]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Implement GAME_WRATH and its codepaths
authorCloudwalk <mazecraze96@gmail.com>
Wed, 10 Jun 2020 15:27:53 +0000 (11:27 -0400)
committerCloudwalk <mazecraze96@gmail.com>
Wed, 10 Jun 2020 15:27:53 +0000 (11:27 -0400)
The game works now. Some console spam related to VM_fgets that I'll need
to look into. Other than that, it doesn't have horrid framerates anymore
in e1m1.

13 files changed:
cl_parse.c
cl_screen.c
cmd.c
common.c
common.h
draw.h
gl_draw.c
host_cmd.c
keys.c
menu.c
screen.h
sv_main.c
vid_shared.c

index c86581a34ce62d8f51fc7dc02111475f158a6746..cdfb120166293cf841323f74b39a20500dbc0c28 100644 (file)
@@ -331,7 +331,7 @@ void CL_KeepaliveMessage (qboolean readmessages)
        {
                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;
@@ -484,6 +484,7 @@ static void CL_SetupWorldModel(void)
                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);
@@ -1350,7 +1351,8 @@ static void CL_BeginDownloads(qboolean aborteddownload)
                // 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)
        {
@@ -1659,6 +1661,17 @@ static void CL_SignonReply (void)
                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;
        }
 }
@@ -1685,6 +1698,7 @@ static void CL_ParseServerInfo (void)
        // 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
index 5810f31d27f88919b08d7f4577ecea2814b3b3e0..fa0245fdc252340042cba7fa7240e5345914c30d 100644 (file)
@@ -53,6 +53,7 @@ cvar_t vid_conwidthauto = {CVAR_CLIENT | CVAR_SAVE, "vid_conwidthauto", "1", "au
 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"};
@@ -2415,8 +2416,11 @@ static float SCR_DrawLoadingStack_r(loadingscreenstack_t *s, float y, float size
                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
@@ -2429,7 +2433,7 @@ static void SCR_DrawLoadingStack(void)
        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);
@@ -2465,8 +2469,47 @@ static void SCR_DrawLoadingStack(void)
 }
 
 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)
 {
@@ -2488,59 +2531,103 @@ 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)
@@ -2654,6 +2741,11 @@ void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup)
        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;
diff --git a/cmd.c b/cmd.c
index d2369157273c4a0c7a794989e0c6a56999f69de1..5b68b6c9ef4f4640bf1172a094b2b24be52343b6 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -695,6 +695,30 @@ static void Cmd_Exec(cmd_state_t *cmd, const char *filename)
 "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"
index 090f097088e0a471390597b82cff9befd0bd3b6c..8be0e0dd60ba9f5c172ce7c69525a884ae54624d 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1480,6 +1480,7 @@ static const gamemode_info_t gamemode_info [GAME_COUNT] =
 { 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);
index a490ede2da9defb52d2b2cfde3b1dd6f74c4a771..44f49a1fd5978f10247bbd2def03cbd09b2d0716 100644 (file)
--- a/common.h
+++ b/common.h
@@ -298,6 +298,7 @@ typedef enum gamemode_e
        GAME_STRAPBOMB, // added by motorsep for Urre
        GAME_MOONHELM,
        GAME_VORETOURNAMENT,
+       GAME_WRATH,
        GAME_COUNT
 }
 gamemode_t;
diff --git a/draw.h b/draw.h
index abc520da4e904f56b4995471b492617fa7bcd7b7..bbb5009c5b28ecc7bd1e19c5c2923e6e9e5b8c7d 100644 (file)
--- a/draw.h
+++ b/draw.h
@@ -47,6 +47,7 @@ cachepic_t *Draw_CachePic (const char *path); // standard function with no optio
 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
index e488e2af0640df07d8ee0386de2fac6dd5655d93..c62a297e5eb93dbb36bbe79f231b7785621db265 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -323,6 +323,17 @@ void Draw_FreePic(const char *picname)
        }
 }
 
