Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Pointers n Fun

Author
Message
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 26th Dec 2008 06:24 Edited at: 26th Dec 2008 06:25
I'm having problems when I pass the address of my player object to a pointer parameter in the following function:


The function is called by a function called game(), where my player object is defined locally:


The game compiles and links correctly, and the functions rpgC_Movement, along with the other functions called in Player() work fine, except for rpgC_Animate(). The function is defined as follows:


The character scoots around without animating.

This issue only came up after I started passing my player using pointers rather than keeping it global.

~you can call me lantz~
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 26th Dec 2008 07:35
I can't see any glaring issue with that code, maybe if you posted your constructor for RPGChar it'd be easier to diagnose, it's possible you're just not initializing some variable but it's hard to see. Try using the debugging tools in VS, add breakpoints whenever RPGChar is used and check the stack or something.

chanchan
15
Years of Service
User Offline
Joined: 17th Dec 2008
Location:
Posted: 30th Dec 2008 11:08
what is m_iDir, I don't see any declaration or assignment to this var

Always learning
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 1st Jan 2009 09:24
RPGChar:


RPGChar():


~you can call me lantz~
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 1st Jan 2009 09:40 Edited at: 1st Jan 2009 09:40
I threw in a bit of debug code into my Animate() function:

though my character moves around, the direction is always 2.

looking at Movement():


the rpgC_Up() and etc functions work, but rpgC_SetDir() does not.

~you can call me lantz~
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 3rd Jan 2009 18:59
you all stumped?

~you can call me lantz~
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 3rd Jan 2009 23:25 Edited at: 3rd Jan 2009 23:28
I am. But yeah, I'm having troubles of my own. My game engine suddenly went boom. MS Debugger says all the variables are "Symbol not found" or something.

Could we see the declaration of RPGImage?
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 8th Jan 2009 00:44


~you can call me lantz~

Login to post a reply

Server time is: 2024-11-25 11:50:36
Your offset time is: 2024-11-25 11:50:36