renders: check for SiN format in player models

This commit is contained in:
Denis Pauk 2024-05-07 00:32:31 +03:00
parent 9145c0a923
commit eff91e34c0
9 changed files with 39 additions and 15 deletions

View file

@ -9,6 +9,7 @@ Have a look at the yquake2 repository for the "normal" Yamagi Quake II:
https://github.com/yquake2/yquake2 https://github.com/yquake2/yquake2
Alpha windows 64 bit [binaries](https://github.com/yquake2/yquake2remaster/releases). Alpha windows 64 bit [binaries](https://github.com/yquake2/yquake2remaster/releases).
Saves format is unstabled and could change between alpha releases.
State: State:
* GL1/GLES3/GL3/GL4/VK: * GL1/GLES3/GL3/GL4/VK:
@ -29,20 +30,20 @@ Monsters:
Models support: Models support:
| Format | Original Game | Frame vertex | Meshes | Comments | | Format | Original Game | Frame vertex | Meshes | Comments |
| ------ | --------------- | ------------ | ------ | --------------------------------------- | | ------ | --------------- | ------------ | -------- | --------------------------------------- |
| mdl | Quake 1 | 8 bit | Single | Unsupported grouped textures | | mdl | Quake 1 | 8 bit | Single | Unsupported grouped textures |
| md2 | Quake 2 | 8 bit | Single | | | md2 | Quake 2 | 8 bit | Single | |
| md2 | Anachronox | 8/10/16 bit | Single | No tagged surfaces, unchecked with game | | md2 | Anachronox | 8/10/16 bit | Single | No tagged surfaces, unchecked with game |
| mdx | Kingpin | 8 bit | Many | No sfx support, unchecked with game | | mdx | Kingpin | 8 bit | Multiple | No sfx support, unchecked with game |
| fm | Heretic 2 | 8 bit | Many | | | fm | Heretic 2 | 8 bit | Multiple | |
| def | SiN | Part of sam | Many | Unchecked with game | | def | SiN | Part of sam | Multiple | Unchecked with game |
| dkm | Daikatana DKM1 | 8 bit | Many | Unchecked with game | | dkm | Daikatana DKM1 | 8 bit | Multiple | Unchecked with game |
| dkm | Daikatana DKM2 | 10 bit | Many | Unchecked with game | | dkm | Daikatana DKM2 | 10 bit | Multiple | Unchecked with game |
| md3 | Quake 3 | 16 bit | Many | No tags support | | md3 | Quake 3 | 16 bit | Multiple | No tags support |
| md5 | Doom 3/Quake 4 | float | Many | Requires md2 for skins | | md5 | Doom 3/Quake 4 | float | Multiple | Requires md2 for skins |
| sbm | SiN | Part of sam | Many | Unchecked with game | | sbm | SiN | Part of sam | Multiple | Unchecked with game |
| sam | SiN | 8 bit | Many | Unchecked with game | | sam | SiN | 8 bit | Multiple | Unchecked with game |
All models support only single texture for all meshes and frames limit based on game protocol. All models support only single texture for all meshes and frames limit based on game protocol.
@ -74,6 +75,8 @@ Maps support:
Note: Note:
* Non Quake 2 maps are limmited mostly view only, and could have issues * Non Quake 2 maps are limmited mostly view only, and could have issues
with tranparency or some animations flags and properties. with tranparency or some animations flags and properties.
* If you like support some other maps type, create pull request for Mod_Load2QBSP
function and provide a link to demo maps.
Games: Games:
* Quake 2: * Quake 2:

View file

@ -5731,6 +5731,7 @@ PlayerModelList(void)
if (ContainsFile(s, "tris.fm") == false && if (ContainsFile(s, "tris.fm") == false &&
ContainsFile(s, "tris.dkm") == false && ContainsFile(s, "tris.dkm") == false &&
ContainsFile(s, "tris.def") == false &&
ContainsFile(s, "tris.md2") == false && ContainsFile(s, "tris.md2") == false &&
ContainsFile(s, "tris.md3") == false && ContainsFile(s, "tris.md3") == false &&
ContainsFile(s, "tris.md5mesh") == false && ContainsFile(s, "tris.md5mesh") == false &&

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1150,7 +1150,6 @@ FS_LoadSIN(const char *packPath)
files[i].size = LittleLong(info[i].filelen); files[i].size = LittleLong(info[i].filelen);
files[i].compressed_size = 0; files[i].compressed_size = 0;
files[i].format = PAK_MODE_Q2; files[i].format = PAK_MODE_Q2;
printf("sin: %s:%d\n", files[i].name, files[i].size);
} }
free(info); free(info);

View file

@ -217,6 +217,7 @@ Mod_LoadFileWithoutExt(const char *namewe, void **buffer, const char* ext)
tlen = strlen(namewe); tlen = strlen(namewe);
if (!strcmp(ext, "fm") || if (!strcmp(ext, "fm") ||
!strcmp(ext, "def") ||
!strcmp(ext, "dkm") || !strcmp(ext, "dkm") ||
!strcmp(ext, "md2") || !strcmp(ext, "md2") ||
!strcmp(ext, "md3") || !strcmp(ext, "md3") ||
@ -257,6 +258,16 @@ Mod_LoadFileWithoutExt(const char *namewe, void **buffer, const char* ext)
return filesize; return filesize;
} }
/* Check SiN model def with include sbm/sam files */
Q_strlcpy(newname + tlen, ".def", sizeof(newname));
filesize = FS_LoadFile(newname, buffer);
if (filesize > 0)
{
Com_DPrintf("%s: %s loaded as def/sbm/sam (SiN)\n",
__func__, namewe);
return filesize;
}
/* Check Quake 2 model */ /* Check Quake 2 model */
Q_strlcpy(newname + tlen, ".md2", sizeof(newname)); Q_strlcpy(newname + tlen, ".md2", sizeof(newname));
filesize = FS_LoadFile(newname, buffer); filesize = FS_LoadFile(newname, buffer);