Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

8bit to 24bit conversion

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 brewknowc   Members   

122
Like
Likes
Like

Posted 26 January 2002 - 05:21 AM

I am trying to take the demo chapter 8_11 (scrolling tile demo) and make it 24 bit. I changed the globals, and made a 24 bit image. The program runs, but each image looks like 1/9 the tilesize (64 x 64). Now I assumed this was because in 24 bit there is 3 times the info of an 8 bit file, but found no where to compensate for this. I came to the conclusion that the create_bob function was making the correct size ddsurfaces, but the load_frame_bob, was not loading the 24 bit images correctly into the surface. If anyone can help me understand what the problem is I would appreciate it. Thank You Bruno - Free Your Mind -

#2 a person   Members   

118
Like
Likes
Like

Posted 26 January 2002 - 12:15 PM

1. nobody will know what the demo chapter 8_11 is from, nor what the functions do unless they read the things you have. case in point i have no idea what you are talking about.

2. conversion of 8bit to 24bit is quite simple. in fact so simple i will show you right here.

      
// WARNING: this is PSUDEO code

// it assumes thet you understand:

// the 24bit format

// 8bit format

// how to plot/read pixels in both

// if not then you porbally should learn that first.


for(y=0; y<height; y++)
for(x=0; x<width; x++)
{
colorIndex = Image8bit.pixels[x+y*pitch];
Image24bit.pixels[x+y*pitch].red = = pallete[colorIndex].red;
Image24bit.pixels[x+y*pitch].grn = = pallete[colorIndex].grn;
Image24bit.pixels[x+y*pitch].blu = = pallete[colorIndex].blu;
}

// that is the basics of going from 8bit to 24bit.



Edited by - a person on January 26, 2002 7:19:19 PM

Edited by - a person on January 26, 2002 7:21:06 PM




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.