From b61e4e5b140278705c79674c02de6886b2189f71 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 26 Jun 2016 11:50:15 -0400 Subject: fixing everything that's apparently broken... --- brice.dat | 4 ++-- include/texture.hpp | 3 ++- main.cpp | 5 +++-- src/ui.cpp | 6 ++++++ src/world.cpp | 6 +++--- xml/bobshouse.xml | 39 ++++++-------------------------------- xml/playerSpawnHill1.xml | 6 +++--- xml/playerSpawnHill1_Building1.xml | 6 +++--- xml/town.xml | 8 ++++---- 9 files changed, 32 insertions(+), 51 deletions(-) diff --git a/brice.dat b/brice.dat index 3b090ad..2033bae 100644 --- a/brice.dat +++ b/brice.dat @@ -1,7 +1,7 @@ 3 canSprint -0 +1 canJump 0 Slow -1 +0 diff --git a/include/texture.hpp b/include/texture.hpp index 95bd73b..0ee3e2c 100644 --- a/include/texture.hpp +++ b/include/texture.hpp @@ -47,8 +47,9 @@ public: position = std::begin(textures); } TextureIterator(const std::vector &l) { - for (const auto &s : l) + for (const auto &s : l) { textures.emplace_back(Texture::loadTexture(s), s); + } position = std::begin(textures); } void operator++(int) noexcept { diff --git a/main.cpp b/main.cpp index 3b98b94..72987a3 100644 --- a/main.cpp +++ b/main.cpp @@ -470,7 +470,7 @@ void render() { if(ui::debug){ ui::putText(offset.x-SCREEN_WIDTH/2, (offset.y+SCREEN_HEIGHT/2)-ui::fontSize, - "fps: %d\ngrounded:%d\nresolution: %ux%u\nentity cnt: %d\nloc: (%+.2f, %+.2f)\nticks: %u\nvolume: %f\nweather: %s", + "fps: %d\ngrounded:%d\nresolution: %ux%u\nentity cnt: %d\nloc: (%+.2f, %+.2f)\nticks: %u\nvolume: %f\nweather: %s\nxml: %s", fps, player->ground, SCREEN_WIDTH, // Window dimensions @@ -480,7 +480,8 @@ void render() { debugY, // The player's y coordinate game::time::getTickCount(), game::config::VOLUME_MASTER, - currentWorld->getWeatherStr().c_str() + currentWorld->getWeatherStr().c_str(), + currentXML.c_str() ); static GLuint tracerText = Texture::genColor(Color(100,100,255)); diff --git a/src/ui.cpp b/src/ui.cpp index 14df95e..037ba89 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -629,6 +629,11 @@ namespace ui { while (fadeIntensity < 255); fadeIntensity = 255; } + + void waitForUncover(void) { + while (fadeIntensity > 0); + fadeIntensity = 0; + } void waitForNothing(unsigned int ms) { unsigned int target = millis() + ms; @@ -1301,6 +1306,7 @@ EXIT: wsi.first->bgmPlay(currentWorld); std::tie(currentWorld, player->loc) = wsi; toggleBlackFast(); + waitForUncover(); player->canMove = true; }; diff --git a/src/world.cpp b/src/world.cpp index 7c62739..2f1a8a6 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -1154,7 +1154,7 @@ void World::save(const std::string& s) { for (const auto &e : entity) e->saveToXML(); - currentXMLDoc.SaveFile((xmlFolder + (s.empty() ? currentXML : s)).c_str(), false); + currentXMLDoc.SaveFile((s.empty() ? currentXML : xmlFolder + s).c_str(), false); } /** @@ -1844,7 +1844,7 @@ static bool loadedRight = false; World *loadWorldFromXML(std::string path) { if (!currentXML.empty()) - currentWorld->save(path); + currentWorld->save(); return loadWorldFromXMLNoSave(path); } @@ -1994,7 +1994,7 @@ loadWorldFromXMLNoSave(std::string path) { tmp->generate(wxml->UnsignedAttribute("width") / game::HLINE); else { if (Indoor) - UserError("XML Error: tags can't be in tags (in " + _currentXML + ")!"); + UserError("XML Error: tags can't be in tags, use instead (in " + _currentXML + ")!"); else UserError("XML Error: Invalid tag in " + _currentXML + "!"); } diff --git a/xml/bobshouse.xml b/xml/bobshouse.xml index 32e6a95..243063d 100644 --- a/xml/bobshouse.xml +++ b/xml/bobshouse.xml @@ -1,34 +1,7 @@ - -