I'm currently testing my game which will (hopefully) shortly be released on the Smartphone platform. While I have been testing it I have been trying to reduce the memory overhead it causes.
At the moment my game appears to use about 2.5Mb of memory. (I have yet to work out how to measure the memory overhead accurately - any advice welcome.)
This is not an unreasonable amount but it seems a little bit more than many commercial games already out on smartphone.
My first port of call was obviously this forum and I have read that changing the colour depth of PNG images can help. So I did this, changing every single image in my game from the standard 16M/24bit format that PaintShopPro saves them to, to 256Col/8bit.
The file sizes generally reduced (except for really small ones where the palette info obviously has taken up a large percentage of the file size) but the memory overhead seemed to remain absolutely the same.
I have to say I can't quite work out where this 2.5Mb has come from. I have about 70 CGapiSurfaces which are defined as global variables and are on the Stack (is this sensible?). Any surfaces which will not be used in the game again - such as intro splash screens etc - are freed by calling CGapiSurface(0,(DWORD)0,0).
The largest structure I have is a LEVEL struct. Sizeof reports that this is about 50000 bytes - so that seems ok. This is created on the heap using the new operator.
Apart from a few global DWORDs etc the only other major thing I have is a lookup table for sine and cosine values - so thats 2 arrays of doubles (should I be using doubles?) of size 360.
So thats about it. I don't profess in any way to be an expert C++ programmer so I could be making many elementary mistakes - hence all my little questions in brackets!!
If anybody has any general advice for me I would be eternally grateful. I realize what I've written is not particularly detailed but you guys all seem to be pretty clever. (My Mum always used to say that flattery will get you nowhere/everywhere!!)
One more question - in the GapiDraw docs it says a CGapiSurface takes up 64 bytes of memory. Why does sizeof(CGapiSurface) report that it's size is 300?
Anyway, thanks in advance for any help.