diff options
Diffstat (limited to 'engines/titanic/core')
-rw-r--r-- | engines/titanic/core/file_item.h | 2 | ||||
-rw-r--r-- | engines/titanic/core/game_object.cpp | 27 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 20 | ||||
-rw-r--r-- | engines/titanic/core/link_item.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/core/list.h | 4 | ||||
-rw-r--r-- | engines/titanic/core/message_target.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/core/project_item.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/core/project_item.h | 6 | ||||
-rw-r--r-- | engines/titanic/core/resource_key.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/core/room_item.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/core/saveable_object.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/core/saveable_object.h | 8 | ||||
-rw-r--r-- | engines/titanic/core/tree_item.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/core/turn_on_play_sound.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/core/view_item.cpp | 8 |
15 files changed, 50 insertions, 49 deletions
diff --git a/engines/titanic/core/file_item.h b/engines/titanic/core/file_item.h index 4cecee4882..0b02d9d938 100644 --- a/engines/titanic/core/file_item.h +++ b/engines/titanic/core/file_item.h @@ -44,7 +44,7 @@ public: /** * Load the data for the class from file */ - virtual void load(SimpleFile *file); + virtual void load(SimpleFile *file); /** * Returns true if the item is a file item diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 56c838995e..8f71b3d995 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -89,7 +89,7 @@ void CGameObject::save(SimpleFile *file, int indent) { if (_surface) { const CMovieRangeInfoList *rangeList = _surface->getMovieRangeInfo(); - + if (rangeList) { for (CMovieRangeInfoList::const_iterator i = rangeList->begin(); i != rangeList->end(); ++i) { @@ -109,7 +109,7 @@ void CGameObject::save(SimpleFile *file, int indent) { file->writeNumberLine(_field40, indent + 1); file->writeQuotedLine(_resource, indent + 1); file->writeBounds(_bounds, indent + 1); - + file->writeFloatLine(_field34, indent + 1); file->writeFloatLine(_field38, indent + 1); file->writeFloatLine(_field3C, indent + 1); @@ -178,7 +178,7 @@ void CGameObject::load(SimpleFile *file) { _id = file->readNumber(); _roomFlags = file->readNumber(); - resourceKey.load(file); + resourceKey.load(file); _surface = nullptr; val = file->readNumber(); if (val) { @@ -199,7 +199,7 @@ void CGameObject::draw(CScreenManager *screenManager) { if (_credits && _credits->_objectP == this) { if (!_credits->draw()) CGameObject::deinit(); - + return; } @@ -281,7 +281,7 @@ bool CGameObject::checkPoint(const Point &pt, bool ignore40, bool visibleOnly) { } Common::Point pixelPos = pt - _bounds; - if (_surface->_transBlitFlag) { + if (_surface->_flipVertically) { pixelPos.y = ((_bounds.height() - _bounds.top) / 2) * 2 - pixelPos.y; } @@ -354,7 +354,7 @@ void CGameObject::loadMovie(const CString &name, bool pendingFlag) { // Create the surface if it doesn't already exist if (!_surface) { CGameManager *gameManager = getGameManager(); - _surface = new OSVideoSurface(gameManager->setScreenManager(), nullptr); + _surface = new OSVideoSurface(gameManager->setScreenManager(), nullptr); } // Load the new movie resource @@ -402,9 +402,10 @@ void CGameObject::loadImage(const CString &name, bool pendingFlag) { } void CGameObject::loadFrame(int frameNumber) { - if (frameNumber != -1 && !_resource.empty()) + _frameNumber = -1; + if (!_resource.empty()) loadResource(_resource); - + if (_surface) _surface->setMovieFrame(frameNumber); @@ -858,14 +859,14 @@ CViewItem *CGameObject::parseView(const CString &viewString) { CRoomItem *room = gameManager->getRoom(); CProjectItem *project = room->getRoot(); - + // Ensure we have the specified room if (project) { if (room->getName() != roomName) { // Scan for the correct room for (room = project->findFirstRoom(); room && room->getName() != roomName; room = project->findNextRoom(room)) ; - } + } } if (!room) return nullptr; @@ -953,7 +954,7 @@ CGameObject *CGameObject::findMailByFlags(int mode, uint roomFlags) { CMailMan *mailMan = getMailMan(); if (!mailMan) return nullptr; - + for (CGameObject *obj = mailMan->getFirstObject(); obj; obj = mailMan->getNextObject(obj)) { if (compareRoomFlags(mode, roomFlags, obj->_roomFlags)) @@ -1077,7 +1078,7 @@ void CGameObject::setText(const CString &str, int border, int borderRight) { _text = new CPetText(); _textBorder = border; _textBorderRight = borderRight; - + _text->setText(str); CScreenManager *screenManager = getGameManager()->setScreenManager(); _text->scrollToTop(screenManager); @@ -1207,7 +1208,7 @@ bool CGameObject::changeView(const CString &viewName, const CString &clipName) { if (!oldView || !newView) return false; - + CMovieClip *clip = nullptr; if (!clipName.empty()) { clip = oldView->findNode()->findRoom()->findClip(clipName); diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index b9a55ac008..b50278cf21 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -401,7 +401,7 @@ protected: * Clear the PET display */ void petClear() const; - + /** * Returns the MailMan */ @@ -488,7 +488,7 @@ protected: * Locks the PET, disabling all input. Can be called multiple times */ void petLockInput(); - + /** * Unlocks PET input */ @@ -646,7 +646,7 @@ public: * Change the object's status */ void playMovie(uint flags); - + /** * Play the movie specified in _resource */ @@ -671,7 +671,7 @@ public: * Get the current movie frame */ int getMovieFrame() const; - + /** * Returns the object's frame number */ @@ -706,7 +706,7 @@ public: * Return the player's passenger class */ int getPassengerClass() const; - + /** * Return the player's previous passenger class */ @@ -732,7 +732,7 @@ public: * Returns a hidden object */ CGameObject *getHiddenObject(const CString &name) const; - + /** * Sets up credits text */ @@ -742,7 +742,7 @@ public: * Support function for drag moving */ void dragMove(const Point &pt); - + /** * Returns the currently dragging item (if any) if it's a game object */ @@ -965,17 +965,17 @@ public: /*--- CGameState Methods ---*/ void setState1C(bool flag); - + /** * Change to the next season */ void stateChangeSeason(); - + /** * Returns the currently active season */ Season stateGetSeason() const; - + void stateSet24(); int stateGet24() const; void stateInc38(); diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp index f77d081c61..559191efc9 100644 --- a/engines/titanic/core/link_item.cpp +++ b/engines/titanic/core/link_item.cpp @@ -57,8 +57,8 @@ CString CLinkItem::formName() { view->getName().c_str(), destView->getName().c_str()); case 3: - return CString::format("_TRACK,%d,%s,%d,%s", - node->_nodeNumber, view->getName().c_str(), + return CString::format("_TRACK,%d,%s,%d,%s", + node->_nodeNumber, view->getName().c_str(), destNode->_nodeNumber, destView->getName().c_str()); case 4: diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h index 91a74adbdc..09068fb06a 100644 --- a/engines/titanic/core/list.h +++ b/engines/titanic/core/list.h @@ -130,7 +130,7 @@ public: */ void destroyContents() { typename Common::List<T *>::iterator i; - for (i = Common::List<T *>::begin(); + for (i = Common::List<T *>::begin(); i != Common::List<T *>::end(); ++i) { CSaveableObject *obj = *i; delete obj; @@ -149,7 +149,7 @@ public: } bool contains(const T *item) const { - for (typename Common::List<T *>::const_iterator i = Common::List<T *>::begin(); + for (typename Common::List<T *>::const_iterator i = Common::List<T *>::begin(); i != Common::List<T *>::end(); ++i) { if (*i == item) return true; diff --git a/engines/titanic/core/message_target.cpp b/engines/titanic/core/message_target.cpp index 4815d03973..a1060c643e 100644 --- a/engines/titanic/core/message_target.cpp +++ b/engines/titanic/core/message_target.cpp @@ -24,7 +24,7 @@ namespace Titanic { -const MSGMAP *CMessageTarget::getMessageMap() const { +const MSGMAP *CMessageTarget::getMessageMap() const { return getThisMessageMap(); } diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp index 76293233b0..65e8645baa 100644 --- a/engines/titanic/core/project_item.cpp +++ b/engines/titanic/core/project_item.cpp @@ -287,7 +287,7 @@ void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const { item->saveHeader(file, 0); item->save(file, 1); item->saveFooter(file, 0); - + CTreeItem *child = item->getFirstChild(); if (child) { file->write("\n{\n", 3); @@ -300,7 +300,7 @@ void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const { file->write("\n{\n", 3); file->writeQuotedString("ALONG"); } - + file->write("\n}\n", 3); item = item->getNextSibling(); } diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h index 473ffd9556..4d009dd50b 100644 --- a/engines/titanic/core/project_item.h +++ b/engines/titanic/core/project_item.h @@ -66,7 +66,7 @@ public: /** * Load the data for the class from file */ - virtual void load(SimpleFile *file); + virtual void load(SimpleFile *file); }; /** @@ -89,7 +89,7 @@ private: * Called during save, iterates through the children to do some stuff */ void buildFilesList(); - + /** * Called at the beginning of loading a game */ @@ -161,7 +161,7 @@ public: /** * Load the data for the class from file */ - virtual void load(SimpleFile *file); + virtual void load(SimpleFile *file); /** * Get the game manager for the project diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp index 3b390af2d4..3db5812d7d 100644 --- a/engines/titanic/core/resource_key.cpp +++ b/engines/titanic/core/resource_key.cpp @@ -37,7 +37,7 @@ void CResourceKey::save(SimpleFile *file, int indent) { void CResourceKey::load(SimpleFile *file) { int val = file->readNumber(); - + if (val == 0 || val == 1) { file->readBuffer(); CString str = file->readString(); diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp index 49b3232ba1..1c360c7571 100644 --- a/engines/titanic/core/room_item.cpp +++ b/engines/titanic/core/room_item.cpp @@ -59,7 +59,7 @@ void CRoomItem::save(SimpleFile *file, int indent) { void CRoomItem::load(SimpleFile *file) { int val = file->readNumber(); - + switch (val) { case 3: // Read exit movie @@ -114,7 +114,7 @@ void CRoomItem::postLoad() { void CRoomItem::calcNodePosition(const Point &nodePos, double &xVal, double &yVal) const { xVal = yVal = 0.0; - + if (_roomDimensionX >= 0.0 && _roomDimensionY >= 0.0) { xVal = _roomRect.width() / _roomDimensionX; yVal = _roomRect.height() / _roomDimensionY; diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp index 630404a6ee..7522a34737 100644 --- a/engines/titanic/core/saveable_object.cpp +++ b/engines/titanic/core/saveable_object.cpp @@ -421,7 +421,7 @@ CSaveableObject *ClassDef::create() { /*------------------------------------------------------------------------*/ -Common::HashMap<Common::String, CSaveableObject::CreateFunction> * +Common::HashMap<Common::String, CSaveableObject::CreateFunction> * CSaveableObject::_classList = nullptr; Common::List<ClassDef *> *CSaveableObject::_classDefs; @@ -1346,7 +1346,7 @@ void CSaveableObject::initClassList() { ADDFN(CTextUp, CPetGraphic); ADDFN(CToggleButton, CBackground); ADDFN(CToggleSwitch, CGameObject); - + ADDFN(CActMsg, CMessage); ADDFN(CActivationmsg, CMessage); ADDFN(CAddHeadPieceMsg, CMessage); diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h index 6d80ad121d..4c7c1a7737 100644 --- a/engines/titanic/core/saveable_object.h +++ b/engines/titanic/core/saveable_object.h @@ -47,7 +47,7 @@ public: template<typename T> class TypeTemplate : public ClassDef { public: - TypeTemplate(const char *className, ClassDef *parent) : + TypeTemplate(const char *className, ClassDef *parent) : ClassDef(className, parent) {} virtual CSaveableObject *create() { return new T(); } }; @@ -79,7 +79,7 @@ public: public: CLASSDEF virtual ~CSaveableObject() {} - + bool isInstanceOf(const ClassDef *classDef) const; /** @@ -91,13 +91,13 @@ public: * Load the data for the class from file */ virtual void load(SimpleFile *file); - + /** * Write out a header definition for the class to file * prior to saving the actual data for the class */ virtual void saveHeader(SimpleFile *file, int indent); - + /** * Writes out a footer for the class after it's data has * been written to file diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp index 86c34cab8b..97d06d7bbe 100644 --- a/engines/titanic/core/tree_item.cpp +++ b/engines/titanic/core/tree_item.cpp @@ -51,7 +51,7 @@ void CTreeItem::dump(int indent) { CTreeItem *item = getFirstChild(); while (item) { item->dump(indent + 1); - + item = item->getNextSibling(); } } diff --git a/engines/titanic/core/turn_on_play_sound.cpp b/engines/titanic/core/turn_on_play_sound.cpp index ab50b33134..44a9b3b0eb 100644 --- a/engines/titanic/core/turn_on_play_sound.cpp +++ b/engines/titanic/core/turn_on_play_sound.cpp @@ -28,7 +28,7 @@ BEGIN_MESSAGE_MAP(CTurnOnPlaySound, CTurnOnObject) ON_MESSAGE(MouseButtonUpMsg) END_MESSAGE_MAP() -CTurnOnPlaySound::CTurnOnPlaySound() : CTurnOnObject(), +CTurnOnPlaySound::CTurnOnPlaySound() : CTurnOnObject(), _soundName("NULL"), _soundVolume(80), _soundVal3(0) { } diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp index 176765b12f..9b20860a46 100644 --- a/engines/titanic/core/view_item.cpp +++ b/engines/titanic/core/view_item.cpp @@ -63,7 +63,7 @@ void CViewItem::save(SimpleFile *file, int indent) { void CViewItem::load(SimpleFile *file) { int val = file->readNumber(); - + switch (val) { case 1: _resourceKey.load(file); @@ -86,7 +86,7 @@ bool CViewItem::getResourceKey(CResourceKey *key) { } void CViewItem::leaveView(CViewItem *newView) { - // Only do the processing if we've been passed a view, and it's not the same + // Only do the processing if we've been passed a view, and it's not the same if (newView && newView != this) { CLeaveViewMsg viewMsg(this, newView); viewMsg.execute(this, nullptr, MSGFLAG_SCAN); @@ -112,7 +112,7 @@ void CViewItem::leaveView(CViewItem *newView) { } void CViewItem::preEnterView(CViewItem *newView) { - // Only do the processing if we've been passed a view, and it's not the same + // Only do the processing if we've been passed a view, and it's not the same if (newView && newView != this) { CPreEnterViewMsg viewMsg(this, newView); viewMsg.execute(newView, nullptr, MSGFLAG_SCAN); @@ -134,7 +134,7 @@ void CViewItem::preEnterView(CViewItem *newView) { } void CViewItem::enterView(CViewItem *newView) { - // Only do the processing if we've been passed a view, and it's not the same + // Only do the processing if we've been passed a view, and it's not the same if (newView && newView != this) { CEnterViewMsg viewMsg(this, newView); viewMsg.execute(newView, nullptr, MSGFLAG_SCAN); |