]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
Sprites are good. Merged.
authorAndy <drumsetmonkey@gmail.com>
Fri, 23 Dec 2016 13:42:15 +0000 (08:42 -0500)
committerAndy <drumsetmonkey@gmail.com>
Fri, 23 Dec 2016 13:42:15 +0000 (08:42 -0500)
1  2 
include/common.hpp
include/components.hpp
include/engine.hpp
main.cpp
src/common.cpp
src/components.cpp
src/engine.cpp
src/ui.cpp
src/world.cpp

Simple merge
index 2a8680d1b22053c8084b7b615c30e2cf7b1b05ef,bbf153a71e1db8925eec9c0e6bdd9854a77ca8ca..5c067dd24717c80241b2d75ede544d634a95686c
@@@ -125,33 -125,12 +125,36 @@@ struct Solid 
  };
  
  struct SpriteData {
-       SpriteData(std::string path, vec2 offset):
-               offset(offset) {
-                       pic = Texture::loadTexture(path);
-                       size = Texture::imageDim(path);
++      
++      SpriteData(std::string path, vec2 off):
++              offset(off) {
++                      tex = Texture(path);
++                      size = tex.getDim();
++                      
 +                      size_tex = vec2(1.0, 1.0);
 +                      
 +                      offset_tex.x = offset.x/size.x;
 +                      offset_tex.y = offset.y/size.y;
 +      }
 +
-       SpriteData(std::string path, vec2 offset, vec2 size):
-               offset(offset), size(size) {
-                       pic = Texture::loadTexture(path);
-                       vec2 tmpsize = Texture::imageDim(path);
++      SpriteData(std::string path, vec2 off, vec2 si):
++              size(si), offset(off) {
++                      tex = Texture(path);
++                      vec2 tmpsize = tex.getDim();
  
 -      SpriteData(std::string path, vec2 offset)
 -              : tex(path), offset(offset) {}
 +                      size_tex.x = size.x/tmpsize.x;
 +                      size_tex.y = size.y/tmpsize.y;
++                      
 +                      offset_tex.x = offset.x/tmpsize.x;
 +                      offset_tex.y = offset.y/tmpsize.y;
 +      }
  
-       GLuint pic;
+       Texture tex;
++      vec2 size;
        vec2 offset;
-       vec2 size;
++      
 +      vec2 offset_tex;
 +      vec2 size_tex;
  };
  
  using Frame = std::vector<std::pair<SpriteData, vec2>>;
index 1c5f5100ea7b45766de2661b1ef2b7733290412d,52569e7c7517e7898fe15cf869113d4d48c1ae2e..2b036967ba24ea2651dd1d343a0f03eaa48b64b9
@@@ -18,11 -34,27 +34,28 @@@ public
  
        explicit Engine(void);
  
+       /**
+        * Initializes the game engine, and all systems used within it.
+        */
        void init(void);
+       /**
+        * Updates all rendering systems.
+        * @param dt the delta time
+        */
      void render(entityx::TimeDelta dt);
 +      void resetRender(entityx::TimeDelta dt);
+       /**
+        * Updates all logic systems.
+        * @param dt the delta time
+        */
        void update(entityx::TimeDelta dt);
  
+       /**
+        * A shortcut to get a system, for calling system-specific functions.
+        * Takes the type of the desired system.
+        */
        template<typename T>
        inline T* getSystem(void) {
                return dynamic_cast<T*>(systems.system<T>().get());
diff --cc main.cpp
index 663173661e692ebb0aa4da0bd81e79158800cbb4,7fc165877428eb811bdc98ca0656727b88d2afe1..17499f71a644e22c83ee7d0713c949bd19eca2c4
+++ b/main.cpp
@@@ -124,14 -131,10 +131,12 @@@ int main(int argc, char *argv[]
        game::briceLoad();
        game::briceUpdate();
  
 -      //
 +      // load sprites used in the inventory menu. See src/inventory.cpp
 +      //initInventorySprites();
 +
-       // load mouse texture, and other inventory textures
-       mouseTex = Texture::loadTexture("assets/goodmouse.png");
        // get a world
+       //
        if (xmlFolder.empty())
                xmlFolder = "xml/";
  
                const bool &run = game::engine.shouldRun;
                while (run) {
                        render();
 -                      game::engine.render(0);
 +                      game::engine.resetRender(0);
                }
  
+               // on game end, get back together
                thMain.join();
                thDebug.join();
-               //game::engine.getSystem<WorldSystem>()->thAmbient.join();
+               //game::engine.getSystem<WorldSystem>()->thAmbient.join(); // segfault or something
        }
  
-       // put away the brice for later
+       //
+       // put away the brice for later, save world
+       //
        game::briceSave();
+       worldSys->save();
+       //
+       // close things, free stuff, yada yada
+       //
  
-       // free library resources
      Mix_HaltMusic();
      Mix_CloseAudio();
  
  }
  
  void render() {
-       const auto SCREEN_WIDTH = game::SCREEN_WIDTH;
-       const auto SCREEN_HEIGHT = game::SCREEN_HEIGHT;
 -      static const Texture mouseTex ("assets/mouse.png");
++      static const Texture mouseTex ("assets/goodmouse.png");
+       static const 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
+       );
+       static const auto& SCREEN_WIDTH2  = game::SCREEN_WIDTH / 2.0f;
+       static const auto& SCREEN_HEIGHT2 = game::SCREEN_HEIGHT / 2.0f;
+       //
+       // set the ortho
+       //
  
        auto ps = game::engine.getSystem<PlayerSystem>();
        auto ploc = ps->getPosition();
        // draw the mouse
        Render::textShader.use();
                glActiveTexture(GL_TEXTURE0);
-               glBindTexture(GL_TEXTURE_2D, mouseTex);
+               mouseTex.use();
                Render::useShader(&Render::textShader);
 -              Render::drawRect(ui::mouse, ui::mouse + 15, -9.9);
 +              Render::drawRect(vec2(ui::mouse.x, ui::mouse.y - 64), vec2(ui::mouse.x + 64, ui::mouse.y), -9.9);
        Render::textShader.unuse();
  }
- void logic(){
- //    static bool NPCSelected    = false;
- //    static bool ObjectSelected = false;
-       // exit the game if the player falls out of the world
-       /*if (player->loc.y < 0)
-               game::endGame();*/
-       /*if (player->inv->usingi) {
-               for (auto &e : currentWorld->entity) {
-                       if (player->inv->usingi && !e->isHit() &&
-                               player->inv->detectCollision(vec2 { e->loc.x, e->loc.y }, vec2 { e->loc.x + e->width, e->loc.y + e->height})) {
-                               e->takeHit(25, 10);
-                               break;
-                       }
-               }
-               player->inv->usingi = false;
-       }*/
-       /*for (auto &e : currentWorld->entity) {
-               if (e->isAlive() && ((e->type == NPCT) || (e->type == MERCHT) || (e->type == OBJECTT))) {
-                       if (e->type == OBJECTT && ObjectSelected) {
-                               e->near = false;
-                               continue;
-                       } else if (e->canMove) {
-                               if (!currentWorld->goWorldLeft(dynamic_cast<NPC *>(e)))
-                                       currentWorld->goWorldRight(dynamic_cast<NPC *>(e));
-                               e->wander((rand() % 120 + 30));
-                               if (NPCSelected) {
-                                       e->near = false;
-                                       continue;
-                               }
-                       }
-                       if(e->isInside(ui::mouse) && player->isNear(e)) {
-                               e->near = true;
-                               if (e->type == OBJECTT)
-                                       ObjectSelected = true;
-                               else
-                                       NPCSelected = true;
-                               if ((SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_RIGHT)) && !ui::dialogBoxExists) {
-                                       if (ui::mouse.x < player->loc.x && player->right)
-                                               player->left = true, player->right = false;
-                                       else if(ui::mouse.x > player->loc.x && player->left)
-                                               player->right = true, player->left = false;
-                                       e->interact();
-                               }
-                       } else {
-                               e->near = false;
-                       }
-               } else if (e->type == MOBT) {
-                       e->near = player->isNear(e);
-                       e->wander();
-               }
-       }*/
-       // calculate the world shading value
-       worldShade = 50 * sin((game::time::getTickCount() + (DAY_CYCLE / 2)) / (DAY_CYCLE / PI));
-       // update fades
-       ui::fadeUpdate();
-       // create weather particles if necessary
-       /*auto weather = game::engine.getSystem<WorldSystem>()->getWeatherId();
-       auto worldWidth = game::engine.getSystem<WorldSystem>()->getWidth();
-       if (weather == WorldWeather::Rain) {
-               for (unsigned int r = (randGet() % 25) + 11; r--;) {
-                       currentWorld->addParticle(randGet() % worldWidth - (worldWidth / 2),
-                                                                         offset.y + game::SCREEN_HEIGHT / 2,
-                                                                         HLINES(1.25),                                                                         // width
-                                                                         HLINES(1.25),                                                                         // height
-                                                                         randGet() % 7 * .01 * (randGet() % 2 == 0 ? -1 : 1),  // vel.x
-                                                                         (4 + randGet() % 6) * .05,                                                    // vel.y
-                                                                         { 0, 0, 255 },                                                                                // RGB color
-                                                                         2500,                                                                                         // duration (ms)
-                                                                         (1 << 0) | (1 << 1)                                                                   // gravity and bounce
-                                                                         );
-               }
-       } else if (weather == WorldWeather::Snowy) {
-               for (unsigned int r = (randGet() % 25) + 11; r--;) {
-                       currentWorld->addParticle(randGet() % worldWidth - (worldWidth / 2),
-                                                                         offset.y + game::SCREEN_HEIGHT / 2,
-                                                                         HLINES(1.25),                                                                         // width
-                                                                         HLINES(1.25),                                                                         // height
-                                                       .0001 + randGet() % 7 * .01 * (randGet() % 2 == 0 ? -1 : 1),    // vel.x
-                                                                         (4 + randGet() % 6) * -.03,                                                   // vel.y
-                                                                         { 255, 255, 255 },                                                                    // RGB color
-                                                                         5000,                                                                                         // duration (ms)
-                                                                         0                                                                                                     // no gravity, no bounce
-                                                                         );
-               }
-       }*/
-       // increment game ticker
-       game::time::tick();
-       //NPCSelected = false;
-       //ObjectSelected = false;
- }
diff --cc src/common.cpp
Simple merge
index 323dfc85008a8f8b1f38556b43956600819d10d8,f95f46f7b6abd81209dd805174c72433c2b12cda..7322208386fa64ed8108bdf4c6913e4b6eb18260
@@@ -19,13 -21,11 +21,11 @@@ void MovementSystem::update(entityx::En
                position.x += direction.x * dt;
                position.y += direction.y * dt;
  
--              if (entity.has_component<Animate>() && entity.has_component<Sprite>()) {
-                       if (direction.x) {
-                               entity.component<Animate>()->nextFrame(entity.component<Sprite>()->sprite);
-                       } else {
-                               entity.component<Animate>()->firstFrame(entity.component<Sprite>()->sprite);
-                       }
-               }
++              /*if (entity.has_component<Animate>() && entity.has_component<Sprite>()) {
+                       auto animate = entity.component<Animate>();
+                       entity.component<Sprite>()->sprite = 
+                               (direction.x != 0) ? animate->nextFrame() : animate->firstFrame();
 -              }
++              }*/
                if (entity.has_component<Dialog>() && entity.component<Dialog>()->talking) {
                        direction.x = 0;
                } else {
@@@ -82,41 -82,34 +82,36 @@@ void RenderSystem::update(entityx::Enti
        en.each<Visible, Sprite, Position>([dt](entityx::Entity entity, Visible &visible, Sprite &sprite, Position &pos) {
                (void)entity;
                // Verticies and shit
 -              GLfloat tex_coord[] = {0.0, 0.0,
 -                                                         1.0, 0.0,
 -                                                         1.0, 1.0,
 -
 -                                                         1.0, 1.0,
 -                                                         0.0, 1.0,
 -                                                         0.0, 0.0};
 +              float its = 0;
 +              for (auto &S : sprite.sprite) {
 +                      auto sp = S.first;
-                       float width = HLINES(S.first.size.x);
-                       float height = HLINES(S.first.size.y);
++                      auto size = sp.size * game::HLINE;
 +                      vec2 drawOffset(HLINES(S.second.x), HLINES(S.second.y));
 +                      vec2 loc(pos.x + drawOffset.x, pos.y + drawOffset.y);
  
 -              GLfloat tex_coordL[] = {1.0, 0.0,
 -                                                              0.0, 0.0,
 -                                                              0.0, 1.0,
 +                      GLfloat tex_coord[] = {sp.offset_tex.x,                                 sp.offset_tex.y,
 +                                                                 sp.offset_tex.x + sp.size_tex.x, sp.offset_tex.y,
 +                                                                 sp.offset_tex.x + sp.size_tex.x, sp.offset_tex.y + sp.size_tex.y,
  
 -                                                              0.0, 1.0,
 -                                                              1.0, 1.0,
 -                                                              1.0, 0.0};
 +                                                                 sp.offset_tex.x + sp.size_tex.x, sp.offset_tex.y + sp.size_tex.y,
 +                                                                 sp.offset_tex.x,                             sp.offset_tex.y + sp.size_tex.y,
 +                                                                 sp.offset_tex.x,                             sp.offset_tex.y};
  
 -              for (auto &S : sprite.sprite) {
 -                      const auto& size = S.first.tex.getDim() * game::HLINE;
 +                      if(sprite.faceLeft) {
 +                              glm::mat4 scale = glm::scale(glm::mat4(1.0f), glm::vec3(-1.0f,1.0f,1.0f));
-                               glm::mat4 translate = glm::translate(glm::mat4(1.0f), glm::vec3(0-width-pos.x*2, 0.0f, 0.0f));
++                              glm::mat4 translate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f - size.x - pos.x * 2.0f, 0.0f, 0.0f));
  
 -                      vec2 loc = vec2(pos.x + S.first.offset.x, pos.y + S.first.offset.y);
 +                              glm::mat4 mov = scale * translate;
 +                              glUniformMatrix4fv(Render::worldShader.uniform[WU_transform], 1, GL_FALSE, glm::value_ptr(mov));
-                       } else {
-                               
 +                      }
  
 -                      GLfloat coords[] = {loc.x,                      loc.y,                  visible.z,
 -                                                              loc.x + size.x, loc.y,                  visible.z,
 -                                                              loc.x + size.x, loc.y + size.y, visible.z,
 +                      GLfloat coords[] = {loc.x,                      loc.y,                  visible.z + its,
-                                                               loc.x + width,  loc.y,                  visible.z + its,
-                                                               loc.x + width,  loc.y + height, visible.z + its,
++                                                              loc.x + size.x, loc.y,                  visible.z + its,
++                                                              loc.x + size.x, loc.y + size.y, visible.z + its,
  
-                                                               loc.x + width,  loc.y + height, visible.z + its,
-                                                               loc.x,                  loc.y + height, visible.z + its,
 -                                                              loc.x + size.x, loc.y + size.y, visible.z,
 -                                                              loc.x,                  loc.y + size.y, visible.z,
 -                                                              loc.x,                  loc.y,                  visible.z};
++                                                              loc.x + size.x, loc.y + size.y, visible.z + its,
++                                                              loc.x,                  loc.y + size.y, visible.z + its,
 +                                                              loc.x,                  loc.y,                  visible.z + its};
  
  
                        // make the entity hit flash red
                                glUniform4f(Render::worldShader.uniform[WU_tex_color], 1.0, flashAmt, flashAmt, 1.0);
                        }*/
  
-                       glBindTexture(GL_TEXTURE_2D, S.first.pic);
 -                      S.first.tex.use();
++                      sp.tex.use();
  
                        glUniform1i(Render::worldShader.uniform[WU_texture], 0);
                        Render::worldShader.enable();
diff --cc src/engine.cpp
Simple merge
diff --cc src/ui.cpp
index 84bb55f0ca02b4727c4ebef62b857271e58f1970,9f0e0148ab477e9672722e787b02dd82fa0e2f67..6383cca2cd27224c425a1ebea11b9ca11190ca67
@@@ -739,56 -675,56 +675,56 @@@ namespace ui 
                                c2.x,                                           c2.y,                                    z,     1.0f, 1.0f,
  
                                c2.x,                                           c2.y,                                    z, 1.0f, 1.0f,
-                                       c2.x - box_corner_dim.x,        c2.y,                                    z, 0.5f, 1.0f,
-                               c2.x - box_corner_dim.x,        c2.y - box_corner_dim.y, z,     0.5f, 0.5f};
+                                       c2.x - boxCornerDim2.x,         c2.y,                                    z, 0.5f, 1.0f,
+                               c2.x - boxCornerDim2.x,         c2.y - boxCornerDim2.y, z,      0.5f, 0.5f};
  
-               GLfloat box_lr[] = {c2.x - box_corner_dim.x,    c1.y,                                    z,     0.5f, 0.0f,
+               GLfloat box_lr[] = {c2.x - boxCornerDim2.x,     c1.y,                                    z,     0.5f, 0.0f,
                                c2.x,                                           c1.y,                                    z,     1.0f, 0.0f,
-                               c2.x,                                           c1.y + box_corner_dim.y, z,     1.0f, 0.5f,
+                               c2.x,                                           c1.y + boxCornerDim2.y, z,      1.0f, 0.5f,
  
-                               c2.x,                                           c1.y + box_corner_dim.y, z, 1.0f, 0.5f,
-                                       c2.x - box_corner_dim.x,        c1.y + box_corner_dim.y, z, 0.5f, 0.5f,
-                               c2.x - box_corner_dim.x,        c1.y,                                    z,     0.5f, 0.0f};
+                               c2.x,                                           c1.y + boxCornerDim2.y, z, 1.0f, 0.5f,
 -                                      c2.x - boxCornerDim2.x,         c1.y + boxCornerDim2.y, z, 0.0f, 0.5f,
++                                      c2.x - boxCornerDim2.x,         c1.y + boxCornerDim2.y, z, 0.5f, 0.5f,
+                               c2.x - boxCornerDim2.x,         c1.y,                                    z,     0.5f, 0.0f};
  
-               GLfloat box_l[] =  {c1.x,                                               c1.y + box_corner_dim.y, z, 0.0f, 0.0f,
-                                                       c1.x + box_corner_dim.x,        c1.y + box_corner_dim.y, z, 0.5f, 0.0f,
-                                                       c1.x + box_corner_dim.x,        c2.y - box_corner_dim.y, z, 0.5f, 1.0f,
+               GLfloat box_l[] =  {c1.x,                                               c1.y + boxCornerDim2.y, z, 0.0f, 0.0f,
+                                                       c1.x + boxCornerDim2.x, c1.y + boxCornerDim2.y, z, 0.5f, 0.0f,
+                                                       c1.x + boxCornerDim2.x, c2.y - boxCornerDim2.y, z, 0.5f, 1.0f,
  
-                                                       c1.x + box_corner_dim.x,        c2.y - box_corner_dim.y, z, 0.5f, 1.0f,
-                                                       c1.x,                                           c2.y - box_corner_dim.y, z, 0.0f, 1.0f,
-                                                       c1.x,                                           c1.y + box_corner_dim.y, z, 0.0f, 0.0f};
+                                                       c1.x + boxCornerDim2.x, c2.y - boxCornerDim2.y, z, 0.5f, 1.0f,
+                                                       c1.x,                                           c2.y - boxCornerDim2.y, z, 0.0f, 1.0f,
+                                                       c1.x,                                           c1.y + boxCornerDim2.y, z, 0.0f, 0.0f};
  
-               GLfloat box_r[] =  {c2.x - box_corner_dim.x,    c1.y + box_corner_dim.y, z, 0.5f, 0.0f,
-                                                       c2.x,                                           c1.y + box_corner_dim.y, z, 1.0f, 0.0f,
-                                                       c2.x,                                           c2.y - box_corner_dim.y, z, 1.0f, 1.0f,
+               GLfloat box_r[] =  {c2.x - boxCornerDim2.x,     c1.y + boxCornerDim2.y, z, 0.5f, 0.0f,
+                                                       c2.x,                                           c1.y + boxCornerDim2.y, z, 1.0f, 0.0f,
+                                                       c2.x,                                           c2.y - boxCornerDim2.y, z, 1.0f, 1.0f,
  
-                                                       c2.x,                                           c2.y - box_corner_dim.y, z, 1.0f, 1.0f,
-                                                       c2.x - box_corner_dim.x,        c2.y - box_corner_dim.y, z, 0.5f, 1.0f,
-                                                       c2.x - box_corner_dim.x,        c1.y + box_corner_dim.y, z, 0.5f, 0.0f};
+                                                       c2.x,                                           c2.y - boxCornerDim2.y, z, 1.0f, 1.0f,
+                                                       c2.x - boxCornerDim2.x, c2.y - boxCornerDim2.y, z, 0.5f, 1.0f,
+                                                       c2.x - boxCornerDim2.x, c1.y + boxCornerDim2.y, z, 0.5f, 0.0f};
  
-         GLfloat box_b[] =  {c1.x + box_corner_dim.x,  c1.y,                                    z,     0.0f, 0.0f,
-                                                       c2.x - box_corner_dim.x,        c1.y,                                    z, 1.0f, 0.0f,
-                                                       c2.x - box_corner_dim.x,        c1.y + box_corner_dim.y, z,     1.0f, 0.5f,
+         GLfloat box_b[] =  {c1.x + boxCornerDim2.x,   c1.y,                                    z,     0.0f, 0.0f,
+                                                       c2.x - boxCornerDim2.x, c1.y,                                    z, 1.0f, 0.0f,
+                                                       c2.x - boxCornerDim2.x, c1.y + boxCornerDim2.y, z,      1.0f, 0.5f,
  
-                                                       c2.x - box_corner_dim.x,        c1.y + box_corner_dim.y, z,     1.0f, 0.5f,
-                                                       c1.x + box_corner_dim.x,        c1.y + box_corner_dim.y, z, 0.0f, 0.5f,
-                                                       c1.x + box_corner_dim.x,        c1.y,                                    z, 0.0f, 0.0f};
+                                                       c2.x - boxCornerDim2.x, c1.y + boxCornerDim2.y, z,      1.0f, 0.5f,
+                                                       c1.x + boxCornerDim2.x, c1.y + boxCornerDim2.y, z, 0.0f, 0.5f,
+                                                       c1.x + boxCornerDim2.x, c1.y,                                    z, 0.0f, 0.0f};
  
-         GLfloat box_t[] =  {c1.x + box_corner_dim.x,  c2.y - box_corner_dim.y, z,     0.0f, 0.5f,
-                                                       c2.x - box_corner_dim.x,        c2.y - box_corner_dim.y, z, 1.0f, 0.5f,
-                                                       c2.x - box_corner_dim.x,        c2.y,                                    z,     1.0f, 1.0f,
+         GLfloat box_t[] =  {c1.x + boxCornerDim2.x,   c2.y - boxCornerDim2.y, z,      0.0f, 0.5f,
+                                                       c2.x - boxCornerDim2.x, c2.y - boxCornerDim2.y, z, 1.0f, 0.5f,
+                                                       c2.x - boxCornerDim2.x, c2.y,                                    z,     1.0f, 1.0f,
  
-                                                       c2.x - box_corner_dim.x,        c2.y,                                    z,     1.0f, 1.0f,
-                                                       c1.x + box_corner_dim.x,        c2.y,                                    z, 0.0f, 1.0f,
-                                                       c1.x + box_corner_dim.x,        c2.y - box_corner_dim.y, z, 0.0f, 0.5f};
+                                                       c2.x - boxCornerDim2.x, c2.y,                                    z,     1.0f, 1.0f,
+                                                       c1.x + boxCornerDim2.x, c2.y,                                    z, 0.0f, 1.0f,
+                                                       c1.x + boxCornerDim2.x, c2.y - boxCornerDim2.y, z, 0.0f, 0.5f};
  
-               GLfloat box_f[] =  {c1.x + box_corner_dim.x,    c1.y + box_corner_dim.y, z, 0.5f, 0.5f,
-                                                       c2.x - box_corner_dim.x,        c1.y + box_corner_dim.y, z, 0.5f, 0.5f,
-                                                       c2.x - box_corner_dim.x,        c2.y - box_corner_dim.y, z, 0.5f, 0.5f,
+               GLfloat box_f[] =  {c1.x + boxCornerDim2.x,     c1.y + boxCornerDim2.y, z, 0.5f, 0.5f,
+                                                       c2.x - boxCornerDim2.x, c1.y + boxCornerDim2.y, z, 0.5f, 0.5f,
+                                                       c2.x - boxCornerDim2.x, c2.y - boxCornerDim2.y, z, 0.5f, 0.5f,
  
-                                                       c2.x - box_corner_dim.x,        c2.y - box_corner_dim.y, z, 0.5f, 0.5f,
-                                                       c1.x + box_corner_dim.x,        c2.y - box_corner_dim.y, z, 0.5f, 0.5f,
-                                                       c1.x + box_corner_dim.x,        c1.y + box_corner_dim.y, z, 0.5f, 0.5f};
+                                                       c2.x - boxCornerDim2.x, c2.y - boxCornerDim2.y, z, 0.5f, 0.5f,
+                                                       c1.x + boxCornerDim2.x, c2.y - boxCornerDim2.y, z, 0.5f, 0.5f,
+                                                       c1.x + boxCornerDim2.x, c1.y + boxCornerDim2.y, z, 0.5f, 0.5f};
  
                glActiveTexture(GL_TEXTURE0);
                glUniform1f(Render::textShader.uniform[WU_texture], 0);
diff --cc src/world.cpp
Simple merge