]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/menu.qc
Merge branch 'master' into divVerent/desktopfullscreen
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / menu.qc
index 1afc9f85d935c3e5958a31ba9cdd206fbf56afc0..fd4fced57db0aa0d2a1a3c6fb2f970def7baf1b9 100644 (file)
@@ -93,7 +93,8 @@ void m_init()
 
 const float MENU_ASPECT = 1.25; // 1280x1024
 const float MENU_MINHEIGHT = 600;
-float conwidth_s, conheight_s, realconwidth, realconheight, screenconwidth, screenconheight;
+float conwidth_s, conheight_s, vidwidth_s, vidheight_s, realconwidth,
+      realconheight, screenconwidth, screenconheight;
 void draw_reset_cropped()
 {
        draw_reset(screenconwidth, screenconheight, 0.5 * (realconwidth - screenconwidth), 0.5 * (realconheight - screenconheight));
@@ -102,8 +103,16 @@ void draw_reset_full()
 {
        draw_reset(realconwidth, realconheight, 0, 0);
 }
-void UpdateConWidthHeight()
+
+void UpdateConWidthHeight(float w, float h)
 {
+       if (w != vidwidth_s || h != vidheight_s)
+       {
+               initConwidths(w, h);
+               updateConwidths();
+               vidwidth_s = w;
+               vidheight_s = h;
+       }
        conwidth_s = conwidth;
        conheight_s = conheight;
        realconwidth = cvar("vid_conwidth");
@@ -149,7 +158,7 @@ void m_init_delayed()
        string s;
 
        conwidth = conheight = -1;
-       UpdateConWidthHeight();
+       UpdateConWidthHeight(cvar("vid_width"), cvar("vid_height"));
        draw_reset_cropped();
 
        menuInitialized = 0;
@@ -671,7 +680,7 @@ void m_tooltip(vector pos)
        }
 }
 
-void m_draw()
+void m_draw(float width, float height)
 {
        float t;
        float realFrametime;
@@ -686,7 +695,13 @@ void m_draw()
                anim.tickAll(anim);
 
        if(main)
-               UpdateConWidthHeight();
+       {
+#ifdef COMPAT_XON070_OLD_M_DRAW
+               UpdateConWidthHeight(width ? width : cvar("vid_width"), height ? height : cvar("vid_height"));
+#else
+               UpdateConWidthHeight(width, height);
+#endif
+       }
 
        if(!menuInitialized)
        {