aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorChristopher Page2008-08-09 19:03:29 +0000
committerChristopher Page2008-08-09 19:03:29 +0000
commitce3d1e1a7d9ec9860d3fc42d8127a1634051d950 (patch)
treefbf6c9a71e7e4bdb90d502755d282c183562e93b /backends
parentf41471d34bb6afb1dc0b6604b1952d10ef583765 (diff)
parent71f4a15e4efebf4de7a25d2b09817cf3a5aa51b5 (diff)
downloadscummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.tar.gz
scummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.tar.bz2
scummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.zip
Merged revisions 33632-33633,33635,33637,33639-33640,33642-33645,33648,33654-33655,33664,33667-33670,33673-33674,33678,33682,33686-33691,33693,33696,33698,33700,33703,33708,33710,33712-33714,33716 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk svn-id: r33720
Diffstat (limited to 'backends')
-rw-r--r--backends/fs/windows/windows-fs.cpp5
-rw-r--r--backends/midi/alsa.cpp42
-rw-r--r--backends/platform/wince/CEActionsPocket.cpp2
-rw-r--r--backends/platform/wince/CEActionsSmartphone.cpp2
-rw-r--r--backends/platform/wince/missing/missing.cpp11
5 files changed, 39 insertions, 23 deletions
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index ac2f521e21..77530c6073 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -260,11 +260,6 @@ AbstractFilesystemNode *WindowsFilesystemNode::getChild(const String &n) const {
newPath += '\\';
newPath += n;
- // Check whether the directory actually exists
- DWORD fileAttribs = GetFileAttributes(toUnicode(newPath.c_str()));
- if (fileAttribs == INVALID_FILE_ATTRIBUTES)
- return 0;
-
return new WindowsFilesystemNode(newPath, false);
}
diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp
index 2a252b9323..5a978a0fd2 100644
--- a/backends/midi/alsa.cpp
+++ b/backends/midi/alsa.cpp
@@ -79,20 +79,18 @@ MidiDriver_ALSA::MidiDriver_ALSA()
}
int MidiDriver_ALSA::open() {
- const char *var;
+ const char *var = NULL;
if (_isOpen)
return MERR_ALREADY_OPEN;
_isOpen = true;
- if (!(var = getenv("SCUMMVM_PORT"))) {
- // use config option if no var specified
+ var = getenv("SCUMMVM_PORT");
+ if (!var && ConfMan.hasKey("alsa_port")) {
var = ConfMan.get("alsa_port").c_str();
- if (parse_addr(var, &seq_client, &seq_port) < 0) {
- error("Invalid port %s", var);
- return -1;
- }
- } else {
+ }
+
+ if (var) {
if (parse_addr(var, &seq_client, &seq_port) < 0) {
error("Invalid port %s", var);
return -1;
@@ -120,14 +118,32 @@ int MidiDriver_ALSA::open() {
return -1;
}
- if (seq_client != SND_SEQ_ADDRESS_SUBSCRIBERS) {
- /* subscribe to MIDI port */
- if (snd_seq_connect_to(seq_handle, my_port, seq_client, seq_port) < 0) {
- error("Can't subscribe to MIDI port (%d:%d) see README for help", seq_client, seq_port);
+ if (var) {
+ if (seq_client != SND_SEQ_ADDRESS_SUBSCRIBERS) {
+ // subscribe to MIDI port
+ if (snd_seq_connect_to(seq_handle, my_port, seq_client, seq_port) < 0) {
+ error("Can't subscribe to MIDI port (%d:%d) see README for help", seq_client, seq_port);
+ }
}
- else printf("Connected to Alsa sequencer client [%d:%d]\n", seq_client, seq_port);
+ } else {
+ int defaultPorts[] = {
+ 65, 0,
+ 17, 0
+ };
+ int i;
+
+ for (i = 0; i < ARRAYSIZE(defaultPorts); i += 2) {
+ seq_client = defaultPorts[i];
+ seq_port = defaultPorts[i + 1];
+ if (snd_seq_connect_to(seq_handle, my_port, seq_client, seq_port) >= 0)
+ break;
+ }
+
+ if (i >= ARRAYSIZE(defaultPorts))
+ error("Can't subscribe to MIDI port (65:0) or (17:0)");
}
+ printf("Connected to Alsa sequencer client [%d:%d]\n", seq_client, seq_port);
printf("ALSA client initialised [%d:0]\n", my_client);
return 0;
diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp
index 45310dba88..932599004d 100644
--- a/backends/platform/wince/CEActionsPocket.cpp
+++ b/backends/platform/wince/CEActionsPocket.cpp
@@ -121,7 +121,7 @@ void CEActionsPocket::initInstanceGame() {
bool is_comi = (strncmp(gameid.c_str(), "comi", 4) == 0);
bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0);
bool is_saga = (gameid == "saga");
- bool is_kyra = (gameid == "kyra1");
+ bool is_kyra = (strncmp(gameid.c_str(), "kyra",4) == 0);
bool is_samnmax = (gameid == "samnmax");
bool is_cine = (gameid == "cine");
bool is_touche = (gameid == "touche");
diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp
index 97d780d534..6877c343e3 100644
--- a/backends/platform/wince/CEActionsSmartphone.cpp
+++ b/backends/platform/wince/CEActionsSmartphone.cpp
@@ -111,7 +111,7 @@ void CEActionsSmartphone::initInstanceGame() {
bool is_comi = (strncmp(gameid.c_str(), "comi", 4) == 0);
bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0);
bool is_saga = (gameid == "saga");
- bool is_kyra = (gameid == "kyra1");
+ bool is_kyra = (strncmp(gameid.c_str(), "kyra",4) == 0);
bool is_samnmax = (gameid == "samnmax");
bool is_cine = (gameid == "cine");
bool is_touche = (gameid == "touche");
diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp
index c760b1f7df..f03f00bb9a 100644
--- a/backends/platform/wince/missing/missing.cpp
+++ b/backends/platform/wince/missing/missing.cpp
@@ -171,7 +171,7 @@ int _access(const char *path, int mode) {
MultiByteToWideChar(CP_ACP, 0, path, -1, fname, sizeof(fname)/sizeof(TCHAR));
WIN32_FIND_DATA ffd;
- HANDLE h=FindFirstFile(fname, &ffd);
+ HANDLE h = FindFirstFile(fname, &ffd);
FindClose(h);
if (h == INVALID_HANDLE_VALUE)
@@ -179,9 +179,14 @@ int _access(const char *path, int mode) {
if (ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
// WORKAROUND: WinCE (or the emulator) sometimes returns bogus direcotry
- // hits for files that don't exist. Checking for the same fname twice
+ // hits for files that don't exist. TRIPLE checking for the same fname
// seems to weed out those false positives.
- HANDLE h=FindFirstFile(fname, &ffd);
+ // Exhibited in kyra engine.
+ HANDLE h = FindFirstFile(fname, &ffd);
+ FindClose(h);
+ if (h == INVALID_HANDLE_VALUE)
+ return -1; //Can't find file
+ h = FindFirstFile(fname, &ffd);
FindClose(h);
if (h == INVALID_HANDLE_VALUE)
return -1; //Can't find file