Include mgraph.h here.

Made mouseactive extern (defined in in_win.c)
Removed unused variables.
Some minor cleanups.
This commit is contained in:
Marcus Sundberg 2000-01-04 23:32:43 +00:00
parent bb1f7ac924
commit b9d6599958

View file

@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "winquake.h" #include "winquake.h"
#include "d_local.h" #include "d_local.h"
#include "resource.h" #include "resource.h"
#include <mgraph.h>
#ifndef CDS_FULLSCREEN #ifndef CDS_FULLSCREEN
# define CDS_FULLSCREEN 0x00000004 # define CDS_FULLSCREEN 0x00000004
@ -35,32 +36,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
qboolean dibonly; qboolean dibonly;
extern int Minimized;
HWND mainwindow; HWND mainwindow;
HWND WINAPI InitializeWindow (HINSTANCE hInstance, int nCmdShow); HWND WINAPI InitializeWindow (HINSTANCE hInstance, int nCmdShow);
int DIBWidth, DIBHeight; int DIBWidth, DIBHeight;
qboolean DDActive; qboolean DDActive;
RECT WindowRect; RECT WindowRect;
DWORD WindowStyle, ExWindowStyle; DWORD WindowStyle, ExWindowStyle;
int window_center_x, window_center_y, window_x, window_y, window_width, window_height; int window_center_x, window_center_y, window_x, window_y, window_width, window_height;
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;
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;
static int vid_fulldib_on_focus_mode; static int vid_fulldib_on_focus_mode;
static qboolean force_minimized, in_mode_set, is_mode0x13, force_mode_set; static qboolean force_minimized, in_mode_set, is_mode0x13, force_mode_set;
static int vid_stretched, windowed_mouse; static int vid_stretched, windowed_mouse;
static qboolean palette_changed, syscolchg, vid_mode_set, hide_window, pal_is_nostatic; static qboolean palette_changed, syscolchg, vid_mode_set, hide_window, pal_is_nostatic;
static HICON hIcon; static HICON hIcon;
qboolean mouseactive; // from in_win.c extern qboolean mouseactive; // from in_win.c
viddef_t vid; // global video state viddef_t vid; // global video state
@ -137,7 +136,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
@ -389,6 +387,7 @@ int VID_Suspend (MGLDC *dc, int flags)
return MGL_NO_SUSPEND_APP; return MGL_NO_SUSPEND_APP;
} }
return 0;
} }
#endif #endif
@ -428,7 +427,7 @@ 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, lowstretched;
uchar *m; uchar *m;
@ -663,7 +662,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));
@ -754,7 +752,7 @@ 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;
BOOL stat; BOOL stat;
@ -790,7 +788,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
@ -869,7 +867,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
@ -953,7 +951,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
@ -1262,7 +1260,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)
{ {
@ -1272,7 +1269,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);
@ -1606,10 +1603,10 @@ 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;
while ((modenum >= nummodes) || (modenum < 0)) while ((modenum >= nummodes) || (modenum < 0))
{ {
@ -2085,7 +2082,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)
{ {
@ -2223,9 +2219,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)
@ -2260,8 +2253,6 @@ FlipScreen
*/ */
void FlipScreen(vrect_t *rects) void FlipScreen(vrect_t *rects)
{ {
HRESULT ddrval;
// Flip the surfaces // Flip the surfaces
if (DDActive) if (DDActive)
@ -2432,7 +2423,7 @@ void VID_Update (vrect_t *rects)
{ {
if (!_windowed_mouse.value) { if (!_windowed_mouse.value) {
if (windowed_mouse) { if (windowed_mouse) {
IN_DectivateMouse (); IN_DeactivateMouse ();
IN_ShowMouse (); IN_ShowMouse ();
} }
windowed_mouse = false; windowed_mouse = false;
@ -2864,11 +2855,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;