X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FScene.cc;h=454726817a3fc9285616efbcf47e405f6fe24aa8;hp=ccfd4f934060b605ad5de663c9e62bf84414c9e0;hb=1dd005530930657fd6216edc1dfcfa4c270a81c9;hpb=f72400af4fa3e7b54dab154b5a2b6503a6f9af18 diff --git a/src/Moof/Scene.cc b/src/Moof/Scene.cc index ccfd4f9..4547268 100644 --- a/src/Moof/Scene.cc +++ b/src/Moof/Scene.cc @@ -26,7 +26,6 @@ *******************************************************************************/ -#include #include #include @@ -34,6 +33,7 @@ #include "Camera.hh" #include "Deserializer.hh" #include "Entity.hh" +#include "Log.hh" #include "Math.hh" #include "Mippleton.hh" #include "OpenGL.hh" @@ -67,7 +67,13 @@ class Scene::Impl : public Mippleton if (!tilemap_.getTileCoords(tileIndex, texCoords_)) { - std::cerr << "no coords for tile's texture" << std::endl; + logWarning("no index %d in texture %s", tileIndex, + texture.c_str()); + + texCoords_[0] = texCoords_[1] = + texCoords_[3] = texCoords_[6] = 0.0; + texCoords_[2] = texCoords_[4] = + texCoords_[5] = texCoords_[7] = 1.0; } aabb_.encloseVertices(vertices, 4); @@ -165,7 +171,7 @@ public: if (!root->get(rootObj)) { - std::cerr << "error loading scene instructions" << std::endl; + logError("scene instructions must be an array"); return; } @@ -299,7 +305,7 @@ public: if (!root->get(rootObj)) { - std::cerr << "error loading scene tilemap object" << std::endl; + logError("invalid tilemap instruction"); return; } @@ -313,7 +319,7 @@ public: } else { - std::cerr << "width is a required field of a tilemap" << std::endl; + logError("missing required field width for tilemap instruction"); return; } @@ -352,7 +358,7 @@ public: } else { - std::cerr << "error loading tiles from tilemap object" << std::endl; + logError("invalid tiles in tilemap instruction"); return; } @@ -480,7 +486,7 @@ public: if (!root || !root->get(rootObj)) { - std::cerr << "error loading scene file" << std::endl; + logError("no root map in scene file"); return; } @@ -494,7 +500,7 @@ public: } else { - std::cerr << "maximum bounds required in scene" << std::endl; + logError("missing required maximum bounds"); return; } @@ -506,6 +512,8 @@ public: loadInstructions((*it).second); } + + octree->sort(); }