Added more resource loading.

svn-id: r28563
This commit is contained in:
Nicola Mettifogo
2007-08-12 13:47:19 +00:00
parent c408e30bb9
commit a3e1907837
2 changed files with 34 additions and 1 deletions
+1
View File
@@ -201,6 +201,7 @@ class DosDisk_br : public Disk {
protected:
Parallaction *_vm;
char _partPath[PATH_LEN];
char _languageDir[2];
protected:
void errorFileNotFound(const char *s);
+33 -1
View File
@@ -46,6 +46,28 @@ Common::String DosDisk_br::selectArchive(const Common::String& name) {
void DosDisk_br::setLanguage(uint16 language) {
debugC(5, kDebugDisk, "DosDisk_br::setLanguage");
switch (language) {
case 0:
strcpy(_languageDir, "it");
break;
case 1:
strcpy(_languageDir, "fr");
break;
case 2:
strcpy(_languageDir, "en");
break;
case 3:
strcpy(_languageDir, "ge");
break;
default:
error("unknown language");
}
return;
}
@@ -64,7 +86,17 @@ Cnv* DosDisk_br::loadTalk(const char *name) {
Script* DosDisk_br::loadLocation(const char *name) {
debugC(5, kDebugDisk, "DosDisk_br::loadLocation");
return 0;
char path[PATH_LEN];
sprintf(path, "%s/%s/%s.loc", _partPath, _languageDir, name);
debugC(3, kDebugDisk, "DosDisk_br::loadLocation(%s): trying '%s'", name, path);
Common::File stream;
if (!stream.open(path))
errorFileNotFound(path);
return new Script(&stream, false);
}
Script* DosDisk_br::loadScript(const char* name) {