Posted 01 December 2004 - 03:52 AM
Direct mapping to the palette indeed. For quite a lot of the images in the game, you simply load the palette from another file, and then you just load in the image file and then draw a pixel of the values that you read in onto the screen. In a 256 colour image, this'll map the pixel directly to the current loaded palette. To draw on a higher resolution drawing surface, you'll have to grab the colour information from the palette before drawing it.
The real trick is knowing where to drop down to the next line, and when and where the next image begins.
Like the texture.dat file, that's easy. Each texture is 32x32, so you jump down to the next line after every 32 pixels, and each texture wil be every 1024 bytes (32x32 = 1024). For variable sized images... eh, that might take a bit of experimentation.
This appears true for a number of the image formats, like the geoscape textures, the background images, the intercept window, and the non-English Geoscape control panels.
NKF - finally built a gaming PC in 2020 (though not any of that RGB nonsense). Can now play games up to '89!