diff options
author | Bertrand Augereau | 2011-12-04 19:48:51 +0100 |
---|---|---|
committer | Bertrand Augereau | 2011-12-04 19:48:51 +0100 |
commit | 060ea998c62a5d4dda7536907ba7b56bcdc3d2e5 (patch) | |
tree | b267fde5c72bfa57fa780157e83d825e2b8d5eb2 /engines | |
parent | d559998f90717d40aadde8a8ab22d594116ade27 (diff) | |
download | scummvm-rg350-060ea998c62a5d4dda7536907ba7b56bcdc3d2e5.tar.gz scummvm-rg350-060ea998c62a5d4dda7536907ba7b56bcdc3d2e5.tar.bz2 scummvm-rg350-060ea998c62a5d4dda7536907ba7b56bcdc3d2e5.zip |
DREAMWEB: kMapstore accessor
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/monitor.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/vgagrafx.cpp | 12 |
4 files changed, 11 insertions, 10 deletions
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp index fff38d3801..be39d6a827 100644 --- a/engines/dreamweb/monitor.cpp +++ b/engines/dreamweb/monitor.cpp @@ -138,7 +138,7 @@ void DreamGenContext::input() { inputLine[data.word(kCurpos) * 2 + 0] = currentKey; if (currentKey > 'Z') continue; - multiGet(getSegment(data.word(kMapstore)).ptr(data.word(kCurpos) * 256, 0), data.word(kMonadx), data.word(kMonady), 8, 8); + multiGet(mapStore() + data.word(kCurpos) * 256, data.word(kMonadx), data.word(kMonady), 8, 8); uint8 charWidth; printChar(engine->tempCharset(), data.word(kMonadx), data.word(kMonady), currentKey, 0, &charWidth, NULL); inputLine[data.word(kCurpos) * 2 + 1] = charWidth; @@ -157,7 +157,7 @@ void DreamGenContext::delChar() { data.word(kCurslocx) -= width; uint16 offset = data.word(kCurpos); offset = ((offset & 0x00ff) << 8) | ((offset & 0xff00) >> 8); - multiPut(getSegment(data.word(kMapstore)).ptr(offset, 0), data.word(kMonadx), data.word(kMonady), 8, 8); + multiPut(mapStore() + offset, data.word(kMonadx), data.word(kMonady), 8, 8); multiDump(data.word(kMonadx), data.word(kMonady), al, 8); } diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 7209cdbfdc..4c3115fd7b 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -906,6 +906,10 @@ void DreamGenContext::mouseCall() { bx = state; } +uint8 *DreamGenContext::mapStore() { + return getSegment(data.word(kMapstore)).ptr(0, 0); +} + void DreamGenContext::readMouse() { data.word(kOldbutton) = data.word(kMousebutton); uint16 state = readMouseState(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 39f3a5e912..53f96da98c 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -56,6 +56,7 @@ void frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); void workToScreen(); void workToScreenCPP(); + uint8 *mapStore(); void multiGet(); void multiGet(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height); void cls(); diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index 4ad52378ee..fdeb373004 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -431,13 +431,11 @@ void DreamGenContext::zoom() { } void DreamGenContext::panelToMap() { - SegmentRef mapstore = getSegment(data.word(kMapstore)); - multiGet(getSegment(mapstore).ptr(0, 0), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); + multiGet(mapStore(), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); } void DreamGenContext::mapToPanel() { - SegmentRef mapstore = getSegment(data.word(kMapstore)); - multiPut(getSegment(mapstore).ptr(0, 0), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); + multiPut(mapStore(), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); } void DreamGenContext::dumpMap() { @@ -471,14 +469,12 @@ bool DreamGenContext::pixelCheckSet(const ObjPos *pos, uint8 x, uint8 y) { } void DreamGenContext::loadPalFromIFF() { - SegmentRef mapstore = getSegment(data.word(kMapstore)); - // TODO: Get rid of data blob position kPalettescreen; engine->openFile("DREAMWEB.PAL"); - engine->readFromFile(mapstore.ptr(0, 2000), 2000); + engine->readFromFile(mapStore(), 2000); engine->closeFile(); - const uint8 *src = mapstore.ptr(0x30, 0); + const uint8 *src = mapStore() + 0x30; uint8 *dst = mainPalette(); for (size_t i = 0; i < 256*3; ++i) { uint8 c = src[i] / 4; |