TextureLoader changes

Yesterday I’ve done a few changes to the TextureLoader. Please have a look at and check them.

You can see, what I’ve changed when you checkout and synchronize, but to sum it up for short:

There was a “self made” buffering mechanism in the stream loader. It first loaded them into a byte array and resized the array every time it becomes greater than the current avalable size. Well, this is unnecessary, since the next step was to create a ByteArrayInputStream to read from the byte array. I’ve just shorten the way and let this second step read directly from the input stream (well I’ve inserted a BufferedInputStream inbetween).

Further, if a TextureStreamLoader begins to read the first bytes of the stream and decides that the current stream doesn’t contain data loadable by this loader, it returned null, but didn’t reset the stream. I’ve changed this.

The loadTexture method of the TextureStreamLoader didn’t receive the format and mipmap flags as parameters. At least in the TextureStreamLoaderTGA, which I newly added, I needed these parameters. So I added them to the interface, which won’t do any harm to the others.

Marvin

In conclusion, no backward compatibility break, I hope ?

Anyway, one more time, good job :slight_smile:

No. (Of course not ;))

Thanks ;D

By the way, can we make methods to load texture with a color-transparency ? Ex using jpg with a black background and at load time we specify the transparent color is black and it loads with the correct alpha values… Would be fine…

Yes! Cool idea. Please implement this ;D. Maybe it will solve the Q3 transparency problems…

Hmm not too much time for now. Remember me of that later.

OK. I’ll put it on the dev-plan 1.0 and attach you as the developer. ok?

But maybe, when I have focus problems again, I’ll try to do it myself ;).