]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
fixing everything that's apparently broken...
authorClyne Sullivan <tullivan99@gmail.com>
Sun, 26 Jun 2016 15:50:15 +0000 (11:50 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Sun, 26 Jun 2016 15:50:15 +0000 (11:50 -0400)
brice.dat
include/texture.hpp
main.cpp
src/ui.cpp
src/world.cpp
xml/bobshouse.xml
xml/playerSpawnHill1.xml
xml/playerSpawnHill1_Building1.xml
xml/town.xml

index 3b090ad887b4d2aa51cf2d99adc0eeaf055a2798..2033bae64b8c312af83dfe1243c6508df9c542aa 100644 (file)
--- a/brice.dat
+++ b/brice.dat
@@ -1,7 +1,7 @@
 3
 canSprint
-0
+1
 canJump
 0
 Slow
-1
+0
index 95bd73b190991a49de6df145584fc216967e4038..0ee3e2c210f9163ae3049f1b9d6850e1bcd7263d 100644 (file)
@@ -47,8 +47,9 @@ public:
                position = std::begin(textures);
        }
        TextureIterator(const std::vector<std::string> &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 {
index 3b98b94d9f8520d755196657c4947ea45f74afb5..72987a3e862b024f57f2ab2d8709a2c8fbbb92d0 100644 (file)
--- 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));
index 14df95eff85361e3ab84743f3cbe6fd21fa8b978..037ba896fb5afd1c1fb92e8b84a8b502f86446b1 100644 (file)
@@ -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;
                };
                
index 7c627399aa97a0e7141e3dadaafdee83ba280917..2f1a8a68c3734ccb7ce6b1ee5120b69940965335 100644 (file)
@@ -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: <generation> tags can't be in <IndoorWorld> tags (in " + _currentXML + ")!");
+                    UserError("XML Error: <generation> tags can't be in <IndoorWorld> tags, use <floor> instead (in " + _currentXML + ")!");
                 else
                     UserError("XML Error: Invalid <generation> tag in " + _currentXML + "!");
             }
index 32e6a95a70c85120317fee0148657c8b6da6858f..243063dae5a4949d109b74d23b50d0e9dcd1ee68 100644 (file)
@@ -1,34 +1,7 @@
 <?xml version="1.0"?>
-<World>
-    <style background="0" bgm="assets/music/embark.wav" folder="assets/style/classic/"/>
-    <generation type="Random" width="1600"/>
-    <time>6000</time>
-    <spawnx>-300</spawnx>
-    <npc name="Sanc" hasDialog="true"/>
-    <npc name="Bob" hasDialog="true" spawnx="30"/>
-    <structure type="1" spawnx="300"/>
-    <structure inside="bobshouse.xml" type="1" spawnx="10"/>
-</World>
-
-<Dialog name="Bob">
-    <text id="0" nextid="1" pause="true">
-        <content>
-                       Hey there! The name's Bob. Good to see you've finally woken up from your nap by the cliff there... lol
-               </content>
-    </text>
-    <text id="1" pause="true">
-        <quest assign="Check out m&apos;swag, man!">
-                       No description
-               </quest>
-        <content>
-                       Looks like you've got yourself pretty empty handed... you know, I have a simple solution for that. Come on inside, I have somethin' to show you.
-               </content>
-    </text>
-</Dialog>
-
-<Dialog name="Sanc">
-    <text id="0">
-        <set id="Slow" value="0"/>
-        <set id="canSprint" value="1"/>
-    </text>
-</Dialog>
+<IndoorWorld>
+       <style background="1" bgm="assets/music/embark.wav" folder="assets/style/classic/"/>
+       <floor width="1600"/>
+       <link outside="town.xml"/>
+       <npc name="Bob" hasDialog="false" spawnx="30"/>
+</IndoorWorld>
index e052c50bca1e4219de0ad89f52f19241091260ba..e197f2e4d4ff6b0973bdb619043f57ffcd06f222 100644 (file)
 <Dialog name="Guy">
     <text id="0" nextid="1">
                Hello there! My name is Ralph.
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <gotox>300</gotox>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <gotox>300</gotox>
     </text>
     <text id="1">
                ...
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <gotox>1000</gotox>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <gotox>1000</gotox>
         <set id="Slow" value="0"/>
         <set id="canSprint" value="1"/>
     </text>
@@ -33,5 +33,5 @@
     <text id="0" stop="true">
                Hey friend! It's dangerous out there, here take these!
                Wait, promise you'll stop by my stand in the local market!
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <give id="Wood Sword" count="1"/>        <give id="Hunters Bow" count="1"/>        <give id="Crude Arrow" count="110"/>        <give id="Fried Chicken" count="1"/>        <give id="Mossy Torch" count="1"/></text>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <give id="Wood Sword" count="1"/>        <give id="Hunters Bow" count="1"/>        <give id="Crude Arrow" count="110"/>        <give id="Fried Chicken" count="1"/>        <give id="Mossy Torch" count="1"/></text>
 </Dialog>
index 28add1f8aa0e7073605f0830c04bc064db530ace..5c5dfdc986796590e6f67c2f4945ad88faaa7183 100644 (file)
 <Dialog name="Bob">
     <text id="0" nextid="1" pause="true">
        Hey. Have a Dank MayMay :)
-                                                                                                                                                                                                                                                                                                                                       <give id="Dank MayMay" count="1"/></text>
+                                                                                                                                                                                                                                                                                                                                                       <give id="Dank MayMay" count="1"/></text>
     <text id="1" nextid="2">
        What? You want another Dank MayMay?
     </text>
     <text id="2" nextid="3" pause="true">
                K.
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   <give id="Dank MayMay" count="1"/></text>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   <give id="Dank MayMay" count="1"/></text>
     <text id="3" nextid="4">
                Well... I'm out of Dank MayMays.
        </text>
     <text id="4">
                Have a sword though.
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               <give id="Wood Sword" count="1"/></text>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               <give id="Wood Sword" count="1"/></text>
 </Dialog>
index 32e6a95a70c85120317fee0148657c8b6da6858f..8d0a0a400f6218b51afe8bc416da8e7416b42df7 100644 (file)
@@ -4,10 +4,10 @@
     <generation type="Random" width="1600"/>
     <time>6000</time>
     <spawnx>-300</spawnx>
-    <npc name="Sanc" hasDialog="true"/>
-    <npc name="Bob" hasDialog="true" spawnx="30"/>
-    <structure type="1" spawnx="300"/>
-    <structure inside="bobshouse.xml" type="1" spawnx="10"/>
+    <npc name="Sanc" hasDialog="true" health="1" x="-316.38254" y="62.999008" dindex="9999"/>
+    <npc name="Bob" hasDialog="true" spawnx="30" health="1" x="262.3949" y="66.698959" dindex="0"/>
+    <structure type="1" spawnx="300" alive="1"/>
+    <structure inside="bobshouse.xml" type="1" spawnx="10" alive="1"/>
 </World>
 
 <Dialog name="Bob">