View Single Post
Phew... I'll share some Progress without actually editing the OP

Importing the Textures should work now. Took quite some hours and nerves to understand what the problem is, how I find a solution to the problem etc.


A bit of boring Explanation from here on:

Alltogether I kept the Texture Importer for Body Textures because that seemed to work out fine, however to load all Object Textures I now use a .Net assembly which loads the tga into a bitmap first, and then I convert the Bitmap with MemoryStreams into a usable Texture.

I had to research a bit about TGA to understand why it didn't worked and as it seems, the genius inventors of the Targa Image type left 1 bit out of 16 unused. And that led to problems when I tried to load 16bit Textures.
That Means Before I start reading any tga's I first need to check if it's a 32bit, 24 or 16bit TGA as 32bit got an alphachannel and 16bit actually only are 15bit.

Before I could use the new Assembly though I needed another Assembly. Because the TGA Assembly relies on BitMap it needed a System.Drawing.Bitmap and that's where Issue number 2 occured.
The Engine I'm using doesn't officially support that Assembly, the only way to use it was to find and old version of it and after that I needed to change my Project to no longer use .Net subset.

Sounds simple enough but finding out and researching how to actually do all this was a pain.
I also broke all public references after I got System.Drawing.Bitmap into the Project. Had fun putting all Arrays and References back together. Not.

Because there's quite alot going on now when reading all the Textures it takes a couple of seconds to load in a Set with alot of Objects and Textures. Maybe I'll take a look at asynchronously loading Toribash Players so the Program doesn't freeze for a few seconds, but only maybe. That's not top priority



Next up I want to manually support all Toribash Items. They import correctly (atleast Head, Breast, Lumbar and Chest Objects), but they aren't correctly sized and positioned.
Also some UV's are not correctly alligned.