[Scummvm-cvs-logs] scummvm master -> 060ea998c62a5d4dda7536907ba7b56bcdc3d2e5

tramboi bertrand_augereau at yahoo.fr
Sun Dec 4 17:50:43 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
060ea998c6 DREAMWEB: kMapstore accessor


Commit: 060ea998c62a5d4dda7536907ba7b56bcdc3d2e5
    https://github.com/scummvm/scummvm/commit/060ea998c62a5d4dda7536907ba7b56bcdc3d2e5
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-12-04T10:48:51-08:00

Commit Message:
DREAMWEB: kMapstore accessor

Changed paths:
    engines/dreamweb/monitor.cpp
    engines/dreamweb/stubs.cpp
    engines/dreamweb/stubs.h
    engines/dreamweb/vgagrafx.cpp



diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index fff38d3..be39d6a 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 7209cdb..4c3115f 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 39f3a5e..53f96da 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 4ad5237..fdeb373 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;






More information about the Scummvm-git-logs mailing list