]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - menu.c
fix errors and warnings in MSVC when compiling as C++
[xonotic/darkplaces.git] / menu.c
diff --git a/menu.c b/menu.c
index 522b97bb3abcae825a936e37a457cd5f4512e4b2..ed17203c2a9b6d20fb5ef770d71fea4b70d596cd 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -2729,7 +2729,7 @@ static void M_Reset_Draw (void)
 //=============================================================================
 /* VIDEO MENU */
 
-static video_resolution_t video_resolutions_hardcoded[] =
+video_resolution_t video_resolutions_hardcoded[] =
 {
 {"Standard 4x3"              ,  320, 240, 320, 240, 1     },
 {"Standard 4x3"              ,  400, 300, 400, 300, 1     },
@@ -2800,9 +2800,9 @@ static int menu_video_resolution;
 video_resolution_t *video_resolutions;
 int video_resolutions_count;
 
-video_resolution_t *menu_video_resolutions;
-int menu_video_resolutions_count;
-qboolean menu_video_resolutions_forfullscreen;
+static video_resolution_t *menu_video_resolutions;
+static int menu_video_resolutions_count;
+static qboolean menu_video_resolutions_forfullscreen;
 
 static void M_Menu_Video_FindResolution(int w, int h, float a)
 {
@@ -2824,19 +2824,19 @@ static void M_Menu_Video_FindResolution(int w, int h, float a)
        for (i = 1;i < menu_video_resolutions_count;i++)
        {
                // if the new mode would be a worse match in width, skip it
-               if (fabs(menu_video_resolutions[i].width - w) > fabs(menu_video_resolutions[menu_video_resolution].width - w))
+               if (abs(menu_video_resolutions[i].width - w) > abs(menu_video_resolutions[menu_video_resolution].width - w))
                        continue;
                // if it is equal in width, check height
                if (menu_video_resolutions[i].width == w && menu_video_resolutions[menu_video_resolution].width == w)
                {
                        // if the new mode would be a worse match in height, skip it
-                       if (fabs(menu_video_resolutions[i].height - h) > fabs(menu_video_resolutions[menu_video_resolution].height - h))
+                       if (abs(menu_video_resolutions[i].height - h) > abs(menu_video_resolutions[menu_video_resolution].height - h))
                                continue;
                        // if it is equal in width and height, check pixel aspect
                        if (menu_video_resolutions[i].height == h && menu_video_resolutions[menu_video_resolution].height == h)
                        {
                                // if the new mode would be a worse match in pixel aspect, skip it
-                               if (fabs(menu_video_resolutions[i].pixelheight - a) > fabs(menu_video_resolutions[menu_video_resolution].pixelheight - a))
+                               if (abs(menu_video_resolutions[i].pixelheight - a) > abs(menu_video_resolutions[menu_video_resolution].pixelheight - a))
                                        continue;
                                // if it is equal in everything, skip it (prefer earlier modes)
                                if (menu_video_resolutions[i].pixelheight == a && menu_video_resolutions[menu_video_resolution].pixelheight == a)
@@ -5377,7 +5377,7 @@ void MR_Init(void)
                        }
                        if(video_resolutions[i].conwidth > video_resolutions[i].width || video_resolutions[i].conheight > video_resolutions[i].height)
                        {
-                               double f1, f2;
+                               int f1, f2;
                                f1 = video_resolutions[i].conwidth > video_resolutions[i].width;
                                f2 = video_resolutions[i].conheight > video_resolutions[i].height;
                                if(f1 > f2)