X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fapp.cc;h=250141536d4c047bb83bea85f931a14efe0d73ce;hp=6cb808c9fd050f6e28a68f6322f2eac8a6d4df1b;hb=72b941af07bbf2673539ad4eea073e68d3bcbbfc;hpb=572bf1ef8d54ef5a7cba7cdf38515cb16c4c312c diff --git a/src/app.cc b/src/app.cc index 6cb808c..2501415 100644 --- a/src/app.cc +++ b/src/app.cc @@ -7,6 +7,7 @@ #include "mesh.h" #include "meshgen.h" #include "scene.h" +#include "metascene.h" #include "datamap.h" static void draw_scene(); @@ -44,41 +45,23 @@ bool app_init() float ambient[] = {0.0, 0.0, 0.0, 0.0}; glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient); + scn = new Scene(&texman); + if(!load_scene(scn, "data/museum.scene")) { + return false; + } + + /* datamap_set_path("data"); if(!datamap_load_map("data.map")) { fprintf(stderr, "failed to load datafile mappings\n"); } unsigned int sflags = SCNLOAD_FLIPTEX; - scn = new Scene(&texman); if(!(scn->load("data/testscene/patoma.fbx", sflags)) || !(scn->load("data/testscene/kolones.fbx", sflags))) { fprintf(stderr, "failed to load test scene\n"); return false; } - - // hardcoded texture assignment hack - Texture *tex_kolones_lightmap = texman.get_texture("data/testscene/kolones_lighmap.jpg", TEX_2D); - Texture *tex_patoma_lightmap = texman.get_texture("data/testscene/patomacorona_lightmap.jpg", TEX_2D); - - /* - for(int i=0; i<(int)scn->objects.size(); i++) { - Object *obj = scn->objects[i]; - if(obj->mtl.name == "WiteMarble") { - obj->mtl.add_texture(tex_patoma_lightmap, MTL_TEX_LIGHTMAP); - } else if(obj->mtl.name == "BrownMarble") { - obj->mtl.add_texture(tex_patoma_lightmap, MTL_TEX_LIGHTMAP); - } else if(obj->mtl.name == "GiroGiroMarmaro") { - obj->mtl.add_texture(tex_patoma_lightmap, MTL_TEX_LIGHTMAP); - } else if(obj->mtl.name == "KentrikoKafeMarmaro") { - obj->mtl.add_texture(tex_patoma_lightmap, MTL_TEX_LIGHTMAP); - - } else if(obj->mtl.name == "SkouroGrizoMarmaro") { - obj->mtl.add_texture(tex_kolones_lightmap, MTL_TEX_LIGHTMAP); - } else if(obj->mtl.name == "PalioMarmaro") { - obj->mtl.add_texture(tex_kolones_lightmap, MTL_TEX_LIGHTMAP); - } - } */ if(!(sdr = create_program_load("sdr/test.v.glsl", "sdr/test.p.glsl"))) {