2015-02-04 16:16:06 +00:00
|
|
|
#pragma once
|
|
|
|
|
2015-02-07 19:08:59 +00:00
|
|
|
#include "application.hh"
|
2015-02-04 16:16:06 +00:00
|
|
|
#include "level.hh"
|
|
|
|
#include "tinyxml2.hh"
|
|
|
|
|
2015-02-18 19:10:30 +00:00
|
|
|
using namespace tinyxml2;
|
|
|
|
|
2015-02-04 16:16:06 +00:00
|
|
|
class Loader {
|
|
|
|
public:
|
|
|
|
Loader();
|
2015-02-07 19:08:59 +00:00
|
|
|
void loadConfig(Application* application);
|
2015-03-14 12:00:47 +00:00
|
|
|
void load(std::string filePath, Level* level, std::string compositionsPath,
|
|
|
|
std::string scriptPath, std::string geometryPath, std::string texturePath,
|
2015-04-25 20:29:37 +00:00
|
|
|
std::string heightmapPath, Graphics* graphics);
|
2015-02-13 16:14:29 +00:00
|
|
|
glm::vec3 reloadPlayerPosition(std::string filePath, Level* level);
|
2015-02-04 16:16:06 +00:00
|
|
|
private:
|
2015-02-18 19:10:30 +00:00
|
|
|
float queryFloat(XMLElement* element, const char* attribute);
|
|
|
|
float queryFloat(XMLDocument*& element, const char* attribute);
|
|
|
|
int queryInt(XMLElement* element, const char* attribute);
|
|
|
|
int queryInt(XMLDocument*& element, const char* attribute);
|
|
|
|
bool queryBool(XMLElement* element, const char* attribute);
|
|
|
|
bool queryBool(XMLDocument*& element, const char* attribute);
|
|
|
|
std::string queryString(XMLElement* element, const char* attribute);
|
|
|
|
std::string queryString(XMLDocument*& element, const char* attribute);
|
2015-02-04 16:16:06 +00:00
|
|
|
void errorCheck(tinyxml2::XMLError error);
|
|
|
|
};
|