diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d7591eb..73978c3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,12 @@ file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES}) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +if(MSVC) + target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX) +else() + target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra) +endif() + option(VE_USE_SYSTEM_LIBS "Use system installed libraries" ON) find_package(OpenGL REQUIRED) diff --git a/src/files/WorldFiles.h b/src/files/WorldFiles.h index 93d50db0..70ebc55b 100644 --- a/src/files/WorldFiles.h +++ b/src/files/WorldFiles.h @@ -3,9 +3,7 @@ #include #include -#ifndef std::string #include -#endif class Player; #define REGION_SIZE_BIT 5 diff --git a/src/files/files.h b/src/files/files.h index 27cc9c54..7b53cb16 100644 --- a/src/files/files.h +++ b/src/files/files.h @@ -1,9 +1,7 @@ #ifndef FILES_FILES_H_ #define FILES_FILES_H_ -#ifndef std::string #include -#endif extern bool write_binary_file(std::string filename, const char* data, size_t size); extern unsigned int append_binary_file(std::string filename, const char* data, size_t size); diff --git a/src/voxel_engine.cpp b/src/voxel_engine.cpp index 66f09aa4..cec3c7e0 100644 --- a/src/voxel_engine.cpp +++ b/src/voxel_engine.cpp @@ -162,7 +162,7 @@ void mainloop(Level* level, Assets* assets) { for (int i = 0; i < freeLoaders; i++) level->chunksController->loadVisible(world->wfile); - worldRenderer.draw(world, camera, occlusion); + worldRenderer.draw(camera, occlusion); hud.draw(level, assets); if (level->player->debug) { hud.drawDebug(level, assets, fps, occlusion); diff --git a/src/world/Level.cpp b/src/world/Level.cpp index d85df92e..c86f9507 100644 --- a/src/world/Level.cpp +++ b/src/world/Level.cpp @@ -1,7 +1,10 @@ #include "Level.h" #include "../lighting/Lighting.h" +#include "../voxels/Chunks.h" #include "../voxels/ChunksController.h" #include "../player_control.h" +#include "../physics/PhysicsSolver.h" +#include "../objects/Player.h" Level::Level(World* world, Player* player, Chunks* chunks, PhysicsSolver* physics) : world(world), diff --git a/src/world_render.cpp b/src/world_render.cpp index 3c4f7df2..35028f04 100644 --- a/src/world_render.cpp +++ b/src/world_render.cpp @@ -73,7 +73,7 @@ bool WorldRenderer::drawChunk(size_t index, Camera* camera, Shader* shader, bool } -void WorldRenderer::draw(World* world, Camera* camera, bool occlusion){ +void WorldRenderer::draw(Camera* camera, bool occlusion){ Chunks* chunks = level->chunks; vec4 skyColor(0.7f, 0.81f, 1.0f, 1.0f); diff --git a/src/world_render.h b/src/world_render.h index d237ed29..2dd611da 100644 --- a/src/world_render.h +++ b/src/world_render.h @@ -4,10 +4,7 @@ #include #include #include - -#ifndef std::string #include -#endif #include #include @@ -37,7 +34,7 @@ public: WorldRenderer(Level* level, Assets* assets); ~WorldRenderer(); - void draw(World* world, Camera* camera, bool occlusion); + void draw(Camera* camera, bool occlusion); };