I'm trying to make a 640x480 8bit color pacman clone using Allegro. My problem is that the colors are not being displayed correctly if I draw the lime. What could a solution be other than use some other color depth?
Thanks for your help.
This is a discussion on allegro help within the Game Programming forums, part of the General Programming Boards category; I'm trying to make a 640x480 8bit color pacman clone using Allegro. My problem is that the colors are not ...
I'm trying to make a 640x480 8bit color pacman clone using Allegro. My problem is that the colors are not being displayed correctly if I draw the lime. What could a solution be other than use some other color depth?
Thanks for your help.
Not sure if this will fix it, but try set_color_depth(8); Or is that the default?
gcc -lalleg
http://www.ciusa.net/~jrgrant/
I just tried your suggestion and it didn't help.
Try using:
void set_palette(const PALETTE p);
Passing it the same palette you used when loading the bitmaps.
gcc -lalleg
http://www.ciusa.net/~jrgrant/
I am setting the palette after the bitmaps are loaded. also, I created the bitmaps in MS Paint and saved them as the 256 color format. That shouldn't be the problem, right?
I really don't know, sorry. I always use 32 bit graphics. Is there any specific reason it has to be 8?
gcc -lalleg
http://www.ciusa.net/~jrgrant/
There's no special reason to use 8 bit other than to have my game to run almost anyones computer
Try the allegro.cc forums, I am sure someone there could help you.
gcc -lalleg
http://www.ciusa.net/~jrgrant/
Nearly everybody can run at least 16bit color depth so here is a way to get max color depth on everybody's computer...
Btw, I was only doing the filelog stuff because I wanted to see what color depth each computer would be going to.Code:ofstream filelog("log.txt"); set_color_depth(32); if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) == 0) { filelog << "\nset_color_depth(32) initialized"; filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) initialized"; } else if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) != 0) { filelog << "\nset_color_depth(32) failed"; filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) failed"; set_color_depth(24); if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) == 0) { filelog << "\nset_color_depth(24) initialized"; filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) initialized"; } else if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) != 0) { filelog << "\nset_color_depth(24) failed"; filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) failed"; set_color_depth(16); if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) == 0) { filelog << "\nset_color_depth(16) initialized"; filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) initialized"; } else if(set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 800, 600, 0, 0) != 0) { filelog << "\nset_color_depth(16) failed"; filelog << "\nset_gfx_mode(GFX_AUTODETECT_FULLSCREEN 800x600) failed"; } } } filelog.close();
Btw numero dos, I have no idea how effective this really is except that it hasn't failed on me once yet. It may cause problems under certain circumstances; I have no idea.![]()