X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fhud.cpp;h=0f496c6d7ce074f59a4dd224043ba9f38c2af3c3;hb=e53a0e2e711a7d8bd9b0ddacd1360aa14370643f;hp=0747cffbca3424364e5a91c43bfe38c3eaa91af5;hpb=b368ecb2c0f34e27b1d3b97cceb218b554dee324;p=blank.git diff --git a/src/hud.cpp b/src/hud.cpp index 0747cff..0f496c6 100644 --- a/src/hud.cpp +++ b/src/hud.cpp @@ -39,18 +39,18 @@ HUD::HUD(const BlockTypeRegistry &types) } -void HUD::Viewport(float width, float height) { +void HUD::Viewport(float width, float height) noexcept { Viewport(0, 0, width, height); } -void HUD::Viewport(float x, float y, float width, float height) { +void HUD::Viewport(float x, float y, float width, float height) noexcept { projection = glm::ortho(x, width, height, y, near, far); crosshair_transform = glm::translate(glm::mat4(1.0f), glm::vec3(width * 0.5f, height * 0.5f, 0.0f)); } void HUD::Display(const Block &b) { - const BlockType &type = *types.Get(b.type); + const BlockType &type = types.Get(b.type); block_buf.Clear(); type.FillModel(block_buf, b.Transform()); @@ -59,7 +59,7 @@ void HUD::Display(const Block &b) { } -void HUD::Render(DirectionalLighting &program) { +void HUD::Render(DirectionalLighting &program) noexcept { if (block_visible) { program.SetLightDirection({ 1.0f, 3.0f, 5.0f }); // disable distance fog