Jump to content

LoadScene Callback


klepto2
 Share

Recommended Posts

I'm currently working on my loading and setup routines and I think it may be useful to have some kind of callback for the LoadScene function.

Currently my scene is relatively small and small splashscreen is enough for indicating loading. But i if the scene files grow and

the loading of a scene takes much longer i would like to present progress on my loading screen.

 

Maybe you can add a callback as an optional parameter to the loadscene function:

 

main_scene = LoadScene("abstract::map_x_1_y_2.sbx", LoaderProgress)

Function LoaderProgress(progress:TSceneProgress)
DrawImage(splash, 512.0 - loadimg.Width() / 2.0, (768.0 / 2.0) - (loadimg.Height() / 2.0))
Local total:Int = progress.GetTotalItems()
Local loaded:Int = progress.GetLoadedItems()
DrawText "Loading... " + (loaded / Float(total)) * 100 + "%",20,20
Flip()
End Function

  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

Pretty easy for us to implement ourselves by creating our own scene loader. You'd probably be best served by loading the terrain/vegetation using the standard LoadScene command, then using your own loader to load the individual items one at a time so you could track status. At least it's a temporary solution until Josh adds this in, if he does.

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

How would you use the LoadScene() to only load terrain/vegetation but then load all the other things yourself? LoadScene() is going to load anything in the sbx file. So the only way I can see this happening is to parse out the terrain and vegetation from the sbx file you want to load, then use LoadScene() on the new sbx file which just has the terrain and vegetation, and then create our own loading function to parse out the original sbx file. That's a pretty big hack. It gets old having to hack stuff like this.

 

By "big hack", I mean anytime you have to start manipulating files on disk like this it's a "big hack". Not in the amount of code it takes, but in how crappy of a solution it would be vs the engine just having it. This would be such an easy feature to put into the engine vs the time it would take for us to do it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...