X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp.cpp;h=9580d33560024171ab9db84e957777b697f2c970;hb=7caa2326d25d4fc5ba98318dfccb508bb3e16820;hp=10a72b8e89e698f2abf52164df4bc91a6b164c96;hpb=eca1fdcc8e34a4918418b2de122c6200aeb7ceaf;p=blank.git diff --git a/src/app.cpp b/src/app.cpp index 10a72b8..9580d33 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -118,7 +118,7 @@ void Application::Update(int dt) { glm::vec3 pos = Chunk::ToCoords(blkid); outline_visible = true; outline.Clear(); - chunk->BlockAt(blkid).type->FillOutlineModel(outline); + chunk->Type(chunk->BlockAt(blkid)).FillOutlineModel(outline); outline_transform = glm::translate(chunk->Transform(world.Player().ChunkCoords()), pos); outline_transform = glm::scale(outline_transform, glm::vec3(1.0001f)); } else { @@ -127,14 +127,14 @@ void Application::Update(int dt) { if (pick) { if (chunk) { - place_id = chunk->BlockAt(blkid).type->id; + place_id = chunk->BlockAt(blkid).type; hud.Display(*world.BlockTypes()[place_id]); } pick = false; } if (remove) { if (chunk) { - chunk->BlockAt(blkid).type = world.BlockTypes()[remove_id]; + chunk->BlockAt(blkid).type = remove_id; chunk->Invalidate(); } remove = false; @@ -147,7 +147,7 @@ void Application::Update(int dt) { mod_chunk = &world.Next(*chunk, normal); next_pos -= normal * glm::vec3(Chunk::Extent()); } - mod_chunk->BlockAt(next_pos).type = world.BlockTypes()[place_id]; + mod_chunk->BlockAt(next_pos).type = place_id; mod_chunk->Invalidate(); } place = false;