X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FApplication.cpp;fp=src%2Fapp%2FApplication.cpp;h=94901bfd44df41c8f431931f8049132c5ea40a2a;hb=a8523bee4fc349a800f5f6d67b470c3a801beaa9;hp=b6a08f115cc48b66d57367297380afad1b1a43a4;hpb=962405ec344818a7f6850d243feca7989ae5d41b;p=orbi.git diff --git a/src/app/Application.cpp b/src/app/Application.cpp index b6a08f1..94901bf 100644 --- a/src/app/Application.cpp +++ b/src/app/Application.cpp @@ -154,7 +154,7 @@ void Application::Update(int dt) { } target.Update(delta); focus = ctrl.Controlling() - ? ctrl.Controlled().bounds.Center() + ? ctrl.Controlled().vbox.Center() : target.Pos(); cam.Update(delta); } @@ -190,13 +190,28 @@ void Application::RenderWorld() { } void Application::RenderEntities() { - constexpr Color entityColor(0x00, 0xFA, 0x00); - canvas.SetColor(entityColor); + constexpr Color vboxColor(0xFA, 0x00, 0x00); + constexpr Color hboxColor(0x00, 0xFA, 0x00); for (const Entity &e : world.Entities()) { - const Vector pos(e.bounds.Left(), e.bounds.Top()); - const Vector size(e.bounds.Size()); - canvas.OutlineRect(cam.ToScreen(pos), cam.ToScale(size)); + canvas.SetColor(vboxColor); + canvas.Line( + cam.ToScreen(Vector(e.vbox.Left(), e.vbox.Top())), + cam.ToScreen(Vector(e.vbox.Right(), e.vbox.Top())) + ); + canvas.Line( + cam.ToScreen(Vector(e.vbox.Left(), e.vbox.Bottom())), + cam.ToScreen(Vector(e.vbox.Right(), e.vbox.Bottom())) + ); + canvas.SetColor(hboxColor); + canvas.Line( + cam.ToScreen(Vector(e.hbox.Left(), e.hbox.Top())), + cam.ToScreen(Vector(e.hbox.Left(), e.hbox.Bottom())) + ); + canvas.Line( + cam.ToScreen(Vector(e.hbox.Right(), e.hbox.Top())), + cam.ToScreen(Vector(e.hbox.Right(), e.hbox.Bottom())) + ); } }