RTS character color questions...

Started by
1 comment, last by NeptuneKul 22 years, 2 months ago
I know it''s through palette to change the colors of different players. Let''s say the game is going to run under 16 or 24 bit mode, the bitmaps are 256 color with 8 bit palette table, one object with one bitmap and with the standard palette table, all the other 7 colors of the same object need to change the palette dynamically. All my offscreen surfaces should also be 16 or 24 bits right? How to blit those offscreen surfaces to the primary surface with different colors? Must I store all the 8 colors of the same object to 8 different offscreen surfaces? If I made any wrong assumption, just point me out.. Thank you!
Advertisement
For directdraw your best bet would be to use 8 bit surfaces and write a custom blit routine that replaces the color you use for these pixels with the player color (best written in asm).

If you were willing to use dx 8 then you could load 8 bit textures and modify the texture palette to get the appropiate effect (D3DDevice::SetTexturePalette or something like that). Change the entry you use to the appropiate player color for each blit maybe sort them by player.
As I mentionned earlier, do like a lot of RTS did, use a different textures for each side colors. No hassle.

This topic is closed to new replies.

Advertisement