X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FApplication.cpp;h=76ded2db2c9b15bc35ba637bf5567ccdfee369d4;hb=7fccdf2cd07afb3afdc0b854e9a03130ef202eec;hp=94901bfd44df41c8f431931f8049132c5ea40a2a;hpb=a8523bee4fc349a800f5f6d67b470c3a801beaa9;p=orbi.git diff --git a/src/app/Application.cpp b/src/app/Application.cpp index 94901bf..76ded2d 100644 --- a/src/app/Application.cpp +++ b/src/app/Application.cpp @@ -175,7 +175,7 @@ void Application::RenderBackground() { canvas.Fill(); canvas.SetColor(outlineColor); - canvas.Grid(cam.ToScreen(Vector(0, 0)), cam.ToScale(world.Size()), cam.ToScale(Vector(1, 1))); + canvas.Grid(cam.ToScreen(Vector(0, 0)), cam.ToScale(world.Size()), cam.ToScale(world.TileSize())); } void Application::RenderWorld() { @@ -190,27 +190,33 @@ void Application::RenderWorld() { } void Application::RenderEntities() { - constexpr Color vboxColor(0xFA, 0x00, 0x00); + constexpr Color boundsColor(0xFA, 0x00, 0x00); + constexpr Color vboxColor(0xFA, 0xFA, 0x00); constexpr Color hboxColor(0x00, 0xFA, 0x00); for (const Entity &e : world.Entities()) { + canvas.SetColor(boundsColor); + canvas.OutlineRect( + cam.ToScreen(Vector(e.bounds.Left(), e.bounds.Top())), + cam.ToScale(Vector(e.bounds.Size())) + ); canvas.SetColor(vboxColor); canvas.Line( cam.ToScreen(Vector(e.vbox.Left(), e.vbox.Top())), - cam.ToScreen(Vector(e.vbox.Right(), e.vbox.Top())) + cam.ToScreen(Vector(e.vbox.Right(), e.vbox.Top())) - Vector(1, 0) ); canvas.Line( - cam.ToScreen(Vector(e.vbox.Left(), e.vbox.Bottom())), - cam.ToScreen(Vector(e.vbox.Right(), e.vbox.Bottom())) + cam.ToScreen(Vector(e.vbox.Left(), e.vbox.Bottom())) - Vector(0, 1), + cam.ToScreen(Vector(e.vbox.Right(), e.vbox.Bottom())) - Vector(1, 1) ); canvas.SetColor(hboxColor); canvas.Line( cam.ToScreen(Vector(e.hbox.Left(), e.hbox.Top())), - cam.ToScreen(Vector(e.hbox.Left(), e.hbox.Bottom())) + cam.ToScreen(Vector(e.hbox.Left(), e.hbox.Bottom())) - Vector(0, 1) ); canvas.Line( - cam.ToScreen(Vector(e.hbox.Right(), e.hbox.Top())), - cam.ToScreen(Vector(e.hbox.Right(), e.hbox.Bottom())) + cam.ToScreen(Vector(e.hbox.Right(), e.hbox.Top())) - Vector(1, 0), + cam.ToScreen(Vector(e.hbox.Right(), e.hbox.Bottom())) - Vector(1, 1) ); } }