#include "quakedef.h"
#include "image.h"
-void (*vid_menudrawfn)(void);
-void (*vid_menukeyfn)(int key);
#define TYPE_DEMO 1
#define TYPE_GAME 2
DrawQ_String(menu_x + cx, menu_y + cy, temp, 1, 8, 8, 1, 1, 1, 1, 0);
}
-void M_Print (float cx, float cy, char *str)
+void M_Print (float cx, float cy, const char *str)
{
DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0);
}
M_Print(16, y, " Customize controls");y += 8;
M_Print(16, y, " Go to console");y += 8;
M_Print(16, y, " Reset to defaults");y += 8;
- M_ItemPrint(16, y, " Video Options", vid_menudrawfn != NULL);y += 8;
+ M_Print(16, y, " Video Options");y += 8;
M_Print(16, y, " Effects Options");y += 8;
M_Print(16, y, " 2D Resolution");M_DrawSlider(220, y, scr_2dresolution.value);y += 8;
M_Print(16, y, " Screen size");M_DrawSlider(220, y, (scr_viewsize.value - 30) /(120 - 30));y += 8;
Cbuf_AddText ("exec default.cfg\n");
break;
case 3:
- if (vid_menudrawfn)
- M_Menu_Video_f ();
+ M_Menu_Video_f ();
break;
case 4:
M_Menu_Options_Effects_f ();
//=============================================================================
/* VIDEO MENU */
+#define VIDEO_ITEMS 5
+
+int video_cursor = 0;
+int video_cursor_table[] = {56, 68, 80, 92, 116};
+unsigned short video_resolutions[][2] = {{512,384}, {640,480}, {800,600}, {1024,768}, {1280,960}};
+int video_resolution;
+
+extern int current_vid_fullscreen;
+extern int current_vid_width;
+extern int current_vid_height;
+extern int current_vid_bitsperpixel;
+extern int current_vid_stencil;
+
+
void M_Menu_Video_f (void)
{
key_dest = key_menu;
m_state = m_video;
m_entersound = true;
+
+ // Look for the current resolution
+ for (video_resolution = 0; video_resolution < (int) (sizeof (video_resolutions) / sizeof (video_resolutions[0])); video_resolution++)
+ {
+ if (video_resolutions[video_resolution][0] == current_vid_width &&
+ video_resolutions[video_resolution][1] == current_vid_height)
+ break;
+ }
+
+ // Default to 800x600 if we didn't find it
+ if (video_resolution == sizeof (video_resolutions) / sizeof (video_resolutions[0]))
+ {
+ video_resolution = 2;
+ Cvar_SetValueQuick (&vid_width, video_resolutions[video_resolution][0]);
+ Cvar_SetValueQuick (&vid_height, video_resolutions[video_resolution][1]);
+ }
}
void M_Video_Draw (void)
{
- (*vid_menudrawfn) ();
+ cachepic_t *p;
+ const char* string;
+
+ M_DrawPic(16, 4, "gfx/qplaque.lmp");
+ p = Draw_CachePic("gfx/vidmodes.lmp");
+ M_DrawPic((320-p->width)/2, 4, "gfx/vidmodes.lmp");
+
+ // Resolution
+ M_Print(16, video_cursor_table[0], " Resolution");
+ string = va("%dx%d", video_resolutions[video_resolution][0], video_resolutions[video_resolution][1]);
+ M_Print (220, video_cursor_table[0], string);
+
+ // Bits per pixel
+ M_Print(16, video_cursor_table[1], " Bits per pixel");
+ M_Print (220, video_cursor_table[1], (vid_bitsperpixel.integer == 32) ? "32" : "16");
+
+ // Fullscreen
+ M_Print(16, video_cursor_table[2], " Fullscreen");
+ M_DrawCheckbox(220, video_cursor_table[2], vid_fullscreen.integer);
+
+ // Stencil
+ M_Print(16, video_cursor_table[3], " Stencil");
+ M_DrawCheckbox(220, video_cursor_table[3], vid_stencil.integer);
+
+ // "Apply" button
+ M_Print(220, video_cursor_table[4], "Apply");
+
+ // Cursor
+ M_DrawCharacter(200, video_cursor_table[video_cursor], 12+((int)(realtime*4)&1));
+}
+
+
+void M_Menu_Video_AdjustSliders (int dir)
+{
+ S_LocalSound ("misc/menu3.wav");
+
+ switch (video_cursor)
+ {
+ // Resolution
+ case 0:
+ {
+ int new_resolution = video_resolution + dir;
+ if (new_resolution < 0)
+ video_resolution = sizeof (video_resolutions) / sizeof (video_resolutions[0]) - 1;
+ else if (new_resolution > (int) (sizeof (video_resolutions) / sizeof (video_resolutions[0]) - 1))
+ video_resolution = 0;
+ else
+ video_resolution = new_resolution;
+
+ Cvar_SetValueQuick (&vid_width, video_resolutions[video_resolution][0]);
+ Cvar_SetValueQuick (&vid_height, video_resolutions[video_resolution][1]);
+ break;
+ }
+
+ // Bits per pixel
+ case 1:
+ Cvar_SetValueQuick (&vid_bitsperpixel, (vid_bitsperpixel.integer == 32) ? 16 : 32);
+ break;
+ case 2:
+ Cvar_SetValueQuick (&vid_fullscreen, !vid_fullscreen.integer);
+ break;
+ case 3:
+ Cvar_SetValueQuick (&vid_stencil, !vid_stencil.integer);
+ break;
+ }
}
void M_Video_Key (int key)
{
- (*vid_menukeyfn) (key);
+ switch (key)
+ {
+ case K_ESCAPE:
+ // vid_shared.c has a copy of the current video config. We restore it
+ Cvar_SetValueQuick(&vid_fullscreen, current_vid_fullscreen);
+ Cvar_SetValueQuick(&vid_width, current_vid_width);
+ Cvar_SetValueQuick(&vid_height, current_vid_height);
+ Cvar_SetValueQuick(&vid_bitsperpixel, current_vid_bitsperpixel);
+ Cvar_SetValueQuick(&vid_stencil, current_vid_stencil);
+
+ S_LocalSound ("misc/menu1.wav");
+ M_Menu_Options_f ();
+ break;
+
+ case K_ENTER:
+ m_entersound = true;
+ switch (video_cursor)
+ {
+ case 4:
+ Cbuf_AddText ("vid_restart\n");
+ M_Menu_Options_f ();
+ break;
+ default:
+ M_Menu_Video_AdjustSliders (1);
+ }
+ break;
+
+ case K_UPARROW:
+ S_LocalSound ("misc/menu1.wav");
+ video_cursor--;
+ if (video_cursor < 0)
+ video_cursor = VIDEO_ITEMS-1;
+ break;
+
+ case K_DOWNARROW:
+ S_LocalSound ("misc/menu1.wav");
+ video_cursor++;
+ if (video_cursor >= VIDEO_ITEMS)
+ video_cursor = 0;
+ break;
+
+ case K_LEFTARROW:
+ M_Menu_Video_AdjustSliders (-1);
+ break;
+
+ case K_RIGHTARROW:
+ M_Menu_Video_AdjustSliders (1);
+ break;
+ }
}
//=============================================================================
{"e1m1", "Cradle to Grave"},
{"e1m2", "Wrong Side of the Tracks"},
{"e1m7", "Altar of Stone"},
- {"e4m8", "The Hall Of Epiphany"},
+ {"e3m7", "The Pit of Cerberus"},
+ {"e4m8", "The Hall of the Epiphany"},
{"dm1", "Monolith Building 11"},
{"dm2", "Power!"},
episode_t transfusionepisodes[] =
{
{"Blood", 0, 8},
- {"Blood Single Player", 8, 4},
- {"Plasma Pack", 12, 4},
- {"Cryptic Passage", 16, 2},
- {"Blood 2", 18, 5},
- {"Transfusion", 23, 6},
- {"Conversions", 29, 5}
+ {"Blood Single Player", 8, 5},
+ {"Plasma Pack", 13, 4},
+ {"Cryptic Passage", 17, 2},
+ {"Blood 2", 19, 5},
+ {"Transfusion", 24, 6},
+ {"Conversions", 30, 5}
};
gamelevels_t sharewarequakegame = {"Shareware Quake", quakelevels, quakeepisodes, 2};
M_Print (x, 146, " More than 64 players?? ");
M_Print (x, 154, " First, question your ");
M_Print (x, 162, " sanity, then email ");
- M_Print (x, 170, " havoc@inside3d.com ");
+ M_Print (x, 170, " havoc@telefragged.com ");
}
else
{