[Scummvm-cvs-logs] scummvm master -> 5948b5a9e3b587fa257d7dea0ec32633060bbc38

wjp wjp at usecode.org
Wed Dec 14 12:34:15 CET 2011


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

Summary:
5af0deba87 DREAMWEB: Cleanup
a489430bc3 DREAMWEB: Fix regression in showDiaryPage and lookAtCard
ee5c9678c3 DREAMWEB: Cleanup
5948b5a9e3 DREAMWEB: Allow quit from diary


Commit: 5af0deba87afaac279db04da52241b6ad1c6d723
    https://github.com/scummvm/scummvm/commit/5af0deba87afaac279db04da52241b6ad1c6d723
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-12-14T03:17:32-08:00

Commit Message:
DREAMWEB: Cleanup

Changed paths:
    engines/dreamweb/dreambase.h
    engines/dreamweb/stubs.cpp
    engines/dreamweb/stubs.h
    engines/dreamweb/use.cpp



diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index c7e9546..2048f39 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -151,6 +151,7 @@ public:
 	SetObject *getSetAd(uint8 index);
 	void *getAnyAd(uint8 *value1, uint8 *value2);
 	const uint8 *getTextInFile1(uint16 index);
+	uint8 findNextColon(const uint8 **string);
 
 	// from use.cpp
 	void placeFreeObject(uint8 index);
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 127724f..d931789 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1917,13 +1917,13 @@ void DreamGenContext::hangOnP(uint16 count) {
 }
 
 void DreamGenContext::findNextColon() {
-	uint8 *initialString = es.ptr(si, 0);
-	uint8 *string = initialString;
+	const uint8 *initialString = es.ptr(si, 0);
+	const uint8 *string = initialString;
 	al = findNextColon(&string);
 	si += (string - initialString);
 }
 
