PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

SaveImage

BurningSheep · 02 Nov 2002, 02:49 UTC
I'm getting an assertion failed on this line:

Code:

assert( ((surface->GetWidth() * sizeof(Pixel))&3)==0 );


Is this supposed to happen? It doesn't complain when I make the surface width divisible by 2.

btw, you forgot to fix those 2 memory leaks (in pocketpc.cpp). I thought I made the mem leaks myself so instead of first grabbing the debugger. I went through all of my code only to find out it wasn't in my code but in the PocketFrog lib =]
What memory leaks? I don't remember them...
BurningSheep · 02 Nov 2002, 12:51 UTC
In PocketPC.cpp:

Code:

DisplayDriver* l_displayDriver; //fixme: leak at exit
InputDriver* l_inputDriver; //fixme: leak at exit
Yeah... Well these two leaks really don't matter. The thing is that I am reworking the low-level stuff and there is no point in "fixing" this.

Thanks for noticing though.


Concerning the SaveImage() thing, this is because a bitmap needs to have dword-aligned pixel rows. The SaveImage() function assumes the surface is already dword-aligned (even number of pixels). I guess SaveImage() should be updated for odd number of pixels.
BurningSheep · 03 Nov 2002, 18:05 UTC
yah no biggie, they aren't accumulating and should get automaticly deallocated by the OS at program exit.

And I just make my surfaces one pixel wider if the width turns out to be uneven =]