Mail Archives: djgpp/1997/08/29/18:04:45
Hi...
I am programming a game using Allegro and I have found a problem that is
driving me nuts.
I use a datafile to store fonts, palettes and the sprites, as these require always
to be in memory.
For the background pictures, I am using normal pcx files and load them as needed
with the load_bitmap or load_pcx function.
The problem is: after some load_bitmap; do_some_stuff; destroy_bitmaps_previously_loaded;
the program displays garbage and the screen is reduced to a 100-200 pixel horizontal bar.
After some tweaking and experimenting, when I removed all load_bitmaps and replaced them
with normal create_bitmap; clear(bitmap); to use a blank screen as background, it works
without a flaw! I think the problem lies with the load_bitmap functions corrupting memory or
something.
I should add, that when I converted all pcx files to lbm files, the program crashes after loading the
second lbm, and this should not happen, as it's almost the same code.
I know what I am. I'm no experienced C programmer, in fact I'm still learning C after too many pascal
years, but I'm desperate for this to work. I have tried almost everything. My apolagies if this is some
stupid newbie error, but I really don't know what else to do.
The game runs in 640x480x256, and all background pictures are in this format.
Thanks.
|| pedro jose' da silva cardoso, garfield / rd
|| pcardoso AT mail DOT telepac DOT pt
|| djgpp - os/2 warp - impulse tracker - gravis ultrasound - demoscene
|| "a sufficiently high level of technology is indistinguishable from
|| magic." -- arthur c. clarke
- Raw text -