-uint8 DreamGenContext::findNextColon(uint8 **string) {
+uint8 DreamBase::findNextColon(const uint8 **string) {
 	uint8 c;
 	do {
 		c = **string;
@@ -1932,11 +1932,11 @@ uint8 DreamGenContext::findNextColon(uint8 **string) {
 	return c;
 }
 
-uint8 *DreamGenContext::getObTextStartCPP() {
+const uint8 *DreamGenContext::getObTextStartCPP() {
 	push(es);
 	push(si);
 	getObTextStart();
-	uint8 *result = es.ptr(si, 0);
+	const uint8 *result = es.ptr(si, 0);
 	si = pop();
 	es = pop();
 	return result;
@@ -2246,7 +2246,7 @@ void DreamGenContext::doLook() {
 	dumpTextLine();
 	uint8 index = data.byte(kRoomnum) & 31;
 	uint16 offset = getSegment(data.word(kRoomdesc)).word(kIntextdat + index * 2);
-	uint8 *string = getSegment(data.word(kRoomdesc)).ptr(kIntext, 0) + offset;
+	const uint8 *string = getSegment(data.word(kRoomdesc)).ptr(kIntext, 0) + offset;
 	findNextColon(&string);
 	uint16 x;
 	if (data.byte(kReallocation) < 50)
@@ -4655,7 +4655,7 @@ void DreamGenContext::lookAtCard() {
 	loadKeypad();
 	createPanel2();
 	showFrame(tempGraphics(), 160, 80, 42, 128);
-	uint8 *obText = getObTextStartCPP();
+	const uint8 *obText = getObTextStartCPP();
 	findNextColon(&obText);
 	findNextColon(&obText);
 	findNextColon(&obText);
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index e60a569..06033b5 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -227,9 +227,11 @@
 	void hangOnP();
 	void hangOnP(uint16 count);
 	void showIcon();
-	uint8 findNextColon(uint8 **string);
+	uint8 findNextColon(const uint8 **string) {
+		return DreamBase::findNextColon(string);
+	}
 	void findNextColon();
-	uint8 *getObTextStartCPP();
+	const uint8 *getObTextStartCPP();
 	void useText(const uint8 *string);
 	void useText();
 	void getBlockOfPixel();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index c591eca..a144f85 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -139,7 +139,7 @@ void DreamGenContext::useRoutine() {
 	}
 
 	delPointer();
-	uint8 *obText = getObTextStartCPP();
+	const uint8 *obText = getObTextStartCPP();
 	if (findNextColon(&obText) != 0) {
 		if (findNextColon(&obText) != 0) {
 			if (*obText != 0) {
@@ -178,7 +178,7 @@ void DreamGenContext::useText(const uint8 *string) {
 }
 
 void DreamGenContext::showFirstUse() {
-	uint8 *obText = getObTextStartCPP();
+	const uint8 *obText = getObTextStartCPP();
 	findNextColon(&obText);
 	findNextColon(&obText);
 	useText(obText);
@@ -186,7 +186,7 @@ void DreamGenContext::showFirstUse() {
 }
 
 void DreamGenContext::showSecondUse() {
-	uint8 *obText = getObTextStartCPP();
+	const uint8 *obText = getObTextStartCPP();
 	findNextColon(&obText);
 	findNextColon(&obText);
 	findNextColon(&obText);


Commit: a489430bc33268d1120442bfd2e4c455cd358ec0
    https://github.com/scummvm/scummvm/commit/a489430bc33268d1120442bfd2e4c455cd358ec0
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-12-14T03:18:11-08:00

Commit Message:
DREAMWEB: Fix regression in showDiaryPage and lookAtCard

Changed paths:
    engines/dreamweb/stubs.cpp



diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index d931789..0c22ffc 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -4591,6 +4591,7 @@ void DreamGenContext::showDiaryPage() {
 	const uint8 *string = getSegment(data.word(kTextfile1)).ptr(offset, 0);
 	uint16 y = kDiaryy + 16;
 	printDirect(&string, kDiaryx + 48, &y, 240, 240 & 1);
+	y = kDiaryy + 16;
 	printDirect(&string, kDiaryx + 129, &y, 240, 240 & 1);
 	y = kDiaryy + 23;
 	printDirect(&string, kDiaryx + 48, &y, 240, 240 & 1);
@@ -4659,7 +4660,8 @@ void DreamGenContext::lookAtCard() {
 	findNextColon(&obText);
 	findNextColon(&obText);
 	findNextColon(&obText);
-	printDirect(obText, 36, 124, 241, 241 & 1);
+	uint16 y = 124;
+	printDirect(&obText, 36, &y, 241, 241 & 1);
 	push(es);
 	push(si);
 	workToScreenM();


Commit: ee5c9678c318ae844a1642445f1aefc3eaeaa320
    https://github.com/scummvm/scummvm/commit/ee5c9678c318ae844a1642445f1aefc3eaeaa320
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-12-14T03:33:08-08:00

Commit Message:
DREAMWEB: Cleanup

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



diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 0c22ffc..c365ee4 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -4587,8 +4587,7 @@ void DreamGenContext::showDiaryPage() {
 	data.byte(kKerning) = 1;
 	useTempCharset();
 	data.word(kCharshift) = 91+91;
-	uint16 offset = kTextstart + getSegment(data.word(kTextfile1)).word(data.byte(kDiarypage) * 2);
-	const uint8 *string = getSegment(data.word(kTextfile1)).ptr(offset, 0);
+	const uint8 *string = getTextInFile1(data.byte(kDiarypage));
 	uint16 y = kDiaryy + 16;
 	printDirect(&string, kDiaryx + 48, &y, 240, 240 & 1);
 	y = kDiaryy + 16;
@@ -4602,14 +4601,12 @@ void DreamGenContext::showDiaryPage() {
 
 void DreamGenContext::dumpDiaryKeys() {
 	if (data.byte(kPresscount) == 1) {
-		if (data.byte(kSartaindead) != 1 && data.byte(kDiarypage) == 5 && DreamBase::getLocation(6) != 1) {
+		if (data.byte(kSartaindead) != 1 && data.byte(kDiarypage) == 5 && getLocation(6) != 1) {
 			// Add Sartain Industries note
-			DreamBase::setLocation(6);
+			setLocation(6);
 			delPointer();
-			uint16 offset = kTextstart + getSegment(data.word(kTextfile1)).word(12 * 2);
-			const uint8 *string = getSegment(data.word(kTextfile1)).ptr(offset, 0);
-			uint16 y = 106;
-			printDirect(&string, 70, &y, 241, 241 & 1);
+			const uint8 *string = getTextInFile1(12);
+			printDirect(string, 70, 106, 241, 241 & 1);
 			workToScreenM();
 			hangOnP(200);
 			createPanel();
@@ -4649,8 +4646,6 @@ void DreamGenContext::runEndSeq() {
 }
 
 void DreamGenContext::lookAtCard() {
-	//showFrame((Frame *)ds.ptr(0, 0), di, bx, ax & 0x1ff, ah & 0xfe, &width, &height);
-	//al = DreamBase::printDirect(&string, di, &y, dl, (bool)(dl & 1));
 	data.byte(kManisoffscreen) = 1;
 	getRidOfReels();
 	loadKeypad();
@@ -4662,14 +4657,10 @@ void DreamGenContext::lookAtCard() {
 	findNextColon(&obText);
 	uint16 y = 124;
 	printDirect(&obText, 36, &y, 241, 241 & 1);
-	push(es);
-	push(si);
 	workToScreenM();
 	hangOnW(280);
 	createPanel2();
 	showFrame(tempGraphics(), 160, 80, 42, 128);
-	si = pop();
-	es = pop();
 	printDirect(obText, 36, 130, 241, 241 & 1);
 	workToScreenM();
 	hangOnW(200);
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 06033b5..a287d57 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -371,7 +371,13 @@
 	void folderHints();
 	void folderExit();
 	void getLocation();
+	uint8 getLocation(uint8 index) {
+		return DreamBase::getLocation(index);
+	}
 	void setLocation();
+	void setLocation(uint8 index) {
+		DreamBase::setLocation(index);
+	}
 	void loadTempText();
 	void loadTempText(const char *fileName);
 	void loadTravelText();


Commit: 5948b5a9e3b587fa257d7dea0ec32633060bbc38
    https://github.com/scummvm/scummvm/commit/5948b5a9e3b587fa257d7dea0ec32633060bbc38
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-12-14T03:33:08-08:00

Commit Message:
DREAMWEB: Allow quit from diary

Changed paths:
    engines/dreamweb/use.cpp



diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index a144f85..599cdf7 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1213,7 +1213,8 @@ void DreamGenContext::useDiary() {
 		dumpDiaryKeys();
 		dumpTextLine();
 		checkCoords(diaryList);
-	} while (!data.byte(kGetback));
+	} while (!data.byte(kGetback) && !quitRequested());
+
 
 	getRidOfTemp();
 	getRidOfTempText();






More information about the Scummvm-git-logs mailing list