diff options
-rw-r--r-- | editor/app.cpp | 2 | ||||
-rw-r--r-- | editor/app.hpp | 4 | ||||
-rw-r--r-- | editor/editor.hpp | 2 | ||||
-rw-r--r-- | editor/ground-editor.hpp | 2 | ||||
-rw-r--r-- | editor/scenery-editor.hpp | 2 | ||||
-rw-r--r-- | editor/vobj-editor.hpp | 2 | ||||
-rw-r--r-- | editor/wall-editor.hpp | 2 | ||||
-rw-r--r-- | floormat/main.hpp | 8 | ||||
-rw-r--r-- | main/main-impl.cpp | 2 | ||||
-rw-r--r-- | main/main-impl.hpp | 8 | ||||
-rw-r--r-- | main/setup.cpp | 4 | ||||
-rw-r--r-- | src/chunk.cpp | 2 | ||||
-rw-r--r-- | src/chunk.hpp | 8 | ||||
-rw-r--r-- | src/critter.hpp | 4 | ||||
-rw-r--r-- | src/light.hpp | 2 | ||||
-rw-r--r-- | src/object.hpp | 2 | ||||
-rw-r--r-- | src/path-search.hpp | 2 | ||||
-rw-r--r-- | src/scenery.hpp | 4 | ||||
-rw-r--r-- | src/world.hpp | 3 | ||||
-rw-r--r-- | test/app.hpp | 2 |
20 files changed, 33 insertions, 34 deletions
diff --git a/editor/app.cpp b/editor/app.cpp index 7cb0075a..94e78576 100644 --- a/editor/app.cpp +++ b/editor/app.cpp @@ -97,7 +97,7 @@ std::shared_ptr<critter> app::ensure_player_character(world& w) return ret; } -void app::reset_world(struct world&& w_) +void app::reset_world(class world&& w_) { if (!M) return; diff --git a/editor/app.hpp b/editor/app.hpp index 8e76a9dd..5aefe4f5 100644 --- a/editor/app.hpp +++ b/editor/app.hpp @@ -30,7 +30,7 @@ namespace floormat { struct fm_settings; struct floormat_main; -struct world; +class world; struct chunk; class ground_atlas; class anim_atlas; @@ -97,7 +97,7 @@ private: void maybe_initialize_chunk_(const chunk_coords_& pos, chunk& c); void update_character(float dt); void reset_world(); - void reset_world(struct world&& w); + void reset_world(class world&& w); void draw() override; diff --git a/editor/editor.hpp b/editor/editor.hpp index 07f5e332..69a5277f 100644 --- a/editor/editor.hpp +++ b/editor/editor.hpp @@ -14,7 +14,7 @@ namespace floormat { -struct world; +class world; class anim_atlas; class ground_atlas; struct app; diff --git a/editor/ground-editor.hpp b/editor/ground-editor.hpp index 5f2399ff..55afec92 100644 --- a/editor/ground-editor.hpp +++ b/editor/ground-editor.hpp @@ -10,7 +10,7 @@ namespace floormat { -struct world; +class world; struct ground_info; class ground_editor final diff --git a/editor/scenery-editor.hpp b/editor/scenery-editor.hpp index dec74b95..873124a8 100644 --- a/editor/scenery-editor.hpp +++ b/editor/scenery-editor.hpp @@ -8,7 +8,7 @@ namespace floormat { class anim_atlas; struct global_coords; -struct world; +class world; struct app; class scenery_editor final diff --git a/editor/vobj-editor.hpp b/editor/vobj-editor.hpp index e92c6abe..d5af27ba 100644 --- a/editor/vobj-editor.hpp +++ b/editor/vobj-editor.hpp @@ -7,7 +7,7 @@ namespace floormat { -struct world; +class world; struct global_coords; struct object; class anim_atlas; diff --git a/editor/wall-editor.hpp b/editor/wall-editor.hpp index 4379a909..159135a0 100644 --- a/editor/wall-editor.hpp +++ b/editor/wall-editor.hpp @@ -8,7 +8,7 @@ namespace floormat { -struct world; +class world; class wall_atlas; class wall_editor diff --git a/floormat/main.hpp b/floormat/main.hpp index 27404fe3..ead48a8d 100644 --- a/floormat/main.hpp +++ b/floormat/main.hpp @@ -13,7 +13,7 @@ struct fm_settings; struct floormat_app; struct tile_shader; struct lightmap_shader; -struct world; +class world; struct scenery; class anim_atlas; struct clickable; @@ -69,9 +69,9 @@ struct floormat_main [[nodiscard]] static bool check_chunk_visible(const Vector2d& offset, const Vector2i& size) noexcept; virtual struct meshes meshes() noexcept = 0; - virtual struct world& world() noexcept = 0; - virtual struct world& reset_world() noexcept = 0; - virtual struct world& reset_world(struct world&& w) noexcept = 0; + virtual class world& world() noexcept = 0; + virtual class world& reset_world() noexcept = 0; + virtual class world& reset_world(class world&& w) noexcept = 0; virtual SDL_Window* window() noexcept = 0; Vector2 dpi_scale() const noexcept { return _dpi_scale; } static int get_mods() noexcept; diff --git a/main/main-impl.cpp b/main/main-impl.cpp index 4fe5d702..ae074a49 100644 --- a/main/main-impl.cpp +++ b/main/main-impl.cpp @@ -15,7 +15,7 @@ main_impl::~main_impl() noexcept } void main_impl::quit(int status) { Platform::Sdl2Application::exit(status); } -struct world& main_impl::world() noexcept { return _world; } +class world& main_impl::world() noexcept { return _world; } SDL_Window* main_impl::window() noexcept { return Sdl2Application::window(); } fm_settings& main_impl::settings() noexcept { return s; } const fm_settings& main_impl::settings() const noexcept { return s; } diff --git a/main/main-impl.hpp b/main/main-impl.hpp index 8aaf6312..b6d1b1f4 100644 --- a/main/main-impl.hpp +++ b/main/main-impl.hpp @@ -53,9 +53,9 @@ struct main_impl final : Platform::Sdl2Application, floormat_main struct lightmap_shader& lightmap_shader() noexcept override; - struct world& world() noexcept override; - struct world& reset_world() noexcept override; - struct world& reset_world(struct world&& w) noexcept override; + class world& world() noexcept override; + class world& reset_world() noexcept override; + class world& reset_world(class world&& w) noexcept override; SDL_Window* window() noexcept override; fm_settings& settings() noexcept override; @@ -108,7 +108,7 @@ private: tile_shader _shader; struct lightmap_shader _lightmap_shader{_tuc}; std::vector<clickable> _clickable_scenery; - struct world _world{}; + class world _world{}; Magnum::Timeline timeline; uint32_t _mouse_cursor = (uint32_t)-1; ground_mesh _ground_mesh; diff --git a/main/setup.cpp b/main/setup.cpp index 45f941cb..6f794719 100644 --- a/main/setup.cpp +++ b/main/setup.cpp @@ -103,12 +103,12 @@ auto main_impl::meshes() noexcept -> struct meshes return { _ground_mesh, _wall_mesh, _anim_mesh, }; }; -struct world& main_impl::reset_world() noexcept +class world& main_impl::reset_world() noexcept { return reset_world(floormat::world{}); } -struct world& main_impl::reset_world(struct world&& w) noexcept +class world& main_impl::reset_world(class world&& w) noexcept { _clickable_scenery.clear(); _world = std::move(w); diff --git a/src/chunk.cpp b/src/chunk.cpp index eaeb06e1..ad24b92f 100644 --- a/src/chunk.cpp +++ b/src/chunk.cpp @@ -119,7 +119,7 @@ void chunk::mark_modified() noexcept mark_passability_modified(); } -chunk::chunk(struct world& w, chunk_coords_ ch) noexcept : _world{&w}, _coord{ch} +chunk::chunk(class world& w, chunk_coords_ ch) noexcept : _world{&w}, _coord{ch} { } diff --git a/src/chunk.hpp b/src/chunk.hpp index 759ac324..ff0f589e 100644 --- a/src/chunk.hpp +++ b/src/chunk.hpp @@ -40,7 +40,7 @@ struct chunk final { friend struct tile_ref; friend struct object; - friend struct world; + friend class world; tile_ref operator[](size_t idx) noexcept; tile_proto operator[](size_t idx) const noexcept; @@ -64,7 +64,7 @@ struct chunk final bool empty(bool force = false) const noexcept; - explicit chunk(struct world& w, chunk_coords_ ch) noexcept; + explicit chunk(class world& w, chunk_coords_ ch) noexcept; ~chunk() noexcept; chunk(const chunk&) = delete; chunk& operator=(const chunk&) = delete; @@ -115,7 +115,7 @@ struct chunk final void ensure_passability() noexcept; RTree* rtree() noexcept; - struct world& world() noexcept { return *_world; } + class world& world() noexcept { return *_world; } [[nodiscard]] bool can_place_object(const object_proto& proto, local_coords pos); @@ -147,7 +147,7 @@ private: Pointer<ground_stuff> _ground; Pointer<wall_stuff> _walls; std::vector<std::shared_ptr<object>> _objects; - struct world* _world; + class world* _world; GL::Mesh ground_mesh{NoCreate}, wall_mesh{NoCreate}, scenery_mesh{NoCreate}; RTree _rtree; chunk_coords_ _coord; diff --git a/src/critter.hpp b/src/critter.hpp index 724e2b28..29b29a84 100644 --- a/src/critter.hpp +++ b/src/critter.hpp @@ -7,7 +7,7 @@ namespace floormat { class anim_atlas; -struct world; +class world; struct critter_proto : object_proto { @@ -39,7 +39,7 @@ struct critter final : object private: int allocate_frame_time(float dt); - friend struct world; + friend class world; critter(object_id id, struct chunk& c, const critter_proto& proto); }; diff --git a/src/light.hpp b/src/light.hpp index b5c4469a..7fc429ea 100644 --- a/src/light.hpp +++ b/src/light.hpp @@ -39,7 +39,7 @@ struct light final : object explicit operator light_proto() const; - friend struct world; + friend class world; }; template<> struct object_type_<struct light> : std::integral_constant<object_type, object_type::light> {}; diff --git a/src/object.hpp b/src/object.hpp index 50512419..cfa406d6 100644 --- a/src/object.hpp +++ b/src/object.hpp @@ -13,7 +13,7 @@ namespace floormat { template<typename T> struct object_type_; class anim_atlas; -struct world; +class world; struct chunk; struct object_proto diff --git a/src/path-search.hpp b/src/path-search.hpp index 6391181b..8e56f4fd 100644 --- a/src/path-search.hpp +++ b/src/path-search.hpp @@ -17,7 +17,7 @@ namespace floormat { -struct world; +class world; struct object; struct chunk; diff --git a/src/scenery.hpp b/src/scenery.hpp index bd51db8c..61345ab6 100644 --- a/src/scenery.hpp +++ b/src/scenery.hpp @@ -11,7 +11,7 @@ namespace floormat { struct chunk; class anim_atlas; -struct world; +class world; enum class scenery_type : unsigned char { none, generic, @@ -50,7 +50,7 @@ struct scenery final : object explicit operator scenery_proto() const; private: - friend struct world; + friend class world; scenery(object_id id, struct chunk& c, const scenery_proto& proto); }; diff --git a/src/world.hpp b/src/world.hpp index cdd1bf7f..bb1e1204 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -13,14 +13,13 @@ namespace floormat { struct object; template<typename T> struct object_type_; -struct world final +class world final { static constexpr object_id object_counter_init = 1024; static constexpr size_t initial_capacity = 4096; static constexpr float max_load_factor = .25; static constexpr size_t initial_collect_every = 64; -private: struct chunk_tuple final { static constexpr chunk_coords_ invalid_coords = { -1 << 15, -1 << 15, chunk_z_min }; chunk* c = nullptr; diff --git a/test/app.hpp b/test/app.hpp index 3fb88666..bd31fdf7 100644 --- a/test/app.hpp +++ b/test/app.hpp @@ -9,7 +9,7 @@ namespace floormat { struct chunk_coords; struct chunk_coords_; struct chunk; -struct world; +class world; struct test_app final : private FM_APPLICATION { |