projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added delayed init call after scenegraph/meshes are done loading
[laserbrain_demo]
/
src
/
app.cc
diff --git
a/src/app.cc
b/src/app.cc
index
63e7cd7
..
7b4280d
100644
(file)
--- a/
src/app.cc
+++ b/
src/app.cc
@@
-84,6
+84,8
@@
static Renderer *rend;
static Ray last_pick_ray;
static Ray last_pick_ray;
+static bool post_scene_init_pending = true;
+
bool app_init(int argc, char **argv)
{
bool app_init(int argc, char **argv)
{
@@
-206,6
+208,11
@@
bool app_init(int argc, char **argv)
return true;
}
return true;
}
+static void post_scene_init()
+{
+ exman->load(mscn, "data/exhibits");
+}
+
void app_cleanup()
{
if(mscn->music) {
void app_cleanup()
{
if(mscn->music) {
@@
-257,6
+264,11
@@
static void update(float dt)
texman.update();
sceneman.update();
texman.update();
sceneman.update();
+ if(post_scene_init_pending && !sceneman.pending()) {
+ post_scene_init_pending = false;
+ post_scene_init();
+ }
+
mscn->update(dt);
exman->update(dt);
exui_update(dt);
mscn->update(dt);
exman->update(dt);
exui_update(dt);