Home | Forums | What's new | Resources | |
Loading assets between levels? |
NightCheese - May 20, 2020 |
NightCheese | Oct 6, 2020 | |||
Sorry to bump my own thread, but I wondered if anyone had any thoughts on this? Thank you! P.S. Thanks to you all for keeping the Saturn alive |
XL2 | Oct 6, 2020 | |||||
You can just replace the data in your texture def directly by updating the size, source, etc. I wrote an image converter a while back, mostly for 4 bpp sprites, which is almost the only thing I personaly use, you should be able to find it somewhere in the forums. It also supports 8 bpp sprites, but I never added support for 16 bpp |
NightCheese | Oct 7, 2020 | |||
Thanks for the reply, XL2! Sorry, but maybe I don't understand? If I was to replace the data in my texture def, how would the new textures get loaded? I'm currently loading the textures with "slInitSystem(TV_320x240, tex_LEVEL1, 1)" that lives in "void init_GFX()" which only gets called when the game boots. I'm very new to Saturn development, so an example would be excellent if you have one? I have found your image converter. Thank you very much |
XL2 | Oct 7, 2020 | |||||
The image converter topic also had a demo if I remember right, you can simply change the data directly in tex_level1 by keeping track of how many textures you have and what you want to replace. Say you have 40 "permanent" textures, you just need to replace stuff in tex_level1[40] when you change level. That includes DMA to VRAM and updating the size and adresses in tex_level1. |
NightCheese | Oct 7, 2020 | |||
Thank you! I think that makes sense. I’ll have a play around and will let you know how I get on. |
XL2 | Oct 8, 2020 | |||||
You can see an example here how to load new textures within SGL : |