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/source/complexitem.h b/source/complexitem.h index 7e32dc06..e9423f88 100644 --- a/source/complexitem.h +++ b/source/complexitem.h @@ -52,12 +52,12 @@ class Container : public Item { size_t getVolume() const noexcept { return getItemType().volume; } - double getWeight() noexcept { + double getWeight() noexcept override { return getItemType().weight; } - virtual bool unserializeItemNode_OTBM(const IOMap &maphandle, BinaryNode* node); - virtual bool serializeItemNode_OTBM(const IOMap &maphandle, NodeFileWriteHandle &f) const; + virtual bool unserializeItemNode_OTBM(const IOMap &maphandle, BinaryNode* node) override; + virtual bool serializeItemNode_OTBM(const IOMap &maphandle, NodeFileWriteHandle &f) const override; // virtual bool unserializeItemNode_OTMM(const IOMap& maphandle, BinaryNode* node); // virtual bool serializeItemNode_OTMM(const IOMap& maphandle, NodeFileWriteHandle& f) const; @@ -74,8 +74,8 @@ class Teleport : public Item { return this; } - virtual void serializeItemAttributes_OTBM(const IOMap &maphandle, NodeFileWriteHandle &f) const; - virtual bool readItemAttribute_OTBM(const IOMap &maphandle, OTBM_ItemAttribute attr, BinaryNode* node); + virtual void serializeItemAttributes_OTBM(const IOMap &maphandle, NodeFileWriteHandle &f) const override; + virtual bool readItemAttribute_OTBM(const IOMap &maphandle, OTBM_ItemAttribute attr, BinaryNode* node) override; // virtual void serializeItemAttributes_OTMM(const IOMap& maphandle, NodeFileWriteHandle& f) const; // virtual bool readItemAttribute_OTMM(const IOMap& maphandle, OTMM_ItemAttribute attr, BinaryNode* node); @@ -118,8 +118,8 @@ class Door : public Item { doorId = id; } - virtual void serializeItemAttributes_OTBM(const IOMap &maphandle, NodeFileWriteHandle &f) const; - virtual bool readItemAttribute_OTBM(const IOMap &maphandle, OTBM_ItemAttribute attr, BinaryNode* node); + virtual void serializeItemAttributes_OTBM(const IOMap &maphandle, NodeFileWriteHandle &f) const override; + virtual bool readItemAttribute_OTBM(const IOMap &maphandle, OTBM_ItemAttribute attr, BinaryNode* node) override; // virtual void serializeItemAttributes_OTMM(const IOMap& maphandle, NodeFileWriteHandle& f) const; // virtual bool readItemAttribute_OTMM(const IOMap& maphandle, OTMM_ItemAttribute attr, BinaryNode* node); @@ -143,8 +143,8 @@ class Depot : public Item { depotId = id; } - virtual void serializeItemAttributes_OTBM(const IOMap &maphandle, NodeFileWriteHandle &f) const; - virtual bool readItemAttribute_OTBM(const IOMap &maphandle, OTBM_ItemAttribute attr, BinaryNode* node); + virtual void serializeItemAttributes_OTBM(const IOMap &maphandle, NodeFileWriteHandle &f) const override; + virtual bool readItemAttribute_OTBM(const IOMap &maphandle, OTBM_ItemAttribute attr, BinaryNode* node) override; // virtual void serializeItemAttributes_OTMM(const IOMap& maphandle, NodeFileWriteHandle& f) const; // virtual bool readItemAttribute_OTMM(const IOMap& maphandle, OTMM_ItemAttribute attr, BinaryNode* node); diff --git a/source/graphics.h b/source/graphics.h index 6703c3c2..4c6a3a22 100644 --- a/source/graphics.h +++ b/source/graphics.h @@ -53,6 +53,7 @@ struct SpriteLight { class Sprite { public: Sprite() { } + virtual ~Sprite() { } virtual void DrawTo(wxDC* dc, SpriteSize sz, int start_x, int start_y, int width = -1, int height = -1) = 0; virtual void unloadDC() = 0; diff --git a/source/map_drawer.cpp b/source/map_drawer.cpp index 7e0fc4ac..4d0db2bc 100644 --- a/source/map_drawer.cpp +++ b/source/map_drawer.cpp @@ -17,9 +17,7 @@ #include "main.h" -#ifdef __APPLE__ - #include -#else +#if defined(__LINUX__) || defined(__WINDOWS__) #include #endif @@ -1788,6 +1786,7 @@ void MapDrawer::DrawPositionIndicator(int z) { } void MapDrawer::DrawTooltips() { +#if defined(__LINUX__) || defined(__WINDOWS__) if (!options.show_tooltips || tooltips.empty()) { return; } @@ -1898,6 +1897,7 @@ void MapDrawer::DrawTooltips() { } glEnable(GL_TEXTURE_2D); +#endif } void MapDrawer::MakeTooltip(int screenx, int screeny, const std::string &text, uint8_t r, uint8_t g, uint8_t b) { diff --git a/source/npcs.cpp b/source/npcs.cpp index ac3794ad..9e22fed1 100644 --- a/source/npcs.cpp +++ b/source/npcs.cpp @@ -254,7 +254,7 @@ bool NpcDatabase::importXMLFromOT(const FileName &filename, wxString &error, wxA } pugi::xml_node node; - if (node = doc.child("npc")) { + if ((node = doc.child("npc"))) { NpcType* npcType = NpcType::loadFromOTXML(filename, doc, warnings); if (npcType) { NpcType* current = (*this)[npcType->name];