[Scummvm-git-logs] scummvm master -> 5ea32efbb0ecb3e6b8336ad3c2edd3905ea5b89a
dreammaster
dreammaster at scummvm.org
Sat Aug 27 18:45:45 CEST 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5ea32efbb0 TITANIC: Implemented more game classes
Commit: 5ea32efbb0ecb3e6b8336ad3c2edd3905ea5b89a
https://github.com/scummvm/scummvm/commit/5ea32efbb0ecb3e6b8336ad3c2edd3905ea5b89a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-27T12:45:36-04:00
Commit Message:
TITANIC: Implemented more game classes
Changed paths:
A engines/titanic/game/placeholder/place_holder.cpp
A engines/titanic/game/placeholder/place_holder.h
R engines/titanic/game/placeholder/place_holder_item.cpp
R engines/titanic/game/placeholder/place_holder_item.h
engines/titanic/carry/plug_in.cpp
engines/titanic/core/saveable_object.cpp
engines/titanic/core/tree_item.cpp
engines/titanic/game/parrot/player_meets_parrot.cpp
engines/titanic/game/parrot/player_meets_parrot.h
engines/titanic/game/pickup/pick_up_speech_centre.cpp
engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
engines/titanic/game/placeholder/bar_shelf_vis_centre.h
engines/titanic/game/placeholder/lemon_on_bar.cpp
engines/titanic/game/placeholder/lemon_on_bar.h
engines/titanic/game/placeholder/tv_on_bar.cpp
engines/titanic/game/placeholder/tv_on_bar.h
engines/titanic/game/play_music_button.cpp
engines/titanic/game/play_music_button.h
engines/titanic/game/play_on_act.cpp
engines/titanic/game/play_on_act.h
engines/titanic/game/port_hole.cpp
engines/titanic/game/port_hole.h
engines/titanic/module.mk
diff --git a/engines/titanic/carry/plug_in.cpp b/engines/titanic/carry/plug_in.cpp
index c82a4cc..883458c 100644
--- a/engines/titanic/carry/plug_in.cpp
+++ b/engines/titanic/carry/plug_in.cpp
@@ -47,19 +47,13 @@ bool CPlugIn::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (otherName == "PET") {
return CCarry::UseWithOtherMsg(msg);
- } else if (otherName == "DatasideTransporter") {
- CString name = getName();
- if (name == "DatasideTransporter") {
- // TODO
- if (name != "SendYourself") {
- // TODO
- }
- } else {
- // TODO
- }
- } else {
+ } else if (isEquals("DatasideTransporter")) {
CShowTextMsg textMsg("This item is incorrectly calibrated.");
textMsg.execute("PET");
+ } else if (isEquals("DatasideTransporter")) {
+ error("TODO: Set msg->_other->fieldC4 = 2");
+ } else if (isEquals("SendYourself")) {
+ error("TODO: Set msg->_other->fieldC8 = 1");
}
return true;
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 6abf9c4..eee71cf 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -252,7 +252,7 @@
#include "titanic/game/pickup/pick_up_vis_centre.h"
#include "titanic/game/placeholder/bar_shelf_vis_centre.h"
#include "titanic/game/placeholder/lemon_on_bar.h"
-#include "titanic/game/placeholder/place_holder_item.h"
+#include "titanic/game/placeholder/place_holder.h"
#include "titanic/game/placeholder/tv_on_bar.h"
#include "titanic/game/sgt/armchair.h"
#include "titanic/game/sgt/basin.h"
@@ -669,7 +669,7 @@ DEFFN(CPickUpSpeechCentre);
DEFFN(CPickUpVisCentre);
DEFFN(CBarShelfVisCentre);
DEFFN(CLemonOnBar);
-DEFFN(CPlaceHolderItem);
+DEFFN(CPlaceHolder);
DEFFN(CTVOnBar);
DEFFN(CArmchair);
DEFFN(CBasin);
@@ -1251,10 +1251,10 @@ void CSaveableObject::initClassList() {
ADDFN(CPickUpLemon, CPickUp);
ADDFN(CPickUpSpeechCentre, CPickUp);
ADDFN(CPickUpVisCentre, CPickUp);
- ADDFN(CBarShelfVisCentre, CPlaceHolderItem);
- ADDFN(CLemonOnBar, CPlaceHolderItem);
- ADDFN(CPlaceHolderItem, CGameObject);
- ADDFN(CTVOnBar, CPlaceHolderItem);
+ ADDFN(CBarShelfVisCentre, CPlaceHolder);
+ ADDFN(CLemonOnBar, CPlaceHolder);
+ ADDFN(CPlaceHolder, CGameObject);
+ ADDFN(CTVOnBar, CPlaceHolder);
ADDFN(CArmchair, CSGTStateRoom);
ADDFN(CBasin, CSGTStateRoom);
ADDFN(CBedfoot, CSGTStateRoom);
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 870ee38..86c34ca 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -34,7 +34,7 @@
#include "titanic/core/room_item.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/game_manager.h"
-#include "titanic/game/placeholder/place_holder_item.h"
+#include "titanic/game/placeholder/place_holder.h"
namespace Titanic {
@@ -96,7 +96,7 @@ bool CTreeItem::isLinkItem() const {
}
bool CTreeItem::isPlaceHolderItem() const {
- return isInstanceOf(CPlaceHolderItem::_type);
+ return isInstanceOf(CPlaceHolder::_type);
}
bool CTreeItem::isNamedItem() const {
diff --git a/engines/titanic/game/parrot/player_meets_parrot.cpp b/engines/titanic/game/parrot/player_meets_parrot.cpp
index 6db9345..cdb1451 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.cpp
+++ b/engines/titanic/game/parrot/player_meets_parrot.cpp
@@ -24,6 +24,10 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CPlayerMeetsParrot, CGameObject)
+ ON_MESSAGE(EnterRoomMsg)
+END_MESSAGE_MAP()
+
void CPlayerMeetsParrot::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CGameObject::save(file, indent);
@@ -35,7 +39,7 @@ void CPlayerMeetsParrot::load(SimpleFile *file) {
}
bool CPlayerMeetsParrot::EnterRoomMsg(CEnterRoomMsg *msg) {
- warning("CPlayerMeetsParrot::handleEvent");
+ stateSet24();
return true;
}
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
index 9cee9ee..edae188 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.h
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -29,6 +29,7 @@
namespace Titanic {
class CPlayerMeetsParrot : public CGameObject {
+ DECLARE_MESSAGE_MAP;
protected:
bool EnterRoomMsg(CEnterRoomMsg *msg);
public:
diff --git a/engines/titanic/game/pickup/pick_up_speech_centre.cpp b/engines/titanic/game/pickup/pick_up_speech_centre.cpp
index d337355..5e99c0a 100644
--- a/engines/titanic/game/pickup/pick_up_speech_centre.cpp
+++ b/engines/titanic/game/pickup/pick_up_speech_centre.cpp
@@ -63,7 +63,7 @@ bool CPickUpSpeechCentre::MouseDragStartMsg(CMouseDragStartMsg *msg) {
CActMsg actMsg("PlayerGetsSpeechCentre");
actMsg.execute("SeasonalAdjust");
} else {
- petDisplayMessage("You can',27h,'t pick this up on account of it being stuck to the branch.");
+ petDisplayMessage("You can't pick this up on account of it being stuck to the branch.");
}
}
diff --git a/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp b/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
index fc5d680..6e5037f 100644
--- a/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
+++ b/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
@@ -24,7 +24,7 @@
namespace Titanic {
-BEGIN_MESSAGE_MAP(CBarShelfVisCentre, CPlaceHolderItem)
+BEGIN_MESSAGE_MAP(CBarShelfVisCentre, CPlaceHolder)
ON_MESSAGE(MouseButtonDownMsg)
ON_MESSAGE(TimerMsg)
ON_MESSAGE(EnterViewMsg)
@@ -33,13 +33,13 @@ END_MESSAGE_MAP()
void CBarShelfVisCentre::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_flag, indent);
- CPlaceHolderItem::save(file, indent);
+ CPlaceHolder::save(file, indent);
}
void CBarShelfVisCentre::load(SimpleFile *file) {
file->readNumber();
_flag = file->readNumber();
- CPlaceHolderItem::load(file);
+ CPlaceHolder::load(file);
}
bool CBarShelfVisCentre::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
diff --git a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
index 672655d..8ad3dcb 100644
--- a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
+++ b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
@@ -23,11 +23,11 @@
#ifndef TITANIC_BAR_SHELF_VIS_CENTRE_H
#define TITANIC_BAR_SHELF_VIS_CENTRE_H
-#include "titanic/game/placeholder/place_holder_item.h"
+#include "titanic/game/placeholder/place_holder.h"
namespace Titanic {
-class CBarShelfVisCentre : public CPlaceHolderItem {
+class CBarShelfVisCentre : public CPlaceHolder {
DECLARE_MESSAGE_MAP;
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool TimerMsg(CTimerMsg *msg);
@@ -36,7 +36,7 @@ private:
bool _flag;
public:
CLASSDEF;
- CBarShelfVisCentre() : CPlaceHolderItem(), _flag(false) {}
+ CBarShelfVisCentre() : CPlaceHolder(), _flag(false) {}
/**
* Save the data for the class to file
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.cpp b/engines/titanic/game/placeholder/lemon_on_bar.cpp
index 917c751..e9cf6a30 100644
--- a/engines/titanic/game/placeholder/lemon_on_bar.cpp
+++ b/engines/titanic/game/placeholder/lemon_on_bar.cpp
@@ -24,20 +24,20 @@
namespace Titanic {
-BEGIN_MESSAGE_MAP(CLemonOnBar, CPlaceHolderItem)
+BEGIN_MESSAGE_MAP(CLemonOnBar, CPlaceHolder)
ON_MESSAGE(VisibleMsg)
END_MESSAGE_MAP()
void CLemonOnBar::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writePoint(_lemonPos, indent);
- CPlaceHolderItem::save(file, indent);
+ CPlaceHolder::save(file, indent);
}
void CLemonOnBar::load(SimpleFile *file) {
file->readNumber();
_lemonPos = file->readPoint();
- CPlaceHolderItem::load(file);
+ CPlaceHolder::load(file);
}
bool CLemonOnBar::VisibleMsg(CVisibleMsg *msg) {
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.h b/engines/titanic/game/placeholder/lemon_on_bar.h
index af5d5e6..c6512ce 100644
--- a/engines/titanic/game/placeholder/lemon_on_bar.h
+++ b/engines/titanic/game/placeholder/lemon_on_bar.h
@@ -23,11 +23,11 @@
#ifndef TITANIC_LEMON_ON_BAR_H
#define TITANIC_LEMON_ON_BAR_H
-#include "titanic/game/placeholder/place_holder_item.h"
+#include "titanic/game/placeholder/place_holder.h"
namespace Titanic {
-class CLemonOnBar : public CPlaceHolderItem {
+class CLemonOnBar : public CPlaceHolder {
DECLARE_MESSAGE_MAP;
bool VisibleMsg(CVisibleMsg *msg);
private:
diff --git a/engines/titanic/game/placeholder/place_holder.cpp b/engines/titanic/game/placeholder/place_holder.cpp
new file mode 100644
index 0000000..ae42cab
--- /dev/null
+++ b/engines/titanic/game/placeholder/place_holder.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/placeholder/place_holder.h"
+
+namespace Titanic {
+
+BEGIN_MESSAGE_MAP(CPlaceHolder, CGameObject)
+ ON_MESSAGE(VisibleMsg)
+END_MESSAGE_MAP()
+
+void CPlaceHolder::save(SimpleFile *file, int indent) {
+ file->writeNumberLine(1, indent);
+ CGameObject::save(file, indent);
+}
+
+void CPlaceHolder::load(SimpleFile *file) {
+ file->readNumber();
+ CGameObject::load(file);
+}
+
+bool CPlaceHolder::VisibleMsg(CVisibleMsg *msg) {
+ setVisible(msg->_visible);
+ return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/place_holder.h b/engines/titanic/game/placeholder/place_holder.h
new file mode 100644
index 0000000..b1aa041
--- /dev/null
+++ b/engines/titanic/game/placeholder/place_holder.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PLACE_HOLDER_H
+#define TITANIC_PLACE_HOLDER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPlaceHolder : public CGameObject {
+ DECLARE_MESSAGE_MAP;
+ bool VisibleMsg(CVisibleMsg *msg);
+public:
+ CLASSDEF;
+
+ /**
+ * Save the data for the class to file
+ */
+ virtual void save(SimpleFile *file, int indent);
+
+ /**
+ * Load the data for the class from file
+ */
+ virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PLACE_HOLDER_H */
diff --git a/engines/titanic/game/placeholder/place_holder_item.cpp b/engines/titanic/game/placeholder/place_holder_item.cpp
deleted file mode 100644
index 365e8cb..0000000
--- a/engines/titanic/game/placeholder/place_holder_item.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/placeholder/place_holder_item.h"
-
-namespace Titanic {
-
-void CPlaceHolderItem::save(SimpleFile *file, int indent) {
- file->writeNumberLine(1, indent);
- CGameObject::save(file, indent);
-}
-
-void CPlaceHolderItem::load(SimpleFile *file) {
- file->readNumber();
- CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/place_holder_item.h b/engines/titanic/game/placeholder/place_holder_item.h
deleted file mode 100644
index de04a64..0000000
--- a/engines/titanic/game/placeholder/place_holder_item.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PLACE_HOLDER_H
-#define TITANIC_PLACE_HOLDER_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CPlaceHolderItem : public CGameObject {
-public:
- CLASSDEF;
-
- /**
- * Save the data for the class to file
- */
- virtual void save(SimpleFile *file, int indent);
-
- /**
- * Load the data for the class from file
- */
- virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PLACE_HOLDER_H */
diff --git a/engines/titanic/game/placeholder/tv_on_bar.cpp b/engines/titanic/game/placeholder/tv_on_bar.cpp
index efbbe50..e17fb78 100644
--- a/engines/titanic/game/placeholder/tv_on_bar.cpp
+++ b/engines/titanic/game/placeholder/tv_on_bar.cpp
@@ -27,13 +27,13 @@ namespace Titanic {
void CTVOnBar::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writePoint(_pos1, indent);
- CPlaceHolderItem::save(file, indent);
+ CPlaceHolder::save(file, indent);
}
void CTVOnBar::load(SimpleFile *file) {
file->readNumber();
_pos1 = file->readPoint();
- CPlaceHolderItem::load(file);
+ CPlaceHolder::load(file);
}
} // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/tv_on_bar.h b/engines/titanic/game/placeholder/tv_on_bar.h
index d41d972..bb5381f 100644
--- a/engines/titanic/game/placeholder/tv_on_bar.h
+++ b/engines/titanic/game/placeholder/tv_on_bar.h
@@ -23,11 +23,11 @@
#ifndef TITANIC_TV_ON_BAR_H
#define TITANIC_TV_ON_BAR_H
-#include "titanic/game/placeholder/place_holder_item.h"
+#include "titanic/game/placeholder/place_holder.h"
namespace Titanic {
-class CTVOnBar : public CPlaceHolderItem {
+class CTVOnBar : public CPlaceHolder {
private:
Point _pos1;
public:
diff --git a/engines/titanic/game/play_music_button.cpp b/engines/titanic/game/play_music_button.cpp
index 8066739..9341691 100644
--- a/engines/titanic/game/play_music_button.cpp
+++ b/engines/titanic/game/play_music_button.cpp
@@ -21,23 +21,58 @@
*/
#include "titanic/game/play_music_button.h"
+#include "titanic/sound/music_room.h"
namespace Titanic {
+BEGIN_MESSAGE_MAP(CPlayMusicButton, CBackground)
+ ON_MESSAGE(MouseButtonDownMsg)
+ ON_MESSAGE(FrameMsg)
+END_MESSAGE_MAP()
+
void CPlayMusicButton::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_fieldE0, indent);
- file->writeNumberLine(_fieldE4, indent);
+ file->writeNumberLine(_flag, indent);
+ file->writeNumberLine(_ticks, indent);
CBackground::save(file, indent);
}
void CPlayMusicButton::load(SimpleFile *file) {
file->readNumber();
- _fieldE0 = file->readNumber();
- _fieldE4 = file->readNumber();
+ _flag = file->readNumber();
+ _ticks = file->readNumber();
CBackground::load(file);
}
+bool CPlayMusicButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ CMusicRoom *musicRoom = getMusicRoom();
+ if (_flag) {
+ musicRoom->stopMusic();
+ stopMovie();
+ loadFrame(0);
+ _flag = false;
+ } else {
+ musicRoom->startMusic(100);
+ playMovie(MOVIE_REPEAT);
+ _ticks = getTicksCount();
+ _flag = true;
+ }
+
+ return true;
+}
+
+bool CPlayMusicButton::FrameMsg(CFrameMsg *msg) {
+ if (_flag && !CMusicRoom::_musicHandler->isBusy()) {
+ CMusicRoom *musicRoom = getMusicRoom();
+ musicRoom->stopMusic();
+ stopMovie();
+ loadFrame(0);
+ _flag = false;
+ }
+
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/play_music_button.h b/engines/titanic/game/play_music_button.h
index 4e34741..824b372 100644
--- a/engines/titanic/game/play_music_button.h
+++ b/engines/titanic/game/play_music_button.h
@@ -28,12 +28,15 @@
namespace Titanic {
class CPlayMusicButton : public CBackground {
+ DECLARE_MESSAGE_MAP;
+ bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+ bool FrameMsg(CFrameMsg *msg);
public:
- int _fieldE0;
- int _fieldE4;
+ bool _flag;
+ uint _ticks;
public:
CLASSDEF;
- CPlayMusicButton() : CBackground(), _fieldE0(0), _fieldE4(0) {}
+ CPlayMusicButton() : CBackground(), _flag(false), _ticks(0) {}
/**
* Save the data for the class to file
diff --git a/engines/titanic/game/play_on_act.cpp b/engines/titanic/game/play_on_act.cpp
index e1ef120..9c368c3 100644
--- a/engines/titanic/game/play_on_act.cpp
+++ b/engines/titanic/game/play_on_act.cpp
@@ -24,6 +24,11 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CPlayOnAct, CBackground)
+ ON_MESSAGE(ActMsg)
+ ON_MESSAGE(LeaveViewMsg)
+END_MESSAGE_MAP()
+
void CPlayOnAct::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CBackground::save(file, indent);
@@ -34,4 +39,20 @@ void CPlayOnAct::load(SimpleFile *file) {
CBackground::load(file);
}
+bool CPlayOnAct::ActMsg(CActMsg *msg) {
+ if (msg->_action == "PlayMovie") {
+ setVisible(true);
+ playMovie(0);
+ } else if (msg->_action == "PlayToEnd") {
+ setVisible(true);
+ playMovie(MOVIE_GAMESTATE);
+ }
+
+ return true;
+}
+
+bool CPlayOnAct::LeaveViewMsg(CLeaveViewMsg *msg) {
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/play_on_act.h b/engines/titanic/game/play_on_act.h
index 197e647..72615f2 100644
--- a/engines/titanic/game/play_on_act.h
+++ b/engines/titanic/game/play_on_act.h
@@ -28,6 +28,9 @@
namespace Titanic {
class CPlayOnAct : public CBackground {
+ DECLARE_MESSAGE_MAP;
+ bool ActMsg(CActMsg *msg);
+ bool LeaveViewMsg(CLeaveViewMsg *msg);
public:
CLASSDEF;
diff --git a/engines/titanic/game/port_hole.cpp b/engines/titanic/game/port_hole.cpp
index f3c447f..25807b1 100644
--- a/engines/titanic/game/port_hole.cpp
+++ b/engines/titanic/game/port_hole.cpp
@@ -24,26 +24,72 @@
namespace Titanic {
-CPortHole::CPortHole() : CGameObject(), _fieldBC(0),
- _string1("b#47.wav"), _string2("b#46.wav") {
+BEGIN_MESSAGE_MAP(CPortHole, CGameObject)
+ ON_MESSAGE(ActMsg)
+ ON_MESSAGE(MovieEndMsg)
+ ON_MESSAGE(LeaveViewMsg)
+ ON_MESSAGE(EnterViewMsg)
+END_MESSAGE_MAP()
+
+CPortHole::CPortHole() : CGameObject(), _open(false),
+ _closeSoundName("b#47.wav"), _openSoundName("b#46.wav") {
}
void CPortHole::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_fieldBC, indent);
- file->writeQuotedLine(_string1, indent);
- file->writeQuotedLine(_string2, indent);
+ file->writeNumberLine(_open, indent);
+ file->writeQuotedLine(_closeSoundName, indent);
+ file->writeQuotedLine(_openSoundName, indent);
CGameObject::save(file, indent);
}
void CPortHole::load(SimpleFile *file) {
file->readNumber();
- _fieldBC = file->readNumber();
- _string1 = file->readString();
- _string2 = file->readString();
+ _open = file->readNumber();
+ _closeSoundName = file->readString();
+ _openSoundName = file->readString();
CGameObject::load(file);
}
+bool CPortHole::ActMsg(CActMsg *msg) {
+ if (msg->_action == "TogglePortHole") {
+ if (_open) {
+ playMovie(14, 26, MOVIE_NOTIFY_OBJECT);
+ playSound(_closeSoundName);
+ _open = false;
+ } else {
+ setVisible(true);
+ playMovie(1, 13, 0);
+ playSound(_openSoundName);
+ _open = true;
+ }
+ }
+
+ return true;
+}
+
+bool CPortHole::MovieEndMsg(CMovieEndMsg *msg) {
+ _open = false;
+ setVisible(false);
+ return true;
+}
+
+bool CPortHole::LeaveViewMsg(CLeaveViewMsg *msg) {
+ if (_open) {
+ playSound(_closeSoundName);
+ playMovie(14, 26, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE);
+ _open = false;
+ }
+
+ return true;
+}
+
+bool CPortHole::EnterViewMsg(CEnterViewMsg *msg) {
+ setVisible(false);
+ _open = false;
+ return true;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game/port_hole.h b/engines/titanic/game/port_hole.h
index 7bba18d..9f1997a 100644
--- a/engines/titanic/game/port_hole.h
+++ b/engines/titanic/game/port_hole.h
@@ -28,9 +28,14 @@
namespace Titanic {
class CPortHole : public CGameObject {
+ DECLARE_MESSAGE_MAP;
+ bool ActMsg(CActMsg *msg);
+ bool MovieEndMsg(CMovieEndMsg *msg);
+ bool LeaveViewMsg(CLeaveViewMsg *msg);
+ bool EnterViewMsg(CEnterViewMsg *msg);
private:
- int _fieldBC;
- CString _string1, _string2;
+ bool _open;
+ CString _closeSoundName, _openSoundName;
public:
CLASSDEF;
CPortHole();
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 2182f58..90d010b 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -242,7 +242,7 @@ MODULE_OBJS := \
game/pickup/pick_up_speech_centre.o \
game/pickup/pick_up_vis_centre.o \
game/placeholder/bar_shelf_vis_centre.o \
- game/placeholder/place_holder_item.o \
+ game/placeholder/place_holder.o \
game/placeholder/lemon_on_bar.o \
game/placeholder/tv_on_bar.o \
game/transport/gondolier.o \
More information about the Scummvm-git-logs
mailing list