Game Development Community

Why limit png's to 1024 pixels in TSE but not TGE?

by Stefan Lundmark · in Torque Game Engine Advanced · 06/09/2006 (12:52 pm) · 3 replies

As the title says, why is this?

I tried to port our old GUI from TGE to TSE and the engine spat out this error:

Quote:
Error, cannot load pngs taller than 1024 pixels!

I find it illogical that TGE has no limit but the next-gen engine TSE does.
One would assume this kind of stuff to be the same between the two engines, or at least improved in TSE.

#1
06/09/2006 (3:02 pm)
It should be really easy to just change that. Someone probably wanted to load a PNG larger than 1024 in some version of TGE and checked it in. The reasoning is as simple as that.

Make sure the frame allocator has > 1 meg in it's initialization (Should be 3 megs, in main.cc) and then just change:
static const U32 csgMaxRowPointers = 1024;
static png_bytep sRowPointers[1024];
(Top of bitmapPng.cpp)

To the size you need and you are golden.

Edit: Just make sure that you have enough space in the frame allocator to allocate the PNG for reads. Remember that other things use the frame allocator, so it should be larger than you need it for PNG loading.
#2
06/10/2006 (5:01 pm)
Odd, I seem to recall that I've used 1600x1200 png's since V12.
In any case, thanks for your advice and pointers - it works perfectly!
#3
06/10/2006 (5:31 pm)
No worries dude, sorry it caused you some issues.