🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

allegro color masking*solved*

Started by
7 comments, last by raptorstrike 19 years, 11 months ago
i saved some bit maps as 32 bit maps and when i display them via grabber threw blit((BITMAP *)datafile[building_red].dat, screen, 0, 0, 64, 64, 10000, 10000); it dosent mask the (RGB(255,0,255)) color do i need to call a function to activate this or do i need to compile there bitmaps as sprites? [Edited by - raptorstrike on September 2, 2004 9:52:49 PM]
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
Advertisement
Well, you need to use masked_blit() or else draw_sprite().. and also, is your image really 10,000 x 10,000 pixels? That's huge...

Good luck,
oo ok i just did that to render the whole thing i was just messing around seeing what each number did ill fix it thx for your speedy response
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
umm i did the whole masked_blit thing and it gives me an image that is totaly meesed up its just a bunch white lines
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
Are you setting your game's color depth to 32 via set_color_depth()?

Jesus saves ... the rest of you take 2d4 fire damage.

i just put set_color_depth in the main function near the begining and it still dosent render properly heres my source

#include "main.h"#include "allegro.h"int main(int argc, char *argv[]){   DATAFILE *datafile;   char buf[256];   allegro_init();   install_keyboard();    if (set_gfx_mode(GFX_SAFE, 320, 201, 0, 0) != 0) {      set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);      allegro_message("Unable to set any graphic mode\n%s\n", allegro_error);      return 1;   set_color_depth(32);   }   /* we still don't have a palette => Don't let Allegro twist colors */   set_color_conversion(COLORCONV_NONE);   /* load the datafile into memory */   replace_filename(buf, argv[0], "datafile.dat", sizeof(buf));   datafile = load_datafile(buf);   if (!datafile) {      set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);      allegro_message("Error loading %s!\n", buf);      return 1;   }   /* select the palette which was loaded from the datafile */   set_palette((RGB *)datafile[THE_PALETTE].dat);   /* aha, set a palette and let Allegro convert colors when blitting */   set_color_conversion(COLORCONV_TOTAL);      /* display the bitmap from the datafile */   textout(screen, font, "This is the bitmap:", 32, 16, makecol(255, 0, 255));     masked_blit((BITMAP *)datafile[building_red].dat, screen, 0, 0, 64, 64, 41, 41);         /* and use the font from the datafile */  // textout(screen, datafile[BIG_FONT].dat, "And this is a big font!", 32, 128,//	   makecol(0, 255, 0));   readkey();   /* unload the datafile when we are finished with it */   unload_datafile(datafile);   return 0;}END_OF_MAIN();


[Edited by - raptorstrike on August 30, 2004 4:21:43 PM]
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
never mind the palette isnt the problem i just dont know what is dose is have to do with me being in safe mode?????????
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie

GFX_SAFE is really for emergency use only.

try GFX_AUTODETECT

or GFX_AUTODETECT_WINDOWED or GFX_AUTODETECT_FULLSCREEN if you want to force a type of resolution.

Hope that helps.
:)
hmm its still not looking right i would try and post an image but i dont know how
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie

This topic is closed to new replies.

Advertisement