This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Doozy of a problem ..anyone can help?(arrays of classes etc)


Doozy of a problem ..anyone can help?(arrays of classes etc)

Postby Codejoy » Aug 26, 2003 @ 7:01pm

Codejoy
pm Member
 
Posts: 34
Joined: Mar 6, 2003 @ 1:41am
Location: New Mexico


Postby Pejo Software - Per » Aug 26, 2003 @ 7:25pm

User avatar
Pejo Software - Per
pm Insider
 
Posts: 343
Joined: Apr 25, 2002 @ 1:00pm
Location: Mölndal, Sweden


Ya

Postby Codejoy » Aug 26, 2003 @ 7:30pm

Ya I figured it was that somewhere, and no I dont like these errors :)

The worse part is, line for line, every piece looks right, even the implementation of the classes, it just so happens that one element on that one array doesnt work (I could see it even if it was like the final element, but the 0th element getting overwritten...how!?)

Like I said, I use to many languages to keep anyone straight, does C++ explicitly require you have a constructor /destructor for your classes, if so I dont know what id put in my constructor for the class...and once code goes out of scope is the destructor called?

plus is there any sort of class memory allocation that needs to be done on an array of instantiated objects?

-Shane
Codejoy
pm Member
 
Posts: 34
Joined: Mar 6, 2003 @ 1:41am
Location: New Mexico


This is too rich.

Postby Codejoy » Aug 26, 2003 @ 7:40pm

Codejoy
pm Member
 
Posts: 34
Joined: Mar 6, 2003 @ 1:41am
Location: New Mexico


Postby Pam » Aug 26, 2003 @ 8:05pm

All the easy problems have been solved.
User avatar
Pam
pm Insider
 
Posts: 449
Joined: Jan 24, 2002 @ 10:30pm
Location: Ohio


Yes

Postby Codejoy » Aug 26, 2003 @ 8:09pm

according to my own code return values, yes indeed the Create and Load are working just fine, they both return success...again in the links at first post is where you can see the inner workings of thsoe methods (they are relativly simple).

The funny thing is after the load, and before the draw i do nothing with m_piece[0]. So somehow is the draw trouncing it? or is there some way for other code to trounce that specific element somehow...this is maddeling frustratingly strange.

-Shane
Codejoy
pm Member
 
Posts: 34
Joined: Mar 6, 2003 @ 1:41am
Location: New Mexico


Postby Pam » Aug 26, 2003 @ 8:21pm

It seems likely it is some other piece of data overwriting part of the m_piece[0] data.

Are you using the GapiApplication class, and if so are you creating and loading the sprites in InitInstance() or in CreateSurfaces()?

If you step through the code, does the Draw fail the very first time the sprite is drawn or after a few times through ProcessNextFrame()?

Pam
All the easy problems have been solved.
User avatar
Pam
pm Insider
 
Posts: 449
Joined: Jan 24, 2002 @ 10:30pm
Location: Ohio


Postby Pejo Software - Per » Aug 26, 2003 @ 8:23pm

User avatar
Pejo Software - Per
pm Insider
 
Posts: 343
Joined: Apr 25, 2002 @ 1:00pm
Location: Mölndal, Sweden


ya

Postby Codejoy » Aug 26, 2003 @ 8:49pm

Last edited by Codejoy on Aug 26, 2003 @ 8:53pm, edited 1 time in total.
Codejoy
pm Member
 
Posts: 34
Joined: Mar 6, 2003 @ 1:41am
Location: New Mexico


Postby Pam » Aug 26, 2003 @ 8:53pm

All the easy problems have been solved.
User avatar
Pam
pm Insider
 
Posts: 449
Joined: Jan 24, 2002 @ 10:30pm
Location: Ohio


*sigh*

Postby Codejoy » Aug 26, 2003 @ 9:08pm

Codejoy
pm Member
 
Posts: 34
Joined: Mar 6, 2003 @ 1:41am
Location: New Mexico


Postby Pam » Aug 26, 2003 @ 9:12pm

All the easy problems have been solved.
User avatar
Pam
pm Insider
 
Posts: 449
Joined: Jan 24, 2002 @ 10:30pm
Location: Ohio


Postby mlepage » Aug 27, 2003 @ 4:20am

www.scalenesoftware.com
Great games for your Palm and Pocket PC!
User avatar
mlepage
pm Insider
 
Posts: 1050
Joined: Aug 3, 2003 @ 4:47am
Location: Canada


Thanks

Postby Codejoy » Aug 27, 2003 @ 2:33pm

hey thanks for that book title, I am new to STL in such a way that basically ive been putting it off for as long as possible, and now with me getting all "classy" I realize that I shouldn't put off the power of it anymore, plus im tired of writing my own linked lists, trees etc :)

I am going to check out that book thanks for the nfo

-Shane
Codejoy
pm Member
 
Posts: 34
Joined: Mar 6, 2003 @ 1:41am
Location: New Mexico


Postby Presto » Aug 27, 2003 @ 2:59pm

Might I recommend:
http://www.pocketmatrix.com/forums/view ... hp?t=10367

And there's an excellent STL tutorial:
http://echellon.hybd.net/issues/5/artic ... part1.html
(as referenced in the thread above)

-John
User avatar
Presto
pm Insider
 
Posts: 763
Joined: Jan 20, 2003 @ 5:51am
Location: Kalesian Archipelago


Next

Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum