Jo Engine Forum

Sega Saturn Development => General Jo Engine Help => Topic started by: b1tsh1ft3r on February 23, 2018, 04:27:10 am

Title: TGA limit?
Post by: b1tsh1ft3r on February 23, 2018, 04:27:10 am
Ive been using the following:

 jo_sprite_add_image_pack("STG2", "000.TEX", JO_COLOR_Black);

At first, i received the error stating i needed to increase the max file size in the image pack, which i did in the makefile by explicitly defining a max number.

I have 299 tga images in the same STG2 folder with 000.TEX as the first file which lists out all of the 299 .tga files which are listed in numerical order (1.tga, 2.tga, ..., 298.tga, 299.tga)

 jo_sprite_add_image_pack is getting to about 52.tga before it states it cant find 53.tga. the error is consistent and seems as if the seek and reading of files gets lost along the way somehow after loading quite a few?

am i doing something wrong here? Maybe i am using this function in an in correct way overall by trying to load too many sprites and there is a better method to achieve the same results?

My original thought was that i would take a 320x240 tilemap image and split it into 16x16 tiles (300 of them) and load them into ram and then load the tilemap itself and draw, but it does not seem to be working as planned.

Any suggestions are welcome!
Title: Re: TGA limit?
Post by: ponut64 on February 23, 2018, 05:53:31 am
It is my understanding that the file-names need to be reasonably unique or else it's going to throw unpredictable errors.

e.g. in my face FLOORA, FLOORC, FLOORB & WALLA, WALLB, WALLC would cause the first .tga file with that leading name become all targa files that are similar.

I hope that helps.
Title: Re: TGA limit?
Post by: mindslight on February 23, 2018, 08:29:12 am

That's because you reach the limit of the filesystem.

You have to separate files in multiple folder.

I don't remember the limit but it's on Sega's documentation (something like 32 files)

Anyway, loaded hundred of sprites from CD is not the good way because it will be very slow on real hardware.

You should make tileset using JoMapEditor.

You will also reach the limit of simultaneous sprites in Jo Engine which is 255 but it can be extended to 65535 if I add an option in the Makefile.
Title: Re: TGA limit?
Post by: b1tsh1ft3r on February 23, 2018, 04:00:26 pm
Ah, i see...

Ok not a problem. I think i know how to perform the same thing i want but in a different manner. Is the option to allow more sprites simultaneously available as an option to define in the makefile currently?
Title: Re: TGA limit?
Post by: XL2 on February 23, 2018, 04:23:56 pm
Yes, with jo max sprites (look at conf.h for the options). I use more than 500 different sprites in some maps in the FPS demo and it works fine with 16 colors.