[Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_draw.cpp,1.21,1.22 driver96.h,1.38,1.39

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Mon Sep 22 23:32:03 CEST 2003


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

Modified Files:
	d_draw.cpp driver96.h 
Log Message:
Removed unused code


Index: d_draw.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_draw.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- d_draw.cpp	23 Sep 2003 06:22:36 -0000	1.21
+++ d_draw.cpp	23 Sep 2003 06:31:13 -0000	1.22
@@ -36,42 +36,24 @@
 
 byte *lpBackBuffer;
 
-/*
-static LPDIRECTDRAW		lpDraw;				// DirectDraw object
-LPDIRECTDRAW2			lpDD2;				// DirectDraw2 object
-LPDIRECTDRAWSURFACE		lpBackBuffer;		// DirectDraw back surface
-LPDIRECTDRAWPALETTE		lpPalette = NULL;	// DirectDraw palette
-*/
-
-
 // Game screen metrics
 int16			screenDeep;
 int16			screenWide;
 
 
 // Set to 1 if vertical blank status cannot be checked.
-static BOOL		noVbl = 0;
 BOOL			bFullScreen = 0;
 
 
 
 // Scroll variables.  scrollx and scrolly hold the current scroll position, 
-//	and scrollxTarget and scrollyTarget are the target position for the end
-//	of the game cycle.
 
 int16			scrollx;
 int16			scrolly;
-static	int16	scrollxTarget;
-static	int16	scrollyTarget;
-static	int16	scrollxOld;
-static	int16	scrollyOld;
-static	int16	failCount = 0;
-//static	DDCAPS	driverCaps;
 
 int32			renderCaps = 0;
 int32			dxHalCaps = 0;
 int32			dxHelCaps = 0;
-//DDCOLORKEY		blackColorKey;
 
 void FatalDirectDrawError(char *str, int32 code, char *filename, int32 line) {
 	char string[256];
@@ -180,35 +162,6 @@
 	}
 }
 
