mirror of
https://github.com/nzp-team/dquakeplus.git
synced 2025-02-16 16:41:03 +00:00
Re-Enable external textures on PSP1000, add optimization for PaP skins
This commit is contained in:
parent
c7726a8653
commit
15bdd2bd8b
4 changed files with 37 additions and 5 deletions
|
@ -25,6 +25,8 @@ extern cvar_t bgmtype;
|
|||
|
||||
extern qboolean domaxammo;
|
||||
|
||||
extern int EN_Find(int num,char *string);
|
||||
|
||||
char *svc_strings[] =
|
||||
{
|
||||
"svc_bad",
|
||||
|
@ -249,6 +251,7 @@ void CL_KeepaliveMessage (void)
|
|||
CL_ParseServerInfo
|
||||
==================
|
||||
*/
|
||||
int has_pap;
|
||||
void CL_ParseServerInfo (void)
|
||||
{
|
||||
char *str, tempname[MAX_QPATH];;
|
||||
|
@ -307,6 +310,8 @@ void CL_ParseServerInfo (void)
|
|||
for (i=0 ; i<NUM_MODELINDEX ; i++)
|
||||
cl_modelindex[i] = -1;
|
||||
|
||||
has_pap = EN_Find(0,"perk_pap");
|
||||
|
||||
// precache models
|
||||
memset (cl.model_precache, 0, sizeof(cl.model_precache));
|
||||
//Con_Printf("GotModelsToLoad: ");
|
||||
|
|
|
@ -775,7 +775,7 @@ void _Host_Frame (float time)
|
|||
pass1+pass2+pass3, pass1, pass2, pass3);
|
||||
}
|
||||
|
||||
//Con_Printf ("%dkB free \n", freememory()/1024);
|
||||
//Con_Printf ("%dkB free \n", pspSdkTotalFreeUserMemSize()/1024);
|
||||
|
||||
//frame speed counter
|
||||
fps_count++;//muff
|
||||
|
|
|
@ -3246,7 +3246,7 @@ int GL_LoadImages (const char *identifier, int width, int height, const byte *da
|
|||
} else {
|
||||
Con_Printf("Couldn't fit %s into VRAM (%dkB)\n", identifier, buffer_size/1024);
|
||||
total_overbudget_texturemem += buffer_size/1024;
|
||||
Con_Printf("RESIDUAL VRAM: %d\n", total_overbudget_texturemem);
|
||||
Con_Printf("OVERFLOWN VRAM: %d\n", total_overbudget_texturemem);
|
||||
}
|
||||
|
||||
// Done.
|
||||
|
|
|
@ -2023,6 +2023,22 @@ void Mod_FloodFillSkin( byte *skin, int skinwidth, int skinheight )
|
|||
}
|
||||
}
|
||||
|
||||
qboolean model_is_gun(char name[MAX_QPATH])
|
||||
{
|
||||
char* wep_path = static_cast<char*>(malloc(sizeof(char)*15));
|
||||
|
||||
for (int i = 0; i < 15; i++) {
|
||||
wep_path[i] = name[i];
|
||||
}
|
||||
wep_path[14] = '\0';
|
||||
|
||||
if (strcmp(wep_path, "models/weapons") == 0) {
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
qboolean model_is_zombie(char name[MAX_QPATH])
|
||||
{
|
||||
if (strcmp(name, "models/ai/zb%.mdl") == 0 ||
|
||||
|
@ -2046,6 +2062,7 @@ Mod_LoadAllSkins
|
|||
===============
|
||||
*/
|
||||
static qboolean mod_h2;
|
||||
extern int has_pap;
|
||||
void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
||||
{
|
||||
int i, j, k;
|
||||
|
@ -2065,6 +2082,8 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
|||
|
||||
s = pheader->skinwidth * pheader->skinheight;
|
||||
|
||||
qboolean is_gun = model_is_gun(loadmodel->name);
|
||||
|
||||
if (model_is_zombie(loadmodel->name) == qtrue) {
|
||||
Mod_FloodFillSkin(skin, pheader->skinwidth, pheader->skinheight);
|
||||
|
||||
|
@ -2121,14 +2140,22 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
|||
|
||||
for (i=0 ; i<numskins ; i++)
|
||||
{
|
||||
if (pskintype->type == ALIAS_SKIN_SINGLE)
|
||||
if (!has_pap && model_is_gun(loadmodel->name) && i >= 1) {
|
||||
pheader->gl_texturenum[i][0] =
|
||||
pheader->gl_texturenum[i][1] =
|
||||
pheader->gl_texturenum[i][2] =
|
||||
pheader->gl_texturenum[i][3] = pheader->gl_texturenum[0][0];
|
||||
pskintype = (daliasskintype_t *)((byte *)(pskintype+1) + s);
|
||||
return (void *)pskintype;
|
||||
}
|
||||
else if (pskintype->type == ALIAS_SKIN_SINGLE)
|
||||
{
|
||||
Mod_FloodFillSkin( skin, pheader->skinwidth, pheader->skinheight );
|
||||
COM_StripExtension(loadmodel->name, model);
|
||||
// HACK HACK HACK
|
||||
sprintf (model2, "%s.mdl_%i", model, i);
|
||||
|
||||
#ifdef SLIM
|
||||
//#ifdef SLIM
|
||||
|
||||
pheader->gl_texturenum[i][0] =
|
||||
pheader->gl_texturenum[i][1] =
|
||||
|
@ -2137,7 +2164,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
|||
|
||||
if (pheader->gl_texturenum[i][0] == 0)// did not find a matching TGA...
|
||||
|
||||
#endif // SLIM
|
||||
//#endif // SLIM
|
||||
|
||||
{
|
||||
sprintf (name, "%s_%i", loadmodel->name, i);
|
||||
|
|
Loading…
Reference in a new issue