fossil
Core Team
Frungy champion
Offline
Gender:
Posts: 94
|
Planting the normal hyperspace graphics into the Orzspace leaves and ugly red glow around the graphics. A most efficient way of eliminating this would of course to define in something like orzspace.ani that the graphics in orz space use a different color table. ... Where in the .ct files it is defined which number it is?
Actually, you do not need to create an orzspace.ani. Instead, you can just create a new palette for hyperstars.ani to use, a palette that carefully replaces those Hyperspace red hues with whichever hues your Orzspace uses (blue?). You can put this palette into your orzspace.ct. This is best demonstrated with this actual example (but do read the doc meep-eep mentioned and also see my post above about the starting and ending colormap index). It can be confusing: colortable vs. colormap, but we do not have better names for them. A colormap is a 256-color palette, and a colortable is a file containing colormaps.
So on to the example: * ambient.ani uses colormap 53 * hyperstars.ani uses colormap 54 * hyperspace.ct defines colormap 53, but not 54, because hyperstars.ani is only ever used in Hyperspace (Quasispace uses quasispace.ani instead). IIRC, colormap 54 is defined by base/uqm.ct, which also defines most colormaps used in the game, especially the ones that never change. * quasispace.ct also defines colormap 53, but you already know that because you made your own orzspace.ct * the assumption is that you want to use hyperstars.ani in Orzspace and not create a brand new one
How do I know they define colormap 53? Open one of these .ct files in a hex editor and follow the layout with doc/devel/strtab. At offset 0x10 you will find the beginning of the first (and only, in this case) colortable entry. The first two bytes of this entry are the starting and ending colormap indices, which are both 0x35 (or 53 in decimal). What follows is the colormap, 256 * 3 = 768 bytes. Note the size of this entry at offset 0x0c: it is 0x00000302, or 770 in decimal = 2 + 768.
So what you may want to do is make your orzspace.ct define both colormaps 53 and 54. In that case, you leave the starting colormap index 53, make the ending index 54, insert the new colormap 54 at the end of the entry (or in this case, append to the end of the file), and change the size of the entry to account for an added colormap (2 + 768 + 768). When this new orzspace.ct is loaded and activated with SetColorMap(), it will replace colormaps 53 and 54, and your hyperstars will be drawn using the palette you defined. While the legacy name does not suggest so, SetColorMap() can replace more than one colormap.
There is just one catch. Once you load and set orzspace.ct, colormap 54 will be forever replaced in the game. So when you go back to Hyperspace, the stars will have an ugly blue glow around them This will happen because, of course, hyperspace.ct does not define colormap 54, but you already know how to fix that. You will just have to fish colomap 54 out of base/uqm.ct. EDIT: You could also simply save the palette from hyperstars-000.png into an .act file, and that will become colormap 54 for hyperspace.ct. But I do not guarantee that the PNG palette is exactly the same as colormap 54 in uqm.ct. Most of the PNG palettes in UQM graphics are there just so a human could see what a graphic is. Such palettes are not used in the game, and instead the colormaps define the colors, as you probably realized already.
Also, when editing the .png files with photoshop, the 4 kB files always bloat into 50kB+ files after saving.
Make sure that PS does not convert these PNGs to 24-bit color. Some versions of GIMP, for example, are known to clobber the palette, rearrange it randomly, etc., and that can make these PNGs unusable by UQM.
|