diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-06-27 21:06:31 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-06-27 21:06:31 -0400 |
commit | 00f633afb62ed6914205639b44dcdaf839a2c2f7 (patch) | |
tree | 5ec98271bb09cd8f1c77c40a8699e0deaadeb942 | |
parent | b202b0d3952e546aaa6d64d42886d9c926f6bd76 (diff) |
redid trees, fixed indoors?
-rw-r--r-- | Changelog | 9 | ||||
-rw-r--r-- | assets/style/classic/bg/forestTileBack.png | bin | 15086 -> 20973 bytes | |||
-rw-r--r-- | assets/style/classic/bg/forestTileFar.png | bin | 28260 -> 23788 bytes | |||
-rw-r--r-- | assets/style/classic/bg/forestTileFront.png | bin | 5703 -> 17530 bytes | |||
-rw-r--r-- | assets/style/classic/bg/forestTileMid.png | bin | 37280 -> 19778 bytes | |||
-rw-r--r-- | include/entities.hpp | 2 | ||||
-rw-r--r-- | include/texture.hpp | 4 | ||||
-rw-r--r-- | include/world.hpp | 1 | ||||
-rw-r--r-- | src/entities.cpp | 8 | ||||
-rw-r--r-- | src/texture.cpp | 7 | ||||
-rw-r--r-- | src/world.cpp | 57 | ||||
-rw-r--r-- | xcf/goodForestTileBack.xcf | bin | 0 -> 154675 bytes | |||
-rw-r--r-- | xcf/goodForestTileFar.xcf | bin | 0 -> 204247 bytes | |||
-rw-r--r-- | xcf/goodForestTileFront.xcf | bin | 0 -> 149663 bytes | |||
-rw-r--r-- | xcf/goodForestTileMid.xcf | bin | 0 -> 154179 bytes | |||
-rw-r--r-- | xcf/goodtree1.xcf | bin | 55512 -> 55512 bytes | |||
-rw-r--r-- | xcf/goodtree2.xcf | bin | 0 -> 64847 bytes | |||
-rw-r--r-- | xcf/goodtree3.xcf | bin | 0 -> 25861 bytes | |||
-rw-r--r-- | xml/playerSpawnHill1.xml | 6 | ||||
-rw-r--r-- | xml/playerSpawnHill1_Building1.xml | 6 | ||||
-rw-r--r-- | xml/town.xml | 12 |
21 files changed, 65 insertions, 47 deletions
@@ -1062,3 +1062,12 @@ - item rendering stuff "I'm also trying to make it so that other entities can use items.. if that makes sense." - Andy + +Late June (6/16/2016 - 6/27/2016) +================================= + + - urging need of decent graphics + - waiting for player sprites + - redid forest trees, mountains, houses + - fixed major issue with entering structures + - exploring more ideas for soundtracks diff --git a/assets/style/classic/bg/forestTileBack.png b/assets/style/classic/bg/forestTileBack.png Binary files differindex f43346c..c3a7daf 100644 --- a/assets/style/classic/bg/forestTileBack.png +++ b/assets/style/classic/bg/forestTileBack.png diff --git a/assets/style/classic/bg/forestTileFar.png b/assets/style/classic/bg/forestTileFar.png Binary files differindex b7cb140..1302130 100644 --- a/assets/style/classic/bg/forestTileFar.png +++ b/assets/style/classic/bg/forestTileFar.png diff --git a/assets/style/classic/bg/forestTileFront.png b/assets/style/classic/bg/forestTileFront.png Binary files differindex 1f5abb2..5b2d250 100644 --- a/assets/style/classic/bg/forestTileFront.png +++ b/assets/style/classic/bg/forestTileFront.png diff --git a/assets/style/classic/bg/forestTileMid.png b/assets/style/classic/bg/forestTileMid.png Binary files differindex 6c4c597..152af65 100644 --- a/assets/style/classic/bg/forestTileMid.png +++ b/assets/style/classic/bg/forestTileMid.png diff --git a/include/entities.hpp b/include/entities.hpp index 2523364..76b6fa8 100644 --- a/include/entities.hpp +++ b/include/entities.hpp @@ -325,7 +325,7 @@ public: class Structures : public Entity { public: BUILD_SUB bsubtype; - World *inWorld; + World *inWorld, *insideWorld; std::string inside; std::string textureLoc; diff --git a/include/texture.hpp b/include/texture.hpp index 0ee3e2c..c301af1 100644 --- a/include/texture.hpp +++ b/include/texture.hpp @@ -47,9 +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 { diff --git a/include/world.hpp b/include/world.hpp index 34a597d..6a97daa 100644 --- a/include/world.hpp +++ b/include/world.hpp @@ -566,6 +566,7 @@ World *loadWorldFromXML(std::string path); * previous world if one was loaded. */ World *loadWorldFromXMLNoSave(std::string path); +World *loadWorldFromXMLNoTakeover(std::string path); /** * Loads a world using a pointer to the current world (used for loading adjacent diff --git a/src/entities.cpp b/src/entities.cpp index 60f49ee..e156ee2 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -320,6 +320,8 @@ Structures::~Structures() { } +extern std::string currentXMLRaw; + void Structures::createFromXML(XMLElement *e, World *w) { float spawnx; @@ -331,6 +333,12 @@ void Structures::createFromXML(XMLElement *e, World *w) inWorld = w; inside = e->StrAttribute("inside"); + + // edge + if (!inside.empty()) { + insideWorld = loadWorldFromXMLNoTakeover(inside); + } + textureLoc = e->StrAttribute("texture"); spawn(static_cast<BUILD_SUB>(e->UnsignedAttribute("type")), diff --git a/src/texture.cpp b/src/texture.cpp index 0f01c83..bdac28e 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -46,7 +46,7 @@ namespace Texture{ GLuint loadTexture(std::string fileName) { SDL_Surface *image; - GLuint object = 0; + static GLuint object = 0; // check if texture is already loaded for(auto &t : LoadedTexture) { @@ -71,9 +71,8 @@ namespace Texture{ /* * Load texture through OpenGL. */ - - glGenTextures(1,&object); // Turns "object" into a texture - glBindTexture(GL_TEXTURE_2D,object); // Binds "object" to the top of the stack + //glGenTextures(1,&object); // Turns "object" into a texture + glBindTexture(GL_TEXTURE_2D,++object); // Binds "object" to the top of the stack glPixelStoref(GL_UNPACK_ALIGNMENT,1); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); // Sets the "min" filter diff --git a/src/world.cpp b/src/world.cpp index 08c788b..8969fb9 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -125,7 +125,7 @@ static const float bgDraw[4][3]={ { 255, 255, 0.1 } }; -static std::string currentXMLRaw; +std::string currentXMLRaw; XMLDocument currentXMLDoc; /* ---------------------------------------------------------------------------- @@ -654,35 +654,22 @@ void World::draw(Player *p) // actually draw the grass. if (wd.groundHeight) { - //glBegin(GL_QUADS); - /*glTexCoord2i(0, 0); glVertex2i(worldStart + i * HLINE , wd.groundHeight + gh[0]); - glTexCoord2i(1, 0); glVertex2i(worldStart + i * HLINE + HLINE / 2, wd.groundHeight + gh[0]); - glTexCoord2i(1, 1); glVertex2i(worldStart + i * HLINE + HLINE / 2, wd.groundHeight - GRASS_HEIGHT); - glTexCoord2i(0, 1); glVertex2i(worldStart + i * HLINE , wd.groundHeight - GRASS_HEIGHT); + c.push_back(std::make_pair(vec2(0, 0),vec3(worldStart + HLINES(i) , wd.groundHeight + gh[0], -3))); + c.push_back(std::make_pair(vec2(1, 0),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight + gh[0], -3))); + c.push_back(std::make_pair(vec2(1, 1),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight - GRASS_HEIGHT, -3))); - glTexCoord2i(0, 0); glVertex2i(worldStart + i * HLINE + HLINE / 2, wd.groundHeight + gh[1]); - glTexCoord2i(1, 0); glVertex2i(worldStart + i * HLINE + HLINE , wd.groundHeight + gh[1]); - glTexCoord2i(1, 1); glVertex2i(worldStart + i * HLINE + HLINE , wd.groundHeight - GRASS_HEIGHT); - glTexCoord2i(0, 1); glVertex2i(worldStart + i * HLINE + HLINE / 2, wd.groundHeight - GRASS_HEIGHT);*/ + c.push_back(std::make_pair(vec2(1, 1),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight - GRASS_HEIGHT, -3))); + c.push_back(std::make_pair(vec2(0, 1),vec3(worldStart + HLINES(i) , wd.groundHeight - GRASS_HEIGHT, -3))); + c.push_back(std::make_pair(vec2(0, 0),vec3(worldStart + HLINES(i) , wd.groundHeight + gh[0], -3))); - c.push_back(std::make_pair(vec2(0, 0),vec3(worldStart + HLINES(i) , wd.groundHeight + gh[0], -3))); - c.push_back(std::make_pair(vec2(1, 0),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight + gh[0], -3))); - c.push_back(std::make_pair(vec2(1, 1),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight - GRASS_HEIGHT, -3))); - c.push_back(std::make_pair(vec2(1, 1),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight - GRASS_HEIGHT, -3))); - c.push_back(std::make_pair(vec2(0, 1),vec3(worldStart + HLINES(i) , wd.groundHeight - GRASS_HEIGHT, -3))); - c.push_back(std::make_pair(vec2(0, 0),vec3(worldStart + HLINES(i) , wd.groundHeight + gh[0], -3))); + c.push_back(std::make_pair(vec2(0, 0),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight + gh[1], -3))); + c.push_back(std::make_pair(vec2(1, 0),vec3(worldStart + HLINES(i) + HLINE , wd.groundHeight + gh[1], -3))); + c.push_back(std::make_pair(vec2(1, 1),vec3(worldStart + HLINES(i) + HLINE , wd.groundHeight - GRASS_HEIGHT, -3))); - - c.push_back(std::make_pair(vec2(0, 0),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight + gh[1], -3))); - c.push_back(std::make_pair(vec2(1, 0),vec3(worldStart + HLINES(i) + HLINE , wd.groundHeight + gh[1], -3))); - c.push_back(std::make_pair(vec2(1, 1),vec3(worldStart + HLINES(i) + HLINE , wd.groundHeight - GRASS_HEIGHT, -3))); - - c.push_back(std::make_pair(vec2(1, 1),vec3(worldStart + HLINES(i) + HLINE , wd.groundHeight - GRASS_HEIGHT, -3))); - c.push_back(std::make_pair(vec2(0, 1),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight - GRASS_HEIGHT, -3))); - c.push_back(std::make_pair(vec2(0, 0),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight + gh[1], -3))); - - //glEnd(); + c.push_back(std::make_pair(vec2(1, 1),vec3(worldStart + HLINES(i) + HLINE , wd.groundHeight - GRASS_HEIGHT, -3))); + c.push_back(std::make_pair(vec2(0, 1),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight - GRASS_HEIGHT, -3))); + c.push_back(std::make_pair(vec2(0, 0),vec3(worldStart + HLINES(i) + HLINE / 2, wd.groundHeight + gh[1], -3))); } } @@ -1803,10 +1790,19 @@ World *loadWorldFromPtr(World *ptr) */ World * +loadWorldFromXMLNoTakeover(std::string path) +{ + loadedLeft = true, loadedRight = true; + auto ret = loadWorldFromXMLNoSave(path); + loadedLeft = false, loadedRight = false; + return ret; +} + +World * loadWorldFromXMLNoSave(std::string path) { XMLDocument *_currentXMLDoc; - std::string _currentXML, - _currentXMLRaw; + static std::string _currentXML, + _currentXMLRaw; XMLElement *wxml; XMLElement *vil; @@ -2000,7 +1996,12 @@ loadWorldFromXMLNoSave(std::string path) { break; } + std::swap(currentXML, _currentXML); + std::swap(currentXMLRaw, _currentXMLRaw); newEntity->createFromXML(wxml, tmp); + std::swap(currentXML, _currentXML); + std::swap(currentXMLRaw, _currentXMLRaw); + std::cout << currentXML << '\n'; //} } diff --git a/xcf/goodForestTileBack.xcf b/xcf/goodForestTileBack.xcf Binary files differnew file mode 100644 index 0000000..fed5120 --- /dev/null +++ b/xcf/goodForestTileBack.xcf diff --git a/xcf/goodForestTileFar.xcf b/xcf/goodForestTileFar.xcf Binary files differnew file mode 100644 index 0000000..9caa87b --- /dev/null +++ b/xcf/goodForestTileFar.xcf diff --git a/xcf/goodForestTileFront.xcf b/xcf/goodForestTileFront.xcf Binary files differnew file mode 100644 index 0000000..b165062 --- /dev/null +++ b/xcf/goodForestTileFront.xcf diff --git a/xcf/goodForestTileMid.xcf b/xcf/goodForestTileMid.xcf Binary files differnew file mode 100644 index 0000000..9c1241b --- /dev/null +++ b/xcf/goodForestTileMid.xcf diff --git a/xcf/goodtree1.xcf b/xcf/goodtree1.xcf Binary files differindex 861cbf0..2fe27bf 100644 --- a/xcf/goodtree1.xcf +++ b/xcf/goodtree1.xcf diff --git a/xcf/goodtree2.xcf b/xcf/goodtree2.xcf Binary files differnew file mode 100644 index 0000000..a959ccd --- /dev/null +++ b/xcf/goodtree2.xcf diff --git a/xcf/goodtree3.xcf b/xcf/goodtree3.xcf Binary files differnew file mode 100644 index 0000000..c19d653 --- /dev/null +++ b/xcf/goodtree3.xcf diff --git a/xml/playerSpawnHill1.xml b/xml/playerSpawnHill1.xml index 3f0e2ce..0566efb 100644 --- a/xml/playerSpawnHill1.xml +++ b/xml/playerSpawnHill1.xml @@ -16,11 +16,11 @@ <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> diff --git a/xml/playerSpawnHill1_Building1.xml b/xml/playerSpawnHill1_Building1.xml index 61b8e16..78dbb54 100644 --- a/xml/playerSpawnHill1_Building1.xml +++ b/xml/playerSpawnHill1_Building1.xml @@ -10,17 +10,17 @@ <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> diff --git a/xml/town.xml b/xml/town.xml index fc5fcd5..f675037 100644 --- a/xml/town.xml +++ b/xml/town.xml @@ -4,23 +4,23 @@ <generation type="Random" width="1600"/> <time>6000</time> <spawnx>-300</spawnx> - <npc name="Sanc" hasDialog="true" health="1" x="-215.47046" y="59.999001" dindex="0"/> - <npc name="Bob" hasDialog="true" spawnx="30" health="1" x="44.280304" y="60.998985" dindex="0"/> + <npc name="Sanc" hasDialog="true" health="1" x="21.680096" y="63.399021" dindex="0"/> + <npc name="Bob" hasDialog="true" spawnx="30" health="1" x="30" y="62.99902" dindex="0"/> <structure type="1" spawnx="300" alive="1"/> <structure inside="bobshouse.xml" type="1" spawnx="10" alive="1"/> </World> <Dialog name="Bob"> <text id="0" nextid="1" pause="true"> - <content> + <content alive="1"> 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'swag, man!"> + <text id="1" pause="true" alive="1"> + <quest assign="Check out m'swag, man!" health="1" x="-0.20029223" y="62.099083" dindex="0"> No description </quest> - <content> + <content health="1" x="176.35571" y="61.999001" dindex="0"> 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> |