From a3e19078372f8ca062fa5504eaaa9d0edec5ca65 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Sun, 12 Aug 2007 13:47:19 +0000 Subject: Added more resource loading. svn-id: r28563 --- engines/parallaction/disk.h | 1 + engines/parallaction/disk_br.cpp | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index 693c3f7fa2..c54ad4eedc 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -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); diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index f9ba2c2295..63ec2e3667 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -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) { -- cgit v1.2.3