[Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_draw.cpp,1.25,1.26 d_draw.h,1.5,1.6 driver96.h,1.41,1.42 rdwin.cpp,1.23,1.24

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Tue Sep 23 09:40:04 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv20333/driver

Modified Files:
	d_draw.cpp d_draw.h driver96.h rdwin.cpp 
Log Message:
Must ... make ... space ... for ... FotAQ ...


Index: d_draw.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_draw.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- d_draw.cpp	23 Sep 2003 16:13:13 -0000	1.25
+++ d_draw.cpp	23 Sep 2003 16:38:37 -0000	1.26
@@ -31,18 +31,15 @@
 #include "palette.h"
 #include "render.h"
 
-#define SCREENYOFFSET	40
-#define MILLISECSPERCYCLE 83
-
 byte *lpBackBuffer;
 
 // Game screen metrics
-int16			screenDeep;
-int16			screenWide;
+int16 screenDeep;
+int16 screenWide;
 
 
 // Set to 1 if vertical blank status cannot be checked.
-BOOL			bFullScreen = 0;
+// BOOL			bFullScreen = 0;
 
 
 

Index: d_draw.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_draw.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- d_draw.h	28 Aug 2003 06:36:15 -0000	1.5
+++ d_draw.h	23 Sep 2003 16:38:38 -0000	1.6
@@ -68,7 +68,6 @@
 extern "C" {
 #endif
 
-//#include "ddraw.h"
 #include "driver96.h"
 
 //  Bits defining hardware and emulation capabilities.
@@ -79,11 +78,6 @@
 
 extern uint8 *lpPalette;			// palette
 extern byte *lpBackBuffer;		// back surface
-// extern Surface *lpPrimarySurface;	// DirectDraw front buffer.
-extern uint8 *lpDD2;				// DirectDraw2 object
-extern BOOL bFullScreen;		// Defines whether the app is running in full screen mode or not.
-//extern DDCOLORKEY				blackColorKey;		// transparent pixel for color key blitting.
-extern uint8 blackColorKey;		// transparent pixel for color key blitting.
 extern int32					dxHalCaps;			// Hardware capabilities.
 extern int32					dxHelCaps;			// Emulation capabilities.
 

Index: driver96.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/driver96.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- driver96.h	23 Sep 2003 16:13:13 -0000	1.41
+++ driver96.h	23 Sep 2003 16:38:38 -0000	1.42
@@ -354,28 +354,9 @@
 //
 //	Plays the smacker file, filename.
 //
-//	---------------------------------------------------------------------------
-//
-//	void GetDrawStatus(_drvStatus *s)
-//
-//	Retrieves the value of the driver's drawing globals and stores them in s.
-//
-//	---------------------------------------------------------------------------
-//
-//	void SetDrawStatus(_drvStatus *s)
-//
-//	Set the value of the driver's drawing globals from s.
-//
 //	--------------------------- rdwin.c ---------------------------------------
 //	---------------------------------------------------------------------------
 //
-//	int32 InitialiseWindow(HWND hWnd)
-//
-//	Creates a window!  This must be the first operation in creating the 
-//	Windows 95 version.
-//
-//	---------------------------------------------------------------------------
-//	
 //	int32 ServiceWindows(void)
 //
 //	This function should be called at a high rate ( > 20 per second) to service
@@ -389,20 +370,6 @@
 //
 //	---------------------------------------------------------------------------
 //
-//	int32 ReportDriverError(int32 error)
-//
-//	Creates a message box and displays the error code passed to it, as well as
-//	the filename and line that the function was called from
-//
-//	---------------------------------------------------------------------------
-//
-//	int32 ReportFatalError(const uint8 *error)
-//
-//	Creates a message box and displays the error string passed in, as well as
-//	the filename and line that the function was called from
-//
-//	---------------------------------------------------------------------------
-//
 //	void SetWindowName(const char *windowName)
 //
 //	Set the window name to windowName and stores this name in gameName for future
@@ -530,19 +497,13 @@
 //
 //	--------------------------------------------------------------------------
 //
-//	int32 ReadKey(char *key)
+//	int32 ReadKey(_keyboardEvent *key)
 //
 //	Sets the value of key passed in to the current waiting key.  If there is
 //	no key waiting, an error code is returned.
 //
 //
 //	--------------------------------------------------------------------------
-//
-//	void GetKeyStatus(_drvKeyStatus *)
-//
-//	Retrieves the address of the keyboard buffer bits.
-//	
-//	--------------------------------------------------------------------------
 //	------------------------------- sprite.c ---------------------------------
 //	--------------------------------------------------------------------------
 //
@@ -888,18 +849,6 @@
 //
 //	---------------------------------------------------------------------------
 //
-//	void GetSoundStatus(_drvStatus *s)
-//
-//	Retrieves the value of the driver's audio globals and stores them in s.
-//
-//	---------------------------------------------------------------------------
-//
-//	void SetSoundStatus(_drvStatus *s)
-//
-//	Set the value of the driver's audio globals from s.
-//
-//	---------------------------------------------------------------------------
-//
 //	void SetMusicVolume(uint8 vol)
 //
 //	Set the volume of any future as well as playing (but not fading) music to
@@ -1328,12 +1277,8 @@
 //-----------------------------------------------------------------------------
 //	Windows OS functions - from rdwin.c
 //-----------------------------------------------------------------------------
-//extern int32 InitialiseWindow(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow, char *gameName);
 extern int32 CloseAppWindow(void);
 extern int32 ServiceWindows(void);
-extern int32 _ReportDriverError(int32 error, const uint8 *filename, uint32 line);
-extern int32 _ReportFatalError(const uint8 *error, const uint8 *filename, uint32 line);
-extern int32 DisableQuitKey(void);
 extern void  SetWindowName(const char *windowName);
 //-----------------------------------------------------------------------------
 
@@ -1425,33 +1370,9 @@
 extern void scumm_mkdir(const char *pathname);
 extern void SVM_GetModuleFileName(void *module, char *destStr, uint32 maxLen);
 
-//-----------------------------------------------------------------------------
-//Macro for calling error handler with source filename and line.
-//-----------------------------------------------------------------------------
-#define ReportDriverError(f) _ReportDriverError(f, (const uint8 *) __FILE__, (uint32) __LINE__)
-#define ReportFatalError(f) _ReportFatalError(f, (const uint8 *) __FILE__, (uint32) __LINE__)
-//-----------------------------------------------------------------------------
-
-
-
-//-----------------------------------------------------------------------------
-// Macro for reporting a non-fatal driver error
-//-----------------------------------------------------------------------------
-#ifdef _SWORD2_DEBUG
-static  int32	rderror;
-#define Driver(f)							\
-	if (rderror = f)						\
-		ReportDriverError(rderror)
-#else
-#define Driver(f) f
-#endif
-//-----------------------------------------------------------------------------
-
-
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-extern BOOL		gotTheFocus;		// set if the game is currently displayed
 extern int16	screenWide;			// Width of the screen display
 extern int16	screenDeep;			// Height of the screen display
 extern int16	mousex;				// Mouse screen x coordinate

Index: rdwin.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/rdwin.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- rdwin.cpp	23 Sep 2003 16:13:13 -0000	1.23
+++ rdwin.cpp	23 Sep 2003 16:38:38 -0000	1.24
@@ -38,23 +38,6 @@
 
 
 
-//static BOOL		bMouseVisible = FALSE;
-//static BOOL		controlKey = FALSE;
-//static BOOL		altKey = FALSE;
-//static BOOL		wasScreenSaverActive = FALSE;
-//static BOOL		myAppClosed = FALSE;
-static BOOL		controlQDisabled = FALSE;
-//static uint8	gameName[80];
-
-
-//BOOL			gotTheFocus = FALSE;
-//assume we always have focus for the time being - khalek
-BOOL			gotTheFocus = TRUE; 
-//HWND			hwnd;
-//RECT			rcWindow;
-
-
-
 //-----------------------------------------------------------------------------
 
 void Zdebug(const char *format,...) {
@@ -86,61 +69,6 @@
 #endif
 }
 
-/*
-void Zdebug(char *format,...)	//Tony's special debug logging file March96
-{
-	warning("stub Zdebug");
-//	Write a printf type string to a debug file
-
-	va_list		arg_ptr;			// Variable argument pointer
-	FILE *		debug_filep=0;			// Debug file pointer
-	static int	first_debug = 1;		// Flag for first time this is used
-
-	va_start(arg_ptr,format);
-
-	if (first_debug)					//First time round delete any previous debug file
-	{
-		unlink("debug.txt");
-		first_debug = 0;
-	}
-
-	debug_filep = fopen("debug.txt","a+t");
-
-	if (debug_filep != NULL)	// if it could be opened
-	{
-		vfprintf(debug_filep, format, arg_ptr);
-		fprintf(debug_filep,"\n");
-
-		fclose(debug_filep);
-	}
-}
-*/
-//-----------------------------------------------------------------------------
-
-/*
-void Message(LPSTR fmt, ...)
-{
-    char	buff[256];
-    va_list	va;
-
-    
-	va_start(va, fmt);
-
-    //
-    // format message with header
-    //
-    lstrcpy( buff, "DRIVER96:" );
-    wvsprintf( &buff[lstrlen(buff)], fmt, va );
-    lstrcat( buff, "\r\n" );
-
-    //
-    // To the debugger
-    //
-    OutputDebugString( buff );
-
-}
-*/
-
 //-----------------------------------------------------------------------------
 //	OSystem Event Handler. Full of cross platform goodness and 99% fat free!
 //-----------------------------------------------------------------------------
@@ -180,340 +108,6 @@
 }
 
 
-//-----------------------------------------------------------------------------
-//	Windows Message Handler.  All keyboard and mouse input is handled here.
-//-----------------------------------------------------------------------------
-/*
-long FAR PASCAL WindowsMessageHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
-{
-
-	switch( message )
-	{
-
-
-	case WM_TIMER:
-		switch (wParam)
-		{
-		case 25:
-			FadeServer();
-			return(0);
-		case 1:
-			FxServer();
-			return(0);
-		}
-		break;
-		
-
-    case WM_CLOSE:
-		Zdebug("WM_CLOSE");
-		break;
-
-    case WM_SIZE:
-    case WM_MOVE:
-        if (IsIconic(hwnd))
-        {
-            Message("minimising");
-//            PauseGame();
-        }
-
-        if (bFullScreen)
-        {
-            SetRect(&rcWindow, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
-        }
-        else
-        {
-            GetClientRect(hwnd, &rcWindow);
-            ClientToScreen(hwnd, (LPPOINT)&rcWindow);
-            ClientToScreen(hwnd, (LPPOINT)&rcWindow+1);
-        }
-        Message("WINDOW RECT: [%d,%d,%d,%d]", rcWindow.left, rcWindow.top, rcWindow.right, rcWindow.bottom);
-		if (bFullScreen)
-		{
-			SetCapture(hwnd);
-		}
-		else
-		{
-			ReleaseCapture();
-		}
-//		SetCursor(NULL);
-//		ShowCursor(FALSE);
-        break;
-
-
-
-	case WM_ACTIVATEAPP:
-		gotTheFocus = wParam;
-		if (gotTheFocus)
-		{
-			Message("Got the focus");
-			bMouseVisible = FALSE;
-			Message("Mouse invisible");
-			ShowCursor(FALSE);
-		}
-		else
-		{
-			if (bMouseVisible == FALSE)
-				ShowCursor(TRUE);
-			Message("Lost the focus");
-			bMouseVisible = TRUE;
-			Message("Mouse visible");
-		}
-		break;
-
-
-    case WM_SYSKEYUP:
-        switch( wParam )
-        {
-
-//			int32 rv;
-
-        // handle ALT+ENTER (fullscreen)
-        case VK_RETURN:
-			break;
-        }
-        break;
- 
-
-	case WM_DISPLAYCHANGE:
-		break;
-
-	case WM_CREATE:
-		SystemParametersInfo(SPI_GETSCREENSAVEACTIVE , 0 , &wasScreenSaverActive , 0);
-		if (wasScreenSaverActive)
-		{
-			SystemParametersInfo(SPI_SETSCREENSAVEACTIVE , FALSE , 0 , 0 );
-		}
-    	break;
-
-
-    case WM_QUERYNEWPALETTE:
-        //
-        //  we are getting the palette focus, select our palette
-        //
-        if (!bFullScreen && lpPalette && lpPrimarySurface)
-        {
-			int32 hr;
-
-            hr = IDirectDrawSurface_BS2_SetPalette(lpPrimarySurface, lpPalette);
-            if (hr == DDERR_SURFACELOST)
-            {
-                IDirectDrawSurface_Restore(lpPrimarySurface);
-
-                hr= IDirectDrawSurface_BS2_SetPalette(lpPrimarySurface, lpPalette);
-                if(hr == DDERR_SURFACELOST)
-                {
-                   Message("Failed to restore palette after second try");
-                }
-            }
-
-            //
-            // Restore normal title if palette is ours
-            //
-            if(hr == DD_OK)
-            {
-                SetWindowText(hwnd, gameName);
-            }
-        }
-        break;
-
-    case WM_PALETTECHANGED:
-        //
-        //  if another app changed the palette we dont have full control
-        //  of the palette. NOTE this only applies for FoxBear in a window
-        //  when we are fullscreen we get all the palette all of the time.
-        //
-        if ((HWND)wParam != hwnd)
-        {
-            if( !bFullScreen )
-            {
-				Message("Lost palette but continuing");
-            }
-        }
-        break;
-
-
-//    case WM_SETCURSOR:
-//		if (bMouseVisible)
-//			SetCursor(LoadCursor(NULL, IDC_ARROW));
-//		else
-//			SetCursor(NULL);
-//	    return TRUE;
-//		break;
-
-	case WM_CHAR:
-		if (lParam & (1 << 30))
-			return(0);
-		WriteKey((char) (wParam & 0xff));
-		return(0);
-
-    case WM_KEYDOWN:
-
-		Zdebug("key %d", wParam);
-
-		switch( wParam )
-		{
-			case VK_CONTROL:
-				controlKey = TRUE;
-				break;
-
-//			case VK_ALT:
-//				altKey = TRUE;
-//				break;
-
-			case 'W':
-				if (controlKey)
-					GrabScreenShot();
-				return 0;
-
-			case 'Q':
-				if (controlKey && !controlQDisabled)
-					DestroyWindow( hWnd );
-  				return 0;
-
-			case 'F4':
-				DestroyWindow( hWnd );
-  				return 0;
-
-        }
-      	break;
-
-
-	case WM_KEYUP:
-		switch(wParam)
-		{
-			case VK_CONTROL:
-				controlKey = FALSE;
-				break;
-
-//			case VK_ALT:
-//				altKey = FALSE;
-//				break;
-
-		}
-	    break;
-
-
-    case WM_DESTROY:
-		Zdebug("*destroy*");
-
-		if (wasScreenSaverActive)
-			SystemParametersInfo(SPI_SETSCREENSAVEACTIVE , TRUE , 0 , 0 );
-        PostQuitMessage( 0 );
-        break;
-
-
-	case WM_MOUSEMOVE:
-		mousex = lParam & 0xffff;
-
-		if (bFullScreen)
-		{
-			mousey = (uint16) (lParam >> 16) - MENUDEEP;
-		}
-		else
-		{
-			mousey = (uint16) (lParam >> 16) - MENUDEEP;
-
-			if (mousex < 0)
-				mousex = 0;
-			if (mousex >= RENDERWIDE)
-				mousex = RENDERWIDE-1;
-		}
-
-		if (mousey < -MENUDEEP)
-			mousey = -MENUDEEP;
-		if (mousey >= RENDERDEEP + MENUDEEP)
-			mousey = RENDERDEEP + MENUDEEP - 1;
-
-		return(0);
-
-	case WM_LBUTTONDOWN:
-		LogMouseEvent(RD_LEFTBUTTONDOWN);
-		return(0);
-
-	case WM_LBUTTONUP:
-		LogMouseEvent(RD_LEFTBUTTONUP);
-		return(0);
-
-	case WM_RBUTTONDOWN:
-		LogMouseEvent(RD_RIGHTBUTTONDOWN);
-		return(0);
-
-	case WM_RBUTTONUP:
-		LogMouseEvent(RD_RIGHTBUTTONUP);
-		return(0);
-
-	case WM_LBUTTONDBLCLK:
-		LogMouseEvent(RD_LEFTBUTTONDOWN);
-		return(0);
-		
-	case WM_RBUTTONDBLCLK:
-		LogMouseEvent(RD_RIGHTBUTTONDOWN);
-
-
-	case WM_SYSCOMMAND:
-		if (gotTheFocus)
-			return(0);
-
-
-
-
-	}
-
-	return DefWindowProc(hWnd, message, wParam, lParam);
-
-}
-*/
-
-
-/*
-int32 InitialiseWindow(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow, char *gameName)
-
-{
-	
-	WNDCLASS    wc;
-//	uint32		err;
-
-
-//	hPrevInstance = hPrevInstance;
-	wc.style = CS_DBLCLKS;
-	wc.lpfnWndProc = WindowsMessageHandler;
-	wc.cbClsExtra = 0;
-	wc.cbWndExtra = 0;
-	wc.hInstance = hInstance;
-	wc.hIcon = LoadIcon( hInstance, "resourc1");  //IDI_APPLICATION );
-	wc.hCursor = LoadCursor( NULL, IDC_ARROW );
-	wc.hbrBackground = GetStockObject(BLACK_BRUSH);
-
-	wc.lpszMenuName = gameName;
-	wc.lpszClassName = gameName;
-
-	RegisterClass( &wc );
-
-	// Create a window
-	hwnd = CreateWindowEx(WS_EX_APPWINDOW, gameName, gameName, WS_VISIBLE | WS_SYSMENU | WS_POPUP, 0, 0,
-			GetSystemMetrics( SM_CXSCREEN ), GetSystemMetrics( SM_CYSCREEN ),
-			NULL, NULL, hInstance, NULL );
-
-	if(!hwnd)
-	{
-	    MessageBox(hwnd, "Failed to create window", gameName, MB_OK );
-	    DestroyWindow(hwnd);
-		return(RDERR_CREATEWINDOW);
-	}
-
-//	ShowWindow(hwnd, nCmdShow);
-	UpdateWindow(hwnd);
-	SetFocus(hwnd);
-	
-	SetTimer(hwnd, 25, 1000 / 25, NULL);
-	SetTimer(hwnd, 1, 100, NULL);
-
-	return(RD_OK);
-
-}
-*/
-
-
 int32 CloseAppWindow(void)
 
 {
@@ -551,75 +145,8 @@
 	// We still need to update because of fades, menu animations, etc.
 	g_system->update_screen();
 
-//	warning("stub ServiceWindows");  // too noisy
-/*
-	MSG msg;
-
-	if (myAppClosed)
-		return(RDERR_APPCLOSED);
-
-	while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
-	{
-		if (!GetMessage(&msg, NULL, 0, 0))
-		{
-			myAppClosed = TRUE;
-			return(RDERR_APPCLOSED);
-		}
-
-		TranslateMessage(&msg);
-		DispatchMessage(&msg);
-  	}
-*/
-	return(RD_OK);
-
-}
-
-
-
-
-int32 _ReportDriverError(int32 error, const uint8 *filename, uint32 line)
-
-{
-	warning("stub _ReportDriverError 0x%.8x file: %s, line: %d ", error, (const char *) filename, line);
-/*
-
-	char errorText[128];
-	char name[80];
-
-
-	GetGameName(name);
-	sprintf(errorText, "Fatal error in %s, line %u!  Code 0x%.8x", filename, line, error);
-    MessageBox(hwnd, errorText, name, MB_SYSTEMMODAL | MB_ICONHAND | MB_ABORTRETRYIGNORE);
-*/	
-	return(RD_OK);
-
-}
-
-
-
-int32 _ReportFatalError(const uint8 *error, const uint8 *filename, uint32 line)
-
-{
-
-	warning("stub _ReportFatalError");
-	char errorText[500];
-	char name[80];
-
-
-	GetGameName((uint8 *)name);
-	sprintf(errorText, "FATAL ERROR - GAME TERMINATED\n%s", error);
-	//MessageBox(hwnd, errorText, name, MB_SYSTEMMODAL | MB_ICONHAND | MB_ABORTRETRYIGNORE);
-	warning("%s", errorText);
-
-	return(RD_OK);
-
-}
-
+	return RD_OK;
 
-int32 DisableQuitKey(void)
-{
-	controlQDisabled = TRUE;
-	return(RD_OK);
 }
 
 void SetWindowName(const char *windowName)





More information about the Scummvm-git-logs mailing list