//=============================================================================
/* 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 },
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)
{
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)
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);
}
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)