From c2c8103490d11bc14e1d54d685aa268a30595927 Mon Sep 17 00:00:00 2001 From: Luan Santos Date: Mon, 9 Oct 2023 19:18:57 -0700 Subject: [PATCH] feat: zones --- .gitignore | 2 + CMakePresets.json | 238 +++++---- data/creatures/monsters.xml | 14 +- data/menubar.xml | 2 + source/CMakeLists.txt | 8 +- source/application.cpp | 31 +- source/brush.cpp | 2 + source/brush.h | 349 ++++-------- source/common.cpp | 171 +++--- source/common.h | 2 +- source/common_windows.cpp | 679 +++++++++++++----------- source/common_windows.h | 171 +++--- source/complexitem.h | 18 +- source/editor.cpp | 943 ++++++++++++++++----------------- source/graphics.h | 1 + source/gui.h | 2 + source/gui_ids.h | 7 + source/iomap_otbm.cpp | 116 +++- source/iomap_otbm.h | 81 +-- source/main_menubar.cpp | 34 +- source/main_menubar.h | 4 + source/map.cpp | 489 +++++++++-------- source/map.h | 165 +++--- source/map_display.cpp | 6 +- source/map_drawer.cpp | 345 +++++------- source/monster_brush.cpp | 52 +- source/monster_brush.h | 1 + source/numbertextctrl.cpp | 70 ++- source/palette_common.cpp | 568 ++++++++++---------- source/palette_monster.cpp | 161 ++++-- source/palette_monster.h | 18 +- source/palette_window.cpp | 224 ++++---- source/palette_window.h | 32 +- source/palette_zones.cpp | 231 ++++++++ source/palette_zones.h | 67 +++ source/preferences.cpp | 247 +++++---- source/preferences.h | 1 + source/settings.cpp | 2 + source/settings.h | 2 + source/spawn_monster_brush.cpp | 47 +- source/spawn_monster_brush.h | 30 +- source/tile.cpp | 3 + source/tile.h | 13 + source/tileset.h | 1 + source/zone_brush.cpp | 56 ++ source/zone_brush.h | 51 ++ source/zones.cpp | 70 +++ source/zones.h | 55 ++ vcproj/Project/RME.vcxproj | 17 +- 49 files changed, 3368 insertions(+), 2531 deletions(-) create mode 100644 source/palette_zones.cpp create mode 100644 source/palette_zones.h create mode 100644 source/zone_brush.cpp create mode 100644 source/zone_brush.h create mode 100644 source/zones.cpp create mode 100644 source/zones.h diff --git a/.gitignore b/.gitignore index 46f6ceff..dfa2825e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,11 @@ build-release CMakeLists.txt.user* # RME +remeres rme rme.cfg data/user +world # Visual Studio *.MAP diff --git a/CMakePresets.json b/CMakePresets.json index d7894fef..d67b075a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,102 +1,140 @@ { - "version": 3, - "cmakeMinimumRequired": { - "major": 3, - "minor": 22, - "patch": 0 - }, - "configurePresets": [ - { - "name": "windows-release", - "displayName": "Windows - Release", - "description": "Sets Ninja generator, compilers, build and install directory and set build type as release", - "generator": "Ninja", - "binaryDir": "${sourceDir}/build/${presetName}", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": { - "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "type": "FILEPATH" - }, - "VCPKG_TARGET_TRIPLET": "x64-windows-static", - "CMAKE_BUILD_TYPE": "Release", - "OPTIONS_ENABLE_SCCACHE": "ON" - }, - "architecture": { - "value": "x64", - "strategy": "external" - }, - "vendor": { - "microsoft.com/VisualStudioSettings/CMake/1.0": { - "hostOS": [ "Windows" ] - } - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - } - }, - { - "name": "linux-release", - "displayName": "Linux - Release", - "description": "Sets Ninja generator, compilers, build and install directory and set build type as release", - "generator": "Ninja", - "binaryDir": "${sourceDir}/build/${presetName}", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": { - "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "type": "FILEPATH" - }, - "CMAKE_BUILD_TYPE": "Release", - "OPTIONS_ENABLE_CCACHE": "ON" - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Linux" - } - }, - { - "name": "windows-debug", - "inherits": "windows-release", - "displayName": "Windows - Debug", - "description": "Build Debug Mode", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "DEBUG_LOG": "ON" - }, - "architecture": { - "value": "x64", - "strategy": "external" - } - }, - { - "name": "linux-debug", - "inherits": "linux-release", - "displayName": "Linux - Debug Build", - "description": "Build Debug Mode", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "DEBUG_LOG": "ON" - } - } - ], - "buildPresets": [ - { - "name": "linux-release", - "configurePreset": "linux-release" - }, - { - "name": "linux-debug", - "configurePreset": "linux-debug" - }, - { - "name": "windows-release", - "configurePreset": "windows-release" - }, - { - "name": "windows-Xdebug", - "configurePreset": "windows-debug" - } - ] + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 22, + "patch": 0 + }, + "configurePresets": [ + { + "name": "windows-release", + "displayName": "Windows - Release", + "description": "Sets Ninja generator, compilers, build and install directory and set build type as release", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": { + "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "type": "FILEPATH" + }, + "VCPKG_TARGET_TRIPLET": "x64-windows-static", + "CMAKE_BUILD_TYPE": "Release", + "OPTIONS_ENABLE_SCCACHE": "ON" + }, + "architecture": { + "value": "x64", + "strategy": "external" + }, + "vendor": { + "microsoft.com/VisualStudioSettings/CMake/1.0": { + "hostOS": ["Windows"] + } + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "linux-release", + "displayName": "Linux - Release", + "description": "Sets Ninja generator, compilers, build and install directory and set build type as release", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": { + "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "type": "FILEPATH" + }, + "CMAKE_BUILD_TYPE": "Release", + "OPTIONS_ENABLE_CCACHE": "ON" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name": "macos-release", + "displayName": "macOS - Release", + "description": "Sets Ninja generator, compilers, build and install directory and set build type as release", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": { + "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "type": "FILEPATH" + }, + "CMAKE_BUILD_TYPE": "Release", + "OPTIONS_ENABLE_CCACHE": "ON" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name": "windows-debug", + "inherits": "windows-release", + "displayName": "Windows - Debug", + "description": "Build Debug Mode", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "DEBUG_LOG": "ON" + }, + "architecture": { + "value": "x64", + "strategy": "external" + } + }, + { + "name": "linux-debug", + "inherits": "linux-release", + "displayName": "Linux - Debug Build", + "description": "Build Debug Mode", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "DEBUG_LOG": "ON" + } + }, + { + "name": "macos-debug", + "inherits": "macos-release", + "displayName": "macOS - Debug Build", + "description": "Build Debug Mode", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "DEBUG_LOG": "ON" + } + } + ], + "buildPresets": [ + { + "name": "linux-release", + "configurePreset": "linux-release" + }, + { + "name": "linux-debug", + "configurePreset": "linux-debug" + }, + { + "name": "windows-release", + "configurePreset": "windows-release" + }, + { + "name": "windows-Xdebug", + "configurePreset": "windows-debug" + }, + { + "name": "macos-release", + "configurePreset": "macos-release" + }, + { + "name": "macos-debug", + "configurePreset": "macos-debug" + } + ] } diff --git a/data/creatures/monsters.xml b/data/creatures/monsters.xml index ae000a97..3c35be71 100644 --- a/data/creatures/monsters.xml +++ b/data/creatures/monsters.xml @@ -5,7 +5,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -616,11 +616,10 @@ - - - - - + + + + @@ -1408,4 +1407,5 @@ + diff --git a/data/menubar.xml b/data/menubar.xml index 2d1eb472..391960ed 100644 --- a/data/menubar.xml +++ b/data/menubar.xml @@ -80,6 +80,7 @@ + @@ -157,6 +158,7 @@ +