Skip to content

Commit

Permalink
TITANIC: Cleanup and fixes for GameStateMovieList
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Nov 13, 2016
1 parent a02adba commit f8d935d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions engines/titanic/game_state.cpp
Expand Up @@ -27,7 +27,7 @@

namespace Titanic {

bool CGameStateMovieList::clear() {
bool CGameStateMovieList::empty() {
for (CGameStateMovieList::iterator i = begin(); i != end(); ) {
CMovieListItem *movieItem = *i;

Expand All @@ -38,7 +38,7 @@ bool CGameStateMovieList::clear() {
}
}

return !empty();
return List<CMovieListItem>::empty();
}

/*------------------------------------------------------------------------*/
Expand Down Expand Up @@ -103,7 +103,7 @@ void CGameState::enterNode() {

void CGameState::enterView() {
CViewItem *oldView = _gameLocation.getView();
CViewItem *newView = _movieList._view;
CViewItem *newView = _movieList._destView;
oldView->preEnterView(newView);

_gameManager->_gameView->setView(newView);
Expand All @@ -115,7 +115,7 @@ void CGameState::enterView() {
_gameManager->decTransitions();
oldView->enterView(newView);

_movieList._view = nullptr;
_movieList._destView = nullptr;
_movieList._movieClip = nullptr;
}

Expand All @@ -133,7 +133,7 @@ void CGameState::changeView(CViewItem *newView, CMovieClip *clip) {
clip = nullptr;

if (_mode == GSMODE_CUTSCENE) {
_movieList._view = newView;
_movieList._destView = newView;
_movieList._movieClip = clip;
_gameManager->incTransitions();
} else {
Expand All @@ -153,9 +153,9 @@ void CGameState::changeView(CViewItem *newView, CMovieClip *clip) {
}

void CGameState::checkForViewChange() {
if (_mode == GSMODE_CUTSCENE && _movieList.clear()) {
if (_mode == GSMODE_CUTSCENE && _movieList.empty()) {
setMode(GSMODE_INTERACTIVE);
if (_movieList._view)
if (_movieList._destView)
enterView();
}
}
Expand Down
8 changes: 4 additions & 4 deletions engines/titanic/game_state.h
Expand Up @@ -48,15 +48,15 @@ enum Season {
PTR_LIST_ITEM(CMovie);
class CGameStateMovieList : public List<CMovieListItem> {
public:
CViewItem *_view;
CViewItem *_destView;
CMovieClip *_movieClip;
public:
CGameStateMovieList() : List<CMovieListItem>(), _view(nullptr), _movieClip(nullptr) {}
CGameStateMovieList() : List<CMovieListItem>(), _destView(nullptr), _movieClip(nullptr) {}

/**
* Clear the movie list
* Returns true if there are no movies in the list
*/
bool clear();
bool empty();
};

class CGameState {
Expand Down

0 comments on commit f8d935d

Please sign in to comment.