diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-02 21:39:18 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-03 01:22:13 +0200 |
commit | c9d56d6fb1c8eca558db937b99b89535893950a0 (patch) | |
tree | 81a4cb7c34af7e78fab8cc2e5780511e8c451978 | |
parent | fc1a03f9a257faf78de7838954709593ab4da628 (diff) |
fix some harmless msvc stuff
-rw-r--r-- | editor/inspect.cpp | 2 | ||||
-rw-r--r-- | src/chunk-render.cpp | 2 | ||||
-rw-r--r-- | src/chunk-scenery.cpp | 2 | ||||
-rw-r--r-- | src/scenery.cpp | 6 | ||||
-rw-r--r-- | src/tile-defs.hpp | 21 | ||||
-rw-r--r-- | userconfig-sthalik@Windows-MSVC.cmake | 50 |
6 files changed, 45 insertions, 38 deletions
diff --git a/editor/inspect.cpp b/editor/inspect.cpp index 1631f11c..131f15e1 100644 --- a/editor/inspect.cpp +++ b/editor/inspect.cpp @@ -67,8 +67,8 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r fm_assert(accessor.check_field_type<T>()); fm_assert(!list.isEmpty() == (repr == field_repr::cbx)); - bool should_disable; char buf[128]; + bool should_disable = false; switch (accessor.is_enabled(datum)) { diff --git a/src/chunk-render.cpp b/src/chunk-render.cpp index 94200239..9eba6446 100644 --- a/src/chunk-render.cpp +++ b/src/chunk-render.cpp @@ -69,7 +69,7 @@ auto chunk::ensure_wall_mesh() noexcept -> wall_mesh_tuple if (_wall_atlases[i]) wall_indexes[count++] = uint16_t(i); - std::sort(wall_indexes.begin(), wall_indexes.begin() + count, + std::sort(wall_indexes.data(), wall_indexes.data() + (ptrdiff_t)count, [this](uint16_t a, uint16_t b) { return _wall_atlases[a] < _wall_atlases[b]; }); diff --git a/src/chunk-scenery.cpp b/src/chunk-scenery.cpp index 7040c634..c13d3148 100644 --- a/src/chunk-scenery.cpp +++ b/src/chunk-scenery.cpp @@ -100,7 +100,7 @@ auto chunk::make_topo_sort_data(entity& e) -> topo_sort_data const auto bb_min = tile_shader::project(Vector3(Vector2(bb_min_[0], bb_max_[1]), 0)); const auto bb_max = tile_shader::project(Vector3(Vector2(bb_max_[0], bb_min_[1]), 0)); const auto bb_len = bb_max[0] - bb_min[0]; - if (bb_len >= 1 && f.size[0] > iTILE_SIZE[0]) + if (bb_len >= 1 && f.size[0] > uiTILE_SIZE[0]) { data.slope = (bb_max[1]-bb_min[1])/bb_len; data.mode = topo_sort_data::mode_static; diff --git a/src/scenery.cpp b/src/scenery.cpp index 9acc7944..ff78bfa8 100644 --- a/src/scenery.cpp +++ b/src/scenery.cpp @@ -77,8 +77,8 @@ Vector2 scenery::ordinal_offset(Vector2b offset) const { if (sc_type == scenery_type::door) { - constexpr auto off_closed_ = Vector2b(0, -iTILE_SIZE[1]/2+2); - constexpr auto off_opened_ = Vector2b(-iTILE_SIZE[0]+2, -iTILE_SIZE[1]/2+2); + constexpr auto off_closed_ = Vector2b(0, -bTILE_SIZE[1]/2+2); + constexpr auto off_opened_ = Vector2b(-bTILE_SIZE[0]+2, -bTILE_SIZE[1]/2+2); const auto off_closed = rotate_point(off_closed_, rotation::N, r); const auto off_opened = rotate_point(off_opened_, rotation::N, r); const auto vec = frame == atlas->info().nframes-1 ? off_closed : off_opened; @@ -93,7 +93,7 @@ Vector2 scenery::depth_offset() const Vector2 ret; if (sc_type == scenery_type::door) { - constexpr auto door_offset = Vector2b(-iTILE_SIZE[0], 0); + constexpr auto door_offset = Vector2b(-bTILE_SIZE[0], 0); const auto offset = rotate_point(door_offset, rotation::N, r); ret += Vector2(offset); } diff --git a/src/tile-defs.hpp b/src/tile-defs.hpp index b260fe8a..072935a8 100644 --- a/src/tile-defs.hpp +++ b/src/tile-defs.hpp @@ -5,17 +5,16 @@ namespace floormat { constexpr inline unsigned char TILE_MAX_DIM = 16; -constexpr inline size_t TILE_COUNT = TILE_MAX_DIM*TILE_MAX_DIM; +constexpr inline size_t TILE_COUNT = size_t{TILE_MAX_DIM}*size_t{TILE_MAX_DIM}; -constexpr inline auto TILE_MAX_DIM20d = Magnum::Math::Vector3<double> { TILE_MAX_DIM, TILE_MAX_DIM, 0 }; -constexpr inline auto iTILE_SIZE = Magnum::Math::Vector3<Int> { 64, 64, 64 }; -constexpr inline auto iTILE_SIZE2 = Magnum::Math::Vector2<Int> { iTILE_SIZE[0], iTILE_SIZE[1] }; -constexpr inline auto sTILE_SIZE2 = Magnum::Math::Vector2<Short> { (Short)iTILE_SIZE[0], (Short)iTILE_SIZE[1] }; -constexpr inline auto usTILE_SIZE2 = Magnum::Math::Vector2<UnsignedShort> { (UnsignedShort)iTILE_SIZE[0], (UnsignedShort)iTILE_SIZE[1] }; -constexpr inline auto TILE_SIZE = Magnum::Math::Vector3<float> { iTILE_SIZE }; -constexpr inline auto dTILE_SIZE = Magnum::Math::Vector3<double> { iTILE_SIZE }; -constexpr inline auto TILE_SIZE2 = Magnum::Math::Vector2<float> { iTILE_SIZE2 }; -constexpr inline auto dTILE_SIZE2 = Magnum::Math::Vector2<double> { TILE_SIZE2 }; -constexpr inline auto TILE_SIZE20 = Magnum::Math::Vector3<float> { (float)iTILE_SIZE[0], (float)iTILE_SIZE[1], 0 }; +constexpr inline auto TILE_MAX_DIM20d = Magnum::Math::Vector3<double> { TILE_MAX_DIM, TILE_MAX_DIM, 0 }; +constexpr inline auto iTILE_SIZE = Magnum::Math::Vector3<Int> { 64, 64, 64 }; +constexpr inline auto uiTILE_SIZE = Magnum::Math::Vector3<UnsignedInt> { iTILE_SIZE }; +constexpr inline auto bTILE_SIZE = Magnum::Math::Vector3<Byte> { iTILE_SIZE }; +constexpr inline auto iTILE_SIZE2 = Magnum::Math::Vector2<Int> { iTILE_SIZE[0], iTILE_SIZE[1] }; +constexpr inline auto TILE_SIZE = Magnum::Math::Vector3<float> { iTILE_SIZE }; +constexpr inline auto dTILE_SIZE = Magnum::Math::Vector3<double> { iTILE_SIZE }; +constexpr inline auto TILE_SIZE2 = Magnum::Math::Vector2<float> { iTILE_SIZE2 }; +constexpr inline auto TILE_SIZE20 = Magnum::Math::Vector3<float> { (float)iTILE_SIZE[0], (float)iTILE_SIZE[1], 0 }; } // namespace floormat diff --git a/userconfig-sthalik@Windows-MSVC.cmake b/userconfig-sthalik@Windows-MSVC.cmake index 4f2b23d3..6aa18c10 100644 --- a/userconfig-sthalik@Windows-MSVC.cmake +++ b/userconfig-sthalik@Windows-MSVC.cmake @@ -8,28 +8,36 @@ set(OpenCV_DIR "F:/dev/opentrack-depends/opencv/build-amd64/install" CACHE PATH list(APPEND CMAKE_IGNORE_PATH "c:/msys64") list(APPEND CMAKE_IGNORE_PREFIX_PATH "c:/msys64") set(CMAKE_INSTALL_MESSAGE NEVER) +sets(PATH CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install") -if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") - sets(BOOL - FLOORMAT_PRECOMPILED-HEADERS OFF - SDL_STATIC OFF - SDL_SHARED ON - CORRADE_BUILD_STATIC OFF - CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT OFF - MAGNUM_BUILD_STATIC OFF - MAGNUM_BUILD_PLUGINS_STATIC OFF - ) -else() - sets(BOOL - FLOORMAT_PRECOMPILED-HEADERS OFF - SDL_STATIC ON - SDL_SHARED OFF - CORRADE_BUILD_STATIC ON - CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT ON - MAGNUM_BUILD_STATIC ON - MAGNUM_BUILD_PLUGINS_STATIC ON - ) -endif() +sets(BOOL FLOORMAT_PRECOMPILED-HEADERS OFF) +sets(BOOL FLOORMAT_SUBMODULE-SDL2 ON) + +add_link_options(-STACK:41943040) + +function(fm-userconfig-external) + if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") + sets(BOOL + SDL_STATIC OFF + SDL_SHARED ON + SDL_FORCE_STATIC_VCRT OFF + CORRADE_BUILD_STATIC OFF + CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT OFF + MAGNUM_BUILD_STATIC OFF + MAGNUM_BUILD_PLUGINS_STATIC OFF + ) + else() + sets(BOOL + SDL_STATIC ON + SDL_SHARED OFF + SDL_FORCE_STATIC_VCRT ON + CORRADE_BUILD_STATIC ON + CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT ON + MAGNUM_BUILD_STATIC ON + MAGNUM_BUILD_PLUGINS_STATIC ON + ) + endif() +endfunction() function(fm-userconfig-src) add_compile_options(-W4 -Qvec-report:1) |