Mintoris Forum

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

FabianClub

  • Full Member
  • ***
  • Posts: 78
Detect atlas loading completion
« on: Jun 10, 2017, 04:29 PM »
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, 09: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: 78
Re: Detect atlas loading completion
« Reply #2 on: Jun 13, 2017, 03:38 AM »
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 14, 2017, 02:56 AM by FabianClub »

Chuck

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

TonyaCon

  • Full Member
  • ***
  • Posts: 18
Detect atlas loading completion
« Reply #4 on: Oct 21, 2019, 11:20 AM »
has left to read.

Evelynwed

  • Full Member
  • ***
  • Posts: 26
Detect atlas loading completion
« Reply #5 on: Oct 24, 2019, 07:25 AM »
All not so is simple, as it seems

CarolclOry

  • Full Member
  • ***
  • Posts: 13
Detect atlas loading completion
« Reply #6 on: Oct 31, 2019, 08:05 PM »
I and thought.