mirror of
https://github.com/nzp-team/quakespasm.git
synced 2024-11-24 21:01:09 +00:00
Add Loading Screens to NX and Vita.
+ misc changes. Please report bugs.
This commit is contained in:
parent
51a902e82d
commit
b912fc17d6
20 changed files with 666 additions and 180 deletions
Binary file not shown.
|
@ -766,6 +766,9 @@ void CL_RelinkEntities (void)
|
||||||
R_RocketTrail (oldorg, ent->origin, 6);
|
R_RocketTrail (oldorg, ent->origin, 6);
|
||||||
|
|
||||||
ent->forcelink = false;
|
ent->forcelink = false;
|
||||||
|
|
||||||
|
if ( ent->effects & EF_NODRAW )
|
||||||
|
continue;
|
||||||
|
|
||||||
if (i == cl.viewentity && !chase_active.value)
|
if (i == cl.viewentity && !chase_active.value)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -403,6 +403,9 @@ void CL_ParseServerInfo (void)
|
||||||
// now we try to load everything else until a cache allocation fails
|
// now we try to load everything else until a cache allocation fails
|
||||||
//
|
//
|
||||||
|
|
||||||
|
loading_num_step = loading_num_step +nummodels + numsounds;
|
||||||
|
loading_step = 1;
|
||||||
|
|
||||||
// copy the naked name of the map file to the cl structure -- O.S
|
// copy the naked name of the map file to the cl structure -- O.S
|
||||||
COM_StripExtension (COM_SkipPath(model_precache[1]), cl.mapname, sizeof(cl.mapname));
|
COM_StripExtension (COM_SkipPath(model_precache[1]), cl.mapname, sizeof(cl.mapname));
|
||||||
|
|
||||||
|
@ -414,15 +417,30 @@ void CL_ParseServerInfo (void)
|
||||||
Host_Error ("Model %s not found", model_precache[i]);
|
Host_Error ("Model %s not found", model_precache[i]);
|
||||||
}
|
}
|
||||||
CL_KeepaliveMessage ();
|
CL_KeepaliveMessage ();
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, model_precache[i]);
|
||||||
|
//Con_Printf("%i,",i);
|
||||||
|
SCR_UpdateScreen ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCR_UpdateScreen ();
|
||||||
|
|
||||||
|
loading_step = 4;
|
||||||
|
|
||||||
S_BeginPrecaching ();
|
S_BeginPrecaching ();
|
||||||
for (i = 1; i < numsounds; i++)
|
for (i = 1; i < numsounds; i++)
|
||||||
{
|
{
|
||||||
cl.sound_precache[i] = S_PrecacheSound (sound_precache[i]);
|
cl.sound_precache[i] = S_PrecacheSound (sound_precache[i]);
|
||||||
CL_KeepaliveMessage ();
|
CL_KeepaliveMessage ();
|
||||||
|
loading_cur_step++;
|
||||||
|
//Con_Printf("%i,",i);
|
||||||
|
strcpy(loading_name, sound_precache[i]);
|
||||||
|
SCR_UpdateScreen ();
|
||||||
}
|
}
|
||||||
S_EndPrecaching ();
|
S_EndPrecaching ();
|
||||||
|
|
||||||
|
SCR_UpdateScreen ();
|
||||||
|
Clear_LoadingFill ();
|
||||||
|
|
||||||
// local state
|
// local state
|
||||||
cl_entities[0].model = cl.worldmodel = cl.model_precache[1];
|
cl_entities[0].model = cl.worldmodel = cl.model_precache[1];
|
||||||
|
|
|
@ -1632,7 +1632,7 @@ static int COM_FindFile (const char *filename, int *handle, FILE **file,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0; /* dummy valid value for COM_FileExists() */
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1773,11 +1773,11 @@ byte *COM_LoadFile (const char *path, int usehunk, unsigned int *path_id)
|
||||||
buf = (byte *) malloc (len+1);
|
buf = (byte *) malloc (len+1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error ("COM_LoadFile: bad usehunk");
|
Host_Error ("COM_LoadFile: bad usehunk");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
Sys_Error ("COM_LoadFile: not enough space for %s", path);
|
Host_Error ("COM_LoadFile: not enough space for %s", path);
|
||||||
|
|
||||||
((byte *)buf)[len] = 0;
|
((byte *)buf)[len] = 0;
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,8 @@ qboolean con_debuglog = false;
|
||||||
|
|
||||||
qboolean con_initialized;
|
qboolean con_initialized;
|
||||||
|
|
||||||
|
extern qboolean console_enabled;
|
||||||
|
|
||||||
void M_OSK_Draw (void);
|
void M_OSK_Draw (void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -118,9 +120,11 @@ void Con_ToggleConsole_f (void)
|
||||||
{
|
{
|
||||||
IN_Activate();
|
IN_Activate();
|
||||||
key_dest = key_game;
|
key_dest = key_game;
|
||||||
|
console_enabled = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
console_enabled = false;
|
||||||
M_Menu_Main_f ();
|
M_Menu_Main_f ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1185,7 +1189,7 @@ The typing input line at the bottom should only be drawn if typing is allowed
|
||||||
|
|
||||||
// Naievil -- console toggle for menu
|
// Naievil -- console toggle for menu
|
||||||
int OSK_toggle;
|
int OSK_toggle;
|
||||||
|
qboolean console_enabled;
|
||||||
void Con_DrawConsole (int lines, qboolean drawinput)
|
void Con_DrawConsole (int lines, qboolean drawinput)
|
||||||
{
|
{
|
||||||
int i, x, y, j, sb, rows;
|
int i, x, y, j, sb, rows;
|
||||||
|
@ -1200,6 +1204,8 @@ void Con_DrawConsole (int lines, qboolean drawinput)
|
||||||
|
|
||||||
// draw the background
|
// draw the background
|
||||||
Draw_ConsoleBackground ();
|
Draw_ConsoleBackground ();
|
||||||
|
if (!console_enabled && !developer.value)
|
||||||
|
return;
|
||||||
|
|
||||||
// draw the buffer text
|
// draw the buffer text
|
||||||
rows = (con_vislines +7)/8;
|
rows = (con_vislines +7)/8;
|
||||||
|
|
|
@ -37,11 +37,18 @@ void Draw_AlphaPic (int x, int y, qpic_t *pic, float alpha);
|
||||||
void Draw_ColorPic (int x, int y, qpic_t *pic, float r, float g, float b, float alpha);
|
void Draw_ColorPic (int x, int y, qpic_t *pic, float r, float g, float b, float alpha);
|
||||||
void Draw_TransPicTranslate (int x, int y, qpic_t *pic, int top, int bottom); //johnfitz -- more parameters
|
void Draw_TransPicTranslate (int x, int y, qpic_t *pic, int top, int bottom); //johnfitz -- more parameters
|
||||||
void Draw_ConsoleBackground (void); //johnfitz -- removed parameter int lines
|
void Draw_ConsoleBackground (void); //johnfitz -- removed parameter int lines
|
||||||
|
void Draw_LoadingFill(void);
|
||||||
void Draw_TileClear (int x, int y, int w, int h);
|
void Draw_TileClear (int x, int y, int w, int h);
|
||||||
void Draw_Fill (int x, int y, int w, int h, int c, float alpha); //johnfitz -- added alpha
|
void Draw_Fill (int x, int y, int w, int h, int c, float alpha); //johnfitz -- added alpha
|
||||||
void Draw_FillByColor (int x, int y, int w, int h, unsigned int c, float alpha);
|
void Draw_FillByColor (int x, int y, int w, int h, float r, float g, float b, float a);
|
||||||
void Draw_FadeScreen (void);
|
void Draw_FadeScreen (void);
|
||||||
void Draw_String (int x, int y, const char *str);
|
void Draw_String (int x, int y, const char *str);
|
||||||
|
|
||||||
|
extern float loading_cur_step;
|
||||||
|
extern int loading_step;
|
||||||
|
extern char loading_name[32];
|
||||||
|
extern float loading_num_step;
|
||||||
|
|
||||||
void Draw_ColoredString (int x, int y, const char *str, float r, float g, float b, float a);
|
void Draw_ColoredString (int x, int y, const char *str, float r, float g, float b, float a);
|
||||||
void Draw_ColoredStringScale (int x, int y, const char *str, float r, float g, float b, float a, float s);
|
void Draw_ColoredStringScale (int x, int y, const char *str, float r, float g, float b, float a, float s);
|
||||||
qpic_t *Draw_PicFromWad (const char *name);
|
qpic_t *Draw_PicFromWad (const char *name);
|
||||||
|
|
114
source/gl_draw.c
114
source/gl_draw.c
|
@ -42,6 +42,13 @@ qpic_t *pic_nul; //johnfitz -- for missing gfx, don't crash
|
||||||
qpic_t *sniper_scope;
|
qpic_t *sniper_scope;
|
||||||
int zombie_skins[2][2];
|
int zombie_skins[2][2];
|
||||||
|
|
||||||
|
//Loading Fill by Crow_bar
|
||||||
|
float loading_cur_step;
|
||||||
|
char loading_name[32];
|
||||||
|
float loading_num_step;
|
||||||
|
int loading_step;
|
||||||
|
float loading_cur_step_bk;
|
||||||
|
|
||||||
|
|
||||||
//johnfitz -- new pics
|
//johnfitz -- new pics
|
||||||
byte pic_ovr_data[8][8] =
|
byte pic_ovr_data[8][8] =
|
||||||
|
@ -295,6 +302,9 @@ qpic_t *Draw_CachePic (const char *path)
|
||||||
int i;
|
int i;
|
||||||
qpic_t *dat;
|
qpic_t *dat;
|
||||||
glpic_t gl;
|
glpic_t gl;
|
||||||
|
|
||||||
|
if (!COM_FileExists(path, NULL))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
for (pic=menu_cachepics, i=0 ; i<menu_numcachepics ; pic++, i++)
|
for (pic=menu_cachepics, i=0 ; i<menu_numcachepics ; pic++, i++)
|
||||||
{
|
{
|
||||||
|
@ -318,13 +328,14 @@ qpic_t *Draw_CachePic (const char *path)
|
||||||
src_type = SRC_TGA;
|
src_type = SRC_TGA;
|
||||||
|
|
||||||
dat = (qpic_t *)LoadTGAPic(path_noext);
|
dat = (qpic_t *)LoadTGAPic(path_noext);
|
||||||
|
if (!dat)
|
||||||
|
Host_Error ("Draw_CachePic: failed to load %s", path);
|
||||||
} else {
|
} else {
|
||||||
src_type = SRC_INDEXED;
|
src_type = SRC_INDEXED;
|
||||||
|
|
||||||
dat = (qpic_t *)COM_LoadTempFile (path, NULL);
|
dat = (qpic_t *)COM_LoadTempFile (path, NULL);
|
||||||
if (!dat)
|
if (!dat)
|
||||||
Sys_Error ("Draw_CachePic: failed to load %s", path);
|
Host_Error ("Draw_CachePic: failed to load %s", path);
|
||||||
SwapPic (dat);
|
SwapPic (dat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,6 +466,7 @@ void Draw_Init (void)
|
||||||
|
|
||||||
// load game pics
|
// load game pics
|
||||||
Draw_LoadPics ();
|
Draw_LoadPics ();
|
||||||
|
Clear_LoadingFill ();
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
@ -839,7 +851,7 @@ void Draw_ConsoleBackground (void)
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw_FillByColor (0, 0, vid.conwidth, vid.conheight, 0, alpha);
|
Draw_FillByColor (0, 0, vid.conwidth, vid.conheight, 0, 0, 0, alpha);
|
||||||
|
|
||||||
|
|
||||||
if (alpha < 1.0)
|
if (alpha < 1.0)
|
||||||
|
@ -852,6 +864,63 @@ void Draw_ConsoleBackground (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
================
|
||||||
|
Draw_LoadingFill
|
||||||
|
By Crow_bar
|
||||||
|
================
|
||||||
|
*/
|
||||||
|
void Draw_LoadingFill(void)
|
||||||
|
{
|
||||||
|
if(!loading_num_step)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int size = 8;
|
||||||
|
int max_step = 350;
|
||||||
|
int x = (vid.width / 2) - (max_step / 2);
|
||||||
|
int y = vid.height - (size/ 2) - 25;
|
||||||
|
int l;
|
||||||
|
char str[64];
|
||||||
|
char* text;
|
||||||
|
|
||||||
|
|
||||||
|
if(loading_cur_step > loading_num_step)
|
||||||
|
loading_cur_step = loading_num_step;
|
||||||
|
|
||||||
|
if (loading_cur_step < loading_cur_step_bk)
|
||||||
|
loading_cur_step = loading_cur_step_bk;
|
||||||
|
|
||||||
|
if (loading_cur_step == loading_num_step && loading_cur_step_bk != loading_num_step)
|
||||||
|
loading_cur_step = loading_cur_step_bk;
|
||||||
|
|
||||||
|
float loadsize = loading_cur_step * (max_step / loading_num_step);
|
||||||
|
Draw_FillByColor (x - 2, y - 2, max_step + 4, size + 4, 69, 69, 69, 255);
|
||||||
|
Draw_FillByColor (x, y, loadsize, size, 0, 0, 0, 200);
|
||||||
|
|
||||||
|
switch(loading_step) {
|
||||||
|
case 1: text = "Loading Models.."; break;
|
||||||
|
case 2: text = "Loading World.."; break;
|
||||||
|
case 3: text = "Running Test Frame.."; break;
|
||||||
|
case 4: text = "Loading Sounds.."; break;
|
||||||
|
default: text = "Initializing.."; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
l = strlen (text);
|
||||||
|
Draw_String((vid.width - l*8)/2, y, text);
|
||||||
|
|
||||||
|
loading_cur_step_bk = loading_cur_step;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Clear_LoadingFill (void)
|
||||||
|
{
|
||||||
|
//it is end loading
|
||||||
|
loading_cur_step = 0;
|
||||||
|
loading_cur_step_bk = 0;
|
||||||
|
loading_num_step = 0;
|
||||||
|
loading_step = -1;
|
||||||
|
memset(loading_name, 0, sizeof(loading_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============
|
=============
|
||||||
|
@ -918,24 +987,24 @@ Draw_FillByColor
|
||||||
Fills a box of pixels with a single color not in basepal
|
Fills a box of pixels with a single color not in basepal
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
void Draw_FillByColor (int x, int y, int w, int h, unsigned int c, float alpha) //johnfitz -- added alpha
|
void Draw_FillByColor (int x, int y, int w, int h, float r, float g, float b, float a)
|
||||||
{
|
{
|
||||||
glDisable (GL_TEXTURE_2D);
|
glDisable (GL_TEXTURE_2D);
|
||||||
glEnable (GL_BLEND); //johnfitz -- for alpha
|
glEnable (GL_BLEND);
|
||||||
glDisable (GL_ALPHA_TEST); //johnfitz -- for alpha
|
glDisable (GL_ALPHA_TEST);
|
||||||
glColor4f (c, c, c, alpha); //johnfitz -- added alpha
|
glColor4f (r/255, g/255, b/255, a/255);
|
||||||
|
|
||||||
glBegin (GL_QUADS);
|
glBegin (GL_QUADS);
|
||||||
glVertex2f (x,y);
|
glVertex2f (x,y);
|
||||||
glVertex2f (x+w, y);
|
glVertex2f (x+w, y);
|
||||||
glVertex2f (x+w, y+h);
|
glVertex2f (x+w, y+h);
|
||||||
glVertex2f (x, y+h);
|
glVertex2f (x, y+h);
|
||||||
glEnd ();
|
glEnd ();
|
||||||
|
|
||||||
glColor3f (1,1,1);
|
glColor4f (1,1,1,1);
|
||||||
glDisable (GL_BLEND); //johnfitz -- for alpha
|
glDisable (GL_BLEND);
|
||||||
glEnable(GL_ALPHA_TEST); //johnfitz -- for alpha
|
glEnable(GL_ALPHA_TEST);
|
||||||
glEnable (GL_TEXTURE_2D);
|
glEnable (GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1106,7 +1175,7 @@ void GL_ResampleTexture (unsigned *in, int inwidth, int inheight, unsigned *out,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
int loading_cur_step;
|
int loading_cur_step;
|
||||||
int loading_num_step;
|
int loading_num_step;
|
||||||
|
|
||||||
|
@ -1116,7 +1185,7 @@ void Clear_LoadingFill (void)
|
||||||
loading_cur_step = 0;
|
loading_cur_step = 0;
|
||||||
loading_num_step = 0;
|
loading_num_step = 0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============
|
=============
|
||||||
|
@ -1132,11 +1201,6 @@ gltexture_t *loadtextureimage (char* filename)
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
data = Image_LoadImage (filename, &w, &h);
|
data = Image_LoadImage (filename, &w, &h);
|
||||||
if(data == NULL)
|
|
||||||
{
|
|
||||||
Sys_Error("loadtextureimage: Cannot load the image %s\n", filename);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
gl.gltexture = TexMgr_LoadImage (NULL, filename, w, h, SRC_RGBA, data, filename, sizeof(int)*2, TEXPREF_ALPHA | TEXPREF_NEAREST | TEXPREF_NOPICMIP);
|
gl.gltexture = TexMgr_LoadImage (NULL, filename, w, h, SRC_RGBA, data, filename, sizeof(int)*2, TEXPREF_ALPHA | TEXPREF_NEAREST | TEXPREF_NOPICMIP);
|
||||||
|
|
||||||
|
|
|
@ -274,36 +274,44 @@ void HUD_EndScreen (void)
|
||||||
char str[80];
|
char str[80];
|
||||||
int i, k, l;
|
int i, k, l;
|
||||||
int y, x, d;
|
int y, x, d;
|
||||||
|
|
||||||
HUD_Sortpoints ();
|
//sB hack in to stop showing HUD during boot
|
||||||
|
if(cl.stats[STAT_ROUNDS] >= 1)
|
||||||
l = scoreboardlines;
|
|
||||||
|
|
||||||
Draw_String ((vid.width/2 - 9*8)/2, vid.height/2 + (vid.height)*40/272, "GAME OVER");
|
|
||||||
|
|
||||||
sprintf (str,"You survived %3i rounds", cl.stats[STAT_ROUNDS]);
|
|
||||||
Draw_String ((vid.width/2 - strlen (str)*8)/2, vid.height/2 + (vid.height)*48/272, str);
|
|
||||||
|
|
||||||
sprintf (str,"Name Kills Points");
|
|
||||||
x = (vid.width/2 - strlen (str)*8)/2;
|
|
||||||
|
|
||||||
Draw_String (x, vid.height/2 + vid.height*68/272, str);
|
|
||||||
y = 0;
|
|
||||||
for (i=0; i<l ; i++)
|
|
||||||
{
|
{
|
||||||
k = pointsort[i];
|
HUD_Sortpoints ();
|
||||||
s = &cl.scores[k];
|
|
||||||
if (!s->name[0])
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Draw_String (x, vid.height/2 + vid.height*78/272 + y, s->name);
|
l = scoreboardlines;
|
||||||
|
|
||||||
d = strlen (va("%i",s->kills));
|
Draw_String ((vid.width/2 - 9*8)/2, vid.height/2 + (vid.height)*40/272, "GAME OVER");
|
||||||
Draw_String (x + (20 - d)*8, vid.height/2 + (vid.height)*78/272 + y, va("%i",s->kills));
|
|
||||||
|
|
||||||
d = strlen (va("%i",s->points));
|
sprintf (str,"You survived %3i rounds", cl.stats[STAT_ROUNDS]);
|
||||||
Draw_String (x + (31 - d)*8, vid.height/2 + (vid.height)*78/272 + y, va("%i",s->points));
|
Draw_String ((vid.width/2 - strlen (str)*8)/2, vid.height/2 + (vid.height)*48/272, str);
|
||||||
y += 20;
|
|
||||||
|
sprintf (str,"Name Kills Points");
|
||||||
|
x = (vid.width/2 - strlen (str)*8)/2;
|
||||||
|
|
||||||
|
Draw_String (x, vid.height/2 + vid.height*68/272, str);
|
||||||
|
y = 0;
|
||||||
|
for (i=0; i<l ; i++)
|
||||||
|
{
|
||||||
|
k = pointsort[i];
|
||||||
|
s = &cl.scores[k];
|
||||||
|
if (!s->name[0])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Draw_String (x, vid.height/2 + vid.height*78/272 + y, s->name);
|
||||||
|
|
||||||
|
d = strlen (va("%i",s->kills));
|
||||||
|
Draw_String (x + (20 - d)*8, vid.height/2 + (vid.height)*78/272 + y, va("%i",s->kills));
|
||||||
|
|
||||||
|
d = strlen (va("%i",s->points));
|
||||||
|
Draw_String (x + (31 - d)*8, vid.height/2 + (vid.height)*78/272 + y, va("%i",s->points));
|
||||||
|
y += 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1006,8 +1014,8 @@ void HUD_ProgressBar (void)
|
||||||
progressbar = 100 - ((cl.progress_bar-sv.time)*10);
|
progressbar = 100 - ((cl.progress_bar-sv.time)*10);
|
||||||
if (progressbar >= 100)
|
if (progressbar >= 100)
|
||||||
progressbar = 100;
|
progressbar = 100;
|
||||||
Draw_FillByColor ((vid.width)/4 - 51, vid.height/2 + (vid.height/2)*0.75 - 1, 102, 5, 0, 100/255.0);
|
Draw_FillByColor ((vid.width)/4 - 51, vid.height/2 + (vid.height/2)*0.75 - 1, 102, 5, 0, 0, 0, 100/255.0);
|
||||||
Draw_FillByColor ((vid.width)/4 - 50, vid.height/2 + (vid.height/2)*0.75, progressbar, 3, 1, 100/255.0);
|
Draw_FillByColor ((vid.width)/4 - 50, vid.height/2 + (vid.height/2)*0.75, progressbar, 3, 1, 0, 0, 100/255.0);
|
||||||
|
|
||||||
Draw_String ((vid.width/2 - (88))/2, vid.height/2 + (vid.height/2)*0.75 + 10, "Reviving...");
|
Draw_String ((vid.width/2 - (88))/2, vid.height/2 + (vid.height/2)*0.75 + 10, "Reviving...");
|
||||||
}
|
}
|
||||||
|
@ -1298,7 +1306,7 @@ void HUD_Draw (void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cl.stats[STAT_HEALTH] <= 0)
|
if (cl.stats[STAT_HEALTH] <= 0)
|
||||||
{
|
{
|
||||||
HUD_EndScreen ();
|
HUD_EndScreen ();
|
||||||
GL_SetCanvas(CANVAS_DEFAULT);
|
GL_SetCanvas(CANVAS_DEFAULT);
|
||||||
|
|
|
@ -526,6 +526,8 @@ void Mod_LoadTextures (lump_t *l)
|
||||||
|
|
||||||
loadmodel->numtextures = nummiptex + 2; //johnfitz -- need 2 dummy texture chains for missing textures
|
loadmodel->numtextures = nummiptex + 2; //johnfitz -- need 2 dummy texture chains for missing textures
|
||||||
loadmodel->textures = (texture_t **) Hunk_AllocName (loadmodel->numtextures * sizeof(*loadmodel->textures) , loadname);
|
loadmodel->textures = (texture_t **) Hunk_AllocName (loadmodel->numtextures * sizeof(*loadmodel->textures) , loadname);
|
||||||
|
|
||||||
|
loading_num_step = loading_num_step + m->nummiptex;
|
||||||
|
|
||||||
// motolegacy - load referenced WAD3 files for HLBSP, from DQuake+
|
// motolegacy - load referenced WAD3 files for HLBSP, from DQuake+
|
||||||
if (loadmodel->bspversion == HL_BSPVERSION)
|
if (loadmodel->bspversion == HL_BSPVERSION)
|
||||||
|
@ -697,6 +699,10 @@ void Mod_LoadTextures (lump_t *l)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
strcpy(loading_name, mt->name);
|
||||||
|
//free (tx_pixels);
|
||||||
|
loading_cur_step++;
|
||||||
|
SCR_UpdateScreen();
|
||||||
//johnfitz
|
//johnfitz
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2185,26 +2191,94 @@ void Mod_LoadBrushModel (qmodel_t *mod, void *buffer)
|
||||||
|
|
||||||
for (i = 0; i < (int) sizeof(dheader_t) / 4; i++)
|
for (i = 0; i < (int) sizeof(dheader_t) / 4; i++)
|
||||||
((int *)header)[i] = LittleLong ( ((int *)header)[i]);
|
((int *)header)[i] = LittleLong ( ((int *)header)[i]);
|
||||||
|
|
||||||
|
loading_num_step = loading_num_step + 16;
|
||||||
|
loading_step = 2;
|
||||||
|
|
||||||
// load into heap
|
// load into heap
|
||||||
|
|
||||||
|
strcpy(loading_name, "Vertexes");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadVertexes (&header->lumps[LUMP_VERTEXES]);
|
Mod_LoadVertexes (&header->lumps[LUMP_VERTEXES]);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Edges");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadEdges (&header->lumps[LUMP_EDGES], bsp2);
|
Mod_LoadEdges (&header->lumps[LUMP_EDGES], bsp2);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Surfedges");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadSurfedges (&header->lumps[LUMP_SURFEDGES]);
|
Mod_LoadSurfedges (&header->lumps[LUMP_SURFEDGES]);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Entities");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadEntities (&header->lumps[LUMP_ENTITIES]);
|
Mod_LoadEntities (&header->lumps[LUMP_ENTITIES]);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Textures");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadTextures (&header->lumps[LUMP_TEXTURES]);
|
Mod_LoadTextures (&header->lumps[LUMP_TEXTURES]);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadLighting (&header->lumps[LUMP_LIGHTING]);
|
Mod_LoadLighting (&header->lumps[LUMP_LIGHTING]);
|
||||||
|
loading_cur_step++;
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadPlanes (&header->lumps[LUMP_PLANES]);
|
Mod_LoadPlanes (&header->lumps[LUMP_PLANES]);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Texinfo");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadTexinfo (&header->lumps[LUMP_TEXINFO]);
|
Mod_LoadTexinfo (&header->lumps[LUMP_TEXINFO]);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Faces");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadFaces (&header->lumps[LUMP_FACES], bsp2);
|
Mod_LoadFaces (&header->lumps[LUMP_FACES], bsp2);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Marksurfaces");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadMarksurfaces (&header->lumps[LUMP_MARKSURFACES], bsp2);
|
Mod_LoadMarksurfaces (&header->lumps[LUMP_MARKSURFACES], bsp2);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Visibility");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadVisibility (&header->lumps[LUMP_VISIBILITY]);
|
Mod_LoadVisibility (&header->lumps[LUMP_VISIBILITY]);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Leafs");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadLeafs (&header->lumps[LUMP_LEAFS], bsp2);
|
Mod_LoadLeafs (&header->lumps[LUMP_LEAFS], bsp2);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Nodes");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadNodes (&header->lumps[LUMP_NODES], bsp2);
|
Mod_LoadNodes (&header->lumps[LUMP_NODES], bsp2);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Clipnodes");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadClipnodes (&header->lumps[LUMP_CLIPNODES], bsp2);
|
Mod_LoadClipnodes (&header->lumps[LUMP_CLIPNODES], bsp2);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Submodels");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_LoadSubmodels (&header->lumps[LUMP_MODELS]);
|
Mod_LoadSubmodels (&header->lumps[LUMP_MODELS]);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
strcpy(loading_name, "Hull");
|
||||||
|
SCR_UpdateScreen ();
|
||||||
Mod_MakeHull0 ();
|
Mod_MakeHull0 ();
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
loading_step = 3;
|
||||||
|
|
||||||
|
strcpy(loading_name, "Screen");
|
||||||
|
loading_cur_step++;
|
||||||
|
SCR_UpdateScreen ();
|
||||||
|
|
||||||
mod->numframes = 2; // regular and alternate animation
|
mod->numframes = 2; // regular and alternate animation
|
||||||
|
|
||||||
|
@ -2448,23 +2522,6 @@ void Mod_FloodFillSkin( byte *skin, int skinwidth, int skinheight )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean model_is_zombie(char name[MAX_QPATH])
|
|
||||||
{
|
|
||||||
if (Q_strcmp(name, "models/ai/zbod.mdl") == 0 ||
|
|
||||||
Q_strcmp(name, "models/ai/zcbod.mdl") == 0 ||
|
|
||||||
Q_strcmp(name, "models/ai/zcfull.mdl") == 0 ||
|
|
||||||
Q_strcmp(name, "models/ai/zchead.mdl") == 0 ||
|
|
||||||
Q_strcmp(name, "models/ai/zclarm.mdl") == 0 ||
|
|
||||||
Q_strcmp(name, "models/ai/zcrarm.mdl") == 0 ||
|
|
||||||
Q_strcmp(name, "models/ai/zfull.mdl") == 0 ||
|
|
||||||
Q_strcmp(name, "models/ai/zhead.mdl") == 0 ||
|
|
||||||
Q_strcmp(name, "models/ai/zlarm.mdl") == 0 ||
|
|
||||||
Q_strcmp(name, "models/ai/zrarm.mdl") == 0)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
Mod_LoadAllSkins
|
Mod_LoadAllSkins
|
||||||
|
@ -2512,11 +2569,11 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
|
||||||
qboolean malloced=false;
|
qboolean malloced=false;
|
||||||
enum srcformat fmt = SRC_RGBA;
|
enum srcformat fmt = SRC_RGBA;
|
||||||
|
|
||||||
if (model_is_zombie(loadmodel->name) == true) {
|
/*if (model_is_zombie(loadmodel->name) == true) {
|
||||||
q_snprintf(filename, sizeof(filename), "%s", zombie_skinss[i]);
|
q_snprintf(filename, sizeof(filename), "%s", zombie_skinss[i]);
|
||||||
} else {
|
} else {*/
|
||||||
q_snprintf (filename, sizeof(filename), "%s_%i", loadmodel->name, i);
|
q_snprintf (filename, sizeof(filename), "%s_%i", loadmodel->name, i);
|
||||||
}
|
//}
|
||||||
|
|
||||||
data = Image_LoadImage (filename, &fwidth, &fheight);
|
data = Image_LoadImage (filename, &fwidth, &fheight);
|
||||||
|
|
||||||
|
|
|
@ -449,9 +449,9 @@ void QMB_AllocParticles (void)
|
||||||
particles = (particle_t *) malloc (r_numparticles * sizeof(particle_t));
|
particles = (particle_t *) malloc (r_numparticles * sizeof(particle_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int loading_num_step;
|
extern float loading_num_step;
|
||||||
extern int loading_cur_step;
|
extern float loading_cur_step;
|
||||||
char loading_name[32];
|
extern char loading_name[32];
|
||||||
|
|
||||||
void QMB_InitParticles (void)
|
void QMB_InitParticles (void)
|
||||||
{
|
{
|
||||||
|
@ -478,7 +478,7 @@ void QMB_InitParticles (void)
|
||||||
|
|
||||||
if (!(glpic = loadtextureimage("textures/particles/particlefont")))
|
if (!(glpic = loadtextureimage("textures/particles/particlefont")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/particlefont\n");
|
Sys_Error("Cannot load textures/particles/particlefont\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -496,10 +496,13 @@ void QMB_InitParticles (void)
|
||||||
|
|
||||||
for (i=0 ; i<8 ; i++)
|
for (i=0 ; i<8 ; i++)
|
||||||
ADD_PARTICLE_TEXTURE(ptex_dpsmoke, glpic, i, 8, i * 32, 64, (i + 1) * 32, 96);
|
ADD_PARTICLE_TEXTURE(ptex_dpsmoke, glpic, i, 8, i * 32, 64, (i + 1) * 32, 96);
|
||||||
|
|
||||||
|
loading_cur_step++;
|
||||||
|
SCR_UpdateScreen ();
|
||||||
|
|
||||||
if (!(glpic = loadtextureimage("textures/particles/smoke")))
|
if (!(glpic = loadtextureimage("textures/particles/smoke")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/smoke\n");
|
Sys_Error("Cannot load textures/particles/smoke\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -513,7 +516,7 @@ void QMB_InitParticles (void)
|
||||||
// load the rest of the images
|
// load the rest of the images
|
||||||
if(!(glpic = loadtextureimage("textures/particles/q3particlefont")))
|
if(!(glpic = loadtextureimage("textures/particles/q3particlefont")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/q3particlefont\n");
|
Sys_Error("Cannot load textures/particles/q3particlefont\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -539,7 +542,7 @@ void QMB_InitParticles (void)
|
||||||
|
|
||||||
if (!(glpic = loadtextureimage("textures/particles/flame")))
|
if (!(glpic = loadtextureimage("textures/particles/flame")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/flame\n");
|
Sys_Error("Cannot load textures/particles/flame\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -551,7 +554,7 @@ void QMB_InitParticles (void)
|
||||||
|
|
||||||
if (!(glpic = loadtextureimage("textures/particles/inferno")))
|
if (!(glpic = loadtextureimage("textures/particles/inferno")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/inferno\n");
|
Sys_Error("Cannot load textures/particles/inferno\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -563,7 +566,7 @@ void QMB_InitParticles (void)
|
||||||
|
|
||||||
if (!(glpic = loadtextureimage("textures/particles/zing1")))
|
if (!(glpic = loadtextureimage("textures/particles/zing1")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/zing1\n");
|
Sys_Error("Cannot load textures/particles/zing1\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -577,7 +580,7 @@ void QMB_InitParticles (void)
|
||||||
|
|
||||||
if (!(glpic = loadtextureimage("textures/mzfl/mzfl0")))
|
if (!(glpic = loadtextureimage("textures/mzfl/mzfl0")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/mzfl0\n");
|
Sys_Error("Cannot load textures/particles/mzfl0\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -590,7 +593,7 @@ void QMB_InitParticles (void)
|
||||||
|
|
||||||
if (!(glpic = loadtextureimage("textures/mzfl/mzfl1")))
|
if (!(glpic = loadtextureimage("textures/mzfl/mzfl1")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/mzfl1\n");
|
Sys_Error("Cannot load textures/particles/mzfl1\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -601,7 +604,7 @@ void QMB_InitParticles (void)
|
||||||
SCR_UpdateScreen ();
|
SCR_UpdateScreen ();
|
||||||
if (!(glpic = loadtextureimage("textures/mzfl/mzfl2")))
|
if (!(glpic = loadtextureimage("textures/mzfl/mzfl2")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/mzfl2\n");
|
Sys_Error("Cannot load textures/particles/mzfl2\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -613,7 +616,7 @@ void QMB_InitParticles (void)
|
||||||
|
|
||||||
if (!(glpic = loadtextureimage("textures/mzfl/muzzleflash8")))
|
if (!(glpic = loadtextureimage("textures/mzfl/muzzleflash8")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/muzzleflash8\n");
|
Sys_Error("Cannot load textures/particles/muzzleflash8\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -626,7 +629,7 @@ void QMB_InitParticles (void)
|
||||||
max_s = max_t = 64.0;
|
max_s = max_t = 64.0;
|
||||||
if (!(glpic = loadtextureimage("textures/particles/bloodcloud")))
|
if (!(glpic = loadtextureimage("textures/particles/bloodcloud")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/bloodcloud\n");
|
Sys_Error("Cannot load textures/particles/bloodcloud\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -638,7 +641,7 @@ void QMB_InitParticles (void)
|
||||||
|
|
||||||
if (!(glpic = loadtextureimage("textures/particles/fly")))
|
if (!(glpic = loadtextureimage("textures/particles/fly")))
|
||||||
{
|
{
|
||||||
Clear_LoadingFill ();
|
//Clear_LoadingFill ();
|
||||||
Sys_Error("Cannot load textures/particles/fly\n");
|
Sys_Error("Cannot load textures/particles/fly\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,10 @@ int glx, gly, glwidth, glheight;
|
||||||
int scr_copytop;
|
int scr_copytop;
|
||||||
int loadingScreen;
|
int loadingScreen;
|
||||||
|
|
||||||
|
qboolean loadscreeninit;
|
||||||
|
char* loadname2;
|
||||||
|
char* loadnamespec;
|
||||||
|
|
||||||
float scr_con_current;
|
float scr_con_current;
|
||||||
float scr_conlines; // lines of console to display
|
float scr_conlines; // lines of console to display
|
||||||
|
|
||||||
|
@ -96,6 +100,7 @@ cvar_t scr_fov = {"fov","70",CVAR_NONE}; // 10 - 170
|
||||||
cvar_t scr_fov_adapt = {"fov_adapt","1",CVAR_ARCHIVE};
|
cvar_t scr_fov_adapt = {"fov_adapt","1",CVAR_ARCHIVE};
|
||||||
cvar_t scr_dynamic_fov = {"scr_dynamic_fov","1",CVAR_ARCHIVE}; //sB add dynamic FOV toggle
|
cvar_t scr_dynamic_fov = {"scr_dynamic_fov","1",CVAR_ARCHIVE}; //sB add dynamic FOV toggle
|
||||||
cvar_t scr_fov_viewmodel = {"r_viewmodel_fov","70"};
|
cvar_t scr_fov_viewmodel = {"r_viewmodel_fov","70"};
|
||||||
|
cvar_t scr_loadscreen = {"scr_loadscreen","1", true}; //sB loading screens
|
||||||
cvar_t scr_conspeed = {"scr_conspeed","500",CVAR_ARCHIVE};
|
cvar_t scr_conspeed = {"scr_conspeed","500",CVAR_ARCHIVE};
|
||||||
cvar_t scr_centertime = {"scr_centertime","2",CVAR_NONE};
|
cvar_t scr_centertime = {"scr_centertime","2",CVAR_NONE};
|
||||||
cvar_t scr_showram = {"showram","1",CVAR_NONE};
|
cvar_t scr_showram = {"showram","1",CVAR_NONE};
|
||||||
|
@ -113,6 +118,8 @@ qpic_t *scr_net;
|
||||||
qpic_t *scr_turtle;
|
qpic_t *scr_turtle;
|
||||||
|
|
||||||
qpic_t *hitmark;
|
qpic_t *hitmark;
|
||||||
|
qpic_t *lscreen;
|
||||||
|
qpic_t *lscreendefault;
|
||||||
qpic_t *ls_wahnsinn;
|
qpic_t *ls_wahnsinn;
|
||||||
qpic_t *ls_anstieg;
|
qpic_t *ls_anstieg;
|
||||||
|
|
||||||
|
@ -127,6 +134,8 @@ qboolean scr_disabled_for_loading;
|
||||||
qboolean scr_drawloading;
|
qboolean scr_drawloading;
|
||||||
float scr_disabled_time;
|
float scr_disabled_time;
|
||||||
|
|
||||||
|
float oldscreensize, oldfov;
|
||||||
|
|
||||||
int scr_tileclear_updates = 0; //johnfitz
|
int scr_tileclear_updates = 0; //johnfitz
|
||||||
|
|
||||||
char scr_usestring[1024];
|
char scr_usestring[1024];
|
||||||
|
@ -679,6 +688,7 @@ void SCR_Init (void)
|
||||||
Cvar_RegisterVariable (&scr_menuscale);
|
Cvar_RegisterVariable (&scr_menuscale);
|
||||||
Cvar_RegisterVariable (&scr_sbarscale);
|
Cvar_RegisterVariable (&scr_sbarscale);
|
||||||
Cvar_SetCallback (&scr_sbaralpha, SCR_Callback_refdef);
|
Cvar_SetCallback (&scr_sbaralpha, SCR_Callback_refdef);
|
||||||
|
Cvar_RegisterVariable (&scr_loadscreen); //sB loading screen
|
||||||
Cvar_RegisterVariable (&scr_sbaralpha);
|
Cvar_RegisterVariable (&scr_sbaralpha);
|
||||||
Cvar_SetCallback (&scr_conwidth, &SCR_Conwidth_f);
|
Cvar_SetCallback (&scr_conwidth, &SCR_Conwidth_f);
|
||||||
Cvar_SetCallback (&scr_conscale, &SCR_Conwidth_f);
|
Cvar_SetCallback (&scr_conscale, &SCR_Conwidth_f);
|
||||||
|
@ -930,6 +940,276 @@ void SCR_DrawLoading (void)
|
||||||
scr_tileclear_updates = 0; //johnfitz
|
scr_tileclear_updates = 0; //johnfitz
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Random_Int (int max_int)
|
||||||
|
{
|
||||||
|
float f;
|
||||||
|
f = (rand ()&0x7fff) / ((float)0x7fff) * max_int;
|
||||||
|
if (f > 0)
|
||||||
|
return (int)(f + 0.5) + 1;
|
||||||
|
else
|
||||||
|
return (int)(f - 0.5) + 1;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
==============
|
||||||
|
SCR_DrawLoadScreen
|
||||||
|
==============
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Creds to the following people from the 2020
|
||||||
|
Loading Screen Hint Submission/Contest:
|
||||||
|
|
||||||
|
* BCDeshiG
|
||||||
|
* Derped_Crusader
|
||||||
|
* Aidan
|
||||||
|
* yasen
|
||||||
|
* greg
|
||||||
|
* Asher
|
||||||
|
* Bernerd
|
||||||
|
* Omar Alejandro
|
||||||
|
* TheSmashers
|
||||||
|
*/
|
||||||
|
double loadingtimechange;
|
||||||
|
int loadingdot;
|
||||||
|
int loadingtextwidth;
|
||||||
|
char *lodinglinetext;
|
||||||
|
qpic_t *awoo;
|
||||||
|
char *ReturnLoadingtex (void)
|
||||||
|
{
|
||||||
|
int StringNum = Random_Int(55);
|
||||||
|
switch(StringNum)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
return "Released in 1996, Quake is now over 25 years old!";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return "Use the Kar98-k to be the hero we want you to be!";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
return "There is a huge number of modern engines based on Quake!";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
return "Development for NZ:P officially began on September 27, 2009";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
return "NZ:P was first released on December 25, 2010!";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
return "The 1.1 release of NZ:P has over 90,000 downloads!";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
return "NZ:P has been downloaded over 400,000 times!";
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
return "The original NZP was made mainly by 3 guys around the world.";
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
return "Blubswillrule: known as \"blubs\", is from the USA.";
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
return "Jukki is from Finland.";
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
return "Ju[s]tice, or \"tom\" is from Lithuania.";
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
return "This game is the reason that we have bad sleeping habits!";
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
return "We had a lot of fun making this game.";
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
|
return "Did you know you can make your own Custom Map?";
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
return "Try Retro Mode, it's in the Graphics Settings!";
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
return "Tired of the base maps? Make your own or try some online!";
|
||||||
|
break;
|
||||||
|
case 17:
|
||||||
|
return "Slay zombies & be grateful.";
|
||||||
|
break;
|
||||||
|
case 18:
|
||||||
|
return "Custom maps, CUSTOM MAPS!";
|
||||||
|
break;
|
||||||
|
case 19:
|
||||||
|
return "Go outside & build a snowman!";
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
return "Please surround yourself with zombies!";
|
||||||
|
break;
|
||||||
|
case 21:
|
||||||
|
return "Don't play for too long, or zombies will eat you.";
|
||||||
|
break;
|
||||||
|
case 22:
|
||||||
|
return "That was epic... EPIC FOR THE WIIIN!"; //why
|
||||||
|
break;
|
||||||
|
case 23:
|
||||||
|
return "PPSSPP is an awesome PSP emulator!";
|
||||||
|
break;
|
||||||
|
case 24:
|
||||||
|
return "You dead yet?";
|
||||||
|
break;
|
||||||
|
case 25:
|
||||||
|
return "Now 21% cooler!";
|
||||||
|
break;
|
||||||
|
case 26:
|
||||||
|
return "your lg is nothink on the lan"; //what
|
||||||
|
break;
|
||||||
|
case 27:
|
||||||
|
return "I'm not your chaotic on dm6!";
|
||||||
|
break;
|
||||||
|
case 28:
|
||||||
|
return "Shoot zombies to kill them. Or knife them. You choose.";
|
||||||
|
break;
|
||||||
|
case 29:
|
||||||
|
return "How many people forgot to Compile today?";
|
||||||
|
break;
|
||||||
|
case 30:
|
||||||
|
return "ggnore";
|
||||||
|
break;
|
||||||
|
case 31:
|
||||||
|
return "Have you tried NZ:P on PC or NX?";
|
||||||
|
break;
|
||||||
|
case 32:
|
||||||
|
return "Submerge your device in water for godmode!";
|
||||||
|
break;
|
||||||
|
case 33:
|
||||||
|
return "10/10/10 was a good day.";
|
||||||
|
break;
|
||||||
|
case 34:
|
||||||
|
return "Also check out \"No Bugs Allowed\" for the PSP!";
|
||||||
|
break;
|
||||||
|
case 35:
|
||||||
|
return "MotoLegacy, or \"Ian\", is from the USA.";
|
||||||
|
break;
|
||||||
|
case 36:
|
||||||
|
return "Zombies don't like bullets.";
|
||||||
|
break;
|
||||||
|
case 37:
|
||||||
|
return "Thanks for being an awesome fan!";
|
||||||
|
break;
|
||||||
|
case 38:
|
||||||
|
return "Removed Herobrine";
|
||||||
|
break;
|
||||||
|
case 39:
|
||||||
|
return "Pack-a-Punch the Kar98k to get to round infinity.";
|
||||||
|
break;
|
||||||
|
case 40:
|
||||||
|
return "I feel like I'm being gaslit.";
|
||||||
|
break;
|
||||||
|
case 41:
|
||||||
|
return "Heads up! You will die if you are killed!";
|
||||||
|
break;
|
||||||
|
case 42:
|
||||||
|
return "Zombies legally can't kill you if you say no!";
|
||||||
|
break;
|
||||||
|
case 43:
|
||||||
|
return "Please help me find the meaning of . Thanks.";
|
||||||
|
break;
|
||||||
|
case 44:
|
||||||
|
return "NZ:P Discord is ONLY for Thomas the Tank Engine Roleplay!";
|
||||||
|
break;
|
||||||
|
case 45:
|
||||||
|
return "Get rid of the 21% cooler tip, it's an MLP reference.";
|
||||||
|
break;
|
||||||
|
case 46:
|
||||||
|
return "You're playing on a PS Vita!";
|
||||||
|
break;
|
||||||
|
case 47:
|
||||||
|
return "Don't leak the beta!";
|
||||||
|
break;
|
||||||
|
case 48:
|
||||||
|
return "Jugger-Nog increases your health!";
|
||||||
|
break;
|
||||||
|
case 49:
|
||||||
|
return "greg was here";
|
||||||
|
break;
|
||||||
|
case 50:
|
||||||
|
return "Where the hell is the Mystery Box?!";
|
||||||
|
break;
|
||||||
|
case 51:
|
||||||
|
return "Zombies like getting shot.. I think.";
|
||||||
|
break;
|
||||||
|
case 52:
|
||||||
|
return "pro tip: aiming helps";
|
||||||
|
break;
|
||||||
|
case 53:
|
||||||
|
return "If a Nazi Zombie bites you, are you a Nazi, or a Zombie?";
|
||||||
|
break;
|
||||||
|
case 54:
|
||||||
|
return "Play some Custom Maps!";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return "wut wut";
|
||||||
|
}
|
||||||
|
qboolean load_screen_exists;
|
||||||
|
void SCR_DrawLoadScreen (void)
|
||||||
|
{
|
||||||
|
int max_step = 350;
|
||||||
|
int x = (vid.width / 2) - (max_step / 2);
|
||||||
|
|
||||||
|
if (developer.value)
|
||||||
|
return;
|
||||||
|
if (!con_forcedup)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (loadingScreen) {
|
||||||
|
if (!loadscreeninit) {
|
||||||
|
load_screen_exists = false;
|
||||||
|
|
||||||
|
char* lpath;
|
||||||
|
lpath = (char*)Z_Malloc(sizeof(char)*32);
|
||||||
|
strcpy(lpath, "gfx/lscreen/");
|
||||||
|
strcat(lpath, loadname2);
|
||||||
|
strcat(lpath, ".tga");
|
||||||
|
|
||||||
|
lscreen = Draw_CachePic(lpath);
|
||||||
|
//
|
||||||
|
//awoo = Draw_CachePic("gfx/menu/awoo");
|
||||||
|
|
||||||
|
if (lscreen == NULL)
|
||||||
|
{
|
||||||
|
lscreen = Draw_CachePic("gfx/lscreen/lscreen.tga");
|
||||||
|
}
|
||||||
|
load_screen_exists = true;
|
||||||
|
|
||||||
|
loadscreeninit = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (load_screen_exists == true)
|
||||||
|
{
|
||||||
|
Draw_StretchPic(0, 0, lscreen, vid.width, vid.height);
|
||||||
|
//Sys_Error("Fixme pls");
|
||||||
|
}
|
||||||
|
|
||||||
|
Draw_FillByColor(0, 0, 480, 24, 0, 0, 0, 150);
|
||||||
|
Draw_FillByColor(x - 62, 478, 480, 24, 0, 0, 0, 150);
|
||||||
|
|
||||||
|
Draw_ColoredString(2, 4, loadnamespec, 255, 255, 0, 255);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loadingtimechange < Sys_DoubleTime ())
|
||||||
|
{
|
||||||
|
lodinglinetext = ReturnLoadingtex();
|
||||||
|
loadingtextwidth = strlen(lodinglinetext); //strlen(lodinglinetext)*8
|
||||||
|
loadingtimechange = Sys_DoubleTime () + 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key_dest == key_game) {
|
||||||
|
Draw_ColoredString((vid.width - loadingtextwidth*8)/2/* - loadingtextwidth/2*/, 486, lodinglinetext, 255, 255, 255, 255);
|
||||||
|
|
||||||
|
//if (strcmp(lodinglinetext, "Please help me find the meaning of . Thanks.") == 0) {
|
||||||
|
//Draw_Pic(335, 255, awoo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
//cvar_t crosshair;
|
//cvar_t crosshair;
|
||||||
extern cvar_t crosshair;
|
extern cvar_t crosshair;
|
||||||
extern qboolean croshhairmoving;
|
extern qboolean croshhairmoving;
|
||||||
|
@ -1294,6 +1574,7 @@ void SCR_SetUpToDrawConsole (void)
|
||||||
scr_tileclear_updates = 0; //johnfitz
|
scr_tileclear_updates = 0; //johnfitz
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
SCR_DrawConsole
|
SCR_DrawConsole
|
||||||
|
@ -1657,8 +1938,11 @@ int original_view_fov;
|
||||||
void SCR_UpdateScreen (void)
|
void SCR_UpdateScreen (void)
|
||||||
{
|
{
|
||||||
vid.numpages = (gl_triplebuffer.value) ? 3 : 2;
|
vid.numpages = (gl_triplebuffer.value) ? 3 : 2;
|
||||||
|
|
||||||
|
scr_copytop = 0;
|
||||||
|
|
||||||
if (scr_disabled_for_loading)
|
//screen is disabled for loading, and we don't have any loading steps...?
|
||||||
|
if (scr_disabled_for_loading && !loading_num_step)
|
||||||
{
|
{
|
||||||
if (realtime - scr_disabled_time > 60)
|
if (realtime - scr_disabled_time > 60)
|
||||||
{
|
{
|
||||||
|
@ -1671,9 +1955,6 @@ void SCR_UpdateScreen (void)
|
||||||
|
|
||||||
if (!scr_initialized || !con_initialized)
|
if (!scr_initialized || !con_initialized)
|
||||||
return; // not initialized yet
|
return; // not initialized yet
|
||||||
|
|
||||||
scr_copytop = 0;
|
|
||||||
|
|
||||||
|
|
||||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||||
|
|
||||||
|
@ -1681,10 +1962,9 @@ void SCR_UpdateScreen (void)
|
||||||
if (cl.stats[STAT_ZOOM] == 1) //sB was here porting seperate viewmodel fov
|
if (cl.stats[STAT_ZOOM] == 1) //sB was here porting seperate viewmodel fov
|
||||||
{
|
{
|
||||||
if(!original_fov)
|
if(!original_fov)
|
||||||
{
|
|
||||||
original_fov = scr_fov.value;
|
original_fov = scr_fov.value;
|
||||||
original_view_fov = scr_fov_viewmodel.value;
|
original_view_fov = scr_fov_viewmodel.value;
|
||||||
}
|
|
||||||
if(scr_fov.value > (GetWeaponZoomAmmount() + 1))//+1 for accounting for floating point inaccurraces
|
if(scr_fov.value > (GetWeaponZoomAmmount() + 1))//+1 for accounting for floating point inaccurraces
|
||||||
{
|
{
|
||||||
scr_fov.value += ((original_fov - GetWeaponZoomAmmount()) - scr_fov.value) * 0.25;
|
scr_fov.value += ((original_fov - GetWeaponZoomAmmount()) - scr_fov.value) * 0.25;
|
||||||
|
@ -1701,22 +1981,21 @@ void SCR_UpdateScreen (void)
|
||||||
}
|
}
|
||||||
else if (cl.stats[STAT_ZOOM] == 3)
|
else if (cl.stats[STAT_ZOOM] == 3)
|
||||||
{
|
{
|
||||||
if(!original_fov)
|
if(!original_fov){
|
||||||
original_fov = scr_fov.value;
|
original_fov = scr_fov.value;
|
||||||
original_view_fov = scr_fov_viewmodel.value;
|
original_view_fov = scr_fov_viewmodel.value;
|
||||||
//original_fov = scr_fov.value;
|
}
|
||||||
|
|
||||||
if(scr_dynamic_fov.value == 0) //sB add dynamic FOV toggle
|
if(scr_dynamic_fov.value == 0) //sB add dynamic FOV toggle
|
||||||
{
|
{
|
||||||
original_fov = 0;
|
original_fov = scr_fov.value;
|
||||||
original_view_fov = 0;
|
original_view_fov = scr_fov_viewmodel.value;
|
||||||
}
|
}
|
||||||
else if(scr_dynamic_fov.value == 1)
|
else if(scr_dynamic_fov.value == 1)
|
||||||
{
|
{
|
||||||
scr_fov.value += (original_fov - 10 - scr_fov.value) * 0.3;
|
scr_fov.value += (original_fov - 10 - scr_fov.value) * 0.3;
|
||||||
//scr_fov_viewmodel.value += (original_view_fov - 10 - scr_fov_viewmodel.value) * 0.3;
|
scr_fov_viewmodel.value += (original_view_fov - 10 - scr_fov_viewmodel.value) * 0.3;
|
||||||
Cvar_SetValue("fov",scr_fov.value);
|
Cvar_SetValue("fov",scr_fov.value);
|
||||||
//Cvar_SetValue("r_viewmodel_fov", scr_fov_viewmodel.value);
|
Cvar_SetValue("r_viewmodel_fov", scr_fov_viewmodel.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cl.stats[STAT_ZOOM] == 0 && original_fov != 0)
|
else if (cl.stats[STAT_ZOOM] == 0 && original_fov != 0)
|
||||||
|
@ -1735,6 +2014,18 @@ void SCR_UpdateScreen (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldfov != scr_fov.value)
|
||||||
|
{
|
||||||
|
oldfov = scr_fov.value;
|
||||||
|
vid.recalc_refdef = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oldscreensize != scr_viewsize.value)
|
||||||
|
{
|
||||||
|
oldscreensize = scr_viewsize.value;
|
||||||
|
vid.recalc_refdef = true;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// determine size of refresh window
|
// determine size of refresh window
|
||||||
//
|
//
|
||||||
|
@ -1753,50 +2044,27 @@ void SCR_UpdateScreen (void)
|
||||||
//FIXME: only call this when needed
|
//FIXME: only call this when needed
|
||||||
SCR_TileClear ();
|
SCR_TileClear ();
|
||||||
|
|
||||||
if (scr_drawdialog) //new game confirm
|
SCR_DrawCrosshair (); //johnfitz
|
||||||
{
|
SCR_DrawRam ();
|
||||||
if (con_forcedup)
|
SCR_DrawNet ();
|
||||||
Draw_ConsoleBackground ();
|
SCR_DrawTurtle ();
|
||||||
// else
|
SCR_DrawPause ();
|
||||||
// Sbar_Draw ();
|
SCR_CheckDrawCenterString ();
|
||||||
Draw_FadeScreen ();
|
SCR_CheckDrawUseString ();
|
||||||
SCR_DrawNotifyString ();
|
SCR_DrawDevStats (); //johnfitz
|
||||||
}
|
HUD_Draw ();
|
||||||
else if (scr_drawloading) //loading
|
SCR_DrawFPS (); //johnfitz
|
||||||
{
|
SCR_DrawClock (); //johnfitz
|
||||||
SCR_DrawLoading ();
|
SCR_DrawConsole ();
|
||||||
// Sbar_Draw ();
|
M_Draw ();
|
||||||
}
|
|
||||||
else if (cl.intermission == 1 && key_dest == key_game) //end of level
|
if(scr_loadscreen.value)
|
||||||
{
|
SCR_DrawLoadScreen();
|
||||||
Sbar_IntermissionOverlay ();
|
|
||||||
}
|
|
||||||
else if (cl.intermission == 2 && key_dest == key_game) //end of episode
|
|
||||||
{
|
|
||||||
Sbar_FinaleOverlay ();
|
|
||||||
SCR_CheckDrawCenterString ();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SCR_DrawCrosshair (); //johnfitz
|
|
||||||
SCR_DrawRam ();
|
|
||||||
SCR_DrawNet ();
|
|
||||||
SCR_DrawTurtle ();
|
|
||||||
SCR_DrawPause ();
|
|
||||||
SCR_CheckDrawCenterString ();
|
|
||||||
SCR_CheckDrawUseString ();
|
|
||||||
SCR_DrawDevStats (); //johnfitz
|
|
||||||
HUD_Draw ();
|
|
||||||
SCR_DrawFPS (); //johnfitz
|
|
||||||
SCR_DrawClock (); //johnfitz
|
|
||||||
SCR_DrawConsole ();
|
|
||||||
M_Draw ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Draw_LoadingFill();
|
||||||
|
|
||||||
V_UpdateBlend (); //johnfitz -- V_UpdatePalette cleaned up and renamed
|
V_UpdateBlend (); //johnfitz -- V_UpdatePalette cleaned up and renamed
|
||||||
|
|
||||||
GLSLGamma_GammaCorrect ();
|
GLSLGamma_GammaCorrect ();
|
||||||
|
|
||||||
GL_EndRendering ();
|
GL_EndRendering ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -714,16 +714,20 @@ int fgetLittleShort (FILE *f);
|
||||||
LoadTGA
|
LoadTGA
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
|
|
||||||
qpic_t *LoadTGAPic (char *path)
|
qpic_t *LoadTGAPic (char *path)
|
||||||
{
|
{
|
||||||
byte *data;
|
byte *data;
|
||||||
int w;
|
int w;
|
||||||
int h;
|
int h;
|
||||||
|
char *lscreendefault;
|
||||||
|
|
||||||
data = Image_LoadImage(path, &w, &h);
|
data = Image_LoadImage(path, &w, &h);
|
||||||
|
|
||||||
// Build it into a qpic for easy return
|
// Build it into a qpic for easy return
|
||||||
|
|
||||||
qpic_t *pic;
|
qpic_t *pic;
|
||||||
|
|
||||||
pic = (qpic_t *) Hunk_Alloc (sizeof(qpic_t) - 4 + (4 * w * h));
|
pic = (qpic_t *) Hunk_Alloc (sizeof(qpic_t) - 4 + (4 * w * h));
|
||||||
|
|
||||||
pic->width = w;
|
pic->width = w;
|
||||||
|
|
|
@ -76,6 +76,7 @@ static inline int Buf_GetC(stdio_buffer_t *buf)
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
#define STBI_ONLY_JPEG
|
#define STBI_ONLY_JPEG
|
||||||
#define STBI_ONLY_PNG
|
#define STBI_ONLY_PNG
|
||||||
|
#define STBI_ONLY_TGA
|
||||||
#include "stb_image.h"
|
#include "stb_image.h"
|
||||||
static byte *Image_LoadSTBI(FILE *f, int *width, int *height)
|
static byte *Image_LoadSTBI(FILE *f, int *width, int *height)
|
||||||
{
|
{
|
||||||
|
@ -103,11 +104,11 @@ returns a pointer to hunk allocated RGBA data
|
||||||
byte *Image_LoadImage (const char *name, int *width, int *height)
|
byte *Image_LoadImage (const char *name, int *width, int *height)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
q_snprintf (loadfilename, sizeof(loadfilename), "%s.tga", name);
|
q_snprintf (loadfilename, sizeof(loadfilename), "%s.tga", name);
|
||||||
COM_FOpenFile (loadfilename, &f, NULL);
|
COM_FOpenFile (loadfilename, &f, NULL);
|
||||||
if (f) {
|
if (f)
|
||||||
return Image_LoadTGA (f, width, height);
|
return Image_LoadSTBI (f, width, height);
|
||||||
}
|
|
||||||
|
|
||||||
q_snprintf (loadfilename, sizeof(loadfilename), "%s.png", name);
|
q_snprintf (loadfilename, sizeof(loadfilename), "%s.png", name);
|
||||||
COM_FOpenFile (loadfilename, &f, NULL);
|
COM_FOpenFile (loadfilename, &f, NULL);
|
||||||
|
@ -257,6 +258,9 @@ byte *Image_LoadTGA (FILE *fin, int *width, int *height)
|
||||||
|
|
||||||
if (targa_header.colormap_type !=0 || (targa_header.pixel_size!=32 && targa_header.pixel_size!=24))
|
if (targa_header.colormap_type !=0 || (targa_header.pixel_size!=32 && targa_header.pixel_size!=24))
|
||||||
Sys_Error ("Image_LoadTGA: %s is not a 24bit or 32bit targa\n", loadfilename);
|
Sys_Error ("Image_LoadTGA: %s is not a 24bit or 32bit targa\n", loadfilename);
|
||||||
|
|
||||||
|
//if(targa_header.id_length == 0)
|
||||||
|
//Sys_Error ("This TGA is non-existent\n");
|
||||||
|
|
||||||
columns = targa_header.width;
|
columns = targa_header.width;
|
||||||
rows = targa_header.height;
|
rows = targa_header.height;
|
||||||
|
|
|
@ -262,7 +262,7 @@ char *osk_text2 [] =
|
||||||
" A S D F G H J K L : \" | ",
|
" A S D F G H J K L : \" | ",
|
||||||
" Z X C V B N M < > ? "
|
" Z X C V B N M < > ? "
|
||||||
};
|
};
|
||||||
|
extern qboolean console_enabled;
|
||||||
void Key_Console (int key)
|
void Key_Console (int key)
|
||||||
{
|
{
|
||||||
static char current[MAXCMDLINE] = "";
|
static char current[MAXCMDLINE] = "";
|
||||||
|
@ -1109,6 +1109,7 @@ void Key_Event (int key, qboolean down)
|
||||||
break;
|
break;
|
||||||
case key_game:
|
case key_game:
|
||||||
case key_console:
|
case key_console:
|
||||||
|
console_enabled = false;
|
||||||
M_ToggleMenu_f ();
|
M_ToggleMenu_f ();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -66,6 +66,10 @@ cvar_t cl_enablereartouchpad = {"cl_enablereartouchpad", "0", CVAR_ARCHIVE};
|
||||||
extern int loadingScreen;
|
extern int loadingScreen;
|
||||||
extern int ShowBlslogo;
|
extern int ShowBlslogo;
|
||||||
|
|
||||||
|
extern char* loadname2;
|
||||||
|
extern char* loadnamespec;
|
||||||
|
extern qboolean loadscreeninit;
|
||||||
|
|
||||||
extern float cl_forwardspeed;
|
extern float cl_forwardspeed;
|
||||||
|
|
||||||
qpic_t *menu_bk;
|
qpic_t *menu_bk;
|
||||||
|
@ -356,6 +360,9 @@ void M_Paused_Menu_f (void) {
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_paused_menu;
|
m_state = m_paused_menu;
|
||||||
m_entersound = true;
|
m_entersound = true;
|
||||||
|
|
||||||
|
loadingScreen = 0;
|
||||||
|
loadscreeninit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define Max_Paused_Items 4
|
#define Max_Paused_Items 4
|
||||||
|
@ -370,7 +377,7 @@ void M_Paused_Menu_Draw (void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Fill black to make everything easier to see
|
// Fill black to make everything easier to see
|
||||||
Draw_FillByColor(0, 0, 1280, 720, 0, 0.4);
|
Draw_FillByColor(0, 0, 1280, 720, 0, 0, 0, 0.4);
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
Draw_ColoredStringScale(10, y + 10, "PAUSED", 1, 1, 1, 1, 3.0f);
|
Draw_ColoredStringScale(10, y + 10, "PAUSED", 1, 1, 1, 1, 3.0f);
|
||||||
|
@ -452,23 +459,26 @@ void M_Paused_Menu_Key (int key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void M_Start_Menu_f ()
|
void M_Start_Menu_f ()
|
||||||
{
|
{
|
||||||
key_dest = key_menu;
|
key_dest = key_menu;
|
||||||
m_state = m_start;
|
m_state = m_start;
|
||||||
m_entersound = true;
|
m_entersound = true;
|
||||||
//loadingScreen = 0;
|
loadingScreen = 0;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
static void M_Start_Menu_Draw ()
|
static void M_Start_Menu_Draw ()
|
||||||
{
|
{
|
||||||
|
qpic_t *start_bk;
|
||||||
|
|
||||||
|
start_bk = Draw_CachePic("gfx/lscreen/lscreen.tga");
|
||||||
|
Draw_StretchPic(0, 0, start_bk, vid.width, vid.height);
|
||||||
// Use the useprint canvas because it's easier to draw things scaled well not in console
|
// Use the useprint canvas because it's easier to draw things scaled well not in console
|
||||||
char *s = "Press start";
|
char *s = "Press start";
|
||||||
GL_SetCanvas(CANVAS_USEPRINT);
|
GL_SetCanvas(CANVAS_USEPRINT);
|
||||||
Draw_String ((vid.width/2 - (strlen(s)*8))/2, vid.height * 0.85, s);
|
Draw_String ((vid.width/2 - (strlen(s)*8))/2, vid.height * 0.85, s);
|
||||||
|
|
||||||
}
|
}
|
||||||
void M_Start_Key (int key)
|
void M_Start_Key (int key)
|
||||||
{
|
{
|
||||||
|
@ -514,7 +524,7 @@ void M_Main_Draw (void)
|
||||||
Draw_BgMenu();
|
Draw_BgMenu();
|
||||||
|
|
||||||
// Fill black to make everything easier to see
|
// Fill black to make everything easier to see
|
||||||
Draw_FillByColor(0, 0, 1280, 720, 0, 0.4);
|
Draw_FillByColor(0, 0, 1280, 720, 0, 0, 0, 0.4);
|
||||||
|
|
||||||
// Version String
|
// Version String
|
||||||
Draw_ColoredString(vid.width - 40, y + 5, NZP_VERSION, 1, 1, 1, 1);
|
Draw_ColoredString(vid.width - 40, y + 5, NZP_VERSION, 1, 1, 1, 1);
|
||||||
|
@ -533,7 +543,7 @@ void M_Main_Draw (void)
|
||||||
Draw_ColoredStringScale(10, y + 70, "Co-Op (Coming Soon!)", 0.5, 0.5, 0.5, 1, 1.5f);
|
Draw_ColoredStringScale(10, y + 70, "Co-Op (Coming Soon!)", 0.5, 0.5, 0.5, 1, 1.5f);
|
||||||
|
|
||||||
// Divider
|
// Divider
|
||||||
Draw_FillByColor(10, y + 90, 240, 3, 1, 1);
|
Draw_FillByColor(10, y + 90, 240, 3, 1, 1, 1, 1);
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
if (m_main_cursor == 1)
|
if (m_main_cursor == 1)
|
||||||
|
@ -545,7 +555,7 @@ void M_Main_Draw (void)
|
||||||
Draw_ColoredStringScale(10, y + 115, "Achievements", 0.5, 0.5, 0.5, 1, 1.5f);
|
Draw_ColoredStringScale(10, y + 115, "Achievements", 0.5, 0.5, 0.5, 1, 1.5f);
|
||||||
|
|
||||||
// Divider
|
// Divider
|
||||||
Draw_FillByColor(10, y + 135, 240, 3, 1, 1);
|
Draw_FillByColor(10, y + 135, 240, 3, 1, 1, 1, 1);
|
||||||
|
|
||||||
// Credits
|
// Credits
|
||||||
if (m_main_cursor == 2)
|
if (m_main_cursor == 2)
|
||||||
|
@ -554,7 +564,7 @@ void M_Main_Draw (void)
|
||||||
Draw_ColoredStringScale(10, y + 145, "Credits", 1, 1, 1, 1, 1.5f);
|
Draw_ColoredStringScale(10, y + 145, "Credits", 1, 1, 1, 1, 1.5f);
|
||||||
|
|
||||||
// Divider
|
// Divider
|
||||||
Draw_FillByColor(10, y + 165, 240, 3, 1, 1);
|
Draw_FillByColor(10, y + 165, 240, 3, 1, 1, 1, 1);
|
||||||
|
|
||||||
// Exit
|
// Exit
|
||||||
if (m_main_cursor == 3)
|
if (m_main_cursor == 3)
|
||||||
|
@ -802,7 +812,7 @@ void M_SinglePlayer_Draw (void)
|
||||||
Draw_BgMenu();
|
Draw_BgMenu();
|
||||||
|
|
||||||
// Fill black to make everything easier to see
|
// Fill black to make everything easier to see
|
||||||
Draw_FillByColor(0, 0, 1280, 720, 0, 0.4);
|
Draw_FillByColor(0, 0, 1280, 720, 0, 0, 0, 0.4);
|
||||||
|
|
||||||
// Version String
|
// Version String
|
||||||
Draw_ColoredString(vid.width - 40, y + 5, NZP_VERSION, 1, 1, 1, 1);
|
Draw_ColoredString(vid.width - 40, y + 5, NZP_VERSION, 1, 1, 1, 1);
|
||||||
|
@ -835,7 +845,7 @@ void M_SinglePlayer_Draw (void)
|
||||||
Draw_ColoredStringScale(10, y + 115, "Christmas Special", 1, 1, 1, 1, 1.5f);
|
Draw_ColoredStringScale(10, y + 115, "Christmas Special", 1, 1, 1, 1, 1.5f);
|
||||||
|
|
||||||
// Divider
|
// Divider
|
||||||
Draw_FillByColor(10, y + 135, 240, 3, 1, 1);
|
Draw_FillByColor(10, y + 135, 240, 3, 1, 1, 1, 1);
|
||||||
|
|
||||||
// Custom Maps
|
// Custom Maps
|
||||||
if (m_singleplayer_cursor == 3)
|
if (m_singleplayer_cursor == 3)
|
||||||
|
@ -928,6 +938,9 @@ void M_SinglePlayer_Key (int key)
|
||||||
Cbuf_AddText ("deathmatch 0\n");
|
Cbuf_AddText ("deathmatch 0\n");
|
||||||
Cbuf_AddText ("coop 0\n");
|
Cbuf_AddText ("coop 0\n");
|
||||||
Cbuf_AddText ("map ndu\n");
|
Cbuf_AddText ("map ndu\n");
|
||||||
|
loadingScreen = 1;
|
||||||
|
loadname2 = "ndu";
|
||||||
|
loadnamespec = "Nacht der Untoten";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -941,6 +954,9 @@ void M_SinglePlayer_Key (int key)
|
||||||
Cbuf_AddText ("deathmatch 0\n");
|
Cbuf_AddText ("deathmatch 0\n");
|
||||||
Cbuf_AddText ("coop 0\n");
|
Cbuf_AddText ("coop 0\n");
|
||||||
Cbuf_AddText ("map warehouse\n");
|
Cbuf_AddText ("map warehouse\n");
|
||||||
|
loadingScreen = 1;
|
||||||
|
loadname2 = "warehouse";
|
||||||
|
loadnamespec = "Warehouse";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -954,6 +970,9 @@ void M_SinglePlayer_Key (int key)
|
||||||
Cbuf_AddText ("deathmatch 0\n");
|
Cbuf_AddText ("deathmatch 0\n");
|
||||||
Cbuf_AddText ("coop 0\n");
|
Cbuf_AddText ("coop 0\n");
|
||||||
Cbuf_AddText ("map christmas_special\n");
|
Cbuf_AddText ("map christmas_special\n");
|
||||||
|
loadingScreen = 1;
|
||||||
|
loadname2 = "christmas_special";
|
||||||
|
loadnamespec = "Christmas Special";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -1000,7 +1019,7 @@ void M_Menu_Maps_Draw (void)
|
||||||
Draw_BgMenu();
|
Draw_BgMenu();
|
||||||
|
|
||||||
// Fill black to make everything easier to see
|
// Fill black to make everything easier to see
|
||||||
Draw_FillByColor(0, 0, 1280, 720, 0, 0.4);
|
Draw_FillByColor(0, 0, 1280, 720, 0, 0, 0, 0.4);
|
||||||
|
|
||||||
// Version String
|
// Version String
|
||||||
Draw_ColoredString(vid.width - 40, y + 5, NZP_VERSION, 1, 1, 1, 1);
|
Draw_ColoredString(vid.width - 40, y + 5, NZP_VERSION, 1, 1, 1, 1);
|
||||||
|
@ -1023,7 +1042,7 @@ void M_Menu_Maps_Draw (void)
|
||||||
if (m_maps_cursor == i) {
|
if (m_maps_cursor == i) {
|
||||||
if (custom_maps[i + multiplier].map_use_thumbnail == 1) {
|
if (custom_maps[i + multiplier].map_use_thumbnail == 1) {
|
||||||
menu_cuthum = Draw_CachePic(custom_maps[i + multiplier].map_thumbnail_path);
|
menu_cuthum = Draw_CachePic(custom_maps[i + multiplier].map_thumbnail_path);
|
||||||
Draw_StretchPic(x_map_info_disp + 305, y + 55, menu_cuthum, 274, 155);
|
//Draw_StretchPic(x_map_info_disp + 305, y + 55, menu_cuthum, 274, 155);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (custom_maps[i + multiplier].map_name_pretty != 0)
|
if (custom_maps[i + multiplier].map_name_pretty != 0)
|
||||||
|
@ -1182,9 +1201,17 @@ void M_Menu_Maps_Key (int key)
|
||||||
Cbuf_AddText ("maxplayers 1\n");
|
Cbuf_AddText ("maxplayers 1\n");
|
||||||
Cbuf_AddText ("deathmatch 0\n");
|
Cbuf_AddText ("deathmatch 0\n");
|
||||||
Cbuf_AddText ("coop 0\n");
|
Cbuf_AddText ("coop 0\n");
|
||||||
|
|
||||||
char map_selection[MAX_QPATH];
|
char map_selection[MAX_QPATH];
|
||||||
strcpy(map_selection, custom_maps[m_maps_cursor + multiplier].map_name);
|
strcpy(map_selection, custom_maps[m_maps_cursor + multiplier].map_name);
|
||||||
Cbuf_AddText (va("map %s\n", custom_maps[m_maps_cursor + multiplier].map_name));
|
Cbuf_AddText (va("map %s\n", custom_maps[m_maps_cursor + multiplier].map_name));
|
||||||
|
|
||||||
|
loadingScreen = 1;
|
||||||
|
loadname2 = custom_maps[m_maps_cursor + multiplier].map_name;
|
||||||
|
if (custom_maps[m_maps_cursor + multiplier].map_name_pretty != 0)
|
||||||
|
loadnamespec = custom_maps[m_maps_cursor + multiplier].map_name_pretty;
|
||||||
|
else
|
||||||
|
loadnamespec = custom_maps[m_maps_cursor + multiplier].map_name;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1917,7 +1944,7 @@ void M_Options_Draw (void)
|
||||||
Draw_BgMenu();
|
Draw_BgMenu();
|
||||||
|
|
||||||
// Fill black to make everything easier to see
|
// Fill black to make everything easier to see
|
||||||
Draw_FillByColor(0, 0, 1280, 720, 0, 0.4);
|
Draw_FillByColor(0, 0, 1280, 720, 0, 0, 0, 0.4);
|
||||||
|
|
||||||
// Version String
|
// Version String
|
||||||
Draw_ColoredString(vid.width - 40, y + 5, NZP_VERSION, 1, 1, 1, 1);
|
Draw_ColoredString(vid.width - 40, y + 5, NZP_VERSION, 1, 1, 1, 1);
|
||||||
|
@ -1944,7 +1971,7 @@ void M_Options_Draw (void)
|
||||||
Draw_ColoredStringScale(10, y + 85, "Control Settings", 1, 1, 1, 1, 1.5f);
|
Draw_ColoredStringScale(10, y + 85, "Control Settings", 1, 1, 1, 1, 1.5f);
|
||||||
|
|
||||||
// Divider
|
// Divider
|
||||||
Draw_FillByColor(10, y + 105, 240, 3, 1, 1);
|
Draw_FillByColor(10, y + 105, 240, 3, 1, 1, 1, 1);
|
||||||
|
|
||||||
// Console
|
// Console
|
||||||
if (options_cursor == 3)
|
if (options_cursor == 3)
|
||||||
|
@ -1968,7 +1995,7 @@ void M_Options_Draw (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern qboolean console_enabled;
|
||||||
void M_Options_Key (int k)
|
void M_Options_Key (int k)
|
||||||
{
|
{
|
||||||
switch (k)
|
switch (k)
|
||||||
|
@ -2001,6 +2028,7 @@ void M_Options_Key (int k)
|
||||||
case 3:
|
case 3:
|
||||||
m_state = m_none;
|
m_state = m_none;
|
||||||
paused_hack = false;
|
paused_hack = false;
|
||||||
|
console_enabled = true;
|
||||||
Con_ToggleConsole_f();
|
Con_ToggleConsole_f();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
@ -2062,7 +2090,7 @@ void M_Graphics_Settings_Draw (void)
|
||||||
Draw_BgMenu();
|
Draw_BgMenu();
|
||||||
|
|
||||||
// Fill black to make everything easier to see
|
// Fill black to make everything easier to see
|
||||||
Draw_FillByColor(0, 0, 1280, 720, 0, 0.4);
|
Draw_FillByColor(0, 0, 1280, 720, 0, 0, 0, 0.4);
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
Draw_ColoredStringScale(10, y + 10, "GRAPHICS SETTINGS", 1, 1, 1, 1, 3.0f);
|
Draw_ColoredStringScale(10, y + 10, "GRAPHICS SETTINGS", 1, 1, 1, 1, 3.0f);
|
||||||
|
@ -2281,7 +2309,7 @@ void M_Control_Settings_Draw (void)
|
||||||
Draw_BgMenu();
|
Draw_BgMenu();
|
||||||
|
|
||||||
// Fill black to make everything easier to see
|
// Fill black to make everything easier to see
|
||||||
Draw_FillByColor(0, 0, 1280, 720, 0, 0.4);
|
Draw_FillByColor(0, 0, 1280, 720, 0, 0, 0, 0.4);
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
Draw_ColoredStringScale(10, y + 10, "CONTROL SETTINGS", 1, 1, 1, 1, 3.0f);
|
Draw_ColoredStringScale(10, y + 10, "CONTROL SETTINGS", 1, 1, 1, 1, 3.0f);
|
||||||
|
@ -2604,7 +2632,7 @@ void M_Keys_Draw (void)
|
||||||
Draw_BgMenu();
|
Draw_BgMenu();
|
||||||
|
|
||||||
// Fill black to make everything easier to see
|
// Fill black to make everything easier to see
|
||||||
Draw_FillByColor(0, 0, 1280, 720, 0, 0.4);
|
Draw_FillByColor(0, 0, 1280, 720, 0, 0, 0, 0.4);
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
Draw_ColoredStringScale(10, y + 10, "CONTROLS", 1, 1, 1, 1, 3.0f);
|
Draw_ColoredStringScale(10, y + 10, "CONTROLS", 1, 1, 1, 1, 3.0f);
|
||||||
|
@ -2863,7 +2891,7 @@ void M_Credits_Draw (void)
|
||||||
Draw_BgMenu();
|
Draw_BgMenu();
|
||||||
|
|
||||||
// Fill black to make everything easier to see
|
// Fill black to make everything easier to see
|
||||||
Draw_FillByColor(0, 0, 1280, 720, 0, 0.4);
|
Draw_FillByColor(0, 0, 1280, 720, 0, 0, 0, 0.4);
|
||||||
|
|
||||||
// Version String
|
// Version String
|
||||||
Draw_ColoredString(vid.width - 40, y + 5, NZP_VERSION, 1, 1, 1, 1);
|
Draw_ColoredString(vid.width - 40, y + 5, NZP_VERSION, 1, 1, 1, 1);
|
||||||
|
@ -3883,6 +3911,8 @@ void M_Draw (void)
|
||||||
|
|
||||||
if (!m_recursiveDraw)
|
if (!m_recursiveDraw)
|
||||||
{
|
{
|
||||||
|
//scr_copyeverything = 1;
|
||||||
|
|
||||||
if (scr_con_current)
|
if (scr_con_current)
|
||||||
{
|
{
|
||||||
Draw_ConsoleBackground ();
|
Draw_ConsoleBackground ();
|
||||||
|
|
|
@ -3069,6 +3069,7 @@ void PF_rumble (void)
|
||||||
IN_StartRumble(intensity_small, intensity_large, duration);
|
IN_StartRumble(intensity_small, intensity_large, duration);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static builtin_t pr_builtin[] =
|
static builtin_t pr_builtin[] =
|
||||||
{
|
{
|
||||||
PF_Fixme,
|
PF_Fixme,
|
||||||
|
|
|
@ -571,6 +571,9 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg)
|
||||||
ent = NEXT_EDICT(sv.edicts);
|
ent = NEXT_EDICT(sv.edicts);
|
||||||
for (e=1 ; e<sv.num_edicts ; e++, ent = NEXT_EDICT(ent))
|
for (e=1 ; e<sv.num_edicts ; e++, ent = NEXT_EDICT(ent))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (ent->v.effects == EF_NODRAW) //sB adding back NODRAW for limbs
|
||||||
|
continue;
|
||||||
|
|
||||||
if (ent != clent) // clent is ALLWAYS sent
|
if (ent != clent) // clent is ALLWAYS sent
|
||||||
{
|
{
|
||||||
|
|
|
@ -209,12 +209,12 @@ void Sys_Error (const char *error, ...)
|
||||||
q_vsnprintf (text, sizeof(text), error, argptr);
|
q_vsnprintf (text, sizeof(text), error, argptr);
|
||||||
va_end (argptr);
|
va_end (argptr);
|
||||||
|
|
||||||
f = fopen ("/switch/nzportable/error.log", "w");
|
/*f = fopen ("/switch/nzportable/error.log", "w");
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
fprintf (f, "Error: %s\n", text);
|
fprintf (f, "Error: %s\n", text);
|
||||||
fclose (f);
|
fclose (f);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
fputs (errortxt1, stderr);
|
fputs (errortxt1, stderr);
|
||||||
Host_Shutdown ();
|
Host_Shutdown ();
|
||||||
|
|
|
@ -406,6 +406,7 @@ void Sys_Error (const char *error, ...)
|
||||||
{
|
{
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
char text[1024];
|
char text[1024];
|
||||||
|
FILE *f;
|
||||||
|
|
||||||
host_parms->errstate++;
|
host_parms->errstate++;
|
||||||
|
|
||||||
|
@ -418,6 +419,13 @@ void Sys_Error (const char *error, ...)
|
||||||
sceClibPrintf(errortxt2);
|
sceClibPrintf(errortxt2);
|
||||||
sceClibPrintf(text);
|
sceClibPrintf(text);
|
||||||
sceClibPrintf("\n\n");
|
sceClibPrintf("\n\n");
|
||||||
|
|
||||||
|
f = fopen ("ux0:data/nzp/error.log", "w");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
fprintf (f, "Error: %s\n", text);
|
||||||
|
fclose (f);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fputs (errortxt1, stderr);
|
fputs (errortxt1, stderr);
|
||||||
|
|
|
@ -115,7 +115,7 @@ static void *Z_TagMalloc (int size, int tag)
|
||||||
memblock_t *start, *rover, *newblock, *base;
|
memblock_t *start, *rover, *newblock, *base;
|
||||||
|
|
||||||
if (!tag)
|
if (!tag)
|
||||||
Sys_Error ("Z_TagMalloc: tried to use a 0 tag");
|
Host_Error ("Z_TagMalloc: tried to use a 0 tag");
|
||||||
|
|
||||||
//
|
//
|
||||||
// scan through the block list looking for the first free block
|
// scan through the block list looking for the first free block
|
||||||
|
@ -181,11 +181,11 @@ static void Z_CheckHeap (void)
|
||||||
if (block->next == &mainzone->blocklist)
|
if (block->next == &mainzone->blocklist)
|
||||||
break; // all blocks have been hit
|
break; // all blocks have been hit
|
||||||
if ( (byte *)block + block->size != (byte *)block->next)
|
if ( (byte *)block + block->size != (byte *)block->next)
|
||||||
Sys_Error ("Z_CheckHeap: block size does not touch the next block\n");
|
Host_Error ("Z_CheckHeap: block size does not touch the next block\n");
|
||||||
if ( block->next->prev != block)
|
if ( block->next->prev != block)
|
||||||
Sys_Error ("Z_CheckHeap: next block doesn't have proper back link\n");
|
Host_Error ("Z_CheckHeap: next block doesn't have proper back link\n");
|
||||||
if (!block->tag && !block->next->tag)
|
if (!block->tag && !block->next->tag)
|
||||||
Sys_Error ("Z_CheckHeap: two consecutive free blocks\n");
|
Host_Error ("Z_CheckHeap: two consecutive free blocks\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ void *Z_Malloc (int size)
|
||||||
Z_CheckHeap (); // DEBUG
|
Z_CheckHeap (); // DEBUG
|
||||||
buf = Z_TagMalloc (size, 1);
|
buf = Z_TagMalloc (size, 1);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
Sys_Error ("Z_Malloc: failed on allocation of %i bytes",size);
|
Host_Error ("Z_Malloc: failed on allocation of %i bytes",size);
|
||||||
Q_memset (buf, 0, size);
|
Q_memset (buf, 0, size);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
|
@ -425,6 +425,7 @@ void Hunk_Print_f (void)
|
||||||
Hunk_AllocName
|
Hunk_AllocName
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void *Hunk_AllocName (int size, const char *name)
|
void *Hunk_AllocName (int size, const char *name)
|
||||||
{
|
{
|
||||||
hunk_t *h;
|
hunk_t *h;
|
||||||
|
@ -434,7 +435,7 @@ void *Hunk_AllocName (int size, const char *name)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (size < 0)
|
if (size < 0)
|
||||||
Sys_Error ("Hunk_Alloc: bad size: %i", size);
|
Sys_Error("Not enough bytes");
|
||||||
|
|
||||||
size = sizeof(hunk_t) + ((size+15)&~15);
|
size = sizeof(hunk_t) + ((size+15)&~15);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue