Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


TGA Import Error


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 iwoplaza   Members   -  Reputation: 173

Like
0Likes
Like

Posted 29 May 2012 - 11:22 PM




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.






Edited by iwoplaza, 29 May 2012 - 11:24 PM.


Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 9143

Like
0Likes
Like

Posted 29 May 2012 - 11:26 PM

Ensure that you have a 24 bit RGB or 32 bit RGBA image, no greyscale or color palette.

#3 trotlinebeercan   Members   -  Reputation: 186

Like
0Likes
Like

Posted 30 May 2012 - 12:42 AM

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.
hopper.dustin@gmail.com

#4 L. Spiro   Crossbones+   -  Reputation: 16317

Like
0Likes
Like

Posted 30 May 2012 - 07:25 AM

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, 30 May 2012 - 07:26 AM.


#5 monachus   Members   -  Reputation: 166

Like
0Likes
Like

Posted 01 June 2012 - 01:06 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS