From 4eac46ee71493082da9044bac01d55b0bdc84a35 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Sat, 19 Aug 2023 23:42:48 +0200 Subject: [PATCH] fix alignment of NPC xdata/ydata with fxconv workaround fxconv.ptr() should have an alignment parameter --- assets/converters.py | 9 +++++++-- src/npc.c | 4 ---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/assets/converters.py b/assets/converters.py index a942fa6..11a5ca4 100644 --- a/assets/converters.py +++ b/assets/converters.py @@ -322,10 +322,15 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax): structData += fxconv.u32(0) structData += fxconv.u32(0) else: + o_xdata = fxconv.Structure() + o_xdata += xdata + o_ydata = fxconv.Structure() + o_ydata += ydata + structData += fxconv.u32(path) structData += fxconv.u32(path_length) - structData += fxconv.ptr( xdata ) - structData += fxconv.ptr( ydata ) + structData += fxconv.ptr(o_xdata) + structData += fxconv.ptr(o_ydata) #else we do nothing (yet) else: diff --git a/src/npc.c b/src/npc.c index ca7b4a7..8f91537 100644 --- a/src/npc.c +++ b/src/npc.c @@ -36,8 +36,6 @@ void npc_draw(Game *game) { int NbPoints = Data->path_length; for(int v=0; vxpath[v % NbPoints] * PXSIZE))-(int16_t) player->wx; int16_t deltaY1=((int16_t) (Data->ypath[v % NbPoints] * PXSIZE))-(int16_t) player->wy; @@ -47,8 +45,6 @@ void npc_draw(Game *game) { dline( player->px + deltaX1, player->py + deltaY1, player->px + deltaX2, player->py + deltaY2, PATH_COLOR); - */ - }