*/
#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_BuildTranslationTable (menuplyr_top*16, menuplyr_bottom*16);
for (i = 0;i < menuplyr_width * menuplyr_height;i++)
- trans[i] = d_8to24table[translation[pixels[i]]];
+ trans[i] = palette_complete[translation[pixels[i]]];
Draw_NewPic("gfx/menuplyr.lmp", menuplyr_width, menuplyr_height, true, (qbyte *)trans);
}
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 ();
{
{"+forward", "walk forward"},
{"+back", "backpedal"},
+{"+left", "turn left"},
+{"+right", "turn right"},
{"+moveleft", "step left"},
{"+moveright", "step right"},
{"+jump", "jump / swim up"},
//=============================================================================
/* VIDEO MENU */
+#define VIDEO_ITEMS 5
+
+int video_cursor = 0;
+int video_cursor_table[] = {56, 68, 80, 92, 116};
+// note: if modes are added to the beginning of this list, update the
+// video_resolution = x; in M_Menu_Video_f below
+unsigned short video_resolutions[][2] = {{320,240}, {400,300}, {512,384}, {640,480}, {800,600}, {1024,768}, {1152,864}, {1280,960}, {1280,1024}, {1600,1200}, {1792,1344}, {1920,1440}, {2048,1536}};
+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]))
+ {
+ // may need to update this number if mode list changes
+ video_resolution = 4;
+ 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;
+ }
}
//=============================================================================
int m_quit_prevstate;
qboolean wasInMenus;
-char *quitMessage [] =
+char *quitMessage [] =
{
/* .........1.........2.... */
/*
" big loser in life. ",
" Press N to stay proud ",
" and successful! ",
-
+
" If you press Y to ",
" quit, I will summon ",
" Satan all over your ",
" hard drive! ",
-
+
" Um, Asmodeus dislikes ",
" his children trying to ",
" quit. Press Y to return",
{"e1m1", "Cradle to Grave"},
{"e1m2", "Wrong Side of the Tracks"},
{"e1m7", "Altar of Stone"},
+ {"e2m8", "The Lair of Shial"},
+ {"e3m7", "The Pit of Cerberus"},
+ {"e4m8", "The Hall of the Epiphany"},
+ {"e4m9", "Mall of the Dead"},
{"dm1", "Monolith Building 11"},
{"dm2", "Power!"},
{"dm3", "Area 15"},
+ {"e6m1", "Welcome to Your Life"},
{"e6m8", "Beauty and the Beast"},
{"cpbb01", "Crypt of Despair"},
{"dranzbb6", "Black Coffee"},
{"fragm", "Frag'M"},
+ {"maim", "Maim"},
{"qe1m7", "The House of Chthon"},
{"simple", "Dead Simple"}
};
episode_t transfusionepisodes[] =
{
{"Blood", 0, 8},
- {"Blood Single Player", 8, 3},
- {"Plasma Pack", 11, 4},
- {"Cryptic Passage", 15, 2},
- {"Blood 2", 17, 5},
- {"Transfusion", 22, 6},
- {"Conversions", 28, 4}
+ {"Blood Single Player", 8, 7},
+ {"Plasma Pack", 15, 5},
+ {"Cryptic Passage", 20, 2},
+ {"Blood 2", 22, 5},
+ {"Transfusion", 27, 6},
+ {"Conversions", 33, 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
{