I just want to know, is there a way around memory consumption with pictures. I create my images in paint and then convert it to an array using sebholls converter. But with every new void that i create to do this, it creates a new array with a size of 1024 each. Is there a way around this?
At the moment I'm thinking of just creating a main void called draw_pic, with a number as it's param. Then depending on what the number is it will declare the array with the appropiate data. But i'm not sure if you can declare within a switch statement.
Someones help here would be wonderfull XD
Memory Consumption With Pictures
Started by
Fez
, Feb 01 2008 02:16 PM
4 replies to this topic
#1
Posted 01 February 2008 - 02:16 PM
#2
Posted 01 February 2008 - 05:23 PM
That does not really explain much.But with every new void that i create to do this, it creates a new array with a size of 1024 each.
Can't you keep the image data global?
#3
Posted 02 February 2008 - 12:45 AM
I Tried that, but with every new void that draws it, it wont accept the new data.
Thats everything ive tried with a global array. But the first one says
Then the second one says
What am I doing wrong here XD
const char imgdata[1024];void draw_main_screen(){imgdata = {0xFF ... }// Draw it to screen junk}
const char imgdata[1024];void draw_main_screen(){imgdata[] = {0xFF ... }// Draw it to screen junk}
Thats everything ive tried with a global array. But the first one says
Illegal Token "{"
Illiegal Token "{"
Then the second one says
Illegal Token "]"
Illegal Token "{"
Source file to complex
What am I doing wrong here XD
#4
Posted 02 February 2008 - 01:55 PM
You have to specify the initialization data when the array is declared;
const char myimg[500] = {0xFF, ...}
const char anotherimg = {0xFE, ...}
and so on. Those won't take up space in 'memory', only in the addin.
const char myimg[500] = {0xFF, ...}
const char anotherimg = {0xFE, ...}
and so on. Those won't take up space in 'memory', only in the addin.
#5
Posted 02 February 2008 - 02:24 PM
Oops XD. I meant decrease the size of the addin. I know that with each new array[1024] is declared its adding more to the size of the addin, i think it adds 4056 bytes but im not sure. I have 4 Pics so far and the addin size has just hit over 30000 bytes. How would I decrease this size with so many pictures.
As a last(and i mean VERY last) resort i am going to open the pics up in paint and do a Bdisp_DrawLineVRAM() for every line on the pic. it might just reduce the size XD.
sorry for not being clearer. I'm gonna hafta work on that
As a last(and i mean VERY last) resort i am going to open the pics up in paint and do a Bdisp_DrawLineVRAM() for every line on the pic. it might just reduce the size XD.
sorry for not being clearer. I'm gonna hafta work on that
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users