Rodrigo 'r2d2rigo' Diaz wrote:
Hi, I want to load a SPR file to use it as a texture in one OpenGL
program. I have based my code from the one in sprgen.c. For testing,
I'm using a single frame 256*256 sprite, and I follow this order for
reading the data:
-1 struct dsprite_t (sprite header)
-1 short (# of palette indexes - 256)
-256 bytes (colours of the palette indexes)
-1 struct spriteframetype_t (frame type - single or multiple)
-1 struct dspriteframe_t (sprite frame header)
-dspriteframe_t->height*dspriteframe_t->width bytes (height*width
bytes - sprite frame data)
And then I create the texture with glTexImage2D. The problem is the
final texture gets messy; did I miss something? Is there any
documentation about SPR file format?

I'm not sure whether this was a typo, but the palette is actually 256*3 bytes (red, green and blue).

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Reply via email to