Skip to content

Commit

Permalink
PINK: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
voltya authored and sev- committed Jun 28, 2018
1 parent 475f6a6 commit e48ac17
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion engines/pink/file.cpp
Expand Up @@ -75,7 +75,7 @@ bool OrbFile::open(const Common::String &name) {
void OrbFile::loadGame(PinkEngine *game) {
seekToObject("PinkGame");
Archive archive(*this);
archive.mapObject((Object *) game); // hack
archive.mapObject(reinterpret_cast<Object*>(game)); // hack
game->load(archive);
}

Expand Down
2 changes: 1 addition & 1 deletion engines/pink/objects/handlers/handler.cpp
Expand Up @@ -65,7 +65,7 @@ void HandlerSequences::onMessage(LeadActor *actor) {
Handler::onMessage(actor);
Sequencer *sequencer = actor->getSequencer();

assert(_sequences.size());
assert(!_sequences.empty());

Common::RandomSource &rnd = actor->getPage()->getGame()->getRnd();
uint index = rnd.getRandomNumber(_sequences.size() - 1);
Expand Down
8 changes: 2 additions & 6 deletions engines/pink/objects/module.cpp
Expand Up @@ -50,11 +50,9 @@ void Module::init(bool isLoadingSave, const Common::String &pageName) {
// 0 0 - new game
// 0 1 - module changed
// 1 0 - from save
if (!pageName.empty()) {
if (!pageName.empty())
_page = findPage(pageName);
}

if (!_page)
else if (!_page)
_page = _pages[0];

_page->init(isLoadingSave);
Expand All @@ -67,7 +65,6 @@ void Module::changePage(const Common::String &pageName) {

//_page->clear


page->init(kLoadingNewGame);
}

Expand All @@ -78,7 +75,6 @@ GamePage *Module::findPage(const Common::String &pageName) const {
});
}


PinkEngine *Module::getGame() const {
return _game;
}
Expand Down
4 changes: 2 additions & 2 deletions engines/pink/sound.cpp
Expand Up @@ -34,8 +34,8 @@ Sound::Sound(Audio::Mixer *mixer, Common::SeekableReadStream *stream)
}

Sound::~Sound() {
//look for mem leak
stop();
delete _stream;
}

bool Sound::isPlaying() {
Expand Down Expand Up @@ -64,7 +64,7 @@ void Sound::play(Audio::Mixer::SoundType type, int volume, bool isLoop) {
_stream = Audio::makeLoopingAudioStream(seekableStream, 0, 0, 0);
}

_mixer->playStream(type, &_handle ,_stream, -1 , Audio::Mixer::kMaxChannelVolume, 0,DisposeAfterUse::NO);
_mixer->playStream(type, &_handle ,_stream, -1 , Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO);
}

bool Sound::load(Common::SeekableReadStream *stream) {
Expand Down

0 comments on commit e48ac17

Please sign in to comment.