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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]} \ No newline at end of file diff --git a/assets/map/map/1_0_0.json b/assets/map/map/1_0_0.json index ddfdd0c..099f1c7 100644 --- a/assets/map/map/1_0_0.json +++ b/assets/map/map/1_0_0.json @@ -1,37 +1 @@ -{ - "shapes": [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]} \ No newline at end of file diff --git a/src/asset/type/assetchunk.c b/src/asset/type/assetchunk.c index 7a3481f..1c3ce8c 100644 --- a/src/asset/type/assetchunk.c +++ b/src/asset/type/assetchunk.c @@ -112,15 +112,19 @@ errorret_t assetChunkLoad(assetcustom_t custom) { } // Init the mesh - mesh_t *mesh = &chunk->meshes[i]; - meshInit( - mesh, - MESH_PRIMITIVE_TRIANGLES, - modelHeader.vertexCount, - &chunk->vertices[vertexIndex] - ); + if(modelHeader.vertexCount > 0) { + mesh_t *mesh = &chunk->meshes[i]; + meshInit( + mesh, + MESH_PRIMITIVE_TRIANGLES, + modelHeader.vertexCount, + &chunk->vertices[vertexIndex] + ); - vertexIndex += modelHeader.vertexCount; + vertexIndex += modelHeader.vertexCount; + } else { + chunk->meshes[i].vertexCount = 0; + } } errorOk(); diff --git a/src/duskdefs.env b/src/duskdefs.env index bf5c40f..1b5880f 100644 --- a/src/duskdefs.env +++ b/src/duskdefs.env @@ -25,6 +25,10 @@ TILE_SHAPE_RAMP_SOUTH = 2 TILE_SHAPE_RAMP_WEST = 3 TILE_SHAPE_RAMP_EAST = 4 TILE_SHAPE_RAMP_NORTH = 5 +TILE_SHAPE_RAMP_SOUTHWEST = 6 +TILE_SHAPE_RAMP_SOUTHEAST = 7 +TILE_SHAPE_RAMP_NORTHWEST = 8 +TILE_SHAPE_RAMP_NORTHEAST = 9 RPG_CAMERA_FOV = 70 RPG_CAMERA_PIXELS_PER_UNIT = 1.0 diff --git a/src/rpg/entity/entity.c b/src/rpg/entity/entity.c index c7542e7..fc158a8 100644 --- a/src/rpg/entity/entity.c +++ b/src/rpg/entity/entity.c @@ -84,8 +84,30 @@ void entityWalk(entity_t *entity, const entitydir_t direction) { // Are we walking up a ramp? if( tileIsRamp(tileCurrent) && - (direction+TILE_SHAPE_RAMP_SOUTH) == tileCurrent && - newPos.z < (MAP_CHUNK_DEPTH - 1) + ( + // Can only walk UP the direction the ramp faces. + (direction+TILE_SHAPE_RAMP_SOUTH) == tileCurrent || + // If diagonal ramp, can go up one of two ways only. + ( + ( + tileCurrent == TILE_SHAPE_RAMP_SOUTHEAST && + (direction == ENTITY_DIR_SOUTH || direction == ENTITY_DIR_EAST) + ) || + ( + tileCurrent == TILE_SHAPE_RAMP_SOUTHWEST && + (direction == ENTITY_DIR_SOUTH || direction == ENTITY_DIR_WEST) + ) || + ( + tileCurrent == TILE_SHAPE_RAMP_NORTHEAST && + (direction == ENTITY_DIR_NORTH || direction == ENTITY_DIR_EAST) + ) || + ( + tileCurrent == TILE_SHAPE_RAMP_NORTHWEST && + (direction == ENTITY_DIR_NORTH || direction == ENTITY_DIR_WEST) + ) + ) + // Must be able to walk up. + ) && newPos.z < (MAP_CHUNK_DEPTH - 1) ) { tileNew = TILE_SHAPE_NULL;// Force check for ramp above. worldpos_t abovePos = newPos; @@ -104,7 +126,29 @@ void entityWalk(entity_t *entity, const entitydir_t direction) { if( tileBelow != TILE_SHAPE_NULL && tileIsRamp(tileBelow) && - (entityDirGetOpposite(direction)+TILE_SHAPE_RAMP_SOUTH) == tileBelow + ( + // This handles regular cardinal ramps + (entityDirGetOpposite(direction)+TILE_SHAPE_RAMP_SOUTH) == tileBelow || + // This handles diagonal ramps + ( + ( + tileBelow == TILE_SHAPE_RAMP_SOUTHEAST && + (direction == ENTITY_DIR_NORTH || direction == ENTITY_DIR_WEST) + ) || + ( + tileBelow == TILE_SHAPE_RAMP_SOUTHWEST && + (direction == ENTITY_DIR_NORTH || direction == ENTITY_DIR_EAST) + ) || + ( + tileBelow == TILE_SHAPE_RAMP_NORTHEAST && + (direction == ENTITY_DIR_SOUTH || direction == ENTITY_DIR_WEST) + ) || + ( + tileBelow == TILE_SHAPE_RAMP_NORTHWEST && + (direction == ENTITY_DIR_SOUTH || direction == ENTITY_DIR_EAST) + ) + ) + ) ) { // We will fall to this tile. fall = true; diff --git a/src/rpg/world/map.c b/src/rpg/world/map.c index 8a68c7e..b1cfae7 100644 --- a/src/rpg/world/map.c +++ b/src/rpg/world/map.c @@ -127,6 +127,7 @@ void mapDispose() { void mapChunkUnload(chunk_t* chunk) { for(uint8_t i = 0; i < chunk->meshCount; i++) { + if(chunk->meshes[i].vertexCount == 0) continue; meshDispose(&chunk->meshes[i]); } } @@ -135,6 +136,7 @@ errorret_t mapChunkLoad(chunk_t* chunk) { char_t buffer[64]; chunk->meshCount = 0; + memoryZero(chunk->meshes, sizeof(chunk->meshes)); snprintf(buffer, sizeof(buffer), "map/map/%d_%d_%d.dcf", chunk->position.x, diff --git a/src/rpg/world/tile.c b/src/rpg/world/tile.c index ce78b8c..cc25881 100644 --- a/src/rpg/world/tile.c +++ b/src/rpg/world/tile.c @@ -9,15 +9,11 @@ bool_t tileIsWalkable(const tile_t tile) { switch(tile) { - case TILE_SHAPE_FLOOR: - case TILE_SHAPE_RAMP_NORTH: - case TILE_SHAPE_RAMP_SOUTH: - case TILE_SHAPE_RAMP_EAST: - case TILE_SHAPE_RAMP_WEST: - return true; + case TILE_SHAPE_NULL: + return false; default: - return false; + return true; } } @@ -27,6 +23,10 @@ bool_t tileIsRamp(const tile_t tile) { case TILE_SHAPE_RAMP_SOUTH: case TILE_SHAPE_RAMP_EAST: case TILE_SHAPE_RAMP_WEST: + case TILE_SHAPE_RAMP_NORTHEAST: + case TILE_SHAPE_RAMP_NORTHWEST: + case TILE_SHAPE_RAMP_SOUTHEAST: + case TILE_SHAPE_RAMP_SOUTHWEST: return true; default: diff --git a/src/scene/scene/scenemap.c b/src/scene/scene/scenemap.c index a46999b..fc77572 100644 --- a/src/scene/scene/scenemap.c +++ b/src/scene/scene/scenemap.c @@ -169,6 +169,7 @@ void sceneMapRenderMap() { for(uint8_t j = 0; j < chunk->meshCount; j++) { mesh_t *mesh = &chunk->meshes[j]; + if(mesh->vertexCount == 0) continue; textureBind(NULL); meshDraw(mesh, -1, -1); } diff --git a/tools/assetstool/processmap.py b/tools/assetstool/processmap.py index 6f8af5a..f890eab 100644 --- a/tools/assetstool/processmap.py +++ b/tools/assetstool/processmap.py @@ -5,7 +5,7 @@ import json from assetstool.args import args from assetstool.assetcache import assetCache, assetGetCache from assetstool.assethelpers import getAssetRelativePath -from editortool.map.mapdefs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH, CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, CHUNK_TILE_COUNT +from dusk.defs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH, CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, CHUNK_TILE_COUNT def processTile(tileIndex, x=0, y=0, z=0, chunkX=0, chunkY=0, chunkZ=0): vertices = [] diff --git a/tools/dusk/defs.py b/tools/dusk/defs.py index 9e6182f..23757dd 100644 --- a/tools/dusk/defs.py +++ b/tools/dusk/defs.py @@ -3,11 +3,6 @@ import os import sys current_file_path = os.path.abspath(__file__) -print(current_file_path) - -ASSET_FILE_NAME_MAX_LENGTH = 256 - - duskDefsPath = os.path.join(os.path.dirname(current_file_path), "..", "..", "src", "duskdefs.env") # Ensure the .env file exists @@ -16,5 +11,30 @@ if not os.path.isfile(duskDefsPath): sys.exit(1) load_dotenv(dotenv_path=duskDefsPath) +defs = {key: os.getenv(key) for key in os.environ.keys()} -defs = {key: os.getenv(key) for key in os.environ.keys()} \ No newline at end of file +# Parsed out definitions +CHUNK_WIDTH = int(defs.get('CHUNK_WIDTH')) +CHUNK_HEIGHT = int(defs.get('CHUNK_HEIGHT')) +CHUNK_DEPTH = int(defs.get('CHUNK_DEPTH')) +CHUNK_TILE_COUNT = CHUNK_WIDTH * CHUNK_HEIGHT * CHUNK_DEPTH +CHUNK_VERTEX_COUNT_MAX = int(defs.get('CHUNK_VERTEX_COUNT_MAX')) + +TILE_WIDTH = float(defs.get('TILE_WIDTH')) +TILE_HEIGHT = float(defs.get('TILE_HEIGHT')) +TILE_DEPTH = float(defs.get('TILE_DEPTH')) + +RPG_CAMERA_PIXELS_PER_UNIT = float(defs.get('RPG_CAMERA_PIXELS_PER_UNIT')) +RPG_CAMERA_Z_OFFSET = float(defs.get('RPG_CAMERA_Z_OFFSET')) +RPG_CAMERA_FOV = float(defs.get('RPG_CAMERA_FOV')) + +MAP_WIDTH = 5 +MAP_HEIGHT = 5 +MAP_DEPTH = 3 +MAP_CHUNK_COUNT = MAP_WIDTH * MAP_HEIGHT * MAP_DEPTH + +TILE_SHAPES = {} +for key in defs.keys(): + if key.startswith('TILE_SHAPE_'): + globals()[key] = int(defs.get(key)) + TILE_SHAPES[key] = int(defs.get(key)) \ No newline at end of file diff --git a/tools/editortool/map/camera.py b/tools/editortool/map/camera.py index 6e5b31e..a32945a 100644 --- a/tools/editortool/map/camera.py +++ b/tools/editortool/map/camera.py @@ -2,7 +2,7 @@ import math import time from OpenGL.GL import * from OpenGL.GLU import * -from editortool.map.mapdefs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH, RPG_CAMERA_PIXELS_PER_UNIT, RPG_CAMERA_Z_OFFSET, RPG_CAMERA_FOV +from dusk.defs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH, RPG_CAMERA_PIXELS_PER_UNIT, RPG_CAMERA_Z_OFFSET, RPG_CAMERA_FOV class Camera: def __init__(self, parent): diff --git a/tools/editortool/map/chunk.py b/tools/editortool/map/chunk.py index 23f6942..d344f9d 100644 --- a/tools/editortool/map/chunk.py +++ b/tools/editortool/map/chunk.py @@ -1,7 +1,7 @@ import json import os from dusk.event import Event -from editortool.map.mapdefs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, CHUNK_VERTEX_COUNT_MAX, TILE_SHAPE_NULL +from dusk.defs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, CHUNK_VERTEX_COUNT_MAX, TILE_SHAPE_NULL from editortool.map.tile import Tile from editortool.map.vertexbuffer import VertexBuffer from OpenGL.GL import * diff --git a/tools/editortool/map/chunkpanel.py b/tools/editortool/map/chunkpanel.py index 7ac0c8b..838d3d4 100644 --- a/tools/editortool/map/chunkpanel.py +++ b/tools/editortool/map/chunkpanel.py @@ -1,5 +1,5 @@ from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QPushButton, QGridLayout, QTreeWidget, QTreeWidgetItem, QComboBox -from editortool.map.mapdefs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, TILE_SHAPES +from dusk.defs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, TILE_SHAPES class ChunkPanel(QWidget): def __init__(self, parent): @@ -68,7 +68,7 @@ class ChunkPanel(QWidget): def onPositionChange(self, pos): self.updateChunkList() - + tile = self.parent.map.getTileAtWorldPos(*self.parent.map.position) if tile is None: return diff --git a/tools/editortool/map/grid.py b/tools/editortool/map/grid.py index be08276..51a0d09 100644 --- a/tools/editortool/map/grid.py +++ b/tools/editortool/map/grid.py @@ -1,5 +1,5 @@ from OpenGL.GL import * -from editortool.map.mapdefs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH +from dusk.defs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH class Grid: def __init__(self, lines=1000): diff --git a/tools/editortool/map/map.py b/tools/editortool/map/map.py index db85b24..9654eb9 100644 --- a/tools/editortool/map/map.py +++ b/tools/editortool/map/map.py @@ -4,7 +4,7 @@ from PyQt5.QtWidgets import QFileDialog, QMessageBox from PyQt5.QtCore import QTimer import os from editortool.map.chunk import Chunk -from editortool.map.mapdefs import MAP_WIDTH, MAP_HEIGHT, MAP_DEPTH, CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH +from dusk.defs import MAP_WIDTH, MAP_HEIGHT, MAP_DEPTH, CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH import traceback MAP_DEFAULT_PATH = os.path.join(os.path.dirname(__file__), '../../../assets/map/') diff --git a/tools/editortool/map/mapdefs.py b/tools/editortool/map/mapdefs.py deleted file mode 100644 index 6202e35..0000000 --- a/tools/editortool/map/mapdefs.py +++ /dev/null @@ -1,26 +0,0 @@ -from dusk.defs import defs - -CHUNK_WIDTH = int(defs.get('CHUNK_WIDTH')) -CHUNK_HEIGHT = int(defs.get('CHUNK_HEIGHT')) -CHUNK_DEPTH = int(defs.get('CHUNK_DEPTH')) -CHUNK_TILE_COUNT = CHUNK_WIDTH * CHUNK_HEIGHT * CHUNK_DEPTH -CHUNK_VERTEX_COUNT_MAX = int(defs.get('CHUNK_VERTEX_COUNT_MAX')) - -TILE_WIDTH = float(defs.get('TILE_WIDTH')) -TILE_HEIGHT = float(defs.get('TILE_HEIGHT')) -TILE_DEPTH = float(defs.get('TILE_DEPTH')) - -RPG_CAMERA_PIXELS_PER_UNIT = float(defs.get('RPG_CAMERA_PIXELS_PER_UNIT')) -RPG_CAMERA_Z_OFFSET = float(defs.get('RPG_CAMERA_Z_OFFSET')) -RPG_CAMERA_FOV = float(defs.get('RPG_CAMERA_FOV')) - -MAP_WIDTH = 5 -MAP_HEIGHT = 5 -MAP_DEPTH = 3 -MAP_CHUNK_COUNT = MAP_WIDTH * MAP_HEIGHT * MAP_DEPTH - -TILE_SHAPES = {} -for key in defs.keys(): - if key.startswith('TILE_SHAPE_'): - globals()[key] = int(defs.get(key)) - TILE_SHAPES[key] = int(defs.get(key)) \ No newline at end of file diff --git a/tools/editortool/map/mapinfopanel.py b/tools/editortool/map/mapinfopanel.py index 27f358e..f0232d2 100644 --- a/tools/editortool/map/mapinfopanel.py +++ b/tools/editortool/map/mapinfopanel.py @@ -1,5 +1,5 @@ from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QLineEdit, QPushButton, QHBoxLayout, QMessageBox -from editortool.map.mapdefs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH +from dusk.defs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH class MapInfoPanel(QWidget): def __init__(self, parent): diff --git a/tools/editortool/map/selectbox.py b/tools/editortool/map/selectbox.py index 9e2b82d..07766d0 100644 --- a/tools/editortool/map/selectbox.py +++ b/tools/editortool/map/selectbox.py @@ -1,7 +1,7 @@ import OpenGL.GL as gl from dusk.defs import defs import colorsys -from editortool.map.mapdefs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH +from dusk.defs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH class SelectBox: def __init__(self, parent): diff --git a/tools/editortool/map/tile.py b/tools/editortool/map/tile.py index 6ad933e..6051d73 100644 --- a/tools/editortool/map/tile.py +++ b/tools/editortool/map/tile.py @@ -1,10 +1,12 @@ from OpenGL.GL import * -from editortool.map.mapdefs import ( - TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH, - CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, - TILE_SHAPE_NULL, TILE_SHAPE_FLOOR, - TILE_SHAPE_RAMP_NORTH, TILE_SHAPE_RAMP_SOUTH, - TILE_SHAPE_RAMP_EAST, TILE_SHAPE_RAMP_WEST +from dusk.defs import ( + TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH, + CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, + TILE_SHAPE_NULL, TILE_SHAPE_FLOOR, + TILE_SHAPE_RAMP_NORTH, TILE_SHAPE_RAMP_SOUTH, + TILE_SHAPE_RAMP_EAST, TILE_SHAPE_RAMP_WEST, + TILE_SHAPE_RAMP_SOUTHWEST, TILE_SHAPE_RAMP_SOUTHEAST, + TILE_SHAPE_RAMP_NORTHWEST, TILE_SHAPE_RAMP_NORTHEAST ) def getItem(arr, index, default): @@ -39,79 +41,138 @@ class Tile: self.chunk.onChunkData.invoke(self.chunk) def getBaseTileModel(self): - vertices = [] - indices = [] - uvs = [] - colors = [] + vertices = [] + indices = [] + uvs = [] + colors = [] - if self.shape == TILE_SHAPE_NULL: - pass + if self.shape == TILE_SHAPE_NULL: + pass - elif self.shape == TILE_SHAPE_FLOOR: - vertices = [ - (self.posX, self.posY, self.posZ), - (self.posX + TILE_WIDTH, self.posY, self.posZ), - (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ), - (self.posX, self.posY + TILE_HEIGHT, self.posZ) - ] - indices = [0, 1, 2, 0, 2, 3] - uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] - colors = [ (255, 255, 255, 255) ] * 4 + elif self.shape == TILE_SHAPE_FLOOR: + vertices = [ + (self.posX, self.posY, self.posZ), + (self.posX + TILE_WIDTH, self.posY, self.posZ), + (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ), + (self.posX, self.posY + TILE_HEIGHT, self.posZ) + ] + indices = [0, 1, 2, 0, 2, 3] + uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] + colors = [ (255, 255, 255, 255) ] * 4 - elif self.shape == TILE_SHAPE_RAMP_NORTH: - vertices = [ - (self.posX, self.posY, self.posZ + TILE_DEPTH), - (self.posX + TILE_WIDTH, self.posY, self.posZ + TILE_DEPTH), - (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ), - (self.posX, self.posY + TILE_HEIGHT, self.posZ) - ] - indices = [0, 1, 2, 0, 2, 3] - uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] - colors = [ (255, 0, 0, 255) ] * 4 + elif self.shape == TILE_SHAPE_RAMP_NORTH: + vertices = [ + (self.posX, self.posY, self.posZ + TILE_DEPTH), + (self.posX + TILE_WIDTH, self.posY, self.posZ + TILE_DEPTH), + (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ), + (self.posX, self.posY + TILE_HEIGHT, self.posZ) + ] + indices = [0, 1, 2, 0, 2, 3] + uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] + colors = [ (255, 0, 0, 255) ] * 4 - elif self.shape == TILE_SHAPE_RAMP_SOUTH: - vertices = [ - (self.posX, self.posY, self.posZ), - (self.posX + TILE_WIDTH, self.posY, self.posZ), - (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH), - (self.posX, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH) - ] - indices = [0, 1, 2, 0, 2, 3] - uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] - colors = [ (0, 255, 0, 255) ] * 4 + elif self.shape == TILE_SHAPE_RAMP_SOUTH: + vertices = [ + (self.posX, self.posY, self.posZ), + (self.posX + TILE_WIDTH, self.posY, self.posZ), + (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH), + (self.posX, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH) + ] + indices = [0, 1, 2, 0, 2, 3] + uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] + colors = [ (0, 255, 0, 255) ] * 4 - elif self.shape == TILE_SHAPE_RAMP_EAST: - vertices = [ - (self.posX, self.posY, self.posZ), - (self.posX + TILE_WIDTH, self.posY, self.posZ + TILE_DEPTH), - (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH), - (self.posX, self.posY + TILE_HEIGHT, self.posZ) - ] - indices = [0, 1, 2, 0, 2, 3] - uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] - colors = [ (0, 0, 255, 255) ] * 4 + elif self.shape == TILE_SHAPE_RAMP_EAST: + vertices = [ + (self.posX, self.posY, self.posZ), + (self.posX + TILE_WIDTH, self.posY, self.posZ + TILE_DEPTH), + (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH), + (self.posX, self.posY + TILE_HEIGHT, self.posZ) + ] + indices = [0, 1, 2, 0, 2, 3] + uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] + colors = [ (0, 0, 255, 255) ] * 4 - elif self.shape == TILE_SHAPE_RAMP_WEST: - vertices = [ - (self.posX, self.posY, self.posZ + TILE_DEPTH), - (self.posX + TILE_WIDTH, self.posY, self.posZ), - (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ), - (self.posX, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH) - ] - indices = [0, 1, 2, 0, 2, 3] - uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] - colors = [ (255, 255, 0, 255) ] * 4 + elif self.shape == TILE_SHAPE_RAMP_WEST: + vertices = [ + (self.posX, self.posY, self.posZ + TILE_DEPTH), + (self.posX + TILE_WIDTH, self.posY, self.posZ), + (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ), + (self.posX, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH) + ] + indices = [0, 1, 2, 0, 2, 3] + uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] + colors = [ (255, 255, 0, 255) ] * 4 + + elif self.shape == TILE_SHAPE_RAMP_SOUTHWEST: + vertices = [ + (self.posX, self.posY, self.posZ + TILE_DEPTH), + (self.posX + TILE_WIDTH, self.posY, self.posZ), + (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH), + (self.posX, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH) + ] + indices = [0, 1, 2, 0, 2, 3] + uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] + colors = [ (255, 128, 0, 255) ] * 4 - else: - print("Unknown tile shape:", self.shape) - pass + elif self.shape == TILE_SHAPE_RAMP_NORTHWEST: + vertices = [ + (self.posX, self.posY, self.posZ + TILE_DEPTH), + (self.posX + TILE_WIDTH, self.posY, self.posZ + TILE_DEPTH), + (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ), + (self.posX, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH) + ] + indices = [0, 1, 2, 0, 2, 3] + uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] + colors = [ (128, 255, 0, 255) ] * 4 - return { - 'vertices': vertices, - 'indices': indices, - 'uvs': uvs, - 'colors': colors - } + elif self.shape == TILE_SHAPE_RAMP_NORTHEAST: + vertices = [ + (self.posX, self.posY, self.posZ + TILE_DEPTH), + (self.posX + TILE_WIDTH, self.posY, self.posZ + TILE_DEPTH), + (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH), + (self.posX, self.posY + TILE_HEIGHT, self.posZ) + ] + indices = [0, 1, 2, 0, 2, 3] + uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] + colors = [ (0, 255, 128, 255) ] * 4 + + elif self.shape == TILE_SHAPE_RAMP_SOUTHEAST: + vertices = [ + (self.posX, self.posY, self.posZ), + (self.posX + TILE_WIDTH, self.posY, self.posZ + TILE_DEPTH), + (self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH), + (self.posX, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH) + ] + indices = [0, 1, 2, 0, 2, 3] + uvs = [ (0, 0), (1, 0), (1, 1), (0, 1) ] + colors = [ (255, 128, 255, 255) ] * 4 + + else: + # Solid black cube for unknown shape + x0, y0, z0 = self.posX, self.posY, self.posZ + x1, y1, z1 = self.posX + TILE_WIDTH, self.posY + TILE_HEIGHT, self.posZ + TILE_DEPTH + vertices = [ + (x0, y0, z0), (x1, y0, z0), (x1, y1, z0), (x0, y1, z0), # bottom + (x0, y0, z1), (x1, y0, z1), (x1, y1, z1), (x0, y1, z1) # top + ] + indices = [ + 0,1,2, 0,2,3, # bottom + 4,5,6, 4,6,7, # top + 0,1,5, 0,5,4, # front + 2,3,7, 2,7,6, # back + 1,2,6, 1,6,5, # right + 3,0,4, 3,4,7 # left + ] + uvs = [ (0,0) ] * 8 + colors = [ (0,0,0,255) ] * 8 + + return { + 'vertices': vertices, + 'indices': indices, + 'uvs': uvs, + 'colors': colors + } def buffer(self, vertexBuffer): if self.shape == TILE_SHAPE_NULL: diff --git a/tools/editortool/maptool.py b/tools/editortool/maptool.py index dca094a..6ca96e6 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 CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH +from dusk.defs import CHUNK_WIDTH, CHUNK_HEIGHT, CHUNK_DEPTH, TILE_SHAPE_NULL, TILE_SHAPE_FLOOR from editortool.map.selectbox import SelectBox from editortool.map.camera import Camera from editortool.map.grid import Grid @@ -73,10 +73,7 @@ class MapWindow(QMainWindow): QMessageBox.Save ) if reply == QMessageBox.Save: - self.saveFile() - if self.map.isDirty(): - event.ignore() - return + self.map.save() elif reply == QMessageBox.Cancel: event.ignore() return @@ -109,4 +106,16 @@ class MapWindow(QMainWindow): self.map.moveRelative(amtX, amtY, amtZ) event.accept() return True + + if key == Qt.Key_Delete: + tile = self.map.getTileAtWorldPos(*self.map.position) + if tile is not None: + tile.setShape(TILE_SHAPE_NULL) + event.accept() + return True + if key == Qt.Key_Insert: + tile = self.map.getTileAtWorldPos(*self.map.position) + if tile is not None and tile.shape == TILE_SHAPE_NULL: + tile.setShape(TILE_SHAPE_FLOOR) + event.accept() return super().eventFilter(obj, event) \ No newline at end of file