Mail Archives: djgpp/1999/01/26/21:22:04
I fixed the problem by making an operator= member function in the class.
It must of been a problem with pointers to ints getting destroyed and
therefore destroying the ints or the BITMAPs etc.
:)
Konstanty
Konstanty wrote:
> 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
- Raw text -