View Single Post
Old 01-08-09, 08:09 PM   #9
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 28
Uploads: 3
Default

Quote:
Originally Posted by Anvart
Quote:
Originally Posted by skwasjer
Thanks Anvart, this bug was already reported to me a couple of days ago via PM, but I have not found time to release a fix yet. I hope soon though
Thanks.
And ... GWX 3.0 Flag.dat, FlagS.dat ...
When i click on any flag in viewer, S3D gives an error message ...
http://rapidshare.com/files/180468922/flag.dat.html
I did not analyze this file (laziness), but i think it's error (dodge?) GWX-team ...?

Regards,
Alex
I've looked up the problem. The cullprit is the EmbeddedImage of the Egypt_Mil.tga material. While it is valid to some TGA-parsers (including my own one which reads it for the preview in S3D), apparently the native DirectX texture loader (which I use to load textures into GFX card) has problems with it. I've looked up the TGA-specs again and indeed there are two Int16's that should be 0 for this image as it has no color palette (it's 24-bit, non-indexed).

I could work a fix out for it, but in reality the TGA-file is incorrect and as such it doesn't have a priority now, but I'll see what I can do. Perhaps an export and reconversion to TGA in a 2D app is simply all that is needed.

Look up in TGA-header, if 'colormaptype' is 0, then 'colormapstart' and 'colormaplength' should both be 0. Since the 'colormapstart' value was a large negative, the DirectX loader - while it should just ignore the values in this case - must be seeking outside of the stream

Code:
/// <summary>
/// Size of ID field that follows 18 byte header (0 usually).
/// </summary>
public byte identsize;
/// <summary>
/// Type of colour map 0=none, 1=has palette.
/// </summary>
public byte colormaptype;
/// <summary>
/// Type of image 0=none, 1=indexed, 2=rgb, 3=grey, 9=indexedRLE, 10=rgbRLE, 11=greyRLE.
/// </summary>
public byte imagetype; 
/// <summary>
/// First colour map entry in palette.
/// </summary>
public short colormapstart;
/// <summary>
/// Number of colours in palette.
/// </summary>
public short colormaplength;
 
.... the rest of the header left out for simplicity...

Last edited by skwasjer; 01-08-09 at 08:22 PM.
skwasjer is offline   Reply With Quote