diff options
author | Torbjörn Andersson | 2003-09-23 06:31:13 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-09-23 06:31:13 +0000 |
commit | fa8ccef9a44cd628d766a982dddeca3f6554f869 (patch) | |
tree | 4fff00aef0bf11ada722755dec7c31a053f17a23 /sword2 | |
parent | c7b8a6c01bd74ea6770a6aee65aa1a82f71fbb84 (diff) | |
download | scummvm-rg350-fa8ccef9a44cd628d766a982dddeca3f6554f869.tar.gz scummvm-rg350-fa8ccef9a44cd628d766a982dddeca3f6554f869.tar.bz2 scummvm-rg350-fa8ccef9a44cd628d766a982dddeca3f6554f869.zip |
Removed unused code
svn-id: r10368
Diffstat (limited to 'sword2')
-rw-r--r-- | sword2/driver/d_draw.cpp | 219 | ||||
-rw-r--r-- | sword2/driver/driver96.h | 63 |
2 files changed, 1 insertions, 281 deletions
diff --git a/sword2/driver/d_draw.cpp b/sword2/driver/d_draw.cpp index f01b8b9af3..b73785e17a 100644 --- a/sword2/driver/d_draw.cpp +++ b/sword2/driver/d_draw.cpp @@ -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 GetRenderType(void) } } -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 CloseTextObject(_movieTextObject *obj) { 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 @@ int32 PlaySmacker(char *filename, _movieTextObject *text[], uint8 *musicOut) { 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; } diff --git a/sword2/driver/driver96.h b/sword2/driver/driver96.h index 54bba17ef4..1fd32aa760 100644 --- a/sword2/driver/driver96.h +++ b/sword2/driver/driver96.h @@ -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 @@ typedef struct 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 @@ typedef struct // 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 ClearShadowFx(void); 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 void ResetRenderEngine(void); //----------------------------------------------------------------------------- extern BOOL KeyWaiting(void); extern int32 ReadKey(char *key); -extern void GetKeyStatus(_drvKeyStatus *s); //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -1519,10 +1458,8 @@ extern uint8 palCopy[256][4]; // Current palette. extern long int myTimers[10][2]; - #ifdef __cplusplus } #endif - #endif |