PDA

View Full Version : SDL color dilema



Almindor
11-05-2005, 08:20 PM
Does anyone know of a fast(CPU wise) way to change the "overall" color of a Surface? I am talking 24 bit surfaces, not some palettized ones. I have 100s of 100x100x24 animations which take roughly 44Mb in RAM when loaded and I need to "recolor" them during runtime(player colors). I've done this by per-pixel changing before but it's darn slow. I need something to change the whole color scheme but something which will ignore the colorkey(transparent color)

savage
12-05-2005, 10:37 AM
It seems my post was lost in the move. The only way I can think of is by changing the palette. Though you may want to rethink how colours are used in the game if it is too slow.

Almindor
12-05-2005, 08:08 PM
Well this is the bottleneck. Sadly I CAN'T go 8 bits. The players themselves could but the backgrounds are too colorful. I don't think 8 bit -> 32 bit blits would be faster than per-pixel recoloring.

cairnswm
16-05-2005, 05:27 AM
GLXtreem has a way of setting a color filter/template before draing a picture that basically allows the conversion of the whole piture to the new color template. I have no idea how it was done but I used it for any color Text when using GLXTreem.