Skip to main content
GameDev.net gamedev.net
🔒 Locked

Release build error!! :-(

Started by MindWipe Apr 9, 2002 at 11:45 AM 6 replies 150+ views
Original Post
MindWipe
MindWipe
I can't run my game in release mode. It runs until one point. I think the error has something to do with pointers. I have a class cPlayer; like
    

cPlayer P[20];

cPlayer *DrawP[10];
cPlayer *TempP;

DrawP[x] = &P[x]; //take all the players that should be drawn


TempP = DrawP[x]; //this is how I use this TempP


//And then I use the DrawP to sort and then draw the players


    
It's not pasted from the code. But it's about the way it's done in It works in debug but not in build What could it be?? /MindWipe [edited by - MindWipe on April 9, 2002 12:46:53 PM]
"To some its a six-pack, to me it's a support group."
MindWipe
MindWipe
Didn''t help

I forgot to say that I call the draw function with the pointers

DrawP[x]->Draw(...);

/MindWipe
"To some its a six-pack, to me it's a support group."
Pyabo
Pyabo
Ah, the infamous release mode crash... works OK with debug build, right? This is commonly caused by buffer overruns. Also, turn off compiler optimizations for release build and see what happens.
The C modest god
The C modest god
I would like to comment that the logical expression you presented can be simplified.

Resist love = 0 OR 1
die = 1 (you gonna die anyway).

Resist love OR die = Resist love OR 1 = 1.

So you could just put the expression 1.
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:
MindWipe
MindWipe
Well.. this is really odd.

I traced the error to a blit. Yup. One blit makes it crash.

I have a Player.Draw(...)
that blits a shadow, the players legs, body and head (4 blits)
And it''s when I blit the legs it crashes!!

It works in debug. And how the hell could this cause a crash?


  
bool cGfx2d::Blit(int x, int y, DWORD Sprite, RECT *rcSrc)
{
HRESULT hr;

if(sprite[Sprite].Allocated == false) return false;
if(lpDD == NULL) return false;
if(Sprite == NA) return false;

//seems okey - let''s blit

hr = lpDDSBack->BltFast(x ,y, sprite[Sprite].Surface, rcSrc, DDBLTFAST_SRCCOLORKEY);

//Don''t detect other errors. They won''t bother us

if(hr == DDERR_SURFACELOST)
{
LOG("[GFX::Blit] Error Surface Lost %s\n",sprite[Sprite].FileName);
return false;
}

return true;
}


That''s my blit

/MindWipe



"To some its a six-pack, to me it's a support group."
MindWipe
MindWipe
Taced the error even closer. It''s one surface that makes it crash. If I use the same parameters except for the surface it works. How can that be?

/MindWipe

"To some its a six-pack, to me it's a support group."
MindWipe
MindWipe
PHEW!!!! Found the error.

It was when it loaded the legs-surfaces.

I had writeen:


  
char ImageToLoad[16];

memset( ImageToLoad, 0, sizeof( ImageToLoad ) );
sprintf( ImageToLoad, "PlayerGFX\\legs%d_%d.bmp", a + 1, b + 1 );
Legs[a]http://[b] = Gfx()->LoadSprite( ImageToLoad, ck );



16 characters isn´t enough. But it seemed to work in debug still.
But now it's fixed!

Damn this is GRRRRRRRRRREAT

/MindWipe




[edited by - MindWipe on April 10, 2002 10:48:10 AM]
"To some its a six-pack, to me it's a support group."

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.