Archived

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

TGA Loading Problems

This topic is 5272 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 wrote my my TGA reading engine based off of nehe''s. My engine reads BSPs so I extracted the Quake III pk3 files and had it read a BSP. When ever it reads a BSP it reads most of the images but a few of them will not load with nehe''s code. The error is it cannt find out if its an uncompressed TGA or a compressed TGA. Here is my code and some of the images it couldnt load. They loaded fine in GIMP. Thanks Nuke

Share this post


Link to post
Share on other sites
use your image and rename it and see if it will work with NeHe''s tutorials.

Make sure the images are 24 bit, have a pixil width/height of 2^n. I would look at the images for you but im at work with no picture editor.

Share this post


Link to post
Share on other sites
quote:
Original post by Nukem
The error is it cannt find out if its an uncompressed TGA or a compressed TGA.


I haven''t looked at your code, but it''s the third byte in the file (offset 2) that determins what type of image it is. You can check the Targa spec at wotsit.org for details.

---
Visit Da Shovvkejs.

Share this post


Link to post
Share on other sites
I checked the TGA's on nehe's code. They worked but it looked like when your getting a bad signal on your TV black and white with lines and such. I have stuff check that the width and height is 2^n and that it is 24 or 32 bpp(nehe supports both) the problem still is at were it is determining what kind of TGA image it is. I took thesalmon's suggestion and looked into other types of TGA it might be. I had code that if it cannt determin the type of TGA an error message prints out to console. I added this code in to find out its offset


GLubyte err[12];
memcpy(err, &tga, sizeof(err));
cout << "OffSet\n";
for(int i=0;i<12;i++)
{
cout << (int)err[i] << endl;
}


It prints out 0 0 2 0 0 0 0 0 0 0 0 0. That is the offset for an uncompressed True Color TGA. nehe's lesson is designed for True Color TGA's(compressed and uncompressed). I have no idea what this means.

Please help me.
Thanks
Nuke

[edited by - nukem on July 8, 2003 1:31:32 AM]

Share this post


Link to post
Share on other sites