Re: 256 colors and Direct3D
It's impossible. You will have to hardcode it.
Re: 256 colors and Direct3D
Or you could use software mode.
If it's really as old school as you say then HWA mode shouldn't be necessary.
Re: 256 colors and Direct3D
Aw, too bad. Software mode works fine on my old PC but on the new it shows some screen tearing, and if I resize it only gets worse. By the way, someone told me it's dual core incompatibility or something, anyone knows about it? Thanks again :*)
Re: 256 colors and Direct3D
If you turn v-sync on you will stop the screen tearing, but you could lose some speed.
Also keep in mind that real 256-colour apps won't work right on Windows 7 if they use the first 32 (IIRC) colours in the palette, as Windows plays with them.
Re: 256 colors and Direct3D
Dynasoft, could you elaborate on that? I've successfully used a full palette on Windows 7 (random testing, nothing serious, but it worked).
Re: 256 colors and Direct3D
I'm not sure of the exact repro steps, but all the old non-MMF2 256-colour games I have will show with technicolour madness unless explorer.exe is killed, due to it forcing the first set of colours to primary colours.
I assumed it was a global issue because it happens to all 256-colour things I've tried. MMF may be immune though...
Re: 256 colors and Direct3D
Thanks. Seems like it. I actually rotated a custom palette at runtime without any issues.
EDIT: Actually, I just remembered that some colors were indeed fixed - but not 32 by far! R,G,B,C,M,Y, black and white IIRC...
Re: 256 colors and Direct3D
I did say "IIRC" (If I Remember Correctly). I guess I didn't.
Apparently in 256-colour mode Windows reserves 20 colours in the palette, the first and last 10 colours: http://en.wikipedia.org/wiki/List_of_software_palettes#Microsoft_Windows_defaul t_20-color_palette
Re: 256 colors and Direct3D
Yes, that's definitely them... more than I remembered. Thanks.
Re: 256 colors and Direct3D
Uhm, Not that I"m an expert or anything but, just because you only want to use 20 colors doesn't mean you have to use a palette or 256 color mode. Just use the 20 colors you want to use and no others! Why make it harder on yourself than you need to?
Re: 256 colors and Direct3D
The reason he wanted to force 256 color mode was to make sure that the alpha effects only used those colors as well.
When you have semi-transparent objects it mixes the colors behind it to give it the semi-transparent look. It'll have to use colors he doesn't want.
Instead of using alpha effects I think it would be better if he used the old school approach and "faked" the semi-transparency by either flashing the object or using the every other transparent pixel method, like Klik & Play's blended gradients. :D
Re: 256 colors and Direct3D
You could use a pixel shader to force the colors into 256 colors :P
(bad idea)