]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
ortho template FIX
authorClyne Sullivan <tullivan99@gmail.com>
Thu, 30 Jun 2016 00:19:55 +0000 (20:19 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Thu, 30 Jun 2016 00:19:55 +0000 (20:19 -0400)
brice.dat
main.cpp
xml/bobshouse.xml
xml/town.xml

index 4dad7115c21edf220ed1e407b1d7f9f20b430ea0..2033bae64b8c312af83dfe1243c6508df9c542aa 100644 (file)
--- a/brice.dat
+++ b/brice.dat
@@ -1,7 +1,7 @@
 3
-Slow
-0
-canJump
-0
 canSprint
 1
+canJump
+0
+Slow
+0
index 1bfce773df73ea1450550812c8dedc59bc21aab6..5e06f6b5fdca5b25ea064d7305eafc15c90813f7 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -413,20 +413,21 @@ void render() {
        offset.y = std::max(player->loc.y + player->height / 2, SCREEN_HEIGHT / 2.0f);
 
        // "setup"
-       glm::mat4 projection = glm::ortho(      floor(offset.x-SCREEN_WIDTH/2),         //left
-                                                                               floor(offset.x+SCREEN_WIDTH/2),         //right
-                                                                               floor(offset.y-SCREEN_HEIGHT/2),        //bottom
-                                                                               floor(offset.y+SCREEN_HEIGHT/2),        //top
-                                                                               10.0,                                                           //near
-                                                                               -10.0);                                                         //far
+       glm::mat4 projection = glm::ortho(floor(offset.x - SCREEN_WIDTH / 2),          // left
+                                         floor(offset.x + SCREEN_WIDTH / 2),          // right
+                                         floor(offset.y - SCREEN_HEIGHT / 2),         // bottom
+                                         floor(offset.y + SCREEN_HEIGHT / 2),         // top
+                                         static_cast<decltype(floor(10.0f))>(10.0),   // near
+                                         static_cast<decltype(floor(10.0f))>(-10.0)); // far
 
-       glm::mat4 view = glm::lookAt(glm::vec3(0,0,0.0f),  //pos
-                                                                glm::vec3(0,0,-10.0f), //looking at
-                                                                glm::vec3(0,1.0f,0)); //up vector
+       glm::mat4 view = glm::lookAt(glm::vec3(0.0f, 0.0f, 0.0f),   // pos
+                                                                glm::vec3(0.0f, 0.0f, -10.0f), // looking at
+                                                                glm::vec3(0.0f, 1.0f, 0.0f));  // up vector
 
        glm::mat4 ortho = projection * view;
 
-       glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
        // TODO add depth
     glEnable(GL_DEPTH_TEST);
        //glEnable(GL_CULL_FACE);
index 2d6981366d25839c590451f970e9ed96bd0a9a4d..0319b897e9d7780f8186600f16c0b747e0bf174a 100644 (file)
@@ -3,5 +3,5 @@
     <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" health="1" x="-229.27991" y="0" dindex="9999"/>
+    <npc name="Bob" hasDialog="false" spawnx="30" health="1" x="-275.90805" y="0" dindex="9999"/>
 </IndoorWorld>
index b9da09c711a17e61e4fb05f800717c11c3d69e24..32ee1ccc1e6dc4c578c4eb64d2c45a9ad37828bf 100644 (file)
@@ -4,8 +4,8 @@
     <generation type="Random" width="1600"/>
     <time>6000</time>
     <spawnx>-300</spawnx>
-    <npc name="Sanc" hasDialog="true" health="1" x="464.45755" y="65.399185" dindex="0"/>
-    <npc name="Bob" hasDialog="true" spawnx="30" health="1" x="-772.5" y="59.999001" dindex="0"/>
+    <npc name="Sanc" hasDialog="true" health="1" x="287.3468" y="66.099106" dindex="9999"/>
+    <npc name="Bob" hasDialog="true" spawnx="30" health="1" x="-630.755" y="65.798988" dindex="0"/>
     <structure type="1" spawnx="300" alive="1"/>
     <structure inside="bobshouse.xml" type="1" spawnx="10" alive="1"/>
     <chest alive="1"/>