From: Konstanty Newsgroups: comp.os.msdos.djgpp Subject: Questions about DJGPP + Allegro Date: Wed, 27 Jan 1999 10:17:38 +1000 Organization: University of Queensland Lines: 46 Message-ID: <36AE5B21.9BEE6CC0@mailbox.uq.edu.au> NNTP-Posting-Host: csmbialk.staff.uq.edu.au Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en,pl To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I have a game that I am making that keeps crashing. I know that something is corrupting memory but I'm not sure what. The program usually crashes when it tries to draw a BITMAP whose pointer has been stuffed up. How do I check whether a BITMAP * is really a bitmap. The BITMAPs are inside a array of Buttons (which is initilised with 'new'). The Buttons cantain information about thier location (4 ints) and the bitmaps. The locations of the first 5 seem to be filled with information from the bitmap (The bitmap is a 16-bit bitmap). 0. (537996,189548)-(189548,1331464) 1. (1333704,1333864)-(1334024,1334184) 2. (1337384,1337544)-(1337704,1337864) 3. (1341064,1341224)-(1341384,1341544) 4. (7,175)-(85,255) 5. (90,175)-(170,255) 6. (5,260)-(85,340) 7. (90,260)-(170,340) The array of locations should be: 0. (5,5)-(85,85) 1. (90,5)-(170,85) 2. (5,90)-(85,170) 3. (90,90)-(170,170) 4. (5,175)-(85,255) 5. (90,175)-(170,255) 6. (5,260)-(85,340) 7. (90,260)-(170,340) Also does anyone have any suggestions on how I can debug this program? I currently am using a log file using fopen, fprintf and fclose. When the program crashes it only saves up to the last fclose. How can you make it close the file before it exits. I have tried an atexit routine - but it doesnt work. I can supply some code if that is needed as well. Konstanty