TGA Loading Problems

Started by
2 comments, last by Nukem 20 years, 9 months ago
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
--------------------------Nukemmsn: nukem996@hotmail.comaim: nukem996open source open mind
Advertisement
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.
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.
---Mikael Lax
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]
--------------------------Nukemmsn: nukem996@hotmail.comaim: nukem996open source open mind

This topic is closed to new replies.

Advertisement