New world and player files format
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
// don't ask
|
||||
using glm::vec3;
|
||||
using std::cout;
|
||||
using std::cerr;
|
||||
@@ -24,14 +25,7 @@ ContentLoader::ContentLoader(path folder) : folder(folder) {}
|
||||
|
||||
// TODO: add basic validation and logging
|
||||
Block* ContentLoader::loadBlock(string name, path file) {
|
||||
string source = files::read_string(file);
|
||||
unique_ptr<json::JObject> root = nullptr;
|
||||
try {
|
||||
root.reset(json::parse(file.string(), source));
|
||||
} catch (const parsing_error& error) {
|
||||
cerr << error.errorLog() << endl;
|
||||
throw std::runtime_error("could not load block def");
|
||||
}
|
||||
unique_ptr<json::JObject> root(files::read_json(file));
|
||||
unique_ptr<Block> def(new Block(name));
|
||||
|
||||
// block texturing
|
||||
|
||||
Reference in New Issue
Block a user