From 868a759dea6b9abbf887c9e8f40c61b6a6ddbf83 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 6 Jun 2021 17:52:38 +0500 Subject: Added CPM. First attempt to improve dependencies management #15 --- src/AssetManager.cpp | 4 ++-- src/Plugin.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 19cd452..514d008 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -1,7 +1,7 @@ #include "AssetManager.hpp" #include -#include +#include #include #include @@ -16,7 +16,7 @@ #include "Utility.hpp" #include "Plugin.hpp" -namespace fs = std::experimental::filesystem::v1; +namespace fs = std::filesystem; const fs::path pathToAssets = "./assets/"; const std::string pathToAssetsList = "./items.json"; diff --git a/src/Plugin.cpp b/src/Plugin.cpp index 618ea9d..83e9bdd 100644 --- a/src/Plugin.cpp +++ b/src/Plugin.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include "GameState.hpp" -- cgit v1.2.3 From 5c9cd1c84e9d25c2ef1440f3aa7019c62e4aa02d Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Mon, 7 Jun 2021 14:37:40 +0500 Subject: Refactored CMakeLists.txt --- src/main.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 2ed2b85..4b27757 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,10 +32,6 @@ void initLogger() { LOG(INFO) << "Logger is configured"; } -#ifndef USE_SDL_MAIN -#undef main -#endif - int main(int argc, char** argv) { srand(time(0)); initLogger(); -- cgit v1.2.3 From f5f62026bf0ce0464811464b16689f9d3aa4abdd Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Mon, 7 Jun 2021 18:15:32 +0500 Subject: Fixed MacOS OpenGL errors --- src/RendererWorld.cpp | 9 ++++++++- src/World.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp index ebb049d..b433609 100644 --- a/src/RendererWorld.cpp +++ b/src/RendererWorld.cpp @@ -293,7 +293,9 @@ void RendererWorld::Render(RenderState & renderState) { glm::mat4 projView = projection * view; //Render Entities +#ifndef __APPLE__ glLineWidth(3.0); +#endif Shader *entityShader = AssetManager::GetAsset("/altcraft/shaders/entity")->shader.get(); entityShader->Activate(); entityShader->SetUniform("projection", projection); @@ -308,7 +310,9 @@ void RendererWorld::Render(RenderState & renderState) { //Render selected block Vector selectedBlock = GetGameState()->GetSelectionStatus().selectedBlock; if (selectedBlock != Vector()) { +#ifndef __APPLE__ glLineWidth(2.0f); +#endif { glm::mat4 model = glm::mat4(1.0); model = glm::translate(model, selectedBlock.glm()); @@ -325,7 +329,9 @@ void RendererWorld::Render(RenderState & renderState) { const bool renderHit = false; if (renderHit) { VectorF hit = GetGameState()->GetSelectionStatus().raycastHit; +#ifndef __APPLE__ glLineWidth(2.0f); +#endif { glm::mat4 model; model = glm::translate(model, hit.glm()); @@ -339,8 +345,9 @@ void RendererWorld::Render(RenderState & renderState) { glDrawArrays(GL_LINE_STRIP, 0, 36); } } - +#ifndef __APPLE__ glLineWidth(1.0); +#endif glCheckError(); //Render sky diff --git a/src/World.cpp b/src/World.cpp index c3246dc..e5e3fe8 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -201,7 +201,7 @@ void World::UpdatePhysics(float delta) { BlockId block = this->GetBlockId(Vector(x, y, z)); if (block.id == 0 || !GetBlockInfo(block).collides) continue; - AABB blockColl{ x,y,z,1.0,1.0,1.0 }; + AABB blockColl{ (double)x,(double)y,(double)z,1.0,1.0,1.0 }; if (TestCollision(entityCollBox, blockColl)) { return { true }; } -- cgit v1.2.3