diff options
author | Strangerke | 2013-01-04 16:43:44 +0100 |
---|---|---|
committer | Strangerke | 2013-01-04 16:43:44 +0100 |
commit | de2c2b7bdb9b1bd3800576241ab9f320ce03bc9f (patch) | |
tree | 22ea289dc77044d9da0a3352a35430b6b6c11e7b /engines/hopkins/graphics.cpp | |
parent | 668cba5bea190f7475ee6ed982cd9f028ae74421 (diff) | |
download | scummvm-rg350-de2c2b7bdb9b1bd3800576241ab9f320ce03bc9f.tar.gz scummvm-rg350-de2c2b7bdb9b1bd3800576241ab9f320ce03bc9f.tar.bz2 scummvm-rg350-de2c2b7bdb9b1bd3800576241ab9f320ce03bc9f.zip |
HOPKINS: Refactor Copy_WinScan_Vbe3
Diffstat (limited to 'engines/hopkins/graphics.cpp')
-rw-r--r-- | engines/hopkins/graphics.cpp | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index d777517402..33b8bedaea 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -766,51 +766,42 @@ void GraphicsManager::Copy_WinScan_Vbe3(const byte *srcData, byte *destSurface) destOffset = 0; srcP = srcData; for (;;) { - srcByte = *srcP; - if (*srcP < 222) - goto Video_Cont3_wVbe; + srcByte = srcP[0]; if (srcByte == kByteStop) return; - - if (srcByte < kSetOffset) { + if (srcByte == 211) { + destLen1 = srcP[1]; + rleValue = srcP[2]; + destSlice1P = destOffset + destSurface; + destOffset += destLen1; + memset(destSlice1P, rleValue, destLen1); + srcP += 3; + } else if (srcByte < 222) { + if (srcByte > 211) { + destLen2 = (byte)(srcP[0] + 45); + rleValue = srcP[1]; + destSlice2P = destOffset + destSurface; + destOffset += destLen2; + memset(destSlice2P, rleValue, destLen2); + srcP += 2; + } else { + destSurface[destOffset] = srcByte; + ++srcP; + ++destOffset; + } + } else if (srcByte < kSetOffset) { destOffset += (byte)(srcP[0] + 35); - srcByte = srcP[1]; srcP++; } else if (srcByte == k8bVal) { destOffset += srcP[1]; - srcByte = srcP[2]; srcP += 2; } else if (srcByte == k16bVal) { destOffset += READ_LE_UINT16(srcP + 1); - srcByte = srcP[3]; srcP += 3; } else { destOffset += READ_LE_UINT32(srcP + 1); - srcByte = srcP[5]; srcP += 5; } -Video_Cont3_wVbe: - if (srcByte > 210) { - if (srcByte == 211) { - destLen1 = srcP[1]; - rleValue = srcP[2]; - destSlice1P = destOffset + destSurface; - destOffset += destLen1; - memset(destSlice1P, rleValue, destLen1); - srcP += 3; - } else { - destLen2 = (byte)(srcP[0] + 45); - rleValue = srcP[1]; - destSlice2P = destOffset + destSurface; - destOffset += destLen2; - memset(destSlice2P, rleValue, destLen2); - srcP += 2; - } - } else { - destSurface[destOffset] = srcByte; - ++srcP; - ++destOffset; - } } } |