-int32 WaitForVbl(void)
-{
-	warning("stub WaitForVbl");
-/*
-	BOOL		vbl;
-	HRESULT		hr;
-	uint32		counter = 0;
-
-
-	while(1)
-	{
-		hr = IDirectDraw2_GetVerticalBlankStatus(lpDD2, &vbl);
-		
-		if (hr != DD_OK)
-		{
-			DirectDrawError("Cannot get vertical blank status", hr);
-			return(hr);
-		}
-
-		if (vbl || noVbl)
-			break;
-		
-		if (++counter == 250000)
-			noVbl = 1;
-	}
-*/	
-	return(RD_OK);
-
-}
 
 int32 EraseBackBuffer( void ) {
 	memset(lpBackBuffer + MENUDEEP * screenWide, 0, screenWide * RENDERDEEP);
@@ -422,122 +375,8 @@
 void DrawTextObject(_movieTextObject *obj) {
 	if (obj->textSprite && textSurface)
 		DrawSurface(obj->textSprite, textSurface);
-	
-/*
-	HRESULT				hr;
-	RECT				rd, rs;
-	LPDIRECTDRAWSURFACE	dds;
-	_spriteInfo *s = obj->textSprite;
-	char myString[256];
-
-
-	dds = (LPDIRECTDRAWSURFACE) textSurface;
-
-	// Set startx and starty for the screen buffer		ADDED THIS!
-	if (s->type & RDSPR_DISPLAYALIGN)
-		rd.top = s->y;
-	else
-		rd.top = s->y - scrolly;
-		
-	if (s->type & RDSPR_DISPLAYALIGN)
-		rd.left = s->x;
-	else
-		rd.left = s->x - scrollx;
-
-	rs.left = 0;
-	rs.right = s->w;
-	rs.top = 0;
-	rs.bottom = s->h;
-	if (s->scale & 0xff)
-	{
-		rd.right = rd.left + s->scaledWidth;
-		rd.bottom = rd.top + s->scaledHeight;
-		// Do clipping
-		if (rd.top < 40)
-		{
-			rs.top = (40 - rd.top) * 256 / s->scale;
-			rd.top = 40;
-		}
-		if (rd.bottom > 440)
-		{
-			rs.bottom -= ((rd.bottom - 440) * 256 / s->scale);
-			rd.bottom = 440;
-		}
-		if (rd.left < 0)
-		{
-			rs.left = (0 - rd.left) * 256 / s->scale;
-			rd.left = 0;
-		}
-		if (rd.right > 640)
-		{
-			rs.right -= ((rd.right - 640) * 256 / s->scale);
-			rd.right = 640;
-		}
-	}
-	else
-	{
-		rd.right = rd.left + s->w;
-		rd.bottom = rd.top + s->h;
-
-		// Do clipping
-		if (rd.top < 40)
-		{
-			rs.top = 40 - rd.top;
-			rd.top = 40;
-		}
-		if (rd.bottom > 440)
-		{
-			rs.bottom -= (rd.bottom - 440);
-			rd.bottom = 440;
-		}
-		if (rd.left < 0)
-		{
-			rs.left = 0 - rd.left;
-			rd.left = 0;
-		}
-		if (rd.right > 640)
-		{
-			rs.right -= (rd.right - 640);
-			rd.right = 640;
-		}
-	}
-
-	if (s->type & RDSPR_TRANS)
-	{
-		hr = IDirectDrawSurface2_Blt(lpPrimarySurface, &rd, dds, &rs, DDBLT_WAIT | DDBLT_KEYSRC, NULL);
-		if (hr)
-		{
-			if (hr == DDERR_SURFACELOST)
-				hr = RDERR_SURFACELOST;
-			else if (dxHalCaps & RDCAPS_BLTSTRETCH)
-				dxHalCaps -= RDCAPS_BLTSTRETCH;
-			else
-			{
-				sprintf(myString, "Cannot print smacker text x%d y%d w%d h%d s%d t%d\n", s->x, s->y, s->w, s->h, s->scale, s->type);
-				DirectDrawError(myString, hr);
-			}
-		}
-	}
-	else
-	{
-		hr = IDirectDrawSurface2_Blt(lpPrimarySurface, &rd, dds, &rs, DDBLT_WAIT, NULL);
-		if (hr)
-		{
-			if (hr == DDERR_SURFACELOST)
-				hr = RDERR_SURFACELOST;
-			else
-			{
-				sprintf(myString, "Cannot print smacker text x%d y%d w%d h%d s%d t%d\n", s->x, s->y, s->w, s->h, s->scale, s->type);
-				DirectDrawError(myString, hr);
-			}
-		}
-	}
-*/
 }
 
-
-extern uint8 musicMuted;
-
 int32 PlaySmacker(char *filename, _movieTextObject *text[], uint8 *musicOut) {
 	warning("semi-stub PlaySmacker %s", filename);
 
@@ -651,61 +490,5 @@
 		UploadRect(&r);
 	}
 
-	return(RD_OK);
-}
-
-void GetDrawStatus(_drvDrawStatus *s)
-{
-//	s->hwnd				= hwnd;
-//	s->lpDraw			= lpDraw;
-//	s->lpDD2			= lpDD2;
-//	s->lpPrimarySurface = lpPrimarySurface;
-	s->lpBackBuffer		= lpBackBuffer;
-//	s->lpPalette		= lpPalette;
-	s->screenDeep		= screenDeep;
-	s->screenWide		= screenWide;
-	s->scrollx			= scrollx;
-	s->scrolly			= scrolly;
-	s->scrollxTarget	= scrollxTarget;
-	s->scrollyTarget	= scrollyTarget;
-	s->scrollxOld		= scrollxOld;
-	s->scrollyOld		= scrollyOld;
-	s->failCount		= failCount;
-	s->renderCaps		= renderCaps;
-	s->dxHalCaps		= dxHalCaps;
-	s->dxHelCaps		= dxHelCaps;
-	s->noVbl			= noVbl;
-	s->bFullScreen		= bFullScreen;
-	
-//	memcpy(&s->driverCaps,	 &driverCaps,	sizeof(DDCAPS));
-//	memset(&blackColorKey, 0, sizeof(DDCOLORKEY));
-}
-
-
-
-void SetDrawStatus(_drvDrawStatus *s)
-{
-//	hwnd			= s->hwnd;
-//	lpDraw			= s->lpDraw;
-//	lpDD2			= s->lpDD2;
-//	lpPrimarySurface= s->lpPrimarySurface;
-//	lpBackBuffer	= s->lpBackBuffer;
-//	lpPalette		= s->lpPalette;
-	screenDeep		= s->screenDeep;
-	screenWide		= s->screenWide;
-	scrollx			= s->scrollx;
-	scrolly			= s->scrolly;
-	scrollxTarget	= s->scrollxTarget;
-	scrollyTarget	= s->scrollyTarget;
-	scrollxOld		= s->scrollxOld;
-	scrollyOld		= s->scrollyOld;
-	failCount		= s->failCount;
-//	renderCaps		= s->renderCaps;
-	dxHalCaps		= s->dxHalCaps;
-	dxHelCaps		= s->dxHelCaps;
-	noVbl			= s->noVbl;
-	bFullScreen		= s->bFullScreen;
-	
-//	memcpy(&driverCaps,	 &s->driverCaps,	sizeof(DDCAPS));
-//	memset(&blackColorKey, 0, sizeof(DDCOLORKEY));
+	return RD_OK;
 }

