aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/parallaction_br.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2008-08-31 05:18:25 +0000
committerNicola Mettifogo2008-08-31 05:18:25 +0000
commit983863bef3f72b81cd0c1211241c64670c4e3e18 (patch)
treec6f14bff41a913bdf4efe2c858d863bdbf4801ed /engines/parallaction/parallaction_br.cpp
parent805a46b229658782820a5f78a862e19e2533ec18 (diff)
downloadscummvm-rg350-983863bef3f72b81cd0c1211241c64670c4e3e18.tar.gz
scummvm-rg350-983863bef3f72b81cd0c1211241c64670c4e3e18.tar.bz2
scummvm-rg350-983863bef3f72b81cd0c1211241c64670c4e3e18.zip
Uniformed the interface of Parallaction class (and its hierarchy) with regards of gui code, which is now independent of engine version.
svn-id: r34219
Diffstat (limited to 'engines/parallaction/parallaction_br.cpp')
-rw-r--r--engines/parallaction/parallaction_br.cpp45
1 files changed, 19 insertions, 26 deletions
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index 25f541bdb2..61e01b79be 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -41,14 +41,6 @@ const char *Parallaction_br::_partNames[] = {
"PART4"
};
-const char *partFirstLocation[] = {
- "intro",
- "museo",
- "start",
- "bolscoi",
- "treno"
-};
-
int Parallaction_br::init() {
_screenWidth = 640;
@@ -112,7 +104,7 @@ int Parallaction_br::go() {
while ((_engineFlags & kEngineQuit) == 0) {
if (getFeatures() & GF_DEMO) {
- startPart(1);
+ scheduleLocationSwitch("camalb.1");
_input->_inputMode = Input::kInputModeGame;
} else {
startGui(splash);
@@ -174,23 +166,6 @@ void Parallaction_br::freePart() {
_countersNames = 0;
}
-void Parallaction_br::startPart(uint part) {
- _part = part;
- _disk->selectArchive(_partNames[_part]);
-
- initPart();
-
- if (getFeatures() & GF_DEMO) {
- strcpy(_location._name, "camalb");
- } else {
- strcpy(_location._name, partFirstLocation[_part]);
- }
-
- parseLocation("common");
- changeLocation(_location._name);
-
-}
-
void Parallaction_br::runPendingZones() {
ZonePtr z;
@@ -245,6 +220,24 @@ void Parallaction_br::freeLocation() {
void Parallaction_br::changeLocation(char *location) {
+ char *partStr = strrchr(location, '.');
+ if (partStr) {
+ int n = partStr - location;
+ strncpy(_location._name, location, n);
+ _location._name[n] = '\0';
+
+ _part = atoi(++partStr);
+ if (getFeatures() & GF_DEMO) {
+ assert(_part == 1);
+ } else {
+ assert(_part >= 0 && _part <= 4);
+ }
+
+ _disk->selectArchive(_partNames[_part]);
+ initPart();
+ parseLocation("common");
+ }
+
freeLocation();
// load new location
parseLocation(location);