aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/midi/alsa.cpp10
-rw-r--r--backends/midi/camd.cpp10
-rw-r--r--backends/midi/dmedia.cpp5
-rw-r--r--backends/platform/android/events.cpp8
-rw-r--r--backends/platform/sdl/posix/posix.cpp1
-rw-r--r--backends/saves/posix/posix-saves.cpp1
-rw-r--r--engines/agi/preagi_winnie.cpp51
-rw-r--r--engines/agi/preagi_winnie.h2
-rw-r--r--engines/m4/detection.cpp15
-rw-r--r--engines/m4/m4.cpp1
-rw-r--r--engines/queen/music.cpp2
-rw-r--r--engines/tsage/core.cpp4
-rw-r--r--engines/tsage/core.h1
-rw-r--r--engines/tsage/globals.cpp3
-rw-r--r--engines/tsage/graphics.cpp4
-rw-r--r--gui/ThemeEngine.cpp16
16 files changed, 86 insertions, 48 deletions
diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp
index 5110734a18..bc8fab6a56 100644
--- a/backends/midi/alsa.cpp
+++ b/backends/midi/alsa.cpp
@@ -183,6 +183,11 @@ void MidiDriver_ALSA::close() {
}
void MidiDriver_ALSA::send(uint32 b) {
+ if (!_isOpen) {
+ warning("MidiDriver_ALSA: Got event while not open");
+ return;
+ }
+
unsigned int midiCmd[4];
ev.type = SND_SEQ_EVENT_OSS;
@@ -256,6 +261,11 @@ void MidiDriver_ALSA::send(uint32 b) {
}
void MidiDriver_ALSA::sysEx(const byte *msg, uint16 length) {
+ if (!_isOpen) {
+ warning("MidiDriver_ALSA: Got SysEx while not open");
+ return;
+ }
+
unsigned char buf[266];
assert(length + 2 <= ARRAYSIZE(buf));
diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp
index cc791cf7c0..aafc7347f0 100644
--- a/backends/midi/camd.cpp
+++ b/backends/midi/camd.cpp
@@ -116,11 +116,21 @@ void MidiDriver_CAMD::close() {
}
void MidiDriver_CAMD::send(uint32 b) {
+ if (!_isOpen) {
+ warning("MidiDriver_CAMD: Got event while not open");
+ return;
+ }
+
ULONG data = READ_LE_UINT32(&b);
_ICamd->PutMidi(_midi_link, data);
}
void MidiDriver_CAMD::sysEx(const byte *msg, uint16 length) {
+ if (!_isOpen) {
+ warning("MidiDriver_CAMD: Got SysEx while not open");
+ return;
+ }
+
unsigned char buf[266];
assert(length + 2 <= ARRAYSIZE(buf));
diff --git a/backends/midi/dmedia.cpp b/backends/midi/dmedia.cpp
index c4c1968354..ba6d58d52d 100644
--- a/backends/midi/dmedia.cpp
+++ b/backends/midi/dmedia.cpp
@@ -34,9 +34,10 @@
#if defined(IRIX)
-#include "common/scummsys.h"
-#include "common/util.h"
#include "common/config-manager.h"
+#include "common/error.h"
+#include "common/textconsole.h"
+#include "common/util.h"
#include "audio/musicplugin.h"
#include "audio/mpu401.h"
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index 2f140f0c0b..0d74e1c524 100644
--- a/backends/platform/android/events.cpp
+++ b/backends/platform/android/events.cpp
@@ -461,8 +461,12 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
if (arg4 & JMETA_SHIFT)
e.kbd.flags |= Common::KBD_SHIFT;
- if (arg4 & JMETA_ALT)
- e.kbd.flags |= Common::KBD_ALT;
+ // JMETA_ALT is Fn on physical keyboards!
+ // when mapping this to ALT - as we know it from PC keyboards - all
+ // Fn combos will be broken (like Fn+q, which needs to end as 1 and
+ // not ALT+1). Do not want.
+ //if (arg4 & JMETA_ALT)
+ // e.kbd.flags |= Common::KBD_ALT;
if (arg4 & (JMETA_SYM | JMETA_CTRL))
e.kbd.flags |= Common::KBD_CTRL;
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index 889bc5cd5e..2208f7c351 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -24,6 +24,7 @@
*/
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
+#define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h
#include "common/scummsys.h"
diff --git a/backends/saves/posix/posix-saves.cpp b/backends/saves/posix/posix-saves.cpp
index 37db208223..3a8e5e998e 100644
--- a/backends/saves/posix/posix-saves.cpp
+++ b/backends/saves/posix/posix-saves.cpp
@@ -26,6 +26,7 @@
// Enable mkdir
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
+#define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h
#include "common/scummsys.h"
diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp
index c92434c15f..ef35a0b4e0 100644
--- a/engines/agi/preagi_winnie.cpp
+++ b/engines/agi/preagi_winnie.cpp
@@ -217,15 +217,9 @@ int Winnie::getObjInRoom(int iRoom) {
return 0;
}
-#define setTakeDrop() {\
- if (getObjInRoom(_room))\
- fCanSel[IDI_WTP_SEL_TAKE] = true;\
- else\
- fCanSel[IDI_WTP_SEL_TAKE] = false;\
- if (_game.iObjHave)\
- fCanSel[IDI_WTP_SEL_DROP] = true;\
- else\
- fCanSel[IDI_WTP_SEL_DROP] = false;\
+void Winnie::setTakeDrop(int fCanSel[]) {
+ fCanSel[IDI_WTP_SEL_TAKE] = getObjInRoom(_room);
+ fCanSel[IDI_WTP_SEL_DROP] = _game.iObjHave;
}
void Winnie::setFlag(int iFlag) {
@@ -281,7 +275,7 @@ int Winnie::parser(int pc, int index, uint8 *buffer) {
fCanSel[IDI_WTP_SEL_EAST] = fCanSel[IDI_WTP_SEL_WEST] = true;
// check if object in room or player carrying one
- setTakeDrop();
+ setTakeDrop(fCanSel);
// check which rows have a menu option
for (iSel = 0; iSel < IDI_WTP_MAX_OPTION; iSel++) {
@@ -367,11 +361,11 @@ int Winnie::parser(int pc, int index, uint8 *buffer) {
break;
case IDI_WTP_SEL_TAKE:
takeObj(_room);
- setTakeDrop();
+ setTakeDrop(fCanSel);
break;
case IDI_WTP_SEL_DROP:
dropObj(_room);
- setTakeDrop();
+ setTakeDrop(fCanSel);
break;
}
}
@@ -796,13 +790,12 @@ void Winnie::getMenuMouseSel(int *iSel, int fCanSel[], int x, int y) {
}
}
-#define makeSel() {\
- if (fCanSel[*iSel]) {\
- return;\
- } else {\
- keyHelp();\
- clrMenuSel(iSel, fCanSel);\
- }\
+void Winnie::makeSel(int *iSel, int fCanSel[]) {
+ if (fCanSel[*iSel])
+ return;
+
+ keyHelp();
+ clrMenuSel(iSel, fCanSel);
}
void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) {
@@ -844,22 +837,22 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) {
// Click to move
if (fCanSel[IDI_WTP_SEL_NORTH] && hotspotNorth.contains(event.mouse.x, event.mouse.y)) {
*iSel = IDI_WTP_SEL_NORTH;
- makeSel();
+ makeSel(iSel, fCanSel);
_vm->_gfx->setCursorPalette(false);
return;
} else if (fCanSel[IDI_WTP_SEL_SOUTH] && hotspotSouth.contains(event.mouse.x, event.mouse.y)) {
*iSel = IDI_WTP_SEL_SOUTH;
- makeSel();
+ makeSel(iSel, fCanSel);
_vm->_gfx->setCursorPalette(false);
return;
} else if (fCanSel[IDI_WTP_SEL_WEST] && hotspotWest.contains(event.mouse.x, event.mouse.y)) {
*iSel = IDI_WTP_SEL_WEST;
- makeSel();
+ makeSel(iSel, fCanSel);
_vm->_gfx->setCursorPalette(false);
return;
} else if (fCanSel[IDI_WTP_SEL_EAST] && hotspotEast.contains(event.mouse.x, event.mouse.y)) {
*iSel = IDI_WTP_SEL_EAST;
- makeSel();
+ makeSel(iSel, fCanSel);
_vm->_gfx->setCursorPalette(false);
return;
} else {
@@ -944,31 +937,31 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) {
break;
case Common::KEYCODE_n:
*iSel = IDI_WTP_SEL_NORTH;
- makeSel();
+ makeSel(iSel, fCanSel);
break;
case Common::KEYCODE_s:
if (event.kbd.flags & Common::KBD_CTRL) {
_vm->flipflag(fSoundOn);
} else {
*iSel = IDI_WTP_SEL_SOUTH;
- makeSel();
+ makeSel(iSel, fCanSel);
}
break;
case Common::KEYCODE_e:
*iSel = IDI_WTP_SEL_EAST;
- makeSel();
+ makeSel(iSel, fCanSel);
break;
case Common::KEYCODE_w:
*iSel = IDI_WTP_SEL_WEST;
- makeSel();
+ makeSel(iSel, fCanSel);
break;
case Common::KEYCODE_t:
*iSel = IDI_WTP_SEL_TAKE;
- makeSel();
+ makeSel(iSel, fCanSel);
break;
case Common::KEYCODE_d:
*iSel = IDI_WTP_SEL_DROP;
- makeSel();
+ makeSel(iSel, fCanSel);
break;
case Common::KEYCODE_RETURN:
switch (*iSel) {
diff --git a/engines/agi/preagi_winnie.h b/engines/agi/preagi_winnie.h
index 5a5472feb0..0187d80326 100644
--- a/engines/agi/preagi_winnie.h
+++ b/engines/agi/preagi_winnie.h
@@ -342,6 +342,8 @@ private:
void saveGame();
void loadGame();
void dropObjRnd();
+ void setTakeDrop(int[]);
+ void makeSel(int*, int[]);
void wind();
void mist();
diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp
index 4b204996f3..e0983e3327 100644
--- a/engines/m4/detection.cpp
+++ b/engines/m4/detection.cpp
@@ -44,11 +44,11 @@ uint32 MadsM4Engine::getFeatures() const { return _gameDescription->features; }
Common::Language MadsM4Engine::getLanguage() const { return _gameDescription->desc.language; }
Common::Platform MadsM4Engine::getPlatform() const { return _gameDescription->desc.platform; }
-}
+} // End of namespace M4
static const PlainGameDescriptor m4Games[] = {
{"m4", "MADS/M4 engine game"},
- {"riddle", "Riddle of Master Lu: Believe it or Not!"},
+ {"riddle", "Ripley's Believe It or Not!: The Riddle of Master Lu"},
{"burger", "Orion Burger"},
{"rex", "Rex Nebular and the Cosmic Gender Bender"},
{"dragon", "DragonSphere"},
@@ -380,7 +380,12 @@ static const M4GameDescription gameDescriptions[] = {
{ AD_TABLE_END_MARKER, 0, 0 }
};
-}
+} // End of namespace M4
+
+static const char *directoryGlobs[] = {
+ "option1",
+ 0
+};
static const ADParams detectionParams = {
// Pointer to ADGameDescription or its superset structure
@@ -402,9 +407,9 @@ static const ADParams detectionParams = {
// Additional GUI options (for every game}
Common::GUIO_NOMIDI,
// Maximum directory depth
- 1,
+ 2,
// List of directory globs
- 0
+ directoryGlobs
};
class M4MetaEngine : public AdvancedMetaEngine {
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index 1a484322fd..e88140cd26 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -115,6 +115,7 @@ MadsM4Engine::MadsM4Engine(OSystem *syst, const M4GameDescription *gameDesc) :
SearchMan.addSubDirectoryMatching(gameDataDir, "goodstuf");
SearchMan.addSubDirectoryMatching(gameDataDir, "resource");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "option1");
DebugMan.addDebugChannel(kDebugScript, "script", "Script debug level");
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics debug level");
diff --git a/engines/queen/music.cpp b/engines/queen/music.cpp
index 58ecfa6d16..5d1a06ccb2 100644
--- a/engines/queen/music.cpp
+++ b/engines/queen/music.cpp
@@ -99,8 +99,8 @@ MidiMusic::MidiMusic(QueenEngine *vm)
MidiMusic::~MidiMusic() {
_driver->setTimerCallback(0, 0);
_parser->unloadMusic();
- _driver->close();
delete _parser;
+ _driver->close();
delete _driver;
delete[] _buf;
delete[] _musicData;
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 28d6dbfb19..8ad920e6fd 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -1166,6 +1166,10 @@ ScenePalette::ScenePalette() {
_field412 = 0;
}
+ScenePalette::~ScenePalette() {
+ clearListeners();
+}
+
ScenePalette::ScenePalette(int paletteNum) {
loadPalette(paletteNum);
}
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index a4a0ec208a..001b478fc9 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -349,6 +349,7 @@ public:
public:
ScenePalette();
ScenePalette(int paletteNum);
+ ~ScenePalette();
bool loadPalette(int paletteNum);
void refresh();
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 74e957580c..c6e1344714 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -44,7 +44,8 @@ static SavedObject *classFactoryProc(const Common::String &className) {
if (className == "ObjectMover3") return new ObjectMover3();
if (className == "PlayerMover") return new PlayerMover();
if (className == "SceneObjectWrapper") return new SceneObjectWrapper();
-
+ if (className == "PaletteRotation") return new PaletteRotation();
+ if (className == "PaletteFader") return new PaletteFader();
return NULL;
}
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 723e50d338..0a1e1eeaa4 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -258,6 +258,10 @@ void GfxSurface::setScreenSurface() {
void GfxSurface::create(int width, int height) {
assert((width >= 0) && (height >= 0));
_screenSurface = false;
+ if (_customSurface) {
+ _customSurface->free();
+ delete _customSurface;
+ }
_customSurface = new Graphics::Surface();
_customSurface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
Common::set_to((byte *)_customSurface->pixels, (byte *)_customSurface->pixels + (width * height), 0);
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 7fe40542c2..098cb8e0ac 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -391,7 +391,7 @@ bool ThemeEngine::init() {
Common::FSNode node(_themeFile);
if (node.isDirectory()) {
_themeArchive = new Common::FSDirectory(node);
- } else if (_themeFile.hasSuffix(".zip")) {
+ } else if (_themeFile.matchString("*.zip", true)) {
// TODO: Also use "node" directly?
// Look for the zip file via SearchMan
Common::ArchiveMemberPtr member = SearchMan.getMember(_themeFile);
@@ -1535,7 +1535,7 @@ bool ThemeEngine::themeConfigUsable(const Common::ArchiveMember &member, Common:
Common::File stream;
bool foundHeader = false;
- if (member.getName().hasSuffix(".zip")) {
+ if (member.getName().matchString("*.zip", true)) {
Common::Archive *zipArchive = Common::makeZipArchive(member.createReadStream());
if (zipArchive && zipArchive->hasFile("THEMERC")) {
@@ -1557,7 +1557,7 @@ bool ThemeEngine::themeConfigUsable(const Common::FSNode &node, Common::String &
Common::File stream;
bool foundHeader = false;
- if (node.getName().hasSuffix(".zip") && !node.isDirectory()) {
+ if (node.getName().matchString("*.zip", true) && !node.isDirectory()) {
Common::Archive *zipArchive = Common::makeZipArchive(node);
if (zipArchive && zipArchive->hasFile("THEMERC")) {
// Open THEMERC from the ZIP file.
@@ -1643,7 +1643,7 @@ void ThemeEngine::listUsableThemes(Common::Archive &archive, Common::List<ThemeD
// If the name of the node object also contains
// the ".zip" suffix, we will strip it.
- if (td.id.hasSuffix(".zip")) {
+ if (td.id.matchString("*.zip", true)) {
for (int j = 0; j < 4; ++j)
td.id.deleteLastChar();
}
@@ -1680,7 +1680,7 @@ void ThemeEngine::listUsableThemes(const Common::FSNode &node, Common::List<Them
for (Common::FSList::iterator i = fileList.begin(); i != fileList.end(); ++i) {
// We will only process zip files for now
- if (!i->getPath().hasSuffix(".zip"))
+ if (!i->getPath().matchString("*.zip", true))
continue;
td.name.clear();
@@ -1690,7 +1690,7 @@ void ThemeEngine::listUsableThemes(const Common::FSNode &node, Common::List<Them
// If the name of the node object also contains
// the ".zip" suffix, we will strip it.
- if (td.id.hasSuffix(".zip")) {
+ if (td.id.matchString("*.zip", true)) {
for (int j = 0; j < 4; ++j)
td.id.deleteLastChar();
}
@@ -1727,7 +1727,7 @@ Common::String ThemeEngine::getThemeFile(const Common::String &id) {
Common::FSNode node(id);
// If the given id is a full path we'll just use it
- if (node.exists() && (node.isDirectory() || node.getName().hasSuffix(".zip")))
+ if (node.exists() && (node.isDirectory() || node.getName().matchString("*.zip", true)))
return id;
// FIXME:
@@ -1758,7 +1758,7 @@ Common::String ThemeEngine::getThemeId(const Common::String &filename) {
if (!node.exists())
return "builtin";
- if (node.getName().hasSuffix(".zip")) {
+ if (node.getName().matchString("*.zip", true)) {
Common::String id = node.getName();
for (int i = 0; i < 4; ++i)