*******************************************************************************/
-#include <iostream>
#include <map>
#include <vector>
#include "Camera.hh"
#include "Deserializer.hh"
#include "Entity.hh"
+#include "Log.hh"
#include "Math.hh"
#include "Mippleton.hh"
#include "OpenGL.hh"
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);
if (!root->get(rootObj))
{
- std::cerr << "error loading scene instructions" << std::endl;
+ logError("scene instructions must be an array");
return;
}
if (!root->get(rootObj))
{
- std::cerr << "error loading scene tilemap object" << std::endl;
+ logError("invalid tilemap instruction");
return;
}
}
else
{
- std::cerr << "width is a required field of a tilemap" << std::endl;
+ logError("missing required field width for tilemap instruction");
return;
}
}
else
{
- std::cerr << "error loading tiles from tilemap object" << std::endl;
+ logError("invalid tiles in tilemap instruction");
return;
}
if (!root || !root->get(rootObj))
{
- std::cerr << "error loading scene file" << std::endl;
+ logError("no root map in scene file");
return;
}
}
else
{
- std::cerr << "maximum bounds required in scene" << std::endl;
+ logError("missing required maximum bounds");
return;
}
loadInstructions((*it).second);
}
+
+
octree->sort();
}