Skip to content

Commit

Permalink
id_ca: Fix build in big endian systems
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryzee119 authored Jan 22, 2024
1 parent 018e938 commit 0f5adb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/id_ca.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ void CA_CacheGrChunk(int chunk)
spriteTable[i].shifts = CK_Cross_SwapLE16(spriteTable[i].shifts);
}
}
else if (chunk >= FON_MAINFONT && chunk <= /*FON_WATCHFONT*/ FON_MAINFONT + 2)
else if (chunk >= CK_CHUNKNUM(FON_MAINFONT) && chunk <= /*FON_WATCHFONT*/ CK_CHUNKNUM(FON_MAINFONT) + 2)
{
VH_Font *font = (VH_Font *)ca_graphChunks[chunk];
font->height = CK_Cross_SwapLE16(font->height);
Expand All @@ -751,7 +751,7 @@ void CA_CacheGrChunk(int chunk)
font->location[i] = CK_Cross_SwapLE16(font->location[i]);
}
}
else if (chunk >= EXTERN_COMMANDER && chunk <= EXTERN_KEEN)
else if (chunk >= CK_CHUNKNUM(EXTERN_COMMANDER) && chunk <= CK_CHUNKNUM(EXTERN_KEEN))
{
introbmptype *intro = (introbmptype *)ca_graphChunks[chunk];
intro->height = CK_Cross_SwapLE16(intro->height);
Expand Down

0 comments on commit 0f5adb6

Please sign in to comment.