diff options
author | Max Horn | 2010-11-01 16:02:28 +0000 |
---|---|---|
committer | Max Horn | 2010-11-01 16:02:28 +0000 |
commit | e27b05ef358102fd60235a5f78d7d51e9f25a5f4 (patch) | |
tree | 50e994a47741bf619de730f6a3ece5d0a0cc7e95 /engines/lastexpress/game | |
parent | 7a853650047064fb15720bb58ce7c5eec28ef606 (diff) | |
download | scummvm-rg350-e27b05ef358102fd60235a5f78d7d51e9f25a5f4.tar.gz scummvm-rg350-e27b05ef358102fd60235a5f78d7d51e9f25a5f4.tar.bz2 scummvm-rg350-e27b05ef358102fd60235a5f78d7d51e9f25a5f4.zip |
COMMON: Rename String::printf() to String::format()
This is a first step towards getting rid of all uses of regular printf,
fprintf, vprintf, vfprintf, puts, fputs, etc. in our codebase.
The name format() reflects the purpose of the function, and parallels
String.format() in Java, boost::format, and others.
svn-id: r54004
Diffstat (limited to 'engines/lastexpress/game')
-rw-r--r-- | engines/lastexpress/game/action.cpp | 10 | ||||
-rw-r--r-- | engines/lastexpress/game/entities.cpp | 42 | ||||
-rw-r--r-- | engines/lastexpress/game/inventory.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/game/inventory.h | 2 | ||||
-rw-r--r-- | engines/lastexpress/game/object.cpp | 4 | ||||
-rw-r--r-- | engines/lastexpress/game/savepoint.h | 4 | ||||
-rw-r--r-- | engines/lastexpress/game/scenes.cpp | 4 | ||||
-rw-r--r-- | engines/lastexpress/game/state.h | 18 |
8 files changed, 43 insertions, 43 deletions
diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index 84f406931d..8058d22f05 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -454,7 +454,7 @@ IMPLEMENT_ACTION(savePoint) IMPLEMENT_ACTION(playSound) // Check that the file is not already buffered - if (hotspot.param2 || !getSound()->isBuffered(Common::String::printf("LIB%03d", hotspot.param1), true)) + if (hotspot.param2 || !getSound()->isBuffered(Common::String::format("LIB%03d", hotspot.param1), true)) getSound()->playSoundEvent(kEntityPlayer, hotspot.param1, hotspot.param2); return kSceneInvalid; @@ -464,7 +464,7 @@ IMPLEMENT_ACTION(playSound) // Action 4 IMPLEMENT_ACTION(playMusic) // Check that the file is not already buffered - Common::String filename = Common::String::printf("MUS%03d", hotspot.param1); + Common::String filename = Common::String::format("MUS%03d", hotspot.param1); if (!getSound()->isBuffered(filename) && (hotspot.param1 != 50 || getProgress().chapter == kChapter5)) getSound()->playSound(kEntityPlayer, filename, SoundManager::kFlagDefault, hotspot.param2); @@ -1182,7 +1182,7 @@ IMPLEMENT_ACTION(29) getProgress().field_C = 1; getSound()->playSoundEvent(kEntityPlayer, hotspot.param1, hotspot.param2); - Common::String filename = Common::String::printf("MUS%03d", hotspot.param3); + Common::String filename = Common::String::format("MUS%03d", hotspot.param3); if (!getSound()->isBuffered(filename)) getSound()->playSound(kEntityPlayer, filename, SoundManager::kFlagDefault); @@ -1407,7 +1407,7 @@ IMPLEMENT_ACTION(playMusicChapter) } if (id) { - Common::String filename = Common::String::printf("MUS%03d", id); + Common::String filename = Common::String::format("MUS%03d", id); if (!getSound()->isBuffered(filename)) getSound()->playSound(kEntityPlayer, filename, SoundManager::kFlagDefault); @@ -1439,7 +1439,7 @@ IMPLEMENT_ACTION(playMusicChapterSetupTrain) break; } - Common::String filename = Common::String::printf("MUS%03d", hotspot.param1); + Common::String filename = Common::String::format("MUS%03d", hotspot.param1); if (!getSound()->isBuffered(filename) && hotspot.param3 & id) { getSound()->playSound(kEntityPlayer, filename, SoundManager::kFlagDefault); diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp index 40fae3ae9b..adba0f1b4c 100644 --- a/engines/lastexpress/game/entities.cpp +++ b/engines/lastexpress/game/entities.cpp @@ -1532,7 +1532,7 @@ void Entities::getSequenceName(EntityIndex index, EntityDirection direction, Com case 1: if (data->entityPosition < kPosition_2587) - sequence1 = Common::String::printf("%02d%01d-01u.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-01u.seq", index, data->clothes); break; case 2: @@ -1554,22 +1554,22 @@ void Entities::getSequenceName(EntityIndex index, EntityDirection direction, Com break; if (data->entityPosition >= kPosition_8513) { - sequence1 = Common::String::printf("%02d%01d-%02deu.seq", index, data->clothes, position); + sequence1 = Common::String::format("%02d%01d-%02deu.seq", index, data->clothes, position); } else { - sequence1 = Common::String::printf("%02d%01d-03u.seq", index, data->clothes); - sequence2 = Common::String::printf("%02d%01d-%02deu.seq", index, data->clothes, position); + sequence1 = Common::String::format("%02d%01d-03u.seq", index, data->clothes); + sequence2 = Common::String::format("%02d%01d-%02deu.seq", index, data->clothes, position); data->field_4A9 = true; } break; case 18: if (data->entityPosition < kPosition_9270) - sequence1 = Common::String::printf("%02d%01d-18u.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-18u.seq", index, data->clothes); break; case 22: if (getData(kEntityPlayer)->entityPosition > data->entityPosition) - sequence1 = Common::String::printf("%02d%01d-22u.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-22u.seq", index, data->clothes); break; case 23: @@ -1592,18 +1592,18 @@ void Entities::getSequenceName(EntityIndex index, EntityDirection direction, Com break; if (data->entityPosition >= kPosition_2087) { - sequence1 = Common::String::printf("%02d%01d-38u.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-38u.seq", index, data->clothes); data->field_4A9 = true; } else { - sequence1 = Common::String::printf("%02d%01d-%02deu.seq", index, data->clothes, position); - sequence2 = Common::String::printf("%02d%01d-38u.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-%02deu.seq", index, data->clothes, position); + sequence2 = Common::String::format("%02d%01d-38u.seq", index, data->clothes); data->field_4AA = true; } break; case 40: if (getData(kEntityPlayer)->entityPosition > data->entityPosition) - sequence1 = Common::String::printf("%02d%01d-40u.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-40u.seq", index, data->clothes); break; } break; @@ -1615,7 +1615,7 @@ void Entities::getSequenceName(EntityIndex index, EntityDirection direction, Com case 1: if (getData(kEntityPlayer)->entityPosition < data->entityPosition) - sequence1 = Common::String::printf("%02d%01d-01d.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-01d.seq", index, data->clothes); break; case 2: @@ -1637,23 +1637,23 @@ void Entities::getSequenceName(EntityIndex index, EntityDirection direction, Com break; if (data->entityPosition <= kPosition_8513) { - sequence1 = Common::String::printf("%02d%01d-03d.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-03d.seq", index, data->clothes); data->field_4A9 = true; } else { - sequence1 = Common::String::printf("%02d%01d-%02ded.seq", index, data->clothes, position); - sequence2 = Common::String::printf("%02d%01d-03d.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-%02ded.seq", index, data->clothes, position); + sequence2 = Common::String::format("%02d%01d-03d.seq", index, data->clothes); data->field_4AA = true; } break; case 18: if (getData(kEntityPlayer)->entityPosition < data->entityPosition) - sequence1 = Common::String::printf("%02d%01d-18d.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-18d.seq", index, data->clothes); break; case 22: if (data->entityPosition > kPosition_850) - sequence1 = Common::String::printf("%02d%01d-22d.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-22d.seq", index, data->clothes); break; case 23: @@ -1676,17 +1676,17 @@ void Entities::getSequenceName(EntityIndex index, EntityDirection direction, Com break; if (data->entityPosition <= kPosition_2087) { - sequence1 = Common::String::printf("%02d%01d-%02ded.seq", index, data->clothes, position); + sequence1 = Common::String::format("%02d%01d-%02ded.seq", index, data->clothes, position); } else { - sequence1 = Common::String::printf("%02d%01d-38d.seq", index, data->clothes); - sequence2 = Common::String::printf("%02d%01d-%02ded.seq", index, data->clothes, position); + sequence1 = Common::String::format("%02d%01d-38d.seq", index, data->clothes); + sequence2 = Common::String::format("%02d%01d-%02ded.seq", index, data->clothes, position); data->field_4A9 = true; } break; case 40: if (getData(kEntityPlayer)->entityPosition > kPosition_8013) - sequence1 = Common::String::printf("%02d%01d-40d.seq", index, data->clothes); + sequence1 = Common::String::format("%02d%01d-40d.seq", index, data->clothes); break; } break; @@ -1694,7 +1694,7 @@ void Entities::getSequenceName(EntityIndex index, EntityDirection direction, Com // First part of sequence is already set case kDirectionLeft: case kDirectionRight: - sequence1 = Common::String::printf("%s%02d.seq", data->sequenceNamePrefix.c_str(), position); + sequence1 = Common::String::format("%s%02d.seq", data->sequenceNamePrefix.c_str(), position); break; } } diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp index 0223176cb6..ae9aca56b6 100644 --- a/engines/lastexpress/game/inventory.cpp +++ b/engines/lastexpress/game/inventory.cpp @@ -422,7 +422,7 @@ Common::String Inventory::toString() { Common::String ret = ""; for (int i = 0; i < kPortraitOriginal; i++) - ret += Common::String::printf("%d : %s\n", i, _entries[i].toString().c_str()); + ret += Common::String::format("%d : %s\n", i, _entries[i].toString().c_str()); return ret; } diff --git a/engines/lastexpress/game/inventory.h b/engines/lastexpress/game/inventory.h index af3478bfae..bae6c8d261 100644 --- a/engines/lastexpress/game/inventory.h +++ b/engines/lastexpress/game/inventory.h @@ -76,7 +76,7 @@ public: } Common::String toString() { - return Common::String::printf("{ %d - %d - %d - %d - %d - %d - %d }", cursor, scene, field_2, isSelectable, isPresent, manualSelect, location); + return Common::String::format("{ %d - %d - %d - %d - %d - %d - %d }", cursor, scene, field_2, isSelectable, isPresent, manualSelect, location); } void saveLoadWithSerializer(Common::Serializer &s) { diff --git a/engines/lastexpress/game/object.cpp b/engines/lastexpress/game/object.cpp index f0e81781b6..4f296debcb 100644 --- a/engines/lastexpress/game/object.cpp +++ b/engines/lastexpress/game/object.cpp @@ -35,7 +35,7 @@ namespace LastExpress { Common::String Objects::Object::toString() { - return Common::String::printf("{ %s - %d - %d - %d - %d }", ENTITY_NAME(entity), location, cursor, cursor2, location2); + return Common::String::format("{ %s - %d - %d - %d - %d }", ENTITY_NAME(entity), location, cursor, cursor2, location2); } Objects::Objects(LastExpressEngine *engine) : _engine(engine) {} @@ -101,7 +101,7 @@ Common::String Objects::toString() { Common::String ret = ""; for (int i = 0; i < ARRAYSIZE(_objects); i++) - ret += Common::String::printf("%d : %s\n", i, _objects[i].toString().c_str()); + ret += Common::String::format("%d : %s\n", i, _objects[i].toString().c_str()); return ret; } diff --git a/engines/lastexpress/game/savepoint.h b/engines/lastexpress/game/savepoint.h index 6b2c12751d..ca507ab8ab 100644 --- a/engines/lastexpress/game/savepoint.h +++ b/engines/lastexpress/game/savepoint.h @@ -73,7 +73,7 @@ struct SavePoint { } Common::String toString() { - return Common::String::printf("{ %s - %d - %s - %s }", ENTITY_NAME(entity1), action, ENTITY_NAME(entity2), param.charValue); + return Common::String::format("{ %s - %d - %s - %s }", ENTITY_NAME(entity1), action, ENTITY_NAME(entity2), param.charValue); } }; @@ -97,7 +97,7 @@ public: } Common::String toString() { - return Common::String::printf(" { %s - %d - %s - %d }", ENTITY_NAME(entity1), action, ENTITY_NAME(entity2), param); + return Common::String::format(" { %s - %d - %s - %d }", ENTITY_NAME(entity1), action, ENTITY_NAME(entity2), param); } }; diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp index 7fd0a3f0ac..cf50d3e425 100644 --- a/engines/lastexpress/game/scenes.cpp +++ b/engines/lastexpress/game/scenes.cpp @@ -78,7 +78,7 @@ void SceneManager::loadSceneDataFile(ArchiveIndex archive) { case kArchiveCd1: case kArchiveCd2: case kArchiveCd3: - if (!_sceneLoader->load(getArchive(Common::String::printf("CD%iTRAIN.DAT", archive)))) + if (!_sceneLoader->load(getArchive(Common::String::format("CD%iTRAIN.DAT", archive)))) error("SceneManager::loadSceneDataFile: cannot load data file CD%iTRAIN.DAT", archive); break; @@ -586,7 +586,7 @@ void SceneManager::updateDoorsAndClock() { // Load door sequence Scene *scene = getScenes()->get(getState()->scene); - Common::String name = Common::String::printf("633X%c-%02d.seq", (index - firstIndex) + 65, scene->position); + Common::String name = Common::String::format("633X%c-%02d.seq", (index - firstIndex) + 65, scene->position); Sequence *sequence = loadSequence1(name, 255); // If the sequence doesn't exists, skip diff --git a/engines/lastexpress/game/state.h b/engines/lastexpress/game/state.h index 135ee6bb4e..da81794ce1 100644 --- a/engines/lastexpress/game/state.h +++ b/engines/lastexpress/game/state.h @@ -466,7 +466,7 @@ public: for (uint i = 0; i < 128; i++) { Common::String name = ""; uint val = getValueName(i, &name); - ret += Common::String::printf("(%03d) %s = %d\n", i, name.c_str(), val); + ret += Common::String::format("(%03d) %s = %d\n", i, name.c_str(), val); } return ret; @@ -527,9 +527,9 @@ public: uint8 minutes = 0; getHourMinutes(time, &hours, &minutes); - ret += Common::String::printf("Time: %d (%d:%d) - Time delta: %d - Ticks: %d\n", time, hours, minutes, timeDelta, timeTicks); - ret += Common::String::printf("Brightness: %d - Volume: %d - UseBackup: %d\n", brightness, volume, sceneUseBackup); - ret += Common::String::printf("Scene: %d - Scene backup: %d - Scene backup 2: %d\n", scene, sceneBackup, sceneBackup2); + ret += Common::String::format("Time: %d (%d:%d) - Time delta: %d - Ticks: %d\n", time, hours, minutes, timeDelta, timeTicks); + ret += Common::String::format("Brightness: %d - Volume: %d - UseBackup: %d\n", brightness, volume, sceneUseBackup); + ret += Common::String::format("Scene: %d - Scene backup: %d - Scene backup 2: %d\n", scene, sceneBackup, sceneBackup2); return ret; } @@ -598,11 +598,11 @@ public: Common::String toString() { Common::String ret = ""; - ret += Common::String::printf("Unknown: 0:%02d - 3:%02d - 4:%02d - 5:%02d\n", flag_0, flag_3, flag_4, flag_5); - ret += Common::String::printf("FrameInterval: %02d - ShouldRedraw:%02d - ShouldDrawEggOrHourGlass:%02d\n", frameInterval, shouldRedraw, shouldDrawEggOrHourGlass); - ret += Common::String::printf("IsGameRunning: %02d\n", isGameRunning); - ret += Common::String::printf("Mouse: RightClick:%02d - LeftClick:%02d\n", mouseRightClick, mouseLeftClick); - ret += Common::String::printf("Entities: 0:%02d - 1:%02d\n", flag_entities_0, flag_entities_1); + ret += Common::String::format("Unknown: 0:%02d - 3:%02d - 4:%02d - 5:%02d\n", flag_0, flag_3, flag_4, flag_5); + ret += Common::String::format("FrameInterval: %02d - ShouldRedraw:%02d - ShouldDrawEggOrHourGlass:%02d\n", frameInterval, shouldRedraw, shouldDrawEggOrHourGlass); + ret += Common::String::format("IsGameRunning: %02d\n", isGameRunning); + ret += Common::String::format("Mouse: RightClick:%02d - LeftClick:%02d\n", mouseRightClick, mouseLeftClick); + ret += Common::String::format("Entities: 0:%02d - 1:%02d\n", flag_entities_0, flag_entities_1); return ret; } |