diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f69f1c2..82726b4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set(DAWN_TARGET_NAME "Dawn") if(NOT DEFINED DAWN_TARGET) set(DAWN_TARGET linux-x64-glfw CACHE INTERNAL ${DAWN_CACHE_TARGET}) + # set(DAWN_TARGET linux-x64-terminal CACHE INTERNAL ${DAWN_CACHE_TARGET}) endif() # Set Common Build Variables diff --git a/assets/maps/train_station.tmx b/assets/maps/train_station.tmx new file mode 100644 index 00000000..086ca2c2 --- /dev/null +++ b/assets/maps/train_station.tmx @@ -0,0 +1,39 @@ + + + + + +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,12,13,12,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,13,13,13,0,0,0,13,13,13,0,0,0,13,13,13,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,15,0,0,12,13,15,0,12,13,12,15,0,0,0,0,15,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,15,0,0,0,0, +10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, +8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, +8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, +10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, +0,0,0,0,11,0,12,13,12,11,12,13,12,0,11,0,0,0,0,11,0,9,9,0,11,0,0,0,0,11,0,0,0,0,11,0,0,0,0,0, +0,0,0,0,11,0,12,13,12,11,12,13,12,0,11,0,0,0,0,11,0,9,9,0,11,0,0,0,0,11,0,6,6,6,6,6,0,0,0,0, +0,0,10,8,11,8,12,13,12,11,12,13,12,8,11,8,8,8,8,11,8,9,9,8,11,8,8,8,8,11,8,6,6,6,6,6,0,0,0,0, +0,0,10,8,8,8,12,13,12,0,12,13,12,8,8,8,15,8,8,8,8,9,9,8,8,8,8,8,8,8,8,6,6,6,6,6,0,0,0,0, +0,0,10,8,8,8,12,13,12,0,12,13,12,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,6,6,6,6,6,0,0,0,0, +0,0,10,8,8,8,12,13,12,0,12,13,12,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,6,6,6,6,6,0,0,0,0, +0,0,10,8,8,8,12,13,12,10,12,13,12,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,14,6,6,6,6,6,0,0,0,0, +0,0,10,8,15,8,12,13,12,8,12,13,12,8,8,8,15,8,8,8,8,8,8,8,8,8,8,8,8,8,14,5,5,5,5,5,0,0,0,0, +0,0,10,8,8,8,12,13,12,8,12,13,12,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5,5,5,5,5,0,0,0,0, +0,0,10,10,10,10,12,13,12,10,12,13,12,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,12,13,12,0,12,13,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + + + + diff --git a/assets/tiled_project.tiled-session b/assets/tiled_project.tiled-session index df235f5d..53fc9afe 100644 --- a/assets/tiled_project.tiled-session +++ b/assets/tiled_project.tiled-session @@ -3,8 +3,9 @@ "height": 4300, "width": 2 }, - "activeFile": "", + "activeFile": "maps/train_station.tmx", "expandedProjectPaths": [ + "maps", "." ], "file.lastUsedOpenFilter": "All Files (*)", @@ -23,16 +24,27 @@ "scale": 3.404166666666667, "selectedLayer": 1, "viewCenter": { - "x": 116.328029375765, - "y": 79.90208078335371 + "x": 120.1468788249694, + "y": 79.75520195838433 } }, "maps/testmap2.tmx": { + "expandedObjectLayers": [ + 2 + ], "scale": 5.0383, "selectedLayer": 1, "viewCenter": { - "x": 33.940019451005305, - "y": 35.726336264216116 + "x": 19.94720441418733, + "y": 19.947204414187325 + } + }, + "maps/train_station.tmx": { + "scale": 3, + "selectedLayer": 0, + "viewCenter": { + "x": 67.66666666666666, + "y": 49.333333333333314 } }, "testmap.tmx": { @@ -54,21 +66,32 @@ "tilemap.tsx": { "scaleInDock": 1, "scaleInEditor": 4 + }, + "tilemaps/entities.tsx": { + "scaleInDock": 1 + }, + "tilemaps/tilemap.tsx": { + "scaleInDock": 1 } }, "last.externalTilesetPath": "/home/yourwishes/htdocs/Dawn/assets", "last.imagePath": "/home/yourwishes/htdocs/Dawn/assets", - "map.height": 5, + "map.height": 10, "map.lastUsedFormat": "tmx", "map.tileHeight": 8, "map.tileWidth": 8, - "map.width": 5, + "map.width": 10, "openFiles": [ + "maps/testmap.tmx", + "maps/testmap2.tmx", + "maps/train_station.tmx" ], "project": "tiled_project.tiled-project", "property.type": "string", "recentFiles": [ - "maps/testmap2.tmx" + "maps/testmap.tmx", + "maps/testmap2.tmx", + "maps/train_station.tmx" ], "tileset.lastUsedFilter": "All Files (*)", "tileset.lastUsedFormat": "tsx", diff --git a/assets/tilemaps/tilemap.png b/assets/tilemaps/tilemap.png index a30bee9c..48d675df 100644 Binary files a/assets/tilemaps/tilemap.png and b/assets/tilemaps/tilemap.png differ diff --git a/gentileset.py b/gentileset.py index 330db91b..e2c2c096 100644 --- a/gentileset.py +++ b/gentileset.py @@ -165,6 +165,14 @@ TILES = { "BUILDING_WALL": [ 4, '-', COLORS["GRAY"] ], "ROOF": [ 5, '/', COLORS["BROWN"] ], "WALKABLE_NULL": [ 6, ' ', COLORS["BLACK"] ], + "COBBLESTONE": [ 7, '#', COLORS["GRAY"] ], + "STAIRS": [ 8, '=', COLORS["GRAY"] ], + "RAILING": [ 9, 'n', COLORS["BROWN"] ], + "COLUMN": [ 10, 'I', COLORS["WHITE"] ], + "RAIL_TRACK": [ 11, '|', COLORS["GRAY"] ], + "RAIL_SLEEPER": [ 12, '-', COLORS["BROWN"] ], + "CARPET": [ 13, '#', COLORS["RED"] ], + "LAMP": [ 14, 'i', COLORS["YELLOW"] ], } ENTITIES = { @@ -222,5 +230,5 @@ def genTileset(filename, tileset, background): # Now write PIXEL_BUFFER to png png.from_array(FLATTENED_PIXEL_BUFFER, 'RGBA').save(filename) -genTileset("./assets/map/tilemap.png", TILES, [ 0, 0, 0, 255 ]) -genTileset("./assets/map/entities.png", ENTITIES, [ 0, 0, 0, 100 ]) \ No newline at end of file +genTileset("./assets/tilemaps/tilemap.png", TILES, [ 0, 0, 0, 255 ]) +genTileset("./assets/tilemaps/entities.png", ENTITIES, [ 0, 0, 0, 100 ]) \ No newline at end of file diff --git a/src/dawn/CMakeLists.txt b/src/dawn/CMakeLists.txt index 0c19749c..029f42d7 100644 --- a/src/dawn/CMakeLists.txt +++ b/src/dawn/CMakeLists.txt @@ -34,6 +34,7 @@ target_sources(${DAWN_TARGET_NAME} # Assets tool_map(testmap maps/testmap.tmx) tool_map(testmap2 maps/testmap2.tmx) +tool_map(train_station maps/train_station.tmx) tool_copy(en en.json) add_dependencies(${DAWN_TARGET_NAME} dawnassets) diff --git a/src/dawn/display/draw/drawmap.c b/src/dawn/display/draw/drawmap.c index 062aeb86..3fd23d0f 100644 --- a/src/dawn/display/draw/drawmap.c +++ b/src/dawn/display/draw/drawmap.c @@ -84,8 +84,8 @@ void drawMap( // Tile? tile = mapTileGetByPosition(map, x - offsetX, y - offsetY, 0); - colorDest[x] = symbolGetColorByTile(tile); - bufferDest[x] = symbolGetCharByTile(tile); + colorDest[x] = tileColorGet(tile); + bufferDest[x] = tileSymbolGet(tile); } } } \ No newline at end of file diff --git a/src/dawn/display/symbol.c b/src/dawn/display/symbol.c index 6506bd83..c0348358 100644 --- a/src/dawn/display/symbol.c +++ b/src/dawn/display/symbol.c @@ -34,35 +34,6 @@ char_t symbolGetCharByEntity(const entity_t *ent) { } } -char_t symbolGetCharByTile(const tile_t tile) { - switch(tile) { - case TILE_NULL: - case TILE_WALKABLE_NULL: - return ' '; - - case TILE_GRASS: - return '#'; - - case TILE_WATER: - int32_t j = (int32_t)(TIME.time * 2) % 4; - switch(j) { - case 0: return '/'; - case 1: return '|'; - case 2: return '\\'; - case 3: return '|'; - } - - case TILE_BUILDING_WALL: - return '-'; - - case TILE_ROOF: - return '/'; - - default: - assertUnreachable("Unknown char for tile."); - } -} - uint8_t symbolGetColorByEntity(const entity_t *ent) { assertNotNull(ent, "Entity cannot be NULL."); switch(ent->type) { @@ -81,27 +52,4 @@ uint8_t symbolGetColorByEntity(const entity_t *ent) { default: assertUnreachable("Invalid entity type."); } -} - -uint8_t symbolGetColorByTile(const tile_t tile) { - switch(tile) { - case TILE_NULL: - case TILE_WALKABLE_NULL: - return COLOR_BLACK; - - case TILE_GRASS: - return COLOR_GREEN; - - case TILE_WATER: - return COLOR_BLUE; - - case TILE_BUILDING_WALL: - return COLOR_GRAY; - - case TILE_ROOF: - return COLOR_BROWN; - - default: - assertUnreachable("Unknown color for tile."); - } } \ No newline at end of file diff --git a/src/dawn/display/symbol.h b/src/dawn/display/symbol.h index ae8e5bfa..a8543c97 100644 --- a/src/dawn/display/symbol.h +++ b/src/dawn/display/symbol.h @@ -7,7 +7,6 @@ #pragma once #include "rpg/entity/entity.h" -#include "rpg/world/tile.h" #include "display/color.h" /** @@ -18,26 +17,10 @@ */ char_t symbolGetCharByEntity(const entity_t *ent); -/** - * Returns the symbol for the given tile. - * - * @param tile Tile to get the symbol for. - * @return The symbol for the tile. - */ -char_t symbolGetCharByTile(const tile_t tile); - /** * Returns the color for the given entity. * * @param ent Entity to get the color for. * @return The color for the entity. */ -uint8_t symbolGetColorByEntity(const entity_t *ent); - -/** - * Returns the color for the given tile. - * - * @param tile Tile to get the color for. - * @return The color for the tile. - */ -uint8_t symbolGetColorByTile(const tile_t tile); \ No newline at end of file +uint8_t symbolGetColorByEntity(const entity_t *ent); \ No newline at end of file diff --git a/src/dawn/game/game.c b/src/dawn/game/game.c index 1fc093dd..509656c8 100644 --- a/src/dawn/game/game.c +++ b/src/dawn/game/game.c @@ -72,6 +72,8 @@ gameupdateresult_t gameUpdate(const float_t delta) { printf("Updating unknown state %d\n", GAME.state); } + if(inputWasPressed(INPUT_BIND_FORCE_QUIT)) GAME.shouldExit = true; + // Perform render. displayUpdate(); diff --git a/src/dawn/game/state/mapchange.c b/src/dawn/game/state/mapchange.c index d611cea1..76b304da 100644 --- a/src/dawn/game/state/mapchange.c +++ b/src/dawn/game/state/mapchange.c @@ -8,23 +8,29 @@ #include "mapchange.h" #include "asset/assetmap.h" #include "game/game.h" +#include "util/memory.h" void gameStateMapChangeUpdate() { // First try and find the player object entity_t *player = NULL; + player_t oldPlayerData; entitydirection_t dir = ENTITY_DIRECTION_SOUTH; if(GAME.currentMap != NULL) { player = mapEntityGetByType(GAME.currentMap, ENTITY_TYPE_PLAYER); dir = player->direction; + oldPlayerData = player->player; } assetMapLoad(MAP_LIST_PATHS[GAME.mapNext], &MAP_MAIN); GAME.state = GAME_STATE_OVERWORLD; GAME.currentMap = &MAP_MAIN; - // Do not reference player since its invalid, just check if it DID exist + // Do not reference player since its invalid, just check if it DID exist if(GAME.currentMap != NULL && player != NULL) { player = mapEntityGetByType(GAME.currentMap, ENTITY_TYPE_PLAYER); + if(player == NULL) return; + + player->player = oldPlayerData; player->direction = dir; } } \ No newline at end of file diff --git a/src/dawn/input.h b/src/dawn/input.h index 516f2b53..64e498b7 100644 --- a/src/dawn/input.h +++ b/src/dawn/input.h @@ -18,8 +18,9 @@ typedef bool_t inputstate_t; #define INPUT_BIND_ACCEPT 0x04 #define INPUT_BIND_CANCEL 0x05 #define INPUT_BIND_PAUSE 0x06 +#define INPUT_BIND_FORCE_QUIT 0x07 -#define INPUT_BIND_COUNT (INPUT_BIND_PAUSE + 1) +#define INPUT_BIND_COUNT (INPUT_BIND_FORCE_QUIT + 1) typedef struct { inputstate_t currentState[INPUT_BIND_COUNT]; diff --git a/src/dawn/rpg/world/map.h b/src/dawn/rpg/world/map.h index a5f41206..f1ffa25b 100644 --- a/src/dawn/rpg/world/map.h +++ b/src/dawn/rpg/world/map.h @@ -11,11 +11,11 @@ #include "rpg/world/trigger.h" #include "maplist.h" -#define MAP_WIDTH_MAX 2048 -#define MAP_HEIGHT_MAX 2048 +#define MAP_WIDTH_MAX 512 +#define MAP_HEIGHT_MAX 512 #define MAP_LAYERS_MAX 1 -#define MAP_ENTITIES_MAX 256 -#define MAP_TRIGGERS_MAX 64 +#define MAP_ENTITIES_MAX 64 +#define MAP_TRIGGERS_MAX 32 typedef struct _map_t { tile_t tiles[MAP_WIDTH_MAX * MAP_HEIGHT_MAX * MAP_LAYERS_MAX]; diff --git a/src/dawn/rpg/world/maplist.c b/src/dawn/rpg/world/maplist.c index ce6b6037..8fb297dd 100644 --- a/src/dawn/rpg/world/maplist.c +++ b/src/dawn/rpg/world/maplist.c @@ -10,7 +10,8 @@ const char_t * MAP_LIST_PATHS[] = { "testmap.map", - "testmap2.map" + "testmap2.map", + "train_station.map" }; const int32_t MAP_LIST_COUNT = sizeof(MAP_LIST_PATHS) / sizeof(char_t*); diff --git a/src/dawn/rpg/world/maplist.h b/src/dawn/rpg/world/maplist.h index 1fec9a14..670f3f75 100644 --- a/src/dawn/rpg/world/maplist.h +++ b/src/dawn/rpg/world/maplist.h @@ -9,7 +9,9 @@ #include "dawn.h" typedef enum { - MAP_LIST_TEST + MAP_LIST_TEST = 0, + MAP_LIST_TEST2 = 1, + MAP_LIST_TRAIN_STATION = 2, } maplist_t; extern const char_t *MAP_LIST_PATHS[]; diff --git a/src/dawn/rpg/world/tile.c b/src/dawn/rpg/world/tile.c index 8059f7a9..5e922c19 100644 --- a/src/dawn/rpg/world/tile.c +++ b/src/dawn/rpg/world/tile.c @@ -6,6 +6,67 @@ */ #include "tile.h" +#include "assert/assert.h" +#include "game/time.h" + +const char_t TILE_SYMBOLS[] = { + ' ',// NULL + '#', + '/', + ' ', + '-',// BUILDING_WALL + '/', + ' ', + '#', + '=',// STAIRS + 'n', + 'I', + '|', + '-',// RAIL_SLEEPER + '#', + 'i' +}; + +const uint8_t TILE_COLORS[] = { + COLOR_BLACK,// NULL + COLOR_GREEN, + COLOR_BLUE, + COLOR_MAGENTA, + COLOR_GRAY,// BUILDING_WALL + COLOR_BROWN, + COLOR_BLACK, + COLOR_GRAY, + COLOR_GRAY, // STAIRS + COLOR_BROWN, + COLOR_WHITE, + COLOR_GRAY, + COLOR_BROWN,// RAIL_SLEEPER + COLOR_RED, + COLOR_YELLOW +}; + +char_t tileSymbolGet(const tile_t tile) { + switch(tile) { + case TILE_WATER: + int32_t j = (int32_t)(TIME.time * 2) % 4; + switch(j) { + case 0: return '/'; + case 1: return '|'; + case 2: return '\\'; + case 3: return '|'; + } + + default: + return TILE_SYMBOLS[tile]; + } +} + +uint8_t tileColorGet(const tile_t tile) { + switch(tile) { + default: + return TILE_COLORS[tile]; + } +} bool_t tileIsSolid(const tile_t tile) { switch(tile) { diff --git a/src/dawn/rpg/world/tile.h b/src/dawn/rpg/world/tile.h index a73128b7..e85b41aa 100644 --- a/src/dawn/rpg/world/tile.h +++ b/src/dawn/rpg/world/tile.h @@ -6,18 +6,44 @@ */ #pragma once -#include "dawn.h" +#include "display/color.h" typedef enum { TILE_NULL = 0, TILE_GRASS = 1, TILE_WATER = 2, - // TILE_DOOR = 3, + TILE_BUILDING_WALL = 4, TILE_ROOF = 5, TILE_WALKABLE_NULL = 6, + TILE_COBBLESTONE = 7, + TILE_STAIRS = 8, + TILE_RAILING = 9, + TILE_COLUMN = 10, + TILE_RAIL_TRACK = 11, + TILE_RAIL_SLEEPER = 12, + TILE_CARPET = 13, + TILE_LAMP = 14 } tile_t; +extern const char_t TILE_SYMBOLS[]; + +/** + * Returns the symbol used by the given tile. + * + * @param tile Tile to get the symbol of. + * @return The symbol for this tile. + */ +char_t tileSymbolGet(const tile_t tile); + +/** + * Returns the color used by a given tile. + * + * @param tile Tile to get the color of. + * @return The color of this tile. + */ +uint8_t tileColorGet(const tile_t tile); + /** * Returns whether or not the tile is solid. * diff --git a/src/dawn/ui/mainmenu.c b/src/dawn/ui/mainmenu.c index d00fb600..6f964209 100644 --- a/src/dawn/ui/mainmenu.c +++ b/src/dawn/ui/mainmenu.c @@ -38,7 +38,7 @@ void mainMenuSelectCallback( ) { // New Game if(y == 0) { - GAME.mapNext = MAP_LIST_TEST; + GAME.mapNext = MAP_LIST_TRAIN_STATION; GAME.state = GAME_STATE_MAP_CHANGE; return; } diff --git a/src/dawnglfw/dawnglfw.c b/src/dawnglfw/dawnglfw.c index de099b0d..0644a4d6 100644 --- a/src/dawnglfw/dawnglfw.c +++ b/src/dawnglfw/dawnglfw.c @@ -88,6 +88,7 @@ int32_t dawnGlfwStart() { dawnGlfwInputBind(INPUT_BIND_PAUSE, GLFW_KEY_P); dawnGlfwInputBind(INPUT_BIND_CANCEL, GLFW_KEY_Q); dawnGlfwInputBind(INPUT_BIND_CANCEL, GLFW_KEY_BACKSPACE); + dawnGlfwInputBind(INPUT_BIND_FORCE_QUIT, GLFW_KEY_BACKSLASH); // Event callbacks glfwSetFramebufferSizeCallback(DAWN_GLFW.window, &dawnGlfwOnResize); diff --git a/src/dawntermlinux/display/display.c b/src/dawntermlinux/display/display.c index 3d9f96de..0caf0d95 100644 --- a/src/dawntermlinux/display/display.c +++ b/src/dawntermlinux/display/display.c @@ -56,6 +56,14 @@ void displayUpdate() { color = TERM_COLOR_CYAN; break; + case COLOR_GRAY: + color = TERM_COLOR_GRAY; + break; + + case COLOR_BROWN: + color = TERM_COLOR_BROWN; + break; + default: assertUnreachable("Invalid color."); } diff --git a/src/dawntermlinux/display/termcolor.h b/src/dawntermlinux/display/termcolor.h index 07e25ce2..bd7534c6 100644 --- a/src/dawntermlinux/display/termcolor.h +++ b/src/dawntermlinux/display/termcolor.h @@ -16,5 +16,7 @@ #define TERM_COLOR_YELLOW "\x1b[33m" #define TERM_COLOR_MAGENTA "\x1b[35m" #define TERM_COLOR_CYAN "\x1b[36m" +#define TERM_COLOR_GRAY "\x1b[90m" +#define TERM_COLOR_BROWN "\x1b[33m" #define TERM_COLOR_RESET "\x1b[0m" \ No newline at end of file diff --git a/src/dawntermlinux/input.c b/src/dawntermlinux/input.c index c90426b7..c6525f03 100644 --- a/src/dawntermlinux/input.c +++ b/src/dawntermlinux/input.c @@ -10,7 +10,6 @@ inputstate_t inputGetState(const inputbind_t bind) { int32_t k = LINUX_TERM_HOST_KEY_PRESS; - if(k == -1) return false; switch(bind) { @@ -32,6 +31,12 @@ inputstate_t inputGetState(const inputbind_t bind) { case INPUT_BIND_CANCEL: return k == 'q'; + case INPUT_BIND_PAUSE: + return k == 'p'; + + case INPUT_BIND_FORCE_QUIT: + return k == '\\'; + default: return false; } diff --git a/tools/maptool/maptool.py b/tools/maptool/maptool.py index ae7384ea..fd5819e0 100755 --- a/tools/maptool/maptool.py +++ b/tools/maptool/maptool.py @@ -51,6 +51,8 @@ for layer in root.findall('layer'): for i in range(0, len(data)): # minus 1 because tiled is 1 indexed tileId = int(data[i]) - 1 + if(int(data[i]) == 0): + tileId = 0 layerOut["tiles"].append(tileId) output["layers"].append(layerOut)