Is there any convenient way fadeout screen to darkness?

Login to reply to this topic.
Tue, 2003-04-01 02:08
Joined: 2003-04-01
Forum posts: 37
thanx for any info  Tongue

ouseka


Tue, 2003-04-08 18:31
Joined: 2003-04-03
Forum posts: 31
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 Smiley

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

Wed, 2003-04-09 02:46
Joined: 2003-04-01
Forum posts: 37
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:

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] >> Cool & 0xf;
    TInt8 g_4bits = (ptr[i] >> 4) & 0xf;
    TInt8 b_4bits = (ptr[i] >> 0) & 0xf;
    ptr[i] = ((r_4bits * alpha / 0xf) << Cool | ((g_4bits * alpha / 0xf) << 4) | (b_4bits * alpha / 0xf);
}

But this runs very slowly Sad

Can you explain your "virtual palette"? tnx very much!

BR, ouseka

ouseka

Wed, 2003-04-09 06:32
Joined: 2003-04-03
Forum posts: 31
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.

Did this make it clearer?

zeep

zeep

Thu, 2003-04-24 16:01
Joined: 2003-04-01
Forum posts: 9
Is there any convenient way fadeout screen to darkness?
well in fact only your palette will change ...
Fri, 2003-04-25 07:10
Joined: 2003-04-01
Forum posts: 37
Is there any convenient way fadeout screen to darkness?
what does you mean?

ouseka

Fri, 2003-05-09 11:37
Joined: 2003-04-01
Forum posts: 9
Is there any convenient way fadeout screen to darkness?
65536colors is 16bits. And in 4096 colors mode already 16bits/pixel are used. So only the content of your palette will have to be changed.
  • Login to reply to this topic.