• Advertisement

Archived

This topic is now archived and is closed to further replies.

Loading a .TGA using NeHe's Lesson 33

This topic is 5039 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
Don''t use NeHe''s TGA loader. It''s given me problems in the past, too. GameTutorials.com''s is good, though.

Share this post


Link to post
Share on other sites
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
______________________________________________________________

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Type 1 and 9 are color-mapped images whereas 9 is also RLE-compressed.

Share this post


Link to post
Share on other sites

  • Advertisement