aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorJohannes Schickel2010-10-13 03:57:44 +0000
committerJohannes Schickel2010-10-13 03:57:44 +0000
commit75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch)
treef29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/agos
parent48ee83b88957dab86bc763e9ef21a70179fa8679 (diff)
parente9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff)
downloadscummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz
scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2
scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend changes into the branch. I suppose the gp2x backend and probably all new backends, i.e. gph, dingux etc., might not compile anymore. Since I have no way of testing those it would be nice if porters could look into getting those up to speed in this branch. svn-id: r53399
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agos.cpp12
-rw-r--r--engines/agos/animation.cpp4
-rw-r--r--engines/agos/detection_tables.h21
-rw-r--r--engines/agos/items.cpp6
-rw-r--r--engines/agos/midi.cpp8
-rw-r--r--engines/agos/midi.h2
-rw-r--r--engines/agos/saveload.cpp9
-rw-r--r--engines/agos/sound.cpp2
8 files changed, 47 insertions, 17 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index c5841ff05e..0c8e6dd63c 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -561,11 +561,11 @@ Common::Error AGOSEngine::init() {
_driver = MidiDriver::createMidi(dev);
- if (_nativeMT32) {
+ if (_nativeMT32)
_driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
- }
- _midi.mapMT32toGM (getGameType() != GType_SIMON2 && !_nativeMT32);
+ _midi.setNativeMT32(_nativeMT32);
+ _midi.mapMT32toGM(getGameType() != GType_SIMON2 && !_nativeMT32);
_midi.setDriver(_driver);
@@ -925,10 +925,10 @@ AGOSEngine::~AGOSEngine() {
free(_textMem);
free(_xtblList);
- free(_backGroundBuf);
- free(_backBuf);
+ delete _backGroundBuf;
+ delete _backBuf;
free(_planarBuf);
- free(_scaleBuf);
+ delete _scaleBuf;
free(_zoneBuffers);
free(_window4BackScn);
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index 1b3ac9fd65..af85c50114 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -372,10 +372,10 @@ bool MoviePlayerDXA::processFrame() {
_vm->_system->unlockScreen();
Common::Rational soundTime(_mixer->getSoundElapsedTime(_bgSound), 1000);
- if ((_bgSoundStream == NULL) || ((int)(soundTime * getFrameRate()) / 1000 < getCurFrame() + 1)) {
+ if ((_bgSoundStream == NULL) || ((soundTime * getFrameRate()).toInt() / 1000 < getCurFrame() + 1)) {
if (_bgSoundStream && _mixer->isSoundHandleActive(_bgSound)) {
- while (_mixer->isSoundHandleActive(_bgSound) && ((int) (soundTime * getFrameRate())) < getCurFrame()) {
+ while (_mixer->isSoundHandleActive(_bgSound) && (soundTime * getFrameRate()).toInt() < getCurFrame()) {
_vm->_system->delayMillis(10);
soundTime = Common::Rational(_mixer->getSoundElapsedTime(_bgSound), 1000);
}
diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h
index e3709f8409..963c08849c 100644
--- a/engines/agos/detection_tables.h
+++ b/engines/agos/detection_tables.h
@@ -2811,6 +2811,27 @@ static const AGOSGameDescription gameDescriptions[] = {
GF_OLD_BUNDLE | GF_TALKIE
},
+ // Simon the Sorcerer's Puzzle Pack - Swampy Adventures - Polish
+ {
+ {
+ "swampy",
+ "CD",
+
+ {
+ { "Gswampy", GAME_BASEFILE, "31bfb5169b47ccc19177e61bd31d4391", -1},
+ { NULL, 0, NULL, 0}
+ },
+ Common::PL_POL,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO_NOSUBTITLES
+ },
+
+ GType_PP,
+ GID_SWAMPY,
+ GF_OLD_BUNDLE | GF_TALKIE
+ },
+
// Simon the Sorcerer's Puzzle Pack - Swampy Adventures - Spanish
{
{
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index 874bf1a802..6c6b127a51 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -429,6 +429,9 @@ Item *AGOSEngine::findMaster(int16 a, int16 n) {
for (j = 1; j < _itemArraySize; j++) {
Item *item = derefItem(j);
+ if (item == NULL)
+ continue;
+
if (wordMatch(item, a, n))
return item;
}
@@ -442,6 +445,9 @@ Item *AGOSEngine::nextMaster(Item *i, int16 a, int16 n) {
for (j = first; j < _itemArraySize; j++) {
Item *item = derefItem(j);
+ if (item == NULL)
+ continue;
+
if (wordMatch(item, a, n))
return item;
}
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index ab5bfc4c94..858307685c 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -77,10 +77,10 @@ int MidiPlayer::open() {
return ret;
_driver->setTimerCallback(this, &onTimer);
- // General MIDI System On message
- // Resets all GM devices to default settings
- _driver->sysEx((const byte *)"\x7E\x7F\x09\x01", 4);
- g_system->delayMillis(20);
+ if (_nativeMT32)
+ _driver->sendMT32Reset();
+ else
+ _driver->sendGMReset();
return 0;
}
diff --git a/engines/agos/midi.h b/engines/agos/midi.h
index d4c09118f6..d76997737a 100644
--- a/engines/agos/midi.h
+++ b/engines/agos/midi.h
@@ -61,6 +61,7 @@ protected:
MidiDriver *_driver;
bool _map_mt32_to_gm;
bool _passThrough;
+ bool _nativeMT32;
MusicInfo _music;
MusicInfo _sfx;
@@ -97,6 +98,7 @@ public:
void loadS1D(Common::File *in, bool sfx = false);
void mapMT32toGM(bool map);
+ void setNativeMT32(bool nativeMT32) { _nativeMT32 = nativeMT32; }
void setLoop(bool loop);
void startTrack(int track);
void queueTrack(int track, bool loop);
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp
index e9fbaf3525..ffa95506c5 100644
--- a/engines/agos/saveload.cpp
+++ b/engines/agos/saveload.cpp
@@ -26,6 +26,7 @@
#include "common/file.h"
#include "common/savefile.h"
#include "common/system.h"
+#include "common/translation.h"
#include "gui/about.h"
#include "gui/message.h"
@@ -146,14 +147,14 @@ void AGOSEngine::quickLoadOrSave() {
}
bool success;
- char buf[60];
+ Common::String buf;
char *filename = genSaveName(_saveLoadSlot);
if (_saveLoadType == 2) {
Subroutine *sub;
success = loadGame(genSaveName(_saveLoadSlot));
if (!success) {
- sprintf(buf, "Failed to load game state to file:\n\n%s", filename);
+ buf = Common::String::printf(_("Failed to load game state from file:\n\n%s"), filename);
} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
drawIconArray(2, me(), 0, 0);
setBitFlag(97, true);
@@ -188,7 +189,7 @@ void AGOSEngine::quickLoadOrSave() {
} else {
success = saveGame(_saveLoadSlot, _saveLoadName);
if (!success)
- sprintf(buf, "Failed to save game state to file:\n\n%s", filename);
+ buf = Common::String::printf(_("Failed to save game state to file:\n\n%s"), filename);
}
if (!success) {
@@ -196,7 +197,7 @@ void AGOSEngine::quickLoadOrSave() {
dialog.runModal();
} else if (_saveLoadType == 1) {
- sprintf(buf, "Successfully saved game state in file:\n\n%s", filename);
+ buf = Common::String::printf(_("Successfully saved game state in file:\n\n%s"), filename);
GUI::TimedMessageDialog dialog(buf, 1500);
dialog.runModal();
diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp
index bd4c89a404..6ec72814fa 100644
--- a/engines/agos/sound.cpp
+++ b/engines/agos/sound.cpp
@@ -776,7 +776,7 @@ void Sound::playVoiceData(byte *soundData, uint sound) {
}
void Sound::playSoundData(Audio::SoundHandle *handle, byte *soundData, uint sound, int pan, int vol, bool loop) {
- int size = READ_LE_UINT32(soundData + 4);
+ int size = READ_LE_UINT32(soundData + 4) + 8;
Common::MemoryReadStream *stream = new Common::MemoryReadStream(soundData, size);
Audio::RewindableAudioStream *sndStream = Audio::makeWAVStream(stream, DisposeAfterUse::YES);