[Scummvm-git-logs] scummvm master -> a467ab6f3e97748fdabb50689771ccdd994197d1

AndywinXp noreply at scummvm.org
Mon Aug 12 18:52:33 UTC 2024


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:
a467ab6f3e SCUMM: MANIAC (Apple IIgs): Implement correct cursor and color for texts


Commit: a467ab6f3e97748fdabb50689771ccdd994197d1
    https://github.com/scummvm/scummvm/commit/a467ab6f3e97748fdabb50689771ccdd994197d1
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-08-12T20:52:24+02:00

Commit Message:
SCUMM: MANIAC (Apple IIgs): Implement correct cursor and color for texts

Everything is white now :-) The C64-like cursor and text colors
are now available via the "Visual changes" enhancement.

Changed paths:
    engines/scumm/actor.cpp
    engines/scumm/cursor.cpp
    engines/scumm/detection_tables.h
    engines/scumm/gfx_gui.cpp
    engines/scumm/script_v0.cpp
    engines/scumm/verbs.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index b1370d245d4..e420899c329 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -3510,7 +3510,7 @@ void ScummEngine::actorTalk(const byte *msg) {
 		_charsetColor = _NES_talkColor;
 	} else {
 		a = derefActor(getTalkingActor(), "actorTalk(2)");
-		_charsetColor = a->_talkColor;
+		_charsetColor = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : a->_talkColor;
 	}
 	_charsetBufPos = 0;
 	_talkDelay = 0;
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 80aa561fde7..59b46cd10ad 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -783,7 +783,7 @@ void ScummEngine_v2::setBuiltinCursor(int idx) {
 	memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor));
 
 	if (_game.platform == Common::kPlatformC64 || _game.platform == Common::kPlatformApple2GS)
-		color = default_v0_cursor_colors[idx];
+		color = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : default_v0_cursor_colors[idx];
 	else if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderCGAComp)
 		color = (idx & 1) * 3;
 	else if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG || _renderMode == Common::kRenderCGA_BW)
@@ -851,6 +851,24 @@ void ScummEngine_v2::setBuiltinCursor(int idx) {
 			*(hotspot - _cursor.width * (3 + i) + i) = color;
 			*(hotspot + _cursor.width * (3 + i) + i) = color;
 		}
+	} else if (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) {
+		_cursor.width = 23;
+		_cursor.height = 21;
+		_cursor.hotspotX = 11;
+		_cursor.hotspotY = 10;
+
+		byte *hotspot = _grabbedCursor + _cursor.hotspotY * _cursor.width + _cursor.hotspotX;
+
+		// A simple crosshair
+		for (i = 0; i < 8; i++) {
+			*(hotspot - 4 - i) = color;
+			*(hotspot + 4 + i) = color;
+		}
+
+		for (i = 0; i < 8; i++) {
+			*(hotspot - _cursor.width * (3 + i)) = color;
+			*(hotspot + _cursor.width * (3 + i)) = color;
+		}
 	} else {
 		_cursor.width = 23;
 		_cursor.height = 21;
@@ -905,7 +923,7 @@ void ScummEngine_v2::setBuiltinCursor(int idx) {
 
 void ScummEngine_v2::setSnailCursor() {
 	byte color;
-	if (_game.platform == Common::kPlatformC64)
+	if (_game.platform == Common::kPlatformC64 || _game.platform == Common::kPlatformApple2GS)
 		color = default_v0_cursor_colors[1];
 	else if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderCGAComp)
 		color = 3;
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 5cb5fc24013..b9304715482 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -153,7 +153,7 @@ static const PlainGameDescriptor gameDescriptions[] = {
 // only a single unique variant. This is used to help the detector quickly
 // decide whether it has to worry about distinguishing multiple variants or not.
 static const GameSettings gameVariantsTable[] = {
-	{"maniac", "Apple II",   0, GID_MANIAC, 0, 0, MDT_APPLEIIGS, 0, Common::kPlatformApple2GS, GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_ORIGINALGUI)},
+	{"maniac", "Apple II",   0, GID_MANIAC, 0, 0, MDT_APPLEIIGS, 0, Common::kPlatformApple2GS, GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_ORIGINALGUI, GAMEOPTION_ENHANCEMENTS)},
 	{"maniac", "C64",        0, GID_MANIAC, 0, 0, MDT_C64, 0, Common::kPlatformC64, GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_ORIGINALGUI) },
 	{"maniac", "C64 Demo",   0, GID_MANIAC, 0, 0, MDT_C64, GF_DEMO, Common::kPlatformC64, GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_ORIGINALGUI) },
 	{"maniac", "V1",      "v1", GID_MANIAC, 1, 0, MDT_PCSPK | MDT_PCJR, 0, Common::kPlatformDOS, GUIO10(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_RENDERHERCGREEN, GUIO_RENDERHERCAMBER, GUIO_RENDERCGABW, GUIO_RENDERCGACOMP, GUIO_RENDERCGA, GAMEOPTION_ENHANCEMENTS, GAMEOPTION_ORIGINALGUI, GAMEOPTION_COPY_PROTECTION)},
diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index 86fed566ce3..3c121df4b86 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -345,7 +345,7 @@ Common::KeyState ScummEngine::printMessageAndPause(const char *msg, int color, i
 			_string[2].xpos = 16;
 			_string[2].color = 0;
 		} else if (_game.platform == Common::kPlatformC64 || _game.platform == Common::kPlatformApple2GS) {
-			_string[2].color = 16;
+			_string[2].color = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : 16;
 		} else {
 			_string[2].color = 13;
 		}
diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp
index 3196fca4bff..78f518a5c0d 100644
--- a/engines/scumm/script_v0.cpp
+++ b/engines/scumm/script_v0.cpp
@@ -402,7 +402,7 @@ void ScummEngine_v0::decodeParseString() {
 	_string[textSlot].overhead = false;
 
 	if (_actorToPrintStrFor == 0xFF)
-		_string[textSlot].color = 14;
+		_string[textSlot].color = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : 14;
 
 	actorTalk(buffer);
 }
@@ -444,7 +444,7 @@ void ScummEngine_v0::flushSentenceLine() {
 	_string[2].ypos = _virtscr[kVerbVirtScreen].topline + pixelYOffset;
 	_string[2].xpos = 0 + pixelXOffset;
 	_string[2].right = _virtscr[kVerbVirtScreen].w - 1 + pixelXOffset;
-	_string[2].color = 16;
+	_string[2].color = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : 16;
 	drawString(2, (byte *)string);
 }
 
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index 973f13eb35a..66c2335c507 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -167,9 +167,9 @@ void ScummEngine_v0::resetVerbs() {
 	for (i = 1; i < 16; i++) {
 		vs = &_verbs[i];
 		vs->verbid = vtable[i - 1].id;
-		vs->color = 5;
-		vs->hicolor = 7;
-		vs->dimcolor = 11;
+		vs->color = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : 5;
+		vs->hicolor = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : 7;
+		vs->dimcolor = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : 11;
 		vs->type = kTextVerbType;
 		vs->charset_nr = _string[0]._default.charset;
 		vs->curmode = 1;
@@ -205,9 +205,9 @@ void ScummEngine_v2::initV2MouseOver() {
 		_hiLiteColorVerbArrow = _hiLiteColorInvSentence = 15;
 
 	if (_game.platform == Common::kPlatformC64 || _game.platform == Common::kPlatformApple2GS) {
-		color = 16;
-		_hiLiteColorVerbArrow = _hiLiteColorInvSentence = 7;
-		arrow_color = 6;
+		color = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : 16;
+		_hiLiteColorVerbArrow = _hiLiteColorInvSentence = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : 7;
+		arrow_color = (_game.platform == Common::kPlatformApple2GS && !enhancementEnabled(kEnhVisualChanges)) ? 1 : 6;
 	} else {
 		color = 13;
 		arrow_color = 1;




More information about the Scummvm-git-logs mailing list