diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ec5691b..b772fb72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ if(MSVC) endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /source-charset:UTF-8") else() - target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -lstdc++fs + target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra # additional warnings -Wformat-nonliteral -Wcast-align -Wpointer-arith -Wundef @@ -114,7 +114,7 @@ if(UNIX) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie -lstdc++fs") endif() include_directories(${LUA_INCLUDE_DIR}) diff --git a/src/assets/assetload_funcs.cpp b/src/assets/assetload_funcs.cpp index 6683d7f6..4ca808f5 100644 --- a/src/assets/assetload_funcs.cpp +++ b/src/assets/assetload_funcs.cpp @@ -135,7 +135,6 @@ bool assetload::animation(Assets* assets, auto frameArr = root->list("frames"); - Frame temp; float frameDuration = DEFAULT_FRAME_DURATION; std::string frameName; diff --git a/src/coders/gzip.cpp b/src/coders/gzip.cpp index b30140c8..ee1afd62 100644 --- a/src/coders/gzip.cpp +++ b/src/coders/gzip.cpp @@ -34,7 +34,7 @@ std::vector gzip::compress(const ubyte* src, size_t size) { std::vector gzip::decompress(const ubyte* src, size_t size) { // getting uncompressed data length from gzip footer - size_t decompressed_size = *(uint32_t*)(src+size-4); + size_t decompressed_size = *reinterpret_cast(src+size-4); std::vector buffer; buffer.resize(decompressed_size); diff --git a/src/content/ContentLoader.cpp b/src/content/ContentLoader.cpp index 6cec4a36..54f585f9 100644 --- a/src/content/ContentLoader.cpp +++ b/src/content/ContentLoader.cpp @@ -74,7 +74,7 @@ void ContentLoader::fixPackIndices() { std::unique_ptr root; if (fs::is_regular_file(indexFile)) { - root = std::move(files::read_json(indexFile)); + root = files::read_json(indexFile); } else { root.reset(new dynamic::Map()); } diff --git a/src/content/ContentLoader.h b/src/content/ContentLoader.h index e8517d53..df14910a 100644 --- a/src/content/ContentLoader.h +++ b/src/content/ContentLoader.h @@ -8,7 +8,7 @@ namespace fs = std::filesystem; class Block; class ItemDef; -class ContentPack; +struct ContentPack; class ContentBuilder; namespace dynamic { diff --git a/src/frontend/InventoryView.h b/src/frontend/InventoryView.h index 7c6b26db..9b9e01b4 100644 --- a/src/frontend/InventoryView.h +++ b/src/frontend/InventoryView.h @@ -120,8 +120,6 @@ class InventoryView : public gui::Container { InventoryInteraction* interaction; std::vector slots; - - int scroll = 0; public: InventoryView( const Content* content, diff --git a/src/frontend/WorldRenderer.cpp b/src/frontend/WorldRenderer.cpp index 0ee73c32..cf20fe9d 100644 --- a/src/frontend/WorldRenderer.cpp +++ b/src/frontend/WorldRenderer.cpp @@ -106,7 +106,7 @@ void WorldRenderer::drawChunks(Chunks* chunks, } float px = camera->position.x / (float)CHUNK_W; float pz = camera->position.z / (float)CHUNK_D; - std::sort(indices.begin(), indices.end(), [this, chunks, px, pz](size_t i, size_t j) { + std::sort(indices.begin(), indices.end(), [chunks, px, pz](size_t i, size_t j) { auto a = chunks->chunks[i]; auto b = chunks->chunks[j]; return ((a->x + 0.5f - px)*(a->x + 0.5f - px) + diff --git a/src/frontend/graphics/Skybox.cpp b/src/frontend/graphics/Skybox.cpp index bd41d1c4..cb481990 100644 --- a/src/frontend/graphics/Skybox.cpp +++ b/src/frontend/graphics/Skybox.cpp @@ -39,7 +39,7 @@ Skybox::Skybox(uint size, Shader* shader) -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, -1.0f }; - vattr attrs[] {2, 0}; + vattr attrs[] {{2}, {0}}; mesh = std::make_unique(vertices, 6, attrs); sprites.push_back(skysprite { diff --git a/src/frontend/gui/controls.cpp b/src/frontend/gui/controls.cpp index ab72d2c4..979ae935 100644 --- a/src/frontend/gui/controls.cpp +++ b/src/frontend/gui/controls.cpp @@ -89,6 +89,7 @@ Button::Button(std::shared_ptr content, glm::vec4 padding) padding[1]+padding[3]+margin[1]+margin[3])); add(content); scrollable(false); + setHoverColor(glm::vec4(0.05f, 0.1f, 0.15f, 0.75f)); } Button::Button(std::wstring text, glm::vec4 padding, onaction action) @@ -102,6 +103,7 @@ Button::Button(std::wstring text, glm::vec4 padding, onaction action) label = std::make_shared