+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)
index bcf349dc7b9f953eef5efa8ef523c08e9a695b2c..3c26c1b62145e69a6924a9605164a6da617e6713 100644 (file)
@@ -382,6 +382,8 @@ static void Host_Map_f(cmd_state_t *cmd)
                return;
        }
 
+       SCR_SetLoadingSplash(NULL); // clear splash
+
        // GAME_DELUXEQUAKE - clear warpmark (used by QC)
        if (gamemode == GAME_DELUXEQUAKE)
                Cvar_Set(&cvars_all, "warpmark", "");
@@ -435,6 +437,8 @@ static void Host_Changelevel_f(cmd_state_t *cmd)
                return;
        }
 
+       SCR_SetLoadingSplash(NULL); // clear splash
+
 #ifdef CONFIG_MENU
        // remove menu
        if (key_dest == key_menu || key_dest == key_menu_grabbed)
@@ -471,6 +475,8 @@ static void Host_Restart_f(cmd_state_t *cmd)
                return;
        }
 
+       SCR_SetLoadingSplash(NULL); // clear splash
+
 #ifdef CONFIG_MENU
        // remove menu
        if (key_dest == key_menu || key_dest == key_menu_grabbed)
@@ -801,6 +807,8 @@ static void Host_Loadgame_f(cmd_state_t *cmd)
                return;
        }
 
+       SCR_SetLoadingSplash(NULL); // clear splash
+
        strlcpy (filename, Cmd_Argv(cmd, 1), sizeof(filename));
        FS_DefaultExtension (filename, ".sav", sizeof (filename));
 
diff --git a/keys.c b/keys.c
index cb050819eabeb8a641b38922bdf3f1747b7e5aa4..65d2325469d82cc49a87ec0c1a685ffe986199fd 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -1795,10 +1795,22 @@ Key_Event (int key, int ascii, qboolean down)
        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);
diff --git a/menu.c b/menu.c
index 25fd8acb816e049f6362d08be9c8855d658129d3..25e29979d85ea5edcd8086ff1cfc71f1ed03bb1b 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -2451,6 +2451,36 @@ static const char *goodvsbad2bindnames[][2] =
 {"+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];
 
@@ -2564,6 +2594,11 @@ void M_Menu_Keys_f(cmd_state_t *cmd)
                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]);
index 55b0e3f0a0c0786cf9fb0f281d706c1baad533a4..268c55d64487d6cc15c961e3ee001ebb8181d528 100644 (file)
--- a/screen.h
+++ b/screen.h
@@ -26,6 +26,8 @@ void CL_Screen_Init (void);
 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);
 
@@ -38,6 +40,9 @@ void SCR_PushLoadingScreen (const char *msg, float len_in_parent);
 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;
@@ -64,6 +69,8 @@ extern cvar_t scr_conscroll3_y;
 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;
 
index 8ac96a112211392dbb7e15bd9f780dc529e2c0cb..7dceb7df63f823fc087ba1c00f89bd5a11a9fb5d 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -3314,6 +3314,7 @@ void SV_SpawnServer (const char *server)
 
        if (cls.state != ca_dedicated)
        {
+               SCR_SetLoadingSplash(NULL); // clear splash
                SCR_BeginLoadingPlaque(false);
                S_StopAllSounds();
        }
index ec7eba1154d9424fdf48075365dd8abe49e0ae04..11fd8403033ee32b098e2add8c129822c77f5a43 100644 (file)
@@ -1432,6 +1432,12 @@ static int VID_Mode(int fullscreen, int width, int height, int bpp, float refres
                        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
@@ -1465,6 +1471,7 @@ void VID_Restart_f(cmd_state_t *cmd)
 
        if (!vid_opened)
        {
+               SCR_SetLoadingSplash(NULL);     
                SCR_BeginLoadingPlaque(false);
                return;
        }