diff options
author | Strangerke | 2013-09-08 22:23:58 +0200 |
---|---|---|
committer | Strangerke | 2013-09-08 22:23:58 +0200 |
commit | e77db05208bede59f9a3aa33ba8c3b175e48b0fc (patch) | |
tree | 0701d320d9818771a5aa55f21ab7299b77663679 /engines/avalanche | |
parent | cb66911ed2d9c0c19bf2ecec3eb71d398e5a94b7 (diff) | |
download | scummvm-rg350-e77db05208bede59f9a3aa33ba8c3b175e48b0fc.tar.gz scummvm-rg350-e77db05208bede59f9a3aa33ba8c3b175e48b0fc.tar.bz2 scummvm-rg350-e77db05208bede59f9a3aa33ba8c3b175e48b0fc.zip |
AVALANCHE: Rework some more string uses
Diffstat (limited to 'engines/avalanche')
-rw-r--r-- | engines/avalanche/animation.cpp | 3 | ||||
-rw-r--r-- | engines/avalanche/gyro2.cpp | 27 | ||||
-rw-r--r-- | engines/avalanche/scrolls2.cpp | 10 |
3 files changed, 18 insertions, 22 deletions
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 006ed5a3d3..d3f66ede09 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -53,9 +53,8 @@ void AnimationType::init(byte spritenum, bool doCheck, Animation *anim) { if (spritenum == 177) return; // Already running! - Common::String filename; Common::File inf; - filename = filename.format("sprite%d.avd", spritenum); + Common::String filename = Common::String::format("sprite%d.avd", spritenum); if (!inf.open(filename)) { warning("AVALANCHE: Trip: File not found: %s", filename.c_str()); return; diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index ab1b9d8686..70c2150d1e 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -190,8 +190,7 @@ Gyro::~Gyro() { } Common::String Gyro::intToStr(int32 num) { - Common::String result = Common::String::format("%d", num); - return result; + return Common::String::format("%d", num); } void Gyro::newMouse(byte id) { @@ -427,34 +426,32 @@ Common::String Gyro::getItem(byte which) { Common::String Gyro::f5Does() { - Common::String f5_does_result; switch (_dna._room) { - case r__yours: { - if (!_dna._avvyIsAwake) - return Common::String(_vm->_acci->kVerbCodeWake) + "WWake up"; - else if (_dna._avvyInBed) - return Common::String(_vm->_acci->kVerbCodeStand) + "GGet up"; - } + case r__yours: + if (!_dna._avvyIsAwake) + return Common::String::format("%cWWake up", Acci::kVerbCodeWake); + else if (_dna._avvyInBed) + return Common::String::format("%cGGet up", Acci::kVerbCodeStand); break; case r__insidecardiffcastle: if (_dna._standingOnDais) - return Common::String(_vm->_acci->kVerbCodeClimb) + "CClimb down"; + return Common::String::format("%cCClimb down", Acci::kVerbCodeClimb); else - return Common::String(_vm->_acci->kVerbCodeClimb) + "CClimb up"; + return Common::String::format("%cCClimb up", Acci::kVerbCodeClimb); break; case r__nottspub: if (_dna._sittingInPub) - return Common::String(_vm->_acci->kVerbCodeStand) + "SStand up"; + return Common::String::format("%cSStand up", Acci::kVerbCodeStand); else - return Common::String(_vm->_acci->kVerbCodeSit) + "SSit down"; + return Common::String::format("%cSSit down", Acci::kVerbCodeSit); break; case r__musicroom: if (_vm->_animation->inField(7)) - return Common::String(_vm->_acci->kVerbCodePlay) + "PPlay the harp"; + return Common::String::format("%cPPlay the harp", Acci::kVerbCodePlay); break; } - return Common::String(_vm->_acci->kPardon); // If all else fails... + return Common::String::format("%c", _vm->_acci->kPardon); // If all else fails... } void Gyro::loadMouse(byte which) { diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index d4cd5b1f3a..ab895a1660 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -85,7 +85,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { byte lz = z.size(); bool offset = x % 8 == 4; - x = x / 8; + x /= 8; y++; int16 i = 0; for (byte xx = 0; xx < lz; xx++) { @@ -112,7 +112,7 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { } void Scrolls::scrollModeNormal() { - Common::String egg = Common::String(kControlParagraph) + kControlLeftJustified + kControlNegative + kControlBell + kControlBackspace + "***"; + Common::String egg = Common::String::format("%c%c%c%c%c***", kControlParagraph, kControlLeftJustified, kControlNegative, kControlBell, kControlBackspace); Common::String e = "(c) 1994"; setReadyLight(3); @@ -161,7 +161,8 @@ void Scrolls::scrollModeNormal() { if (aboutscroll) { move(e[2 - 1], e[1 - 1], 7); e[8 - 1] = inchar; - if (egg == e) easteregg(); + if (egg == e) + easteregg(); } oktoexit = set::of('\15', '\33', '+', '#', eos).has(inchar); if (! oktoexit) errorled(); @@ -278,9 +279,8 @@ void Scrolls::getIcon(int16 x, int16 y, byte which) { void Scrolls::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) { Common::File file; + Common::String filename = Common::String::format("%s.avd", fn.c_str()); - Common::String filename; - filename = filename.format("%s.avd", fn.c_str()); if (!file.open(filename)) { warning("AVALANCHE: Scrolls: File not found: %s", filename.c_str()); return; |