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

dreammaster dreammaster at scummvm.org
Sat Feb 24 01:01:22 CET 2018


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:
d5deec56c8 XEEN: Simplify showPharaohEndText method to use const char *


Commit: d5deec56c839a9bc90d7dad9afc4014f03b96201
    https://github.com/scummvm/scummvm/commit/d5deec56c839a9bc90d7dad9afc4014f03b96201
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-02-23T19:01:20-05:00

Commit Message:
XEEN: Simplify showPharaohEndText method to use const char *

Changed paths:
    engines/xeen/worldofxeen/darkside_cutscenes.cpp
    engines/xeen/worldofxeen/darkside_cutscenes.h
    engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp


diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
index b02e7d9..a772500 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
@@ -1203,7 +1203,7 @@ void DarkSideCutscenes::showDarkSideScore(uint endingScore) {
 	saves.saveGame();
 }
 
-void DarkSideCutscenes::showPharaohEndText(const Common::String &msg1, const Common::String &msg2, const Common::String &msg3) {
+void DarkSideCutscenes::showPharaohEndText(const char *msg1, const char *msg2, const char *msg3) {
 	const int YLIST[32] = {
 		-3, -3, -3, -3, -3, -3, -3, -3, -1, 0, 0, 0, 0, 0, 0, 0,
 		-1, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3
@@ -1225,12 +1225,8 @@ void DarkSideCutscenes::showPharaohEndText(const Common::String &msg1, const Com
 	Windows &windows = *_vm->_windows;
 	SpriteResource claw("claw.int");
 	SpriteResource dragon1("dragon1.int");
-	int numPages = 0 + (msg1.empty() ? 0 : 1) + (msg2.empty() ? 0 : 1) + (msg3.empty() ? 0 : 1);
-	const char *const text[3] = { 
-		msg1.empty() ? nullptr : msg1.c_str(),
-		msg2.empty() ? nullptr : msg2.c_str(),
-		msg3.empty() ? nullptr : msg3.c_str()
-	};
+	int numPages = 0 + (msg1 ? 1 : 0) + (msg2 ? 1 : 0) + (msg3 ? 1 : 0);
+	const char *const text[3] = { msg1, msg2, msg3 };
 
 	screen.loadBackground("3room.raw");
 	screen.saveBackground();
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.h b/engines/xeen/worldofxeen/darkside_cutscenes.h
index 9c8db4d..f2dd5c5 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.h
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.h
@@ -61,13 +61,7 @@ protected:
 	/**
 	 * Shows the Pharaoh ending screen where score text is shown
 	 */
-	void showPharaohEndText(const Common::String &msg1, const Common::String &msg2, const Common::String &msg3);
-	void showPharaohEndText(const Common::String &msg1) {
-		showPharaohEndText(msg1, "", "");
-	}
-	void showPharaohEndText(const Common::String &msg1, const Common::String &msg2) {
-		showPharaohEndText(msg1, msg2, "");
-	}
+	void showPharaohEndText(const char *msg1, const char *msg2 = nullptr, const char *msg3 = nullptr);
 public:
 	DarkSideCutscenes(XeenEngine *vm) : Cutscenes(vm) {}
 
diff --git a/engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp b/engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp
index f53de8d..07fde8f 100644
--- a/engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp
@@ -51,7 +51,7 @@ void WorldOfXeenCutscenes::worldEnding1() {
 
 	files.setGameCc(0);
 	sound.playSong("outday3.m");
-	showPharaohEndText(Res.WORLD_END_TEXT[0], nullptr, nullptr);
+	showPharaohEndText(Res.WORLD_END_TEXT[0]);
 	sound.playSound("elect.voc", 1, 0);
 
 	screen.loadBackground("skymain.raw");





More information about the Scummvm-git-logs mailing list