fix alignment of NPC xdata/ydata with fxconv workaround

fxconv.ptr() should have an alignment parameter
This commit is contained in:
Lephenixnoir 2023-08-19 23:42:48 +02:00
parent 8639a3feed
commit 4eac46ee71
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495
2 changed files with 7 additions and 6 deletions

View file

@ -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)
structData += fxconv.u32(0) structData += fxconv.u32(0)
else: else:
o_xdata = fxconv.Structure()
o_xdata += xdata
o_ydata = fxconv.Structure()
o_ydata += ydata
structData += fxconv.u32(path) structData += fxconv.u32(path)
structData += fxconv.u32(path_length) structData += fxconv.u32(path_length)
structData += fxconv.ptr( xdata ) structData += fxconv.ptr(o_xdata)
structData += fxconv.ptr( ydata ) structData += fxconv.ptr(o_ydata)
#else we do nothing (yet) #else we do nothing (yet)
else: else:

View file

@ -36,8 +36,6 @@ void npc_draw(Game *game) {
int NbPoints = Data->path_length; int NbPoints = Data->path_length;
for(int v=0; v<NbPoints; v++) for(int v=0; v<NbPoints; v++)
{ {
/*
int16_t deltaX1=((int16_t) (Data->xpath[v % NbPoints] * PXSIZE))-(int16_t) player->wx; int16_t deltaX1=((int16_t) (Data->xpath[v % NbPoints] * PXSIZE))-(int16_t) player->wx;
int16_t deltaY1=((int16_t) (Data->ypath[v % NbPoints] * PXSIZE))-(int16_t) player->wy; 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, dline( player->px + deltaX1, player->py + deltaY1,
player->px + deltaX2, player->py + deltaY2, player->px + deltaX2, player->py + deltaY2,
PATH_COLOR); PATH_COLOR);
*/
} }