aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen
diff options
context:
space:
mode:
authorPaul Gilbert2018-02-23 19:01:04 -0500
committerPaul Gilbert2018-02-23 19:01:20 -0500
commitd5deec56c839a9bc90d7dad9afc4014f03b96201 (patch)
tree0c066bbb55b92f99119dcf0f7c07eb020f241a00 /engines/xeen
parentb5df2f8ec7c65fb427f903269c1b7a3f8e0eaba7 (diff)
downloadscummvm-rg350-d5deec56c839a9bc90d7dad9afc4014f03b96201.tar.gz
scummvm-rg350-d5deec56c839a9bc90d7dad9afc4014f03b96201.tar.bz2
scummvm-rg350-d5deec56c839a9bc90d7dad9afc4014f03b96201.zip
XEEN: Simplify showPharaohEndText method to use const char *
Diffstat (limited to 'engines/xeen')
-rw-r--r--engines/xeen/worldofxeen/darkside_cutscenes.cpp10
-rw-r--r--engines/xeen/worldofxeen/darkside_cutscenes.h8
-rw-r--r--engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp2
3 files changed, 5 insertions, 15 deletions
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
index b02e7d9608..a772500eaa 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 9c8db4d8ae..f2dd5c5045 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 f53de8d94f..07fde8f017 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");