From cde057a5828ed0e4136436dd2c8628c2141e173f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 13 Oct 2012 16:41:51 +1100 Subject: HOPKINS: Some cleanup to the video frame display and fading methods --- engines/hopkins/graphics.cpp | 21 +++++++++++---------- engines/hopkins/graphics.h | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'engines/hopkins') diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 94dee59aac..c19ad05540 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -1051,15 +1051,17 @@ void GraphicsManager::DD_VBL() { } void GraphicsManager::FADE_OUTW_LINUX(const byte *surface) { + assert(surface); fade_out(Palette, FADESPD, surface); } void GraphicsManager::FADE_INW_LINUX(const byte *surface) { - return fade_in(Palette, FADESPD, surface); + assert(surface); + fade_in(Palette, FADESPD, surface); } -void GraphicsManager::Copy_WinScan_Vbe3(const byte *sourceSurface, byte *destSurface) { - int result; +void GraphicsManager::Copy_WinScan_Vbe3(const byte *srcData, byte *destSurface) { + byte v; int v3; int v4; const byte *v5; @@ -1071,10 +1073,9 @@ void GraphicsManager::Copy_WinScan_Vbe3(const byte *sourceSurface, byte *destSur unsigned int v11; byte *v12; - result = 0; v3 = 0; v4 = 0; - v5 = sourceSurface; + v5 = srcData; for (;;) { v6 = *v5; if (*v5 < 222) @@ -1091,7 +1092,7 @@ void GraphicsManager::Copy_WinScan_Vbe3(const byte *sourceSurface, byte *destSur v6 = *(v5 + 2); v5 += 2; } else if (v6 == 254) { - v3 += (int16)READ_LE_UINT16(v5 + 1); + v3 += READ_LE_UINT16(v5 + 1); v6 = *(v5 + 3); v5 += 3; } else { @@ -1105,19 +1106,19 @@ Video_Cont3_wVbe: if (v6 == 211) { v7 = v4; v8 = *(v5 + 1); - result = *(v5 + 2); + v = *(v5 + 2); v9 = v3 + destSurface; v3 += v8; - memset(v9, result, v8); + memset(v9, v, v8); v5 += 3; v4 = v7; } else { v10 = v4; v11 = *v5 + 45; - result = *(v5 + 1); + v = *(v5 + 1); v12 = v3 + destSurface; v3 += v11; - memset(v12, result, v11); + memset(v12, v, v11); v5 += 2; v4 = v10; } diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index 5be407ce46..b826058af4 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -144,7 +144,7 @@ public: void CHANGE_PALETTE(const byte *palette); uint16 MapRGB(byte r, byte g, byte b); void DD_VBL(); - void Copy_WinScan_Vbe3(const byte *sourceSurface, byte *destSurface); + void Copy_WinScan_Vbe3(const byte *srcData, byte *destSurface); void Copy_Video_Vbe3(const byte *srcData); void Copy_Video_Vbe16(const byte *srcData); void Copy_Video_Vbe16a(const byte *srcData); -- cgit v1.2.3