Page 1 of 1

Preloading functions

Posted: Fri Feb 24, 2012 7:52 pm
by Allanon
Hi Andreas,
I'd like to post an idea on a method to implement preload/chaching without implement separate thread processes, but internally of course you should handle them asynchronously.

I was thinking about something like:

Code: Select all

; Call an async loading routine for the given filename, if preload_id is Nil means that the Preloading has failed (file not found, etc...)
Local preload_id = Preload(filename)

; Check if the loading has been completed, result can be TRUE or FALSE
Local result = IsLoaded(preload_id)

Then we could use the preload_id as pseudo filename in standard loading routines:

Code: Select all

Local myBrush = LoadBrush(Nil, preload_id)
This could lead to istant loadings in many situations, or at least the wait could be reduced because the program should wait only for the reading completetion:

Code: Select all

...
While IsLoaded(preload_is)
   ...
Wend
Local myBrush = LoadBrush(Nil, preload_id)
Just an idea :)
Could it be possible?

Re: Preloading functions

Posted: Sat Feb 25, 2012 12:04 pm
by airsoftsoftwair
Of course it's possible but it would require fundamental changes in the Hollywood core so it's not very likely to come :)