Mail Archives: djgpp/1999/03/09/07:37:12
@elp.rr.com wrote in article <S41F2.5561$UL DOT 233 AT newsr1 DOT elp DOT rr DOT com>...
>
> Paradox wrote in message <7bd1t7$es9 AT chronicle DOT concentric DOT net>...
> >I'm having a problem with destroy_bitmap(). The compiler seems to not
like
> >it when I do the following
> >
> >void dest_proj(void) {
> > int x;
> > for(x = 0; x <MAXPROJ; x++) {
> > if(player_ship.PROJ[x].proj_x > 575) {
> > destroy_bitmap(player_ship.PROJ[x].proj);
> > player_ship.PROJ[x].alive = 0;
> > }
> > }
> >}
> >
> >When the projectile exceeds 575, the program barfs and I get a GPF
error.
> >Proj is a bitmap of sprite_data[BASIC_BULLET].dat. FYI, 575 is the end
of
> >the screen, and I want to destroy the bitmap as it leaves the screen to
> >preserve memory.
> >
> >Thanks
> >Paradox.
I.ve ran into this too - check that MAXPROJ is actually one LESS than the
amount of sprites you have - this is what tripped me up seriously when I
started playing with DJGPP recently. (Experienced guys don't laugh please!)
If you have, say, and array of 50 bitmap pointers
BITMAP *proj_bmp[50];
You must refer to ths bitmap pointer array by looping from 0 to 49, NOT
from 1 to 50, or 0 to 50. Are you sure you are doing this?
--
Spawned By Rylan
Rylan AT intekom DOT co DOT za
http://home.intekom.com/rylan/
Power Overwhelming
- Raw text -