]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/ui.cpp
split chunk stuff
[blank.git] / src / ui / ui.cpp
index d8459e5190419f1c27e8f069d0da6efdae388d01..39942987f6375a243fd0412572cffbc8201bf3fe 100644 (file)
@@ -102,11 +102,12 @@ void HUD::Render(Viewport &viewport) noexcept {
 Interface::Interface(
        const Config &config,
        Environment &env,
-       World &world)
+       World &world,
+       const Player &player)
 : env(env)
 , world(world)
-// let's assume this succeeds and hope for the best for now
-, ctrl(*world.AddPlayer(config.player_name))
+, player(player)
+, ctrl(*player.entity)
 , hud(world.BlockTypes(), env.assets.small_ui_font)
 , aim{{ 0, 0, 0 }, { 0, 0, -1 }}
 , aim_world()
@@ -525,7 +526,7 @@ void Interface::UpdateOutline() {
        outl_buf.Clear();
        aim_world.GetType().FillOutlineModel(outl_buf);
        outline.Update(outl_buf);
-       outline_transform = aim_world.GetChunk().Transform(Player().ChunkCoords());
+       outline_transform = aim_world.GetChunk().Transform(player.entity->ChunkCoords());
        outline_transform *= aim_world.BlockTransform();
        outline_transform *= glm::scale(glm::vec3(1.005f));
 }