From 84966c3d0ae2d39fa4e691ed0131d8b94f8785e4 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sat, 22 Dec 2012 05:38:32 +0000 Subject: BGE: Committing async LibLoad from Swiss. This does the lib loading in a separate thread to keep the BGE from freezing. Here is an example from the docs: # Print a message when an async LibLoad is done import bge def finished_cb(status): print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken)) bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb LibLoad() now returns a KX_LibLoadStatus object for information on the library loading. LibNew() and LibFree() are unaffected by this commit. In other words, the async option only works for LibLoad(). Furthermore it only works for Scenes, not Actions or Meshes. --- source/gameengine/Converter/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/gameengine/Converter/CMakeLists.txt') diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt index e9dd97f3821..e01729e156f 100644 --- a/source/gameengine/Converter/CMakeLists.txt +++ b/source/gameengine/Converter/CMakeLists.txt @@ -83,6 +83,7 @@ set(SRC KX_ConvertProperties.cpp KX_ConvertSensors.cpp KX_IpoConvert.cpp + KX_LibLoadStatus.cpp KX_SoftBodyDeformer.cpp BL_ActionActuator.h @@ -105,6 +106,7 @@ set(SRC KX_ConvertProperties.h KX_ConvertSensors.h KX_IpoConvert.h + KX_LibLoadStatus.h KX_SoftBodyDeformer.h ) -- cgit v1.2.3