From df73742cdd427e68057603746864abd3d2b545c2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 8 Oct 2022 22:01:19 +0200 Subject: a --- main/main.cpp | 52 +--------------------------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) (limited to 'main/main.cpp') diff --git a/main/main.cpp b/main/main.cpp index 80d85eef..5a555c97 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1,60 +1,10 @@ -#include "tile-atlas.hpp" -#include "loader.hpp" -#include "shaders/tile-shader.hpp" -#include "tile.hpp" -#include "chunk.hpp" -#include "floor-mesh.hpp" -#include "wall-mesh.hpp" -#include "compat/enum-bitset.hpp" - -#include -#include +#include "app.hpp" #include #include -#include #include -#include namespace Magnum::Examples { -struct app final : Platform::Application -{ - using dpi_policy = Platform::Implementation::Sdl2DpiScalingPolicy; - using tile_atlas_ = std::shared_ptr; - - explicit app(const Arguments& arguments); - virtual ~app(); - void drawEvent() override; - void update(float dt); - void do_camera(float dt); - void reset_camera_offset(); - void keyPressEvent(KeyEvent& event) override; - void keyReleaseEvent(KeyEvent& event) override; - void do_key(KeyEvent::Key k, KeyEvent::Modifiers m, bool pressed, bool repeated); - void draw_chunk(chunk& c); - void update_window_scale(); - - enum class key : int { - camera_up, camera_left, camera_right, camera_down, camera_reset, - quit, - MAX - }; - chunk make_test_chunk(); - - 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; - - Vector2 camera_offset; - enum_bitset keys; - Magnum::Timeline timeline; -}; - app::app(const Arguments& arguments): Platform::Application{ arguments, -- cgit v1.2.3