mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-24 21:12:27 +00:00
it was decided the menu code should return until release. here it is with the
gettimeofday -> Sys_DoubleTime change (though I'm having some operational issues (non-critial) with the server list).
This commit is contained in:
parent
005dbaa83f
commit
c71fc78360
21 changed files with 2315 additions and 9 deletions
|
@ -36,6 +36,10 @@
|
||||||
typedef struct server_entry_s {
|
typedef struct server_entry_s {
|
||||||
char *server;
|
char *server;
|
||||||
char *desc;
|
char *desc;
|
||||||
|
char *status;
|
||||||
|
int waitstatus;
|
||||||
|
double pingsent;
|
||||||
|
double pongback;
|
||||||
struct server_entry_s *next;
|
struct server_entry_s *next;
|
||||||
struct server_entry_s *prev;
|
struct server_entry_s *prev;
|
||||||
} server_entry_t;
|
} server_entry_t;
|
||||||
|
@ -58,5 +62,5 @@ void SL_Shutdown(server_entry_t *start);
|
||||||
char *gettokstart(char *str, int req, char delim);
|
char *gettokstart(char *str, int req, char delim);
|
||||||
int gettoklen(char *str, int req, char delim);
|
int gettoklen(char *str, int req, char delim);
|
||||||
|
|
||||||
void timepassed (struct timeval *time1, struct timeval *time2);
|
void timepassed (double time1, double *time2);
|
||||||
#endif // _CL_SLIST_H
|
#endif // _CL_SLIST_H
|
||||||
|
|
|
@ -161,7 +161,7 @@ typedef enum {
|
||||||
} keynum_t;
|
} keynum_t;
|
||||||
|
|
||||||
|
|
||||||
typedef enum {key_game, key_console, key_message} keydest_t;
|
typedef enum {key_game, key_console, key_message, key_menu} keydest_t;
|
||||||
|
|
||||||
extern keydest_t key_dest;
|
extern keydest_t key_dest;
|
||||||
extern char *keybindings[256];
|
extern char *keybindings[256];
|
||||||
|
|
|
@ -62,4 +62,17 @@ typedef int func_t;
|
||||||
typedef int string_t;
|
typedef int string_t;
|
||||||
typedef byte pixel_t;
|
typedef byte pixel_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
typedef enum {key_game, key_console, key_message, key_menu} keydest_t;
|
||||||
|
typedef enum { ALIAS_SINGLE=0, ALIAS_GROUP } aliasframetype_t;
|
||||||
|
typedef enum { ALIAS_SKIN_SINGLE=0, ALIAS_SKIN_GROUP } aliasskintype_t;
|
||||||
|
typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t;
|
||||||
|
typedef void (*builtin_t) (void);
|
||||||
|
typedef enum {touchessolid, drawnode, nodrawnode} solidstate_t;
|
||||||
|
typedef enum { ST_SYNC=0, ST_RAND } synctype_t;
|
||||||
|
typedef enum { SPR_SINGLE=0, SPR_GROUP } spriteframetype_t;
|
||||||
|
typedef enum {MS_WINDOWED, MS_FULLSCREEN, MS_FULLDIB, MS_UNINIT} modestate_t;
|
||||||
|
typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
|
||||||
|
*/
|
||||||
|
|
||||||
#endif // _QTYPES_H
|
#endif // _QTYPES_H
|
||||||
|
|
|
@ -162,7 +162,7 @@ endif
|
||||||
|
|
||||||
client_SOURCES= cl_cam.c cl_cmd.c cl_cvar.c cl_demo.c cl_ents.c cl_input.c \
|
client_SOURCES= cl_cam.c cl_cmd.c cl_cvar.c cl_demo.c cl_ents.c cl_input.c \
|
||||||
cl_main.c cl_misc.c cl_parse.c cl_pred.c cl_slist.c cl_tent.c \
|
cl_main.c cl_misc.c cl_parse.c cl_pred.c cl_slist.c cl_tent.c \
|
||||||
console.c keys.c model_alias.c model_sprite.c nonintel.c \
|
console.c keys.c menu.c model_alias.c model_sprite.c nonintel.c \
|
||||||
pcx.c r_view.c sbar.c skin.c teamplay.c tga.c wad.c vid.c $(client_ASM)
|
pcx.c r_view.c sbar.c skin.c teamplay.c tga.c wad.c vid.c $(client_ASM)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
#include "checksum.h"
|
#include "checksum.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
|
#include "menu.h"
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "buildnum.h"
|
#include "buildnum.h"
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
|
@ -94,6 +95,9 @@
|
||||||
|
|
||||||
void CL_RemoveQFInfoKeys ();
|
void CL_RemoveQFInfoKeys ();
|
||||||
|
|
||||||
|
// we need to declare some mouse variables here, because the menu system
|
||||||
|
// references them even when on a unix system.
|
||||||
|
|
||||||
qboolean noclip_anglehack; // remnant from old quake
|
qboolean noclip_anglehack; // remnant from old quake
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,6 +215,10 @@ CL_Quit_f
|
||||||
void
|
void
|
||||||
CL_Quit_f (void)
|
CL_Quit_f (void)
|
||||||
{
|
{
|
||||||
|
if (confirm_quit->int_val) {
|
||||||
|
M_Menu_Quit_f ();
|
||||||
|
return;
|
||||||
|
}
|
||||||
CL_Disconnect ();
|
CL_Disconnect ();
|
||||||
Sys_Quit ();
|
Sys_Quit ();
|
||||||
}
|
}
|
||||||
|
@ -992,7 +1000,29 @@ CL_ConnectionlessPacket (void)
|
||||||
}
|
}
|
||||||
// print command from somewhere
|
// print command from somewhere
|
||||||
if (c == A2C_PRINT) {
|
if (c == A2C_PRINT) {
|
||||||
|
netadr_t addy;
|
||||||
|
server_entry_t *temp;
|
||||||
s = MSG_ReadString ();
|
s = MSG_ReadString ();
|
||||||
|
for (temp = slist; temp; temp = temp->next)
|
||||||
|
if (temp->waitstatus)
|
||||||
|
{
|
||||||
|
NET_StringToAdr (temp->server, &addy);
|
||||||
|
if (NET_CompareBaseAdr (net_from, addy))
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
temp->status = realloc(temp->status, strlen(s) + 1);
|
||||||
|
strcpy(temp->status, s);
|
||||||
|
temp->waitstatus = 0;
|
||||||
|
for (i = 0; i < strlen(temp->status); i++)
|
||||||
|
if (temp->status[i] == '\n')
|
||||||
|
{
|
||||||
|
temp->status[i] = '\\';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Con_Printf("status response\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
Con_Printf ("print\n");
|
Con_Printf ("print\n");
|
||||||
Con_Print (s);
|
Con_Print (s);
|
||||||
return;
|
return;
|
||||||
|
@ -1037,6 +1067,22 @@ CL_ConnectionlessPacket (void)
|
||||||
Con_Printf ("unknown: %c\n", c);
|
Con_Printf ("unknown: %c\n", c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CL_PingPacket (void)
|
||||||
|
{
|
||||||
|
server_entry_t *temp;
|
||||||
|
netadr_t addy;
|
||||||
|
MSG_ReadByte ();;
|
||||||
|
for (temp = slist; temp; temp = temp->next)
|
||||||
|
if (temp->pingsent && !temp->pongback) {
|
||||||
|
NET_StringToAdr (temp->server, &addy);
|
||||||
|
if (NET_CompareBaseAdr (net_from, addy)) {
|
||||||
|
temp->pongback = Sys_DoubleTime ();
|
||||||
|
timepassed(temp->pingsent, &temp->pongback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
CL_ReadPackets
|
CL_ReadPackets
|
||||||
|
@ -1054,6 +1100,11 @@ CL_ReadPackets (void)
|
||||||
CL_ConnectionlessPacket ();
|
CL_ConnectionlessPacket ();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (*(char *) net_message.data == A2A_ACK)
|
||||||
|
{
|
||||||
|
CL_PingPacket ();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (net_message.cursize < 8) {
|
if (net_message.cursize < 8) {
|
||||||
Con_Printf ("%s: Runt packet\n", NET_AdrToString (net_from));
|
Con_Printf ("%s: Runt packet\n", NET_AdrToString (net_from));
|
||||||
continue;
|
continue;
|
||||||
|
@ -1651,6 +1702,7 @@ Host_Init (void)
|
||||||
W_LoadWadFile ("gfx.wad");
|
W_LoadWadFile ("gfx.wad");
|
||||||
Key_Init ();
|
Key_Init ();
|
||||||
Con_Init ();
|
Con_Init ();
|
||||||
|
M_Init ();
|
||||||
Mod_Init ();
|
Mod_Init ();
|
||||||
|
|
||||||
// Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
|
// Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "cl_slist.h"
|
#include "cl_slist.h"
|
||||||
#include "bothdefs.h"
|
#include "bothdefs.h"
|
||||||
|
@ -94,6 +96,8 @@ SL_Del (server_entry_t *start, server_entry_t *del)
|
||||||
|
|
||||||
free (del->server);
|
free (del->server);
|
||||||
free (del->desc);
|
free (del->desc);
|
||||||
|
if (del->status)
|
||||||
|
free (del->status);
|
||||||
if (del->prev)
|
if (del->prev)
|
||||||
del->prev->next = del->next;
|
del->prev->next = del->next;
|
||||||
if (del->next)
|
if (del->next)
|
||||||
|
@ -246,6 +250,8 @@ SL_Del_All (server_entry_t *start)
|
||||||
n = start->next;
|
n = start->next;
|
||||||
free (start->server);
|
free (start->server);
|
||||||
free (start->desc);
|
free (start->desc);
|
||||||
|
if (start->status)
|
||||||
|
free (start->status);
|
||||||
free (start);
|
free (start);
|
||||||
start = n;
|
start = n;
|
||||||
}
|
}
|
||||||
|
@ -297,3 +303,8 @@ gettoklen (char *str, int req, char delim)
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void timepassed (double time1, double *time2)
|
||||||
|
{
|
||||||
|
*time2 -= time1;
|
||||||
|
}
|
||||||
|
|
|
@ -216,6 +216,8 @@ typedef struct cachepic_s {
|
||||||
static cachepic_t cachepics[MAX_CACHED_PICS];
|
static cachepic_t cachepics[MAX_CACHED_PICS];
|
||||||
static int numcachepics;
|
static int numcachepics;
|
||||||
|
|
||||||
|
static byte menuplyr_pixels[4096];
|
||||||
|
|
||||||
qpic_t *
|
qpic_t *
|
||||||
Draw_PicFromWad (char *name)
|
Draw_PicFromWad (char *name)
|
||||||
{
|
{
|
||||||
|
@ -287,7 +289,7 @@ Draw_CachePic (char *path)
|
||||||
|
|
||||||
// Its not cached, lets make sure we have space in the cache..
|
// Its not cached, lets make sure we have space in the cache..
|
||||||
if (numcachepics == MAX_CACHED_PICS)
|
if (numcachepics == MAX_CACHED_PICS)
|
||||||
Sys_Error ("numcachepics == MAX_CACHED_PICS");
|
Sys_Error ("menu_numcachepics == MAX_CACHED_PICS");
|
||||||
|
|
||||||
// Load the picture..
|
// Load the picture..
|
||||||
dat = (qpic_t *) COM_LoadTempFile (path);
|
dat = (qpic_t *) COM_LoadTempFile (path);
|
||||||
|
@ -320,6 +322,15 @@ Draw_CachePic (char *path)
|
||||||
pic->dirty = false;
|
pic->dirty = false;
|
||||||
numcachepics++;
|
numcachepics++;
|
||||||
|
|
||||||
|
// FIXME:
|
||||||
|
// A really ugly kluge, keep a specific image in memory
|
||||||
|
// for the menu system.
|
||||||
|
//
|
||||||
|
// Some days I really dislike legacy support..
|
||||||
|
|
||||||
|
if (!strcmp (path, "gfx/menuplyr.lmp"))
|
||||||
|
memcpy (menuplyr_pixels, dat->data, dat->width * dat->height);
|
||||||
|
|
||||||
// And now we are done, return what was asked for..
|
// And now we are done, return what was asked for..
|
||||||
return &pic->pic;
|
return &pic->pic;
|
||||||
}
|
}
|
||||||
|
@ -725,6 +736,61 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
|
||||||
glColor3ubv (lighthalf_v);
|
glColor3ubv (lighthalf_v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=============
|
||||||
|
Draw_TransPicTranslate
|
||||||
|
|
||||||
|
Only used for the player color selection menu
|
||||||
|
=============
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte * translation)
|
||||||
|
{
|
||||||
|
int v, u, c;
|
||||||
|
unsigned int trans[64 * 64], *dest;
|
||||||
|
byte *src;
|
||||||
|
int p;
|
||||||
|
|
||||||
|
glBindTexture (GL_TEXTURE_2D, translate_texture);
|
||||||
|
|
||||||
|
c = pic->width * pic->height;
|
||||||
|
|
||||||
|
dest = trans;
|
||||||
|
for (v = 0; v < 64; v++, dest += 64) {
|
||||||
|
src = &menuplyr_pixels[((v * pic->height) >> 6) * pic->width];
|
||||||
|
for (u = 0; u < 64; u++) {
|
||||||
|
p = src[(u * pic->width) >> 6];
|
||||||
|
if (p == 255)
|
||||||
|
dest[u] = p;
|
||||||
|
else
|
||||||
|
dest[u] = d_8to24table[translation[p]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 64, 64, 0, GL_RGBA,
|
||||||
|
GL_UNSIGNED_BYTE, trans);
|
||||||
|
|
||||||
|
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
|
||||||
|
if (lighthalf)
|
||||||
|
glColor3f (0.4, 0.4, 0.4);
|
||||||
|
else
|
||||||
|
glColor3f (0.8, 0.8, 0.8);
|
||||||
|
glBegin (GL_QUADS);
|
||||||
|
glTexCoord2f (0, 0);
|
||||||
|
glVertex2f (x, y);
|
||||||
|
glTexCoord2f (1, 0);
|
||||||
|
glVertex2f (x + pic->width, y);
|
||||||
|
glTexCoord2f (1, 1);
|
||||||
|
glVertex2f (x + pic->width, y + pic->height);
|
||||||
|
glTexCoord2f (0, 1);
|
||||||
|
glVertex2f (x, y + pic->height);
|
||||||
|
glEnd ();
|
||||||
|
glColor3ubv (lighthalf_v);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Draw_ConsoleBackground
|
Draw_ConsoleBackground
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "wad.h"
|
#include "wad.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
#include "cvar.h"
|
#include "cvar.h"
|
||||||
|
#include "menu.h"
|
||||||
#include "net.h" // needed by: client.h
|
#include "net.h" // needed by: client.h
|
||||||
#include "protocol.h" // needed by: client.h
|
#include "protocol.h" // needed by: client.h
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include "glquake.h"
|
#include "glquake.h"
|
||||||
#include "host.h"
|
#include "host.h"
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
|
#include "menu.h"
|
||||||
#include "pcx.h"
|
#include "pcx.h"
|
||||||
#include "qendian.h"
|
#include "qendian.h"
|
||||||
#include "sbar.h"
|
#include "sbar.h"
|
||||||
|
@ -59,6 +60,7 @@ notify lines
|
||||||
intermission / finale overlay
|
intermission / finale overlay
|
||||||
loading plaque
|
loading plaque
|
||||||
console
|
console
|
||||||
|
menu
|
||||||
|
|
||||||
required background clears
|
required background clears
|
||||||
required update regions
|
required update regions
|
||||||
|
@ -1014,6 +1016,7 @@ SCR_UpdateScreen (void)
|
||||||
SCR_CheckDrawCenterString ();
|
SCR_CheckDrawCenterString ();
|
||||||
Sbar_Draw ();
|
Sbar_Draw ();
|
||||||
SCR_DrawConsole ();
|
SCR_DrawConsole ();
|
||||||
|
M_Draw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// LordHavoc: adjustable brightness and contrast,
|
// LordHavoc: adjustable brightness and contrast,
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "joystick.h"
|
#include "joystick.h"
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
|
#include "menu.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "qargs.h"
|
#include "qargs.h"
|
||||||
#include "qendian.h"
|
#include "qendian.h"
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include "qtypes.h"
|
#include "qtypes.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
|
#include "menu.h"
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "cvar.h"
|
#include "cvar.h"
|
||||||
|
@ -69,8 +70,13 @@ keydest_t key_dest;
|
||||||
|
|
||||||
char *keybindings[256];
|
char *keybindings[256];
|
||||||
qboolean consolekeys[256]; // if true, can't be rebound while in
|
qboolean consolekeys[256]; // if true, can't be rebound while in
|
||||||
|
|
||||||
// console
|
// console
|
||||||
|
qboolean menubound[256]; // if true, can't be rebound while in
|
||||||
|
|
||||||
|
// menu
|
||||||
int keyshift[256]; // key to map to if shift held down
|
int keyshift[256]; // key to map to if shift held down
|
||||||
|
|
||||||
// in console
|
// in console
|
||||||
int key_repeats[256]; // if > 1, it is autorepeating
|
int key_repeats[256]; // if > 1, it is autorepeating
|
||||||
qboolean keydown[256];
|
qboolean keydown[256];
|
||||||
|
@ -738,6 +744,10 @@ Key_Init (void)
|
||||||
keyshift['`'] = '~';
|
keyshift['`'] = '~';
|
||||||
keyshift['\\'] = '|';
|
keyshift['\\'] = '|';
|
||||||
|
|
||||||
|
menubound[K_ESCAPE] = true;
|
||||||
|
for (i = 0; i < 12; i++)
|
||||||
|
menubound[K_F1 + i] = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
// register our functions
|
// register our functions
|
||||||
//
|
//
|
||||||
|
@ -813,9 +823,12 @@ Key_Event (int key, int alt_key, qboolean down)
|
||||||
case key_message:
|
case key_message:
|
||||||
Key_Message (key);
|
Key_Message (key);
|
||||||
break;
|
break;
|
||||||
|
case key_menu:
|
||||||
|
M_Keydown (key);
|
||||||
|
break;
|
||||||
case key_game:
|
case key_game:
|
||||||
case key_console:
|
case key_console:
|
||||||
Con_ToggleConsole_f ();
|
M_ToggleMenu_f ();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error ("Bad key_dest");
|
Sys_Error ("Bad key_dest");
|
||||||
|
@ -850,14 +863,14 @@ Key_Event (int key, int alt_key, qboolean down)
|
||||||
if (cls.demoplayback && down && consolekeys[key] && key_dest == key_game
|
if (cls.demoplayback && down && consolekeys[key] && key_dest == key_game
|
||||||
&& key != K_CTRL && key != K_DEL && key != K_HOME && key != K_END
|
&& key != K_CTRL && key != K_DEL && key != K_HOME && key != K_END
|
||||||
&& key != K_TAB) {
|
&& key != K_TAB) {
|
||||||
Con_ToggleConsole_f ();
|
M_ToggleMenu_f ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// if not a consolekey, send to the interpreter no matter what mode is
|
// if not a consolekey, send to the interpreter no matter what mode is
|
||||||
//
|
//
|
||||||
if ((key_dest == key_console && !consolekeys[key])
|
if ((key_dest == key_menu && menubound[key])
|
||||||
|
|| (key_dest == key_console && !consolekeys[key])
|
||||||
|| (key_dest == key_game
|
|| (key_dest == key_game
|
||||||
&& (cls.state == ca_active || !consolekeys[key]))) {
|
&& (cls.state == ca_active || !consolekeys[key]))) {
|
||||||
kb = keybindings[key];
|
kb = keybindings[key];
|
||||||
|
@ -886,6 +899,10 @@ Key_Event (int key, int alt_key, qboolean down)
|
||||||
case key_message:
|
case key_message:
|
||||||
Key_Message (key);
|
Key_Message (key);
|
||||||
break;
|
break;
|
||||||
|
case key_menu:
|
||||||
|
M_Keydown (key);
|
||||||
|
break;
|
||||||
|
|
||||||
case key_game:
|
case key_game:
|
||||||
case key_console:
|
case key_console:
|
||||||
Key_Console (key);
|
Key_Console (key);
|
||||||
|
|
1735
source/menu.c
Normal file
1735
source/menu.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -229,6 +229,7 @@ DEPEND = \
|
||||||
$(OBJS)\cl_slist.obj\
|
$(OBJS)\cl_slist.obj\
|
||||||
$(OBJS)\mathlib.obj\
|
$(OBJS)\mathlib.obj\
|
||||||
$(OBJS)\nonintel.obj\
|
$(OBJS)\nonintel.obj\
|
||||||
|
$(OBJS)\menu.obj\
|
||||||
$(OBJS)\keys.obj\
|
$(OBJS)\keys.obj\
|
||||||
$(OBJS)\console.obj\
|
$(OBJS)\console.obj\
|
||||||
$(OBJS)\wad.obj\
|
$(OBJS)\wad.obj\
|
||||||
|
@ -348,6 +349,7 @@ $(OBJS)\cl_sys_sdl.obj+
|
||||||
$(OBJS)\cl_slist.obj+
|
$(OBJS)\cl_slist.obj+
|
||||||
$(OBJS)\mathlib.obj+
|
$(OBJS)\mathlib.obj+
|
||||||
$(OBJS)\nonintel.obj+
|
$(OBJS)\nonintel.obj+
|
||||||
|
$(OBJS)\menu.obj+
|
||||||
$(OBJS)\keys.obj+
|
$(OBJS)\keys.obj+
|
||||||
$(OBJS)\console.obj+
|
$(OBJS)\console.obj+
|
||||||
$(OBJS)\wad.obj+
|
$(OBJS)\wad.obj+
|
||||||
|
@ -759,6 +761,11 @@ $(OBJS)\nonintel.obj : $(QFROOT)\source\nonintel.c
|
||||||
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\nonintel.c
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\nonintel.c
|
||||||
|
|
|
|
||||||
|
|
||||||
|
$(OBJS)\menu.obj : $(QFROOT)\source\menu.c
|
||||||
|
$(BCC32) -P- -c @&&|
|
||||||
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\menu.c
|
||||||
|
|
|
||||||
|
|
||||||
$(OBJS)\keys.obj : $(QFROOT)\source\keys.c
|
$(OBJS)\keys.obj : $(QFROOT)\source\keys.c
|
||||||
$(BCC32) -P- -c @&&|
|
$(BCC32) -P- -c @&&|
|
||||||
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\keys.c
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\keys.c
|
||||||
|
|
|
@ -213,6 +213,7 @@ DEPEND = \
|
||||||
$(OBJS)\cl_slist.obj\
|
$(OBJS)\cl_slist.obj\
|
||||||
$(OBJS)\mathlib.obj\
|
$(OBJS)\mathlib.obj\
|
||||||
$(OBJS)\nonintel.obj\
|
$(OBJS)\nonintel.obj\
|
||||||
|
$(OBJS)\menu.obj\
|
||||||
$(OBJS)\keys.obj\
|
$(OBJS)\keys.obj\
|
||||||
$(OBJS)\console.obj\
|
$(OBJS)\console.obj\
|
||||||
$(OBJS)\wad.obj\
|
$(OBJS)\wad.obj\
|
||||||
|
@ -310,6 +311,7 @@ $(OBJS)\cl_sys_sdl.obj+
|
||||||
$(OBJS)\cl_slist.obj+
|
$(OBJS)\cl_slist.obj+
|
||||||
$(OBJS)\mathlib.obj+
|
$(OBJS)\mathlib.obj+
|
||||||
$(OBJS)\nonintel.obj+
|
$(OBJS)\nonintel.obj+
|
||||||
|
$(OBJS)\menu.obj+
|
||||||
$(OBJS)\keys.obj+
|
$(OBJS)\keys.obj+
|
||||||
$(OBJS)\console.obj+
|
$(OBJS)\console.obj+
|
||||||
$(OBJS)\wad.obj+
|
$(OBJS)\wad.obj+
|
||||||
|
@ -678,6 +680,11 @@ $(OBJS)\nonintel.obj : $(QFROOT)\source\nonintel.c
|
||||||
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\nonintel.c
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\nonintel.c
|
||||||
|
|
|
|
||||||
|
|
||||||
|
$(OBJS)\menu.obj : $(QFROOT)\source\menu.c
|
||||||
|
$(BCC32) -P- -c @&&|
|
||||||
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\menu.c
|
||||||
|
|
|
||||||
|
|
||||||
$(OBJS)\keys.obj : $(QFROOT)\source\keys.c
|
$(OBJS)\keys.obj : $(QFROOT)\source\keys.c
|
||||||
$(BCC32) -P- -c @&&|
|
$(BCC32) -P- -c @&&|
|
||||||
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\keys.c
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\keys.c
|
||||||
|
|
|
@ -205,6 +205,7 @@ DEPEND = \
|
||||||
$(OBJS)\cl_slist.obj\
|
$(OBJS)\cl_slist.obj\
|
||||||
$(OBJS)\mathlib.obj\
|
$(OBJS)\mathlib.obj\
|
||||||
$(OBJS)\nonintel.obj\
|
$(OBJS)\nonintel.obj\
|
||||||
|
$(OBJS)\menu.obj\
|
||||||
$(OBJS)\keys.obj\
|
$(OBJS)\keys.obj\
|
||||||
$(OBJS)\console.obj\
|
$(OBJS)\console.obj\
|
||||||
$(OBJS)\wad.obj\
|
$(OBJS)\wad.obj\
|
||||||
|
@ -297,6 +298,7 @@ $(OBJS)\cl_sys_win.obj+
|
||||||
$(OBJS)\cl_slist.obj+
|
$(OBJS)\cl_slist.obj+
|
||||||
$(OBJS)\mathlib.obj+
|
$(OBJS)\mathlib.obj+
|
||||||
$(OBJS)\nonintel.obj+
|
$(OBJS)\nonintel.obj+
|
||||||
|
$(OBJS)\menu.obj+
|
||||||
$(OBJS)\keys.obj+
|
$(OBJS)\keys.obj+
|
||||||
$(OBJS)\console.obj+
|
$(OBJS)\console.obj+
|
||||||
$(OBJS)\wad.obj+
|
$(OBJS)\wad.obj+
|
||||||
|
@ -646,6 +648,11 @@ $(OBJS)\nonintel.obj : $(QFROOT)\source\nonintel.c
|
||||||
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\nonintel.c
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\nonintel.c
|
||||||
|
|
|
|
||||||
|
|
||||||
|
$(OBJS)\menu.obj : $(QFROOT)\source\menu.c
|
||||||
|
$(BCC32) -P- -c @&&|
|
||||||
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\menu.c
|
||||||
|
|
|
||||||
|
|
||||||
$(OBJS)\keys.obj : $(QFROOT)\source\keys.c
|
$(OBJS)\keys.obj : $(QFROOT)\source\keys.c
|
||||||
$(BCC32) -P- -c @&&|
|
$(BCC32) -P- -c @&&|
|
||||||
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\keys.c
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\keys.c
|
||||||
|
|
|
@ -227,6 +227,7 @@ DEPEND = \
|
||||||
$(OBJS)\cl_slist.obj\
|
$(OBJS)\cl_slist.obj\
|
||||||
$(OBJS)\mathlib.obj\
|
$(OBJS)\mathlib.obj\
|
||||||
$(OBJS)\nonintel.obj\
|
$(OBJS)\nonintel.obj\
|
||||||
|
$(OBJS)\menu.obj\
|
||||||
$(OBJS)\keys.obj\
|
$(OBJS)\keys.obj\
|
||||||
$(OBJS)\console.obj\
|
$(OBJS)\console.obj\
|
||||||
$(OBJS)\wad.obj\
|
$(OBJS)\wad.obj\
|
||||||
|
@ -343,6 +344,7 @@ $(OBJS)\cl_sys_win.obj+
|
||||||
$(OBJS)\cl_slist.obj+
|
$(OBJS)\cl_slist.obj+
|
||||||
$(OBJS)\mathlib.obj+
|
$(OBJS)\mathlib.obj+
|
||||||
$(OBJS)\nonintel.obj+
|
$(OBJS)\nonintel.obj+
|
||||||
|
$(OBJS)\menu.obj+
|
||||||
$(OBJS)\keys.obj+
|
$(OBJS)\keys.obj+
|
||||||
$(OBJS)\console.obj+
|
$(OBJS)\console.obj+
|
||||||
$(OBJS)\wad.obj+
|
$(OBJS)\wad.obj+
|
||||||
|
@ -741,6 +743,11 @@ $(OBJS)\nonintel.obj : $(QFROOT)\source\nonintel.c
|
||||||
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\nonintel.c
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\nonintel.c
|
||||||
|
|
|
|
||||||
|
|
||||||
|
$(OBJS)\menu.obj : $(QFROOT)\source\menu.c
|
||||||
|
$(BCC32) -P- -c @&&|
|
||||||
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\menu.c
|
||||||
|
|
|
||||||
|
|
||||||
$(OBJS)\keys.obj : $(QFROOT)\source\keys.c
|
$(OBJS)\keys.obj : $(QFROOT)\source\keys.c
|
||||||
$(BCC32) -P- -c @&&|
|
$(BCC32) -P- -c @&&|
|
||||||
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\keys.c
|
$(COMPOPTS) -I$(INCLUDES) -D$(DEFINES) -o$@ $(QFROOT)\source\keys.c
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include "sbar.h"
|
#include "sbar.h"
|
||||||
#include "r_local.h"
|
#include "r_local.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
|
#include "menu.h"
|
||||||
#include "cl_parse.h"
|
#include "cl_parse.h"
|
||||||
|
|
||||||
qboolean allowskybox; // whether or not to allow skyboxes
|
qboolean allowskybox; // whether or not to allow skyboxes
|
||||||
|
@ -251,7 +252,7 @@ R_NetGraph (void)
|
||||||
y = vid.height - sb_lines - 24 - r_graphheight->int_val * 2 - 2;
|
y = vid.height - sb_lines - 24 - r_graphheight->int_val * 2 - 2;
|
||||||
|
|
||||||
//M_DrawTextBox (x, y, (w + 7) / 8, (r_graphheight->int_val * 2 + 7) / 8 + 1);
|
//M_DrawTextBox (x, y, (w + 7) / 8, (r_graphheight->int_val * 2 + 7) / 8 + 1);
|
||||||
//M_DrawTextBox (x-w, y, (w+7)/8, (r_graphheight->int_val*2+7)/8+1);
|
M_DrawTextBox (x-w, y, (w+7)/8, (r_graphheight->int_val*2+7)/8+1);
|
||||||
y2 = y + 8;
|
y2 = y + 8;
|
||||||
y = vid.height - sb_lines - 8 - 2;
|
y = vid.height - sb_lines - 8 - 2;
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
#include "host.h"
|
#include "host.h"
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
|
#include "menu.h"
|
||||||
#include "pcx.h"
|
#include "pcx.h"
|
||||||
#include "qendian.h"
|
#include "qendian.h"
|
||||||
#include "sbar.h"
|
#include "sbar.h"
|
||||||
|
@ -59,6 +60,7 @@ notify lines
|
||||||
intermission / finale overlay
|
intermission / finale overlay
|
||||||
loading plaque
|
loading plaque
|
||||||
console
|
console
|
||||||
|
menu
|
||||||
|
|
||||||
required background clears
|
required background clears
|
||||||
required update regions
|
required update regions
|
||||||
|
@ -1005,6 +1007,7 @@ SCR_UpdateScreen (void)
|
||||||
SCR_CheckDrawCenterString ();
|
SCR_CheckDrawCenterString ();
|
||||||
Sbar_Draw ();
|
Sbar_Draw ();
|
||||||
SCR_DrawConsole ();
|
SCR_DrawConsole ();
|
||||||
|
M_Draw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
263
source/vid_mgl.c
263
source/vid_mgl.c
|
@ -54,6 +54,9 @@
|
||||||
#define MAX_MODE_LIST 30
|
#define MAX_MODE_LIST 30
|
||||||
#define VID_ROW_SIZE 3
|
#define VID_ROW_SIZE 3
|
||||||
|
|
||||||
|
extern void (*vid_menudrawfn) (void);
|
||||||
|
extern void (*vid_menukeyfn) (int);
|
||||||
|
|
||||||
/* Unused */
|
/* Unused */
|
||||||
int VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes, VGA_planar;
|
int VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes, VGA_planar;
|
||||||
byte *VGA_pagebase;
|
byte *VGA_pagebase;
|
||||||
|
@ -171,6 +174,9 @@ static vmode_t badmode;
|
||||||
|
|
||||||
static byte backingbuf[48 * 24];
|
static byte backingbuf[48 * 24];
|
||||||
|
|
||||||
|
void VID_MenuDraw (void);
|
||||||
|
void VID_MenuKey (int key);
|
||||||
|
|
||||||
LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
void AppActivate (BOOL fActive, BOOL minimize);
|
void AppActivate (BOOL fActive, BOOL minimize);
|
||||||
|
|
||||||
|
@ -2097,6 +2103,9 @@ VID_Init (unsigned char *palette)
|
||||||
|
|
||||||
VID_SetPalette (palette);
|
VID_SetPalette (palette);
|
||||||
|
|
||||||
|
vid_menudrawfn = VID_MenuDraw;
|
||||||
|
vid_menukeyfn = VID_MenuKey;
|
||||||
|
|
||||||
strcpy (badmode.modedesc, "Bad mode");
|
strcpy (badmode.modedesc, "Bad mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2954,6 +2963,7 @@ MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern void M_Menu_Options_f (void);
|
||||||
extern void M_Print (int cx, int cy, char *str);
|
extern void M_Print (int cx, int cy, char *str);
|
||||||
extern void M_PrintWhite (int cx, int cy, char *str);
|
extern void M_PrintWhite (int cx, int cy, char *str);
|
||||||
extern void M_DrawCharacter (int cx, int line, int num);
|
extern void M_DrawCharacter (int cx, int line, int num);
|
||||||
|
@ -2976,6 +2986,259 @@ typedef struct {
|
||||||
|
|
||||||
static modedesc_t modedescs[MAX_MODEDESCS];
|
static modedesc_t modedescs[MAX_MODEDESCS];
|
||||||
|
|
||||||
|
/*
|
||||||
|
================
|
||||||
|
VID_MenuDraw
|
||||||
|
================
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
VID_MenuDraw (void)
|
||||||
|
{
|
||||||
|
qpic_t *p;
|
||||||
|
char *ptr;
|
||||||
|
int lnummodes, i, j, k, column, row, dup, dupmode = 0;
|
||||||
|
char temp[100];
|
||||||
|
vmode_t *pv;
|
||||||
|
modedesc_t tmodedesc;
|
||||||
|
|
||||||
|
p = Draw_CachePic ("gfx/vidmodes.lmp");
|
||||||
|
M_DrawPic ((320 - p->width) / 2, 4, p);
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++) {
|
||||||
|
ptr = VID_GetModeDescriptionMemCheck (i);
|
||||||
|
modedescs[i].modenum = modelist[i].modenum;
|
||||||
|
modedescs[i].desc = ptr;
|
||||||
|
modedescs[i].ismode13 = 0;
|
||||||
|
modedescs[i].iscur = 0;
|
||||||
|
|
||||||
|
if (vid_modenum == i)
|
||||||
|
modedescs[i].iscur = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
vid_wmodes = 3;
|
||||||
|
lnummodes = VID_NumModes ();
|
||||||
|
|
||||||
|
for (i = 3; i < lnummodes; i++) {
|
||||||
|
ptr = VID_GetModeDescriptionMemCheck (i);
|
||||||
|
pv = VID_GetModePtr (i);
|
||||||
|
|
||||||
|
// we only have room for 15 fullscreen modes, so don't allow
|
||||||
|
// 360-wide modes, because if there are 5 320-wide modes and
|
||||||
|
// 5 360-wide modes, we'll run out of space
|
||||||
|
if (ptr && ((pv->width != 360) || COM_CheckParm ("-allow360"))) {
|
||||||
|
dup = 0;
|
||||||
|
|
||||||
|
for (j = 3; j < vid_wmodes; j++) {
|
||||||
|
if (!strcmp (modedescs[j].desc, ptr)) {
|
||||||
|
dup = 1;
|
||||||
|
dupmode = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dup || (vid_wmodes < MAX_MODEDESCS)) {
|
||||||
|
if (!dup || !modedescs[dupmode].ismode13
|
||||||
|
|| COM_CheckParm ("-noforcevga")) {
|
||||||
|
if (dup) {
|
||||||
|
k = dupmode;
|
||||||
|
} else {
|
||||||
|
k = vid_wmodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
modedescs[k].modenum = i;
|
||||||
|
modedescs[k].desc = ptr;
|
||||||
|
modedescs[k].ismode13 = pv->mode13;
|
||||||
|
modedescs[k].iscur = 0;
|
||||||
|
modedescs[k].width = pv->width;
|
||||||
|
|
||||||
|
if (i == vid_modenum)
|
||||||
|
modedescs[k].iscur = 1;
|
||||||
|
|
||||||
|
if (!dup)
|
||||||
|
vid_wmodes++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// sort the modes on width (to handle picking up oddball dibonly modes
|
||||||
|
// after all the others)
|
||||||
|
for (i = 3; i < (vid_wmodes - 1); i++) {
|
||||||
|
for (j = (i + 1); j < vid_wmodes; j++) {
|
||||||
|
if (modedescs[i].width > modedescs[j].width) {
|
||||||
|
tmodedesc = modedescs[i];
|
||||||
|
modedescs[i] = modedescs[j];
|
||||||
|
modedescs[j] = tmodedesc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
M_Print (13 * 8, 36, "Windowed Modes");
|
||||||
|
|
||||||
|
column = 16;
|
||||||
|
row = 36 + 2 * 8;
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++) {
|
||||||
|
if (modedescs[i].iscur)
|
||||||
|
M_PrintWhite (column, row, modedescs[i].desc);
|
||||||
|
else
|
||||||
|
M_Print (column, row, modedescs[i].desc);
|
||||||
|
|
||||||
|
column += 13 * 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vid_wmodes > 3) {
|
||||||
|
M_Print (12 * 8, 36 + 4 * 8, "Fullscreen Modes");
|
||||||
|
|
||||||
|
column = 16;
|
||||||
|
row = 36 + 6 * 8;
|
||||||
|
|
||||||
|
for (i = 3; i < vid_wmodes; i++) {
|
||||||
|
if (modedescs[i].iscur)
|
||||||
|
M_PrintWhite (column, row, modedescs[i].desc);
|
||||||
|
else
|
||||||
|
M_Print (column, row, modedescs[i].desc);
|
||||||
|
|
||||||
|
column += 13 * 8;
|
||||||
|
|
||||||
|
if (((i - 3) % VID_ROW_SIZE) == (VID_ROW_SIZE - 1)) {
|
||||||
|
column = 16;
|
||||||
|
row += 8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// line cursor
|
||||||
|
if (vid_testingmode) {
|
||||||
|
snprintf (temp, sizeof (temp), "TESTING %s", modedescs[vid_line].desc);
|
||||||
|
M_Print (13 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8 * 4, temp);
|
||||||
|
M_Print (9 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8 * 6,
|
||||||
|
"Please wait 5 seconds...");
|
||||||
|
} else {
|
||||||
|
M_Print (9 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8,
|
||||||
|
"Press Enter to set mode");
|
||||||
|
M_Print (6 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8 * 3,
|
||||||
|
"T to test mode for 5 seconds");
|
||||||
|
ptr = VID_GetModeDescription2 (vid_modenum);
|
||||||
|
|
||||||
|
if (ptr) {
|
||||||
|
snprintf (temp, sizeof (temp), "D to set default: %s", ptr);
|
||||||
|
M_Print (2 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8 * 5, temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
ptr = VID_GetModeDescription2 (_vid_default_mode_win->int_val);
|
||||||
|
|
||||||
|
if (ptr) {
|
||||||
|
snprintf (temp, sizeof (temp), "Current default: %s", ptr);
|
||||||
|
M_Print (3 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8 * 6, temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
M_Print (15 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8 * 8, "Esc to exit");
|
||||||
|
|
||||||
|
row = 36 + 2 * 8 + (vid_line / VID_ROW_SIZE) * 8;
|
||||||
|
column = 8 + (vid_line % VID_ROW_SIZE) * 13 * 8;
|
||||||
|
|
||||||
|
if (vid_line >= 3)
|
||||||
|
row += 3 * 8;
|
||||||
|
|
||||||
|
M_DrawCharacter (column, row, 12 + ((int) (realtime * 4) & 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
================
|
||||||
|
VID_MenuKey
|
||||||
|
================
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
VID_MenuKey (int key)
|
||||||
|
{
|
||||||
|
if (vid_testingmode)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (key) {
|
||||||
|
case K_ESCAPE:
|
||||||
|
S_LocalSound ("misc/menu1.wav");
|
||||||
|
M_Menu_Options_f ();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case K_LEFTARROW:
|
||||||
|
|
||||||
|
S_LocalSound ("misc/menu1.wav");
|
||||||
|
vid_line = ((vid_line / VID_ROW_SIZE) * VID_ROW_SIZE) +
|
||||||
|
((vid_line + 2) % VID_ROW_SIZE);
|
||||||
|
|
||||||
|
if (vid_line >= vid_wmodes)
|
||||||
|
vid_line = vid_wmodes - 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case K_RIGHTARROW:
|
||||||
|
S_LocalSound ("misc/menu1.wav");
|
||||||
|
vid_line = ((vid_line / VID_ROW_SIZE) * VID_ROW_SIZE) +
|
||||||
|
((vid_line + 4) % VID_ROW_SIZE);
|
||||||
|
|
||||||
|
if (vid_line >= vid_wmodes)
|
||||||
|
vid_line = (vid_line / VID_ROW_SIZE) * VID_ROW_SIZE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case K_UPARROW:
|
||||||
|
S_LocalSound ("misc/menu1.wav");
|
||||||
|
vid_line -= VID_ROW_SIZE;
|
||||||
|
|
||||||
|
if (vid_line < 0) {
|
||||||
|
vid_line += ((vid_wmodes + (VID_ROW_SIZE - 1)) /
|
||||||
|
VID_ROW_SIZE) * VID_ROW_SIZE;
|
||||||
|
|
||||||
|
while (vid_line >= vid_wmodes)
|
||||||
|
vid_line -= VID_ROW_SIZE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case K_DOWNARROW:
|
||||||
|
S_LocalSound ("misc/menu1.wav");
|
||||||
|
vid_line += VID_ROW_SIZE;
|
||||||
|
|
||||||
|
if (vid_line >= vid_wmodes) {
|
||||||
|
vid_line -= ((vid_wmodes + (VID_ROW_SIZE - 1)) /
|
||||||
|
VID_ROW_SIZE) * VID_ROW_SIZE;
|
||||||
|
|
||||||
|
while (vid_line < 0)
|
||||||
|
vid_line += VID_ROW_SIZE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case K_ENTER:
|
||||||
|
S_LocalSound ("misc/menu1.wav");
|
||||||
|
VID_SetMode (modedescs[vid_line].modenum, vid_curpal);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'T':
|
||||||
|
case 't':
|
||||||
|
S_LocalSound ("misc/menu1.wav");
|
||||||
|
// have to set this before setting the mode because WM_PAINT
|
||||||
|
// happens during the mode set and does a VID_Update, which
|
||||||
|
// checks vid_testingmode
|
||||||
|
vid_testingmode = 1;
|
||||||
|
vid_testendtime = realtime + 5.0;
|
||||||
|
|
||||||
|
if (!VID_SetMode (modedescs[vid_line].modenum, vid_curpal)) {
|
||||||
|
vid_testingmode = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'D':
|
||||||
|
case 'd':
|
||||||
|
S_LocalSound ("misc/menu1.wav");
|
||||||
|
firstupdate = 0;
|
||||||
|
Cvar_SetValue (_vid_default_mode_win, vid_modenum);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_SetCaption (char *text)
|
VID_SetCaption (char *text)
|
||||||
{
|
{
|
||||||
|
|
107
source/vid_wgl.c
107
source/vid_wgl.c
|
@ -47,6 +47,9 @@
|
||||||
#include "sbar.h"
|
#include "sbar.h"
|
||||||
#include "host.h"
|
#include "host.h"
|
||||||
|
|
||||||
|
extern void (*vid_menudrawfn) (void);
|
||||||
|
extern void (*vid_menukeyfn) (int);
|
||||||
|
|
||||||
#define MAX_MODE_LIST 30
|
#define MAX_MODE_LIST 30
|
||||||
#define VID_ROW_SIZE 3
|
#define VID_ROW_SIZE 3
|
||||||
#define WARP_WIDTH 320
|
#define WARP_WIDTH 320
|
||||||
|
@ -137,6 +140,9 @@ float gldepthmin, gldepthmax;
|
||||||
|
|
||||||
modestate_t modestate = MS_UNINIT;
|
modestate_t modestate = MS_UNINIT;
|
||||||
|
|
||||||
|
void VID_MenuDraw (void);
|
||||||
|
void VID_MenuKey (int key);
|
||||||
|
|
||||||
LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
void AppActivate (BOOL fActive, BOOL minimize);
|
void AppActivate (BOOL fActive, BOOL minimize);
|
||||||
char *VID_GetModeDescription (int mode);
|
char *VID_GetModeDescription (int mode);
|
||||||
|
@ -1745,6 +1751,9 @@ VID_Init (unsigned char *palette)
|
||||||
// Check for 3DFX Extensions and initialize them.
|
// Check for 3DFX Extensions and initialize them.
|
||||||
VID_Init8bitPalette ();
|
VID_Init8bitPalette ();
|
||||||
|
|
||||||
|
vid_menudrawfn = VID_MenuDraw;
|
||||||
|
vid_menukeyfn = VID_MenuKey;
|
||||||
|
|
||||||
strcpy (badmode.modedesc, "Bad mode");
|
strcpy (badmode.modedesc, "Bad mode");
|
||||||
vid_canalttab = true;
|
vid_canalttab = true;
|
||||||
|
|
||||||
|
@ -1759,6 +1768,17 @@ VID_Init_Cvars ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//========================================================
|
||||||
|
// Video menu stuff
|
||||||
|
//========================================================
|
||||||
|
|
||||||
|
extern void M_Menu_Options_f (void);
|
||||||
|
extern void M_Print (int cx, int cy, char *str);
|
||||||
|
extern void M_PrintWhite (int cx, int cy, char *str);
|
||||||
|
extern void M_DrawCharacter (int cx, int line, int num);
|
||||||
|
extern void M_DrawTransPic (int x, int y, qpic_t *pic);
|
||||||
|
extern void M_DrawPic (int x, int y, qpic_t *pic);
|
||||||
|
|
||||||
static int vid_line, vid_wmodes;
|
static int vid_line, vid_wmodes;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -1773,6 +1793,93 @@ typedef struct {
|
||||||
|
|
||||||
static modedesc_t modedescs[MAX_MODEDESCS];
|
static modedesc_t modedescs[MAX_MODEDESCS];
|
||||||
|
|
||||||
|
/*
|
||||||
|
================
|
||||||
|
VID_MenuDraw
|
||||||
|
================
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
VID_MenuDraw (void)
|
||||||
|
{
|
||||||
|
qpic_t *p;
|
||||||
|
char *ptr;
|
||||||
|
int lnummodes, i, k, column, row;
|
||||||
|
vmode_t *pv;
|
||||||
|
|
||||||
|
p = Draw_CachePic ("gfx/vidmodes.lmp");
|
||||||
|
M_DrawPic ((320 - p->width) / 2, 4, p);
|
||||||
|
|
||||||
|
vid_wmodes = 0;
|
||||||
|
lnummodes = VID_NumModes ();
|
||||||
|
|
||||||
|
for (i = 1; (i < lnummodes) && (vid_wmodes < MAX_MODEDESCS); i++) {
|
||||||
|
ptr = VID_GetModeDescription (i);
|
||||||
|
pv = VID_GetModePtr (i);
|
||||||
|
|
||||||
|
k = vid_wmodes;
|
||||||
|
|
||||||
|
modedescs[k].modenum = i;
|
||||||
|
modedescs[k].desc = ptr;
|
||||||
|
modedescs[k].iscur = 0;
|
||||||
|
|
||||||
|
if (i == vid_modenum)
|
||||||
|
modedescs[k].iscur = 1;
|
||||||
|
|
||||||
|
vid_wmodes++;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vid_wmodes > 0) {
|
||||||
|
M_Print (2 * 8, 36 + 0 * 8, "Fullscreen Modes (WIDTHxHEIGHTxBPP)");
|
||||||
|
|
||||||
|
column = 8;
|
||||||
|
row = 36 + 2 * 8;
|
||||||
|
|
||||||
|
for (i = 0; i < vid_wmodes; i++) {
|
||||||
|
if (modedescs[i].iscur)
|
||||||
|
M_PrintWhite (column, row, modedescs[i].desc);
|
||||||
|
else
|
||||||
|
M_Print (column, row, modedescs[i].desc);
|
||||||
|
|
||||||
|
column += 13 * 8;
|
||||||
|
|
||||||
|
if ((i % VID_ROW_SIZE) == (VID_ROW_SIZE - 1)) {
|
||||||
|
column = 8;
|
||||||
|
row += 8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
M_Print (3 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8 * 2,
|
||||||
|
"Video modes must be set from the");
|
||||||
|
M_Print (3 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8 * 3,
|
||||||
|
"command line with -width <width>");
|
||||||
|
M_Print (3 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8 * 4,
|
||||||
|
"and -bpp <bits-per-pixel>");
|
||||||
|
M_Print (3 * 8, 36 + MODE_AREA_HEIGHT * 8 + 8 * 6,
|
||||||
|
"Select windowed mode with -window");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
================
|
||||||
|
VID_MenuKey
|
||||||
|
================
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
VID_MenuKey (int key)
|
||||||
|
{
|
||||||
|
switch (key) {
|
||||||
|
case K_ESCAPE:
|
||||||
|
S_LocalSound ("misc/menu1.wav");
|
||||||
|
M_Menu_Options_f ();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_SetCaption (char *text)
|
VID_SetCaption (char *text)
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
|
#include "menu.h"
|
||||||
#include "qargs.h"
|
#include "qargs.h"
|
||||||
#include "qendian.h"
|
#include "qendian.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
|
|
Loading…
Reference in a new issue