perandersson / playstate

PlayState
2 stars 0 forks source link

Find a solution for loading SceneGroups in the ResourceLoader thread #28

Open perandersson opened 11 years ago

perandersson commented 11 years ago

Find a solution for loading SceneGroups in the ResourceLoader thread

perandersson commented 11 years ago

Each thread should have it's own lua_State. After the SceneGroup is loaded, return it and re-register it inside the main lua state. As long as the reference ID and internal state of the Scriptable object is updated - this should not be a problem

perandersson commented 11 years ago

Problems might occur for script generated classes with lua overloaded functions.

perandersson commented 11 years ago

Possible solution is to use non-lua dependent script_ref identifier. Instead use a lookup table for objects:

local ref = Lookup(self)
perandersson commented 11 years ago

Possible solution: Don't do anything. This might not be a problem since all non-scripted resources are loaded in the multithreaded resource loader.