Loading a .TGA using NeHe's Lesson 33
I'm using NeHe's .TGA loading code and have been having some trouble getting correct formats. I have converted my old .BMP pictars into new compressed .TGA images and it seems that half of them don't work. I used Photoshop to convert them (I tried some other online programs but they didn't work either) to targas.
Instead of getting the required 2 or 10 type, I've been getting types 1 or 9, usually depending on what program I used to convert it. Anyone know what the problem is? I'm thinking it's the original .BMP type that is the problem but haven't been able to verify this yet.
*Edit* I converted my old bitmaps from 256 colors to 24-bit colors and they loaded successfully but now half of them just show up as white while the other half are the correct colors.
[edited by - Kaezin on May 8, 2004 5:59:02 PM]
Don''t use NeHe''s TGA loader. It''s given me problems in the past, too. GameTutorials.com''s is good, though.
Do you have any idea what the pictures that don''t seem to load correctly have in common? Make sure that all of your files are either 24 or 32 bit and that the 32 bit files aren''t compressed (I don''t believe the code supports this).
______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________
______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________
Using compressed/uncompressed images doesn't make a difference as I have used both without failure. I'm creating more images so I can try to find similiarities between the ones that work and the ones that don't. I'll check out www.GameTutorials.com though.
*Edit*
Implemented Ben's TGA loader and it worked beautfully, thanks. I think the problem with NeHe's is that it is hardcoded.
[edited by - Kaezin on May 8, 2004 6:30:16 PM]
*Edit*
Implemented Ben's TGA loader and it worked beautfully, thanks. I think the problem with NeHe's is that it is hardcoded.
[edited by - Kaezin on May 8, 2004 6:30:16 PM]
Why not write your own TGA loader? It''s fun and informative. Check out http://netghost.narod.ru/gff/graphics/summary/tga.htm for specifications on the TGA file format (it''s not too dry, it helped me when I wrote mine).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement