COMMON: Get rid of Common::StringList
svn-id: r48287
This commit is contained in:
parent
81a698d0a0
commit
cac0ac66e2
54 changed files with 108 additions and 116 deletions
|
@ -37,13 +37,6 @@ namespace Common {
|
||||||
typedef Array<String> StringArray;
|
typedef Array<String> StringArray;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Alias for type StringArray. For backwards compatibility only.
|
|
||||||
* @deprecated Use StringArray instead!
|
|
||||||
*/
|
|
||||||
typedef StringArray StringList;
|
|
||||||
|
|
||||||
|
|
||||||
} // End of namespace Common
|
} // End of namespace Common
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1048,7 +1048,7 @@ bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD
|
||||||
SaveStateList AgiMetaEngine::listSaves(const char *target) const {
|
SaveStateList AgiMetaEngine::listSaves(const char *target) const {
|
||||||
const uint32 AGIflag = MKID_BE('AGI:');
|
const uint32 AGIflag = MKID_BE('AGI:');
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
char saveDesc[31];
|
char saveDesc[31];
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern += ".???";
|
pattern += ".???";
|
||||||
|
@ -1057,7 +1057,7 @@ SaveStateList AgiMetaEngine::listSaves(const char *target) const {
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||||
int slotNum = atoi(file->c_str() + file->size() - 3);
|
int slotNum = atoi(file->c_str() + file->size() - 3);
|
||||||
|
|
||||||
|
|
|
@ -1194,16 +1194,16 @@ bool IIgsSoundMgr::loadWaveFile(const Common::FSNode &wavePath, const IIgsExeInf
|
||||||
*/
|
*/
|
||||||
struct fsnodeNameEqualsIgnoreCase : public Common::UnaryFunction<const Common::FSNode&, bool> {
|
struct fsnodeNameEqualsIgnoreCase : public Common::UnaryFunction<const Common::FSNode&, bool> {
|
||||||
// FIXME: This should be replaced; use SearchMan instead
|
// FIXME: This should be replaced; use SearchMan instead
|
||||||
fsnodeNameEqualsIgnoreCase(const Common::StringList &str) : _str(str) {}
|
fsnodeNameEqualsIgnoreCase(const Common::StringArray &str) : _str(str) {}
|
||||||
fsnodeNameEqualsIgnoreCase(const Common::String str) { _str.push_back(str); }
|
fsnodeNameEqualsIgnoreCase(const Common::String str) { _str.push_back(str); }
|
||||||
bool operator()(const Common::FSNode ¶m) const {
|
bool operator()(const Common::FSNode ¶m) const {
|
||||||
for (Common::StringList::const_iterator iter = _str.begin(); iter != _str.end(); ++iter)
|
for (Common::StringArray::const_iterator iter = _str.begin(); iter != _str.end(); ++iter)
|
||||||
if (param.getName().equalsIgnoreCase(*iter))
|
if (param.getName().equalsIgnoreCase(*iter))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
Common::StringList _str;
|
Common::StringArray _str;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool SoundMgr::loadInstruments() {
|
bool SoundMgr::loadInstruments() {
|
||||||
|
@ -1229,12 +1229,12 @@ bool SoundMgr::loadInstruments() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Populate executable filenames list (Long filename and short filename) for searching
|
// Populate executable filenames list (Long filename and short filename) for searching
|
||||||
Common::StringList exeNames;
|
Common::StringArray exeNames;
|
||||||
exeNames.push_back(Common::String(exeInfo->exePrefix) + ".SYS16");
|
exeNames.push_back(Common::String(exeInfo->exePrefix) + ".SYS16");
|
||||||
exeNames.push_back(Common::String(exeInfo->exePrefix) + ".SYS");
|
exeNames.push_back(Common::String(exeInfo->exePrefix) + ".SYS");
|
||||||
|
|
||||||
// Populate wave filenames list (Long filename and short filename) for searching
|
// Populate wave filenames list (Long filename and short filename) for searching
|
||||||
Common::StringList waveNames;
|
Common::StringArray waveNames;
|
||||||
waveNames.push_back("SIERRASTANDARD");
|
waveNames.push_back("SIERRASTANDARD");
|
||||||
waveNames.push_back("SIERRAST");
|
waveNames.push_back("SIERRAST");
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,7 @@ bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame
|
||||||
|
|
||||||
SaveStateList AgosMetaEngine::listSaves(const char *target) const {
|
SaveStateList AgosMetaEngine::listSaves(const char *target) const {
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
Common::String saveDesc;
|
Common::String saveDesc;
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern += ".???";
|
pattern += ".???";
|
||||||
|
@ -194,7 +194,7 @@ SaveStateList AgosMetaEngine::listSaves(const char *target) const {
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||||
int slotNum = atoi(file->c_str() + file->size() - 3);
|
int slotNum = atoi(file->c_str() + file->size() - 3);
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace AGOS {
|
||||||
|
|
||||||
int AGOSEngine::countSaveGames() {
|
int AGOSEngine::countSaveGames() {
|
||||||
Common::InSaveFile *f;
|
Common::InSaveFile *f;
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
uint i = 1;
|
uint i = 1;
|
||||||
char slot[4];
|
char slot[4];
|
||||||
int slotNum;
|
int slotNum;
|
||||||
|
@ -49,7 +49,7 @@ int AGOSEngine::countSaveGames() {
|
||||||
memset(marks, false, 256 * sizeof(bool)); //assume no savegames for this title
|
memset(marks, false, 256 * sizeof(bool)); //assume no savegames for this title
|
||||||
filenames = _saveFileMan->listSavefiles(prefix);
|
filenames = _saveFileMan->listSavefiles(prefix);
|
||||||
|
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file){
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file){
|
||||||
//Obtain the last 3 digits of the filename, since they correspond to the save slot
|
//Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||||
slot[0] = file->c_str()[file->size()-3];
|
slot[0] = file->c_str()[file->size()-3];
|
||||||
slot[1] = file->c_str()[file->size()-2];
|
slot[1] = file->c_str()[file->size()-2];
|
||||||
|
|
|
@ -130,7 +130,7 @@ public:
|
||||||
|
|
||||||
Common::RandomSource _rnd;
|
Common::RandomSource _rnd;
|
||||||
|
|
||||||
Common::StringList _volumeResourceFiles;
|
Common::StringArray _volumeResourceFiles;
|
||||||
StringPtrHashMap _volumeEntriesMap;
|
StringPtrHashMap _volumeEntriesMap;
|
||||||
TextHandler _textHandler;
|
TextHandler _textHandler;
|
||||||
|
|
||||||
|
|
|
@ -619,9 +619,9 @@ SaveStateList CineMetaEngine::listSaves(const char *target) const {
|
||||||
|
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern += ".?";
|
pattern += ".?";
|
||||||
Common::StringList filenames = saveFileMan->listSavefiles(pattern);
|
Common::StringArray filenames = saveFileMan->listSavefiles(pattern);
|
||||||
sort(filenames.begin(), filenames.end());
|
sort(filenames.begin(), filenames.end());
|
||||||
Common::StringList::const_iterator file;
|
Common::StringArray::const_iterator file;
|
||||||
|
|
||||||
Common::String filename = target;
|
Common::String filename = target;
|
||||||
filename += ".dir";
|
filename += ".dir";
|
||||||
|
|
|
@ -833,7 +833,7 @@ void FWRenderer::clearMenuStack() {
|
||||||
delete menu;
|
delete menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectionMenu::SelectionMenu(Common::Point p, int width, Common::StringList elements)
|
SelectionMenu::SelectionMenu(Common::Point p, int width, Common::StringArray elements)
|
||||||
: Menu(kSelectionMenu), _pos(p), _width(width), _elements(elements), _selection(-1) {
|
: Menu(kSelectionMenu), _pos(p), _width(width), _elements(elements), _selection(-1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ private:
|
||||||
|
|
||||||
class SelectionMenu : public Menu {
|
class SelectionMenu : public Menu {
|
||||||
public:
|
public:
|
||||||
SelectionMenu(Common::Point p, int width, Common::StringList elements);
|
SelectionMenu(Common::Point p, int width, Common::StringArray elements);
|
||||||
|
|
||||||
int getElementCount() const { return _elements.size(); }
|
int getElementCount() const { return _elements.size(); }
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ public:
|
||||||
private:
|
private:
|
||||||
const Common::Point _pos;
|
const Common::Point _pos;
|
||||||
const int _width;
|
const int _width;
|
||||||
const Common::StringList _elements;
|
const Common::StringArray _elements;
|
||||||
|
|
||||||
int _selection;
|
int _selection;
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace Cine {
|
||||||
|
|
||||||
// FIXME: Global C++ objects affect portability negatively.
|
// FIXME: Global C++ objects affect portability negatively.
|
||||||
// Turn this into a class member instead.
|
// Turn this into a class member instead.
|
||||||
Common::StringList messageTable;
|
Common::StringArray messageTable;
|
||||||
|
|
||||||
void loadMsg(char *pMsgName) {
|
void loadMsg(char *pMsgName) {
|
||||||
uint32 sourceSize;
|
uint32 sourceSize;
|
||||||
|
|
|
@ -502,7 +502,7 @@ void processInventory(int16 x, int16 y) {
|
||||||
if (!listSize)
|
if (!listSize)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Common::StringList list;
|
Common::StringArray list;
|
||||||
for (int i = 0; i < listSize; ++i)
|
for (int i = 0; i < listSize; ++i)
|
||||||
list.push_back(objectListCommand[i]);
|
list.push_back(objectListCommand[i]);
|
||||||
SelectionMenu *menu = new SelectionMenu(Common::Point(x, y), menuWidth, list);
|
SelectionMenu *menu = new SelectionMenu(Common::Point(x, y), menuWidth, list);
|
||||||
|
@ -706,7 +706,7 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
|
||||||
Y = 199 - paramY;
|
Y = 199 - paramY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::StringList list;
|
Common::StringArray list;
|
||||||
for (uint16 i = 0; i < height; ++i)
|
for (uint16 i = 0; i < height; ++i)
|
||||||
list.push_back(commandList[i]);
|
list.push_back(commandList[i]);
|
||||||
menu = new SelectionMenu(Common::Point(X, Y), width, list);
|
menu = new SelectionMenu(Common::Point(X, Y), width, list);
|
||||||
|
|
|
@ -66,7 +66,7 @@ private:
|
||||||
bool _preLoad;
|
bool _preLoad;
|
||||||
Debugger *_debugger;
|
Debugger *_debugger;
|
||||||
PCSound *_sound;
|
PCSound *_sound;
|
||||||
Common::StringList _langStrings;
|
Common::StringArray _langStrings;
|
||||||
CursorType _savedCursor;
|
CursorType _savedCursor;
|
||||||
uint32 lastTick, lastTickDebug;
|
uint32 lastTick, lastTickDebug;
|
||||||
int _gameSpeed;
|
int _gameSpeed;
|
||||||
|
|
|
@ -271,14 +271,14 @@ bool CruiseMetaEngine::hasFeature(MetaEngineFeature f) const {
|
||||||
|
|
||||||
SaveStateList CruiseMetaEngine::listSaves(const char *target) const {
|
SaveStateList CruiseMetaEngine::listSaves(const char *target) const {
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
Common::String pattern("cruise.s??");
|
Common::String pattern("cruise.s??");
|
||||||
|
|
||||||
filenames = saveFileMan->listSavefiles(pattern);
|
filenames = saveFileMan->listSavefiles(pattern);
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
||||||
int slotNum = atoi(file->c_str() + file->size() - 2);
|
int slotNum = atoi(file->c_str() + file->size() - 2);
|
||||||
|
|
||||||
|
|
|
@ -130,14 +130,14 @@ bool DraciMetaEngine::hasFeature(MetaEngineFeature f) const {
|
||||||
|
|
||||||
SaveStateList DraciMetaEngine::listSaves(const char *target) const {
|
SaveStateList DraciMetaEngine::listSaves(const char *target) const {
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
Common::String pattern("draci.s??");
|
Common::String pattern("draci.s??");
|
||||||
|
|
||||||
filenames = saveFileMan->listSavefiles(pattern);
|
filenames = saveFileMan->listSavefiles(pattern);
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
||||||
int slotNum = atoi(file->c_str() + file->size() - 2);
|
int slotNum = atoi(file->c_str() + file->size() - 2);
|
||||||
|
|
||||||
|
|
|
@ -50,13 +50,13 @@ SaveStateList SaveLoad::listValidSaves(const Common::String &target) {
|
||||||
|
|
||||||
// Get the list of savefiles
|
// Get the list of savefiles
|
||||||
Common::String pattern = target + ".00?";
|
Common::String pattern = target + ".00?";
|
||||||
Common::StringList savefiles = g_system->getSavefileManager()->listSavefiles(pattern);
|
Common::StringArray savefiles = g_system->getSavefileManager()->listSavefiles(pattern);
|
||||||
|
|
||||||
// Sort the list of filenames
|
// Sort the list of filenames
|
||||||
sort(savefiles.begin(), savefiles.end());
|
sort(savefiles.begin(), savefiles.end());
|
||||||
|
|
||||||
// Fill the information for the existing savegames
|
// Fill the information for the existing savegames
|
||||||
Common::StringList::iterator it = savefiles.begin();
|
Common::StringArray::iterator it = savefiles.begin();
|
||||||
while (it != savefiles.end()) {
|
while (it != savefiles.end()) {
|
||||||
int slot = it->lastChar() - '0';
|
int slot = it->lastChar() - '0';
|
||||||
SaveStateDescriptor descriptor;
|
SaveStateDescriptor descriptor;
|
||||||
|
|
|
@ -1321,12 +1321,12 @@ SaveStateList KyraMetaEngine::listSaves(const char *target) const {
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern += ".???";
|
pattern += ".???";
|
||||||
|
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
filenames = saveFileMan->listSavefiles(pattern);
|
filenames = saveFileMan->listSavefiles(pattern);
|
||||||
Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||||
int slotNum = atoi(file->c_str() + file->size() - 3);
|
int slotNum = atoi(file->c_str() + file->size() - 3);
|
||||||
|
|
||||||
|
|
|
@ -370,10 +370,10 @@ int GUI::redrawShadedButtonCallback(Button *button) {
|
||||||
|
|
||||||
void GUI::updateSaveList(bool excludeQuickSaves) {
|
void GUI::updateSaveList(bool excludeQuickSaves) {
|
||||||
Common::String pattern = _vm->_targetName + ".???";
|
Common::String pattern = _vm->_targetName + ".???";
|
||||||
Common::StringList saveFileList = _vm->_saveFileMan->listSavefiles(pattern);
|
Common::StringArray saveFileList = _vm->_saveFileMan->listSavefiles(pattern);
|
||||||
_saveSlots.clear();
|
_saveSlots.clear();
|
||||||
|
|
||||||
for (Common::StringList::const_iterator i = saveFileList.begin(); i != saveFileList.end(); ++i) {
|
for (Common::StringArray::const_iterator i = saveFileList.begin(); i != saveFileList.end(); ++i) {
|
||||||
char s1 = 0, s2 = 0, s3 = 0;
|
char s1 = 0, s2 = 0, s3 = 0;
|
||||||
s1 = (*i)[i->size()-3];
|
s1 = (*i)[i->size()-3];
|
||||||
s2 = (*i)[i->size()-2];
|
s2 = (*i)[i->size()-2];
|
||||||
|
|
|
@ -242,7 +242,7 @@ bool LureMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame
|
||||||
|
|
||||||
SaveStateList LureMetaEngine::listSaves(const char *target) const {
|
SaveStateList LureMetaEngine::listSaves(const char *target) const {
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
Common::String saveDesc;
|
Common::String saveDesc;
|
||||||
Common::String pattern = "lure.???";
|
Common::String pattern = "lure.???";
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ SaveStateList LureMetaEngine::listSaves(const char *target) const {
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||||
int slotNum = atoi(file->c_str() + file->size() - 3);
|
int slotNum = atoi(file->c_str() + file->size() - 3);
|
||||||
|
|
||||||
|
|
|
@ -510,7 +510,7 @@ bool RivenConsole::Cmd_DumpScript(int argc, const char **argv) {
|
||||||
|
|
||||||
// Load in Variable Names
|
// Load in Variable Names
|
||||||
Common::SeekableReadStream *nameStream = _vm->getRawData(ID_NAME, VariableNames);
|
Common::SeekableReadStream *nameStream = _vm->getRawData(ID_NAME, VariableNames);
|
||||||
Common::StringList varNames;
|
Common::StringArray varNames;
|
||||||
|
|
||||||
uint16 namesCount = nameStream->readUint16BE();
|
uint16 namesCount = nameStream->readUint16BE();
|
||||||
uint16 *stringOffsets = new uint16[namesCount];
|
uint16 *stringOffsets = new uint16[namesCount];
|
||||||
|
@ -531,7 +531,7 @@ bool RivenConsole::Cmd_DumpScript(int argc, const char **argv) {
|
||||||
|
|
||||||
// Load in External Command Names
|
// Load in External Command Names
|
||||||
nameStream = _vm->getRawData(ID_NAME, ExternalCommandNames);
|
nameStream = _vm->getRawData(ID_NAME, ExternalCommandNames);
|
||||||
Common::StringList xNames;
|
Common::StringArray xNames;
|
||||||
|
|
||||||
namesCount = nameStream->readUint16BE();
|
namesCount = nameStream->readUint16BE();
|
||||||
stringOffsets = new uint16[namesCount];
|
stringOffsets = new uint16[namesCount];
|
||||||
|
|
|
@ -1005,7 +1005,7 @@ bool MohawkMetaEngine::hasFeature(MetaEngineFeature f) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveStateList MohawkMetaEngine::listSaves(const char *target) const {
|
SaveStateList MohawkMetaEngine::listSaves(const char *target) const {
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
|
|
||||||
// Loading games is only supported in Myst/Riven currently.
|
// Loading games is only supported in Myst/Riven currently.
|
||||||
|
@ -1027,10 +1027,10 @@ SaveStateList MohawkMetaEngine::listSaves(const char *target) const {
|
||||||
void MohawkMetaEngine::removeSaveState(const char *target, int slot) const {
|
void MohawkMetaEngine::removeSaveState(const char *target, int slot) const {
|
||||||
// Removing saved games is only supported in Myst/Riven currently.
|
// Removing saved games is only supported in Myst/Riven currently.
|
||||||
if (strstr(target, "myst")) {
|
if (strstr(target, "myst")) {
|
||||||
Common::StringList filenames = g_system->getSavefileManager()->listSavefiles("*.mys");
|
Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles("*.mys");
|
||||||
g_system->getSavefileManager()->removeSavefile(filenames[slot].c_str());
|
g_system->getSavefileManager()->removeSavefile(filenames[slot].c_str());
|
||||||
} else if (strstr(target, "riven")) {
|
} else if (strstr(target, "riven")) {
|
||||||
Common::StringList filenames = g_system->getSavefileManager()->listSavefiles("*.rvn");
|
Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles("*.rvn");
|
||||||
g_system->getSavefileManager()->removeSavefile(filenames[slot].c_str());
|
g_system->getSavefileManager()->removeSavefile(filenames[slot].c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,7 +222,7 @@ Common::Error MohawkEngine_Myst::run() {
|
||||||
// Load game from launcher/command line if requested
|
// Load game from launcher/command line if requested
|
||||||
if (ConfMan.hasKey("save_slot") && !(getFeatures() & GF_DEMO)) {
|
if (ConfMan.hasKey("save_slot") && !(getFeatures() & GF_DEMO)) {
|
||||||
uint32 gameToLoad = ConfMan.getInt("save_slot");
|
uint32 gameToLoad = ConfMan.getInt("save_slot");
|
||||||
Common::StringList savedGamesList = _saveLoad->generateSaveGameList();
|
Common::StringArray savedGamesList = _saveLoad->generateSaveGameList();
|
||||||
if (gameToLoad > savedGamesList.size())
|
if (gameToLoad > savedGamesList.size())
|
||||||
error ("Could not find saved game");
|
error ("Could not find saved game");
|
||||||
_saveLoad->loadGame(savedGamesList[gameToLoad]);
|
_saveLoad->loadGame(savedGamesList[gameToLoad]);
|
||||||
|
@ -1593,7 +1593,7 @@ Common::Error MohawkEngine_Myst::loadGameState(int slot) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::Error MohawkEngine_Myst::saveGameState(int slot, const char *desc) {
|
Common::Error MohawkEngine_Myst::saveGameState(int slot, const char *desc) {
|
||||||
Common::StringList saveList = _saveLoad->generateSaveGameList();
|
Common::StringArray saveList = _saveLoad->generateSaveGameList();
|
||||||
|
|
||||||
if ((uint)slot < saveList.size())
|
if ((uint)slot < saveList.size())
|
||||||
_saveLoad->deleteSave(saveList[slot]);
|
_saveLoad->deleteSave(saveList[slot]);
|
||||||
|
|
|
@ -39,7 +39,7 @@ MystSaveLoad::~MystSaveLoad() {
|
||||||
delete _v;
|
delete _v;
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::StringList MystSaveLoad::generateSaveGameList() {
|
Common::StringArray MystSaveLoad::generateSaveGameList() {
|
||||||
return _saveFileMan->listSavefiles("*.mys");
|
return _saveFileMan->listSavefiles("*.mys");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ public:
|
||||||
MystSaveLoad(MohawkEngine_Myst*, Common::SaveFileManager*);
|
MystSaveLoad(MohawkEngine_Myst*, Common::SaveFileManager*);
|
||||||
~MystSaveLoad();
|
~MystSaveLoad();
|
||||||
|
|
||||||
Common::StringList generateSaveGameList();
|
Common::StringArray generateSaveGameList();
|
||||||
bool loadGame(Common::String);
|
bool loadGame(Common::String);
|
||||||
bool saveGame(Common::String);
|
bool saveGame(Common::String);
|
||||||
void deleteSave(Common::String);
|
void deleteSave(Common::String);
|
||||||
|
|
|
@ -98,7 +98,7 @@ Common::Error MohawkEngine_Riven::run() {
|
||||||
// Load game from launcher/command line if requested
|
// Load game from launcher/command line if requested
|
||||||
if (ConfMan.hasKey("save_slot") && !(getFeatures() & GF_DEMO)) {
|
if (ConfMan.hasKey("save_slot") && !(getFeatures() & GF_DEMO)) {
|
||||||
uint32 gameToLoad = ConfMan.getInt("save_slot");
|
uint32 gameToLoad = ConfMan.getInt("save_slot");
|
||||||
Common::StringList savedGamesList = _saveLoad->generateSaveGameList();
|
Common::StringArray savedGamesList = _saveLoad->generateSaveGameList();
|
||||||
if (gameToLoad > savedGamesList.size())
|
if (gameToLoad > savedGamesList.size())
|
||||||
error ("Could not find saved game");
|
error ("Could not find saved game");
|
||||||
_saveLoad->loadGame(savedGamesList[gameToLoad]);
|
_saveLoad->loadGame(savedGamesList[gameToLoad]);
|
||||||
|
@ -569,7 +569,7 @@ Common::Error MohawkEngine_Riven::loadGameState(int slot) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::Error MohawkEngine_Riven::saveGameState(int slot, const char *desc) {
|
Common::Error MohawkEngine_Riven::saveGameState(int slot, const char *desc) {
|
||||||
Common::StringList saveList = _saveLoad->generateSaveGameList();
|
Common::StringArray saveList = _saveLoad->generateSaveGameList();
|
||||||
|
|
||||||
if ((uint)slot < saveList.size())
|
if ((uint)slot < saveList.size())
|
||||||
_saveLoad->deleteSave(saveList[slot]);
|
_saveLoad->deleteSave(saveList[slot]);
|
||||||
|
|
|
@ -38,7 +38,7 @@ RivenSaveLoad::~RivenSaveLoad() {
|
||||||
delete _loadFile;
|
delete _loadFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::StringList RivenSaveLoad::generateSaveGameList() {
|
Common::StringArray RivenSaveLoad::generateSaveGameList() {
|
||||||
return _saveFileMan->listSavefiles("*.rvn");
|
return _saveFileMan->listSavefiles("*.rvn");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
RivenSaveLoad(MohawkEngine_Riven*, Common::SaveFileManager*);
|
RivenSaveLoad(MohawkEngine_Riven*, Common::SaveFileManager*);
|
||||||
~RivenSaveLoad();
|
~RivenSaveLoad();
|
||||||
|
|
||||||
Common::StringList generateSaveGameList();
|
Common::StringArray generateSaveGameList();
|
||||||
bool loadGame(Common::String);
|
bool loadGame(Common::String);
|
||||||
bool saveGame(Common::String);
|
bool saveGame(Common::String);
|
||||||
void deleteSave(Common::String);
|
void deleteSave(Common::String);
|
||||||
|
|
|
@ -295,7 +295,7 @@ bool ParallactionMetaEngine::createInstance(OSystem *syst, Engine **engine, cons
|
||||||
|
|
||||||
SaveStateList ParallactionMetaEngine::listSaves(const char *target) const {
|
SaveStateList ParallactionMetaEngine::listSaves(const char *target) const {
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern += ".0??";
|
pattern += ".0??";
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ SaveStateList ParallactionMetaEngine::listSaves(const char *target) const {
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
||||||
int slotNum = atoi(file->c_str() + file->size() - 2);
|
int slotNum = atoi(file->c_str() + file->size() - 2);
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ void LocationName::bind(const char *s) {
|
||||||
_hasSlide = false;
|
_hasSlide = false;
|
||||||
_hasCharacter = false;
|
_hasCharacter = false;
|
||||||
|
|
||||||
Common::StringList list;
|
Common::StringArray list;
|
||||||
char *tok = strtok(_buf, ".");
|
char *tok = strtok(_buf, ".");
|
||||||
while (tok) {
|
while (tok) {
|
||||||
list.push_back(tok);
|
list.push_back(tok);
|
||||||
|
|
|
@ -193,9 +193,9 @@ void SaveLoad_ns::doSaveGame(uint16 slot, const char* name) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int SaveLoad::buildSaveFileList(Common::StringList& l) {
|
int SaveLoad::buildSaveFileList(Common::StringArray& l) {
|
||||||
Common::String pattern = _saveFilePrefix + ".???";
|
Common::String pattern = _saveFilePrefix + ".???";
|
||||||
Common::StringList filenames = _saveFileMan->listSavefiles(pattern);
|
Common::StringArray filenames = _saveFileMan->listSavefiles(pattern);
|
||||||
|
|
||||||
Common::String s;
|
Common::String s;
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ int SaveLoad::buildSaveFileList(Common::StringList& l) {
|
||||||
|
|
||||||
|
|
||||||
int SaveLoad::selectSaveFile(Common::String &selectedName, bool saveMode, const Common::String &caption, const Common::String &button) {
|
int SaveLoad::selectSaveFile(Common::String &selectedName, bool saveMode, const Common::String &caption, const Common::String &button) {
|
||||||
Common::StringList list;
|
Common::StringArray list;
|
||||||
buildSaveFileList(list);
|
buildSaveFileList(list);
|
||||||
|
|
||||||
GUI::SaveLoadChooser slc(caption, button);
|
GUI::SaveLoadChooser slc(caption, button);
|
||||||
|
@ -332,7 +332,7 @@ static bool askRenameOldSavefiles() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveLoad_ns::renameOldSavefiles() {
|
void SaveLoad_ns::renameOldSavefiles() {
|
||||||
Common::StringList oldFilenames = _saveFileMan->listSavefiles("game.*");
|
Common::StringArray oldFilenames = _saveFileMan->listSavefiles("game.*");
|
||||||
uint numOldSaves = oldFilenames.size();
|
uint numOldSaves = oldFilenames.size();
|
||||||
|
|
||||||
bool rename = false;
|
bool rename = false;
|
||||||
|
|
|
@ -42,7 +42,7 @@ protected:
|
||||||
Common::InSaveFile *getInSaveFile(uint slot);
|
Common::InSaveFile *getInSaveFile(uint slot);
|
||||||
Common::OutSaveFile *getOutSaveFile(uint slot);
|
Common::OutSaveFile *getOutSaveFile(uint slot);
|
||||||
int selectSaveFile(Common::String &selectedName, bool saveMode, const Common::String &caption, const Common::String &button);
|
int selectSaveFile(Common::String &selectedName, bool saveMode, const Common::String &caption, const Common::String &button);
|
||||||
int buildSaveFileList(Common::StringList& l);
|
int buildSaveFileList(Common::StringArray& l);
|
||||||
virtual void doLoadGame(uint16 slot) = 0;
|
virtual void doLoadGame(uint16 slot) = 0;
|
||||||
virtual void doSaveGame(uint16 slot, const char* name) = 0;
|
virtual void doSaveGame(uint16 slot, const char* name) = 0;
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ GameList QueenMetaEngine::detectGames(const Common::FSList &fslist) const {
|
||||||
|
|
||||||
SaveStateList QueenMetaEngine::listSaves(const char *target) const {
|
SaveStateList QueenMetaEngine::listSaves(const char *target) const {
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
char saveDesc[32];
|
char saveDesc[32];
|
||||||
Common::String pattern("queen.s??");
|
Common::String pattern("queen.s??");
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ SaveStateList QueenMetaEngine::listSaves(const char *target) const {
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
||||||
int slotNum = atoi(file->c_str() + file->size() - 2);
|
int slotNum = atoi(file->c_str() + file->size() - 2);
|
||||||
|
|
||||||
|
@ -432,8 +432,8 @@ int QueenEngine::getGameStateSlot(const char *filename) const {
|
||||||
void QueenEngine::findGameStateDescriptions(char descriptions[100][32]) {
|
void QueenEngine::findGameStateDescriptions(char descriptions[100][32]) {
|
||||||
char prefix[20];
|
char prefix[20];
|
||||||
makeGameStateName(SLOT_LISTPREFIX, prefix);
|
makeGameStateName(SLOT_LISTPREFIX, prefix);
|
||||||
Common::StringList filenames = _saveFileMan->listSavefiles(prefix);
|
Common::StringArray filenames = _saveFileMan->listSavefiles(prefix);
|
||||||
for (Common::StringList::const_iterator it = filenames.begin(); it != filenames.end(); ++it) {
|
for (Common::StringArray::const_iterator it = filenames.begin(); it != filenames.end(); ++it) {
|
||||||
int i = getGameStateSlot(it->c_str());
|
int i = getGameStateSlot(it->c_str());
|
||||||
if (i >= 0 && i < SAVESTATE_MAX_NUM) {
|
if (i >= 0 && i < SAVESTATE_MAX_NUM) {
|
||||||
GameStateHeader header;
|
GameStateHeader header;
|
||||||
|
|
|
@ -125,7 +125,7 @@ uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, uint32 *size)
|
||||||
return dstBuf;
|
return dstBuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Resource::loadTextFile(const char *filename, Common::StringList &stringList) {
|
void Resource::loadTextFile(const char *filename, Common::StringArray &stringList) {
|
||||||
debug(7, "Resource::loadTextFile('%s')", filename);
|
debug(7, "Resource::loadTextFile('%s')", filename);
|
||||||
ResourceEntry *re = resourceEntry(filename);
|
ResourceEntry *re = resourceEntry(filename);
|
||||||
assert(re != NULL);
|
assert(re != NULL);
|
||||||
|
|
|
@ -190,7 +190,7 @@ bool SagaMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame
|
||||||
|
|
||||||
SaveStateList SagaMetaEngine::listSaves(const char *target) const {
|
SaveStateList SagaMetaEngine::listSaves(const char *target) const {
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
char saveDesc[SAVE_TITLE_SIZE];
|
char saveDesc[SAVE_TITLE_SIZE];
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern += ".s??";
|
pattern += ".s??";
|
||||||
|
@ -200,7 +200,7 @@ SaveStateList SagaMetaEngine::listSaves(const char *target) const {
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
int slotNum = 0;
|
int slotNum = 0;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
||||||
slotNum = atoi(file->c_str() + file->size() - 2);
|
slotNum = atoi(file->c_str() + file->size() - 2);
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ class Puzzle;
|
||||||
class Resource;
|
class Resource;
|
||||||
|
|
||||||
class ResourceContext;
|
class ResourceContext;
|
||||||
struct StringList;
|
|
||||||
|
|
||||||
using Common::MemoryReadStream;
|
using Common::MemoryReadStream;
|
||||||
using Common::MemoryReadStreamEndian;
|
using Common::MemoryReadStreamEndian;
|
||||||
|
@ -390,7 +389,7 @@ struct StringsTable {
|
||||||
const char *getString(int index) const {
|
const char *getString(int index) const {
|
||||||
if ((stringsCount <= index) || (index < 0)) {
|
if ((stringsCount <= index) || (index < 0)) {
|
||||||
// This occurs at the end of Ted's chapter, right after the ending cutscene
|
// This occurs at the end of Ted's chapter, right after the ending cutscene
|
||||||
warning("StringList::getString wrong index 0x%X (%d)", index, stringsCount);
|
warning("StringsTable::getString wrong index 0x%X (%d)", index, stringsCount);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return strings[index];
|
return strings[index];
|
||||||
|
|
|
@ -118,7 +118,7 @@ void SagaEngine::fillSaveList() {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
Common::InSaveFile *in;
|
Common::InSaveFile *in;
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
char slot[3];
|
char slot[3];
|
||||||
int slotNumber;
|
int slotNumber;
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -136,7 +136,7 @@ void SagaEngine::fillSaveList() {
|
||||||
|
|
||||||
_saveFilesCount = 0;
|
_saveFilesCount = 0;
|
||||||
|
|
||||||
for (Common::StringList::iterator file = filenames.begin(); file != filenames.end(); ++file){
|
for (Common::StringArray::iterator file = filenames.begin(); file != filenames.end(); ++file){
|
||||||
//Obtain the last 2 digits of the filename, since they correspond to the save slot
|
//Obtain the last 2 digits of the filename, since they correspond to the save slot
|
||||||
slot[0] = file->c_str()[file->size()-2];
|
slot[0] = file->c_str()[file->size()-2];
|
||||||
slot[1] = file->c_str()[file->size()-1];
|
slot[1] = file->c_str()[file->size()-1];
|
||||||
|
|
|
@ -402,7 +402,7 @@ bool SciEngine::hasFeature(EngineFeature f) const {
|
||||||
|
|
||||||
SaveStateList SciMetaEngine::listSaves(const char *target) const {
|
SaveStateList SciMetaEngine::listSaves(const char *target) const {
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern += ".???";
|
pattern += ".???";
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ SaveStateList SciMetaEngine::listSaves(const char *target) const {
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
int slotNum = 0;
|
int slotNum = 0;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||||
slotNum = atoi(file->c_str() + file->size() - 3);
|
slotNum = atoi(file->c_str() + file->size() - 3);
|
||||||
|
|
||||||
|
|
|
@ -445,7 +445,7 @@ void Kernel::loadSelectorNames() {
|
||||||
if (!r) { // No such resource?
|
if (!r) { // No such resource?
|
||||||
// Check if we have a table for this game
|
// Check if we have a table for this game
|
||||||
// Some demos do not have a selector table
|
// Some demos do not have a selector table
|
||||||
Common::StringList staticSelectorTable = checkStaticSelectorNames();
|
Common::StringArray staticSelectorTable = checkStaticSelectorNames();
|
||||||
|
|
||||||
if (staticSelectorTable.empty())
|
if (staticSelectorTable.empty())
|
||||||
error("Kernel: Could not retrieve selector names");
|
error("Kernel: Could not retrieve selector names");
|
||||||
|
@ -722,7 +722,7 @@ bool kernel_matches_signature(SegManager *segMan, const char *sig, int argc, con
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kernel::setDefaultKernelNames(Common::String gameId) {
|
void Kernel::setDefaultKernelNames(Common::String gameId) {
|
||||||
_kernelNames = Common::StringList(sci_default_knames, SCI_KNAMES_DEFAULT_ENTRIES_NR);
|
_kernelNames = Common::StringArray(sci_default_knames, SCI_KNAMES_DEFAULT_ENTRIES_NR);
|
||||||
|
|
||||||
// Some (later) SCI versions replaced CanBeHere by CantBeHere
|
// Some (later) SCI versions replaced CanBeHere by CantBeHere
|
||||||
if (_selectorCache.cantBeHere != -1)
|
if (_selectorCache.cantBeHere != -1)
|
||||||
|
|
|
@ -375,7 +375,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
void Kernel::setKernelNamesSci2() {
|
void Kernel::setKernelNamesSci2() {
|
||||||
_kernelNames = Common::StringList(sci2_default_knames, kKernelEntriesSci2);
|
_kernelNames = Common::StringArray(sci2_default_knames, kKernelEntriesSci2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kernel::setKernelNamesSci21(EngineState *s) {
|
void Kernel::setKernelNamesSci21(EngineState *s) {
|
||||||
|
@ -387,13 +387,13 @@ void Kernel::setKernelNamesSci21(EngineState *s) {
|
||||||
// they would not be compatible with other games of the same interpreter.
|
// they would not be compatible with other games of the same interpreter.
|
||||||
|
|
||||||
if (g_sci->_features->detectSci21KernelType() == SCI_VERSION_2) {
|
if (g_sci->_features->detectSci21KernelType() == SCI_VERSION_2) {
|
||||||
_kernelNames = Common::StringList(sci2_default_knames, kKernelEntriesGk2Demo);
|
_kernelNames = Common::StringArray(sci2_default_knames, kKernelEntriesGk2Demo);
|
||||||
// OnMe is IsOnMe here, but they should be compatible
|
// OnMe is IsOnMe here, but they should be compatible
|
||||||
_kernelNames[0x23] = "Robot"; // Graph in SCI2
|
_kernelNames[0x23] = "Robot"; // Graph in SCI2
|
||||||
_kernelNames[0x2e] = "Priority"; // DisposeTextBitmap in SCI2
|
_kernelNames[0x2e] = "Priority"; // DisposeTextBitmap in SCI2
|
||||||
} else {
|
} else {
|
||||||
// TODO: Differentiate between SCI2.1/3
|
// TODO: Differentiate between SCI2.1/3
|
||||||
_kernelNames = Common::StringList(sci21_default_knames, kKernelEntriesSci3);
|
_kernelNames = Common::StringArray(sci21_default_knames, kKernelEntriesSci3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -257,9 +257,9 @@ void listSavegames(Common::Array<SavegameDesc> &saves) {
|
||||||
Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager();
|
Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager();
|
||||||
|
|
||||||
// Load all saves
|
// Load all saves
|
||||||
Common::StringList saveNames = saveFileMan->listSavefiles(g_sci->getSavegamePattern());
|
Common::StringArray saveNames = saveFileMan->listSavefiles(g_sci->getSavegamePattern());
|
||||||
|
|
||||||
for (Common::StringList::const_iterator iter = saveNames.begin(); iter != saveNames.end(); ++iter) {
|
for (Common::StringArray::const_iterator iter = saveNames.begin(); iter != saveNames.end(); ++iter) {
|
||||||
Common::String filename = *iter;
|
Common::String filename = *iter;
|
||||||
Common::SeekableReadStream *in;
|
Common::SeekableReadStream *in;
|
||||||
if ((in = saveFileMan->openForLoading(filename))) {
|
if ((in = saveFileMan->openForLoading(filename))) {
|
||||||
|
|
|
@ -110,8 +110,8 @@ static const SelectorRemap sciSelectorRemap[] = {
|
||||||
{ SCI_VERSION_NONE, SCI_VERSION_NONE, 0, 0 }
|
{ SCI_VERSION_NONE, SCI_VERSION_NONE, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
Common::StringList Kernel::checkStaticSelectorNames() {
|
Common::StringArray Kernel::checkStaticSelectorNames() {
|
||||||
Common::StringList names;
|
Common::StringArray names;
|
||||||
const int offset = (getSciVersion() < SCI_VERSION_1_1) ? 3 : 0;
|
const int offset = (getSciVersion() < SCI_VERSION_1_1) ? 3 : 0;
|
||||||
|
|
||||||
#ifdef ENABLE_SCI32
|
#ifdef ENABLE_SCI32
|
||||||
|
|
|
@ -1036,7 +1036,7 @@ int ScummMetaEngine::getMaximumSaveSlot() const { return 99; }
|
||||||
|
|
||||||
SaveStateList ScummMetaEngine::listSaves(const char *target) const {
|
SaveStateList ScummMetaEngine::listSaves(const char *target) const {
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
Common::String saveDesc;
|
Common::String saveDesc;
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern += ".s??";
|
pattern += ".s??";
|
||||||
|
@ -1045,7 +1045,7 @@ SaveStateList ScummMetaEngine::listSaves(const char *target) const {
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
// Obtain the last 2 digits of the filename, since they correspond to the save slot
|
||||||
int slotNum = atoi(file->c_str() + file->size() - 2);
|
int slotNum = atoi(file->c_str() + file->size() - 2);
|
||||||
|
|
||||||
|
|
|
@ -582,7 +582,7 @@ void ScummEngine::listSavegames(bool *marks, int num) {
|
||||||
|
|
||||||
char slot[3];
|
char slot[3];
|
||||||
int slotNum;
|
int slotNum;
|
||||||
Common::StringList files;
|
Common::StringArray files;
|
||||||
|
|
||||||
Common::String prefix = makeSavegameName(99, false);
|
Common::String prefix = makeSavegameName(99, false);
|
||||||
prefix.setChar('*', prefix.size()-2);
|
prefix.setChar('*', prefix.size()-2);
|
||||||
|
@ -590,7 +590,7 @@ void ScummEngine::listSavegames(bool *marks, int num) {
|
||||||
memset(marks, false, num * sizeof(bool)); //assume no savegames for this title
|
memset(marks, false, num * sizeof(bool)); //assume no savegames for this title
|
||||||
files = _saveFileMan->listSavefiles(prefix);
|
files = _saveFileMan->listSavefiles(prefix);
|
||||||
|
|
||||||
for (Common::StringList::const_iterator file = files.begin(); file != files.end(); ++file) {
|
for (Common::StringArray::const_iterator file = files.begin(); file != files.end(); ++file) {
|
||||||
//Obtain the last 2 digits of the filename, since they correspond to the save slot
|
//Obtain the last 2 digits of the filename, since they correspond to the save slot
|
||||||
slot[0] = file->c_str()[file->size()-2];
|
slot[0] = file->c_str()[file->size()-2];
|
||||||
slot[1] = file->c_str()[file->size()-1];
|
slot[1] = file->c_str()[file->size()-1];
|
||||||
|
|
|
@ -838,7 +838,7 @@ uint16 Control::saveRestorePanel(bool allowSave) {
|
||||||
}
|
}
|
||||||
bool withAutoSave = (lookListLen == 7);
|
bool withAutoSave = (lookListLen == 7);
|
||||||
|
|
||||||
Common::StringList saveGameTexts;
|
Common::StringArray saveGameTexts;
|
||||||
DataFileHeader *textSprites[MAX_ON_SCREEN + 1];
|
DataFileHeader *textSprites[MAX_ON_SCREEN + 1];
|
||||||
for (cnt = 0; cnt < MAX_ON_SCREEN + 1; cnt++)
|
for (cnt = 0; cnt < MAX_ON_SCREEN + 1; cnt++)
|
||||||
textSprites[cnt] = NULL;
|
textSprites[cnt] = NULL;
|
||||||
|
@ -982,7 +982,7 @@ void Control::handleKeyPress(Common::KeyState kbd, Common::String &textBuf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Control::setUpGameSprites(const Common::StringList &saveGameNames, DataFileHeader **nameSprites, uint16 firstNum, uint16 selectedGame) {
|
void Control::setUpGameSprites(const Common::StringArray &saveGameNames, DataFileHeader **nameSprites, uint16 firstNum, uint16 selectedGame) {
|
||||||
char cursorChar[2] = "-";
|
char cursorChar[2] = "-";
|
||||||
DisplayedText textSpr;
|
DisplayedText textSpr;
|
||||||
if (!nameSprites[MAX_ON_SCREEN]) {
|
if (!nameSprites[MAX_ON_SCREEN]) {
|
||||||
|
@ -1027,7 +1027,7 @@ void Control::showSprites(DataFileHeader **nameSprites, bool allowSave) {
|
||||||
delete drawResource;
|
delete drawResource;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Control::loadDescriptions(Common::StringList &savenames) {
|
void Control::loadDescriptions(Common::StringArray &savenames) {
|
||||||
savenames.resize(MAX_SAVE_GAMES);
|
savenames.resize(MAX_SAVE_GAMES);
|
||||||
|
|
||||||
Common::InSaveFile *inf;
|
Common::InSaveFile *inf;
|
||||||
|
@ -1072,7 +1072,7 @@ int Control::displayMessage(const char *altButton, const char *message, ...) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Control::saveDescriptions(const Common::StringList &list) {
|
void Control::saveDescriptions(const Common::StringArray &list) {
|
||||||
Common::OutSaveFile *outf;
|
Common::OutSaveFile *outf;
|
||||||
|
|
||||||
outf = _saveFileMan->openForSaving("SKY-VM.SAV");
|
outf = _saveFileMan->openForSaving("SKY-VM.SAV");
|
||||||
|
|
|
@ -178,7 +178,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const {
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
|
|
||||||
// Load the descriptions
|
// Load the descriptions
|
||||||
Common::StringList savenames;
|
Common::StringArray savenames;
|
||||||
savenames.resize(MAX_SAVE_GAMES+1);
|
savenames.resize(MAX_SAVE_GAMES+1);
|
||||||
|
|
||||||
Common::InSaveFile *inf;
|
Common::InSaveFile *inf;
|
||||||
|
@ -196,7 +196,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find all saves
|
// Find all saves
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
filenames = saveFileMan->listSavefiles("SKY-VM.???");
|
filenames = saveFileMan->listSavefiles("SKY-VM.???");
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const {
|
||||||
saveList.insert_at(0, SaveStateDescriptor(0, "*AUTOSAVE*"));
|
saveList.insert_at(0, SaveStateDescriptor(0, "*AUTOSAVE*"));
|
||||||
|
|
||||||
// Prepare the list of savestates by looping over all matching savefiles
|
// Prepare the list of savestates by looping over all matching savefiles
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Extract the extension
|
// Extract the extension
|
||||||
Common::String ext = file->c_str() + file->size() - 3;
|
Common::String ext = file->c_str() + file->size() - 3;
|
||||||
ext.toUppercase();
|
ext.toUppercase();
|
||||||
|
@ -235,7 +235,7 @@ void SkyMetaEngine::removeSaveState(const char *target, int slot) const {
|
||||||
saveFileMan->removeSavefile(fName);
|
saveFileMan->removeSavefile(fName);
|
||||||
|
|
||||||
// Load current save game descriptions
|
// Load current save game descriptions
|
||||||
Common::StringList savenames;
|
Common::StringArray savenames;
|
||||||
savenames.resize(MAX_SAVE_GAMES+1);
|
savenames.resize(MAX_SAVE_GAMES+1);
|
||||||
Common::InSaveFile *inf;
|
Common::InSaveFile *inf;
|
||||||
inf = saveFileMan->openForLoading("SKY-VM.SAV");
|
inf = saveFileMan->openForLoading("SKY-VM.SAV");
|
||||||
|
@ -294,7 +294,7 @@ Common::Error SkyEngine::saveGameState(int slot, const char *desc) {
|
||||||
return Common::kWritePermissionDenied;
|
return Common::kWritePermissionDenied;
|
||||||
|
|
||||||
// Load current save game descriptions
|
// Load current save game descriptions
|
||||||
Common::StringList saveGameTexts;
|
Common::StringArray saveGameTexts;
|
||||||
saveGameTexts.resize(MAX_SAVE_GAMES+1);
|
saveGameTexts.resize(MAX_SAVE_GAMES+1);
|
||||||
_skyControl->loadDescriptions(saveGameTexts);
|
_skyControl->loadDescriptions(saveGameTexts);
|
||||||
|
|
||||||
|
|
|
@ -791,14 +791,14 @@ bool Control::restoreFromFile() {
|
||||||
void Control::readSavegameDescriptions() {
|
void Control::readSavegameDescriptions() {
|
||||||
char saveName[40];
|
char saveName[40];
|
||||||
Common::String pattern = "sword1.???";
|
Common::String pattern = "sword1.???";
|
||||||
Common::StringList filenames = _saveFileMan->listSavefiles(pattern);
|
Common::StringArray filenames = _saveFileMan->listSavefiles(pattern);
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
_saveNames.clear();
|
_saveNames.clear();
|
||||||
|
|
||||||
int num = 0;
|
int num = 0;
|
||||||
int slotNum = 0;
|
int slotNum = 0;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||||
slotNum = atoi(file->c_str() + file->size() - 3);
|
slotNum = atoi(file->c_str() + file->size() - 3);
|
||||||
|
|
||||||
|
@ -847,7 +847,7 @@ int Control::displayMessage(const char *altButton, const char *message, ...) {
|
||||||
|
|
||||||
bool Control::savegamesExist() {
|
bool Control::savegamesExist() {
|
||||||
Common::String pattern = "sword1.???";
|
Common::String pattern = "sword1.???";
|
||||||
Common::StringList saveNames = _saveFileMan->listSavefiles(pattern);
|
Common::StringArray saveNames = _saveFileMan->listSavefiles(pattern);
|
||||||
return saveNames.size() > 0;
|
return saveNames.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -228,11 +228,11 @@ SaveStateList SwordMetaEngine::listSaves(const char *target) const {
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
char saveName[40];
|
char saveName[40];
|
||||||
|
|
||||||
Common::StringList filenames = saveFileMan->listSavefiles("sword1.???");
|
Common::StringArray filenames = saveFileMan->listSavefiles("sword1.???");
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
int slotNum = 0;
|
int slotNum = 0;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||||
slotNum = atoi(file->c_str() + file->size() - 3);
|
slotNum = atoi(file->c_str() + file->size() - 3);
|
||||||
|
|
||||||
|
|
|
@ -389,7 +389,7 @@ uint32 Sword2Engine::getSaveDescription(uint16 slotNo, byte *description) {
|
||||||
|
|
||||||
bool Sword2Engine::saveExists() {
|
bool Sword2Engine::saveExists() {
|
||||||
Common::String pattern = _targetName + ".???";
|
Common::String pattern = _targetName + ".???";
|
||||||
Common::StringList filenames = _saveFileMan->listSavefiles(pattern);
|
Common::StringArray filenames = _saveFileMan->listSavefiles(pattern);
|
||||||
|
|
||||||
return !filenames.empty();
|
return !filenames.empty();
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,7 +184,7 @@ GameList Sword2MetaEngine::detectGames(const Common::FSList &fslist) const {
|
||||||
|
|
||||||
SaveStateList Sword2MetaEngine::listSaves(const char *target) const {
|
SaveStateList Sword2MetaEngine::listSaves(const char *target) const {
|
||||||
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||||
Common::StringList filenames;
|
Common::StringArray filenames;
|
||||||
char saveDesc[SAVE_DESCRIPTION_LEN];
|
char saveDesc[SAVE_DESCRIPTION_LEN];
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern += ".???";
|
pattern += ".???";
|
||||||
|
@ -193,7 +193,7 @@ SaveStateList Sword2MetaEngine::listSaves(const char *target) const {
|
||||||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||||
int slotNum = atoi(file->c_str() + file->size() - 3);
|
int slotNum = atoi(file->c_str() + file->size() - 3);
|
||||||
|
|
||||||
|
|
|
@ -121,11 +121,11 @@ public:
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern += ".*";
|
pattern += ".*";
|
||||||
|
|
||||||
Common::StringList filenames = g_system->getSavefileManager()->listSavefiles(pattern);
|
Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles(pattern);
|
||||||
Common::sort(filenames.begin(), filenames.end());
|
Common::sort(filenames.begin(), filenames.end());
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
int slot;
|
int slot;
|
||||||
const char *ext = strrchr(file->c_str(), '.');
|
const char *ext = strrchr(file->c_str(), '.');
|
||||||
if (ext && (slot = atoi(ext + 1)) >= 0 && slot < MAX_SAVES) {
|
if (ext && (slot = atoi(ext + 1)) >= 0 && slot < MAX_SAVES) {
|
||||||
|
|
|
@ -684,12 +684,12 @@ extern int getList(Common::SaveFileManager *saveFileMan, const Common::String &t
|
||||||
SaveStateList TinselMetaEngine::listSaves(const char *target) const {
|
SaveStateList TinselMetaEngine::listSaves(const char *target) const {
|
||||||
Common::String pattern = target;
|
Common::String pattern = target;
|
||||||
pattern = pattern + ".???";
|
pattern = pattern + ".???";
|
||||||
Common::StringList files = g_system->getSavefileManager()->listSavefiles(pattern);
|
Common::StringArray files = g_system->getSavefileManager()->listSavefiles(pattern);
|
||||||
sort(files.begin(), files.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
sort(files.begin(), files.end()); // Sort (hopefully ensuring we are sorted numerically..)
|
||||||
|
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
int slotNum = 0;
|
int slotNum = 0;
|
||||||
for (Common::StringList::const_iterator file = files.begin(); file != files.end(); ++file) {
|
for (Common::StringArray::const_iterator file = files.begin(); file != files.end(); ++file) {
|
||||||
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||||
slotNum = atoi(file->c_str() + file->size() - 3);
|
slotNum = atoi(file->c_str() + file->size() - 3);
|
||||||
|
|
||||||
|
|
|
@ -330,11 +330,11 @@ int getList(Common::SaveFileManager *saveFileMan, const Common::String &target)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
const Common::String pattern = target + ".???";
|
const Common::String pattern = target + ".???";
|
||||||
Common::StringList files = saveFileMan->listSavefiles(pattern);
|
Common::StringArray files = saveFileMan->listSavefiles(pattern);
|
||||||
|
|
||||||
numSfiles = 0;
|
numSfiles = 0;
|
||||||
|
|
||||||
for (Common::StringList::const_iterator file = files.begin(); file != files.end(); ++file) {
|
for (Common::StringArray::const_iterator file = files.begin(); file != files.end(); ++file) {
|
||||||
if (numSfiles >= MAX_SAVED_FILES)
|
if (numSfiles >= MAX_SAVED_FILES)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -180,11 +180,11 @@ bool ToucheMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGa
|
||||||
|
|
||||||
SaveStateList ToucheMetaEngine::listSaves(const char *target) const {
|
SaveStateList ToucheMetaEngine::listSaves(const char *target) const {
|
||||||
Common::String pattern = Touche::generateGameStateFileName(target, 0, true);
|
Common::String pattern = Touche::generateGameStateFileName(target, 0, true);
|
||||||
Common::StringList filenames = g_system->getSavefileManager()->listSavefiles(pattern);
|
Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles(pattern);
|
||||||
bool slotsTable[Touche::kMaxSaveStates];
|
bool slotsTable[Touche::kMaxSaveStates];
|
||||||
memset(slotsTable, 0, sizeof(slotsTable));
|
memset(slotsTable, 0, sizeof(slotsTable));
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
int slot = Touche::getGameStateFileSlot(file->c_str());
|
int slot = Touche::getGameStateFileSlot(file->c_str());
|
||||||
if (slot >= 0 && slot < Touche::kMaxSaveStates) {
|
if (slot >= 0 && slot < Touche::kMaxSaveStates) {
|
||||||
slotsTable[slot] = true;
|
slotsTable[slot] = true;
|
||||||
|
|
|
@ -377,8 +377,8 @@ void ToucheEngine::handleOptions(int forceDisplay) {
|
||||||
menuData.saveLoadDescriptionsTable[i][0] = 0;
|
menuData.saveLoadDescriptionsTable[i][0] = 0;
|
||||||
}
|
}
|
||||||
Common::String gameStateFileName = generateGameStateFileName(_targetName.c_str(), 0, true);
|
Common::String gameStateFileName = generateGameStateFileName(_targetName.c_str(), 0, true);
|
||||||
Common::StringList filenames = _saveFileMan->listSavefiles(gameStateFileName);
|
Common::StringArray filenames = _saveFileMan->listSavefiles(gameStateFileName);
|
||||||
for (Common::StringList::const_iterator it = filenames.begin(); it != filenames.end(); ++it) {
|
for (Common::StringArray::const_iterator it = filenames.begin(); it != filenames.end(); ++it) {
|
||||||
int i = getGameStateFileSlot(it->c_str());
|
int i = getGameStateFileSlot(it->c_str());
|
||||||
if (i >= 0 && i < kMaxSaveStates) {
|
if (i >= 0 && i < kMaxSaveStates) {
|
||||||
Common::InSaveFile *f = _saveFileMan->openForLoading(*it);
|
Common::InSaveFile *f = _saveFileMan->openForLoading(*it);
|
||||||
|
|
|
@ -173,11 +173,11 @@ public:
|
||||||
|
|
||||||
virtual SaveStateList listSaves(const char *target) const {
|
virtual SaveStateList listSaves(const char *target) const {
|
||||||
Common::String pattern = Tucker::generateGameStateFileName(target, 0, true);
|
Common::String pattern = Tucker::generateGameStateFileName(target, 0, true);
|
||||||
Common::StringList filenames = g_system->getSavefileManager()->listSavefiles(pattern);
|
Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles(pattern);
|
||||||
bool slotsTable[Tucker::kLastSaveSlot + 1];
|
bool slotsTable[Tucker::kLastSaveSlot + 1];
|
||||||
memset(slotsTable, 0, sizeof(slotsTable));
|
memset(slotsTable, 0, sizeof(slotsTable));
|
||||||
SaveStateList saveList;
|
SaveStateList saveList;
|
||||||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||||
int slot;
|
int slot;
|
||||||
const char *ext = strrchr(file->c_str(), '.');
|
const char *ext = strrchr(file->c_str(), '.');
|
||||||
if (ext && (slot = atoi(ext + 1)) >= 0 && slot <= Tucker::kLastSaveSlot) {
|
if (ext && (slot = atoi(ext + 1)) >= 0 && slot <= Tucker::kLastSaveSlot) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue