From dcf411bb11104b3194b1b619d46c29cd8b448c93 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sat, 14 Sep 2024 00:11:42 +0300 Subject: [PATCH] models: add mda file to override list --- README.md | 7 +++++-- src/common/models.c | 11 +++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cbe195a6..397ba146 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,8 @@ Note: 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. +* Use `maptype 1` before load any Heretic 2 maps. Look to + [maptype_t](src/common/header/cmodel.h#L42) for more info. Games: @@ -120,14 +122,15 @@ Goals: * [x] suport Daikatana/SiN .pak/.sin format from pakextract, * [x] Support flow/scale flags for Q64 maps, * [x] Add debug progress loading code for maps, -* [x] MDR model format in Star Trek: Voyager – Elite Force, +* [x] MDR model format from Star Trek: Voyager – Elite Force, +* [ ] MDA entity format from Anachronox, * [x] RGB particles support instead palette based one, * [x] Get rid of VID_PaletteColor client internal api use, * [x] Broken maps groups from base2 to next, * [ ] Single player ReRelease support, * [ ] Support effects and additional flags for ReRelease when possible. * [ ] Use shared model cache in client code insted reimplemnet in each render, -* [ ] Check load soft colormap as 24bit color, +* [x] Check load soft colormap as 24bit color from loaded image, * [ ] Fix transparent textures in Daikatana/SiN maps, * [ ] Use separete texture hi-color buffer for ui in soft render, * [ ] Cleanup function declarations in game save code, diff --git a/src/common/models.c b/src/common/models.c index f0b19e81..f98c088f 100644 --- a/src/common/models.c +++ b/src/common/models.c @@ -225,6 +225,7 @@ Mod_LoadFileWithoutExt(const char *namewe, void **buffer, const char* ext) if (!strcmp(ext, "fm") || !strcmp(ext, "def") || !strcmp(ext, "dkm") || + !strcmp(ext, "mda") || !strcmp(ext, "md2") || !strcmp(ext, "md3") || !strcmp(ext, "mdr") || @@ -296,6 +297,16 @@ Mod_LoadFileWithoutExt(const char *namewe, void **buffer, const char* ext) return filesize; } + /* Check Anachronox model definition */ + Q_strlcpy(newname + tlen, ".mda", sizeof(newname)); + filesize = FS_LoadFile(newname, buffer); + if (filesize > 0) + { + Com_DPrintf("%s: %s loaded as mda (Anachronox)\n", + __func__, namewe); + return filesize; + } + /* Check Kingpin model */ Q_strlcpy(newname + tlen, ".mdx", sizeof(newname)); filesize = FS_LoadFile(newname, buffer);