]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - menu.c
fix two pointer bugs in ODE code
[xonotic/darkplaces.git] / menu.c
diff --git a/menu.c b/menu.c
index 97f37360405b8f3a916b25ff4796f32202c6db05..06d164d098dd262026878f08d604bf5b1503a8a9 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     },
@@ -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)
@@ -5185,6 +5185,7 @@ void MP_Init (void)
        prog->init_cmd = VM_M_Cmd_Init;
        prog->reset_cmd = VM_M_Cmd_Reset;
        prog->error_cmd = MP_Error;
+       prog->ExecuteProgram = MVM_ExecuteProgram;
 
        // allocate the mempools
        prog->progs_mempool = Mem_AllocPool(M_PROG_FILENAME, 0, NULL);
@@ -5377,7 +5378,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)