{
if(cls.state != ca_dedicated)
{
- if(countdownupdate <= 0) // check if time stepped backwards
+ if(countdownupdate <= 0 || gamemode == GAME_WRATH) // check if time stepped backwards
{
SCR_UpdateLoadingScreenIfShown();
countdownupdate = 2;
strlcpy(cl.worldname, cl.worldmodel->name, sizeof(cl.worldname));
FS_StripExtension(cl.worldname, cl.worldnamenoextension, sizeof(cl.worldnamenoextension));
strlcpy(cl.worldbasename, !strncmp(cl.worldnamenoextension, "maps/", 5) ? cl.worldnamenoextension + 5 : cl.worldnamenoextension, sizeof(cl.worldbasename));
+ SCR_SetLoadingSplash(cl.worldbasename); // set the loading splash once we know the map name for sure
Cvar_SetQuick(&cl_worldmessage, cl.worldmessage);
Cvar_SetQuick(&cl_worldname, cl.worldname);
Cvar_SetQuick(&cl_worldnamenoextension, cl.worldnamenoextension);
// finished loading sounds
}
- SCR_PopLoadingScreen(false);
+ if (gamemode != GAME_WRATH) // this will be done after the "press any key" screen
+ SCR_ClearLoadingScreen(false);
if (!cl.loadfinished)
{
Con_ClearNotify();
if (COM_CheckParm("-profilegameonly"))
Sys_AllowProfiling(true);
+
+ if (gamemode == GAME_WRATH)
+ {
+ // HACK: pause the game and display "loading ended, press any key" screen
+ SCR_ClearLoadingScreen(false);
+ if (cl.islocalgame)
+ {
+ SCR_PushLoadingScreen("$", 1);
+ sv.paused = true;
+ }
+ }
break;
}
}
// if server is active, we already began a loading plaque
if (!sv.active)
{
+ SCR_SetLoadingSplash(NULL);
SCR_BeginLoadingPlaque(false);
S_StopAllSounds();
// free q3 shaders so that any newly downloaded shaders will be active
cvar_t vid_conwidth = {CVAR_CLIENT | CVAR_SAVE, "vid_conwidth", "640", "virtual width of 2D graphics system (note: changes may be overwritten, see vid_conwidthauto)"};
cvar_t vid_conheight = {CVAR_CLIENT | CVAR_SAVE, "vid_conheight", "480", "virtual height of 2D graphics system"};
cvar_t vid_pixelheight = {CVAR_CLIENT | CVAR_SAVE, "vid_pixelheight", "1", "adjusts vertical field of vision to account for non-square pixels (1280x1024 on a CRT monitor for example)"};
+cvar_t scr_aspectname = {CVAR_CLIENT, "scr_aspectname", "16-9", "string name for the current aspect ratio; use a dash instead of a colon, e. g. 16-9"};
cvar_t scr_screenshot_jpeg = {CVAR_CLIENT | CVAR_SAVE, "scr_screenshot_jpeg","1", "save jpeg instead of targa"};
cvar_t scr_screenshot_jpeg_quality = {CVAR_CLIENT | CVAR_SAVE, "scr_screenshot_jpeg_quality","0.9", "image quality of saved jpeg"};
cvar_t scr_screenshot_png = {CVAR_CLIENT | CVAR_SAVE, "scr_screenshot_png","0", "save png instead of targa"};
len = strlen(s->msg);
x = (vid_conwidth.integer - DrawQ_TextWidth(s->msg, len, size, size, true, FONT_INFOBAR)) / 2;
y -= size;
- DrawQ_Fill(0, y, vid_conwidth.integer, size, 0, 0, 0, 1, 0);
- DrawQ_String(x, y, s->msg, len, size, size, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
+ if (gamemode != GAME_WRATH)
+ {
+ DrawQ_Fill(0, y, vid_conwidth.integer, size, 0, 0, 0, 1, 0);
+ DrawQ_String(x, y, s->msg, len, size, size, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
+ }
total += size;
}
#endif
float colors[16];
loadingscreenheight = SCR_DrawLoadingStack_r(loadingscreenstack, vid_conheight.integer, scr_loadingscreen_barheight.value);
- if(loadingscreenstack)
+ if(gamemode != GAME_WRATH && loadingscreenstack)
{
// height = 32; // sorry, using the actual one is ugly
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
}
static cachepic_t *loadingscreenpic;
+static cachepic_t *loadingscreenind;
static float loadingscreenpic_vertex3f[12];
static float loadingscreenpic_texcoord2f[8];
+static float loadingscreenind_vertex3f[12];
+static float loadingscreenind_texcoord2f[8];
+static float loadingscreenind_angle;
+static float loadingscreenind_pos[2];
+static qboolean loadingscreenind_show;
+
+void SCR_SetLoadingSplash (const char *mapname)
+{
+ char vabuf[1024] = { 0 };
+
+ if (gamemode != GAME_WRATH)
+ return; // let god sort em out
+
+ // if we're connecting somewhere, the mapname is unknown until the server sends it to us,
+ // so the pic is set once we get the server info,
+ // otherwise the appropriate function just calls this with a known mapname.
+ // to reset to black screen, just call this with NULL mapname
+
+ if (mapname && mapname[0]) {
+ // try the current aspect ratio
+ dpsnprintf(vabuf, sizeof(vabuf), "gfx/splashes/%s_%s", mapname, scr_aspectname.string);
+ if (!Draw_PicExists(vabuf)) {
+ // try the default aspect ratio (16:9)
+ dpsnprintf(vabuf, sizeof(vabuf), "gfx/splashes/%s_16-9", mapname);
+ if (!Draw_PicExists(vabuf)) {
+ // try without aspect ratio
+ dpsnprintf(vabuf, sizeof(vabuf), "gfx/splashes/%s", mapname);
+ if (!Draw_PicExists(vabuf))
+ vabuf[0] = 0; // give up
+ }
+ }
+ }
+
+ if (!vabuf[0])
+ strlcpy(vabuf, "gfx/splashes/_blank", sizeof(vabuf));
+
+ Cvar_SetQuick(&scr_loadingscreen_picture, vabuf);
+}
static void SCR_DrawLoadingScreen_SharedSetup (qboolean clear)
{
R_Textures_Frame();
R_Mesh_Start();
R_EntityMatrix(&identitymatrix);
- // draw the loading plaque
- loadingscreenpic = Draw_CachePic_Flags (loadingscreenpic_number ? va(vabuf, sizeof(vabuf), "%s%d", scr_loadingscreen_picture.string, loadingscreenpic_number+1) : scr_loadingscreen_picture.string, loadingscreenpic_number ? CACHEPICFLAG_NOTPERSISTENT : 0);
+
+ if (gamemode == GAME_WRATH)
+ {
+ // setup the splash
+ loadingscreenpic = Draw_CachePic_Flags(scr_loadingscreen_picture.string, 0);
+ loadingscreenpic_vertex3f[2] = loadingscreenpic_vertex3f[5] = loadingscreenpic_vertex3f[8] = loadingscreenpic_vertex3f[11] = 0;
+ loadingscreenpic_vertex3f[0] = loadingscreenpic_vertex3f[9] = 0;
+ loadingscreenpic_vertex3f[1] = loadingscreenpic_vertex3f[4] = 0;
+ loadingscreenpic_vertex3f[3] = loadingscreenpic_vertex3f[6] = vid_conwidth.integer;
+ loadingscreenpic_vertex3f[7] = loadingscreenpic_vertex3f[10] = vid_conheight.integer;
+ loadingscreenpic_texcoord2f[0] = 0;loadingscreenpic_texcoord2f[1] = 0;
+ loadingscreenpic_texcoord2f[2] = 1;loadingscreenpic_texcoord2f[3] = 0;
+ loadingscreenpic_texcoord2f[4] = 1;loadingscreenpic_texcoord2f[5] = 1;
+ loadingscreenpic_texcoord2f[6] = 0;loadingscreenpic_texcoord2f[7] = 1;
+
+ // spinning circle/arrow thing
+ if (SCR_LoadingScreenWaiting())
+ {
+ loadingscreenind = loadingscreenind_show ? Draw_CachePic_Flags ("gfx/splashes/arrow", 0) : NULL;
+ loadingscreenind_angle = 0.f;
+ }
+ else
+ {
+ loadingscreenind = Draw_CachePic_Flags ("gfx/splashes/loading_ring", 0);
+ }
- w = Draw_GetPicWidth(loadingscreenpic);
- h = Draw_GetPicHeight(loadingscreenpic);
+ if (loadingscreenind)
+ {
+ loadingscreenind_pos[0] = vid_conwidth.integer - 20;
+ loadingscreenind_pos[1] = vid_conheight.integer - 20;
+ loadingscreenind_vertex3f[2] = loadingscreenind_vertex3f[5] = loadingscreenind_vertex3f[8] = loadingscreenind_vertex3f[11] = 0;
+ loadingscreenind_vertex3f[0] = loadingscreenind_vertex3f[9] = -Draw_GetPicWidth(loadingscreenind) / 2;
+ loadingscreenind_vertex3f[1] = loadingscreenind_vertex3f[4] = -Draw_GetPicHeight(loadingscreenind) / 2;
+ loadingscreenind_vertex3f[3] = loadingscreenind_vertex3f[6] = Draw_GetPicWidth(loadingscreenind) / 2;
+ loadingscreenind_vertex3f[7] = loadingscreenind_vertex3f[10] = Draw_GetPicHeight(loadingscreenind) / 2;
+ loadingscreenind_texcoord2f[0] = 0;loadingscreenind_texcoord2f[1] = 0;
+ loadingscreenind_texcoord2f[2] = 1;loadingscreenind_texcoord2f[3] = 0;
+ loadingscreenind_texcoord2f[4] = 1;loadingscreenind_texcoord2f[5] = 1;
+ loadingscreenind_texcoord2f[6] = 0;loadingscreenind_texcoord2f[7] = 1;
+ }
+ }
+ else
+ {
+ // draw the loading plaque
+ loadingscreenpic = Draw_CachePic_Flags (loadingscreenpic_number ? va(vabuf, sizeof(vabuf), "%s%d", scr_loadingscreen_picture.string, loadingscreenpic_number+1) : scr_loadingscreen_picture.string, loadingscreenpic_number ? CACHEPICFLAG_NOTPERSISTENT : 0);
- // apply scale
- w *= scr_loadingscreen_scale.value;
- h *= scr_loadingscreen_scale.value;
+ w = Draw_GetPicWidth(loadingscreenpic);
+ h = Draw_GetPicHeight(loadingscreenpic);
- // apply scale base
- if(scr_loadingscreen_scale_base.integer)
- {
- w *= vid_conwidth.integer / (float) vid.width;
- h *= vid_conheight.integer / (float) vid.height;
- }
+ // apply scale
+ w *= scr_loadingscreen_scale.value;
+ h *= scr_loadingscreen_scale.value;
- // apply scale limit
- sw = w / vid_conwidth.integer;
- sh = h / vid_conheight.integer;
- f = 1;
- switch(scr_loadingscreen_scale_limit.integer)
- {
- case 1:
- f = max(sw, sh);
- break;
- case 2:
- f = min(sw, sh);
- break;
- case 3:
- f = sw;
- break;
- case 4:
- f = sh;
- break;
- }
- if(f > 1)
- {
- w /= f;
- h /= f;
- }
+ // apply scale base
+ if(scr_loadingscreen_scale_base.integer)
+ {
+ w *= vid_conwidth.integer / (float) vid.width;
+ h *= vid_conheight.integer / (float) vid.height;
+ }
+
+ // apply scale limit
+ sw = w / vid_conwidth.integer;
+ sh = h / vid_conheight.integer;
+ f = 1;
+ switch(scr_loadingscreen_scale_limit.integer)
+ {
+ case 1:
+ f = max(sw, sh);
+ break;
+ case 2:
+ f = min(sw, sh);
+ break;
+ case 3:
+ f = sw;
+ break;
+ case 4:
+ f = sh;
+ break;
+ }
+ if(f > 1)
+ {
+ w /= f;
+ h /= f;
+ }
- x = (vid_conwidth.integer - w)/2;
- y = (vid_conheight.integer - h)/2;
- loadingscreenpic_vertex3f[2] = loadingscreenpic_vertex3f[5] = loadingscreenpic_vertex3f[8] = loadingscreenpic_vertex3f[11] = 0;
- loadingscreenpic_vertex3f[0] = loadingscreenpic_vertex3f[9] = x;
- loadingscreenpic_vertex3f[1] = loadingscreenpic_vertex3f[4] = y;
- loadingscreenpic_vertex3f[3] = loadingscreenpic_vertex3f[6] = x + w;
- loadingscreenpic_vertex3f[7] = loadingscreenpic_vertex3f[10] = y + h;
- loadingscreenpic_texcoord2f[0] = 0;loadingscreenpic_texcoord2f[1] = 0;
- loadingscreenpic_texcoord2f[2] = 1;loadingscreenpic_texcoord2f[3] = 0;
- loadingscreenpic_texcoord2f[4] = 1;loadingscreenpic_texcoord2f[5] = 1;
- loadingscreenpic_texcoord2f[6] = 0;loadingscreenpic_texcoord2f[7] = 1;
+ x = (vid_conwidth.integer - w)/2;
+ y = (vid_conheight.integer - h)/2;
+ loadingscreenpic_vertex3f[2] = loadingscreenpic_vertex3f[5] = loadingscreenpic_vertex3f[8] = loadingscreenpic_vertex3f[11] = 0;
+ loadingscreenpic_vertex3f[0] = loadingscreenpic_vertex3f[9] = x;
+ loadingscreenpic_vertex3f[1] = loadingscreenpic_vertex3f[4] = y;
+ loadingscreenpic_vertex3f[3] = loadingscreenpic_vertex3f[6] = x + w;
+ loadingscreenpic_vertex3f[7] = loadingscreenpic_vertex3f[10] = y + h;
+ loadingscreenpic_texcoord2f[0] = 0;loadingscreenpic_texcoord2f[1] = 0;
+ loadingscreenpic_texcoord2f[2] = 1;loadingscreenpic_texcoord2f[3] = 0;
+ loadingscreenpic_texcoord2f[4] = 1;loadingscreenpic_texcoord2f[5] = 1;
+ loadingscreenpic_texcoord2f[6] = 0;loadingscreenpic_texcoord2f[7] = 1;
+ }
}
static void SCR_DrawLoadingScreen (void)
key_consoleactive = old_key_consoleactive;
}
+qboolean SCR_LoadingScreenWaiting(void)
+{
+ return cl.islocalgame && (loadingscreenstack && loadingscreenstack->msg[0] == '$' && loadingscreenstack->msg[1] == '\0');
+}
+
qboolean R_Stereo_ColorMasking(void)
{
return r_stereo_redblue.integer || r_stereo_redgreen.integer || r_stereo_redcyan.integer;
"csqc_polygons_defaultmaterial_nocullface 1\n"
);
break;
+ case GAME_WRATH:
+ Cbuf_InsertText(cmd, "\n"
+"sv_gameplayfix_blowupfallenzombies 1\n"
+"sv_gameplayfix_findradiusdistancetobox 1\n"
+"sv_gameplayfix_grenadebouncedownslopes 1\n"
+"sv_gameplayfix_slidemoveprojectiles 1\n"
+"sv_gameplayfix_upwardvelocityclearsongroundflag 1\n"
+"sv_gameplayfix_setmodelrealbox 1\n"
+"sv_gameplayfix_droptofloorstartsolid 1\n"
+"sv_gameplayfix_droptofloorstartsolid_nudgetocorrect 1\n"
+"sv_gameplayfix_noairborncorpse 1\n"
+"sv_gameplayfix_noairborncorpse_allowsuspendeditems 0\n"
+"sv_gameplayfix_easierwaterjump 1\n"
+"sv_gameplayfix_delayprojectiles 1\n"
+"sv_gameplayfix_multiplethinksperframe 1\n"
+"sv_gameplayfix_fixedcheckwatertransition 1\n"
+"sv_gameplayfix_q1bsptracelinereportstexture 1\n"
+"sv_gameplayfix_swiminbmodels 1\n"
+"sv_gameplayfix_downtracesupportsongroundflag 0\n"
+"sv_gameplayfix_stepmultipletimes 1\n"
+"sv_gameplayfix_nogravityonground 1\n"
+"sys_ticrate 0.01388889\n"
+ );
+ break;
default:
Cbuf_InsertText(cmd, "\n"
"sv_gameplayfix_blowupfallenzombies 1\n"
{ GAME_STRAPBOMB, GAME_STRAPBOMB, "strapbomb", "-strapbomb", "Strap-on-bomb Car", "Strap-on-bomb_Car", "id1", NULL, "strap", "strapbomb" }, // COMMANDLINEOPTION: Game: -strapbomb runs the game Strap-on-bomb Car
{ GAME_MOONHELM, GAME_MOONHELM, "moonhelm", "-moonhelm", "MoonHelm", "MoonHelm", "data", NULL, "mh", "moonhelm" }, // COMMANDLINEOPTION: Game: -moonhelm runs the game MoonHelm
{ GAME_VORETOURNAMENT, GAME_VORETOURNAMENT, "voretournament", "-voretournament", "Vore Tournament", "Vore_Tournament", "data", NULL, "voretournament", "voretournament" }, // COMMANDLINEOPTION: Game: -voretournament runs the multiplayer game Vore Tournament
+{ GAME_WRATH, GAME_WRATH, "wrath", "-wrath", "WRATH", "WRATH", "kp1", NULL, "wrath", "WRATH" }, // COMMANDLINEOPTION: Game: -wrath runs WRATH
};
static void COM_SetGameType(int index);
GAME_STRAPBOMB, // added by motorsep for Urre
GAME_MOONHELM,
GAME_VORETOURNAMENT,
+ GAME_WRATH,
GAME_COUNT
}
gamemode_t;
cachepic_t *Draw_NewPic(const char *picname, int width, int height, unsigned char *pixels, textype_t textype, int texflags);
// free the texture memory used by a pic (the cachepic_t itself is eternal)
void Draw_FreePic(const char *picname);
+qboolean Draw_PicExists(const char *picname);
// a triangle mesh..
// each vertex is 3 floats
}
}
+qboolean Draw_PicExists(const char *name) {
+ char vabuf[1024] = { 0 };
+ const char *checkfmt[] = { "%s.tga", "%s.png", "%s.jpg", "%s.pcx" };
+ int i;
+ // TODO: actually use the gfx format list for this
+ for (i = 0; i < sizeof(checkfmt) / sizeof(checkfmt[0]); ++i)
+ if (FS_FileExists(va(vabuf, sizeof(vabuf), checkfmt[i], name)))
+ return true;
+ return false;
+}
+
static float snap_to_pixel_x(float x, float roundUpAt);
extern int con_linewidth; // to force rewrapping
void LoadFont(qboolean override, const char *name, dp_font_t *fnt, float scale, float voffset)
return;
}
+ SCR_SetLoadingSplash(NULL); // clear splash
+
// GAME_DELUXEQUAKE - clear warpmark (used by QC)
if (gamemode == GAME_DELUXEQUAKE)
Cvar_Set(&cvars_all, "warpmark", "");
return;
}
+ SCR_SetLoadingSplash(NULL); // clear splash
+
#ifdef CONFIG_MENU
// remove menu
if (key_dest == key_menu || key_dest == key_menu_grabbed)
return;
}
+ SCR_SetLoadingSplash(NULL); // clear splash
+
#ifdef CONFIG_MENU
// remove menu
if (key_dest == key_menu || key_dest == key_menu_grabbed)
return;
}
+ SCR_SetLoadingSplash(NULL); // clear splash
+
strlcpy (filename, Cmd_Argv(cmd, 1), sizeof(filename));
FS_DefaultExtension (filename, ".sav", sizeof (filename));
qboolean q;
keydest_t keydest = key_dest;
char vabuf[1024];
+ long curtime;
+ static long pausetime = 0; // HACK: prevent double unpause
if (key < 0 || key >= MAX_KEYS)
return;
+ // HACK: allow unpause by any key for the "press any key" screen
+ if (SCR_LoadingScreenWaiting() && sv.paused && down && (curtime = Sys_DirtyTime()) > pausetime)
+ {
+ key_consoleactive &= ~KEY_CONSOLEACTIVE_USER; // close the console if opened
+ Cbuf_InsertText(cmd,"pause\n"); // unpause
+ SCR_ClearLoadingScreen(false);
+ pausetime = curtime + 2;
+ return; // eat the key
+ }
+
if(events_blocked)
{
Key_EventQueue_Add(key, ascii, down);
{"+movedown", "swim down"}
};
+static const char *wrathbindnames[][2] =
+{
+{"+attack", "primary fire"},
+{"+button3", "secondary fire"},
+{"impulse 10", "next weapon"},
+{"impulse 12", "previous weapon"},
+{"impulse 15", "use artifact"},
+{"+button6", "artifact inventory"},
+{"+jump", "jump / swim up"},
+{"+forward", "walk forward"},
+{"+back", "backpedal"},
+{"+left", "turn left"},
+{"+right", "turn right"},
+{"+speed", "walk"},
+{"+button4", "crouch"},
+{"+button5", "use"},
+{"+moveleft", "step left"},
+{"+moveright", "step right"},
+{"+moveup", "swim up"},
+{"+movedown", "swim down"},
+{"impulse 35", "toggle journal"},
+// guns
+{"impulse 1", "select gauntlet"},
+{"impulse 2", "select coachgun"},
+{"impulse 3", "select shotgun"},
+{"impulse 4", "select fang spitter"},
+{"impulse 5", "select retcher"},
+{"impulse 6", "select slag cannon"}
+};
+
static int numcommands;
static const char *(*bindnames)[2];
numcommands = sizeof(goodvsbad2bindnames) / sizeof(goodvsbad2bindnames[0]);
bindnames = goodvsbad2bindnames;
}
+ else if (gamemode == GAME_WRATH)
+ {
+ numcommands = sizeof(wrathbindnames) / sizeof(wrathbindnames[0]);
+ bindnames = wrathbindnames;
+ }
else
{
numcommands = sizeof(quakebindnames) / sizeof(quakebindnames[0]);
void CL_UpdateScreen (void);
void SCR_CenterPrint(const char *str);
+void SCR_SetLoadingSplash (const char *mapname);
+
void SCR_BeginLoadingPlaque (qboolean startup);
void SCR_EndLoadingPlaque (void);
void SCR_PopLoadingScreen (qboolean redraw);
void SCR_ClearLoadingScreen (qboolean redraw);
+// returns true if the loading screen is waiting for a key press
+qboolean SCR_LoadingScreenWaiting(void);
+
extern float scr_con_current; // current height of displayed console
extern int sb_lines;
extern cvar_t scr_conbrightness;
extern cvar_t r_letterbox;
+extern cvar_t scr_aspectname;
+
extern cvar_t scr_refresh;
extern cvar_t scr_stipple;
if (cls.state != ca_dedicated)
{
+ SCR_SetLoadingSplash(NULL); // clear splash
SCR_BeginLoadingPlaque(false);
S_StopAllSounds();
}
in_windowmouse_y = vid_height.value / 2.f;
}
+ // TODO: a more fine-grained calculation
+ if (((float)vid.mode.width / (float)vid.mode.height) > 1.501f)
+ Cvar_SetQuick(&scr_aspectname, "16-9");
+ else
+ Cvar_SetQuick(&scr_aspectname, "4-3");
+
return true;
}
else
if (!vid_opened)
{
+ SCR_SetLoadingSplash(NULL);
SCR_BeginLoadingPlaque(false);
return;
}