Skip to content

Commit

Permalink
models: support Anachronox 14 version
Browse files Browse the repository at this point in the history
  • Loading branch information
0lvin committed Sep 22, 2024
1 parent 9566ef1 commit 5bcb204
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/client/refresh/files/models.c
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,8 @@ Mod_LoadModel_MD2Anox(const char *mod_name, const void *buffer, int modfilelen,
((int *)&pinmodel)[i] = LittleLong(((int *)buffer)[i]);
}

if (pinmodel.version != ALIAS_ANACHRONOX_VERSION)
if (pinmodel.version != ALIAS_ANACHRONOX_VERSION &&
pinmodel.version != ALIAS_ANACHRONOX_VERSION_OLD)
{
R_Printf(PRINT_ALL, "%s: %s has wrong version number (%i should be %i)\n",
__func__, mod_name, pinmodel.version, ALIAS_ANACHRONOX_VERSION);
Expand Down Expand Up @@ -3244,7 +3245,8 @@ Mod_LoadModelFile(const char *mod_name, const void *buffer, int modfilelen,
short version;

version = LittleShort(((short*)buffer)[2]);
if (version == ALIAS_ANACHRONOX_VERSION)
if (version == ALIAS_ANACHRONOX_VERSION ||
version == ALIAS_ANACHRONOX_VERSION_OLD)
{
extradata = Mod_LoadModel_MD2Anox(mod_name, buffer, modfilelen,
skins, numskins, type);
Expand Down
1 change: 1 addition & 0 deletions src/common/header/files.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ typedef struct
/* .MD2 Anachronox triangle model file format */

#define MDAHEADER (('1' << 24) + ('A' << 16) + ('D' << 8) + 'M')
#define ALIAS_ANACHRONOX_VERSION_OLD 14
#define ALIAS_ANACHRONOX_VERSION 15

typedef struct
Expand Down

0 comments on commit 5bcb204

Please sign in to comment.