projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- shaders for both lightmapped objects with or without albedo maps
[laserbrain_demo]
/
src
/
metascene.cc
diff --git
a/src/metascene.cc
b/src/metascene.cc
index
aae7482
..
cf4d788
100644
(file)
--- a/
src/metascene.cc
+++ b/
src/metascene.cc
@@
-2,6
+2,7
@@
#include "scene.h"
#include "datamap.h"
#include "treestore.h"
#include "scene.h"
#include "datamap.h"
#include "treestore.h"
+#include "logger.h"
#ifdef WIN32
#include <malloc.h>
#ifdef WIN32
#include <malloc.h>
@@
-20,15
+21,15
@@
bool load_scene(Scene *scn, const char *fname)
struct ts_node *root = ts_load(fname);
if(!root || strcmp(root->name, "scene") != 0) {
ts_free_tree(root);
struct ts_node *root = ts_load(fname);
if(!root || strcmp(root->name, "scene") != 0) {
ts_free_tree(root);
- fprintf(stderr, "failed to load scene metadata: %s\n", fname);
+ error_log("failed to load scene metadata: %s\n", fname);
return false;
}
bool res = proc_node(scn, root);
ts_free_tree(root);
return false;
}
bool res = proc_node(scn, root);
ts_free_tree(root);
- printf("loaded scene: %s\n", fname);
- printf("scene graph:\n");
+ info_log("loaded scene: %s\n", fname);
+ info_log("scene graph:\n");
print_scene_graph(scn->nodes, 0);
return res;
}
print_scene_graph(scn->nodes, 0);
return res;
}
@@
-65,7
+66,7
@@
static bool proc_scenefile(Scene *scn, struct ts_node *node)
// datapath
struct ts_attr *adpath = attr_inscope(node, "datapath");
if(adpath && adpath->val.type == TS_STRING) {
// datapath
struct ts_attr *adpath = attr_inscope(node, "datapath");
if(adpath && adpath->val.type == TS_STRING) {
- printf("adding data path: %s\n", adpath->val.str);
+ info_log("adding data path: %s\n", adpath->val.str);
datamap_set_path(adpath->val.str);
}
datamap_set_path(adpath->val.str);
}
@@
-128,14
+129,14
@@
static void print_scene_graph(SceneNode *n, int level)
if(!n) return;
for(int i=0; i<level; i++) {
if(!n) return;
for(int i=0; i<level; i++) {
- fputs(" ", stdout);
+ info_log(" ");
}
int nobj = n->get_num_objects();
if(nobj) {
}
int nobj = n->get_num_objects();
if(nobj) {
- printf("%s - %d obj\n", n->get_name(), n->get_num_objects());
+ info_log("%s - %d obj\n", n->get_name(), n->get_num_objects());
} else {
} else {
- printf("%s\n", n->get_name());
+ info_log("%s\n", n->get_name());
}
for(int i=0; i<n->get_num_children(); i++) {
}
for(int i=0; i<n->get_num_children(); i++) {