From 875048383990acd8edcce029682246f6eb01663e Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Wed, 12 Jun 2024 12:44:43 +0200 Subject: [PATCH] =?UTF-8?q?-=20Ja=20guarda=20l'habitaci=C3=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/actor.cpp | 20 +++++++++++--------- source/jui.cpp | 2 +- source/main.cpp | 11 ++++++----- source/room.cpp | 28 ++++++++++++++-------------- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/source/actor.cpp b/source/actor.cpp index 0a85f59..37f1e51 100644 --- a/source/actor.cpp +++ b/source/actor.cpp @@ -44,6 +44,7 @@ namespace actor act->anim_wait = act->anim_wait_count = 0; act->anim_frame=0; act->react_mask = act->react_push = 0; + act->flags = FLAG_NONE; return act; } @@ -61,6 +62,7 @@ namespace actor act->anim_wait = act->anim_wait_count = 0; act->anim_frame=0; act->react_mask = act->react_push = 0; + act->flags = FLAG_NONE; return act; } @@ -195,21 +197,21 @@ namespace actor void saveToFile(FILE *f, actor_t *act) { - fprintf(f, "actor{\n"); + fprintf(f, "\nactor{\n"); fprintf(f, " name: %s\n", act->name); fprintf(f, " bmp: %s\n", act->bmp); fprintf(f, " bmp-rect: %i %i %i %i\n", act->bmp_rect.x, act->bmp_rect.y, act->bmp_rect.w, act->bmp_rect.h); fprintf(f, " bmp-offset: %i %i\n", act->bmp_offset.x, act->bmp_offset.y); fprintf(f, " pos: %i %i %i\n", act->pos.x, act->pos.y, act->pos.z); fprintf(f, " size: %i %i %i\n", act->size.x, act->size.y, act->size.z); - fprintf(f, " orient: %s\n", numToOrient(act->orient)); - fprintf(f, " anim-cycle: %s\n", act->anim_cycle==0 ? "WALK" : "SEQ"); - fprintf(f, " anim-wait: %i\n", act->anim_wait); - fprintf(f, " flags: %s\n", numToFlags(act->flags)); - fprintf(f, " react-mask: %s\n", numToOrient(act->react_mask)); - fprintf(f, " react-push: %s\n", numToOrient(act->react_push)); - fprintf(f, " movement: %s\n\n", numToMov(act->movement)); - fprintf(f, "}\n\n"); + if (act->orient!=0) fprintf(f, " orient: %s\n", numToOrient(act->orient)); + if (act->anim_cycle!=0) fprintf(f, " anim-cycle: %s\n", act->anim_cycle==0 ? "WALK" : "SEQ"); + if (act->anim_wait!=0) fprintf(f, " anim-wait: %i\n", act->anim_wait); + if (act->flags!=0) fprintf(f, " flags: %s\n", numToFlags(act->flags)); + if (act->react_mask!=0) fprintf(f, " react-mask: %s\n", numToOrient(act->react_mask)); + if (act->react_push!=0) fprintf(f, " react-push: %s\n", numToOrient(act->react_push)); + if (act->movement!=0) fprintf(f, " movement: %s\n", numToMov(act->movement)); + fprintf(f, "}\n"); } const bool check_2d_collision(actor_t *obj1, actor_t *obj2) diff --git a/source/jui.cpp b/source/jui.cpp index 3c2a0e5..592c819 100644 --- a/source/jui.cpp +++ b/source/jui.cpp @@ -77,7 +77,7 @@ namespace ui draw::color(LIGHT+WHITE); draw::fillrect(x, y, w, h); - draw::color(PAPER); + draw::color(WHITE); draw::rect(x, y, w, h); draw::vline(x+w-11,y+1,h-2); diff --git a/source/main.cpp b/source/main.cpp index 819b451..f1646ce 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -191,10 +191,10 @@ const bool btn_check(const int x, const int y, const char* label, uint16_t &flag return false; } -const bool btn_opt(const char* label, const int x, const int y, uint8_t &var, std::vector values, std::vector labels) +const bool btn_opt(const char* label, const int x, const int y, uint8_t &var, std::vector values, std::vector labels, const int w=32) { //draw::print(label, x, y+3, 15, 0); - ui::label(label, x, y, 32, 11); + ui::label(label, x, y, w, 11); int result = 0; std::size_t pos = 0; while (posflags&(FLAG_HERO|FLAG_NOEDITOR))==0 ) actor::saveToFile(f, act); act = act->next; }