projects
/
xonotic
/
xonotic-data.pk3dir.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d78465c
)
Menu: avoid loading font twice on resolution switch; avoid extra r_restart on resolut...
author
Rudolf Polzer <divverent@xonotic.org>
Sun, 13 Oct 2013 14:23:50 +0000
(16:23 +0200)
committer
Rudolf Polzer <divverent@xonotic.org>
Sun, 13 Oct 2013 14:30:40 +0000
(16:30 +0200)
qcsrc/menu/command/menu_cmd.qc
patch
|
blob
|
history
qcsrc/menu/menu.qc
patch
|
blob
|
history
qcsrc/menu/xonotic/dialog_settings_video.c
patch
|
blob
|
history
qcsrc/menu/xonotic/slider_resolution.c
patch
|
blob
|
history
diff --git
a/qcsrc/menu/command/menu_cmd.qc
b/qcsrc/menu/command/menu_cmd.qc
index
2c0b1ed
..
c7499e5
100644
(file)
--- a/
qcsrc/menu/command/menu_cmd.qc
+++ b/
qcsrc/menu/command/menu_cmd.qc
@@
-51,6
+51,12
@@
void GameCommand(string theCommand)
return;
}
return;
}
+ if(argv(0) == "update_conwidths_before_vid_restart")
+ {
+ updateConwidths(cvar("vid_width"), cvar("vid_height"), cvar("vid_pixelheight"));
+ return;
+ }
+
if(argv(0) == "directmenu" || argv(0) == "directpanelhudmenu")
{
string filter = string_null;
if(argv(0) == "directmenu" || argv(0) == "directpanelhudmenu")
{
string filter = string_null;
diff --git
a/qcsrc/menu/menu.qc
b/qcsrc/menu/menu.qc
index
433b842
..
0f2a525
100644
(file)
--- a/
qcsrc/menu/menu.qc
+++ b/
qcsrc/menu/menu.qc
@@
-108,7
+108,8
@@
void UpdateConWidthHeight(float w, float h, float p)
{
if (w != vidwidth_s || h != vidheight_s || p != vidpixelheight_s)
{
{
if (w != vidwidth_s || h != vidheight_s || p != vidpixelheight_s)
{
- updateConwidths(w, h, p);
+ if (updateConwidths(w, h, p))
+ localcmd(sprintf("\nexec %s\n", cvar_string("menu_font_cfg")));
vidwidth_s = w;
vidheight_s = h;
vidpixelheight_s = p;
vidwidth_s = w;
vidheight_s = h;
vidpixelheight_s = p;
diff --git
a/qcsrc/menu/xonotic/dialog_settings_video.c
b/qcsrc/menu/xonotic/dialog_settings_video.c
index
8d9f219
..
076dd23
100644
(file)
--- a/
qcsrc/menu/xonotic/dialog_settings_video.c
+++ b/
qcsrc/menu/xonotic/dialog_settings_video.c
@@
-140,6
+140,6
@@
void XonoticVideoSettingsTab_fill(entity me)
}
me.gotoRC(me, me.rows - 1, 0);
}
me.gotoRC(me, me.rows - 1, 0);
- me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_width $_menu_vid_width; vid_height $_menu_vid_height; vid_pixelheight $_menu_vid_pixelheight; vid_desktopfullscreen $_menu_vid_desktopfullscreen;
vid_restart; menu_restart; menu_cmd videosettings
", COMMANDBUTTON_APPLY));
+ me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_width $_menu_vid_width; vid_height $_menu_vid_height; vid_pixelheight $_menu_vid_pixelheight; vid_desktopfullscreen $_menu_vid_desktopfullscreen;
menu_cmd update_conwidths_before_vid_restart; vid_restart; menu_cmd sync
", COMMANDBUTTON_APPLY));
}
#endif
}
#endif
diff --git
a/qcsrc/menu/xonotic/slider_resolution.c
b/qcsrc/menu/xonotic/slider_resolution.c
index
5914e9a
..
66f48f9
100644
(file)
--- a/
qcsrc/menu/xonotic/slider_resolution.c
+++ b/
qcsrc/menu/xonotic/slider_resolution.c
@@
-9,7
+9,7
@@
CLASS(XonoticResolutionSlider) EXTENDS(XonoticTextSlider)
ATTRIB(XonoticResolutionSlider, vid_fullscreen, float, -1)
ENDCLASS(XonoticResolutionSlider)
entity makeXonoticResolutionSlider();
ATTRIB(XonoticResolutionSlider, vid_fullscreen, float, -1)
ENDCLASS(XonoticResolutionSlider)
entity makeXonoticResolutionSlider();
-
void
updateConwidths(float width, float height, float pixelheight);
+
float
updateConwidths(float width, float height, float pixelheight);
#endif
#ifdef IMPLEMENTATION
#endif
#ifdef IMPLEMENTATION
@@
-17,12
+17,16
@@
void updateConwidths(float width, float height, float pixelheight);
/* private static */ float XonoticResolutionSlider_DataHasChanged;
// Updates cvars (to be called by menu.qc at startup or on detected res change)
/* private static */ float XonoticResolutionSlider_DataHasChanged;
// Updates cvars (to be called by menu.qc at startup or on detected res change)
-
void
updateConwidths(float width, float height, float pixelheight)
+
float
updateConwidths(float width, float height, float pixelheight)
{
vector r, c;
float minfactor, maxfactor;
float sz, f;
{
vector r, c;
float minfactor, maxfactor;
float sz, f;
+ sz = cvar("menu_vid_scale");
+ if (sz < -1)
+ return 0; // No recalculation.
+
// Save off current settings.
cvar_set("_menu_vid_width", ftos(width));
cvar_set("_menu_vid_height", ftos(height));
// Save off current settings.
cvar_set("_menu_vid_width", ftos(width));
cvar_set("_menu_vid_height", ftos(height));
@@
-32,7
+36,6
@@
void updateConwidths(float width, float height, float pixelheight)
r_x = width;
r_y = height;
r_z = pixelheight;
r_x = width;
r_y = height;
r_z = pixelheight;
- sz = cvar("menu_vid_scale");
// calculate the base resolution
c_z = 0;
// calculate the base resolution
c_z = 0;
@@
-64,14
+67,16
@@
void updateConwidths(float width, float height, float pixelheight)
c_x = rint(c_x);
c_y = rint(c_y);
c_x = rint(c_x);
c_y = rint(c_y);
+ // Please reload resolutions list and such stuff.
+ XonoticResolutionSlider_DataHasChanged = TRUE;
+
if (c_x != cvar("vid_conwidth") || c_y != cvar("vid_conheight"))
{
cvar_set("vid_conwidth", ftos(c_x));
cvar_set("vid_conheight", ftos(c_y));
if (c_x != cvar("vid_conwidth") || c_y != cvar("vid_conheight"))
{
cvar_set("vid_conwidth", ftos(c_x));
cvar_set("vid_conheight", ftos(c_y));
-
localcmd("\nr_restart\n")
;
+
return 1
;
}
}
-
- XonoticResolutionSlider_DataHasChanged = TRUE;
+ return 0;
}
entity makeXonoticResolutionSlider()
{
}
entity makeXonoticResolutionSlider()
{