renders: load mdx/Kingpin models support

This commit is contained in:
Denis Pauk 2024-03-17 00:23:24 +02:00
parent b30dd7dd2d
commit bb3ac6ef9c
8 changed files with 24 additions and 1 deletions

View file

@ -39,7 +39,8 @@ Models support:
| mdl | Quake 1 | 8 bit | unsupported grouped textures |
| md2 | Quake 2 | 8 bit | full support |
| md2 | Anachronox | 8/10/16 bit | does no suport tagged surfaces |
| fm | Heretic 2 | 8 bit | show all meshes, |
| mdx | Kingpin | 8 bit | unchecked with game |
| fm | Heretic 2 | 8 bit | show all meshes |
| dkm | Daikatana DKM1 | 8 bit | unchecked with game |
| dkm | Daikatana DKM2 | 10 bit | unchecked with game |
| md3 | Quake 3 | 16 bit | show all meshes, no tags support, unchecked |

View file

@ -5735,6 +5735,7 @@ PlayerModelList(void)
ContainsFile(s, "tris.md2") == false &&
ContainsFile(s, "tris.md3") == false &&
ContainsFile(s, "tris.md5mesh") == false &&
ContainsFile(s, "tris.mdx") == false &&
ContainsFile(s, "tris.mdl") == false)
{
/* invalid player model */

View file

@ -2820,6 +2820,7 @@ Mod_LoadFileWithoutExt(const char *namewe, void **buffer, const char* ext)
!strcmp(ext, "md2") ||
!strcmp(ext, "md3") ||
!strcmp(ext, "md5mesh") ||
!strcmp(ext, "mdx") ||
!strcmp(ext, "mdl"))
{
int filesize;
@ -2865,6 +2866,16 @@ Mod_LoadFileWithoutExt(const char *namewe, void **buffer, const char* ext)
return filesize;
}
/* Check Kingpin model */
Q_strlcpy(newname + tlen, ".mdx", sizeof(newname));
filesize = ri.FS_LoadFile(newname, buffer);
if (filesize > 0)
{
R_Printf(PRINT_DEVELOPER, "%s: %s loaded as mdx (Kingpin)\n",
__func__, namewe);
return filesize;
}
/* Check Daikatana model */
Q_strlcpy(newname + tlen, ".dkm", sizeof(newname));
filesize = ri.FS_LoadFile(newname, buffer);

View file

@ -820,6 +820,8 @@ Mod_ForName(const char *name, model_t *parent_model, qboolean crash)
/* call the apropriate loader */
switch (LittleLong(*(unsigned *)buf))
{
case MDXHEADER:
/* fall through */
case DKMHEADER:
/* fall through */
case RAVENFMHEADER:

View file

@ -821,6 +821,8 @@ Mod_ForName(const char *name, gl3model_t *parent_model, qboolean crash)
/* call the apropriate loader */
switch (LittleLong(*(unsigned *)buf))
{
case MDXHEADER:
/* fall through */
case DKMHEADER:
/* fall through */
case RAVENFMHEADER:

View file

@ -821,6 +821,8 @@ Mod_ForName(const char *name, gl4model_t *parent_model, qboolean crash)
/* call the apropriate loader */
switch (LittleLong(*(unsigned *)buf))
{
case MDXHEADER:
/* fall through */
case DKMHEADER:
/* fall through */
case RAVENFMHEADER:

View file

@ -645,6 +645,8 @@ Mod_ForName(const char *name, model_t *parent_model, qboolean crash)
/* call the apropriate loader */
switch (LittleLong(*(unsigned *)buf))
{
case MDXHEADER:
/* fall through */
case DKMHEADER:
/* fall through */
case RAVENFMHEADER:

View file

@ -804,6 +804,8 @@ Mod_ForName(const char *name, model_t *parent_model, qboolean crash)
/* call the apropriate loader */
switch (LittleLong(*(unsigned *)buf))
{
case MDXHEADER:
/* fall through */
case DKMHEADER:
/* fall through */
case RAVENFMHEADER: