Jump to content
  • Advertisement

Aidamina

Member
  • Content Count

    126
  • Joined

  • Last visited

Community Reputation

100 Neutral

About Aidamina

  • Rank
    Member
  1. Aidamina

    [web] AJAX and images

    Ok im not sure if i understand exactly what your trying todo but maybe this will help. Note 1: the ....... refers to unrelevant html tags or javascript code Note 2: you should implement the AJAX in a way that it calls the thisFunctionIsCalledWhenAjaxTellsYouThatTheImageHasToChange() function <html> <head> <script lang="javascript"> ...... function thisFunctionIsCalledWhenAjaxTellsYouThatTheImageHasToChange() { var img = document.getElementById('myimage'); img.src='state2.gif'; alert('I changed the image, yey!'); } ..... </script> </head> <body> ...... </img id="myimage" src="state1.gif"> ...... </body> </html> Sorry if this wasnt what you were trying todo.
  2. \n works, but not in notepad. Try opening the file in something like wordpad and you will notice the newlines, if you want to fix this problem use \r\n (windows linebreak)
  3. Aidamina

    Pointer problems

    Any suggestions? Its supposed to be a callback with result; Cant i just return the result directly and ifso how do i turn that into void * Thank you
  4. Aidamina

    Pointer problems

    Below is the implented code. ret in the call function has a correct value in the local scope but it should have a value when it returns aswell if RT is a pointer right? class ICallback { public: virtual void * Call()=0; }; template<class C,typename RT> class Callback : public ICallback { private: C* m_pClass; RT (C::*m_pMethod)(); public: Callback () { m_pClass = 0; return; } Callback (C* pClass, RT (C::*pMethod)()) { m_pClass = pClass; m_pMethod=pMethod; return; } void SetClass(C* pClass) { m_pClass = pClass; return; } void SetMethod(RT (C::*pMethod)()) { m_pMethod=pMethod; return; } void * Call() { RT ret = (RT )((m_pClass->*m_pMethod)()); return &ret; } };
  5. Aidamina

    Pointer problems

    Well the think is that it should no only return float this was just an example, i want to return an object aswell so it should be some kind of universal pointer.
  6. Why doesnt this work? And what do i need todo to make this work float test() { return 0.1337; } void * Call() { return (void *)&test(); }
  7. Thx a lot for your time and effort i think i get it now.
  8. Aidamina

    exact number from string

    This is certainly possible The below code puts the name of the variable to a char * nullterminated string, its easy to substract the last part of the string, i think you can figure that out by yourself if not give a holla. //magic macro #token is the string representation of the variable name #define vartostring(token) #token //in your app (example how to use the macro) int test=0; char * testname = vartostring(test); printf("%s",testname); Output test Have fun
  9. Yeah i used the system you just explained before i was trying the callback, but some jobs can have subjobs in the same class which use different functions. thats why i want to use function pointer and BOOST in NOT an option
  10. Thx CTAR Let me describe what im try to make. I have a workclass that is handling several jobs. the workingclass has a vectore which hold all these jobs. something like this: class Job { functionpointer DoWork(); functionpointer Finished(); }; this is just some pseudo code but will give you the idea what im trying to accomplish. functionpointer should be a pointer to anypoint in my engine (managed c++) and im not able to use boost in this engine for reasons i will not sum up here. the first pointer is called todo a part of the job. the second one is called when the job is complete. Thx
  11. CTar I did put down what i wanted: Quote:What the correct way of setting this to a class'/ any class' member. No need to derate me for that... Could you deliberate a bit more on that template class. template<typename RT,typename T> RT Call( T& owner, RT (T::*ptr)() ) { return (owner.*ptr)(); } What does the RT represent? and could you show me how to use this, like an example? Thx
  12. Thats not what i asked mate and dont point me to that site already been there. It needs to store a pointer which can reference to any class' member!
  13. OK heres the deal, i trying to make a callback to a function in a class, but i cant get it working. typedef double(*FuncCallback)(double); FuncCallback fcb; fcb=?? What the correct way of setting this to a class'/ any class' member. Thx, Aidamina
  14. Aidamina

    Help me analyze this...

    Hi, Its hard to say what the problem is. Assertion errors are not really related to a specific problem. The Array.h file designation isnt very helpful either because its probably some Array modification, maybe a custom vector i dont know, but no clear hint there either. Hope ArenaNet can help you mate Greetz, Aidamina
  15. Aidamina

    Physics & Networking

    The only variables that really matter are position x,y(,z), velocityvector and rotation vector, and maybe some other stuff like car type etc. To make this look fluid use interpolation or put the external cars in the same ode physics system and correct the position with data received from the player. Sorry if this wasnt very helpfull.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!