summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-09 05:06:41 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-09 05:06:41 +0200
commit94f6748d5f5b9fdc3047022fe59d66028bde63f3 (patch)
treede3dd2e7944c9dea12523702773ce5a2f93beed5
parente3b2c9267e7a8da5adca522a48a9f9a8457f89d8 (diff)
a
-rw-r--r--CMakeLists.txt1
-rw-r--r--draw/CMakeLists.txt9
-rw-r--r--draw/floor-mesh.cpp (renamed from src/floor-mesh.cpp)0
-rw-r--r--draw/floor-mesh.hpp (renamed from src/floor-mesh.hpp)0
-rw-r--r--draw/wall-mesh.cpp (renamed from src/wall-mesh.cpp)0
-rw-r--r--draw/wall-mesh.hpp (renamed from src/wall-mesh.hpp)0
-rw-r--r--draw/wireframe-mesh.cpp (renamed from src/wireframe-mesh.cpp)0
-rw-r--r--draw/wireframe-mesh.hpp (renamed from src/wireframe-mesh.hpp)0
-rw-r--r--draw/wireframe-quad.cpp (renamed from src/wireframe-quad.cpp)0
-rw-r--r--draw/wireframe-quad.hpp (renamed from src/wireframe-quad.hpp)0
-rw-r--r--main/CMakeLists.txt2
-rw-r--r--main/app.hpp11
12 files changed, 17 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eabc854f..413b9d79 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,6 +59,7 @@ if(NOT BOOTSTRAP_DEPENDS)
include_directories(src)
add_subdirectory(src)
+ add_subdirectory(draw)
add_subdirectory(main)
add_subdirectory(anim-crop-tool)
add_subdirectory(test)
diff --git a/draw/CMakeLists.txt b/draw/CMakeLists.txt
new file mode 100644
index 00000000..9dd2e869
--- /dev/null
+++ b/draw/CMakeLists.txt
@@ -0,0 +1,9 @@
+set(self ${PROJECT_NAME}-draw)
+file(GLOB sources "*.cpp" CONFIGURE_ARGS)
+add_library(${self} STATIC "${sources}")
+target_link_libraries(${self} PUBLIC
+ Magnum::GL
+ Magnum::Magnum
+ Magnum::Shaders
+ ${PROJECT_NAME}
+)
diff --git a/src/floor-mesh.cpp b/draw/floor-mesh.cpp
index 3698bc6e..3698bc6e 100644
--- a/src/floor-mesh.cpp
+++ b/draw/floor-mesh.cpp
diff --git a/src/floor-mesh.hpp b/draw/floor-mesh.hpp
index fed5867c..fed5867c 100644
--- a/src/floor-mesh.hpp
+++ b/draw/floor-mesh.hpp
diff --git a/src/wall-mesh.cpp b/draw/wall-mesh.cpp
index d698b508..d698b508 100644
--- a/src/wall-mesh.cpp
+++ b/draw/wall-mesh.cpp
diff --git a/src/wall-mesh.hpp b/draw/wall-mesh.hpp
index 4a4e9615..4a4e9615 100644
--- a/src/wall-mesh.hpp
+++ b/draw/wall-mesh.hpp
diff --git a/src/wireframe-mesh.cpp b/draw/wireframe-mesh.cpp
index 1425df60..1425df60 100644
--- a/src/wireframe-mesh.cpp
+++ b/draw/wireframe-mesh.cpp
diff --git a/src/wireframe-mesh.hpp b/draw/wireframe-mesh.hpp
index 0ae122f5..0ae122f5 100644
--- a/src/wireframe-mesh.hpp
+++ b/draw/wireframe-mesh.hpp
diff --git a/src/wireframe-quad.cpp b/draw/wireframe-quad.cpp
index 18b49628..18b49628 100644
--- a/src/wireframe-quad.cpp
+++ b/draw/wireframe-quad.cpp
diff --git a/src/wireframe-quad.hpp b/draw/wireframe-quad.hpp
index 062bf913..062bf913 100644
--- a/src/wireframe-quad.hpp
+++ b/draw/wireframe-quad.hpp
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index 1d8da0a1..9723e38b 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -1,7 +1,7 @@
set(self "${PROJECT_NAME}-main")
file(GLOB sources "*.cpp" CONFIGURE_ARGS)
-link_libraries(${PROJECT_NAME})
+link_libraries(${PROJECT_NAME} ${PROJECT_NAME}-draw)
link_libraries(Magnum::Sdl2Application Magnum::Trade)
corrade_add_resource(res ../resources.conf)
diff --git a/main/app.hpp b/main/app.hpp
index 07a64d2f..c691f85d 100644
--- a/main/app.hpp
+++ b/main/app.hpp
@@ -3,10 +3,10 @@
#include "chunk.hpp"
#include "shaders/tile-shader.hpp"
#include "src/loader.hpp"
-#include "floor-mesh.hpp"
-#include "wall-mesh.hpp"
-#include "wireframe-mesh.hpp"
-#include "wireframe-quad.hpp"
+#include "draw/floor-mesh.hpp"
+#include "draw/wall-mesh.hpp"
+#include "draw/wireframe-mesh.hpp"
+#include "draw/wireframe-quad.hpp"
#include "compat/enum-bitset.hpp"
#include <Magnum/Timeline.h>
#include <Magnum/Platform/Sdl2Application.h>
@@ -44,13 +44,14 @@ struct app final : Platform::Application
};
chunk make_test_chunk();
- const void* const _dummy = register_debug_callback();
+ const void* _dummy = register_debug_callback();
tile_shader _shader;
tile_atlas_ floor1 = loader.tile_atlas("share/game/images/metal1.tga", {2, 2});
tile_atlas_ floor2 = loader.tile_atlas("share/game/images/floor1.tga", {4, 4});
tile_atlas_ wall1 = loader.tile_atlas("share/game/images/wood2.tga", {2, 2});
tile_atlas_ wall2 = loader.tile_atlas("share/game/images/wood1.tga", {2, 2});
chunk _chunk = make_test_chunk();
+
floor_mesh _floor_mesh;
wall_mesh _wall_mesh;
wireframe_mesh<wireframe::quad> _wireframe_quad;