mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 14:52:08 +00:00
Moved vid_win.c -> vid_mgl.c, and fix lots of warnings.
This commit is contained in:
parent
52867ce15d
commit
e31f9fa9cd
1 changed files with 20 additions and 26 deletions
|
@ -42,6 +42,11 @@
|
||||||
#define MAX_MODE_LIST 30
|
#define MAX_MODE_LIST 30
|
||||||
#define VID_ROW_SIZE 3
|
#define VID_ROW_SIZE 3
|
||||||
|
|
||||||
|
|
||||||
|
/* Unused */
|
||||||
|
int VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes, VGA_planar;
|
||||||
|
byte *VGA_pagebase;
|
||||||
|
|
||||||
qboolean dibonly;
|
qboolean dibonly;
|
||||||
|
|
||||||
extern qboolean Minimized;
|
extern qboolean Minimized;
|
||||||
|
@ -59,7 +64,7 @@ int window_center_x, window_center_y, window_x, window_y, window_width, window
|
||||||
RECT window_rect;
|
RECT window_rect;
|
||||||
|
|
||||||
static DEVMODE gdevmode;
|
static DEVMODE gdevmode;
|
||||||
static qboolean startwindowed = 0, windowed_mode_set;
|
static qboolean startwindowed = 0, windowed_mode_set = 0;
|
||||||
static int firstupdate = 1;
|
static int firstupdate = 1;
|
||||||
static qboolean vid_initialized = false, vid_palettized;
|
static qboolean vid_initialized = false, vid_palettized;
|
||||||
static int lockcount;
|
static int lockcount;
|
||||||
|
@ -174,7 +179,6 @@ typedef struct {
|
||||||
|
|
||||||
static vmode_t modelist[MAX_MODE_LIST];
|
static vmode_t modelist[MAX_MODE_LIST];
|
||||||
static int nummodes;
|
static int nummodes;
|
||||||
static vmode_t *pcurrentmode;
|
|
||||||
|
|
||||||
int aPage; // Current active display page
|
int aPage; // Current active display page
|
||||||
int vPage; // Current visible display page
|
int vPage; // Current visible display page
|
||||||
|
@ -486,8 +490,8 @@ void registerAllMemDrivers(void)
|
||||||
|
|
||||||
void VID_InitMGLFull (HINSTANCE hInstance)
|
void VID_InitMGLFull (HINSTANCE hInstance)
|
||||||
{
|
{
|
||||||
int i, xRes, yRes, bits, vMode, lowres, curmode, temp;
|
int i, xRes, yRes, bits, lowres, curmode, temp;
|
||||||
int lowstretchedres, stretchedmode, lowstretched;
|
int lowstretchedres, stretchedmode = 0, lowstretched;
|
||||||
uchar *m;
|
uchar *m;
|
||||||
|
|
||||||
// FIXME: NT is checked for because MGL currently has a bug that causes it
|
// FIXME: NT is checked for because MGL currently has a bug that causes it
|
||||||
|
@ -721,7 +725,6 @@ void VID_InitMGLDIB (HINSTANCE hInstance)
|
||||||
{
|
{
|
||||||
WNDCLASS wc;
|
WNDCLASS wc;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
int i;
|
|
||||||
|
|
||||||
hIcon = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_ICON2));
|
hIcon = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_ICON2));
|
||||||
|
|
||||||
|
@ -812,9 +815,9 @@ VID_InitFullDIB
|
||||||
void VID_InitFullDIB (HINSTANCE hInstance)
|
void VID_InitFullDIB (HINSTANCE hInstance)
|
||||||
{
|
{
|
||||||
DEVMODE devmode;
|
DEVMODE devmode;
|
||||||
int i, j, modenum, cmodes, existingmode, originalnummodes, lowestres;
|
int i, j, modenum, existingmode, originalnummodes, lowestres;
|
||||||
int numlowresmodes, bpp, done;
|
int numlowresmodes, bpp, done;
|
||||||
int cstretch, istretch, mstretch;
|
int cstretch, istretch, mstretch = 0;
|
||||||
BOOL stat;
|
BOOL stat;
|
||||||
|
|
||||||
// enumerate 8 bpp modes
|
// enumerate 8 bpp modes
|
||||||
|
@ -848,7 +851,7 @@ void VID_InitFullDIB (HINSTANCE hInstance)
|
||||||
modelist[nummodes].dib = 1;
|
modelist[nummodes].dib = 1;
|
||||||
modelist[nummodes].fullscreen = 1;
|
modelist[nummodes].fullscreen = 1;
|
||||||
modelist[nummodes].bpp = devmode.dmBitsPerPel;
|
modelist[nummodes].bpp = devmode.dmBitsPerPel;
|
||||||
sprintf (modelist[nummodes].modedesc, "%dx%d",
|
sprintf (modelist[nummodes].modedesc, "%ldx%ld",
|
||||||
devmode.dmPelsWidth, devmode.dmPelsHeight);
|
devmode.dmPelsWidth, devmode.dmPelsHeight);
|
||||||
|
|
||||||
// if the width is more than twice the height, reduce it by half because this
|
// if the width is more than twice the height, reduce it by half because this
|
||||||
|
@ -927,7 +930,7 @@ void VID_InitFullDIB (HINSTANCE hInstance)
|
||||||
modelist[nummodes].dib = 1;
|
modelist[nummodes].dib = 1;
|
||||||
modelist[nummodes].fullscreen = 1;
|
modelist[nummodes].fullscreen = 1;
|
||||||
modelist[nummodes].bpp = devmode.dmBitsPerPel;
|
modelist[nummodes].bpp = devmode.dmBitsPerPel;
|
||||||
sprintf (modelist[nummodes].modedesc, "%dx%d",
|
sprintf (modelist[nummodes].modedesc, "%ldx%ld",
|
||||||
devmode.dmPelsWidth, devmode.dmPelsHeight);
|
devmode.dmPelsWidth, devmode.dmPelsHeight);
|
||||||
|
|
||||||
// if the width is more than twice the height, reduce it by half because this
|
// if the width is more than twice the height, reduce it by half because this
|
||||||
|
@ -1011,7 +1014,7 @@ void VID_InitFullDIB (HINSTANCE hInstance)
|
||||||
modelist[nummodes].dib = 1;
|
modelist[nummodes].dib = 1;
|
||||||
modelist[nummodes].fullscreen = 1;
|
modelist[nummodes].fullscreen = 1;
|
||||||
modelist[nummodes].bpp = devmode.dmBitsPerPel;
|
modelist[nummodes].bpp = devmode.dmBitsPerPel;
|
||||||
sprintf (modelist[nummodes].modedesc, "%dx%d",
|
sprintf (modelist[nummodes].modedesc, "%ldx%ld",
|
||||||
devmode.dmPelsWidth, devmode.dmPelsHeight);
|
devmode.dmPelsWidth, devmode.dmPelsHeight);
|
||||||
|
|
||||||
// we only want the lowest-bpp version of each mode
|
// we only want the lowest-bpp version of each mode
|
||||||
|
@ -1334,7 +1337,6 @@ qboolean VID_SetWindowedMode (int modenum)
|
||||||
pixel_format_t pf;
|
pixel_format_t pf;
|
||||||
qboolean stretched;
|
qboolean stretched;
|
||||||
int lastmodestate;
|
int lastmodestate;
|
||||||
LONG wlong;
|
|
||||||
|
|
||||||
if (!windowed_mode_set)
|
if (!windowed_mode_set)
|
||||||
{
|
{
|
||||||
|
@ -1344,7 +1346,7 @@ qboolean VID_SetWindowedMode (int modenum)
|
||||||
Cvar_SetValue (vid_window_y, 0.0);
|
Cvar_SetValue (vid_window_y, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
windowed_mode_set;
|
windowed_mode_set = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VID_CheckModedescFixup (modenum);
|
VID_CheckModedescFixup (modenum);
|
||||||
|
@ -1685,7 +1687,7 @@ void VID_SetDefaultMode (void)
|
||||||
|
|
||||||
int VID_SetMode (int modenum, unsigned char *palette)
|
int VID_SetMode (int modenum, unsigned char *palette)
|
||||||
{
|
{
|
||||||
int original_mode, temp, dummy;
|
int original_mode, temp;
|
||||||
qboolean stat;
|
qboolean stat;
|
||||||
MSG msg;
|
MSG msg;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
@ -2174,7 +2176,6 @@ VID_ForceMode_f
|
||||||
void VID_ForceMode_f (void)
|
void VID_ForceMode_f (void)
|
||||||
{
|
{
|
||||||
int modenum;
|
int modenum;
|
||||||
double testduration;
|
|
||||||
|
|
||||||
if (!vid_testingmode)
|
if (!vid_testingmode)
|
||||||
{
|
{
|
||||||
|
@ -2189,7 +2190,7 @@ void VID_ForceMode_f (void)
|
||||||
|
|
||||||
void VID_Init (unsigned char *palette)
|
void VID_Init (unsigned char *palette)
|
||||||
{
|
{
|
||||||
int i, bestmatch, bestmatchmetric, t, dr, dg, db;
|
int i, bestmatch = 0, bestmatchmetric, t, dr, dg, db;
|
||||||
int basenummodes;
|
int basenummodes;
|
||||||
byte *ptmp;
|
byte *ptmp;
|
||||||
|
|
||||||
|
@ -2342,9 +2343,6 @@ void VID_Init (unsigned char *palette)
|
||||||
|
|
||||||
void VID_Shutdown (void)
|
void VID_Shutdown (void)
|
||||||
{
|
{
|
||||||
HDC hdc;
|
|
||||||
int dummy;
|
|
||||||
|
|
||||||
if (vid_initialized)
|
if (vid_initialized)
|
||||||
{
|
{
|
||||||
if (modestate == MS_FULLDIB)
|
if (modestate == MS_FULLDIB)
|
||||||
|
@ -2379,10 +2377,7 @@ FlipScreen
|
||||||
*/
|
*/
|
||||||
void FlipScreen(vrect_t *rects)
|
void FlipScreen(vrect_t *rects)
|
||||||
{
|
{
|
||||||
HRESULT ddrval;
|
/* Flip the surfaces */
|
||||||
|
|
||||||
// Flip the surfaces
|
|
||||||
|
|
||||||
if (DDActive)
|
if (DDActive)
|
||||||
{
|
{
|
||||||
if (mgldc)
|
if (mgldc)
|
||||||
|
@ -2956,7 +2951,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
|
||||||
IN_DeactivateMouse ();
|
IN_DeactivateMouse ();
|
||||||
IN_ShowMouse ();
|
IN_ShowMouse ();
|
||||||
}
|
}
|
||||||
/* else if ((modestate == MS_WINDOWED) && _windowed_mouse.value //* && mouseactive * /)
|
/* else if ((modestate == MS_WINDOWED) && _windowed_mouse.value && mouseactive * /)
|
||||||
CVAR_FIXME */
|
CVAR_FIXME */
|
||||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value /* && mouseactive */)
|
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value /* && mouseactive */)
|
||||||
{
|
{
|
||||||
|
@ -3013,11 +3008,10 @@ LONG WINAPI MainWndProc (
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
{
|
{
|
||||||
LONG lRet = 0;
|
LONG lRet = 0;
|
||||||
int fwKeys, xPos, yPos, fActive, fMinimized, temp;
|
int fActive, fMinimized, temp;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
extern unsigned int uiWheelMessage;
|
extern unsigned int uiWheelMessage;
|
||||||
static int recursiveflag;
|
|
||||||
|
|
||||||
if ( uMsg == uiWheelMessage ) {
|
if ( uMsg == uiWheelMessage ) {
|
||||||
uMsg = WM_MOUSEWHEEL;
|
uMsg = WM_MOUSEWHEEL;
|
||||||
|
@ -3275,7 +3269,7 @@ void VID_MenuDraw (void)
|
||||||
{
|
{
|
||||||
qpic_t *p;
|
qpic_t *p;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int lnummodes, i, j, k, column, row, dup, dupmode;
|
int lnummodes, i, j, k, column, row, dup, dupmode = 0;
|
||||||
char temp[100];
|
char temp[100];
|
||||||
vmode_t *pv;
|
vmode_t *pv;
|
||||||
modedesc_t tmodedesc;
|
modedesc_t tmodedesc;
|
Loading…
Reference in a new issue