Sign in to follow this  

sending out an allegro project

This topic is 4668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to build a project and send it out so that the person receiving it doesn't have access to the .bmp files and fonts used? Like all they get is an .exe and everything is built into that? if so, how do you do that? [pig]

Share this post


Link to post
Share on other sites
Allegro has datafiles which you use to store game resources. You can read about it in the documentation. Once you use datafiles, the user can't access your bitmaps and such.

Share this post


Link to post
Share on other sites
and ALSO...i'm loading a .bmp (this is allegro still) that has two colors, transparent (pink) and black...but when I use it in my program, the black has switched to a dark green. I'm sure this is a palette problem but I have no idea how to fix it

Share this post


Link to post
Share on other sites
In Allegro, colour index 0 is used for masked colours. It is also usually used for black, since the screen's border ends up being the same as colour index 0 in full screen. As a result, when it tried to convert your bitmaps to use the global palette, it can't use black because that would make all the black parts transparent, so it uses the next closest colour.

You options are:
1: Don't use 8-bit colour.
2: Rearrange the palette so black isn't at index 0. This might result in your screen getting a funny coloured border, though.
3: Create two entries for black, and create a custom colour conversion table that will map #ff00ff to index 0, and #000000 to the second index for black.
4: If you're not using masking, create a custom colour conversion table that treats #ff00ff like it would any other colour.

Share this post


Link to post
Share on other sites
Hey...thanks, I got it loaded into a datafile. But NOW the pink transparent color shows up as solid pink instead of transparent. How do I set a transparent color on a bitmap loaded from a datafile?
Before I embedded it in the datafile, it worked correctly.

Share this post


Link to post
Share on other sites
that worked. I just had to set the color depth. now how about this one (a minute ago it was working but now it won't)
When you press space, I want to switch between which of two messages are displayed. Here's my code:

const char *messages[2] = {message1,message2};
int mindex=0;

while(!key[KEY_ESC])
{
if(key[KEY_SPACE]){ mindex++; }

textout_centre(buffer,myfont,messages[mindex%2],SCREEN_W/2,400,color2);

blit(buffer,screen,10,10,10,10,SCREEN_W,SCREEN_H);
}



The problem is that it stays on message1 no matter how many times I press space.

Share this post


Link to post
Share on other sites

This topic is 4668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this