In Allegro 5, al_draw_tinted_bitmap can't do the job. Drawing a filled rectangle is rather ugly, because the original sprite is not a rectangle.

I have read the al_set_blender documentation as well as other "Most helpful discussions" on al_set_blender page.If I understand correcly, I would need to:1. First draw the source bitmap on destination2. Then set a blender to add{1,1,1,0} (Full White) and draw the result multiplied by {r,g,b, litLevel} on the destination. This way, draw a 50% red light corresponds to {r,g,b,litLevel} = {1,0,0, 0.5}

I would simply draw the red or white bitmap over the first at 50% transparency. In my own game I use al_draw_tinted_bitmap(bitmap, al_map_rgb_f(.5, .5, .5), x, y, 0); to draw something at 50% transparency.

I would simply draw the red or white bitmap over the first at 50% transparency. In my own game I use al_draw_tinted_bitmap(bitmap, al_map_rgb_f(.5, .5, .5), x, y, 0); to draw something at 50% transparency.

Hmm when you say "the red or white bitmap", are you assuming that I must store 3 copies or the bitmap (the original, a full red one, and a full white one)?This is not the case for me: the original is loaded from a file, and I won't create file copies corresponding to each possible lit color for each sprite.

NiteHackr said:

I also have the following settings for my game which would effect this...al_set_new_bitmap_flags(ALLEGRO_MAG_LINEAR);

ALLEGRO_MAG_LINEARWhen drawing a magnified version of a bitmap, use linear filtering. This will cause the picture to get blurry instead of creating a big rectangle for each pixel. It depends on how you want things to look like whether you want to use this or not.

I don't see the point. Could you please explain?

NiteHackr said:

al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA);

Is this the way you can specify to display a red "version" of the sprite?

Really, shaders are the way to go, because to 'light' your sprites you need to draw a light source over the top of them. One way is as NiteHackr suggests, to draw a light mask / map over your sprites. The second way is to use a shader, which you can set up to blend specified light levels with your sprites.

Ah, okay, you weren't very clear on what you wanted to do. But if you're sprites are not going to be that big, I don't know why you are worried about there being copies of them. You're not programming for DOS on an 8bit machine anymore. My video card alone has 2gigs of RAM which is more than enough for most graphics, they really don't take up that much space, especially smaller ones so I couldn't jump through hoops to limit numbers like that.

For my own game I have a circle I use for different spawns, I made it a white one with some alpha for the transparent areas, then I can set the colour using Allegro. I use the MAG_LINEAR stuff because then I can adjust my sprite sizes for any resolution monitor and they will still look nice. These days that is a breeze for all video cards anyhow, even cheap ones.

I would redesign how you plan to display them to make things simpler. Shaders would work, but if you are having a difficult time with the simple commands I laid out, than I wouldn't suggest going anywhere near shaders just yet.

What you could do is just make a shaded white sphere, then when you draw it, set the colour to whatever you wish and it will be drawn that colour using a tinted sprite. This way you're using one sprite and you can make it any colour you wish at runtime.