Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model Warning and Limit Increases #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Quake/cl_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void CL_ParseServerInfo (void)
cl.model_precache[i] = Mod_ForName (model_precache[i], false);
if (cl.model_precache[i] == NULL)
{
Host_Error ("Model %s not found", model_precache[i]);
Con_Warning("Model %s not found.\n", model_precache[i]); // Qmaster -- was Host_Error
}
CL_KeepaliveMessage ();
}
Expand Down
25 changes: 20 additions & 5 deletions Quake/gl_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int mod_novis_capacity;
static byte *mod_decompressed;
static int mod_decompressed_capacity;

#define MAX_MOD_KNOWN 2048 /*johnfitz -- was 512 */
#define MAX_MOD_KNOWN 8192 /*Qmaster -- was 2048. johnfitz -- was 512 */
qmodel_t mod_known[MAX_MOD_KNOWN];
int mod_numknown;

Expand Down Expand Up @@ -337,7 +337,9 @@ qmodel_t *Mod_LoadModel (qmodel_t *mod, qboolean crash)
if (!buf)
{
if (crash)
Host_Error ("Mod_LoadModel: %s not found", mod->name); //johnfitz -- was "Mod_NumForName"
{
Con_Warning("Mod_LoadModel: %s not found.\n", mod->name); // Qmaster -- was Host_Error. johnfitz -- was "Mod_NumForName"
}
return NULL;
}

Expand Down Expand Up @@ -2438,8 +2440,10 @@ void * Mod_LoadAliasFrame (void * pin, maliasframedesc_t *frame)
int i;
daliasframe_t *pdaliasframe;

if (posenum >= MAXALIASFRAMES)
Sys_Error ("posenum >= MAXALIASFRAMES");
if (posenum >= MAXALIASFRAMES) {
posenum = MAXALIASFRAMES; // Qmaster -- was Sys_Error, now clamps to max.
// Warning on model load rather than spam here.
}

pdaliasframe = (daliasframe_t *)pin;

Expand Down Expand Up @@ -2503,7 +2507,10 @@ void *Mod_LoadAliasGroup (void * pin, maliasframedesc_t *frame)

for (i=0 ; i<numframes ; i++)
{
if (posenum >= MAXALIASFRAMES) Sys_Error ("posenum >= MAXALIASFRAMES");
if (posenum >= MAXALIASFRAMES) {
posenum = MAXALIASFRAMES; // Qmaster -- was Sys_Error, now clamps to max.
// Warning on model load rather than spam here.
}

poseverts[posenum] = (trivertx_t *)((daliasframe_t *)ptemp + 1);
posenum++;
Expand Down Expand Up @@ -2902,6 +2909,14 @@ void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
if (numframes < 1)
Sys_Error ("Mod_LoadAliasModel: Invalid # of frames: %d", numframes);

if (numframes > 256) // Qmaster -- Added warning for exceeding standard limits.
{
Con_DWarning("Model %s frame count exceeds standard limit of 256", mod->name);
}
if (numframes > MAXALIASFRAMES) // Qmaster -- Added warning on load for exceeding new limit rather than error out.
{
Con_DWarning("Model %s frame count exceeds limit of %i, frame calls greater than this will be capped at max", mod->name,MAXALIASFRAMES);
}
pheader->size = LittleFloat (pinmodel->size) * ALIAS_BASE_SIZE_RATIO;
mod->synctype = (synctype_t) LittleLong (pinmodel->synctype);
mod->numframes = pheader->numframes;
Expand Down
2 changes: 1 addition & 1 deletion Quake/gl_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ typedef struct mtriangle_s {
} mtriangle_t;


#define MAX_SKINS 32
#define MAX_SKINS 256 // Qmaster -- was 32
typedef struct {
int ident;
int version;
Expand Down
4 changes: 2 additions & 2 deletions Quake/quakedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MAX_EDICTS 32000 // johnfitz -- highest allowed value for max_edicts cvar
// ents past 8192 can't play sounds in the standard protocol
#define MAX_LIGHTSTYLES 64
#define MAX_MODELS 2048 // johnfitz -- was 256
#define MAX_SOUNDS 2048 // johnfitz -- was 256
#define MAX_MODELS 16384 // Qmaster -- was 2048 // johnfitz -- was 256
#define MAX_SOUNDS 16384 // Qmaster -- was 2048 // johnfitz -- was 256

#define SAVEGAME_COMMENT_LENGTH 39

Expand Down
2 changes: 1 addition & 1 deletion Quake/snd_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int s_rawend;
portable_samplepair_t s_rawsamples[MAX_RAW_SAMPLES];


#define MAX_SFX 1024
#define MAX_SFX 16384 // Qmaster -- was 1024
static sfx_t *known_sfx = NULL; // hunk allocated [MAX_SFX]
static int num_sfx;

Expand Down
6 changes: 3 additions & 3 deletions Quake/snd_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ sfxcache_t *S_LoadSound (sfx_t *s)
info = GetWavinfo (s->name, data, com_filesize);
if (info.channels != 1)
{
Con_Printf ("%s is a stereo sample\n",s->name);
Con_Printf ("%s is a stereo sample, not loaded!\n",s->name); // Qmaster -- clarified why this message is printed
return NULL;
}

if (info.width != 1 && info.width != 2)
{
Con_Printf("%s is not 8 or 16 bit\n", s->name);
Con_Printf("%s is not 8 or 16 bit, not loaded!\n", s->name); // Qmaster -- clarified why this message is printed
return NULL;
}

Expand All @@ -141,7 +141,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)

if (info.samples == 0 || len == 0)
{
Con_Printf("%s has zero samples\n", s->name);
Con_Printf("%s has zero samples, not loaded!\n", s->name); // Qmaster -- clarified why this message is printed
return NULL;
}

Expand Down