]> git.localhorst.tv Git - blank.git/commitdiff
lil cleanup of common and unused stuff
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 15 Oct 2015 14:59:08 +0000 (16:59 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 15 Oct 2015 15:18:12 +0000 (17:18 +0200)
18 files changed:
src/app/Assets.hpp
src/app/FPSController.cpp [deleted file]
src/app/FPSController.hpp [deleted file]
src/app/TextureIndex.hpp [deleted file]
src/app/app.cpp
src/client/InteractiveState.hpp
src/client/client.cpp
src/model/Part.hpp
src/model/model.cpp
src/server/ServerState.cpp
src/server/ServerState.hpp
src/shared/ResourceIndex.hpp [new file with mode: 0644]
src/shared/WorldResources.hpp [new file with mode: 0644]
src/shared/shared.cpp [new file with mode: 0644]
src/standalone/MasterState.cpp
src/standalone/MasterState.hpp
src/world/ChunkRenderer.hpp
src/world/chunk.cpp

index 64bc72ce81f1239ab884b739989f701e9604ffe8..c069c3ec32f7681e0c7573202567adde83327d00 100644 (file)
@@ -12,10 +12,10 @@ class ArrayTexture;
 class BlockTypeRegistry;
 class CubeMap;
 class ModelRegistry;
+class ResourceIndex;
 class ShapeRegistry;
 class Sound;
 class Texture;
-class TextureIndex;
 
 class AssetLoader {
 
@@ -25,20 +25,20 @@ public:
        void LoadBlockTypes(
                const std::string &set_name,
                BlockTypeRegistry &,
-               TextureIndex &,
+               ResourceIndex &,
                const ShapeRegistry &) const;
        CubeMap LoadCubeMap(const std::string &name) const;
        Font LoadFont(const std::string &name, int size) const;
        void LoadModels(
                const std::string &set_name,
                ModelRegistry &,
-               TextureIndex &,
+               ResourceIndex &,
                const ShapeRegistry &) const;
        void LoadShapes(const std::string &set_name, ShapeRegistry &) const;
        Sound LoadSound(const std::string &name) const;
        Texture LoadTexture(const std::string &name) const;
        void LoadTexture(const std::string &name, ArrayTexture &, int layer) const;
-       void LoadTextures(const TextureIndex &, ArrayTexture &) const;
+       void LoadTextures(const ResourceIndex &, ArrayTexture &) const;
 
 private:
        std::string fonts;
diff --git a/src/app/FPSController.cpp b/src/app/FPSController.cpp
deleted file mode 100644 (file)
index 87591aa..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "FPSController.hpp"
-
-#include <glm/gtx/euler_angles.hpp>
-#include <glm/gtx/rotate_vector.hpp>
-
-
-namespace blank {
-
-FPSController::FPSController(Entity &entity) noexcept
-: entity(entity)
-, pitch(0)
-, yaw(0) {
-       entity.Ref();
-}
-
-FPSController::~FPSController() {
-       entity.UnRef();
-}
-
-
-void FPSController::Pitch(float p) noexcept {
-       pitch = p;
-       if (pitch > PI / 2) {
-               pitch = PI / 2;
-       } else if (pitch < -PI / 2) {
-               pitch = -PI / 2;
-       }
-}
-
-void FPSController::RotatePitch(float delta) noexcept {
-       Pitch(pitch + delta);
-}
-
-void FPSController::Yaw(float y) noexcept {
-       yaw = y;
-       if (yaw > PI) {
-               yaw -= PI * 2;
-       } else if (yaw < -PI) {
-               yaw += PI * 2;
-       }
-}
-
-void FPSController::RotateYaw(float delta) noexcept {
-       Yaw(yaw + delta);
-}
-
-
-void FPSController::Update(int dt) noexcept {
-       entity.Orientation(glm::quat(glm::vec3(pitch, yaw, 0.0f)));
-       entity.Velocity(glm::rotateY(velocity, yaw));
-}
-
-}
diff --git a/src/app/FPSController.hpp b/src/app/FPSController.hpp
deleted file mode 100644 (file)
index ee10691..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef BLANK_APP_FPSCONTROLLER_HPP_
-#define BLANK_APP_FPSCONTROLLER_HPP_
-
-#include "../model/geometry.hpp"
-#include "../world/Entity.hpp"
-
-#include <glm/glm.hpp>
-
-
-namespace blank {
-
-/// Sets entity rotation and velocity according to stored velocity
-/// and pitch/yaw components.
-/// Rotation is applied in yaw,pitch order (YX). Velocity is relative
-/// to yaw only (Y axis).
-class FPSController {
-
-public:
-       explicit FPSController(Entity &) noexcept;
-       ~FPSController();
-
-       Entity &Controlled() noexcept { return entity; }
-       const Entity &Controlled() const noexcept { return entity; }
-
-       /// get position and face direction of controlled entity
-       Ray Aim() const noexcept { return entity.Aim(entity.ChunkCoords()); }
-
-       /// velocity, relative to heading (yaw only)
-       const glm::vec3 &Velocity() const noexcept { return velocity; }
-       void Velocity(const glm::vec3 &vel) noexcept { velocity = vel; }
-
-       // all angles in radians (full circle = 2π)
-       float Pitch() const noexcept { return pitch; }
-       void Pitch(float p) noexcept;
-       void RotatePitch(float delta) noexcept;
-       float Yaw() const noexcept { return yaw; }
-       void Yaw(float y) noexcept;
-       void RotateYaw(float delta) noexcept;
-
-       void Update(int dt) noexcept;
-
-private:
-       Entity &entity;
-
-       glm::vec3 velocity;
-
-       float pitch;
-       float yaw;
-
-};
-
-}
-
-#endif
diff --git a/src/app/TextureIndex.hpp b/src/app/TextureIndex.hpp
deleted file mode 100644 (file)
index 8c6e22f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef BLANK_APP_TEXTUREINDEX_HPP_
-#define BLANK_APP_TEXTUREINDEX_HPP_
-
-#include <map>
-#include <string>
-
-
-namespace blank {
-
-class TextureIndex {
-
-       using MapType = std::map<std::string, int>;
-
-public:
-       TextureIndex();
-
-       int GetID(const std::string &);
-
-       std::size_t Size() const noexcept { return id_map.size(); }
-       const MapType &Entries() const noexcept { return id_map; }
-
-private:
-       MapType id_map;
-
-};
-
-};
-
-#endif
index 7f5f02f0d5e1c557675c56dbdad3b7a1ac970189..ab5170f8ebc70233546b22b3d658ed92a629126d 100644 (file)
@@ -4,7 +4,6 @@
 #include "FrameCounter.hpp"
 #include "State.hpp"
 #include "StateControl.hpp"
-#include "TextureIndex.hpp"
 
 #include "init.hpp"
 #include "../audio/Sound.hpp"
@@ -18,6 +17,7 @@
 #include "../model/ModelRegistry.hpp"
 #include "../model/Shape.hpp"
 #include "../model/ShapeRegistry.hpp"
+#include "../shared/ResourceIndex.hpp"
 #include "../world/BlockType.hpp"
 #include "../world/BlockTypeRegistry.hpp"
 #include "../world/Entity.hpp"
@@ -318,7 +318,7 @@ CuboidBounds slab_shape({{ -0.5f, -0.5f, -0.5f }, { 0.5f, 0.0f, 0.5f }});
 void AssetLoader::LoadBlockTypes(
        const string &set_name,
        BlockTypeRegistry &reg,
-       TextureIndex &tex_index,
+       ResourceIndex &tex_index,
        const ShapeRegistry &shapes
 ) const {
        string full = data + set_name + ".types";
@@ -499,7 +499,7 @@ Font AssetLoader::LoadFont(const string &name, int size) const {
 void AssetLoader::LoadModels(
        const string &set_name,
        ModelRegistry &models,
-       TextureIndex &tex_index,
+       ResourceIndex &tex_index,
        const ShapeRegistry &shapes
 ) const {
        string full = data + set_name + ".models";
@@ -584,7 +584,7 @@ void AssetLoader::LoadTexture(const string &name, ArrayTexture &tex, int layer)
        SDL_FreeSurface(srf);
 }
 
-void AssetLoader::LoadTextures(const TextureIndex &index, ArrayTexture &tex) const {
+void AssetLoader::LoadTextures(const ResourceIndex &index, ArrayTexture &tex) const {
        // TODO: where the hell should that size come from?
        tex.Reserve(16, 16, index.Size(), Format());
        for (const auto &entry : index.Entries()) {
@@ -593,22 +593,6 @@ void AssetLoader::LoadTextures(const TextureIndex &index, ArrayTexture &tex) con
 }
 
 
-TextureIndex::TextureIndex()
-: id_map() {
-
-}
-
-int TextureIndex::GetID(const string &name) {
-       auto entry = id_map.find(name);
-       if (entry == id_map.end()) {
-               auto result = id_map.emplace(name, Size());
-               return result.first->second;
-       } else {
-               return entry->second;
-       }
-}
-
-
 void FrameCounter::EnterFrame() noexcept {
        last_enter = SDL_GetTicks();
        last_tick = last_enter;
index 2bc459a330a875e9fb748a9e0a10fda43f61c020..02385e2e5a5ff6904aa1031d3ebd12ed61759a0a 100644 (file)
@@ -9,13 +9,11 @@
 #include "../app/IntervalTimer.hpp"
 #include "../graphics/SkyBox.hpp"
 #include "../io/WorldSave.hpp"
-#include "../model/ModelRegistry.hpp"
-#include "../model/ShapeRegistry.hpp"
 #include "../net/Packet.hpp"
+#include "../shared/WorldResources.hpp"
 #include "../ui/HUD.hpp"
 #include "../ui/InteractiveManipulator.hpp"
 #include "../ui/Interface.hpp"
-#include "../world/BlockTypeRegistry.hpp"
 #include "../world/ChunkRenderer.hpp"
 #include "../world/EntityState.hpp"
 #include "../world/Player.hpp"
@@ -40,7 +38,6 @@ public:
        World &GetWorld() noexcept { return world; }
        Player &GetPlayer() noexcept { return player; }
        ChunkReceiver &GetChunkReceiver() noexcept { return chunk_receiver; }
-       ModelRegistry &GetModels() noexcept { return models; }
 
        void OnEnter() override;
 
@@ -69,9 +66,7 @@ private:
 
 private:
        MasterState &master;
-       ShapeRegistry shapes;
-       BlockTypeRegistry block_types;
-       ModelRegistry models;
+       WorldResources res;
        WorldSave save;
        World world;
        Player &player;
index cc3106f8e34a08be63d49f9ce789d83480da3f74..236fa1a41fe0872a35d5a819da2f186fa764b998 100644 (file)
@@ -4,7 +4,6 @@
 
 #include "../app/Environment.hpp"
 #include "../app/init.hpp"
-#include "../app/TextureIndex.hpp"
 #include "../model/Model.hpp"
 #include "../io/WorldSave.hpp"
 #include "../world/ChunkIndex.hpp"
@@ -48,11 +47,9 @@ void InitialState::Render(Viewport &viewport) {
 // TODO: this clutter is a giant mess
 InteractiveState::InteractiveState(MasterState &master, uint32_t player_id)
 : master(master)
-, shapes()
-, block_types()
-, models()
+, res()
 , save(master.GetEnv().config.GetWorldPath(master.GetWorldConf().name, master.GetConfig().net.host))
-, world(block_types, master.GetWorldConf())
+, world(res.block_types, master.GetWorldConf())
 , player(*world.AddPlayer(master.GetConfig().player.name))
 , hud(master.GetEnv(), master.GetConfig(), player)
 , manip(master.GetEnv(), player.GetEntity())
@@ -66,12 +63,9 @@ InteractiveState::InteractiveState(MasterState &master, uint32_t player_id)
        if (!save.Exists()) {
                save.Write(master.GetWorldConf());
        }
-       TextureIndex tex_index;
-       master.GetEnv().loader.LoadShapes("default", shapes);
-       master.GetEnv().loader.LoadBlockTypes("default", block_types, tex_index, shapes);
-       master.GetEnv().loader.LoadModels("default", models, tex_index, shapes);
-       interface.SetInventorySlots(block_types.size() - 1);
-       chunk_renderer.LoadTextures(master.GetEnv().loader, tex_index);
+       res.Load(master.GetEnv().loader, "default");
+       interface.SetInventorySlots(res.block_types.size() - 1);
+       chunk_renderer.LoadTextures(master.GetEnv().loader, res.tex_index);
        chunk_renderer.FogDensity(master.GetWorldConf().fog_density);
        loop_timer.Start();
        if (save.Exists(player)) {
@@ -120,7 +114,7 @@ void InteractiveState::Update(int dt) {
        } else {
                hud.FocusNone();
        }
-       hud.Display(block_types[player.GetInventorySlot() + 1]);
+       hud.Display(res.block_types[player.GetInventorySlot() + 1]);
        loop_timer.Update(dt);
        master.Update(dt);
        chunk_receiver.Update(dt);
@@ -164,8 +158,8 @@ void InteractiveState::Handle(const Packet::SpawnEntity &pack) {
        pack.ReadEntity(entity);
        uint32_t skel_id;
        pack.ReadSkeletonID(skel_id);
-       if (skel_id > 0 && skel_id <= models.size()) {
-               Model &skel = models.Get(skel_id);
+       if (skel_id > 0 && skel_id <= res.models.size()) {
+               Model &skel = res.models.Get(skel_id);
                skel.Instantiate(entity.GetModel());
        }
        cout << "spawned entity #" << entity_id << "  (" << entity.Name()
@@ -257,7 +251,7 @@ void InteractiveState::Handle(const Packet::BlockUpdate &pack) {
                Block block;
                pack.ReadIndex(index, i);
                pack.ReadBlock(block, i);
-               if (index < Chunk::size && block.type < block_types.size()) {
+               if (index < Chunk::size && block.type < res.block_types.size()) {
                        manip.SetBlock(*chunk, index, block);
                }
        }
index f71efc5425a1580a992ba1b857e38e8ef9797a44..3e3b57080316942b8c60622614b4cda9f64e80e9 100644 (file)
@@ -17,9 +17,9 @@ class DirectionalLighting;
 class EntityMesh;
 class Instance;
 class Model;
+class ResourceIndex;
 class Shape;
 class ShapeRegistry;
-class TextureIndex;
 class TokenStreamReader;
 
 struct Part {
@@ -33,7 +33,7 @@ public:
        Part();
        ~Part();
 
-       void Read(TokenStreamReader &, TextureIndex &, const ShapeRegistry &);
+       void Read(TokenStreamReader &, ResourceIndex &, const ShapeRegistry &);
 
        Part &AddChild();
        const std::list<Part> &Children() const noexcept { return children; }
index 63187b863033569af1da8f1e446ac3ec54607d69..55050e0b72d856ce57894787705c0630cbc981a3 100644 (file)
@@ -5,10 +5,10 @@
 
 #include "Shape.hpp"
 #include "ShapeRegistry.hpp"
-#include "../app/TextureIndex.hpp"
 #include "../io/TokenStreamReader.hpp"
 #include "../graphics/DirectionalLighting.hpp"
 #include "../graphics/EntityMesh.hpp"
+#include "../shared/ResourceIndex.hpp"
 
 #include <iostream>
 #include <glm/gtx/quaternion.hpp>
@@ -101,7 +101,7 @@ Part::~Part() {
 
 }
 
-void Part::Read(TokenStreamReader &in, TextureIndex &tex_index, const ShapeRegistry &shapes) {
+void Part::Read(TokenStreamReader &in, ResourceIndex &tex_index, const ShapeRegistry &shapes) {
        std::string name;
        std::string shape_name;
        std::string tex_name;
index 3e2869fc56b1da8afec9c2faccaf71c9eed97593..0bec3918c0345bc0e3e836157d3d148ba0ddcac2 100644 (file)
@@ -1,7 +1,6 @@
 #include "ServerState.hpp"
 
 #include "../app/Environment.hpp"
-#include "../app/TextureIndex.hpp"
 #include "../io/WorldSave.hpp"
 #include "../net/io.hpp"
 
@@ -19,25 +18,20 @@ ServerState::ServerState(
        const Config &config
 )
 : env(env)
-, shapes()
-, block_types()
-, models()
-, world(block_types, wc)
+, res()
+, world(res.block_types, wc)
 , generator(gc)
 , chunk_loader(world.Chunks(), generator, ws)
-, spawner(world, models, env.rng)
+, spawner(world, res.models, env.rng)
 , server(config.net, world, wc, ws)
 , loop_timer(16) {
-       TextureIndex tex_index;
-       env.loader.LoadShapes("default", shapes);
-       env.loader.LoadBlockTypes("default", block_types, tex_index, shapes);
-       env.loader.LoadModels("default", models, tex_index, shapes);
-       if (models.size() < 2) {
+       res.Load(env.loader, "default");
+       if (res.models.size() < 2) {
                throw std::runtime_error("need at least two models to run");
        }
-       generator.LoadTypes(block_types);
-       spawner.LimitModels(1, models.size());
-       server.SetPlayerModel(models[0]);
+       generator.LoadTypes(res.block_types);
+       spawner.LimitModels(1, res.models.size());
+       server.SetPlayerModel(res.models[0]);
 
        loop_timer.Start();
 
index b62cf0904224f767730bf6cd33f5156c1d7e50f8..fbf28e5768f71c7003fa5436b2e6aa48a0da9892 100644 (file)
@@ -5,9 +5,7 @@
 #include "../ai/Spawner.hpp"
 #include "../app/IntervalTimer.hpp"
 #include "../app/State.hpp"
-#include "../model/ModelRegistry.hpp"
-#include "../model/ShapeRegistry.hpp"
-#include "../world/BlockTypeRegistry.hpp"
+#include "../shared/WorldResources.hpp"
 #include "../world/ChunkLoader.hpp"
 #include "../world/Generator.hpp"
 #include "../world/World.hpp"
@@ -40,9 +38,7 @@ public:
 
 private:
        HeadlessEnvironment &env;
-       ShapeRegistry shapes;
-       BlockTypeRegistry block_types;
-       ModelRegistry models;
+       WorldResources res;
        World world;
        Generator generator;
        ChunkLoader chunk_loader;
diff --git a/src/shared/ResourceIndex.hpp b/src/shared/ResourceIndex.hpp
new file mode 100644 (file)
index 0000000..e04ec6f
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef BLANK_SHARED_RESOURCEINDEX_HPP_
+#define BLANK_SHARED_RESOURCEINDEX_HPP_
+
+#include <map>
+#include <string>
+
+
+namespace blank {
+
+class ResourceIndex {
+
+       using MapType = std::map<std::string, std::size_t>;
+
+public:
+       ResourceIndex();
+
+       std::size_t GetID(const std::string &);
+
+       std::size_t Size() const noexcept { return id_map.size(); }
+       const MapType &Entries() const noexcept { return id_map; }
+
+private:
+       MapType id_map;
+
+};
+
+};
+
+#endif
diff --git a/src/shared/WorldResources.hpp b/src/shared/WorldResources.hpp
new file mode 100644 (file)
index 0000000..d92101d
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef BLANK_SHARED_WORLDRESOURCES_HPP_
+#define BLANK_SHARED_WORLDRESOURCES_HPP_
+
+#include "ResourceIndex.hpp"
+#include "../model/ModelRegistry.hpp"
+#include "../model/ShapeRegistry.hpp"
+#include "../world/BlockTypeRegistry.hpp"
+
+#include <string>
+
+
+namespace blank {
+
+class AssetLoader;
+
+struct WorldResources {
+
+       ShapeRegistry shapes;
+       BlockTypeRegistry block_types;
+       ModelRegistry models;
+
+       ResourceIndex tex_index;
+
+
+       WorldResources();
+
+       void Load(const AssetLoader &, const std::string &set);
+
+};
+
+}
+
+#endif
diff --git a/src/shared/shared.cpp b/src/shared/shared.cpp
new file mode 100644 (file)
index 0000000..9541c95
--- /dev/null
@@ -0,0 +1,39 @@
+#include "ResourceIndex.hpp"
+#include "WorldResources.hpp"
+
+#include "../app/Assets.hpp"
+
+
+namespace blank {
+
+ResourceIndex::ResourceIndex()
+: id_map() {
+
+}
+
+std::size_t ResourceIndex::GetID(const std::string &name) {
+       auto entry = id_map.find(name);
+       if (entry == id_map.end()) {
+               auto result = id_map.emplace(name, Size());
+               return result.first->second;
+       } else {
+               return entry->second;
+       }
+}
+
+
+WorldResources::WorldResources()
+: shapes()
+, block_types()
+, models()
+, tex_index() {
+
+}
+
+void WorldResources::Load(const AssetLoader &loader, const std::string &set) {
+       loader.LoadShapes("default", shapes);
+       loader.LoadBlockTypes("default", block_types, tex_index, shapes);
+       loader.LoadModels("default", models, tex_index, shapes);
+}
+
+}
index 9d95966953590d7b5ab146f36cb4439b64f68505..7ae67418a6160bec46081c23924eaf7e8bab357f 100644 (file)
@@ -3,7 +3,6 @@
 #include "../app/Config.hpp"
 #include "../app/Environment.hpp"
 #include "../app/init.hpp"
-#include "../app/TextureIndex.hpp"
 #include "../io/WorldSave.hpp"
 
 #include <SDL.h>
@@ -21,11 +20,9 @@ MasterState::MasterState(
 )
 : config(config)
 , env(env)
-, shapes()
-, block_types()
-, models()
+, res()
 , save(save)
-, world(block_types, wc)
+, world(res.block_types, wc)
 , spawn_index(world.Chunks().MakeIndex(wc.spawn, 3))
 , player(*world.AddPlayer(config.player.name))
 , spawn_player(false)
@@ -36,21 +33,18 @@ MasterState::MasterState(
 , generator(gc)
 , chunk_loader(world.Chunks(), generator, save)
 , chunk_renderer(player.GetChunks())
-, spawner(world, models, env.rng)
+, spawner(world, res.models, env.rng)
 , sky(env.loader.LoadCubeMap("skybox"))
 , preload(env, chunk_loader, chunk_renderer)
 , unload(env, world.Chunks(), save) {
-       TextureIndex tex_index;
-       env.loader.LoadShapes("default", shapes);
-       env.loader.LoadBlockTypes("default", block_types, tex_index, shapes);
-       env.loader.LoadModels("default", models, tex_index, shapes);
-       if (models.size() < 2) {
+       res.Load(env.loader, "default");
+       if (res.models.size() < 2) {
                throw std::runtime_error("need at least two models to run");
        }
-       spawner.LimitModels(0, models.size());
-       interface.SetInventorySlots(block_types.size() - 1);
-       generator.LoadTypes(block_types);
-       chunk_renderer.LoadTextures(env.loader, tex_index);
+       spawner.LimitModels(0, res.models.size());
+       interface.SetInventorySlots(res.block_types.size() - 1);
+       generator.LoadTypes(res.block_types);
+       chunk_renderer.LoadTextures(env.loader, res.tex_index);
        chunk_renderer.FogDensity(wc.fog_density);
        if (save.Exists(player)) {
                save.Read(player);
@@ -119,7 +113,7 @@ void MasterState::Update(int dt) {
        } else {
                hud.FocusNone();
        }
-       hud.Display(block_types[player.GetInventorySlot() + 1]);
+       hud.Display(res.block_types[player.GetInventorySlot() + 1]);
        hud.Update(dt);
        spawner.Update(dt);
        world.Update(dt);
index f72c38ceed7b73f83059b3e1249c4da46f4c42f9..6e630200fa9eab8e60b653e7fb5bf76cae1b9d53 100644 (file)
@@ -8,13 +8,11 @@
 #include "UnloadState.hpp"
 #include "../ai/Spawner.hpp"
 #include "../graphics/SkyBox.hpp"
-#include "../model/ModelRegistry.hpp"
-#include "../model/ShapeRegistry.hpp"
+#include "../shared/WorldResources.hpp"
 #include "../ui/DirectInput.hpp"
 #include "../ui/HUD.hpp"
 #include "../ui/InteractiveManipulator.hpp"
 #include "../ui/Interface.hpp"
-#include "../world/BlockTypeRegistry.hpp"
 #include "../world/ChunkIndex.hpp"
 #include "../world/ChunkLoader.hpp"
 #include "../world/ChunkRenderer.hpp"
@@ -63,9 +61,7 @@ public:
 private:
        Config &config;
        Environment &env;
-       ShapeRegistry shapes;
-       BlockTypeRegistry block_types;
-       ModelRegistry models;
+       WorldResources res;
        const WorldSave &save;
        World world;
        ChunkIndex &spawn_index;
index 714bb847f5655495ea979ca6cc4ca07a4b2a9063..7234941b7a472128d8f685355b2eb0161213a55c 100644 (file)
@@ -14,7 +14,7 @@ namespace blank {
 class AssetLoader;
 class BlockMesh;
 class ChunkIndex;
-class TextureIndex;
+class ResourceIndex;
 class Viewport;
 
 class ChunkRenderer {
@@ -23,7 +23,7 @@ public:
        explicit ChunkRenderer(ChunkIndex &);
        ~ChunkRenderer();
 
-       void LoadTextures(const AssetLoader &, const TextureIndex &);
+       void LoadTextures(const AssetLoader &, const ResourceIndex &);
        void FogDensity(float d) noexcept { fog_density = d; }
 
        int MissingChunks() const noexcept;
index f819ef9be8ecacdeb90219862dc399f554d78a58..ef9f578fa3e90dd9c90a1336925e086c1d0b3611 100644 (file)
@@ -675,7 +675,7 @@ int ChunkRenderer::MissingChunks() const noexcept {
        return index.MissingChunks();
 }
 
-void ChunkRenderer::LoadTextures(const AssetLoader &loader, const TextureIndex &tex_index) {
+void ChunkRenderer::LoadTextures(const AssetLoader &loader, const ResourceIndex &tex_index) {
        block_tex.Bind();
        loader.LoadTextures(tex_index, block_tex);
        block_tex.FilterNearest();