aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2011-12-04 15:46:04 +0100
committerBertrand Augereau2011-12-04 19:28:17 +0100
commitd559998f90717d40aadde8a8ab22d594116ade27 (patch)
treeb0683b0928a4f4274056ef5be0317fffd1463d1d
parent4506d2ac8d12c871cac0b1eb9b82a056e39e1303 (diff)
downloadscummvm-rg350-d559998f90717d40aadde8a8ab22d594116ade27.tar.gz
scummvm-rg350-d559998f90717d40aadde8a8ab22d594116ade27.tar.bz2
scummvm-rg350-d559998f90717d40aadde8a8ab22d594116ade27.zip
DREAMWEB: Cleanup DreamGenContext::loadPalFromIFF, get rid of readFromFile()
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/stubs.cpp8
-rw-r--r--engines/dreamweb/stubs.h1
-rw-r--r--engines/dreamweb/vgagrafx.cpp23
4 files changed, 12 insertions, 21 deletions
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index bd42cabeb1..204c171ffb 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -777,7 +777,6 @@ public:
void handClap();
void afterIntroRoom();
void findAllOpen();
- void readFromFile();
void initialInv();
void quitSymbol();
void setTopRight();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 85d39a8c00..7209cdbfdc 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -845,14 +845,6 @@ void DreamGenContext::resetKeyboard() {
void DreamGenContext::setKeyboardInt() {
}
-void DreamGenContext::readFromFile() {
- uint16 dst_offset = dx;
- uint16 size = cx;
- debug(1, "readfromfile(%04x:%u, %u)", (uint16)ds, dst_offset, size);
- ax = engine->readFromFile(ds.ptr(dst_offset, size), size);
- flags._c = false;
-}
-
void DreamGenContext::closeFile() {
engine->closeFile();
data.byte(kHandle) = 0;
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 05b3b3adbe..39f3a5e912 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -91,7 +91,6 @@
void oldToNames();
void namesToOld();
void loadPalFromIFF();
- void readHeader();
void fillSpace();
void startLoading(const Room &room);
Sprite *spriteTable();
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 1088058fe5..4ad52378ee 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -431,11 +431,13 @@ void DreamGenContext::zoom() {
}
void DreamGenContext::panelToMap() {
- multiGet(getSegment(data.word(kMapstore)).ptr(0, 0), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize));
+ 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));
}
void DreamGenContext::mapToPanel() {
- multiPut(getSegment(data.word(kMapstore)).ptr(0, 0), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize));
+ 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));
}
void DreamGenContext::dumpMap() {
@@ -469,15 +471,14 @@ bool DreamGenContext::pixelCheckSet(const ObjPos *pos, uint8 x, uint8 y) {
}
void DreamGenContext::loadPalFromIFF() {
- dx = kPalettescreen;
- openFile();
- cx = 2000;
- ds = data.word(kMapstore);
- dx = 0;
- readFromFile();
- closeFile();
-
- const uint8 *src = getSegment(data.word(kMapstore)).ptr(0x30, 0);
+ 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->closeFile();
+
+ const uint8 *src = mapstore.ptr(0x30, 0);
uint8 *dst = mainPalette();
for (size_t i = 0; i < 256*3; ++i) {
uint8 c = src[i] / 4;