X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2Fui.cpp;h=acf877fd1da6811dca1679d80461d7c86105f0ee;hb=ad7cf72ed47c39640d5588ba53386e090289b4d1;hp=aeaccc55c915e49bf21689f01c1347d82b346da3;hpb=df8e86cac65da6daedcab3e4ab1751de2f7e123a;p=blank.git diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index aeaccc5..acf877f 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -59,6 +59,10 @@ HUD::HUD(const BlockTypeRegistry &types, const Font &font) } +void HUD::DisplayNone() { + block_visible = false; +} + void HUD::Display(const Block &b) { const BlockType &type = types.Get(b.type); @@ -120,7 +124,7 @@ Interface::Interface( , place_timer(256) , remove_timer(256) , remove(0) -, selection(1) +, selection(0) , place_sound(env.assets.LoadSound("thump")) , remove_sound(env.assets.LoadSound("plop")) , fwd(0) @@ -146,7 +150,7 @@ Interface::Interface( messages.Position(glm::vec3(25.0f, -25.0f, 0.0f), Gravity::SOUTH_WEST); messages.Foreground(glm::vec4(1.0f)); messages.Background(glm::vec4(0.5f)); - hud.Display(selection); + hud.DisplayNone(); } @@ -592,10 +596,10 @@ OutlineModel::Buffer outl_buf; } void Interface::CheckAim() { - if (!world.Intersection(aim, glm::mat4(1.0f), aim_world)) { + if (!world.Intersection(aim, glm::mat4(1.0f), ctrl.Controlled().ChunkCoords(), aim_world)) { aim_world = WorldCollision(); } - if (!world.Intersection(aim, glm::mat4(1.0f), aim_entity)) { + if (!world.Intersection(aim, glm::mat4(1.0f), ctrl.Controlled(), aim_entity)) { aim_entity = EntityCollision(); } if (aim_world && aim_entity) {