DOS Games Message Board
DOS Games Discussion
A message board to talk about DOS games, get help, and find old games.
Do NOT post warez or abandonware requests please
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


My own DOS Game Library

 
Post new topic   Reply to topic    DOS Games Discussion Forum Index -> Game Creation
Author Message
Crunchy
Newbie
Newbie


Offline
Joined: 21 Mar 2008
Posts: 4

PostPosted: Fri Mar 21, 2008 6:00 am     Post subject: My own DOS Game Library Reply with quote

Hi everybody,

at the moment, i'm developing my own DOS Game Programming Library using GCC from DJGPP. I've just implemented a sprite system and it works fine. But now I want to create an array of sprites and it just crashes. The problem's described better here : http://djdamy.speed-codings.de/problem.rtf

thanks in advance!
Crunch
Back to top
MiniMax
Expert
Expert


Offline
Joined: 25 Jan 2007
Posts: 149
Location: Stockholm, Sweden

PostPosted: Mon Mar 24, 2008 6:41 am     Post subject: Reply with quote

Crunchy -can't you try to isolate the part that is causing the error? Like uncommenting most of the body in CreateSpriteSet() and see if it still crashes? Then re-enabling the initialization part, but leave the for-loop de-activated? After a while you should be able to tell which part of the code that is causing the problem.

You could also try to run the code outside of DOSBox. Maybe the error message will be different, telling you something new?
Back to top
Crunchy
Newbie
Newbie


Offline
Joined: 21 Mar 2008
Posts: 4

PostPosted: Mon Mar 24, 2008 7:37 am     Post subject: Reply with quote

Well, i already isolated it. It's the part in which I access the bitmap memory of the sprite with DrawBitmap. This error is so confusing because it works with this -> "Sprite MySpr;" but not with "Sprite Sprites[ x ];" - Where's the difference between when i hand over "MySpr" and "Sprites[ 0 ]" to the function? They're both Sprite-structs right?

And without the DOSBox it doesn't work on my computer.

If anyone has a older computer and would test it for me - that would be great Happy

http://djdamy.speed-codings.de/mode13.rar

Thanks in advance!
Crunchy
Back to top
MiniMax
Expert
Expert


Offline
Joined: 25 Jan 2007
Posts: 149
Location: Stockholm, Sweden

PostPosted: Mon Mar 24, 2008 8:25 am     Post subject: Reply with quote

Ahh - the joy of C and pointers, always giving the programmer enough rope to hang himself Happy

I don't know how good/recent this DJGPP compiler is. I would try to compile, not run, just compile the code using some other compiler, with all the warning flags and strict compliance flags you can throw at it. Maybe that will throw up enough warnings to tell you what the difference is.
Back to top
Crunchy
Newbie
Newbie


Offline
Joined: 21 Mar 2008
Posts: 4

PostPosted: Mon Mar 24, 2008 12:04 pm     Post subject: Reply with quote

well actually its a c++ compiler...it's a little confusing, i thought it was C at first. In the DJGPP package, there are 2 compiler. A C and a C++ Compiler. At first i used the C compiler but i just got a lot of errors i didn't understand. So i just decided to try the other one and it worked ^^

Do you know which one i should try?
Back to top
MiniMax
Expert
Expert


Offline
Joined: 25 Jan 2007
Posts: 149
Location: Stockholm, Sweden

PostPosted: Mon Mar 24, 2008 1:29 pm     Post subject: Reply with quote

I think the answer to that is evident: The one that gives you the fewest errors. Do you compile with -Wall ?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    DOS Games Discussion Forum Index -> Game Creation All times are GMT - 5 Hours
Page 1 of 1

 
Free Windows games


Powered by phpBB © 2001, 2005 phpBB Group and Ask an Expert
Also powered by Darren and the other admin and mods' hard work! ;)