Jump to content
  • Advertisement
Sign in to follow this  
iwoplaza

TGA Import Error

This topic is 2185 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

[color=#888888][font=arial, sans-serif]

[background=rgb(245, 245, 245)]


[color=#333333]

I have a problem with importing and loading TGA images.
I used the tutorial:http://nehe.gamedev.net/tutorial/loading_compressed_and_uncompressed_tga's/22001 /

I Export files with GIMP

I have the error:

TGA file be type 2 or type 10

Thanks in advance.




[color=#444444][size=2][/background][/font] Edited by iwoplaza

Share this post


Link to post
Share on other sites
Advertisement
I had this problem initially when I started to use TGA images for textures.

http://www.organicbit.com/closecombat/formats/tga.html
http://tgalib.sourceforge.net/api/r28.html

I believe that tutorial may be old, check the listed resources and try updating your header format to best resemble the examples from the resources.

You can double check by simply printing out the variables to double check what is saved in each variable matches what you have in GIMP. By default, I recommend using 32bit RGBA export settings.

Share this post


Link to post
Share on other sites
Type 2 is raw data and type 10 is run-length encoded data.
Now you need to handle indexed data, black-and-white data, and true-color data.
Read the TGA specifications to find out how.


L. Spiro Edited by L. Spiro

Share this post


Link to post
Share on other sites
What do you need it for? This is a good opportunity to read the TGA spec and implement a very simple reader that suits your needs.
In my case, some time ago I needed a TGA loader for a simple arcade game. I implemented a simple, small reader that only read 24bit uncompressed images that I had exported from GIMP. Good enough for my needs and I was a better programmer when I finished.

Read the spec, you will learn a lot and you will have a lot more fun because you will have understanding.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!