From 7d411110a64eacc939b592b710b41d340da8bf62 Mon Sep 17 00:00:00 2001 From: Vladislav Khorev Date: Sat, 14 Jul 2018 15:49:31 +0500 Subject: [PATCH] Prepare for Android --- assets/galax_menu/matte_screen.png | Bin 10748 -> 10699 bytes game/galaxy_menu.cpp | 6 +++--- game/main_code.cpp | 32 +++++++++++++++++------------ 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/assets/galax_menu/matte_screen.png b/assets/galax_menu/matte_screen.png index 56bfa62e77c0188e0d842e6c00d2d4b3974b2cc8..749a5c2a4767254e47e4c8cc6771ecc9f9e2480d 100755 GIT binary patch literal 10699 zcmeAS@N?(olHy`uVBq!ia0y~y-~cjN7&zE~R4MyT7a+x09OUlAufI!23P6&g6K|le9jssKw0qvhjh`8ZlWfop00i_>zopr0IY*N^8f$< literal 10748 zcmeAS@N?(olHy`uVBq!ia0y~y-~cjN7&zE~R4MyT7a+x!|H(?D8gCb z5n0T@z%2~Ij105pNB{-dOFVsD*&ngWap;)*d{G$2z@Wh3>EaktaqG=3N5KOM32V@QH7(y14{~{i2@c945Ntx78Ik2 z0u~aZiDI<+fTo4f+I6%|0Zj^{<>OE)A1!Uo(t%3`YC&rOM$7Zj@_e*BhlIdrdly!U zjh5%IkQgl=N6W|2@^Q3$1cd+vBZm&stcw#wdYS?axZDnENB~zyE-mGJcyam7M3BLr Lu6{1-oD!M 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();