diff --git a/assets/galax_menu/matte_screen.png b/assets/galax_menu/matte_screen.png index 56bfa62..749a5c2 100755 Binary files a/assets/galax_menu/matte_screen.png and b/assets/galax_menu/matte_screen.png differ diff --git a/game/galaxy_menu.cpp b/game/galaxy_menu.cpp index 69dcb57..c19cb54 100755 --- a/game/galaxy_menu.cpp +++ b/game/galaxy_menu.cpp @@ -20,9 +20,9 @@ bool GalaxyMenu::InitGalaxyMenu(std::string config_json, float scale) { menuScale = scale; /*...Read ptree from config...*/ - std::string res_path = "../../../assets/"; - boost::property_tree::ptree config_pt; - boost::property_tree::json_parser::read_json(res_path + config_json, config_pt); + + boost::property_tree::ptree config_pt = SE::ReadJsonFile(ST::PathToResources + config_json); + //boost::property_tree::json_parser::read_json(res_path + config_json, config_pt); /*..error ptree..*/ boost::property_tree::ptree error_pt; diff --git a/game/main_code.cpp b/game/main_code.cpp index 71d85b8..146ac34 100755 --- a/game/main_code.cpp +++ b/game/main_code.cpp @@ -72,6 +72,8 @@ void TMyApplication::InnerInit() ST::PathToResources = "assets/"; #endif + ST::PathToResources = ""; + if (Console != NULL) { *Console<<"APP INIT\n"; @@ -257,8 +259,9 @@ void TMyApplication::LoadResources() // ::::::::::::::::::::::::::::::::::::: // :::::::::::::PTREE LOAD:::::::::::::: - boost::property_tree::ptree Textures_pt; - boost::property_tree::json_parser::read_json(ST::PathToResources + "bg_textures_config.json", Textures_pt); + boost::property_tree::ptree Textures_pt = SE::ReadJsonFile(ST::PathToResources + "bg_textures_config.json"); + //boost::property_tree::json_parser::read_json(ST::PathToResources + "bg_textures_config.json", Textures_pt); + std::string bg_ext = ".jpeg"; // ::::::::::::::::::::::::::::::::::::: @@ -307,12 +310,12 @@ void TMyApplication::LoadResources() std::vector galaxies; galaxies.resize(1); galaxies[0] = 3; - TextureNamesToLoad.push_back(std::pair("/galax_menu/matte_screen.png", "matte_screen")); + TextureNamesToLoad.push_back(std::pair("galax_menu/matte_screen.png", "matte_screen")); for (int i = 0; i < galaxies.size(); i++) { - TextureNamesToLoad.push_back(std::pair("/galax_menu/galaxies/galaxy_" + std::to_string(i) + ".png", "galaxy_" + std::to_string(i))); + TextureNamesToLoad.push_back(std::pair("galax_menu/galaxies/galaxy_" + std::to_string(i) + ".png", "galaxy_" + std::to_string(i))); for (int j = 0; j < galaxies[i]; j++) { - TextureNamesToLoad.push_back(std::pair("/galax_menu/planets/star_" + std::to_string(i) + "_" + std::to_string(j) + ".png", "star_" + std::to_string(i) + "_" + std::to_string(j))); - TextureNamesToLoad.push_back(std::pair("/galax_menu/planets/star_" + std::to_string(i) + "_" + std::to_string(j) + "_hover" + ".png", "star_" + std::to_string(i) + "_" + std::to_string(j) + "_hover")); + TextureNamesToLoad.push_back(std::pair("galax_menu/planets/star_" + std::to_string(i) + "_" + std::to_string(j) + ".png", "star_" + std::to_string(i) + "_" + std::to_string(j))); + TextureNamesToLoad.push_back(std::pair("galax_menu/planets/star_" + std::to_string(i) + "_" + std::to_string(j) + "_hover" + ".png", "star_" + std::to_string(i) + "_" + std::to_string(j) + "_hover")); } } @@ -438,8 +441,11 @@ void TMyApplication::InnerUpdate(size_t dt) if (TextureNamesToLoad.size() != 0) { + *SE::Console << "LOADING: " + TextureNamesToLoad.begin()->first; ResourceManager->TexList.AddTexture(TextureNamesToLoad.begin()->first, TextureNamesToLoad.begin()->second); + TextureNamesToLoad.erase(TextureNamesToLoad.begin()); + } else { @@ -640,33 +646,33 @@ void TMyApplication::InnerOnMouseMove(TMouseState& mouseState) { void TMyApplication::EffectsInit() { boost::property_tree::ptree JSONsource; - boost::property_tree::ptree JSONconfig; + boost::property_tree::ptree JSONconfig = SE::ReadJsonFile("config.json"); std::string effectJSON; - boost::property_tree::json_parser::read_json(ST::PathToResources + "config.json", JSONconfig); // LEFT effectJSON = JSONconfig.get("lefteffect"); - boost::property_tree::json_parser::read_json(ST::PathToResources + effectJSON, JSONsource); + //boost::property_tree::json_parser::read_json(ST::PathToResources + effectJSON, JSONsource); + JSONsource = SE::ReadJsonFile(ST::PathToResources + effectJSON); lsparkler.parse(JSONsource); // parse JSON lsparkler.load(); // load textures // RIGHT effectJSON = JSONconfig.get("righteffect"); - boost::property_tree::json_parser::read_json(ST::PathToResources + effectJSON, JSONsource); + JSONsource = SE::ReadJsonFile(ST::PathToResources + effectJSON); rsparkler.parse(JSONsource); rsparkler.load(); // TOP effectJSON = JSONconfig.get("topeffect"); - boost::property_tree::json_parser::read_json(ST::PathToResources + effectJSON, JSONsource); + JSONsource = SE::ReadJsonFile(ST::PathToResources + effectJSON); tsparkler.parse(JSONsource); tsparkler.load(); // BOTTOM effectJSON = JSONconfig.get("boteffect"); - boost::property_tree::json_parser::read_json(ST::PathToResources + effectJSON, JSONsource); + JSONsource = SE::ReadJsonFile(ST::PathToResources + effectJSON); bsparkler.parse(JSONsource); bsparkler.load(); // Level finish effectJSON = JSONconfig.get("lvlFinish"); - boost::property_tree::json_parser::read_json(ST::PathToResources + effectJSON, JSONsource); + JSONsource = SE::ReadJsonFile(ST::PathToResources + effectJSON); lvlFirework.parse(JSONsource); lvlFirework.load();