]> git.localhorst.tv Git - blank.git/blobdiff - src/client/client.cpp
linear model instance state
[blank.git] / src / client / client.cpp
index 1978f3929c5b623ef987d224fe3ed2e9e5ffcaa9..6a2dd32993b1fb45031ef9485428ce256ae0f4a7 100644 (file)
@@ -5,7 +5,7 @@
 #include "../app/Environment.hpp"
 #include "../app/init.hpp"
 #include "../app/TextureIndex.hpp"
-#include "../model/CompositeModel.hpp"
+#include "../model/Model.hpp"
 #include "../io/WorldSave.hpp"
 #include "../world/ChunkIndex.hpp"
 #include "../world/ChunkStore.hpp"
@@ -48,6 +48,7 @@ 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()
 , save(master.GetEnv().config.GetWorldPath(master.GetWorldConf().name, master.GetConfig().net.host))
 , world(block_types, master.GetWorldConf())
@@ -65,11 +66,12 @@ InteractiveState::InteractiveState(MasterState &master, uint32_t player_id)
                save.Write(master.GetWorldConf());
        }
        TextureIndex tex_index;
-       master.GetEnv().loader.LoadBlockTypes("default", block_types, tex_index);
+       master.GetEnv().loader.LoadShapes("default", shapes);
+       master.GetEnv().loader.LoadBlockTypes("default", block_types, tex_index, shapes);
+       skeletons.Load(shapes, tex_index);
        interface.SetInventorySlots(block_types.size() - 1);
        chunk_renderer.LoadTextures(master.GetEnv().loader, tex_index);
        chunk_renderer.FogDensity(master.GetWorldConf().fog_density);
-       skeletons.Load();
        loop_timer.Start();
        if (save.Exists(player)) {
                save.Read(player);
@@ -327,7 +329,7 @@ void MasterState::On(const Packet::SpawnEntity &pack) {
        pack.ReadEntity(entity);
        uint32_t skel_id;
        pack.ReadSkeletonID(skel_id);
-       CompositeModel *skel = state->GetSkeletons().ByID(skel_id);
+       Model *skel = state->GetSkeletons().ByID(skel_id);
        if (skel) {
                skel->Instantiate(entity.GetModel());
        }