From 84618348e2bb23118be268eaf20e0ef68e5a799a Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Sun, 7 Jul 2024 08:37:08 +0200 Subject: [PATCH] =?UTF-8?q?-[NEW]=20actor::drawAt(),=20per=20a=20pintar=20?= =?UTF-8?q?un=20actor=20on=20siga=20(coordenades=20de=20pantalla,=20no=20i?= =?UTF-8?q?som=C3=A8triques)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/actor.cpp | 8 +++++++- source/actor.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/actor.cpp b/source/actor.cpp index 7c10c7f..614eaa1 100644 --- a/source/actor.cpp +++ b/source/actor.cpp @@ -965,7 +965,13 @@ namespace actor if (sign) draw::draw(x,y,5,7,50,120); } - //int order=0; + void drawAt(actor_t * act, const int x, const int y) + { + act->inner_x = x; + act->inner_y = y; + draw(act, false); + } + void draw(actor_t *act, const bool draw_all) { if (!act) return; diff --git a/source/actor.h b/source/actor.h index 1c8a4eb..56a8cca 100644 --- a/source/actor.h +++ b/source/actor.h @@ -135,6 +135,7 @@ namespace actor void update(actor_t *act, const bool update_all=true); void updateEditor(actor_t *act, const bool update_all=true); + void drawAt(actor_t * act, const int x, const int y); void draw(actor_t *act, const bool draw_all=true); actor_t *find(std::string name);