Is there any convenient way fadeout screen to darkness?
Get the bitmap data you want to fade out directly using the CFbsBitmap->DataAddress method. In 12 bit Series 60 devices high-color bitmap have a 444-Pixel format. The first 4 bits are just 0.
It should be quite easy to scale these pixel values down to 0. There's just some bit-masking magic involved
In my project I am using "virtual paletted" 8 bit bitmaps which are converted to 12 bit in the final copy-to-screen pass using a look-up table. There you can just change the palette table to fade in/out.
I would not call that a convenient way but it seems that there is no other to do this...
Is there any convenient way fadeout screen to darkness?
Quote from: zeep
...
In my project I am using "virtual paletted" 8 bit bitmaps which are converted to 12 bit in the final copy-to-screen pass using a look-up table. There you can just change the palette table to fade in/out.
...
Thanx for your help, but I can't understand your concept "virtual paletted". I only know code like below:
Is there any convenient way fadeout screen to darkness?
Hi!
All my game bitmaps are in 8 bit format (e.g. TUint8*). Each value (0-255) is mapped to a 12 bit rgb-value. In the final output pass I am using an output table to do the conversion. Look at this:
TUint8* myGameBitmap; // 8 bit game colors TUint16 myPalette[256]; // 12 bit palette in here TUint16* outputBitmap = out->DataAddress(); // CFbsBitmap (12 bit)
for (int i=0; i<176*208; i++) { outputBitmap[i] = myPalette[myGameBitmap[i]]; }
So all colors can be changed by manipulating the myPalette array, and it's fast too because we save a lot of memory bandwidth in the sprite blitting routines, etc.
The downside with this is that by using a custom data format, all blitting routines have to be written by yourself. It took several days to create conversion tools that create a master palette out of several bitmaps etc.
One downside is that some newer devices (Siemens SX-1?) support 64k colors and probably are using another data format. So I will have to choose different copying routines, depending on the device.
Forum posts: 31
In 12 bit Series 60 devices high-color bitmap have a 444-Pixel format. The first 4 bits are just 0.
It should be quite easy to scale these pixel values down to 0. There's just some bit-masking magic involved
In my project I am using "virtual paletted" 8 bit bitmaps which are converted to 12 bit in the final copy-to-screen pass using a look-up table. There you can just change the palette table to fade in/out.
I would not call that a convenient way but it seems that there is no other to do this...
zeep
Forum posts: 37
In my project I am using "virtual paletted" 8 bit bitmaps which are converted to 12 bit in the final copy-to-screen pass using a look-up table. There you can just change the palette table to fade in/out.
...
Thanx for your help, but I can't understand your concept "virtual paletted".
I only know code like below:
const TInt8 alpha = 0x7; // 0x0 - 0xf
TUint32* ptr = aFbsBitmap->DataAddress();
TInt w = aFbsBitmap->SizeInPixels().iWidth;
TInt h = aFbsBitmap->SizeInPixels().iHeight;
for (TInt i=0; i<w*h; i++) {
TInt8 r_4bits = (ptr[i] >>
TInt8 g_4bits = (ptr[i] >> 4) & 0xf;
TInt8 b_4bits = (ptr[i] >> 0) & 0xf;
ptr[i] = ((r_4bits * alpha / 0xf) <<
}
But this runs very slowly
Can you explain your "virtual palette"? tnx very much!
BR, ouseka
ouseka
Forum posts: 31
All my game bitmaps are in 8 bit format (e.g. TUint8*). Each value (0-255) is mapped to a 12 bit rgb-value.
In the final output pass I am using an output table to do the conversion.
Look at this:
TUint8* myGameBitmap; // 8 bit game colors
TUint16 myPalette[256]; // 12 bit palette in here
TUint16* outputBitmap = out->DataAddress(); // CFbsBitmap (12 bit)
for (int i=0; i<176*208; i++) {
outputBitmap[i] = myPalette[myGameBitmap[i]];
}
So all colors can be changed by manipulating the myPalette array, and it's fast too because we save a lot of memory bandwidth in the sprite blitting routines, etc.
The downside with this is that by using a custom data format, all blitting routines have to be written by yourself. It took several days to create conversion tools that create a master palette out of several bitmaps etc.
One downside is that some newer devices (Siemens SX-1?) support 64k colors and probably are using another data format. So I will have to choose different copying routines, depending on the device.
Did this make it clearer?
zeep
zeep
Forum posts: 9
Forum posts: 37
ouseka
Forum posts: 9