Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


8bit to 24bit conversion


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   -  Reputation: 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 -

Sponsor:

#2 a person   Members   -  Reputation: 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.



PARTNERS