Index: driver96.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/driver96.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- driver96.h	22 Sep 2003 06:36:38 -0000	1.38
+++ driver96.h	23 Sep 2003 06:31:13 -0000	1.39
@@ -309,12 +309,6 @@
 //
 //	---------------------------------------------------------------------------
 //
-//	int32 WaitForVbl(void)
-//
-//	This function returns when the video hardware is in vertical retrace.
-//
-//	---------------------------------------------------------------------------
-//
 //	void InterpretDirectDrawError(int32 error)
 //
 //	This function is passed the pointer to a direct draw error code, and
@@ -1004,12 +998,7 @@
 #ifndef DRIVER96_H
 #define DRIVER96_H
 
-//#define DIRECTDRAW_VERSION 0x0300
-
-//#include <windows.h>
-//#include <windowsx.h>
 #include <limits.h>
-//#include <mmsystem.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -1017,16 +1006,11 @@
 #include "base/engine.h" // for warning()
 #include "common/system.h"
 #include "common/rect.h"
-//#include "ddraw.h"
-//#include "dsound.h"
-
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-
-
 //
 //	Defines
 //	-------
@@ -1316,47 +1300,6 @@
 	char	filler[58];
 } _pcxHeader;
 
-
-//  This is the structure which is used to set and
-//  retrieve the direct draw drivers global variables.
-
-typedef struct
-{	
-//	HWND				hwnd;
-//	LPDIRECTDRAW		lpDraw;
-//	LPDIRECTDRAW2		lpDD2;
-//	Surface				*lpPrimarySurface;
-	byte				*lpBackBuffer;
-//	LPDIRECTDRAWPALETTE	lpPalette;
-	int16				screenDeep;
-	int16				screenWide;
-	int16				scrollx;
-	int16				scrolly;
-	int16				scrollxTarget;
-	int16				scrollyTarget;
-	int16				scrollxOld;
-	int16				scrollyOld;
-	int16				failCount;
-	int32				renderCaps;
-	int32				dxHalCaps;
-	int32				dxHelCaps;
-	BOOL				noVbl;
-	BOOL				bFullScreen;
-//	DDCAPS				driverCaps;
-//	DDCOLORKEY			blackColorKey;
-} _drvDrawStatus;
-
-//  This is the structure which is used to retrieve
-//  the keyboard driver bits.
-
-typedef struct
-{
-	uint8 *pBacklog;
-	uint8 *pPointer;
-	char  *pBuffer;
-} _drvKeyStatus;
-
-
 //
 //	Function Prototypes
 //	-------------------
@@ -1366,7 +1309,6 @@
 //  Display functions - from d_draw.c
 //-----------------------------------------------------------------------------
 extern int32 InitialiseDisplay(int16 width, int16 height, int16 colourDepth, int32 windowType);
-extern int32 WaitForVbl(void);
 extern int32 EraseBackBuffer(void);
 extern void SetTransFx(void);
 extern void ClearTransFx(void);
@@ -1376,8 +1318,6 @@
 extern void SetShadowFx(void);
 extern int32 GetRenderType(void);
 extern int32 PlaySmacker(char *filename, _movieTextObject *textObjects[], uint8 *musicOut);
-extern void  GetDrawStatus(_drvDrawStatus *s);
-extern void  SetDrawStatus(_drvDrawStatus *s);
 extern int32 GrabScreenShot(void);
 //-----------------------------------------------------------------------------
 
@@ -1430,7 +1370,6 @@
 //-----------------------------------------------------------------------------
 extern BOOL  KeyWaiting(void);
 extern int32 ReadKey(char *key);
-extern void  GetKeyStatus(_drvKeyStatus *s);
 //-----------------------------------------------------------------------------
 
 //-----------------------------------------------------------------------------
@@ -1519,10 +1458,8 @@
 
 extern long int myTimers[10][2];
 
-
 #ifdef __cplusplus
 }
 #endif
-
 
 #endif





More information about the Scummvm-git-logs mailing list