Mintoris

Author Topic: Detect atlas loading completion  (Read 1672 times)

FabianClub

  • Full Member
  • ***
  • Posts: 76
Detect atlas loading completion
« on: Jun 10, 2017, 08:29 AM »
Hello everybody!

Let's see if anyone knows how I can fix this:

I charge the atlas (GenLoadAtlas), which is 4096x4096 and I use a background with GenSplashScreen. While the atlas is being loaded, the program continues to execute the program code.
On more powerful phones or tablets, this is done quite fast.
But in less powerful devices, loading the atlas takes more time. Then the program continues to advance and continues the game, but the atlas is not yet loaded.
Is there any Mintoris statement, or some other way of detecting that you have finished uploading the atlas to graphic memory?
If it is not, I think that it could be implemented in future versions, some thing that does this check, like those that already exist (IsAudioPlaying, IsGenPaused, etc.)

Thank you all!

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Detect atlas loading completion
« Reply #1 on: Jun 12, 2017, 01:21 PM »
Hmm, yes. I'll have to put something in to check for that condition. Maybe you could put a wait 250 or so in for now to make sure everything is loaded. Also 4096x4096 is really big for the atlas. It won't work on most older phones.

FabianClub

  • Full Member
  • ***
  • Posts: 76
Re: Detect atlas loading completion
« Reply #2 on: Jun 12, 2017, 07:38 PM »
I found a method that I will now share with you all. It works for me at various points in my program.

With the following procedure you can detect that the atlas is loaded.

First the splash screen should be removed (if it is in use).


Program...

GenSplashScreen Off   'only if it was in use
j = GenGetPlayedTime()
loadatlas1:
k = GenGetPlayedTime()
If (k-j)<3 then loadatlas1

...Program

More useful on phones or tablets older, or less powerful.
« Last Edit: Jun 13, 2017, 06:56 PM by FabianClub »

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Detect atlas loading completion
« Reply #3 on: Jun 13, 2017, 07:26 PM »
Yes that should work for now.