diff --git a/src/duskdefs.env b/src/duskdefs.env index ae57014..03af4e3 100644 --- a/src/duskdefs.env +++ b/src/duskdefs.env @@ -3,16 +3,29 @@ # This software is released under the MIT License. # https://opensource.org/licenses/MIT +ENTITY_DIR_SOUTH = 0 +ENTITY_DIR_WEST = 1 +ENTITY_DIR_NORTH = 2 +ENTITY_DIR_EAST = 3 + CHUNK_WIDTH = 16 CHUNK_HEIGHT = 16 CHUNK_DEPTH = 4 # CHUNK_VERTEX_COUNT_MAX = QUAD_VERTEXES * CHUNK_WIDTH * CHUNK_HEIGHT * 4 CHUNK_VERTEX_COUNT_MAX=6144 +CHUNK_MESH_COUNT_MAX = 14 TILE_WIDTH = 16.0 TILE_HEIGHT = 16.0 TILE_DEPTH = 16.0 +TILE_SHAPE_NULL = 0 +TILE_SHAPE_FLOOR = 1 +TILE_SHAPE_RAMP_SOUTH = 2 +TILE_SHAPE_RAMP_EAST = 3 +TILE_SHAPE_RAMP_NORTH = 4 +TILE_SHAPE_RAMP_WEST = 5 + RPG_CAMERA_FOV = 70 RPG_CAMERA_PIXELS_PER_UNIT = 1.0 RPG_CAMERA_Z_OFFSET = 24.0 diff --git a/src/rpg/entity/entitydir.h b/src/rpg/entity/entitydir.h index 4332b76..3b34b6e 100644 --- a/src/rpg/entity/entitydir.h +++ b/src/rpg/entity/entitydir.h @@ -9,11 +9,6 @@ #include "rpg/world/worldpos.h" typedef enum { - ENTITY_DIR_SOUTH = 0, - ENTITY_DIR_EAST = 1, - ENTITY_DIR_WEST = 2, - ENTITY_DIR_NORTH = 3, - ENTITY_DIR_UP = ENTITY_DIR_NORTH, ENTITY_DIR_DOWN = ENTITY_DIR_SOUTH, ENTITY_DIR_LEFT = ENTITY_DIR_WEST, diff --git a/src/rpg/world/chunk.h b/src/rpg/world/chunk.h index 9f3fa14..9187ced 100644 --- a/src/rpg/world/chunk.h +++ b/src/rpg/world/chunk.h @@ -10,11 +10,6 @@ #include "worldpos.h" #include "display/mesh/quad.h" -#define CHUNK_VERTEX_COUNT_MAX ( \ - QUAD_VERTEX_COUNT * CHUNK_WIDTH * CHUNK_HEIGHT * 4 \ -) -#define CHUNK_MESH_COUNT_MAX 14 - typedef struct chunk_s { chunkpos_t position; tile_t tiles[CHUNK_TILE_COUNT]; diff --git a/tools/editortool/map/tile.py b/tools/editortool/map/tile.py index 1f1555c..0753b38 100644 --- a/tools/editortool/map/tile.py +++ b/tools/editortool/map/tile.py @@ -1,9 +1,11 @@ from OpenGL.GL import * from editortool.map.mapdefs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH, CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH +from enum import Enum class Tile: - def __init__(self, chunk, x, y, z, tileIndex): - self.tileId = 0 + def __init__(self, chunk, x, y, z): + self.shape = TILE_SHAPE_NULL + self.chunk = chunk self.x = x self.y = y @@ -14,7 +16,7 @@ class Tile: self.posZ = z * TILE_DEPTH + chunk.z * CHUNK_DEPTH * TILE_DEPTH def buffer(self, vertexBuffer): - if self.z != 0: + if self.shape == TILE_SHAPE_NULL: return # if self.x != 0 or self.y != 0 or self.z != 0: # return # Only buffer the tile at (0,0,0) diff --git a/tools/editortool/maptool.py b/tools/editortool/maptool.py index 4bac1f2..dca094a 100644 --- a/tools/editortool/maptool.py +++ b/tools/editortool/maptool.py @@ -7,7 +7,7 @@ from editortool.map.mapinfopanel import MapInfoPanel from editortool.map.menubar import MapMenubar from editortool.map.statusbar import StatusBar from editortool.map.map import Map -from editortool.map.mapdefs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH +from editortool.map.mapdefs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH from editortool.map.selectbox import SelectBox from editortool.map.camera import Camera from editortool.map.grid import Grid @@ -101,9 +101,9 @@ class MapWindow(QMainWindow): amtZ = -1 if event.modifiers() & Qt.ShiftModifier: - amtX *= int(TILE_WIDTH) - amtY *= int(TILE_HEIGHT) - amtZ *= int(TILE_DEPTH) + amtX *= CHUNK_WIDTH + amtY *= CHUNK_HEIGHT + amtZ *= CHUNK_DEPTH if amtX != 0 or amtY != 0 or amtZ != 0: self.map.moveRelative(amtX, amtY, amtZ)