ALL: sync with scummvm
This commit is contained in:
parent
0c962164d4
commit
7329a5d164
126 changed files with 2443 additions and 1679 deletions
13
.gitignore
vendored
13
.gitignore
vendored
|
@ -23,12 +23,23 @@ lib*.a
|
||||||
/.project
|
/.project
|
||||||
/.cproject
|
/.cproject
|
||||||
/.settings
|
/.settings
|
||||||
|
/Icon.*
|
||||||
|
|
||||||
/build
|
/build
|
||||||
/dists/codeblocks/*.cbp
|
/dists/codeblocks/*.cbp
|
||||||
/dists/codeblocks/*.depend
|
/dists/codeblocks/*.depend
|
||||||
/dists/codeblocks/*.layout
|
/dists/codeblocks/*.layout
|
||||||
/dists/codeblocks/scummvm*
|
/dists/codeblocks/residual*
|
||||||
|
|
||||||
|
#Ignore XCode user data and build files
|
||||||
|
xcuserdata
|
||||||
|
project.xcworkspace
|
||||||
|
/dists/iphone/build
|
||||||
|
/dists/iphone/residual.xcodeproj
|
||||||
|
/dists/iphone/create_project
|
||||||
|
/dists/macosx/build
|
||||||
|
/dists/macosx/residual.xcodeproj
|
||||||
|
/dists/macosx/create_project
|
||||||
|
|
||||||
/dists/msvc*/[Dd]ebug*/
|
/dists/msvc*/[Dd]ebug*/
|
||||||
/dists/msvc*/[Rr]elease*/
|
/dists/msvc*/[Rr]elease*/
|
||||||
|
|
17
COPYING
17
COPYING
|
@ -1,8 +1,8 @@
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
|
||||||
General Public License applies to most of the Free Software
|
General Public License applies to most of the Free Software
|
||||||
Foundation's software and to any other program whose authors commit to
|
Foundation's software and to any other program whose authors commit to
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
the GNU Lesser General Public License instead.) You can apply it to
|
||||||
your programs, too.
|
your programs, too.
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License along
|
||||||
along with this program; if not, write to the Free Software
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
|
||||||
This General Public License does not permit incorporating your program into
|
This General Public License does not permit incorporating your program into
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
consider it more useful to permit linking proprietary applications with the
|
consider it more useful to permit linking proprietary applications with the
|
||||||
library. If this is what you want to do, use the GNU Library General
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License.
|
Public License instead of this License.
|
|
@ -66,10 +66,10 @@ Travis Howell
|
||||||
Janne Huttunen
|
Janne Huttunen
|
||||||
Felix Jakschitsch
|
Felix Jakschitsch
|
||||||
Jeroen Janssen
|
Jeroen Janssen
|
||||||
Willem Jan Palenstijn
|
|
||||||
Florian Kagerer
|
Florian Kagerer
|
||||||
Filippos Karapetis
|
Filippos Karapetis
|
||||||
Andreas Karlsson
|
Andreas Karlsson
|
||||||
|
Ismail Khatib
|
||||||
Oliver Kiehl
|
Oliver Kiehl
|
||||||
Martin Kiewitz
|
Martin Kiewitz
|
||||||
Pawel Kolodziejski
|
Pawel Kolodziejski
|
||||||
|
@ -84,6 +84,7 @@ Gregory Montoir
|
||||||
Kostas Nakos
|
Kostas Nakos
|
||||||
Mikesch Nepomuk
|
Mikesch Nepomuk
|
||||||
Nicolas Noble
|
Nicolas Noble
|
||||||
|
Willem Jan Palenstijn
|
||||||
Lars Persson
|
Lars Persson
|
||||||
Joost Peters
|
Joost Peters
|
||||||
Tim Phillips
|
Tim Phillips
|
||||||
|
|
|
@ -48,7 +48,7 @@ struct StreamFileFormat {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const StreamFileFormat STREAM_FILEFORMATS[] = {
|
static const StreamFileFormat STREAM_FILEFORMATS[] = {
|
||||||
/* decoderName, fileExt, openStreamFuntion */
|
/* decoderName, fileExt, openStreamFunction */
|
||||||
#ifdef USE_FLAC
|
#ifdef USE_FLAC
|
||||||
{ "FLAC", ".flac", makeFLACStream },
|
{ "FLAC", ".flac", makeFLACStream },
|
||||||
{ "FLAC", ".fla", makeFLACStream },
|
{ "FLAC", ".fla", makeFLACStream },
|
||||||
|
|
|
@ -303,7 +303,7 @@ int FLACStream::readBuffer(int16 *buffer, const int numSamples) {
|
||||||
const uint numChannels = getChannels();
|
const uint numChannels = getChannels();
|
||||||
|
|
||||||
if (numChannels == 0) {
|
if (numChannels == 0) {
|
||||||
warning("FLACStream: Stream not successfully initialised, cant playback");
|
warning("FLACStream: Stream not successfully initialized, cant playback");
|
||||||
return -1; // streaminfo wasnt read!
|
return -1; // streaminfo wasnt read!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,10 @@
|
||||||
#define SOUND_FMOPL_H
|
#define SOUND_FMOPL_H
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
#include "common/str.h"
|
|
||||||
|
namespace Common {
|
||||||
|
class String;
|
||||||
|
}
|
||||||
|
|
||||||
namespace OPL {
|
namespace OPL {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,9 @@
|
||||||
#include "common/str.h"
|
#include "common/str.h"
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
#include "common/textconsole.h"
|
#include "common/textconsole.h"
|
||||||
|
#include "common/translation.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
|
#include "gui/message.h"
|
||||||
#include "audio/mididrv.h"
|
#include "audio/mididrv.h"
|
||||||
#include "audio/musicplugin.h"
|
#include "audio/musicplugin.h"
|
||||||
|
|
||||||
|
@ -110,6 +112,8 @@ Common::String MidiDriver::getDeviceString(DeviceHandle handle, DeviceStringType
|
||||||
return d->getMusicDriverName();
|
return d->getMusicDriverName();
|
||||||
else if (type == kDriverId)
|
else if (type == kDriverId)
|
||||||
return d->getMusicDriverId();
|
return d->getMusicDriverId();
|
||||||
|
else if (type == kDeviceName)
|
||||||
|
return d->getCompleteName();
|
||||||
else if (type == kDeviceId)
|
else if (type == kDeviceId)
|
||||||
return d->getCompleteId();
|
return d->getCompleteId();
|
||||||
else
|
else
|
||||||
|
@ -125,6 +129,7 @@ Common::String MidiDriver::getDeviceString(DeviceHandle handle, DeviceStringType
|
||||||
MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
|
MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
|
||||||
// Query the selected music device (defaults to MT_AUTO device).
|
// Query the selected music device (defaults to MT_AUTO device).
|
||||||
DeviceHandle hdl = getDeviceHandle(ConfMan.get("music_driver"));
|
DeviceHandle hdl = getDeviceHandle(ConfMan.get("music_driver"));
|
||||||
|
DeviceHandle reslt = 0;
|
||||||
|
|
||||||
_forceTypeMT32 = false;
|
_forceTypeMT32 = false;
|
||||||
|
|
||||||
|
@ -133,148 +138,234 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
|
||||||
switch (getMusicType(hdl)) {
|
switch (getMusicType(hdl)) {
|
||||||
case MT_PCSPK:
|
case MT_PCSPK:
|
||||||
if (flags & MDT_PCSPK)
|
if (flags & MDT_PCSPK)
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_PCJR:
|
case MT_PCJR:
|
||||||
if (flags & MDT_PCJR)
|
if (flags & MDT_PCJR)
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_CMS:
|
case MT_CMS:
|
||||||
if (flags & MDT_CMS)
|
if (flags & MDT_CMS)
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_ADLIB:
|
case MT_ADLIB:
|
||||||
if (flags & MDT_ADLIB)
|
if (flags & MDT_ADLIB)
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_C64:
|
case MT_C64:
|
||||||
if (flags & MDT_C64)
|
if (flags & MDT_C64)
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_AMIGA:
|
case MT_AMIGA:
|
||||||
if (flags & MDT_AMIGA)
|
if (flags & MDT_AMIGA)
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_APPLEIIGS:
|
case MT_APPLEIIGS:
|
||||||
if (flags & MDT_APPLEIIGS)
|
if (flags & MDT_APPLEIIGS)
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_TOWNS:
|
case MT_TOWNS:
|
||||||
if (flags & MDT_TOWNS)
|
if (flags & MDT_TOWNS)
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_PC98:
|
case MT_PC98:
|
||||||
if (flags & MDT_PC98)
|
if (flags & MDT_PC98)
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_GM:
|
case MT_GM:
|
||||||
case MT_GS:
|
case MT_GS:
|
||||||
case MT_MT32:
|
case MT_MT32:
|
||||||
if (flags & MDT_MIDI)
|
if (flags & MDT_MIDI)
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_NULL:
|
case MT_NULL:
|
||||||
return hdl;
|
reslt = hdl;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Common::String failedDevStr;
|
||||||
|
if (getMusicType(hdl) == MT_INVALID) {
|
||||||
|
// If the expressly selected driver or device cannot be found (no longer compiled in, turned off, etc.)
|
||||||
|
// we display a warning and continue.
|
||||||
|
failedDevStr = ConfMan.get("music_driver");
|
||||||
|
Common::String warningMsg = Common::String::format(_("The selected audio device '%s' was not found (e.g. might be turned off or disconnected). Attempting to fall back to the next available device..."), failedDevStr.c_str());
|
||||||
|
GUI::MessageDialog dialog(warningMsg);
|
||||||
|
dialog.runModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
MusicType tp = getMusicType(reslt);
|
||||||
|
if (tp != MT_INVALID && tp != MT_AUTO) {
|
||||||
|
if (checkDevice(reslt)) {
|
||||||
|
return reslt;
|
||||||
|
} else {
|
||||||
|
// If the expressly selected device cannot be used we display a warning and continue.
|
||||||
|
failedDevStr = getDeviceString(hdl, MidiDriver::kDeviceName);
|
||||||
|
Common::String warningMsg = Common::String::format(_("The selected audio device '%s' cannot be used. See log file for more information. Attempting to fall back to the next available device..."), failedDevStr.c_str());
|
||||||
|
GUI::MessageDialog dialog(warningMsg);
|
||||||
|
dialog.runModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
reslt = 0;
|
||||||
|
|
||||||
// If the selected driver did not match the flags setting,
|
// If the selected driver did not match the flags setting,
|
||||||
// we try to determine a suitable and "optimal" music driver.
|
// we try to determine a suitable and "optimal" music driver.
|
||||||
const MusicPlugin::List p = MusicMan.getPlugins();
|
const MusicPlugin::List p = MusicMan.getPlugins();
|
||||||
// If only MDT_MIDI but not MDT_PREFER_MT32 or MDT_PREFER_GM is set we prefer the other devices (which will always be
|
// If only MDT_MIDI but not MDT_PREFER_MT32 or MDT_PREFER_GM is set we prefer the other devices (which will always be
|
||||||
// detected since they are hard coded and cannot be disabled.
|
// detected since they are hard coded and cannot be disabled).
|
||||||
for (int l = (flags & (MDT_PREFER_GM | MDT_PREFER_MT32)) ? 1 : 0; l < 2; ++l) {
|
bool skipMidi = !(flags & (MDT_PREFER_GM | MDT_PREFER_MT32));
|
||||||
if ((flags & MDT_MIDI) && (l == 1)) {
|
while (flags != MDT_NONE) {
|
||||||
// If a preferred MT32 or GM device has been selected that device gets returned
|
if ((flags & MDT_MIDI) && !skipMidi) {
|
||||||
if (flags & MDT_PREFER_MT32)
|
// If a preferred MT32 or GM device has been selected that device gets returned if available.
|
||||||
hdl = getDeviceHandle(ConfMan.get("mt32_device"));
|
Common::String devStr;
|
||||||
|
if (flags & MDT_PREFER_MT32)
|
||||||
|
devStr = ConfMan.get("mt32_device");
|
||||||
else if (flags & MDT_PREFER_GM)
|
else if (flags & MDT_PREFER_GM)
|
||||||
hdl = getDeviceHandle(ConfMan.get("gm_device"));
|
devStr = ConfMan.get("gm_device");
|
||||||
else
|
else
|
||||||
hdl = getDeviceHandle("auto");
|
devStr = "auto";
|
||||||
|
|
||||||
|
hdl = getDeviceHandle(devStr);
|
||||||
const MusicType type = getMusicType(hdl);
|
const MusicType type = getMusicType(hdl);
|
||||||
|
|
||||||
// If have a "Don't use GM/MT-32" setting we skip this part and jump
|
// If we have a "Don't use GM/MT-32" setting we skip this part and jump
|
||||||
// to AdLib, PC Speaker etc. detection right away.
|
// to AdLib, PC Speaker etc. detection right away.
|
||||||
if (type != MT_NULL) {
|
if (type != MT_NULL) {
|
||||||
if (type != MT_AUTO && type != MT_INVALID) {
|
if (type == MT_INVALID) {
|
||||||
if (flags & MDT_PREFER_MT32)
|
// If the preferred (expressly requested) selected driver or device cannot be found (no longer compiled in, turned off, etc.)
|
||||||
// If we have a preferred MT32 device we disable the gm/mt32 mapping (more about this in mididrv.h)
|
// we display a warning and continue. Don't warn about the missing device if we did already (this becomes relevant if the
|
||||||
_forceTypeMT32 = true;
|
// missing device is selected as preferred device and also as GM or MT-32 device).
|
||||||
|
if (failedDevStr != devStr) {
|
||||||
return hdl;
|
Common::String warningMsg = Common::String::format(_("The preferred audio device '%s' was not found (e.g. might be turned off or disconnected). Attempting to fall back to the next available device..."), devStr.c_str());
|
||||||
|
GUI::MessageDialog dialog(warningMsg);
|
||||||
|
dialog.runModal();
|
||||||
|
}
|
||||||
|
} else if (type != MT_AUTO) {
|
||||||
|
if (checkDevice(hdl)) {
|
||||||
|
if (flags & MDT_PREFER_MT32)
|
||||||
|
// If we have a preferred MT32 device we disable the gm/mt32 mapping (more about this in mididrv.h).
|
||||||
|
_forceTypeMT32 = true;
|
||||||
|
return hdl;
|
||||||
|
} else {
|
||||||
|
// If the preferred (expressly requested) device cannot be used we display a warning and continue.
|
||||||
|
// Don't warn about the failing device if we did already (this becomes relevant if the failing
|
||||||
|
// device is selected as preferred device and also as GM or MT-32 device).
|
||||||
|
if (failedDevStr != getDeviceString(hdl, MidiDriver::kDeviceName)) {
|
||||||
|
Common::String warningMsg = Common::String::format(_("The preferred audio device '%s' cannot be used. See log file for more information. Attempting to fall back to the next available device..."), getDeviceString(hdl, MidiDriver::kDeviceName).c_str());
|
||||||
|
GUI::MessageDialog dialog(warningMsg);
|
||||||
|
dialog.runModal();
|
||||||
|
}
|
||||||
|
hdl = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have no specific device selected (neither in the scummvm nor in the game domain)
|
// If no specific device is selected (neither in the scummvm nor in the game domain)
|
||||||
// and no preferred MT32 or GM device selected we arrive here.
|
// and there is no preferred MT32 or GM device selected either or if the detected device is unavailable we arrive here.
|
||||||
// If MT32 is preferred we try for the first available device with music type 'MT_MT32' (usually the mt32 emulator)
|
// If MT32 is preferred we try for the first available device with music type 'MT_MT32' (usually the mt32 emulator).
|
||||||
if (flags & MDT_PREFER_MT32) {
|
if (flags & MDT_PREFER_MT32) {
|
||||||
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
|
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
|
||||||
MusicDevices i = (**m)->getDevices();
|
MusicDevices i = (**m)->getDevices();
|
||||||
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
|
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
|
||||||
if (d->getMusicType() == MT_MT32)
|
if (d->getMusicType() == MT_MT32) {
|
||||||
return d->getHandle();
|
hdl = d->getHandle();
|
||||||
|
if (checkDevice(hdl))
|
||||||
|
return hdl;
|
||||||
|
else
|
||||||
|
// No warning here, since the user hasn't expressly requested anything.
|
||||||
|
hdl = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we default to the first available device with music type 'MT_GM'
|
// Now we default to the first available device with music type 'MT_GM' if not
|
||||||
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
|
// MT-32 is preferred or if MT-32 is preferred but all other devices have failed.
|
||||||
MusicDevices i = (**m)->getDevices();
|
if (!(flags & MDT_PREFER_MT32) || flags == (MDT_PREFER_MT32 | MDT_MIDI)) {
|
||||||
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
|
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
|
||||||
if (d->getMusicType() == MT_GM || d->getMusicType() == MT_GS)
|
MusicDevices i = (**m)->getDevices();
|
||||||
return d->getHandle();
|
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
|
||||||
|
if (d->getMusicType() == MT_GM || d->getMusicType() == MT_GS) {
|
||||||
|
hdl = d->getHandle();
|
||||||
|
if (checkDevice(hdl))
|
||||||
|
return hdl;
|
||||||
|
else
|
||||||
|
// No warning here, since the user hasn't expressly requested anything.
|
||||||
|
hdl = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// Detection flags get removed after final detection attempt to avoid further attempts.
|
||||||
|
flags &= ~(MDT_MIDI | MDT_PREFER_GM | MDT_PREFER_MT32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MusicType tp = MT_AUTO;
|
// The order in this list is important, since this is the order of preference
|
||||||
if (flags & MDT_TOWNS)
|
// (e.g. MT_ADLIB is checked before MT_PCJR and MT_PCSPK for a good reason).
|
||||||
|
// Detection flags get removed after detection attempt to avoid further attempts.
|
||||||
|
if (flags & MDT_TOWNS) {
|
||||||
tp = MT_TOWNS;
|
tp = MT_TOWNS;
|
||||||
else if (flags & MDT_PC98)
|
flags &= ~MDT_TOWNS;
|
||||||
|
} else if (flags & MDT_PC98) {
|
||||||
tp = MT_PC98;
|
tp = MT_PC98;
|
||||||
else if (flags & MDT_ADLIB)
|
flags &= ~MDT_PC98;
|
||||||
|
} else if (flags & MDT_ADLIB) {
|
||||||
tp = MT_ADLIB;
|
tp = MT_ADLIB;
|
||||||
else if (flags & MDT_PCJR)
|
flags &= ~MDT_ADLIB;
|
||||||
|
} else if (flags & MDT_PCJR) {
|
||||||
tp = MT_PCJR;
|
tp = MT_PCJR;
|
||||||
else if (flags & MDT_PCSPK)
|
flags &= ~MDT_PCJR;
|
||||||
|
} else if (flags & MDT_PCSPK) {
|
||||||
tp = MT_PCSPK;
|
tp = MT_PCSPK;
|
||||||
else if (flags & MDT_C64)
|
flags &= ~MDT_PCSPK;
|
||||||
|
} else if (flags & MDT_C64) {
|
||||||
tp = MT_C64;
|
tp = MT_C64;
|
||||||
else if (flags & MDT_AMIGA)
|
flags &= ~MDT_C64;
|
||||||
|
} else if (flags & MDT_AMIGA) {
|
||||||
tp = MT_AMIGA;
|
tp = MT_AMIGA;
|
||||||
else if (flags & MDT_APPLEIIGS)
|
flags &= ~MDT_AMIGA;
|
||||||
|
} else if (flags & MDT_APPLEIIGS) {
|
||||||
tp = MT_APPLEIIGS;
|
tp = MT_APPLEIIGS;
|
||||||
else if (l == 0)
|
flags &= ~MDT_APPLEIIGS;
|
||||||
// if we haven't tried to find a MIDI device yet we do this now.
|
} else if (flags & MDT_MIDI) {
|
||||||
|
// If we haven't tried to find a MIDI device yet we do this now.
|
||||||
|
skipMidi = false;
|
||||||
continue;
|
continue;
|
||||||
else
|
} else if (flags) {
|
||||||
|
// Invalid flags. Set them to MDT_NONE to leave detection loop.
|
||||||
|
flags = MDT_NONE;
|
||||||
tp = MT_AUTO;
|
tp = MT_AUTO;
|
||||||
|
}
|
||||||
|
|
||||||
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
|
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
|
||||||
MusicDevices i = (**m)->getDevices();
|
MusicDevices i = (**m)->getDevices();
|
||||||
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
|
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
|
||||||
if (d->getMusicType() == tp)
|
if (d->getMusicType() == tp) {
|
||||||
return d->getHandle();
|
hdl = d->getHandle();
|
||||||
|
if (checkDevice(hdl))
|
||||||
|
return hdl;
|
||||||
|
else
|
||||||
|
// No warning here, since the user hasn't expressly requested anything.
|
||||||
|
hdl = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return reslt;
|
||||||
}
|
}
|
||||||
|
|
||||||
MidiDriver *MidiDriver::createMidi(MidiDriver::DeviceHandle handle) {
|
MidiDriver *MidiDriver::createMidi(MidiDriver::DeviceHandle handle) {
|
||||||
|
@ -288,11 +379,21 @@ MidiDriver *MidiDriver::createMidi(MidiDriver::DeviceHandle handle) {
|
||||||
return driver;
|
return driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MidiDriver::checkDevice(MidiDriver::DeviceHandle handle) {
|
||||||
|
const MusicPlugin::List p = MusicMan.getPlugins();
|
||||||
|
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); m++) {
|
||||||
|
if (getDeviceString(handle, MidiDriver::kDriverId).equals((**m)->getId()))
|
||||||
|
return (**m)->checkDevice(handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
MidiDriver::DeviceHandle MidiDriver::getDeviceHandle(const Common::String &identifier) {
|
MidiDriver::DeviceHandle MidiDriver::getDeviceHandle(const Common::String &identifier) {
|
||||||
const MusicPlugin::List p = MusicMan.getPlugins();
|
const MusicPlugin::List p = MusicMan.getPlugins();
|
||||||
|
|
||||||
if (p.begin() == p.end())
|
if (p.begin() == p.end())
|
||||||
error("Music plugins must be loaded prior to calling this method");
|
error("MidiDriver::getDeviceHandle: Music plugins must be loaded prior to calling this method");
|
||||||
|
|
||||||
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); m++) {
|
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); m++) {
|
||||||
MusicDevices i = (**m)->getDevices();
|
MusicDevices i = (**m)->getDevices();
|
||||||
|
|
|
@ -142,6 +142,7 @@ public:
|
||||||
enum DeviceStringType {
|
enum DeviceStringType {
|
||||||
kDriverName,
|
kDriverName,
|
||||||
kDriverId,
|
kDriverId,
|
||||||
|
kDeviceName,
|
||||||
kDeviceId
|
kDeviceId
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -156,6 +157,9 @@ public:
|
||||||
/** Find the music driver matching the given driver name/description. */
|
/** Find the music driver matching the given driver name/description. */
|
||||||
static DeviceHandle getDeviceHandle(const Common::String &identifier);
|
static DeviceHandle getDeviceHandle(const Common::String &identifier);
|
||||||
|
|
||||||
|
/** Check whether the device with the given handle is available. */
|
||||||
|
static bool checkDevice(DeviceHandle handle);
|
||||||
|
|
||||||
/** Get the music type matching the given device handle, or MT_AUTO if there is no match. */
|
/** Get the music type matching the given device handle, or MT_AUTO if there is no match. */
|
||||||
static MusicType getMusicType(DeviceHandle handle);
|
static MusicType getMusicType(DeviceHandle handle);
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,13 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual MusicDevices getDevices() const = 0;
|
virtual MusicDevices getDevices() const = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether a device can actually be used. Currently this is only
|
||||||
|
* implemented for the MT-32 emulator to check whether the required rom
|
||||||
|
* files are present.
|
||||||
|
*/
|
||||||
|
virtual bool checkDevice(MidiDriver::DeviceHandle) const { return true; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to instantiate a MIDI Driver instance based on the device
|
* Tries to instantiate a MIDI Driver instance based on the device
|
||||||
* previously detected via MidiDriver::detectDevice()
|
* previously detected via MidiDriver::detectDevice()
|
||||||
|
|
|
@ -857,6 +857,7 @@ void AdLibPercussionChannel::sysEx_customInstrument(uint32 type, const byte *ins
|
||||||
// Allocate memory for the new instruments
|
// Allocate memory for the new instruments
|
||||||
if (!_customInstruments[note]) {
|
if (!_customInstruments[note]) {
|
||||||
_customInstruments[note] = new AdLibInstrument;
|
_customInstruments[note] = new AdLibInstrument;
|
||||||
|
memset(_customInstruments[note], 0, sizeof(AdLibInstrument));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the new instrument data
|
// Save the new instrument data
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
|
#include "common/system.h"
|
||||||
|
|
||||||
#ifdef USE_MT32EMU
|
#ifdef USE_MT32EMU
|
||||||
|
|
||||||
|
@ -62,7 +63,7 @@ protected:
|
||||||
void generateSamples(int16 *buf, int len);
|
void generateSamples(int16 *buf, int len);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool _initialising;
|
bool _initializing;
|
||||||
|
|
||||||
MidiDriver_MT32(Audio::Mixer *mixer);
|
MidiDriver_MT32(Audio::Mixer *mixer);
|
||||||
virtual ~MidiDriver_MT32();
|
virtual ~MidiDriver_MT32();
|
||||||
|
@ -218,7 +219,7 @@ static MT32Emu::File *MT32_OpenFile(void *userData, const char *filename, MT32Em
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MT32_PrintDebug(void *userData, const char *fmt, va_list list) {
|
static void MT32_PrintDebug(void *userData, const char *fmt, va_list list) {
|
||||||
if (((MidiDriver_MT32 *)userData)->_initialising) {
|
if (((MidiDriver_MT32 *)userData)->_initializing) {
|
||||||
char buf[512];
|
char buf[512];
|
||||||
|
|
||||||
vsnprintf(buf, 512, fmt, list);
|
vsnprintf(buf, 512, fmt, list);
|
||||||
|
@ -242,7 +243,7 @@ static int MT32_Report(void *userData, MT32Emu::ReportType type, const void *rep
|
||||||
error("Failed to load MT32_PCM.ROM");
|
error("Failed to load MT32_PCM.ROM");
|
||||||
break;
|
break;
|
||||||
case MT32Emu::ReportType_progressInit:
|
case MT32Emu::ReportType_progressInit:
|
||||||
if (((MidiDriver_MT32 *)userData)->_initialising) {
|
if (((MidiDriver_MT32 *)userData)->_initializing) {
|
||||||
drawProgress(*((const float *)reportData));
|
drawProgress(*((const float *)reportData));
|
||||||
return eatSystemEvents();
|
return eatSystemEvents();
|
||||||
}
|
}
|
||||||
|
@ -286,7 +287,7 @@ MidiDriver_MT32::MidiDriver_MT32(Audio::Mixer *mixer) : MidiDriver_Emulated(mixe
|
||||||
// at rates other than 32KHz, thus we produce data at 32KHz and
|
// at rates other than 32KHz, thus we produce data at 32KHz and
|
||||||
// rely on Mixer to convert.
|
// rely on Mixer to convert.
|
||||||
_outputRate = 32000; //_mixer->getOutputRate();
|
_outputRate = 32000; //_mixer->getOutputRate();
|
||||||
_initialising = false;
|
_initializing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
MidiDriver_MT32::~MidiDriver_MT32() {
|
MidiDriver_MT32::~MidiDriver_MT32() {
|
||||||
|
@ -329,11 +330,11 @@ int MidiDriver_MT32::open() {
|
||||||
//g_system->setPalette(dummy_palette, 0, 3);
|
//g_system->setPalette(dummy_palette, 0, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
_initialising = true;
|
_initializing = true;
|
||||||
drawMessage(-1, _s("Initialising MT-32 Emulator"));
|
drawMessage(-1, _s("Initializing MT-32 Emulator"));
|
||||||
if (!_synth->open(prop))
|
if (!_synth->open(prop))
|
||||||
return MERR_DEVICE_NOT_AVAILABLE;
|
return MERR_DEVICE_NOT_AVAILABLE;
|
||||||
_initialising = false;
|
_initializing = false;
|
||||||
|
|
||||||
// TODO implement in Residual
|
// TODO implement in Residual
|
||||||
/* if (screenFormat.bytesPerPixel > 1)
|
/* if (screenFormat.bytesPerPixel > 1)
|
||||||
|
@ -553,6 +554,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
MusicDevices getDevices() const;
|
MusicDevices getDevices() const;
|
||||||
|
bool checkDevice(MidiDriver::DeviceHandle) const;
|
||||||
Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
|
Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -562,6 +564,16 @@ MusicDevices MT32EmuMusicPlugin::getDevices() const {
|
||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MT32EmuMusicPlugin::checkDevice(MidiDriver::DeviceHandle) const {
|
||||||
|
if (!((Common::File::exists("MT32_CONTROL.ROM") && Common::File::exists("MT32_PCM.ROM")) ||
|
||||||
|
(Common::File::exists("CM32L_CONTROL.ROM") && Common::File::exists("CM32L_PCM.ROM")))) {
|
||||||
|
warning("The MT-32 emulator requires one of the two following file sets (not bundled with ScummVM):\n Either 'MT32_CONTROL.ROM' and 'MT32_PCM.ROM' or 'CM32L_CONTROL.ROM' and 'CM32L_PCM.ROM'");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
Common::Error MT32EmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
|
Common::Error MT32EmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
|
||||||
if (ConfMan.hasKey("extrapath"))
|
if (ConfMan.hasKey("extrapath"))
|
||||||
SearchMan.addDirectory("extrapath", ConfMan.get("extrapath"));
|
SearchMan.addDirectory("extrapath", ConfMan.get("extrapath"));
|
||||||
|
|
|
@ -164,7 +164,7 @@ void Partial::startPartial(dpoly *usePoly, const PatchCache *useCache, Partial *
|
||||||
structurePosition = patchCache->structurePosition;
|
structurePosition = patchCache->structurePosition;
|
||||||
|
|
||||||
play = true;
|
play = true;
|
||||||
initKeyFollow(poly->freqnum); // Initialises noteVal, filtVal and realVal
|
initKeyFollow(poly->freqnum); // Initializes noteVal, filtVal and realVal
|
||||||
#if MT32EMU_ACCURATENOTES == 0
|
#if MT32EMU_ACCURATENOTES == 0
|
||||||
noteLookup = &synth->tables.noteLookups[noteVal - LOWEST_NOTE];
|
noteLookup = &synth->tables.noteLookups[noteVal - LOWEST_NOTE];
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -426,36 +426,36 @@ bool Synth::open(SynthProperties &useProp) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printDebug("Initialising Timbre Bank A");
|
printDebug("Initializing Timbre Bank A");
|
||||||
if (!initTimbres(controlROMMap->timbreAMap, controlROMMap->timbreAOffset, 0)) {
|
if (!initTimbres(controlROMMap->timbreAMap, controlROMMap->timbreAOffset, 0)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
printDebug("Initialising Timbre Bank B");
|
printDebug("Initializing Timbre Bank B");
|
||||||
if (!initTimbres(controlROMMap->timbreBMap, controlROMMap->timbreBOffset, 64)) {
|
if (!initTimbres(controlROMMap->timbreBMap, controlROMMap->timbreBOffset, 64)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
printDebug("Initialising Timbre Bank R");
|
printDebug("Initializing Timbre Bank R");
|
||||||
if (!initRhythmTimbres(controlROMMap->timbreRMap, controlROMMap->timbreRCount)) {
|
if (!initRhythmTimbres(controlROMMap->timbreRMap, controlROMMap->timbreRCount)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
printDebug("Initialising Timbre Bank M");
|
printDebug("Initializing Timbre Bank M");
|
||||||
// CM-64 seems to initialise all bytes in this bank to 0.
|
// CM-64 seems to initialize all bytes in this bank to 0.
|
||||||
memset(&mt32ram.timbres[128], 0, sizeof (mt32ram.timbres[128]) * 64);
|
memset(&mt32ram.timbres[128], 0, sizeof (mt32ram.timbres[128]) * 64);
|
||||||
|
|
||||||
partialManager = new PartialManager(this);
|
partialManager = new PartialManager(this);
|
||||||
|
|
||||||
pcmWaves = new PCMWaveEntry[controlROMMap->pcmCount];
|
pcmWaves = new PCMWaveEntry[controlROMMap->pcmCount];
|
||||||
|
|
||||||
printDebug("Initialising PCM List");
|
printDebug("Initializing PCM List");
|
||||||
initPCMList(controlROMMap->pcmTable, controlROMMap->pcmCount);
|
initPCMList(controlROMMap->pcmTable, controlROMMap->pcmCount);
|
||||||
|
|
||||||
printDebug("Initialising Rhythm Temp");
|
printDebug("Initializing Rhythm Temp");
|
||||||
memcpy(mt32ram.rhythmSettings, &controlROMData[controlROMMap->rhythmSettings], controlROMMap->rhythmSettingsCount * 4);
|
memcpy(mt32ram.rhythmSettings, &controlROMData[controlROMMap->rhythmSettings], controlROMMap->rhythmSettingsCount * 4);
|
||||||
|
|
||||||
printDebug("Initialising Patches");
|
printDebug("Initializing Patches");
|
||||||
for (Bit8u i = 0; i < 128; i++) {
|
for (Bit8u i = 0; i < 128; i++) {
|
||||||
PatchParam *patch = &mt32ram.patches[i];
|
PatchParam *patch = &mt32ram.patches[i];
|
||||||
patch->timbreGroup = i / 64;
|
patch->timbreGroup = i / 64;
|
||||||
|
@ -468,9 +468,9 @@ bool Synth::open(SynthProperties &useProp) {
|
||||||
patch->dummy = 0;
|
patch->dummy = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
printDebug("Initialising System");
|
printDebug("Initializing System");
|
||||||
// The MT-32 manual claims that "Standard pitch" is 442Hz.
|
// The MT-32 manual claims that "Standard pitch" is 442Hz.
|
||||||
mt32ram.system.masterTune = 0x40; // Confirmed on CM-64 as 0x4A, but SCUMM games use 0x40 and we don't want to initialise twice
|
mt32ram.system.masterTune = 0x40; // Confirmed on CM-64 as 0x4A, but SCUMM games use 0x40 and we don't want to initialize twice
|
||||||
mt32ram.system.reverbMode = 0; // Confirmed
|
mt32ram.system.reverbMode = 0; // Confirmed
|
||||||
mt32ram.system.reverbTime = 5; // Confirmed
|
mt32ram.system.reverbTime = 5; // Confirmed
|
||||||
mt32ram.system.reverbLevel = 3; // Confirmed
|
mt32ram.system.reverbLevel = 3; // Confirmed
|
||||||
|
@ -792,7 +792,7 @@ void Synth::writeSysex(unsigned char device, const Bit8u *sysex, Bit32u len) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// Find the appropriate memory region
|
// Find the appropriate memory region
|
||||||
int regionNum;
|
int regionNum;
|
||||||
const MemoryRegion *region = NULL; // Initialised to please compiler
|
const MemoryRegion *region = NULL; // Initialized to please compiler
|
||||||
for (regionNum = 0; regionNum < NUM_REGIONS; regionNum++) {
|
for (regionNum = 0; regionNum < NUM_REGIONS; regionNum++) {
|
||||||
region = &memoryRegions[regionNum];
|
region = &memoryRegions[regionNum];
|
||||||
if (region->contains(addr)) {
|
if (region->contains(addr)) {
|
||||||
|
|
|
@ -263,7 +263,7 @@ public:
|
||||||
Synth();
|
Synth();
|
||||||
~Synth();
|
~Synth();
|
||||||
|
|
||||||
// Used to initialise the MT-32. Must be called before any other function.
|
// Used to initialize the MT-32. Must be called before any other function.
|
||||||
// Returns true if initialization was sucessful, otherwise returns false.
|
// Returns true if initialization was sucessful, otherwise returns false.
|
||||||
bool open(SynthProperties &useProp);
|
bool open(SynthProperties &useProp);
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ void Tables::initEnvelopes(float samplerate) {
|
||||||
|
|
||||||
void Tables::initMT32ConstantTables(Synth *synth) {
|
void Tables::initMT32ConstantTables(Synth *synth) {
|
||||||
int lf;
|
int lf;
|
||||||
synth->printDebug("Initialising Pitch Tables");
|
synth->printDebug("Initializing Pitch Tables");
|
||||||
for (lf = -108; lf <= 108; lf++) {
|
for (lf = -108; lf <= 108; lf++) {
|
||||||
tvfKeyfollowMult[lf + 108] = (int)(256 * powf(2.0f, (float)(lf / 24.0f)));
|
tvfKeyfollowMult[lf + 108] = (int)(256 * powf(2.0f, (float)(lf / 24.0f)));
|
||||||
//synth->printDebug("KT %d = %d", f, keytable[f+108]);
|
//synth->printDebug("KT %d = %d", f, keytable[f+108]);
|
||||||
|
@ -668,7 +668,7 @@ bool Tables::initNotes(Synth *synth, PCMWaveEntry *pcmWaves, float rate, float m
|
||||||
bool abort = false;
|
bool abort = false;
|
||||||
synth->report(ReportType_progressInit, &progress);
|
synth->report(ReportType_progressInit, &progress);
|
||||||
for (int f = LOWEST_NOTE; f <= HIGHEST_NOTE; f++) {
|
for (int f = LOWEST_NOTE; f <= HIGHEST_NOTE; f++) {
|
||||||
synth->printDebug("Initialising note %s%d", NoteNames[f % 12], (f / 12) - 2);
|
synth->printDebug("Initializing note %s%d", NoteNames[f % 12], (f / 12) - 2);
|
||||||
NoteLookup *noteLookup = ¬eLookups[f - LOWEST_NOTE];
|
NoteLookup *noteLookup = ¬eLookups[f - LOWEST_NOTE];
|
||||||
file = initNote(synth, noteLookup, (float)f, rate, masterTune, pcmWaves, file);
|
file = initNote(synth, noteLookup, (float)f, rate, masterTune, pcmWaves, file);
|
||||||
progress = (f - LOWEST_NOTE + 1) / (float)NUM_NOTES;
|
progress = (f - LOWEST_NOTE + 1) / (float)NUM_NOTES;
|
||||||
|
@ -723,12 +723,12 @@ void Tables::freeNotes() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
initialisedMasterTune = 0.0f;
|
initializedMasterTune = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
Tables::Tables() {
|
Tables::Tables() {
|
||||||
initialisedSampleRate = 0.0f;
|
initializedSampleRate = 0.0f;
|
||||||
initialisedMasterTune = 0.0f;
|
initializedMasterTune = 0.0f;
|
||||||
memset(¬eLookups, 0, sizeof(noteLookups));
|
memset(¬eLookups, 0, sizeof(noteLookups));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -737,23 +737,23 @@ bool Tables::init(Synth *synth, PCMWaveEntry *pcmWaves, float sampleRate, float
|
||||||
synth->printDebug("Bad sampleRate (%f <= 0.0f)", (double)sampleRate);
|
synth->printDebug("Bad sampleRate (%f <= 0.0f)", (double)sampleRate);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (initialisedSampleRate == 0.0f) {
|
if (initializedSampleRate == 0.0f) {
|
||||||
initMT32ConstantTables(synth);
|
initMT32ConstantTables(synth);
|
||||||
}
|
}
|
||||||
if (initialisedSampleRate != sampleRate) {
|
if (initializedSampleRate != sampleRate) {
|
||||||
initFiltCoeff(sampleRate);
|
initFiltCoeff(sampleRate);
|
||||||
initEnvelopes(sampleRate);
|
initEnvelopes(sampleRate);
|
||||||
for (int key = 12; key <= 108; key++) {
|
for (int key = 12; key <= 108; key++) {
|
||||||
initDep(&keyLookups[key - 12], (float)key);
|
initDep(&keyLookups[key - 12], (float)key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (initialisedSampleRate != sampleRate || initialisedMasterTune != masterTune) {
|
if (initializedSampleRate != sampleRate || initializedMasterTune != masterTune) {
|
||||||
freeNotes();
|
freeNotes();
|
||||||
if (!initNotes(synth, pcmWaves, sampleRate, masterTune)) {
|
if (!initNotes(synth, pcmWaves, sampleRate, masterTune)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
initialisedSampleRate = sampleRate;
|
initializedSampleRate = sampleRate;
|
||||||
initialisedMasterTune = masterTune;
|
initializedMasterTune = masterTune;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,8 +69,8 @@ struct KeyLookup {
|
||||||
};
|
};
|
||||||
|
|
||||||
class Tables {
|
class Tables {
|
||||||
float initialisedSampleRate;
|
float initializedSampleRate;
|
||||||
float initialisedMasterTune;
|
float initializedMasterTune;
|
||||||
void initMT32ConstantTables(Synth *synth);
|
void initMT32ConstantTables(Synth *synth);
|
||||||
static Bit16s clampWF(Synth *synth, const char *n, float ampVal, double input);
|
static Bit16s clampWF(Synth *synth, const char *n, float ampVal, double input);
|
||||||
static File *initWave(Synth *synth, NoteLookup *noteLookup, float ampsize, float div2, File *file);
|
static File *initWave(Synth *synth, NoteLookup *noteLookup, float ampsize, float div2, File *file);
|
||||||
|
|
|
@ -546,7 +546,7 @@ inline void OPL_CALC_RH(FM_OPL *OPL, OPL_CH *CH) {
|
||||||
// but EG_STEP = 96.0/EG_ENT, and WHITE_NOISE_db=6.0. So, that's equivalent to
|
// but EG_STEP = 96.0/EG_ENT, and WHITE_NOISE_db=6.0. So, that's equivalent to
|
||||||
// int(OPL->rnd.getRandomBit() * EG_ENT/16). We know that EG_ENT is 4096, or 1024,
|
// int(OPL->rnd.getRandomBit() * EG_ENT/16). We know that EG_ENT is 4096, or 1024,
|
||||||
// or 128, so we can safely avoid any FP ops.
|
// or 128, so we can safely avoid any FP ops.
|
||||||
int whitenoise = OPL->rnd.getRandomBit() * (EG_ENT>>4);
|
int whitenoise = OPL->rnd->getRandomBit() * (EG_ENT>>4);
|
||||||
|
|
||||||
int tone8;
|
int tone8;
|
||||||
|
|
||||||
|
@ -754,8 +754,10 @@ static int OPLOpenTable(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OPLCloseTable(void) {
|
static void OPLCloseTable(void) {
|
||||||
|
#ifndef __DS__
|
||||||
free(TL_TABLE);
|
free(TL_TABLE);
|
||||||
free(SIN_TABLE);
|
free(SIN_TABLE);
|
||||||
|
#endif
|
||||||
free(AMS_TABLE);
|
free(AMS_TABLE);
|
||||||
free(VIB_TABLE);
|
free(VIB_TABLE);
|
||||||
free(ENV_CURVE);
|
free(ENV_CURVE);
|
||||||
|
@ -1126,6 +1128,15 @@ FM_OPL *OPLCreate(int type, int clock, int rate) {
|
||||||
OPL->rate = rate;
|
OPL->rate = rate;
|
||||||
OPL->max_ch = max_ch;
|
OPL->max_ch = max_ch;
|
||||||
|
|
||||||
|
// Init the random source. Note: We use a fixed name for it here.
|
||||||
|
// So if multiple FM_OPL objects exist in parallel, then their
|
||||||
|
// random sources will have an equal name. At least in the
|
||||||
|
// current EventRecorder implementation, this causes no problems;
|
||||||
|
// but this is probably not guaranteed.
|
||||||
|
// Alas, it does not seem worthwhile to bother much with this
|
||||||
|
// at the time, so I am leaving it as it is.
|
||||||
|
OPL->rnd = new Common::RandomSource("mame");
|
||||||
|
|
||||||
/* init grobal tables */
|
/* init grobal tables */
|
||||||
OPL_initalize(OPL);
|
OPL_initalize(OPL);
|
||||||
|
|
||||||
|
@ -1134,9 +1145,10 @@ FM_OPL *OPLCreate(int type, int clock, int rate) {
|
||||||
return OPL;
|
return OPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- Destroy one of vietual YM3812 ---------- */
|
/* ---------- Destroy one of virtual YM3812 ---------- */
|
||||||
void OPLDestroy(FM_OPL *OPL) {
|
void OPLDestroy(FM_OPL *OPL) {
|
||||||
OPL_UnLockTable();
|
OPL_UnLockTable();
|
||||||
|
delete OPL->rnd;
|
||||||
free(OPL);
|
free(OPL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ typedef struct fm_opl_f {
|
||||||
OPL_UPDATEHANDLER UpdateHandler; /* stream update handler */
|
OPL_UPDATEHANDLER UpdateHandler; /* stream update handler */
|
||||||
int UpdateParam; /* stream update parameter */
|
int UpdateParam; /* stream update parameter */
|
||||||
|
|
||||||
Common::RandomSource rnd;
|
Common::RandomSource *rnd;
|
||||||
} FM_OPL;
|
} FM_OPL;
|
||||||
|
|
||||||
/* ---------- Generic interface section ---------- */
|
/* ---------- Generic interface section ---------- */
|
||||||
|
|
|
@ -108,7 +108,7 @@ public:
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise the specified CD drive for audio playback.
|
* Initialize the specified CD drive for audio playback.
|
||||||
* @param drive the drive id
|
* @param drive the drive id
|
||||||
* @return true if the CD drive was inited succesfully
|
* @return true if the CD drive was inited succesfully
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -63,7 +63,7 @@ SdlEventSource::SdlEventSource()
|
||||||
|
|
||||||
// Enable joystick
|
// Enable joystick
|
||||||
if (SDL_NumJoysticks() > 0) {
|
if (SDL_NumJoysticks() > 0) {
|
||||||
printf("Using joystick: %s\n", SDL_JoystickName(0));
|
debug("Using joystick: %s", SDL_JoystickName(0));
|
||||||
_joystick = SDL_JoystickOpen(joystick_num);
|
_joystick = SDL_JoystickOpen(joystick_num);
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
@ -281,7 +281,7 @@ bool SdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) {
|
||||||
event.type = Common::EVENT_QUIT;
|
event.type = Common::EVENT_QUIT;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#elif defined(UNIX)
|
#elif defined(POSIX)
|
||||||
// On other *nix systems, Control-Q quits
|
// On other *nix systems, Control-Q quits
|
||||||
if ((ev.key.keysym.mod & KMOD_CTRL) && ev.key.keysym.sym == 'q') {
|
if ((ev.key.keysym.mod & KMOD_CTRL) && ev.key.keysym.sym == 'q') {
|
||||||
event.type = Common::EVENT_QUIT;
|
event.type = Common::EVENT_QUIT;
|
||||||
|
@ -325,7 +325,7 @@ bool SdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) {
|
||||||
if (ev.key.keysym.sym == 'm' || // Ctrl-m toggles mouse capture
|
if (ev.key.keysym.sym == 'm' || // Ctrl-m toggles mouse capture
|
||||||
#if defined(MACOSX)
|
#if defined(MACOSX)
|
||||||
// Meta - Q, handled below
|
// Meta - Q, handled below
|
||||||
#elif defined(UNIX)
|
#elif defined(POSIX)
|
||||||
ev.key.keysym.sym == 'q' || // On other *nix systems, Control-Q quits
|
ev.key.keysym.sym == 'q' || // On other *nix systems, Control-Q quits
|
||||||
#else
|
#else
|
||||||
ev.key.keysym.sym == 'z' || // Ctrl-z quit
|
ev.key.keysym.sym == 'z' || // Ctrl-z quit
|
||||||
|
@ -338,7 +338,7 @@ bool SdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) {
|
||||||
#if defined(MACOSX)
|
#if defined(MACOSX)
|
||||||
if ((mod & KMOD_META) && ev.key.keysym.sym == 'q')
|
if ((mod & KMOD_META) && ev.key.keysym.sym == 'q')
|
||||||
return false; // On Macintosh, Cmd-Q quits
|
return false; // On Macintosh, Cmd-Q quits
|
||||||
#elif defined(UNIX)
|
#elif defined(POSIX)
|
||||||
// Control Q has already been handled above
|
// Control Q has already been handled above
|
||||||
#else
|
#else
|
||||||
if ((mod & KMOD_ALT) && ev.key.keysym.sym == 'x')
|
if ((mod & KMOD_ALT) && ev.key.keysym.sym == 'x')
|
||||||
|
|
|
@ -19,13 +19,14 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(UNIX)
|
#if defined(POSIX)
|
||||||
|
|
||||||
// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h.
|
// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h.
|
||||||
// Also with clock() in sys/time.h in some Mac OS X SDKs.
|
// Also with clock() in sys/time.h in some Mac OS X SDKs.
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
|
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
|
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit //Needed for IRIX's unistd.h
|
||||||
|
|
||||||
#include "backends/fs/posix/posix-fs-factory.h"
|
#include "backends/fs/posix/posix-fs-factory.h"
|
||||||
#include "backends/fs/posix/posix-fs.h"
|
#include "backends/fs/posix/posix-fs.h"
|
||||||
|
|
|
@ -19,13 +19,15 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(UNIX)
|
#if defined(POSIX)
|
||||||
|
|
||||||
// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h.
|
// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h.
|
||||||
// Also with clock() in sys/time.h in some Mac OS X SDKs.
|
// Also with clock() in sys/time.h in some Mac OS X SDKs.
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
|
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
|
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_getenv
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit //Needed for IRIX's unistd.h
|
||||||
|
|
||||||
#include "backends/fs/posix/posix-fs.h"
|
#include "backends/fs/posix/posix-fs.h"
|
||||||
#include "backends/fs/stdiostream.h"
|
#include "backends/fs/stdiostream.h"
|
||||||
|
@ -248,4 +250,4 @@ Common::WriteStream *POSIXFilesystemNode::createWriteStream() {
|
||||||
return StdioStream::makeFromPath(getPath(), true);
|
return StdioStream::makeFromPath(getPath(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //#if defined(UNIX)
|
#endif //#if defined(POSIX)
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
|
#undef ARRAYSIZE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of the ScummVM file system API based on Windows API.
|
* Implementation of the ScummVM file system API based on Windows API.
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
#include <SDL_opengl.h>
|
#include <SDL_opengl.h>
|
||||||
#endif
|
#endif
|
||||||
|
#undef ARRAYSIZE
|
||||||
|
|
||||||
#include "backends/graphics/graphics.h"
|
#include "backends/graphics/graphics.h"
|
||||||
#include "graphics/pixelformat.h"
|
#include "graphics/pixelformat.h"
|
||||||
|
|
|
@ -164,7 +164,7 @@ int MidiDriver_ALSA::open() {
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Connected to Alsa sequencer client [%d:%d]\n", seq_client, seq_port);
|
printf("Connected to Alsa sequencer client [%d:%d]\n", seq_client, seq_port);
|
||||||
printf("ALSA client initialised [%d:0]\n", my_client);
|
printf("ALSA client initialized [%d:0]\n", my_client);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,7 @@ MusicDevices AlsaMusicPlugin::getDevices() const {
|
||||||
|
|
||||||
AlsaDevices alsaDevices = getAlsaDevices();
|
AlsaDevices alsaDevices = getAlsaDevices();
|
||||||
|
|
||||||
// Since the default behaviour is to use the first device in the list,
|
// Since the default behavior is to use the first device in the list,
|
||||||
// try to put something sensible there. We used to have 17:0 and 65:0
|
// try to put something sensible there. We used to have 17:0 and 65:0
|
||||||
// as defaults.
|
// as defaults.
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
#if defined(SDL_BACKEND)
|
#if defined(SDL_BACKEND)
|
||||||
|
|
||||||
#include "backends/mixer/sdl/sdl-mixer.h"
|
#include "backends/mixer/sdl/sdl-mixer.h"
|
||||||
|
|
|
@ -20,46 +20,29 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
|
||||||
|
|
||||||
#include "backends/modular-backend.h"
|
#include "backends/modular-backend.h"
|
||||||
|
|
||||||
#include "backends/fs/fs-factory.h"
|
|
||||||
#include "backends/audiocd/audiocd.h"
|
|
||||||
#include "backends/graphics/graphics.h"
|
#include "backends/graphics/graphics.h"
|
||||||
#include "backends/mutex/mutex.h"
|
#include "backends/mutex/mutex.h"
|
||||||
|
|
||||||
#include "audio/mixer.h"
|
#include "audio/mixer.h"
|
||||||
#include "common/events.h"
|
|
||||||
#include "gui/message.h"
|
|
||||||
#include "graphics/pixelformat.h"
|
#include "graphics/pixelformat.h"
|
||||||
|
|
||||||
ModularBackend::ModularBackend()
|
ModularBackend::ModularBackend()
|
||||||
:
|
:
|
||||||
_fsFactory(0),
|
|
||||||
_eventManager(0),
|
|
||||||
_savefileManager(0),
|
|
||||||
_timerManager(0),
|
|
||||||
_mutexManager(0),
|
_mutexManager(0),
|
||||||
_graphicsManager(0),
|
_graphicsManager(0),
|
||||||
_mixer(0),
|
_mixer(0) {
|
||||||
_audiocdManager(0) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ModularBackend::~ModularBackend() {
|
ModularBackend::~ModularBackend() {
|
||||||
delete _fsFactory;
|
|
||||||
_fsFactory = 0;
|
|
||||||
delete _graphicsManager;
|
delete _graphicsManager;
|
||||||
_graphicsManager = 0;
|
_graphicsManager = 0;
|
||||||
delete _eventManager;
|
|
||||||
_eventManager = 0;
|
|
||||||
delete _mixer;
|
delete _mixer;
|
||||||
_mixer = 0;
|
_mixer = 0;
|
||||||
delete _audiocdManager;
|
|
||||||
_audiocdManager = 0;
|
|
||||||
delete _savefileManager;
|
|
||||||
_savefileManager = 0;
|
|
||||||
delete _timerManager;
|
|
||||||
_timerManager = 0;
|
|
||||||
delete _mutexManager;
|
delete _mutexManager;
|
||||||
_mutexManager = 0;
|
_mutexManager = 0;
|
||||||
}
|
}
|
||||||
|
@ -145,16 +128,6 @@ void ModularBackend::setMouseCursor(const byte *buf, uint w, uint h, int hotspot
|
||||||
_graphicsManager->setMouseCursor(buf, w, h, hotspotX, hotspotY, keycolor, cursorTargetScale, format);
|
_graphicsManager->setMouseCursor(buf, w, h, hotspotX, hotspotY, keycolor, cursorTargetScale, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::TimerManager *ModularBackend::getTimerManager() {
|
|
||||||
assert(_timerManager);
|
|
||||||
return _timerManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
Common::EventManager *ModularBackend::getEventManager() {
|
|
||||||
assert(_eventManager);
|
|
||||||
return _eventManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
OSystem::MutexRef ModularBackend::createMutex() {
|
OSystem::MutexRef ModularBackend::createMutex() {
|
||||||
assert(_mutexManager);
|
assert(_mutexManager);
|
||||||
return _mutexManager->createMutex();
|
return _mutexManager->createMutex();
|
||||||
|
@ -180,21 +153,10 @@ Audio::Mixer *ModularBackend::getMixer() {
|
||||||
return (Audio::Mixer *)_mixer;
|
return (Audio::Mixer *)_mixer;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioCDManager *ModularBackend::getAudioCDManager() {
|
|
||||||
assert(_audiocdManager);
|
|
||||||
return _audiocdManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ModularBackend::displayMessageOnOSD(const char *msg) {
|
void ModularBackend::displayMessageOnOSD(const char *msg) {
|
||||||
_graphicsManager->displayMessageOnOSD(msg);
|
_graphicsManager->displayMessageOnOSD(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::SaveFileManager *ModularBackend::getSavefileManager() {
|
void ModularBackend::quit() {
|
||||||
assert(_savefileManager);
|
exit(0);
|
||||||
return _savefileManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
FilesystemFactory *ModularBackend::getFilesystemFactory() {
|
|
||||||
assert(_fsFactory);
|
|
||||||
return _fsFactory;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
#define BACKENDS_MODULAR_BACKEND_H
|
#define BACKENDS_MODULAR_BACKEND_H
|
||||||
|
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
#include "common/timer.h"
|
|
||||||
#include "common/savefile.h"
|
|
||||||
|
|
||||||
class GraphicsManager;
|
class GraphicsManager;
|
||||||
class MutexManager;
|
class MutexManager;
|
||||||
|
@ -39,8 +37,6 @@ class MutexManager;
|
||||||
* A backend derivated from this class, will need to implement
|
* A backend derivated from this class, will need to implement
|
||||||
* these functions on its own:
|
* these functions on its own:
|
||||||
* OSystem::pollEvent()
|
* OSystem::pollEvent()
|
||||||
* OSystem::createConfigReadStream()
|
|
||||||
* OSystem::createConfigWriteStream()
|
|
||||||
* OSystem::getMillis()
|
* OSystem::getMillis()
|
||||||
* OSystem::delayMillis()
|
* OSystem::delayMillis()
|
||||||
* OSystem::getTimeAndDate()
|
* OSystem::getTimeAndDate()
|
||||||
|
@ -91,8 +87,6 @@ public:
|
||||||
/** @name Events and Time */
|
/** @name Events and Time */
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
virtual Common::TimerManager *getTimerManager();
|
|
||||||
virtual Common::EventManager *getEventManager();
|
|
||||||
virtual Common::HardwareKeySet *getHardwareKeySet() { return 0; }
|
virtual Common::HardwareKeySet *getHardwareKeySet() { return 0; }
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
@ -114,20 +108,10 @@ public:
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/** @name Audio CD */
|
|
||||||
//@{
|
|
||||||
|
|
||||||
virtual AudioCDManager *getAudioCDManager();
|
|
||||||
|
|
||||||
//@}
|
|
||||||
|
|
||||||
/** @name Miscellaneous */
|
/** @name Miscellaneous */
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
virtual Common::SaveFileManager *getSavefileManager();
|
virtual void quit();
|
||||||
virtual FilesystemFactory *getFilesystemFactory();
|
|
||||||
virtual void quit() { exit(0); }
|
|
||||||
virtual void setWindowCaption(const char *caption) {}
|
|
||||||
virtual void displayMessageOnOSD(const char *msg);
|
virtual void displayMessageOnOSD(const char *msg);
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
@ -136,14 +120,9 @@ protected:
|
||||||
/** @name Managers variables */
|
/** @name Managers variables */
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
FilesystemFactory *_fsFactory;
|
|
||||||
Common::EventManager *_eventManager;
|
|
||||||
Common::SaveFileManager *_savefileManager;
|
|
||||||
Common::TimerManager *_timerManager;
|
|
||||||
MutexManager *_mutexManager;
|
MutexManager *_mutexManager;
|
||||||
GraphicsManager *_graphicsManager;
|
GraphicsManager *_graphicsManager;
|
||||||
Audio::Mixer *_mixer;
|
Audio::Mixer *_mixer;
|
||||||
AudioCDManager *_audiocdManager;
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,10 +6,6 @@ MODULE_OBJS := \
|
||||||
events/default/default-events.o \
|
events/default/default-events.o \
|
||||||
fs/abstract-fs.o \
|
fs/abstract-fs.o \
|
||||||
fs/stdiostream.o \
|
fs/stdiostream.o \
|
||||||
keymapper/action.o \
|
|
||||||
keymapper/keymap.o \
|
|
||||||
keymapper/keymapper.o \
|
|
||||||
keymapper/remap-dialog.o \
|
|
||||||
log/log.o \
|
log/log.o \
|
||||||
midi/alsa.o \
|
midi/alsa.o \
|
||||||
midi/dmedia.o \
|
midi/dmedia.o \
|
||||||
|
@ -18,20 +14,42 @@ MODULE_OBJS := \
|
||||||
midi/timidity.o \
|
midi/timidity.o \
|
||||||
saves/savefile.o \
|
saves/savefile.o \
|
||||||
saves/default/default-saves.o \
|
saves/default/default-saves.o \
|
||||||
timer/default/default-timer.o \
|
timer/default/default-timer.o
|
||||||
|
|
||||||
|
|
||||||
|
ifdef USE_ELF_LOADER
|
||||||
|
MODULE_OBJS += \
|
||||||
|
plugins/elf/arm-loader.o \
|
||||||
|
plugins/elf/elf-loader.o \
|
||||||
|
plugins/elf/elf-provider.o \
|
||||||
|
plugins/elf/memory-manager.o \
|
||||||
|
plugins/elf/mips-loader.o \
|
||||||
|
plugins/elf/ppc-loader.o \
|
||||||
|
plugins/elf/shorts-segment-manager.o \
|
||||||
|
plugins/elf/version.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef ENABLE_KEYMAPPER
|
||||||
|
MODULE_OBJS += \
|
||||||
|
keymapper/action.o \
|
||||||
|
keymapper/keymap.o \
|
||||||
|
keymapper/keymapper.o \
|
||||||
|
keymapper/remap-dialog.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef ENABLE_VKEYBD
|
||||||
|
MODULE_OBJS += \
|
||||||
vkeybd/image-map.o \
|
vkeybd/image-map.o \
|
||||||
vkeybd/polygon.o \
|
vkeybd/polygon.o \
|
||||||
vkeybd/virtual-keyboard.o \
|
vkeybd/virtual-keyboard.o \
|
||||||
vkeybd/virtual-keyboard-gui.o \
|
vkeybd/virtual-keyboard-gui.o \
|
||||||
vkeybd/virtual-keyboard-parser.o
|
vkeybd/virtual-keyboard-parser.o
|
||||||
|
endif
|
||||||
|
|
||||||
# SDL specific source files.
|
# SDL specific source files.
|
||||||
# We cannot just check $BACKEND = sdl, as various other backends
|
# We cannot just check $BACKEND = sdl, as various other backends
|
||||||
# derive from the SDL backend, and they all need the following files.
|
# derive from the SDL backend, and they all need the following files.
|
||||||
# TODO: Add SDL_BACKEND to config.mk; this would match the fact that
|
ifdef SDL_BACKEND
|
||||||
# we also add -DSDL_BACKEND to the DEFINES.
|
|
||||||
# However, the latter is only done for *most* SDL based stuff, not always
|
|
||||||
# so we really should unify the relevant code in configure.
|
|
||||||
MODULE_OBJS += \
|
MODULE_OBJS += \
|
||||||
audiocd/sdl/sdl-audiocd.o \
|
audiocd/sdl/sdl-audiocd.o \
|
||||||
events/sdl/sdl-events.o \
|
events/sdl/sdl-events.o \
|
||||||
|
@ -41,8 +59,9 @@ MODULE_OBJS += \
|
||||||
mutex/sdl/sdl-mutex.o \
|
mutex/sdl/sdl-mutex.o \
|
||||||
plugins/sdl/sdl-provider.o \
|
plugins/sdl/sdl-provider.o \
|
||||||
timer/sdl/sdl-timer.o
|
timer/sdl/sdl-timer.o
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef UNIX
|
ifdef POSIX
|
||||||
MODULE_OBJS += \
|
MODULE_OBJS += \
|
||||||
fs/posix/posix-fs.o \
|
fs/posix/posix-fs.o \
|
||||||
fs/posix/posix-fs-factory.o \
|
fs/posix/posix-fs-factory.o \
|
||||||
|
@ -134,9 +153,10 @@ MODULE_OBJS += \
|
||||||
timer/psp/timer.o
|
timer/psp/timer.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BACKEND),samsungstv)
|
ifeq ($(BACKEND),samsungtv)
|
||||||
MODULE_OBJS += \
|
MODULE_OBJS += \
|
||||||
events/samsungtvsdl/samsungtvsdl-events.o
|
events/samsungtvsdl/samsungtvsdl-events.o \
|
||||||
|
graphics/samsungtvsdl/samsungtvsdl-graphics.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BACKEND),webos)
|
ifeq ($(BACKEND),webos)
|
||||||
|
|
|
@ -33,7 +33,9 @@
|
||||||
#include "common/archive.h"
|
#include "common/archive.h"
|
||||||
#include "common/fs.h"
|
#include "common/fs.h"
|
||||||
|
|
||||||
#include "CoreFoundation/CoreFoundation.h"
|
#include "ApplicationServices/ApplicationServices.h" // for LSOpenFSRef
|
||||||
|
#include "CoreFoundation/CoreFoundation.h" // for CF* stuff
|
||||||
|
#include "CoreServices/CoreServices.h" // for FSPathMakeRef
|
||||||
|
|
||||||
OSystem_MacOSX::OSystem_MacOSX()
|
OSystem_MacOSX::OSystem_MacOSX()
|
||||||
:
|
:
|
||||||
|
@ -75,4 +77,27 @@ void OSystem_MacOSX::setupIcon() {
|
||||||
// Don't set icon on OS X, as we use a nicer external icon there.
|
// Don't set icon on OS X, as we use a nicer external icon there.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OSystem_MacOSX::hasFeature(Feature f) {
|
||||||
|
if (f == kFeatureDisplayLogFile)
|
||||||
|
return true;
|
||||||
|
return OSystem_POSIX::hasFeature(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OSystem_MacOSX::displayLogFile() {
|
||||||
|
// Use LaunchServices to open the log file, if possible.
|
||||||
|
|
||||||
|
if (_logFilePath.empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
FSRef ref;
|
||||||
|
OSStatus err;
|
||||||
|
|
||||||
|
err = FSPathMakeRef((const UInt8 *)_logFilePath.c_str(), &ref, NULL);
|
||||||
|
if (err == noErr) {
|
||||||
|
err = LSOpenFSRef(&ref, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return err != noErr;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -29,6 +29,10 @@ class OSystem_MacOSX : public OSystem_POSIX {
|
||||||
public:
|
public:
|
||||||
OSystem_MacOSX();
|
OSystem_MacOSX();
|
||||||
|
|
||||||
|
virtual bool hasFeature(Feature f);
|
||||||
|
|
||||||
|
virtual bool displayLogFile();
|
||||||
|
|
||||||
virtual void initBackend();
|
virtual void initBackend();
|
||||||
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
|
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
|
||||||
virtual void setupIcon();
|
virtual void setupIcon();
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
// Several SDL based ports use a custom main, and hence do not want to compile
|
// Several SDL based ports use a custom main, and hence do not want to compile
|
||||||
// of this file. The following "#if" ensures that.
|
// of this file. The following "#if" ensures that.
|
||||||
#if !defined(UNIX) && \
|
#if !defined(POSIX) && \
|
||||||
!defined(WIN32) && \
|
!defined(WIN32) && \
|
||||||
!defined(__MAEMO__) && \
|
!defined(__MAEMO__) && \
|
||||||
!defined(__SYMBIAN32__) && \
|
!defined(__SYMBIAN32__) && \
|
||||||
|
@ -33,6 +33,7 @@
|
||||||
!defined(DINGUX) && \
|
!defined(DINGUX) && \
|
||||||
!defined(CAANOO) && \
|
!defined(CAANOO) && \
|
||||||
!defined(LINUXMOTO) && \
|
!defined(LINUXMOTO) && \
|
||||||
|
!defined(SAMSUNGTV) && \
|
||||||
!defined(OPENPANDORA)
|
!defined(OPENPANDORA)
|
||||||
|
|
||||||
#include "backends/platform/sdl/sdl.h"
|
#include "backends/platform/sdl/sdl.h"
|
||||||
|
|
|
@ -5,7 +5,7 @@ MODULE_OBJS := \
|
||||||
main.o \
|
main.o \
|
||||||
sdl.o
|
sdl.o
|
||||||
|
|
||||||
ifdef UNIX
|
ifdef POSIX
|
||||||
MODULE_OBJS += \
|
MODULE_OBJS += \
|
||||||
posix/posix-main.o \
|
posix/posix-main.o \
|
||||||
posix/posix.o
|
posix/posix.o
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
#if defined(UNIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA)
|
#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA)
|
||||||
|
|
||||||
#include "backends/platform/sdl/posix/posix.h"
|
#include "backends/platform/sdl/posix/posix.h"
|
||||||
#include "backends/plugins/sdl/sdl-provider.h"
|
#include "backends/plugins/sdl/sdl-provider.h"
|
||||||
|
|
|
@ -20,12 +20,15 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_getenv
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h
|
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
#ifdef UNIX
|
#ifdef POSIX
|
||||||
|
|
||||||
#include "backends/platform/sdl/posix/posix.h"
|
#include "backends/platform/sdl/posix/posix.h"
|
||||||
#include "backends/saves/posix/posix-saves.h"
|
#include "backends/saves/posix/posix-saves.h"
|
||||||
|
@ -33,6 +36,8 @@
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
OSystem_POSIX::OSystem_POSIX(Common::String baseConfigName)
|
OSystem_POSIX::OSystem_POSIX(Common::String baseConfigName)
|
||||||
|
@ -57,10 +62,16 @@ void OSystem_POSIX::initBackend() {
|
||||||
OSystem_SDL::initBackend();
|
OSystem_SDL::initBackend();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OSystem_POSIX::hasFeature(Feature f) {
|
||||||
|
if (f == kFeatureDisplayLogFile)
|
||||||
|
return true;
|
||||||
|
return OSystem_SDL::hasFeature(f);
|
||||||
|
}
|
||||||
|
|
||||||
Common::String OSystem_POSIX::getDefaultConfigFileName() {
|
Common::String OSystem_POSIX::getDefaultConfigFileName() {
|
||||||
char configFile[MAXPATHLEN];
|
char configFile[MAXPATHLEN];
|
||||||
|
|
||||||
// On UNIX type systems, by default we store the config file inside
|
// On POSIX type systems, by default we store the config file inside
|
||||||
// to the HOME directory of the user.
|
// to the HOME directory of the user.
|
||||||
const char *home = getenv("HOME");
|
const char *home = getenv("HOME");
|
||||||
if (home != NULL && strlen(home) < MAXPATHLEN)
|
if (home != NULL && strlen(home) < MAXPATHLEN)
|
||||||
|
@ -72,6 +83,10 @@ Common::String OSystem_POSIX::getDefaultConfigFileName() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::WriteStream *OSystem_POSIX::createLogFile() {
|
Common::WriteStream *OSystem_POSIX::createLogFile() {
|
||||||
|
// Start out by resetting _logFilePath, so that in case
|
||||||
|
// of a failure, we know that no log file is open.
|
||||||
|
_logFilePath.clear();
|
||||||
|
|
||||||
const char *home = getenv("HOME");
|
const char *home = getenv("HOME");
|
||||||
if (home == NULL)
|
if (home == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -82,6 +97,9 @@ Common::WriteStream *OSystem_POSIX::createLogFile() {
|
||||||
#else
|
#else
|
||||||
logFile += "/.residual";
|
logFile += "/.residual";
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef SAMSUNGTV
|
||||||
|
logFile = "/mtd_ram";
|
||||||
|
#endif
|
||||||
|
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
|
@ -124,7 +142,62 @@ Common::WriteStream *OSystem_POSIX::createLogFile() {
|
||||||
logFile += "/residual.log";
|
logFile += "/residual.log";
|
||||||
|
|
||||||
Common::FSNode file(logFile);
|
Common::FSNode file(logFile);
|
||||||
return file.createWriteStream();
|
Common::WriteStream *stream = file.createWriteStream();
|
||||||
|
if (stream)
|
||||||
|
_logFilePath = logFile;
|
||||||
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OSystem_POSIX::displayLogFile() {
|
||||||
|
if (_logFilePath.empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// FIXME: This may not work perfectly when in fullscreen mode.
|
||||||
|
// On my system it drops from fullscreen without ScummVM noticing,
|
||||||
|
// so the next Alt-Enter does nothing, going from windowed to windowed.
|
||||||
|
// (wjp, 20110604)
|
||||||
|
|
||||||
|
pid_t pid = fork();
|
||||||
|
if (pid < 0) {
|
||||||
|
// failed to fork
|
||||||
|
return false;
|
||||||
|
} else if (pid == 0) {
|
||||||
|
|
||||||
|
// Try xdg-open first
|
||||||
|
execlp("xdg-open", "xdg-open", _logFilePath.c_str(), (char*)0);
|
||||||
|
|
||||||
|
// If we're here, that clearly failed.
|
||||||
|
|
||||||
|
// TODO: We may also want to try detecting the case where
|
||||||
|
// xdg-open is successfully executed but returns an error code.
|
||||||
|
|
||||||
|
// Try xterm+less next
|
||||||
|
|
||||||
|
execlp("xterm", "xterm", "-e", "less", _logFilePath.c_str(), (char*)0);
|
||||||
|
|
||||||
|
// TODO: If less does not exist we could fall back to 'more'.
|
||||||
|
// However, we'll have to use 'xterm -hold' for that to prevent the
|
||||||
|
// terminal from closing immediately (for short log files) or
|
||||||
|
// unexpectedly.
|
||||||
|
|
||||||
|
exit(127);
|
||||||
|
}
|
||||||
|
|
||||||
|
int status;
|
||||||
|
// Wait for viewer to close.
|
||||||
|
// (But note that xdg-open may have spawned a viewer in the background.)
|
||||||
|
|
||||||
|
// FIXME: We probably want the viewer to always open in the background.
|
||||||
|
// This may require installing a SIGCHLD handler.
|
||||||
|
pid = waitpid(pid, &status, 0);
|
||||||
|
|
||||||
|
if (pid < 0) {
|
||||||
|
// Probably nothing sensible to do in this error situation
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return WIFEXITED(status) && WEXITSTATUS(status) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -31,14 +31,31 @@ public:
|
||||||
OSystem_POSIX(Common::String baseConfigName = ".residualrc");
|
OSystem_POSIX(Common::String baseConfigName = ".residualrc");
|
||||||
virtual ~OSystem_POSIX() {}
|
virtual ~OSystem_POSIX() {}
|
||||||
|
|
||||||
|
virtual bool hasFeature(Feature f);
|
||||||
|
|
||||||
|
virtual bool displayLogFile();
|
||||||
|
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void initBackend();
|
virtual void initBackend();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Base string for creating the default path and filename
|
/**
|
||||||
// for the configuration file
|
* Base string for creating the default path and filename for the
|
||||||
|
* configuration file. This allows the Mac OS X subclass to override
|
||||||
|
* the config file path and name.
|
||||||
|
*/
|
||||||
Common::String _baseConfigName;
|
Common::String _baseConfigName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path of the currently open log file, if any.
|
||||||
|
*
|
||||||
|
* @note This is currently a string and not an FSNode for simplicity;
|
||||||
|
* e.g. we don't need to include fs.h here, and currently the
|
||||||
|
* only use of this value is to use it to open the log file in an
|
||||||
|
* editor; for that, we need it only as a string anyway.
|
||||||
|
*/
|
||||||
|
Common::String _logFilePath;
|
||||||
|
|
||||||
virtual Common::String getDefaultConfigFileName();
|
virtual Common::String getDefaultConfigFileName();
|
||||||
|
|
||||||
virtual Common::WriteStream *createLogFile();
|
virtual Common::WriteStream *createLogFile();
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
|
#define FORBIDDEN_SYMBOL_ALLOW_ALL
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
@ -160,6 +160,8 @@ void OSystem_SDL::initBackend() {
|
||||||
setupIcon();
|
setupIcon();
|
||||||
|
|
||||||
_inited = true;
|
_inited = true;
|
||||||
|
|
||||||
|
ModularBackend::initBackend();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSystem_SDL::initSDL() {
|
void OSystem_SDL::initSDL() {
|
||||||
|
@ -198,20 +200,6 @@ void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s, int priority)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::String OSystem_SDL::getDefaultConfigFileName() {
|
|
||||||
return "residual.ini";
|
|
||||||
}
|
|
||||||
|
|
||||||
Common::SeekableReadStream *OSystem_SDL::createConfigReadStream() {
|
|
||||||
Common::FSNode file(getDefaultConfigFileName());
|
|
||||||
return file.createReadStream();
|
|
||||||
}
|
|
||||||
|
|
||||||
Common::WriteStream *OSystem_SDL::createConfigWriteStream() {
|
|
||||||
Common::FSNode file(getDefaultConfigFileName());
|
|
||||||
return file.createWriteStream();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OSystem_SDL::setWindowCaption(const char *caption) {
|
void OSystem_SDL::setWindowCaption(const char *caption) {
|
||||||
Common::String cap;
|
Common::String cap;
|
||||||
byte c;
|
byte c;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
#include <SDL_opengl.h>
|
#include <SDL_opengl.h>
|
||||||
#endif
|
#endif
|
||||||
|
#undef ARRAYSIZE
|
||||||
|
|
||||||
#include "backends/modular-backend.h"
|
#include "backends/modular-backend.h"
|
||||||
#include "backends/mixer/sdl/sdl-mixer.h"
|
#include "backends/mixer/sdl/sdl-mixer.h"
|
||||||
|
@ -68,8 +69,6 @@ public:
|
||||||
|
|
||||||
virtual void setWindowCaption(const char *caption);
|
virtual void setWindowCaption(const char *caption);
|
||||||
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
|
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
|
||||||
virtual Common::SeekableReadStream *createConfigReadStream();
|
|
||||||
virtual Common::WriteStream *createConfigWriteStream();
|
|
||||||
virtual uint32 getMillis();
|
virtual uint32 getMillis();
|
||||||
virtual void delayMillis(uint msecs);
|
virtual void delayMillis(uint msecs);
|
||||||
virtual void getTimeAndDate(TimeDate &td) const;
|
virtual void getTimeAndDate(TimeDate &td) const;
|
||||||
|
@ -96,6 +95,8 @@ protected:
|
||||||
*/
|
*/
|
||||||
SdlEventSource *_eventSource;
|
SdlEventSource *_eventSource;
|
||||||
|
|
||||||
|
virtual Common::EventSource *getDefaultEventSource() { return _eventSource; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialze the SDL library.
|
* Initialze the SDL library.
|
||||||
*/
|
*/
|
||||||
|
@ -106,12 +107,6 @@ protected:
|
||||||
*/
|
*/
|
||||||
virtual void setupIcon();
|
virtual void setupIcon();
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the file path where the user configuration
|
|
||||||
* of ScummVM will be saved.
|
|
||||||
*/
|
|
||||||
virtual Common::String getDefaultConfigFileName();
|
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
virtual Common::WriteStream *createLogFile() { return 0; }
|
virtual Common::WriteStream *createLogFile() { return 0; }
|
||||||
Backends::Log::Log *_logger;
|
Backends::Log::Log *_logger;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
|
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
|
||||||
|
#include <shellapi.h>
|
||||||
|
|
||||||
#include "backends/platform/sdl/win32/win32.h"
|
#include "backends/platform/sdl/win32/win32.h"
|
||||||
#include "backends/fs/windows/windows-fs-factory.h"
|
#include "backends/fs/windows/windows-fs-factory.h"
|
||||||
|
@ -87,6 +88,49 @@ void OSystem_Win32::init() {
|
||||||
OSystem_SDL::init();
|
OSystem_SDL::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool OSystem_Win32::hasFeature(Feature f) {
|
||||||
|
if (f == kFeatureDisplayLogFile)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return OSystem_SDL::hasFeature(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OSystem_Win32::displayLogFile() {
|
||||||
|
if (_logFilePath.empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Try opening the log file with the default text editor
|
||||||
|
// log files should be registered as "txtfile" by default and thus open in the default text editor
|
||||||
|
HINSTANCE shellExec = ShellExecute(NULL, NULL, _logFilePath.c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||||
|
if ((intptr_t)shellExec > 32)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// ShellExecute with the default verb failed, try the "Open with..." dialog
|
||||||
|
PROCESS_INFORMATION processInformation;
|
||||||
|
STARTUPINFO startupInfo;
|
||||||
|
memset(&processInformation, 0, sizeof(processInformation));
|
||||||
|
memset(&startupInfo, 0, sizeof(startupInfo));
|
||||||
|
startupInfo.cb = sizeof(startupInfo);
|
||||||
|
|
||||||
|
char cmdLine[MAX_PATH * 2]; // CreateProcess may change the contents of cmdLine
|
||||||
|
sprintf(cmdLine, "rundll32 shell32.dll,OpenAs_RunDLL %s", _logFilePath.c_str());
|
||||||
|
BOOL result = CreateProcess(NULL,
|
||||||
|
cmdLine,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
FALSE,
|
||||||
|
NORMAL_PRIORITY_CLASS,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&startupInfo,
|
||||||
|
&processInformation);
|
||||||
|
if (result)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Common::String OSystem_Win32::getDefaultConfigFileName() {
|
Common::String OSystem_Win32::getDefaultConfigFileName() {
|
||||||
char configFile[MAXPATHLEN];
|
char configFile[MAXPATHLEN];
|
||||||
|
|
||||||
|
@ -136,6 +180,10 @@ Common::String OSystem_Win32::getDefaultConfigFileName() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::WriteStream *OSystem_Win32::createLogFile() {
|
Common::WriteStream *OSystem_Win32::createLogFile() {
|
||||||
|
// Start out by resetting _logFilePath, so that in case
|
||||||
|
// of a failure, we know that no log file is open.
|
||||||
|
_logFilePath.clear();
|
||||||
|
|
||||||
char logFile[MAXPATHLEN];
|
char logFile[MAXPATHLEN];
|
||||||
|
|
||||||
OSVERSIONINFO win32OsVersion;
|
OSVERSIONINFO win32OsVersion;
|
||||||
|
@ -163,7 +211,11 @@ Common::WriteStream *OSystem_Win32::createLogFile() {
|
||||||
strcat(logFile, "\\residual.log");
|
strcat(logFile, "\\residual.log");
|
||||||
|
|
||||||
Common::FSNode file(logFile);
|
Common::FSNode file(logFile);
|
||||||
return file.createWriteStream();
|
Common::WriteStream *stream = file.createWriteStream();
|
||||||
|
if (stream)
|
||||||
|
_logFilePath= logFile;
|
||||||
|
|
||||||
|
return stream;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,22 @@ public:
|
||||||
virtual void init();
|
virtual void init();
|
||||||
|
|
||||||
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
|
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
|
||||||
|
|
||||||
|
virtual bool hasFeature(Feature f);
|
||||||
|
|
||||||
|
virtual bool displayLogFile();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
/**
|
||||||
|
* The path of the currently open log file, if any.
|
||||||
|
*
|
||||||
|
* @note This is currently a string and not an FSNode for simplicity;
|
||||||
|
* e.g. we don't need to include fs.h here, and currently the
|
||||||
|
* only use of this value is to use it to open the log file in an
|
||||||
|
* editor; for that, we need it only as a string anyway.
|
||||||
|
*/
|
||||||
|
Common::String _logFilePath;
|
||||||
|
|
||||||
virtual Common::String getDefaultConfigFileName();
|
virtual Common::String getDefaultConfigFileName();
|
||||||
virtual Common::WriteStream *createLogFile();
|
virtual Common::WriteStream *createLogFile();
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
#if defined(DYNAMIC_MODULES) && defined(UNIX)
|
#if defined(DYNAMIC_MODULES) && defined(POSIX)
|
||||||
|
|
||||||
#include "backends/plugins/posix/posix-provider.h"
|
#include "backends/plugins/posix/posix-provider.h"
|
||||||
#include "backends/plugins/dynamic-plugin.h"
|
#include "backends/plugins/dynamic-plugin.h"
|
||||||
|
@ -77,9 +77,9 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Plugin* POSIXPluginProvider::createPlugin(const Common::FSNode &node) const {
|
Plugin *POSIXPluginProvider::createPlugin(const Common::FSNode &node) const {
|
||||||
return new POSIXPlugin(node.getPath());
|
return new POSIXPlugin(node.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // defined(DYNAMIC_MODULES) && defined(UNIX)
|
#endif // defined(DYNAMIC_MODULES) && defined(POSIX)
|
||||||
|
|
|
@ -25,13 +25,13 @@
|
||||||
|
|
||||||
#include "base/plugins.h"
|
#include "base/plugins.h"
|
||||||
|
|
||||||
#if defined(DYNAMIC_MODULES) && defined(UNIX)
|
#if defined(DYNAMIC_MODULES) && defined(POSIX)
|
||||||
|
|
||||||
class POSIXPluginProvider : public FilePluginProvider {
|
class POSIXPluginProvider : public FilePluginProvider {
|
||||||
protected:
|
protected:
|
||||||
Plugin* createPlugin(const Common::FSNode &node) const;
|
Plugin *createPlugin(const Common::FSNode &node) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // defined(DYNAMIC_MODULES) && defined(UNIX)
|
#endif // defined(DYNAMIC_MODULES) && defined(POSIX)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
|
||||||
|
|
||||||
|
|
||||||
class Win32Plugin : public DynamicPlugin {
|
class Win32Plugin : public DynamicPlugin {
|
||||||
|
@ -67,19 +68,11 @@ public:
|
||||||
|
|
||||||
bool loadPlugin() {
|
bool loadPlugin() {
|
||||||
assert(!_dlHandle);
|
assert(!_dlHandle);
|
||||||
#ifndef _WIN32_WCE
|
#ifndef _WIN32_WCE
|
||||||
_dlHandle = LoadLibrary(_filename.c_str());
|
_dlHandle = LoadLibrary(_filename.c_str());
|
||||||
#else
|
#else
|
||||||
if (!_filename.hasSuffix("residual.dll") &&
|
_dlHandle = LoadLibrary(toUnicode(_filename.c_str()));
|
||||||
!_filename.hasSuffix("libstdc++-6.dll") &&
|
#endif
|
||||||
!_filename.hasSuffix("libgcc_s_sjlj-1.dll")) {
|
|
||||||
// skip loading the core scummvm module and runtime dlls
|
|
||||||
_dlHandle = LoadLibrary(toUnicode(_filename.c_str()));
|
|
||||||
} else {
|
|
||||||
// do not generate misleading error message
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!_dlHandle) {
|
if (!_dlHandle) {
|
||||||
debug("Failed loading plugin '%s' (error code %d)", _filename.c_str(), (int32) GetLastError());
|
debug("Failed loading plugin '%s' (error code %d)", _filename.c_str(), (int32) GetLastError());
|
||||||
|
@ -111,7 +104,11 @@ Plugin* Win32PluginProvider::createPlugin(const Common::FSNode &node) const {
|
||||||
bool Win32PluginProvider::isPluginFilename(const Common::FSNode &node) const {
|
bool Win32PluginProvider::isPluginFilename(const Common::FSNode &node) const {
|
||||||
// Check the plugin suffix
|
// Check the plugin suffix
|
||||||
Common::String filename = node.getName();
|
Common::String filename = node.getName();
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
if (!filename.hasSuffix(".dll"))
|
if (!filename.hasSuffix(".dll"))
|
||||||
|
#else
|
||||||
|
if (!filename.hasSuffix(".plugin"))
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -21,13 +21,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// Enable mkdir
|
// Enable getenv, mkdir and time.h stuff
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_getenv
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h
|
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
#if defined(UNIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
|
#if defined(POSIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
|
||||||
|
|
||||||
#include "backends/saves/posix/posix-saves.h"
|
#include "backends/saves/posix/posix-saves.h"
|
||||||
|
|
||||||
|
@ -50,7 +51,7 @@
|
||||||
POSIXSaveFileManager::POSIXSaveFileManager() {
|
POSIXSaveFileManager::POSIXSaveFileManager() {
|
||||||
// Register default savepath based on HOME
|
// Register default savepath based on HOME
|
||||||
#if defined(SAMSUNGTV)
|
#if defined(SAMSUNGTV)
|
||||||
ConfMan.registerDefault("savepath", "/dtv/usb/sda1/.residual");
|
ConfMan.registerDefault("savepath", "/mtd_wiselink/residual savegames");
|
||||||
#else
|
#else
|
||||||
Common::String savePath;
|
Common::String savePath;
|
||||||
const char *home = getenv("HOME");
|
const char *home = getenv("HOME");
|
||||||
|
@ -59,15 +60,30 @@ POSIXSaveFileManager::POSIXSaveFileManager() {
|
||||||
savePath += "/" DEFAULT_SAVE_PATH;
|
savePath += "/" DEFAULT_SAVE_PATH;
|
||||||
ConfMan.registerDefault("savepath", savePath);
|
ConfMan.registerDefault("savepath", savePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The user can override the savepath with the SCUMMVM_SAVEPATH
|
||||||
|
// environment variable. This is weaker than a --savepath on the
|
||||||
|
// command line, but overrides the default savepath.
|
||||||
|
//
|
||||||
|
// To ensure that the command line option (if given) has precedence,
|
||||||
|
// we only set the value in the transient domain if it is not
|
||||||
|
// yet present there.
|
||||||
|
if (!ConfMan.hasKey("savepath", Common::ConfigManager::kTransientDomain)) {
|
||||||
|
const char *dir = getenv("RESIDUAL_SAVEPATH");
|
||||||
|
if (dir && *dir && strlen(dir) < MAXPATHLEN) {
|
||||||
|
Common::FSNode saveDir(dir);
|
||||||
|
if (!saveDir.exists()) {
|
||||||
|
warning("Ignoring non-existent RESIDUAL_SAVEPATH '%s'", dir);
|
||||||
|
} else if (!saveDir.isWritable()) {
|
||||||
|
warning("Ignoring non-writable RESIDUAL_SAVEPATH '%s'", dir);
|
||||||
|
} else {
|
||||||
|
ConfMan.set("savepath", dir, Common::ConfigManager::kTransientDomain);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
POSIXSaveFileManager::POSIXSaveFileManager(const Common::String &defaultSavepath)
|
|
||||||
: DefaultSaveFileManager(defaultSavepath) {
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(UNIX)
|
|
||||||
void POSIXSaveFileManager::checkPath(const Common::FSNode &dir) {
|
void POSIXSaveFileManager::checkPath(const Common::FSNode &dir) {
|
||||||
const Common::String path = dir.getPath();
|
const Common::String path = dir.getPath();
|
||||||
clearError();
|
clearError();
|
||||||
|
@ -132,6 +148,5 @@ void POSIXSaveFileManager::checkPath(const Common::FSNode &dir) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include "backends/saves/default/default-saves.h"
|
#include "backends/saves/default/default-saves.h"
|
||||||
|
|
||||||
#if defined(UNIX)
|
#if defined(POSIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
|
||||||
/**
|
/**
|
||||||
* Customization of the DefaultSaveFileManager for POSIX platforms.
|
* Customization of the DefaultSaveFileManager for POSIX platforms.
|
||||||
* The only two differences are that the default constructor sets
|
* The only two differences are that the default constructor sets
|
||||||
|
@ -35,7 +35,6 @@
|
||||||
class POSIXSaveFileManager : public DefaultSaveFileManager {
|
class POSIXSaveFileManager : public DefaultSaveFileManager {
|
||||||
public:
|
public:
|
||||||
POSIXSaveFileManager();
|
POSIXSaveFileManager();
|
||||||
// POSIXSaveFileManager(const Common::String &defaultSavepath);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,9 +23,10 @@
|
||||||
#ifndef COMMON_IMAGEMAP_H
|
#ifndef COMMON_IMAGEMAP_H
|
||||||
#define COMMON_IMAGEMAP_H
|
#define COMMON_IMAGEMAP_H
|
||||||
|
|
||||||
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
#ifdef ENABLE_VKEYBD
|
#ifdef ENABLE_VKEYBD
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
|
||||||
#include "common/hashmap.h"
|
#include "common/hashmap.h"
|
||||||
#include "common/hash-str.h"
|
#include "common/hash-str.h"
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,10 @@
|
||||||
#ifndef COMMON_POLYGON_H
|
#ifndef COMMON_POLYGON_H
|
||||||
#define COMMON_POLYGON_H
|
#define COMMON_POLYGON_H
|
||||||
|
|
||||||
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
#ifdef ENABLE_VKEYBD
|
#ifdef ENABLE_VKEYBD
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
|
||||||
#include "common/array.h"
|
#include "common/array.h"
|
||||||
#include "common/rect.h"
|
#include "common/rect.h"
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,11 @@
|
||||||
#ifndef COMMON_VIRTUAL_KEYBOARD_GUI_H
|
#ifndef COMMON_VIRTUAL_KEYBOARD_GUI_H
|
||||||
#define COMMON_VIRTUAL_KEYBOARD_GUI_H
|
#define COMMON_VIRTUAL_KEYBOARD_GUI_H
|
||||||
|
|
||||||
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
#ifdef ENABLE_VKEYBD
|
#ifdef ENABLE_VKEYBD
|
||||||
|
|
||||||
#include "backends/vkeybd/virtual-keyboard.h"
|
#include "backends/vkeybd/virtual-keyboard.h"
|
||||||
#include "common/scummsys.h"
|
|
||||||
#include "common/rect.h"
|
#include "common/rect.h"
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
#include "graphics/font.h"
|
#include "graphics/font.h"
|
||||||
|
|
|
@ -59,8 +59,7 @@ bool VirtualKeyboardParser::closedKeyCallback(ParserNode *node) {
|
||||||
return parserError("Initial mode of keyboard pack not defined");
|
return parserError("Initial mode of keyboard pack not defined");
|
||||||
} else if (node->name.equalsIgnoreCase("mode")) {
|
} else if (node->name.equalsIgnoreCase("mode")) {
|
||||||
if (!_layoutParsed) {
|
if (!_layoutParsed) {
|
||||||
return parserError("'%s' layout missing from '%s' mode",
|
return parserError("'" + _mode->resolution + "' layout missing from '" + _mode->name + "' mode");
|
||||||
_mode->resolution.c_str(), _mode->name.c_str());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -105,7 +104,7 @@ bool VirtualKeyboardParser::parserCallback_mode(ParserNode *node) {
|
||||||
if (_parseMode == kParseFull) {
|
if (_parseMode == kParseFull) {
|
||||||
// if full parse then add new mode to keyboard
|
// if full parse then add new mode to keyboard
|
||||||
if (_keyboard->_modes.contains(name))
|
if (_keyboard->_modes.contains(name))
|
||||||
return parserError("Mode '%s' has already been defined", name.c_str());
|
return parserError("Mode '" + name + "' has already been defined");
|
||||||
|
|
||||||
VirtualKeyboard::Mode mode;
|
VirtualKeyboard::Mode mode;
|
||||||
mode.name = name;
|
mode.name = name;
|
||||||
|
@ -177,7 +176,7 @@ bool VirtualKeyboardParser::parserCallback_event(ParserNode *node) {
|
||||||
|
|
||||||
String name = node->values["name"];
|
String name = node->values["name"];
|
||||||
if (_mode->events.contains(name))
|
if (_mode->events.contains(name))
|
||||||
return parserError("Event '%s' has already been defined", name.c_str());
|
return parserError("Event '" + name + "' has already been defined");
|
||||||
|
|
||||||
VirtualKeyboard::VKEvent *evt = new VirtualKeyboard::VKEvent();
|
VirtualKeyboard::VKEvent *evt = new VirtualKeyboard::VKEvent();
|
||||||
evt->name = name;
|
evt->name = name;
|
||||||
|
@ -235,7 +234,7 @@ bool VirtualKeyboardParser::parserCallback_event(ParserNode *node) {
|
||||||
evt->type = VirtualKeyboard::kVKEventMoveRight;
|
evt->type = VirtualKeyboard::kVKEventMoveRight;
|
||||||
} else {
|
} else {
|
||||||
delete evt;
|
delete evt;
|
||||||
return parserError("Event type '%s' not known", type.c_str());
|
return parserError("Event type '" + type + "' not known");
|
||||||
}
|
}
|
||||||
|
|
||||||
_mode->events[name] = evt;
|
_mode->events[name] = evt;
|
||||||
|
@ -257,7 +256,7 @@ bool VirtualKeyboardParser::parserCallback_layout(ParserNode *node) {
|
||||||
|
|
||||||
SeekableReadStream *file = _keyboard->_fileArchive->createReadStreamForMember(_mode->bitmapName);
|
SeekableReadStream *file = _keyboard->_fileArchive->createReadStreamForMember(_mode->bitmapName);
|
||||||
if (!file)
|
if (!file)
|
||||||
return parserError("Bitmap '%s' not found", _mode->bitmapName.c_str());
|
return parserError("Bitmap '" + _mode->bitmapName + "' not found");
|
||||||
|
|
||||||
const Graphics::PixelFormat format = g_system->getOverlayFormat();
|
const Graphics::PixelFormat format = g_system->getOverlayFormat();
|
||||||
|
|
||||||
|
@ -265,7 +264,7 @@ bool VirtualKeyboardParser::parserCallback_layout(ParserNode *node) {
|
||||||
delete file;
|
delete file;
|
||||||
|
|
||||||
if (!_mode->image)
|
if (!_mode->image)
|
||||||
return parserError("Error loading bitmap '%s'", _mode->bitmapName.c_str());
|
return parserError("Error loading bitmap '" + _mode->bitmapName + "'");
|
||||||
|
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
if (node->values.contains("transparent_color")) {
|
if (node->values.contains("transparent_color")) {
|
||||||
|
@ -313,7 +312,7 @@ bool VirtualKeyboardParser::parserCallback_area(ParserNode *node) {
|
||||||
Polygon *poly = _mode->imageMap.createArea(target);
|
Polygon *poly = _mode->imageMap.createArea(target);
|
||||||
return parsePolygon(*poly, coords);
|
return parsePolygon(*poly, coords);
|
||||||
}
|
}
|
||||||
return parserError("Area shape '%s' not known", shape.c_str());
|
return parserError("Area shape '" + shape + "' not known");
|
||||||
}
|
}
|
||||||
|
|
||||||
byte VirtualKeyboardParser::parseFlags(const String& flags) {
|
byte VirtualKeyboardParser::parseFlags(const String& flags) {
|
||||||
|
|
|
@ -23,9 +23,10 @@
|
||||||
#ifndef COMMON_VIRTUAL_KEYBOARD_PARSER_H
|
#ifndef COMMON_VIRTUAL_KEYBOARD_PARSER_H
|
||||||
#define COMMON_VIRTUAL_KEYBOARD_PARSER_H
|
#define COMMON_VIRTUAL_KEYBOARD_PARSER_H
|
||||||
|
|
||||||
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
#ifdef ENABLE_VKEYBD
|
#ifdef ENABLE_VKEYBD
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
|
||||||
#include "common/xmlparser.h"
|
#include "common/xmlparser.h"
|
||||||
#include "backends/vkeybd/virtual-keyboard.h"
|
#include "backends/vkeybd/virtual-keyboard.h"
|
||||||
|
|
||||||
|
|
|
@ -23,11 +23,12 @@
|
||||||
#ifndef COMMON_VIRTUAL_KEYBOARD_H
|
#ifndef COMMON_VIRTUAL_KEYBOARD_H
|
||||||
#define COMMON_VIRTUAL_KEYBOARD_H
|
#define COMMON_VIRTUAL_KEYBOARD_H
|
||||||
|
|
||||||
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
#ifdef ENABLE_VKEYBD
|
#ifdef ENABLE_VKEYBD
|
||||||
|
|
||||||
class OSystem;
|
class OSystem;
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
|
||||||
#include "common/events.h"
|
#include "common/events.h"
|
||||||
#include "common/hashmap.h"
|
#include "common/hashmap.h"
|
||||||
#include "common/hash-str.h"
|
#include "common/hash-str.h"
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
// FIXME: Avoid using printf
|
// FIXME: Avoid using printf
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
|
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
|
||||||
|
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
|
||||||
|
|
||||||
#include "engines/metaengine.h"
|
#include "engines/metaengine.h"
|
||||||
#include "base/commandLine.h"
|
#include "base/commandLine.h"
|
||||||
#include "base/plugins.h"
|
#include "base/plugins.h"
|
||||||
|
@ -50,7 +52,7 @@ static const char USAGE_STRING[] =
|
||||||
;
|
;
|
||||||
|
|
||||||
// DONT FIXME: DO NOT ORDER ALPHABETICALLY, THIS IS ORDERED BY IMPORTANCE/CATEGORY! :)
|
// DONT FIXME: DO NOT ORDER ALPHABETICALLY, THIS IS ORDERED BY IMPORTANCE/CATEGORY! :)
|
||||||
#if defined(__SYMBIAN32__) || defined(__GP32__) || defined(ANDROID)
|
#if defined(__SYMBIAN32__) || defined(__GP32__) || defined(ANDROID) || defined(__DS__)
|
||||||
static const char HELP_STRING[] = "NoUsageString"; // save more data segment space
|
static const char HELP_STRING[] = "NoUsageString"; // save more data segment space
|
||||||
#else
|
#else
|
||||||
static const char HELP_STRING[] =
|
static const char HELP_STRING[] =
|
||||||
|
@ -111,7 +113,7 @@ static void usage(const char *s, ...) {
|
||||||
vsnprintf(buf, STRINGBUFLEN, s, va);
|
vsnprintf(buf, STRINGBUFLEN, s, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
#if !(defined(__GP32__) || defined (__SYMBIAN32__))
|
#if !(defined(__GP32__) || defined (__SYMBIAN32__) || defined(__DS__))
|
||||||
printf(USAGE_STRING, s_appName, buf, s_appName, s_appName);
|
printf(USAGE_STRING, s_appName, buf, s_appName, s_appName);
|
||||||
#endif
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -797,7 +799,8 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
|
||||||
#endif // DISABLE_COMMAND_LINE
|
#endif // DISABLE_COMMAND_LINE
|
||||||
|
|
||||||
|
|
||||||
Common::Error processSettings(Common::String &command, Common::StringMap &settings) {
|
bool processSettings(Common::String &command, Common::StringMap &settings, Common::Error &err) {
|
||||||
|
err = Common::kNoError;
|
||||||
|
|
||||||
#ifndef DISABLE_COMMAND_LINE
|
#ifndef DISABLE_COMMAND_LINE
|
||||||
|
|
||||||
|
@ -806,33 +809,34 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin
|
||||||
// have been loaded.
|
// have been loaded.
|
||||||
if (command == "list-targets") {
|
if (command == "list-targets") {
|
||||||
listTargets();
|
listTargets();
|
||||||
return Common::kNoError;
|
return true;
|
||||||
} else if (command == "list-games") {
|
} else if (command == "list-games") {
|
||||||
listGames();
|
listGames();
|
||||||
return Common::kNoError;
|
return true;
|
||||||
} else if (command == "list-saves") {
|
} else if (command == "list-saves") {
|
||||||
return listSaves(settings["list-saves"].c_str());
|
err = listSaves(settings["list-saves"].c_str());
|
||||||
|
return true;
|
||||||
} else if (command == "list-themes") {
|
} else if (command == "list-themes") {
|
||||||
listThemes();
|
listThemes();
|
||||||
return Common::kNoError;
|
return true;
|
||||||
} else if (command == "version") {
|
} else if (command == "version") {
|
||||||
printf("%s\n", gResidualFullVersion);
|
printf("%s\n", gResidualFullVersion);
|
||||||
printf("Features compiled in: %s\n", gResidualFeatures);
|
printf("Features compiled in: %s\n", gResidualFeatures);
|
||||||
return Common::kNoError;
|
return true;
|
||||||
} else if (command == "help") {
|
} else if (command == "help") {
|
||||||
printf(HELP_STRING, s_appName);
|
printf(HELP_STRING, s_appName);
|
||||||
return Common::kNoError;
|
return true;
|
||||||
}
|
}
|
||||||
#ifdef DETECTOR_TESTING_HACK
|
#ifdef DETECTOR_TESTING_HACK
|
||||||
else if (command == "test-detector") {
|
else if (command == "test-detector") {
|
||||||
runDetectorTest();
|
runDetectorTest();
|
||||||
return Common::kNoError;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef UPGRADE_ALL_TARGETS_HACK
|
#ifdef UPGRADE_ALL_TARGETS_HACK
|
||||||
else if (command == "upgrade-targets") {
|
else if (command == "upgrade-targets") {
|
||||||
upgradeTargets();
|
upgradeTargets();
|
||||||
return Common::kNoError;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -870,26 +874,6 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// The user can override the savepath with the SCUMMVM_SAVEPATH
|
|
||||||
// environment variable. This is weaker than a --savepath on the
|
|
||||||
// command line, but overrides the default savepath, hence it is
|
|
||||||
// handled here, just before the command line gets parsed.
|
|
||||||
#if !defined(_WIN32_WCE) && !defined(__GP32__) && !defined(ANDROID)
|
|
||||||
if (!settings.contains("savepath")) {
|
|
||||||
const char *dir = getenv("RESIDUAL_SAVEPATH");
|
|
||||||
if (dir && *dir && strlen(dir) < MAXPATHLEN) {
|
|
||||||
Common::FSNode saveDir(dir);
|
|
||||||
if (!saveDir.exists()) {
|
|
||||||
warning("Non-existent RESIDUAL_SAVEPATH save path. It will be ignored.");
|
|
||||||
} else if (!saveDir.isWritable()) {
|
|
||||||
warning("Non-writable RESIDUAL_SAVEPATH save path. It will be ignored.");
|
|
||||||
} else {
|
|
||||||
settings["savepath"] = dir;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Finally, store the command line settings into the config manager.
|
// Finally, store the command line settings into the config manager.
|
||||||
for (Common::StringMap::const_iterator x = settings.begin(); x != settings.end(); ++x) {
|
for (Common::StringMap::const_iterator x = settings.begin(); x != settings.end(); ++x) {
|
||||||
Common::String key(x->_key);
|
Common::String key(x->_key);
|
||||||
|
@ -904,7 +888,7 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin
|
||||||
ConfMan.set(key, value, Common::ConfigManager::kTransientDomain);
|
ConfMan.set(key, value, Common::ConfigManager::kTransientDomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Common::kArgumentNotProcessed;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace Base
|
} // End of namespace Base
|
||||||
|
|
|
@ -32,9 +32,28 @@ class String;
|
||||||
|
|
||||||
namespace Base {
|
namespace Base {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register various defaults with the ConfigManager.
|
||||||
|
*/
|
||||||
void registerDefaults();
|
void registerDefaults();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse the command line for options and a command; the options
|
||||||
|
* are stored in the map 'settings, the command (if any) is returned.
|
||||||
|
*/
|
||||||
Common::String parseCommandLine(Common::StringMap &settings, int argc, const char * const *argv);
|
Common::String parseCommandLine(Common::StringMap &settings, int argc, const char * const *argv);
|
||||||
Common::Error processSettings(Common::String &command, Common::StringMap &settings);
|
|
||||||
|
/**
|
||||||
|
* Process the command line options and arguments.
|
||||||
|
* Returns true if everything was handled and ScummVM should quit
|
||||||
|
* (e.g. because "--help" was specified, and handled).
|
||||||
|
*
|
||||||
|
* @param[in] command the command as returned by parseCommandLine
|
||||||
|
* @param[in] settings the settings as returned by parseCommandLine
|
||||||
|
* @param[out] err indicates whether any error occurred, and which
|
||||||
|
* @return true if the command was completely processed and ScummVM should quit, false otherwise
|
||||||
|
*/
|
||||||
|
bool processSettings(Common::String &command, Common::StringMap &settings, Common::Error &err);
|
||||||
|
|
||||||
} // End of namespace Base
|
} // End of namespace Base
|
||||||
|
|
||||||
|
|
|
@ -338,8 +338,7 @@ extern "C" int residual_main(int argc, const char * const argv[]) {
|
||||||
Common::Error res;
|
Common::Error res;
|
||||||
|
|
||||||
// TODO: deal with settings that require plugins to be loaded
|
// TODO: deal with settings that require plugins to be loaded
|
||||||
res = Base::processSettings(command, settings);
|
if (Base::processSettings(command, settings, res)) {
|
||||||
if (res.getCode() != Common::kArgumentNotProcessed) {
|
|
||||||
if (res.getCode() != Common::kNoError)
|
if (res.getCode() != Common::kNoError)
|
||||||
warning("%s", res.getDesc().c_str());
|
warning("%s", res.getDesc().c_str());
|
||||||
return res.getCode();
|
return res.getCode();
|
||||||
|
|
|
@ -80,7 +80,7 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX];
|
||||||
(ENABLE_##ID && !PLUGIN_ENABLED_DYNAMIC(ID))
|
(ENABLE_##ID && !PLUGIN_ENABLED_DYNAMIC(ID))
|
||||||
|
|
||||||
#define PLUGIN_ENABLED_DYNAMIC(ID) \
|
#define PLUGIN_ENABLED_DYNAMIC(ID) \
|
||||||
(ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN) && DYNAMIC_MODULES)
|
(ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN) && defined(DYNAMIC_MODULES))
|
||||||
|
|
||||||
// see comments in backends/plugins/elf/elf-provider.cpp
|
// see comments in backends/plugins/elf/elf-provider.cpp
|
||||||
#if defined(USE_ELF_LOADER) && defined(ELF_LOADER_CXA_ATEXIT)
|
#if defined(USE_ELF_LOADER) && defined(ELF_LOADER_CXA_ATEXIT)
|
||||||
|
@ -92,7 +92,7 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX];
|
||||||
|
|
||||||
#ifdef USE_ELF_LOADER
|
#ifdef USE_ELF_LOADER
|
||||||
#define PLUGIN_DYNAMIC_BUILD_DATE \
|
#define PLUGIN_DYNAMIC_BUILD_DATE \
|
||||||
PLUGIN_EXPORT const char *PLUGIN_getBuildDate() { return gResidualPluginBuildDate; }
|
PLUGIN_EXPORT const char *PLUGIN_getBuildDate() { return gScummVMPluginBuildDate; }
|
||||||
#else
|
#else
|
||||||
#define PLUGIN_DYNAMIC_BUILD_DATE
|
#define PLUGIN_DYNAMIC_BUILD_DATE
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -112,5 +112,9 @@ const char *gResidualFeatures = ""
|
||||||
#ifdef USE_THEORADEC
|
#ifdef USE_THEORADEC
|
||||||
"Theora "
|
"Theora "
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_FAAD
|
||||||
|
"AAC "
|
||||||
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -234,6 +234,13 @@ void sort(T first, T last) {
|
||||||
sort(first, last, Common::Less<typename T::ValueType>());
|
sort(first, last, Common::Less<typename T::ValueType>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MSVC is complaining about the minus operator being applied to an unsigned type
|
||||||
|
// We disable this warning for the affected section of code
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable: 4146)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Euclid's algorithm to compute the greatest common divisor.
|
* Euclid's algorithm to compute the greatest common divisor.
|
||||||
*/
|
*/
|
||||||
|
@ -256,6 +263,10 @@ T gcd(T a, T b) {
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
} // End of namespace Common
|
} // End of namespace Common
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,6 @@ static String errorToString(ErrorCode errorCode) {
|
||||||
case kEnginePluginNotSupportSaves:
|
case kEnginePluginNotSupportSaves:
|
||||||
return _s("Engine plugin does not support save states");
|
return _s("Engine plugin does not support save states");
|
||||||
|
|
||||||
case kArgumentNotProcessed:
|
|
||||||
return _s("Command line argument not processed");
|
|
||||||
|
|
||||||
case kUnknownError:
|
case kUnknownError:
|
||||||
default:
|
default:
|
||||||
return _s("Unknown error");
|
return _s("Unknown error");
|
||||||
|
|
|
@ -47,7 +47,6 @@ enum ErrorCode {
|
||||||
kUnsupportedGameidError, ///< Engine initialization: Gameid not supported by this (Meta)Engine
|
kUnsupportedGameidError, ///< Engine initialization: Gameid not supported by this (Meta)Engine
|
||||||
kUnsupportedColorMode, ///< Engine initialization: Engine does not support backend's color mode
|
kUnsupportedColorMode, ///< Engine initialization: Engine does not support backend's color mode
|
||||||
|
|
||||||
|
|
||||||
kReadPermissionDenied, ///< Unable to read data due to missing read permission
|
kReadPermissionDenied, ///< Unable to read data due to missing read permission
|
||||||
kWritePermissionDenied, ///< Unable to write data due to missing write permission
|
kWritePermissionDenied, ///< Unable to write data due to missing write permission
|
||||||
|
|
||||||
|
@ -63,8 +62,6 @@ enum ErrorCode {
|
||||||
kEnginePluginNotFound, ///< Failed to find plugin to handle target
|
kEnginePluginNotFound, ///< Failed to find plugin to handle target
|
||||||
kEnginePluginNotSupportSaves, ///< Failed if plugin does not support listing save states
|
kEnginePluginNotSupportSaves, ///< Failed if plugin does not support listing save states
|
||||||
|
|
||||||
kArgumentNotProcessed, ///< Used in command line parsing
|
|
||||||
|
|
||||||
kUnknownError ///< Catch-all error, used if no other error code matches
|
kUnknownError ///< Catch-all error, used if no other error code matches
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise the event manager.
|
* Initialize the event manager.
|
||||||
* @note called after graphics system has been set up
|
* @note called after graphics system has been set up
|
||||||
*/
|
*/
|
||||||
virtual void init() {}
|
virtual void init() {}
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
* Backend files may #define FORBIDDEN_SYMBOL_ALLOW_ALL if they
|
* Backend files may #define FORBIDDEN_SYMBOL_ALLOW_ALL if they
|
||||||
* have to access functions like fopen, fread etc.
|
* have to access functions like fopen, fread etc.
|
||||||
* Regular code, esp. code in engines/, should never do that.
|
* Regular code, esp. code in engines/, should never do that.
|
||||||
|
* To ease transition, though, we allow re-enabling selected symbols
|
||||||
|
* in frontend code. However, this should only be used as a temporary
|
||||||
|
* measure. Especially new code should avoid this at all costs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FORBIDDEN_SYMBOL_ALLOW_ALL
|
#ifndef FORBIDDEN_SYMBOL_ALLOW_ALL
|
||||||
|
@ -51,7 +54,7 @@
|
||||||
* the compiler will hopefully print along with its own error message),
|
* the compiler will hopefully print along with its own error message),
|
||||||
* we try to make clear what is causing the error.
|
* we try to make clear what is causing the error.
|
||||||
*/
|
*/
|
||||||
#define FORBIDDEN_SYMBOL_REPLACEMENT FORBIDDEN SYMBOL !%*
|
#define FORBIDDEN_SYMBOL_REPLACEMENT FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
|
||||||
|
|
||||||
|
|
||||||
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_printf
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_printf
|
||||||
|
@ -79,6 +82,21 @@
|
||||||
#define FILE FORBIDDEN_SYMBOL_REPLACEMENT
|
#define FILE FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_stdin
|
||||||
|
#undef stdin
|
||||||
|
#define stdin FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_stdout
|
||||||
|
#undef stdout
|
||||||
|
#define stdout FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_stderr
|
||||||
|
#undef stderr
|
||||||
|
#define stderr FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_fopen
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_fopen
|
||||||
#undef fopen
|
#undef fopen
|
||||||
#define fopen(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
|
#define fopen(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
@ -124,6 +142,46 @@
|
||||||
#define fputc(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
|
#define fputc(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_fgets
|
||||||
|
#undef fgets
|
||||||
|
#define fgets(a,b,c) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_fputs
|
||||||
|
#undef fputs
|
||||||
|
#define fputs(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_getc
|
||||||
|
#undef getc
|
||||||
|
#define getc(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_putc
|
||||||
|
#undef putc
|
||||||
|
#define putc(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_gets
|
||||||
|
#undef gets
|
||||||
|
#define gets(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_puts
|
||||||
|
#undef puts
|
||||||
|
#define puts(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_getchar
|
||||||
|
#undef getchar
|
||||||
|
#define getchar() FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_putchar
|
||||||
|
#undef putchar
|
||||||
|
#define putchar(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_setjmp
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_setjmp
|
||||||
#undef setjmp
|
#undef setjmp
|
||||||
|
@ -140,6 +198,31 @@
|
||||||
#define system(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
#define system(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_exit
|
||||||
|
#undef exit
|
||||||
|
#define exit(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_getenv
|
||||||
|
#undef getenv
|
||||||
|
#define getenv(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_putenv
|
||||||
|
#undef putenv
|
||||||
|
#define putenv(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_setenv
|
||||||
|
#undef setenv
|
||||||
|
#define setenv(a,b,c) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_unsetenv
|
||||||
|
#undef unsetenv
|
||||||
|
#define unsetenv(a) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Disable various symbols from time.h
|
// Disable various symbols from time.h
|
||||||
|
@ -281,6 +364,27 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_stricmp
|
||||||
|
#undef stricmp
|
||||||
|
#define stricmp(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_strnicmp
|
||||||
|
#undef strnicmp
|
||||||
|
#define strnicmp(a,b,c) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_strcasecmp
|
||||||
|
#undef strcasecmp
|
||||||
|
#define strcasecmp(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_strncasecmp
|
||||||
|
#undef strncasecmp
|
||||||
|
#define strncasecmp(a,b,c) FORBIDDEN_SYMBOL_REPLACEMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We also would like to disable the following symbols;
|
* We also would like to disable the following symbols;
|
||||||
* however, these are also frequently used in regular code,
|
* however, these are also frequently used in regular code,
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
|
|
||||||
#ifdef MACOSX
|
#ifdef MACOSX
|
||||||
#include "common/config-manager.h"
|
#include "common/config-manager.h"
|
||||||
#include "backends/fs/stdiostream.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
@ -108,7 +107,7 @@ bool MacResManager::open(String filename) {
|
||||||
#ifdef MACOSX
|
#ifdef MACOSX
|
||||||
// Check the actual fork on a Mac computer
|
// Check the actual fork on a Mac computer
|
||||||
String fullPath = ConfMan.get("path") + "/" + filename + "/..namedfork/rsrc";
|
String fullPath = ConfMan.get("path") + "/" + filename + "/..namedfork/rsrc";
|
||||||
SeekableReadStream *macResForkRawStream = StdioStream::makeFromPath(fullPath, false);
|
SeekableReadStream *macResForkRawStream = FSNode(fullPath).createReadStream();;
|
||||||
|
|
||||||
if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
|
if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
|
||||||
_baseFileName = filename;
|
_baseFileName = filename;
|
||||||
|
@ -168,7 +167,7 @@ bool MacResManager::open(FSNode path, String filename) {
|
||||||
#ifdef MACOSX
|
#ifdef MACOSX
|
||||||
// Check the actual fork on a Mac computer
|
// Check the actual fork on a Mac computer
|
||||||
String fullPath = path.getPath() + "/" + filename + "/..namedfork/rsrc";
|
String fullPath = path.getPath() + "/" + filename + "/..namedfork/rsrc";
|
||||||
SeekableReadStream *macResForkRawStream = StdioStream::makeFromPath(fullPath, false);
|
SeekableReadStream *macResForkRawStream = FSNode(fullPath).createReadStream();
|
||||||
|
|
||||||
if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
|
if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
|
||||||
_baseFileName = filename;
|
_baseFileName = filename;
|
||||||
|
|
|
@ -142,7 +142,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request a list of available savegames with a given DOS-style pattern,
|
* Request a list of available savegames with a given DOS-style pattern,
|
||||||
* also known as "glob" in the UNIX world. Refer to the Common::matchString()
|
* also known as "glob" in the POSIX world. Refer to the Common::matchString()
|
||||||
* function to learn about the precise pattern format.
|
* function to learn about the precise pattern format.
|
||||||
* @param pattern Pattern to match. Wildcards like * or ? are available.
|
* @param pattern Pattern to match. Wildcards like * or ? are available.
|
||||||
* @return list of strings for all present file names.
|
* @return list of strings for all present file names.
|
||||||
|
|
|
@ -40,10 +40,42 @@
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
// vsnprintf is already defined in Visual Studio 2008
|
|
||||||
#if (_MSC_VER < 1500)
|
// FIXME: The placement of the workaround functions for MSVC below
|
||||||
#define vsnprintf _vsnprintf
|
// require us to include stdio.h and stdarg.h for MSVC here. This
|
||||||
#endif
|
// is not exactly nice...
|
||||||
|
// We should think of a better way of doing this.
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
// MSVC's vsnprintf is either non-existant (2003) or bugged since it
|
||||||
|
// does not always include a terminating NULL (2005+). To work around
|
||||||
|
// that we fix up the _vsnprintf included. Note that the return value
|
||||||
|
// will still not match C99's specs!
|
||||||
|
inline int vsnprintf_msvc(char *str, size_t size, const char *format, va_list args) {
|
||||||
|
// We do not pass size - 1 here, to ensure we would get the same
|
||||||
|
// return value as when we would use _vsnprintf directly, since
|
||||||
|
// for example Common::String::format relies on this.
|
||||||
|
int retValue = _vsnprintf(str, size, format, args);
|
||||||
|
str[size - 1] = 0;
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define vsnprintf vsnprintf_msvc
|
||||||
|
|
||||||
|
// Visual Studio does not include snprintf in its standard C library.
|
||||||
|
// Instead it includes a function called _snprintf with somewhat
|
||||||
|
// similar semantics. The minor difference is that the return value in
|
||||||
|
// case the formatted string exceeds the buffer size is different.
|
||||||
|
// A much more dangerous one is that _snprintf does not always include
|
||||||
|
// a terminating null (Whoops!). Instead we map to our fixed vsnprintf.
|
||||||
|
inline int snprintf(char *str, size_t size, const char *format, ...) {
|
||||||
|
va_list args;
|
||||||
|
va_start(args, format);
|
||||||
|
int len = vsnprintf(str, size, format, args);
|
||||||
|
va_end(args);
|
||||||
|
return len;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(_WIN32_WCE)
|
#if !defined(_WIN32_WCE)
|
||||||
|
@ -107,21 +139,6 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
|
||||||
// Define scumm_stricmp and scumm_strnicmp
|
|
||||||
//
|
|
||||||
#if defined(_WIN32_WCE) || defined(_MSC_VER)
|
|
||||||
#define scumm_stricmp stricmp
|
|
||||||
#define scumm_strnicmp _strnicmp
|
|
||||||
#define snprintf _snprintf
|
|
||||||
#elif defined(__MINGW32__) || defined(__GP32__) || defined(__DS__)
|
|
||||||
#define scumm_stricmp stricmp
|
|
||||||
#define scumm_strnicmp strnicmp
|
|
||||||
#else
|
|
||||||
#define scumm_stricmp strcasecmp
|
|
||||||
#define scumm_strnicmp strncasecmp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// In the following we configure various targets, in particular those
|
// In the following we configure various targets, in particular those
|
||||||
// which can't use our "configure" tool and hence don't use config.h.
|
// which can't use our "configure" tool and hence don't use config.h.
|
||||||
|
@ -151,88 +168,50 @@
|
||||||
//
|
//
|
||||||
#define SCUMMVM_USE_PRAGMA_PACK
|
#define SCUMMVM_USE_PRAGMA_PACK
|
||||||
|
|
||||||
|
//
|
||||||
|
// Determine the host endianess and whether memory alignment is required.
|
||||||
|
//
|
||||||
|
#if !defined(HAVE_CONFIG_H)
|
||||||
|
|
||||||
#if defined(HAVE_CONFIG_H)
|
#if defined(__DC__) || \
|
||||||
// All settings should have been set in config.h
|
defined(__DS__) || \
|
||||||
|
defined(__GP32__) || \
|
||||||
|
defined(IPHONE) || \
|
||||||
|
defined(__PLAYSTATION2__) || \
|
||||||
|
defined(__PSP__) || \
|
||||||
|
defined(__SYMBIAN32__)
|
||||||
|
|
||||||
#elif defined(__SYMBIAN32__)
|
#define SCUMM_LITTLE_ENDIAN
|
||||||
|
#define SCUMM_NEED_ALIGNMENT
|
||||||
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
#elif defined(_WIN32_WCE) || defined(_MSC_VER) || defined(__MINGW32__)
|
||||||
#define SCUMM_NEED_ALIGNMENT
|
|
||||||
|
|
||||||
#elif defined(_WIN32_WCE)
|
#define SCUMM_LITTLE_ENDIAN
|
||||||
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
#elif defined(__amigaos4__) || defined(__N64__) || defined(__WII__)
|
||||||
|
|
||||||
#elif defined(_MSC_VER)
|
#define SCUMM_BIG_ENDIAN
|
||||||
|
#define SCUMM_NEED_ALIGNMENT
|
||||||
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
#elif defined(SDL_BACKEND)
|
||||||
|
// On SDL based ports, we try to use SDL_BYTEORDER to determine the
|
||||||
|
// endianess. We explicitly do this as the *last* thing we try, so that
|
||||||
|
// platform specific settings have precedence.
|
||||||
|
#include <SDL_endian.h>
|
||||||
|
|
||||||
#elif defined(__MINGW32__)
|
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||||
|
#define SCUMM_LITTLE_ENDIAN
|
||||||
|
#elif SDL_BYTEORDER == SDL_BIG_ENDIAN
|
||||||
|
#define SCUMM_BIG_ENDIAN
|
||||||
|
#else
|
||||||
|
#error Neither SDL_BIG_ENDIAN nor SDL_LIL_ENDIAN is set.
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
|
||||||
|
|
||||||
#elif defined(SDL_BACKEND)
|
|
||||||
/* need this for the SDL_BYTEORDER define */
|
|
||||||
#include <SDL_byteorder.h>
|
|
||||||
|
|
||||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
|
||||||
#elif SDL_BYTEORDER == SDL_BIG_ENDIAN
|
|
||||||
#define SCUMM_BIG_ENDIAN
|
|
||||||
#else
|
#else
|
||||||
#error Neither SDL_BIG_ENDIAN nor SDL_LIL_ENDIAN is set.
|
|
||||||
|
#error No system type defined, host endianess unknown.
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined(__DC__)
|
|
||||||
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
|
||||||
#define SCUMM_NEED_ALIGNMENT
|
|
||||||
|
|
||||||
#elif defined(__GP32__)
|
|
||||||
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
|
||||||
#define SCUMM_NEED_ALIGNMENT
|
|
||||||
|
|
||||||
#elif defined(__PLAYSTATION2__)
|
|
||||||
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
|
||||||
#define SCUMM_NEED_ALIGNMENT
|
|
||||||
|
|
||||||
#elif defined(__N64__)
|
|
||||||
|
|
||||||
#define SCUMM_BIG_ENDIAN
|
|
||||||
#define SCUMM_NEED_ALIGNMENT
|
|
||||||
|
|
||||||
#elif defined(__PSP__)
|
|
||||||
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
|
||||||
#define SCUMM_NEED_ALIGNMENT
|
|
||||||
|
|
||||||
#elif defined(__amigaos4__)
|
|
||||||
|
|
||||||
#define SCUMM_BIG_ENDIAN
|
|
||||||
#define SCUMM_NEED_ALIGNMENT
|
|
||||||
|
|
||||||
#elif defined(__DS__)
|
|
||||||
|
|
||||||
#define SCUMM_NEED_ALIGNMENT
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
|
||||||
|
|
||||||
#elif defined(__WII__)
|
|
||||||
|
|
||||||
#define SCUMM_BIG_ENDIAN
|
|
||||||
#define SCUMM_NEED_ALIGNMENT
|
|
||||||
|
|
||||||
#elif defined(IPHONE)
|
|
||||||
|
|
||||||
#define SCUMM_LITTLE_ENDIAN
|
|
||||||
#define SCUMM_NEED_ALIGNMENT
|
|
||||||
|
|
||||||
|
|
||||||
#else
|
|
||||||
#error No system type defined
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -240,17 +219,7 @@
|
||||||
// Some more system specific settings.
|
// Some more system specific settings.
|
||||||
// TODO/FIXME: All of these should be moved to backend specific files (such as portdefs.h)
|
// TODO/FIXME: All of these should be moved to backend specific files (such as portdefs.h)
|
||||||
//
|
//
|
||||||
#if defined(__SYMBIAN32__)
|
#if defined(DINGUX)
|
||||||
|
|
||||||
#define SMALL_SCREEN_DEVICE
|
|
||||||
|
|
||||||
#elif defined(_WIN32_WCE)
|
|
||||||
|
|
||||||
#if _WIN32_WCE < 300
|
|
||||||
#define SMALL_SCREEN_DEVICE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(DINGUX)
|
|
||||||
|
|
||||||
// Very BAD hack following, used to avoid triggering an assert in uClibc dingux library
|
// Very BAD hack following, used to avoid triggering an assert in uClibc dingux library
|
||||||
// "toupper" when pressing keyboard function keys.
|
// "toupper" when pressing keyboard function keys.
|
||||||
|
@ -309,7 +278,7 @@
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#define NORETURN_PRE __declspec(noreturn)
|
#define NORETURN_PRE __declspec(noreturn)
|
||||||
#else
|
#else
|
||||||
#define NORETURN_PRE
|
#define NORETURN_PRE
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -317,7 +286,7 @@
|
||||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||||
#define NORETURN_POST __attribute__((__noreturn__))
|
#define NORETURN_POST __attribute__((__noreturn__))
|
||||||
#else
|
#else
|
||||||
#define NORETURN_POST
|
#define NORETURN_POST
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -339,87 +308,25 @@
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Typedef our system types
|
// Typedef our system types unless they have already been defined by config.h,
|
||||||
|
// or SCUMMVM_DONT_DEFINE_TYPES is set.
|
||||||
//
|
//
|
||||||
#if !defined(HAVE_CONFIG_H)
|
#if !defined(HAVE_CONFIG_H) && !defined(SCUMMVM_DONT_DEFINE_TYPES)
|
||||||
|
typedef unsigned char byte;
|
||||||
#if defined(__SYMBIAN32__)
|
typedef unsigned char uint8;
|
||||||
|
typedef signed char int8;
|
||||||
// Enable Symbians own datatypes
|
typedef unsigned short uint16;
|
||||||
// This is done for two reasons
|
typedef signed short int16;
|
||||||
// a) uint is already defined by Symbians libc component
|
typedef unsigned int uint32;
|
||||||
// b) Symbian is using its "own" datatyping, and the Scummvm port
|
typedef signed int int32;
|
||||||
// should follow this to ensure the best compability possible.
|
typedef unsigned int uint;
|
||||||
typedef unsigned char byte;
|
|
||||||
|
|
||||||
typedef unsigned char uint8;
|
|
||||||
typedef signed char int8;
|
|
||||||
|
|
||||||
typedef unsigned short int uint16;
|
|
||||||
typedef signed short int int16;
|
|
||||||
|
|
||||||
typedef unsigned long int uint32;
|
|
||||||
typedef signed long int int32;
|
|
||||||
|
|
||||||
#elif defined(__GP32__)
|
|
||||||
|
|
||||||
// Override typenames. uint is already defined by system header files.
|
|
||||||
typedef unsigned char byte;
|
|
||||||
|
|
||||||
typedef unsigned char uint8;
|
|
||||||
typedef signed char int8;
|
|
||||||
|
|
||||||
typedef unsigned short int uint16;
|
|
||||||
typedef signed short int int16;
|
|
||||||
|
|
||||||
typedef unsigned long int uint32;
|
|
||||||
typedef signed long int int32;
|
|
||||||
|
|
||||||
#elif defined(__N64__)
|
|
||||||
|
|
||||||
typedef unsigned char byte;
|
|
||||||
|
|
||||||
typedef unsigned char uint8;
|
|
||||||
typedef signed char int8;
|
|
||||||
|
|
||||||
typedef unsigned short int uint16;
|
|
||||||
typedef signed short int int16;
|
|
||||||
|
|
||||||
typedef unsigned int uint32;
|
|
||||||
typedef signed int int32;
|
|
||||||
|
|
||||||
#elif defined(__DS__)
|
|
||||||
|
|
||||||
// Do nothing, the SDK defines all types we need in nds/ndstypes.h,
|
|
||||||
// which we include in our portsdef.h
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
typedef unsigned char byte;
|
|
||||||
typedef unsigned char uint8;
|
|
||||||
typedef signed char int8;
|
|
||||||
typedef unsigned short uint16;
|
|
||||||
typedef signed short int16;
|
|
||||||
typedef unsigned int uint32;
|
|
||||||
typedef signed int int32;
|
|
||||||
typedef unsigned int uint;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Overlay color type (FIXME: shouldn't be declared here)
|
// Overlay color type (FIXME: shouldn't be declared here)
|
||||||
//
|
//
|
||||||
#if defined(NEWGUI_256)
|
typedef uint16 OverlayColor;
|
||||||
// 256 color only on PalmOS
|
|
||||||
typedef byte OverlayColor;
|
|
||||||
#else
|
|
||||||
// 15/16 bit color mode everywhere else...
|
|
||||||
typedef uint16 OverlayColor;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "common/forbidden.h"
|
#include "common/forbidden.h"
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common/str.h"
|
|
||||||
#include "common/hash-str.h"
|
#include "common/hash-str.h"
|
||||||
#include "common/util.h"
|
#include "common/list.h"
|
||||||
|
|
||||||
#include "common/memorypool.h"
|
#include "common/memorypool.h"
|
||||||
|
#include "common/str.h"
|
||||||
|
#include "common/util.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ String &String::operator=(char c) {
|
||||||
|
|
||||||
String &String::operator+=(const char *str) {
|
String &String::operator+=(const char *str) {
|
||||||
if (_str <= str && str <= _str + _size)
|
if (_str <= str && str <= _str + _size)
|
||||||
return operator+=(Common::String(str));
|
return operator+=(String(str));
|
||||||
|
|
||||||
int len = strlen(str);
|
int len = strlen(str);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
|
@ -270,7 +270,7 @@ String &String::operator+=(const char *str) {
|
||||||
|
|
||||||
String &String::operator+=(const String &str) {
|
String &String::operator+=(const String &str) {
|
||||||
if (&str == this)
|
if (&str == this)
|
||||||
return operator+=(Common::String(str));
|
return operator+=(String(str));
|
||||||
|
|
||||||
int len = str._size;
|
int len = str._size;
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
|
@ -612,7 +612,7 @@ char *trim(char *t) {
|
||||||
return rtrim(ltrim(t));
|
return rtrim(ltrim(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::String lastPathComponent(const Common::String &path, const char sep) {
|
String lastPathComponent(const String &path, const char sep) {
|
||||||
const char *str = path.c_str();
|
const char *str = path.c_str();
|
||||||
const char *last = str + path.size();
|
const char *last = str + path.size();
|
||||||
|
|
||||||
|
@ -622,7 +622,7 @@ Common::String lastPathComponent(const Common::String &path, const char sep) {
|
||||||
|
|
||||||
// Path consisted of only slashes -> return empty string
|
// Path consisted of only slashes -> return empty string
|
||||||
if (last == str)
|
if (last == str)
|
||||||
return Common::String();
|
return String();
|
||||||
|
|
||||||
// Now scan the whole component
|
// Now scan the whole component
|
||||||
const char *first = last - 1;
|
const char *first = last - 1;
|
||||||
|
@ -632,24 +632,26 @@ Common::String lastPathComponent(const Common::String &path, const char sep) {
|
||||||
if (*first == sep)
|
if (*first == sep)
|
||||||
first++;
|
first++;
|
||||||
|
|
||||||
return Common::String(first, last);
|
return String(first, last);
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::String normalizePath(const Common::String &path, const char sep) {
|
String normalizePath(const String &path, const char sep) {
|
||||||
if (path.empty())
|
if (path.empty())
|
||||||
return path;
|
return path;
|
||||||
|
|
||||||
const char *cur = path.c_str();
|
const char *cur = path.c_str();
|
||||||
Common::String result;
|
String result;
|
||||||
|
|
||||||
// If there is a leading slash, preserve that:
|
// If there is a leading slash, preserve that:
|
||||||
if (*cur == sep) {
|
if (*cur == sep) {
|
||||||
result += sep;
|
result += sep;
|
||||||
|
// Skip over multiple leading slashes, so "//" equals "/"
|
||||||
while (*cur == sep)
|
while (*cur == sep)
|
||||||
++cur;
|
++cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scan till the end of the String
|
// Scan for path components till the end of the String
|
||||||
|
List<String> comps;
|
||||||
while (*cur != 0) {
|
while (*cur != 0) {
|
||||||
const char *start = cur;
|
const char *start = cur;
|
||||||
|
|
||||||
|
@ -657,18 +659,16 @@ Common::String normalizePath(const Common::String &path, const char sep) {
|
||||||
while (*cur != sep && *cur != 0)
|
while (*cur != sep && *cur != 0)
|
||||||
cur++;
|
cur++;
|
||||||
|
|
||||||
const Common::String component(start, cur);
|
const String component(start, cur);
|
||||||
|
|
||||||
// Skip empty components and dot components, add all others
|
if (component.empty() || component == ".") {
|
||||||
if (!component.empty() && component != ".") {
|
// Skip empty components and dot components
|
||||||
// Add a separator before the component, unless the result
|
} else if (!comps.empty() && component == ".." && comps.back() != "..") {
|
||||||
// string already ends with one (which happens only if the
|
// If stack is non-empty and top is not "..", remove top
|
||||||
// path *starts* with a separator).
|
comps.pop_back();
|
||||||
if (!result.empty() && result.lastChar() != sep)
|
} else {
|
||||||
result += sep;
|
// Add the component to the stack
|
||||||
|
comps.push_back(component);
|
||||||
// Add the component
|
|
||||||
result += component;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip over separator chars
|
// Skip over separator chars
|
||||||
|
@ -676,6 +676,14 @@ Common::String normalizePath(const Common::String &path, const char sep) {
|
||||||
cur++;
|
cur++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Finally, assemble all components back into a path
|
||||||
|
while (!comps.empty()) {
|
||||||
|
result += comps.front();
|
||||||
|
comps.pop_front();
|
||||||
|
if (!comps.empty())
|
||||||
|
result += sep;
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -749,7 +757,7 @@ String tag2string(uint32 tag) {
|
||||||
if (!isprint((unsigned char)str[i]))
|
if (!isprint((unsigned char)str[i]))
|
||||||
str[i] = '.';
|
str[i] = '.';
|
||||||
}
|
}
|
||||||
return Common::String(str);
|
return String(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t strlcpy(char *dst, const char *src, size_t size) {
|
size_t strlcpy(char *dst, const char *src, size_t size) {
|
||||||
|
@ -833,3 +841,36 @@ size_t strlcat(char *dst, const char *src, size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace Common
|
} // End of namespace Common
|
||||||
|
|
||||||
|
// Portable implementation of stricmp / strcasecmp / strcmpi.
|
||||||
|
// TODO: Rename this to Common::strcasecmp
|
||||||
|
int scumm_stricmp(const char *s1, const char *s2) {
|
||||||
|
byte l1, l2;
|
||||||
|
do {
|
||||||
|
// Don't use ++ inside tolower, in case the macro uses its
|
||||||
|
// arguments more than once.
|
||||||
|
l1 = (byte)*s1++;
|
||||||
|
l1 = tolower(l1);
|
||||||
|
l2 = (byte)*s2++;
|
||||||
|
l2 = tolower(l2);
|
||||||
|
} while (l1 == l2 && l1 != 0);
|
||||||
|
return l1 - l2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Portable implementation of strnicmp / strncasecmp / strncmpi.
|
||||||
|
// TODO: Rename this to Common::strncasecmp
|
||||||
|
int scumm_strnicmp(const char *s1, const char *s2, uint n) {
|
||||||
|
byte l1, l2;
|
||||||
|
do {
|
||||||
|
if (n-- == 0)
|
||||||
|
return 0; // no difference found so far -> signal equality
|
||||||
|
|
||||||
|
// Don't use ++ inside tolower, in case the macro uses its
|
||||||
|
// arguments more than once.
|
||||||
|
l1 = (byte)*s1++;
|
||||||
|
l1 = tolower(l1);
|
||||||
|
l2 = (byte)*s2++;
|
||||||
|
l2 = tolower(l2);
|
||||||
|
} while (l1 == l2 && l1 != 0);
|
||||||
|
return l1 - l2;
|
||||||
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace Common {
|
||||||
* a certain length do we allocate a buffer on the heap.
|
* a certain length do we allocate a buffer on the heap.
|
||||||
*
|
*
|
||||||
* The presence of \0 characters in the string will cause undefined
|
* The presence of \0 characters in the string will cause undefined
|
||||||
* behaviour in some operations.
|
* behavior in some operations.
|
||||||
*/
|
*/
|
||||||
class String {
|
class String {
|
||||||
protected:
|
protected:
|
||||||
|
@ -378,4 +378,7 @@ size_t strlcat(char *dst, const char *src, size_t size);
|
||||||
|
|
||||||
} // End of namespace Common
|
} // End of namespace Common
|
||||||
|
|
||||||
|
extern int scumm_stricmp(const char *s1, const char *s2);
|
||||||
|
extern int scumm_strnicmp(const char *s1, const char *s2, uint n);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -20,34 +20,71 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Disable symbol overrides so that we can use system headers.
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
|
||||||
// FIXME: Necessary for the PS2 port, should get rid of this eventually.
|
#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
|
||||||
#define FORBIDDEN_SYMBOL_ALLOW_ALL
|
#define FORBIDDEN_SYMBOL_EXCEPTION_fputs
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_fflush
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stdout
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
|
||||||
|
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
|
#include "common/events.h"
|
||||||
|
#include "common/fs.h"
|
||||||
|
#include "common/savefile.h"
|
||||||
#include "common/str.h"
|
#include "common/str.h"
|
||||||
|
#include "common/textconsole.h"
|
||||||
|
|
||||||
#ifdef __PLAYSTATION2__
|
#include "backends/audiocd/default/default-audiocd.h"
|
||||||
// for those replaced fopen/fread/etc functions
|
#include "backends/fs/fs-factory.h"
|
||||||
#include "backends/platform/ps2/fileio.h"
|
#include "backends/timer/default/default-timer.h"
|
||||||
|
|
||||||
#define fputs(str, file) ps2_fputs(str, file)
|
|
||||||
#define fflush(a) ps2_fflush(a)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __DS__
|
|
||||||
#include "backends/fs/ds/ds-fs.h"
|
|
||||||
|
|
||||||
#define fputs(str, file) DS::std_fwrite(str, strlen(str), 1, file)
|
|
||||||
#define fflush(file) DS::std_fflush(file)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
OSystem *g_system = 0;
|
OSystem *g_system = 0;
|
||||||
|
|
||||||
OSystem::OSystem() {
|
OSystem::OSystem() {
|
||||||
|
_audiocdManager = 0;
|
||||||
|
_eventManager = 0;
|
||||||
|
_timerManager = 0;
|
||||||
|
_savefileManager = 0;
|
||||||
|
_fsFactory = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSystem::~OSystem() {
|
OSystem::~OSystem() {
|
||||||
|
delete _audiocdManager;
|
||||||
|
_audiocdManager = 0;
|
||||||
|
|
||||||
|
delete _eventManager;
|
||||||
|
_eventManager = 0;
|
||||||
|
|
||||||
|
delete _timerManager;
|
||||||
|
_timerManager = 0;
|
||||||
|
|
||||||
|
delete _savefileManager;
|
||||||
|
_savefileManager = 0;
|
||||||
|
|
||||||
|
delete _fsFactory;
|
||||||
|
_fsFactory = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OSystem::initBackend() {
|
||||||
|
// Verify all managers has been set
|
||||||
|
if (!_audiocdManager)
|
||||||
|
error("Backend failed to instantiate audio CD manager");
|
||||||
|
if (!_eventManager)
|
||||||
|
error("Backend failed to instantiate event manager");
|
||||||
|
if (!_timerManager)
|
||||||
|
error("Backend failed to instantiate timer manager");
|
||||||
|
|
||||||
|
// TODO: We currently don't check _savefileManager, because at least
|
||||||
|
// on the Nintendo DS, it is possible that none is set. That should
|
||||||
|
// probably be treated as "saving is not possible". Or else the NDS
|
||||||
|
// port needs to be changed to always set a _savefileManager
|
||||||
|
// if (!_savefileManager)
|
||||||
|
// error("Backend failed to instantiate savefile manager");
|
||||||
|
|
||||||
|
// TODO: We currently don't check _fsFactory because not all ports
|
||||||
|
// set it.
|
||||||
|
// if (!_fsFactory)
|
||||||
|
// error("Backend failed to instantiate fs factory");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSystem::fatalError() {
|
void OSystem::fatalError() {
|
||||||
|
@ -55,16 +92,41 @@ void OSystem::fatalError() {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FilesystemFactory *OSystem::getFilesystemFactory() {
|
||||||
|
assert(_fsFactory);
|
||||||
|
return _fsFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
Common::SeekableReadStream *OSystem::createConfigReadStream() {
|
||||||
|
Common::FSNode file(getDefaultConfigFileName());
|
||||||
|
return file.createReadStream();
|
||||||
|
}
|
||||||
|
|
||||||
|
Common::WriteStream *OSystem::createConfigWriteStream() {
|
||||||
|
#ifdef __DC__
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
Common::FSNode file(getDefaultConfigFileName());
|
||||||
|
return file.createWriteStream();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
Common::String OSystem::getDefaultConfigFileName() {
|
||||||
|
return "residual.ini";
|
||||||
|
}
|
||||||
|
|
||||||
void OSystem::logMessage(LogMessageType::Type type, const char *message) {
|
void OSystem::logMessage(LogMessageType::Type type, const char *message) {
|
||||||
|
#if !defined(__PLAYSTATION2__) && !defined(__DS__)
|
||||||
FILE *output = 0;
|
FILE *output = 0;
|
||||||
|
|
||||||
if (type == LogMessageType::kDebug)
|
if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
|
||||||
output = stdout;
|
output = stdout;
|
||||||
else
|
else
|
||||||
output = stderr;
|
output = stderr;
|
||||||
|
|
||||||
fputs(message, output);
|
fputs(message, output);
|
||||||
fflush(output);
|
fflush(output);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::String OSystem::getSystemLanguage() const {
|
Common::String OSystem::getSystemLanguage() const {
|
||||||
|
|
154
common/system.h
154
common/system.h
|
@ -73,6 +73,7 @@ struct TimeDate {
|
||||||
namespace LogMessageType {
|
namespace LogMessageType {
|
||||||
|
|
||||||
enum Type {
|
enum Type {
|
||||||
|
kInfo,
|
||||||
kError,
|
kError,
|
||||||
kWarning,
|
kWarning,
|
||||||
kDebug
|
kDebug
|
||||||
|
@ -95,6 +96,72 @@ protected:
|
||||||
OSystem();
|
OSystem();
|
||||||
virtual ~OSystem();
|
virtual ~OSystem();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* @name Module slots
|
||||||
|
*
|
||||||
|
* For backend authors only, the following pointers (= "slots) to various
|
||||||
|
* subsystem managers / factories / etc. can and should be set to
|
||||||
|
* a suitable instance of the respective type.
|
||||||
|
*
|
||||||
|
* For some of the slots, a default instance is set if your backend
|
||||||
|
* does not do so. For details, please look at the documentation of
|
||||||
|
* each slot.
|
||||||
|
*
|
||||||
|
* A backend may setup slot values in its initBackend() method,
|
||||||
|
* its constructor or somewhere in between. But it must a slot's value
|
||||||
|
* no later than in its initBackend() implementation, because
|
||||||
|
* OSystem::initBackend() will create any default instances if
|
||||||
|
* none has been set yet (and for other slots, will verify that
|
||||||
|
* one has been set; if not, an error may be generated).
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* No default value is provided for _audiocdManager by OSystem.
|
||||||
|
* However, BaseBackend::initBackend() does set a default value
|
||||||
|
* if none has been set before.
|
||||||
|
*
|
||||||
|
* @note _audiocdManager is deleted by the OSystem destructor.
|
||||||
|
*/
|
||||||
|
AudioCDManager *_audiocdManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* No default value is provided for _eventManager by OSystem.
|
||||||
|
* However, BaseBackend::initBackend() does set a default value
|
||||||
|
* if none has been set before.
|
||||||
|
*
|
||||||
|
* @note _eventManager is deleted by the OSystem destructor.
|
||||||
|
*/
|
||||||
|
Common::EventManager *_eventManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* No default value is provided for _timerManager by OSystem.
|
||||||
|
*
|
||||||
|
* @note _timerManager is deleted by the OSystem destructor.
|
||||||
|
*/
|
||||||
|
Common::TimerManager *_timerManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* No default value is provided for _savefileManager by OSystem.
|
||||||
|
*
|
||||||
|
* @note _savefileManager is deleted by the OSystem destructor.
|
||||||
|
*/
|
||||||
|
Common::SaveFileManager *_savefileManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* No default value is provided for _fsFactory by OSystem.
|
||||||
|
*
|
||||||
|
* Note that _fsFactory is typically required very early on,
|
||||||
|
* so it usually should be set in the backends constructor or shortly
|
||||||
|
* thereafter, and before initBackend() is called.
|
||||||
|
*
|
||||||
|
* @note _fsFactory is deleted by the OSystem destructor.
|
||||||
|
*/
|
||||||
|
FilesystemFactory *_fsFactory;
|
||||||
|
|
||||||
|
//@}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,7 +172,7 @@ public:
|
||||||
* parent class. They should do so near the end of their own
|
* parent class. They should do so near the end of their own
|
||||||
* implementation.
|
* implementation.
|
||||||
*/
|
*/
|
||||||
virtual void initBackend() { }
|
virtual void initBackend();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows the backend to perform engine specific init.
|
* Allows the backend to perform engine specific init.
|
||||||
|
@ -128,11 +195,19 @@ public:
|
||||||
* - fullscreen mode
|
* - fullscreen mode
|
||||||
* - aspect ration correction
|
* - aspect ration correction
|
||||||
* - a virtual keyboard for text entry (on PDAs)
|
* - a virtual keyboard for text entry (on PDAs)
|
||||||
|
*
|
||||||
|
* One has to distinguish between the *availability* of a feature,
|
||||||
|
* which can be checked using hasFeature(), and its *state*.
|
||||||
|
* For example, the SDL backend *has* the kFeatureFullscreenMode,
|
||||||
|
* so hasFeature returns true for it. On the other hand,
|
||||||
|
* fullscreen mode may be active or not; this can be determined
|
||||||
|
* by checking the state via getFeatureState(). Finally, to
|
||||||
|
* switch between fullscreen and windowed mode, use setFeatureState().
|
||||||
*/
|
*/
|
||||||
enum Feature {
|
enum Feature {
|
||||||
/**
|
/**
|
||||||
* If your backend supports both a windowed and a fullscreen mode,
|
* If supported, this feature flag can be used to switch between
|
||||||
* then this feature flag can be used to switch between the two.
|
* windowed and fullscreen mode.
|
||||||
*/
|
*/
|
||||||
kFeatureFullscreenMode,
|
kFeatureFullscreenMode,
|
||||||
|
|
||||||
|
@ -152,12 +227,24 @@ public:
|
||||||
* phone-like keypad temporarily unmap all user actions which leads to
|
* phone-like keypad temporarily unmap all user actions which leads to
|
||||||
* comfortable word entry. Conversely, when the dialog exits the feature
|
* comfortable word entry. Conversely, when the dialog exits the feature
|
||||||
* is set to false.
|
* is set to false.
|
||||||
|
*
|
||||||
|
* TODO: The word 'beneficial' above is very unclear. Beneficial to
|
||||||
|
* whom and for what??? Just giving an example is not enough.
|
||||||
|
*
|
||||||
* TODO: Fingolfin suggests that the way the feature is used can be
|
* TODO: Fingolfin suggests that the way the feature is used can be
|
||||||
* generalized in this sense: Have a keyboard mapping feature, which the
|
* generalized in this sense: Have a keyboard mapping feature, which the
|
||||||
* engine queries for to assign keys to actions ("Here's my default key
|
* engine queries for to assign keys to actions ("Here's my default key
|
||||||
* map for these actions, what do you want them set to?").
|
* map for these actions, what do you want them set to?").
|
||||||
*/
|
*/
|
||||||
kFeatureDisableKeyFiltering
|
kFeatureDisableKeyFiltering,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The presence of this feature indicates whether the displayLogFile()
|
||||||
|
* call is supported.
|
||||||
|
*
|
||||||
|
* This feature has no associated state.
|
||||||
|
*/
|
||||||
|
kFeatureDisplayLogFile
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -379,13 +466,17 @@ public:
|
||||||
* Return the timer manager singleton. For more information, refer
|
* Return the timer manager singleton. For more information, refer
|
||||||
* to the TimerManager documentation.
|
* to the TimerManager documentation.
|
||||||
*/
|
*/
|
||||||
virtual Common::TimerManager *getTimerManager() = 0;
|
inline Common::TimerManager *getTimerManager() {
|
||||||
|
return _timerManager;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the event manager singleton. For more information, refer
|
* Return the event manager singleton. For more information, refer
|
||||||
* to the EventManager documentation.
|
* to the EventManager documentation.
|
||||||
*/
|
*/
|
||||||
virtual Common::EventManager *getEventManager() = 0;
|
inline Common::EventManager *getEventManager() {
|
||||||
|
return _eventManager;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register hardware keys with keymapper
|
* Register hardware keys with keymapper
|
||||||
|
@ -475,7 +566,9 @@ public:
|
||||||
* Return the audio cd manager. For more information, refer to the
|
* Return the audio cd manager. For more information, refer to the
|
||||||
* AudioCDManager documentation.
|
* AudioCDManager documentation.
|
||||||
*/
|
*/
|
||||||
virtual AudioCDManager *getAudioCDManager() = 0;
|
inline AudioCDManager *getAudioCDManager() {
|
||||||
|
return _audiocdManager;
|
||||||
|
}
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
@ -509,7 +602,8 @@ public:
|
||||||
* rectangle over the regular screen content; or in a message box beneath
|
* rectangle over the regular screen content; or in a message box beneath
|
||||||
* it; etc.).
|
* it; etc.).
|
||||||
*
|
*
|
||||||
* Currently, only pure ASCII messages can be expected to show correctly.
|
* The message is expected to be provided in the current TranslationManager
|
||||||
|
* charset.
|
||||||
*
|
*
|
||||||
* @note There is a default implementation in BaseBackend which uses a
|
* @note There is a default implementation in BaseBackend which uses a
|
||||||
* TimedMessageDialog to display the message. Hence implementing
|
* TimedMessageDialog to display the message. Hence implementing
|
||||||
|
@ -524,14 +618,16 @@ public:
|
||||||
* and other modifiable persistent game data. For more information,
|
* and other modifiable persistent game data. For more information,
|
||||||
* refer to the SaveFileManager documentation.
|
* refer to the SaveFileManager documentation.
|
||||||
*/
|
*/
|
||||||
virtual Common::SaveFileManager *getSavefileManager() = 0;
|
inline Common::SaveFileManager *getSavefileManager() {
|
||||||
|
return _savefileManager;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the FilesystemFactory object, depending on the current architecture.
|
* Returns the FilesystemFactory object, depending on the current architecture.
|
||||||
*
|
*
|
||||||
* @return the FSNode factory for the current architecture
|
* @return the FSNode factory for the current architecture
|
||||||
*/
|
*/
|
||||||
virtual FilesystemFactory *getFilesystemFactory() = 0;
|
virtual FilesystemFactory *getFilesystemFactory();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add system specific Common::Archive objects to the given SearchSet.
|
* Add system specific Common::Archive objects to the given SearchSet.
|
||||||
|
@ -550,7 +646,7 @@ public:
|
||||||
* ReadStream instance. It is the callers responsiblity to delete
|
* ReadStream instance. It is the callers responsiblity to delete
|
||||||
* the stream after use.
|
* the stream after use.
|
||||||
*/
|
*/
|
||||||
virtual Common::SeekableReadStream *createConfigReadStream() = 0;
|
virtual Common::SeekableReadStream *createConfigReadStream();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open the default config file for writing, by returning a suitable
|
* Open the default config file for writing, by returning a suitable
|
||||||
|
@ -559,7 +655,14 @@ public:
|
||||||
*
|
*
|
||||||
* May return 0 to indicate that writing to config file is not possible.
|
* May return 0 to indicate that writing to config file is not possible.
|
||||||
*/
|
*/
|
||||||
virtual Common::WriteStream *createConfigWriteStream() = 0;
|
virtual Common::WriteStream *createConfigWriteStream();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the default file name (or even path) where the user configuration
|
||||||
|
* of ScummVM will be saved.
|
||||||
|
* Note that not all ports may use this.
|
||||||
|
*/
|
||||||
|
virtual Common::String getDefaultConfigFileName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs a given message.
|
* Logs a given message.
|
||||||
|
@ -575,6 +678,33 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void logMessage(LogMessageType::Type type, const char *message);
|
virtual void logMessage(LogMessageType::Type type, const char *message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the log file in a way that allows the user to review it,
|
||||||
|
* and possibly email it (or parts of it) to the ScummVM team,
|
||||||
|
* e.g. as part of a bug report.
|
||||||
|
*
|
||||||
|
* On a desktop operating system, this would typically launch
|
||||||
|
* some kind of (external) text editor / viewer.
|
||||||
|
* On a phone, it might also cause a context switch to another
|
||||||
|
* application. Finally, on some ports, it might not be supported
|
||||||
|
* at all, and so do nothing.
|
||||||
|
*
|
||||||
|
* The kFeatureDisplayLogFile feature flag can be used to
|
||||||
|
* test whether this call has been implemented by the active
|
||||||
|
* backend.
|
||||||
|
*
|
||||||
|
* @return true if all seems to have gone fine, false if an error occurred
|
||||||
|
*
|
||||||
|
* @note An error could mean that the log file did not exist,
|
||||||
|
* or the editor could not launch. However, a return value of true does
|
||||||
|
* not guarantee that the user actually will see the log file.
|
||||||
|
*
|
||||||
|
* @note It is up to the backend to ensure that the system is in a state
|
||||||
|
* that allows the user to actually see the displayed log files. This
|
||||||
|
* might for example require leaving fullscreen mode.
|
||||||
|
*/
|
||||||
|
virtual bool displayLogFile() { return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the locale of the system.
|
* Returns the locale of the system.
|
||||||
*
|
*
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
|
||||||
|
|
||||||
#include "common/textconsole.h"
|
#include "common/textconsole.h"
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
#include "common/str.h"
|
#include "common/str.h"
|
||||||
|
|
|
@ -349,7 +349,7 @@ typedef struct {
|
||||||
z_stream stream; /* zLib stream structure for inflate */
|
z_stream stream; /* zLib stream structure for inflate */
|
||||||
|
|
||||||
uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/
|
uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/
|
||||||
uLong stream_initialised; /* flag set if stream structure is initialised*/
|
uLong stream_initialized; /* flag set if stream structure is initialized*/
|
||||||
|
|
||||||
uLong offset_local_extrafield;/* offset of the local extra field */
|
uLong offset_local_extrafield;/* offset of the local extra field */
|
||||||
uInt size_local_extrafield;/* size of the local extra field */
|
uInt size_local_extrafield;/* size of the local extra field */
|
||||||
|
@ -1073,7 +1073,7 @@ int unzOpenCurrentFile (unzFile file) {
|
||||||
return UNZ_INTERNALERROR;
|
return UNZ_INTERNALERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
pfile_in_zip_read_info->stream_initialised=0;
|
pfile_in_zip_read_info->stream_initialized=0;
|
||||||
|
|
||||||
if ((s->cur_file_info.compression_method!=0) &&
|
if ((s->cur_file_info.compression_method!=0) &&
|
||||||
(s->cur_file_info.compression_method!=Z_DEFLATED))
|
(s->cur_file_info.compression_method!=Z_DEFLATED))
|
||||||
|
@ -1096,7 +1096,7 @@ int unzOpenCurrentFile (unzFile file) {
|
||||||
|
|
||||||
err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
|
err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
|
||||||
if (err == Z_OK)
|
if (err == Z_OK)
|
||||||
pfile_in_zip_read_info->stream_initialised = 1;
|
pfile_in_zip_read_info->stream_initialized = 1;
|
||||||
/* windowBits is passed < 0 to tell that there is no zlib header.
|
/* windowBits is passed < 0 to tell that there is no zlib header.
|
||||||
* Note that in this case inflate *requires* an extra "dummy" byte
|
* Note that in this case inflate *requires* an extra "dummy" byte
|
||||||
* after the compressed stream in order to complete decompression and
|
* after the compressed stream in order to complete decompression and
|
||||||
|
@ -1365,7 +1365,7 @@ int unzCloseCurrentFile(unzFile file) {
|
||||||
if (pfile_in_zip_read_info->crc32_data != pfile_in_zip_read_info->crc32_wait)
|
if (pfile_in_zip_read_info->crc32_data != pfile_in_zip_read_info->crc32_wait)
|
||||||
err=UNZ_CRCERROR;
|
err=UNZ_CRCERROR;
|
||||||
}
|
}
|
||||||
if (pfile_in_zip_read_info->stream_initialised)
|
if (pfile_in_zip_read_info->stream_initialized)
|
||||||
inflateEnd(&pfile_in_zip_read_info->stream);
|
inflateEnd(&pfile_in_zip_read_info->stream);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1373,7 +1373,7 @@ int unzCloseCurrentFile(unzFile file) {
|
||||||
free(pfile_in_zip_read_info->read_buffer);
|
free(pfile_in_zip_read_info->read_buffer);
|
||||||
pfile_in_zip_read_info->read_buffer = NULL;
|
pfile_in_zip_read_info->read_buffer = NULL;
|
||||||
|
|
||||||
pfile_in_zip_read_info->stream_initialised = 0;
|
pfile_in_zip_read_info->stream_initialized = 0;
|
||||||
free(pfile_in_zip_read_info);
|
free(pfile_in_zip_read_info);
|
||||||
|
|
||||||
s->pfile_in_zip_read=NULL;
|
s->pfile_in_zip_read=NULL;
|
||||||
|
|
|
@ -212,6 +212,7 @@ const PlatformDescription g_platforms[] = {
|
||||||
{ "playstation", "psx", "psx", "Sony PlayStation", kPlatformPSX },
|
{ "playstation", "psx", "psx", "Sony PlayStation", kPlatformPSX },
|
||||||
{ "playstation2", "ps2", "ps2", "Sony PlayStation 2", kPlatformPS2 },
|
{ "playstation2", "ps2", "ps2", "Sony PlayStation 2", kPlatformPS2 },
|
||||||
{ "cdi", "cdi", "cdi", "Philips CD-i", kPlatformCDi },
|
{ "cdi", "cdi", "cdi", "Philips CD-i", kPlatformCDi },
|
||||||
|
{ "ios", "ios", "ios", "Apple iOS", kPlatformIOS },
|
||||||
|
|
||||||
{ 0, 0, 0, "Default", kPlatformUnknown }
|
{ 0, 0, 0, "Default", kPlatformUnknown }
|
||||||
};
|
};
|
||||||
|
|
|
@ -177,6 +177,7 @@ enum Platform {
|
||||||
kPlatformPSX,
|
kPlatformPSX,
|
||||||
kPlatformPS2,
|
kPlatformPS2,
|
||||||
kPlatformCDi,
|
kPlatformCDi,
|
||||||
|
kPlatformIOS,
|
||||||
|
|
||||||
kPlatformUnknown = -1
|
kPlatformUnknown = -1
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,9 +22,7 @@
|
||||||
|
|
||||||
// FIXME: Avoid using fprintf
|
// FIXME: Avoid using fprintf
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
|
#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
|
||||||
// FIXME: Avoid using vfprintf
|
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_vfprintf
|
|
||||||
|
|
||||||
|
|
||||||
#include "common/xmlparser.h"
|
#include "common/xmlparser.h"
|
||||||
|
@ -83,7 +81,7 @@ void XMLParser::close() {
|
||||||
_stream = 0;
|
_stream = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool XMLParser::parserError(const char *errorString, ...) {
|
bool XMLParser::parserError(const Common::String &errStr) {
|
||||||
_state = kParserError;
|
_state = kParserError;
|
||||||
|
|
||||||
const int startPosition = _stream->pos();
|
const int startPosition = _stream->pos();
|
||||||
|
@ -134,12 +132,7 @@ bool XMLParser::parserError(const char *errorString, ...) {
|
||||||
fprintf(stderr, "%c", _stream->readByte());
|
fprintf(stderr, "%c", _stream->readByte());
|
||||||
|
|
||||||
fprintf(stderr, "\n\nParser error: ");
|
fprintf(stderr, "\n\nParser error: ");
|
||||||
|
fprintf(stderr, "%s", errStr.c_str());
|
||||||
va_list args;
|
|
||||||
va_start(args, errorString);
|
|
||||||
vfprintf(stderr, errorString, args);
|
|
||||||
va_end(args);
|
|
||||||
|
|
||||||
fprintf(stderr, "\n\n");
|
fprintf(stderr, "\n\n");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -181,16 +174,16 @@ bool XMLParser::parseActiveKey(bool closed) {
|
||||||
|
|
||||||
for (List<XMLKeyLayout::XMLKeyProperty>::const_iterator i = key->layout->properties.begin(); i != key->layout->properties.end(); ++i) {
|
for (List<XMLKeyLayout::XMLKeyProperty>::const_iterator i = key->layout->properties.begin(); i != key->layout->properties.end(); ++i) {
|
||||||
if (i->required && !localMap.contains(i->name))
|
if (i->required && !localMap.contains(i->name))
|
||||||
return parserError("Missing required property '%s' inside key '%s'", i->name.c_str(), key->name.c_str());
|
return parserError("Missing required property '" + i->name + "' inside key '" + key->name + "'");
|
||||||
else if (localMap.contains(i->name))
|
else if (localMap.contains(i->name))
|
||||||
keyCount--;
|
keyCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyCount > 0)
|
if (keyCount > 0)
|
||||||
return parserError("Unhandled property inside key '%s'.", key->name.c_str());
|
return parserError("Unhandled property inside key '" + key->name + "'.");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return parserError("Unexpected key in the active scope ('%s').", key->name.c_str());
|
return parserError("Unexpected key in the active scope ('" + key->name + "').");
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if any of the parents must be ignored.
|
// check if any of the parents must be ignored.
|
||||||
|
@ -205,7 +198,7 @@ bool XMLParser::parseActiveKey(bool closed) {
|
||||||
// when keyCallback() fails, a parserError() must be set.
|
// when keyCallback() fails, a parserError() must be set.
|
||||||
// We set it manually in that case.
|
// We set it manually in that case.
|
||||||
if (_state != kParserError)
|
if (_state != kParserError)
|
||||||
parserError("Unhandled exception when parsing '%s' key.", key->name.c_str());
|
parserError("Unhandled exception when parsing '" + key->name + "' key.");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -395,7 +388,7 @@ bool XMLParser::parse() {
|
||||||
case kParserNeedPropertyName:
|
case kParserNeedPropertyName:
|
||||||
if (activeClosure) {
|
if (activeClosure) {
|
||||||
if (!closeKey()) {
|
if (!closeKey()) {
|
||||||
parserError("Missing data when closing key '%s'.", _activeKey.top()->name.c_str());
|
parserError("Missing data when closing key '" + _activeKey.top()->name + "'.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -274,7 +274,7 @@ protected:
|
||||||
* Parser error always returns "false" so we can pass the return value
|
* Parser error always returns "false" so we can pass the return value
|
||||||
* directly and break down the parsing.
|
* directly and break down the parsing.
|
||||||
*/
|
*/
|
||||||
bool parserError(const char *errorString, ...) GCC_PRINTF(2, 3);
|
bool parserError(const Common::String &errStr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Skips spaces/whitelines etc.
|
* Skips spaces/whitelines etc.
|
||||||
|
|
|
@ -47,6 +47,8 @@
|
||||||
<Unit filename="..\msvc.h" />
|
<Unit filename="..\msvc.h" />
|
||||||
<Unit filename="..\visualstudio.cpp" />
|
<Unit filename="..\visualstudio.cpp" />
|
||||||
<Unit filename="..\visualstudio.h" />
|
<Unit filename="..\visualstudio.h" />
|
||||||
|
<Unit filename="..\xcode.cpp" />
|
||||||
|
<Unit filename="..\xcode.h" />
|
||||||
<Extensions>
|
<Extensions>
|
||||||
<code_completion />
|
<code_completion />
|
||||||
<envvars />
|
<envvars />
|
||||||
|
|
|
@ -28,11 +28,12 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "create_project.h"
|
#include "create_project.h"
|
||||||
#include "codeblocks.h"
|
|
||||||
|
|
||||||
|
#include "codeblocks.h"
|
||||||
#include "msvc.h"
|
#include "msvc.h"
|
||||||
#include "visualstudio.h"
|
#include "visualstudio.h"
|
||||||
#include "msbuild.h"
|
#include "msbuild.h"
|
||||||
|
#include "xcode.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -107,13 +108,14 @@ typedef std::list<FSNode> FileList;
|
||||||
enum ProjectType {
|
enum ProjectType {
|
||||||
kProjectNone,
|
kProjectNone,
|
||||||
kProjectCodeBlocks,
|
kProjectCodeBlocks,
|
||||||
kProjectMSVC
|
kProjectMSVC,
|
||||||
|
kProjectXcode
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
#ifndef USE_WIN32_API
|
#ifndef USE_WIN32_API
|
||||||
// Initialize random number generator for UUID creation
|
// Initialize random number generator for UUID creation
|
||||||
std::srand(std::time(0));
|
std::srand((uint)std::time(0));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
|
@ -175,6 +177,14 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
projectType = kProjectMSVC;
|
projectType = kProjectMSVC;
|
||||||
|
|
||||||
|
} else if (!std::strcmp(argv[i], "--xcode")) {
|
||||||
|
if (projectType != kProjectNone) {
|
||||||
|
std::cerr << "ERROR: You cannot pass more than one project type!\n";
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
projectType = kProjectXcode;
|
||||||
|
|
||||||
} else if (!std::strcmp(argv[i], "--msvc-version")) {
|
} else if (!std::strcmp(argv[i], "--msvc-version")) {
|
||||||
if (i + 1 >= argc) {
|
if (i + 1 >= argc) {
|
||||||
std::cerr << "ERROR: Missing \"version\" parameter for \"--msvc-version\"!\n";
|
std::cerr << "ERROR: Missing \"version\" parameter for \"--msvc-version\"!\n";
|
||||||
|
@ -463,6 +473,31 @@ int main(int argc, char *argv[]) {
|
||||||
provider = new CreateProjectTool::MSBuildProvider(globalWarnings, projectWarnings, msvcVersion);
|
provider = new CreateProjectTool::MSBuildProvider(globalWarnings, projectWarnings, msvcVersion);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case kProjectXcode:
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Xcode is also using GCC behind the scenes. See Code::Blocks comment
|
||||||
|
// for info on all warnings
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
globalWarnings.push_back("-Wall");
|
||||||
|
globalWarnings.push_back("-Wno-long-long");
|
||||||
|
globalWarnings.push_back("-Wno-multichar");
|
||||||
|
globalWarnings.push_back("-Wno-unknown-pragmas");
|
||||||
|
globalWarnings.push_back("-Wno-reorder");
|
||||||
|
globalWarnings.push_back("-Wpointer-arith");
|
||||||
|
globalWarnings.push_back("-Wcast-qual");
|
||||||
|
globalWarnings.push_back("-Wcast-align");
|
||||||
|
globalWarnings.push_back("-Wshadow");
|
||||||
|
globalWarnings.push_back("-Wimplicit");
|
||||||
|
globalWarnings.push_back("-Wnon-virtual-dtor");
|
||||||
|
globalWarnings.push_back("-Wwrite-strings");
|
||||||
|
// The following are not warnings at all... We should consider adding them to
|
||||||
|
// a different list of parameters.
|
||||||
|
globalWarnings.push_back("-fno-exceptions");
|
||||||
|
globalWarnings.push_back("-fcheck-new");
|
||||||
|
|
||||||
|
provider = new CreateProjectTool::XCodeProvider(globalWarnings, projectWarnings);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
provider->createProject(setup);
|
provider->createProject(setup);
|
||||||
|
@ -501,6 +536,7 @@ void displayHelp(const char *exe) {
|
||||||
"Project specific settings:\n"
|
"Project specific settings:\n"
|
||||||
" --codeblock build Code::Blocks project files\n"
|
" --codeblock build Code::Blocks project files\n"
|
||||||
" --msvc build Visual Studio project files\n"
|
" --msvc build Visual Studio project files\n"
|
||||||
|
" --xcode build XCode project files\n"
|
||||||
" --file-prefix prefix allow overwriting of relative file prefix in the\n"
|
" --file-prefix prefix allow overwriting of relative file prefix in the\n"
|
||||||
" MSVC project files. By default the prefix is the\n"
|
" MSVC project files. By default the prefix is the\n"
|
||||||
" \"path\\to\\source\" argument\n"
|
" \"path\\to\\source\" argument\n"
|
||||||
|
@ -636,7 +672,7 @@ bool setEngineBuildState(const std::string &name, EngineDescList &engines, bool
|
||||||
if (engine != engines.end()) {
|
if (engine != engines.end()) {
|
||||||
engine->enable = enable;
|
engine->enable = enable;
|
||||||
|
|
||||||
// When we disable an einge, we also need to disable all the sub engines.
|
// When we disable an engine, we also need to disable all the sub engines.
|
||||||
if (!enable && !engine->subEngines.empty()) {
|
if (!enable && !engine->subEngines.empty()) {
|
||||||
for (StringList::const_iterator j = engine->subEngines.begin(); j != engine->subEngines.end(); ++j) {
|
for (StringList::const_iterator j = engine->subEngines.begin(); j != engine->subEngines.end(); ++j) {
|
||||||
EngineDescList::iterator subEngine = std::find(engines.begin(), engines.end(), *j);
|
EngineDescList::iterator subEngine = std::find(engines.begin(), engines.end(), *j);
|
||||||
|
|
|
@ -6,11 +6,17 @@ MODULE_OBJS := \
|
||||||
codeblocks.o \
|
codeblocks.o \
|
||||||
msvc.o \
|
msvc.o \
|
||||||
visualstudio.o \
|
visualstudio.o \
|
||||||
msbuild.o
|
msbuild.o \
|
||||||
|
xcode.o
|
||||||
|
|
||||||
# Set the name of the executable
|
# Set the name of the executable
|
||||||
TOOL_EXECUTABLE := create_project
|
TOOL_EXECUTABLE := create_project
|
||||||
|
|
||||||
|
# Set custom build flags for create_project.o: It uses C++ iostreams,
|
||||||
|
# which make use of global constructors. So we don't want warnings for
|
||||||
|
# that.
|
||||||
|
$(srcdir)/devtools/create_project/create_project.o: CXXFLAGS:=$(filter-out -Wglobal-constructors,$(CXXFLAGS))
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include $(srcdir)/rules.mk
|
include $(srcdir)/rules.mk
|
||||||
|
|
||||||
|
|
|
@ -373,6 +373,7 @@ void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, b
|
||||||
"\t\t\t<StringPooling>true</StringPooling>\n"
|
"\t\t\t<StringPooling>true</StringPooling>\n"
|
||||||
"\t\t\t<BufferSecurityCheck>false</BufferSecurityCheck>\n"
|
"\t\t\t<BufferSecurityCheck>false</BufferSecurityCheck>\n"
|
||||||
"\t\t\t<DebugInformationFormat></DebugInformationFormat>\n"
|
"\t\t\t<DebugInformationFormat></DebugInformationFormat>\n"
|
||||||
|
"\t\t\t<RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n"
|
||||||
"\t\t\t<EnablePREfast>" << (enableAnalysis ? "true" : "false") << "</EnablePREfast>\n"
|
"\t\t\t<EnablePREfast>" << (enableAnalysis ? "true" : "false") << "</EnablePREfast>\n"
|
||||||
"\t\t</ClCompile>\n"
|
"\t\t</ClCompile>\n"
|
||||||
"\t\t<Link>\n"
|
"\t\t<Link>\n"
|
||||||
|
|
|
@ -58,10 +58,12 @@
|
||||||
<TargetMachine>MachineX86</TargetMachine>
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc10\
|
<Command>@echo off
|
||||||
|
xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc10\
|
||||||
xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc9\
|
xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc9\
|
||||||
xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc8\
|
xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc8\
|
||||||
xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\</Command>
|
xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\
|
||||||
|
xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\iphone\</Command>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
@ -98,6 +100,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\</Command>
|
||||||
<ClCompile Include="..\msbuild.cpp" />
|
<ClCompile Include="..\msbuild.cpp" />
|
||||||
<ClCompile Include="..\msvc.cpp" />
|
<ClCompile Include="..\msvc.cpp" />
|
||||||
<ClCompile Include="..\visualstudio.cpp" />
|
<ClCompile Include="..\visualstudio.cpp" />
|
||||||
|
<ClCompile Include="..\xcode.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\codeblocks.h" />
|
<ClInclude Include="..\codeblocks.h" />
|
||||||
|
@ -106,6 +109,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\</Command>
|
||||||
<ClInclude Include="..\msbuild.h" />
|
<ClInclude Include="..\msbuild.h" />
|
||||||
<ClInclude Include="..\msvc.h" />
|
<ClInclude Include="..\msvc.h" />
|
||||||
<ClInclude Include="..\visualstudio.h" />
|
<ClInclude Include="..\visualstudio.h" />
|
||||||
|
<ClInclude Include="..\xcode.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\scripts\installer.vbs" />
|
<None Include="..\scripts\installer.vbs" />
|
||||||
|
|
|
@ -27,6 +27,9 @@
|
||||||
<ClInclude Include="..\visualstudio.h">
|
<ClInclude Include="..\visualstudio.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\xcode.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="..\config.h">
|
<ClInclude Include="..\config.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -47,6 +50,9 @@
|
||||||
<ClCompile Include="..\visualstudio.cpp">
|
<ClCompile Include="..\visualstudio.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\xcode.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\scripts\prebuild.cmd">
|
<None Include="..\scripts\prebuild.cmd">
|
||||||
|
|
|
@ -184,6 +184,10 @@
|
||||||
RelativePath="..\visualstudio.cpp"
|
RelativePath="..\visualstudio.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\xcode.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Header Files"
|
Name="Header Files"
|
||||||
|
@ -214,6 +218,10 @@
|
||||||
RelativePath="..\visualstudio.h"
|
RelativePath="..\visualstudio.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\xcode.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Scripts"
|
Name="Scripts"
|
||||||
|
|
|
@ -185,6 +185,10 @@
|
||||||
RelativePath="..\visualstudio.cpp"
|
RelativePath="..\visualstudio.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\xcode.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Header Files"
|
Name="Header Files"
|
||||||
|
@ -215,6 +219,10 @@
|
||||||
RelativePath="..\visualstudio.h"
|
RelativePath="..\visualstudio.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\xcode.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Scripts"
|
Name="Scripts"
|
||||||
|
|
|
@ -23,19 +23,19 @@ if "%~5"=="" goto error_installer
|
||||||
echo Copying data files
|
echo Copying data files
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
xcopy /F /Y "%~1/AUTHORS" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/AUTHORS" %~2 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~1/COPYING.GPL" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/COPYING.GPL" %~2 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~1/COPYING" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/COPYING" %~2 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~1/COPYING.LGPL" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/COPYING.LGPL" %~2 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~1/COPYRIGHT" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/COPYRIGHT" %~2 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~1/NEWS" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/NEWS" %~2 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~1/README" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/README" %~2 1>NUL 2>&1
|
||||||
|
|
||||||
xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/gui/themes/*.zip" %~2 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1
|
REM xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 1>NUL 2>&1
|
||||||
|
|
||||||
xcopy /F /Y "%~4/lib/%~3/SDL.dll" "%~2" 1>NUL 2>&1
|
xcopy /F /Y "%~4/lib/%~3/SDL.dll" "%~2" 1>NUL 2>&1
|
||||||
xcopy /F /Y "%~4/README-SDL" "%~2" 1>NUL 2>&1
|
xcopy /F /Y "%~4/README-SDL" "%~2" 1>NUL 2>&1
|
||||||
|
|
|
@ -269,6 +269,7 @@ void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelea
|
||||||
"\t\tStringPooling=\"true\"\n"
|
"\t\tStringPooling=\"true\"\n"
|
||||||
"\t\tBufferSecurityCheck=\"false\"\n"
|
"\t\tBufferSecurityCheck=\"false\"\n"
|
||||||
"\t\tDebugInformationFormat=\"0\"\n"
|
"\t\tDebugInformationFormat=\"0\"\n"
|
||||||
|
"\t\tRuntimeLibrary=\"0\"\n"
|
||||||
"\t\tAdditionalOption=\"" << (enableAnalysis ? "/analyze" : "") << "\"\n"
|
"\t\tAdditionalOption=\"" << (enableAnalysis ? "/analyze" : "") << "\"\n"
|
||||||
"\t/>\n"
|
"\t/>\n"
|
||||||
"\t<Tool\n"
|
"\t<Tool\n"
|
||||||
|
|
|
@ -0,0 +1,255 @@
|
||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 46;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
F9A66C691396D4DF00CEE494 /* codeblocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C5F1396D4DF00CEE494 /* codeblocks.cpp */; };
|
||||||
|
F9A66C6A1396D4DF00CEE494 /* create_project.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C621396D4DF00CEE494 /* create_project.cpp */; };
|
||||||
|
F9A66C6B1396D4DF00CEE494 /* msbuild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C651396D4DF00CEE494 /* msbuild.cpp */; };
|
||||||
|
F9A66C6C1396D4DF00CEE494 /* msvc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C671396D4DF00CEE494 /* msvc.cpp */; };
|
||||||
|
F9A66C6F1396D4E800CEE494 /* visualstudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C6D1396D4E800CEE494 /* visualstudio.cpp */; };
|
||||||
|
F9A66C871396E2F500CEE494 /* xcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C861396E2F500CEE494 /* xcode.cpp */; };
|
||||||
|
F9A66C91139704A400CEE494 /* create_project in CopyFiles */ = {isa = PBXBuildFile; fileRef = F9A66C271396D36100CEE494 /* create_project */; };
|
||||||
|
F9BA99141398064E00C276C2 /* create_project in CopyFiles */ = {isa = PBXBuildFile; fileRef = F9A66C271396D36100CEE494 /* create_project */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
F9A66C251396D36100CEE494 /* CopyFiles */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 12;
|
||||||
|
dstPath = ../../../../../dists/iphone;
|
||||||
|
dstSubfolderSpec = 16;
|
||||||
|
files = (
|
||||||
|
F9A66C91139704A400CEE494 /* create_project in CopyFiles */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
F9BA99131398063A00C276C2 /* CopyFiles */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = ../../../../../dists/macosx;
|
||||||
|
dstSubfolderSpec = 16;
|
||||||
|
files = (
|
||||||
|
F9BA99141398064E00C276C2 /* create_project in CopyFiles */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
F9A66C271396D36100CEE494 /* create_project */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = create_project; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
F9A66C491396D47500CEE494 /* installer.vbs */ = {isa = PBXFileReference; lastKnownFileType = text; name = installer.vbs; path = ../scripts/installer.vbs; sourceTree = "<group>"; };
|
||||||
|
F9A66C4A1396D47500CEE494 /* postbuild.cmd */ = {isa = PBXFileReference; lastKnownFileType = text; name = postbuild.cmd; path = ../scripts/postbuild.cmd; sourceTree = "<group>"; };
|
||||||
|
F9A66C4B1396D47500CEE494 /* prebuild.cmd */ = {isa = PBXFileReference; lastKnownFileType = text; name = prebuild.cmd; path = ../scripts/prebuild.cmd; sourceTree = "<group>"; };
|
||||||
|
F9A66C4C1396D47500CEE494 /* revision.vbs */ = {isa = PBXFileReference; lastKnownFileType = text; name = revision.vbs; path = ../scripts/revision.vbs; sourceTree = "<group>"; };
|
||||||
|
F9A66C5F1396D4DF00CEE494 /* codeblocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = codeblocks.cpp; path = ../codeblocks.cpp; sourceTree = "<group>"; };
|
||||||
|
F9A66C601396D4DF00CEE494 /* codeblocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = codeblocks.h; path = ../codeblocks.h; sourceTree = "<group>"; };
|
||||||
|
F9A66C611396D4DF00CEE494 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../config.h; sourceTree = "<group>"; };
|
||||||
|
F9A66C621396D4DF00CEE494 /* create_project.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = create_project.cpp; path = ../create_project.cpp; sourceTree = "<group>"; };
|
||||||
|
F9A66C631396D4DF00CEE494 /* create_project.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = create_project.h; path = ../create_project.h; sourceTree = "<group>"; };
|
||||||
|
F9A66C641396D4DF00CEE494 /* module.mk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = module.mk; path = ../module.mk; sourceTree = "<group>"; };
|
||||||
|
F9A66C651396D4DF00CEE494 /* msbuild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = msbuild.cpp; path = ../msbuild.cpp; sourceTree = "<group>"; };
|
||||||
|
F9A66C661396D4DF00CEE494 /* msbuild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msbuild.h; path = ../msbuild.h; sourceTree = "<group>"; };
|
||||||
|
F9A66C671396D4DF00CEE494 /* msvc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = msvc.cpp; path = ../msvc.cpp; sourceTree = "<group>"; };
|
||||||
|
F9A66C681396D4DF00CEE494 /* msvc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msvc.h; path = ../msvc.h; sourceTree = "<group>"; };
|
||||||
|
F9A66C6D1396D4E800CEE494 /* visualstudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = visualstudio.cpp; path = ../visualstudio.cpp; sourceTree = "<group>"; };
|
||||||
|
F9A66C6E1396D4E800CEE494 /* visualstudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = visualstudio.h; path = ../visualstudio.h; sourceTree = "<group>"; };
|
||||||
|
F9A66C841396E2D800CEE494 /* xcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xcode.h; path = ../xcode.h; sourceTree = "<group>"; };
|
||||||
|
F9A66C861396E2F500CEE494 /* xcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xcode.cpp; path = ../xcode.cpp; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
F9A66C241396D36100CEE494 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
F9A66C1C1396D36100CEE494 = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F9A66C861396E2F500CEE494 /* xcode.cpp */,
|
||||||
|
F9A66C841396E2D800CEE494 /* xcode.h */,
|
||||||
|
F9A66C6D1396D4E800CEE494 /* visualstudio.cpp */,
|
||||||
|
F9A66C6E1396D4E800CEE494 /* visualstudio.h */,
|
||||||
|
F9A66C5F1396D4DF00CEE494 /* codeblocks.cpp */,
|
||||||
|
F9A66C601396D4DF00CEE494 /* codeblocks.h */,
|
||||||
|
F9A66C611396D4DF00CEE494 /* config.h */,
|
||||||
|
F9A66C621396D4DF00CEE494 /* create_project.cpp */,
|
||||||
|
F9A66C631396D4DF00CEE494 /* create_project.h */,
|
||||||
|
F9A66C641396D4DF00CEE494 /* module.mk */,
|
||||||
|
F9A66C651396D4DF00CEE494 /* msbuild.cpp */,
|
||||||
|
F9A66C661396D4DF00CEE494 /* msbuild.h */,
|
||||||
|
F9A66C671396D4DF00CEE494 /* msvc.cpp */,
|
||||||
|
F9A66C681396D4DF00CEE494 /* msvc.h */,
|
||||||
|
F9A66C481396D45D00CEE494 /* Scripts */,
|
||||||
|
F9A66C281396D36100CEE494 /* Products */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F9A66C281396D36100CEE494 /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F9A66C271396D36100CEE494 /* create_project */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F9A66C481396D45D00CEE494 /* Scripts */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F9A66C491396D47500CEE494 /* installer.vbs */,
|
||||||
|
F9A66C4A1396D47500CEE494 /* postbuild.cmd */,
|
||||||
|
F9A66C4B1396D47500CEE494 /* prebuild.cmd */,
|
||||||
|
F9A66C4C1396D47500CEE494 /* revision.vbs */,
|
||||||
|
);
|
||||||
|
name = Scripts;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
F9A66C261396D36100CEE494 /* create_project */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = F9A66C301396D36100CEE494 /* Build configuration list for PBXNativeTarget "create_project" */;
|
||||||
|
buildPhases = (
|
||||||
|
F9A66C231396D36100CEE494 /* Sources */,
|
||||||
|
F9A66C241396D36100CEE494 /* Frameworks */,
|
||||||
|
F9A66C251396D36100CEE494 /* CopyFiles */,
|
||||||
|
F9BA99131398063A00C276C2 /* CopyFiles */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = create_project;
|
||||||
|
productName = create_project;
|
||||||
|
productReference = F9A66C271396D36100CEE494 /* create_project */;
|
||||||
|
productType = "com.apple.product-type.tool";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
F9A66C1E1396D36100CEE494 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
buildConfigurationList = F9A66C211396D36100CEE494 /* Build configuration list for PBXProject "create_project" */;
|
||||||
|
compatibilityVersion = "Xcode 3.2";
|
||||||
|
developmentRegion = English;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
);
|
||||||
|
mainGroup = F9A66C1C1396D36100CEE494;
|
||||||
|
productRefGroup = F9A66C281396D36100CEE494 /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
F9A66C261396D36100CEE494 /* create_project */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
F9A66C231396D36100CEE494 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
F9A66C691396D4DF00CEE494 /* codeblocks.cpp in Sources */,
|
||||||
|
F9A66C6A1396D4DF00CEE494 /* create_project.cpp in Sources */,
|
||||||
|
F9A66C6B1396D4DF00CEE494 /* msbuild.cpp in Sources */,
|
||||||
|
F9A66C6C1396D4DF00CEE494 /* msvc.cpp in Sources */,
|
||||||
|
F9A66C6F1396D4E800CEE494 /* visualstudio.cpp in Sources */,
|
||||||
|
F9A66C871396E2F500CEE494 /* xcode.cpp in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
F9A66C2E1396D36100CEE494 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
|
||||||
|
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||||
|
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
F9A66C2F1396D36100CEE494 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
F9A66C311396D36100CEE494 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
F9A66C321396D36100CEE494 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
COPY_PHASE_STRIP = YES;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
F9A66C211396D36100CEE494 /* Build configuration list for PBXProject "create_project" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
F9A66C2E1396D36100CEE494 /* Debug */,
|
||||||
|
F9A66C2F1396D36100CEE494 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
F9A66C301396D36100CEE494 /* Build configuration list for PBXNativeTarget "create_project" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
F9A66C311396D36100CEE494 /* Debug */,
|
||||||
|
F9A66C321396D36100CEE494 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = F9A66C1E1396D36100CEE494 /* Project object */;
|
||||||
|
}
|
|
@ -1,11 +1,10 @@
|
||||||
# $URL$
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
MODULE := devtools
|
MODULE := devtools
|
||||||
|
|
||||||
MODULE_DIRS += \
|
MODULE_DIRS += \
|
||||||
devtools/
|
devtools/
|
||||||
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Tools directory
|
# Tools directory
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
@ -26,4 +25,24 @@ devtools: $(DEVTOOLS)
|
||||||
clean-devtools:
|
clean-devtools:
|
||||||
-$(RM) $(DEVTOOLS)
|
-$(RM) $(DEVTOOLS)
|
||||||
|
|
||||||
.PHONY: clean-devtools devtools
|
#
|
||||||
|
# Build rules for the devtools
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Rules to explicitly rebuild the credits / MD5 tables.
|
||||||
|
# The rules for the files in the "web" resp. "docs" modules
|
||||||
|
# assume that you are invoking "make" from within a complete
|
||||||
|
# checkout of the ScummVM repository. Of course if that is not the
|
||||||
|
# case, then you have to modify those paths...
|
||||||
|
#
|
||||||
|
|
||||||
|
credits:
|
||||||
|
$(srcdir)/devtools/credits.pl --text > $(srcdir)/AUTHORS
|
||||||
|
# $(srcdir)/devtools/credits.pl --rtf > $(srcdir)/Credits.rtf
|
||||||
|
$(srcdir)/devtools/credits.pl --cpp > $(srcdir)/gui/credits.h
|
||||||
|
$(srcdir)/devtools/credits.pl --xml-website > $(srcdir)/../../web/trunk/data/credits.xml
|
||||||
|
# $(srcdir)/devtools/credits.pl --xml-docbook > $(srcdir)/../../docs/trunk/docbook/credits.xml
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: clean-devtools devtools credits
|
||||||
|
|
|
@ -20,9 +20,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// FIXME: Avoid using printf
|
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
|
|
||||||
|
|
||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "common/hash-str.h"
|
#include "common/hash-str.h"
|
||||||
|
@ -30,7 +27,9 @@
|
||||||
#include "common/macresman.h"
|
#include "common/macresman.h"
|
||||||
#include "common/md5.h"
|
#include "common/md5.h"
|
||||||
#include "common/config-manager.h"
|
#include "common/config-manager.h"
|
||||||
|
#include "common/system.h"
|
||||||
#include "common/textconsole.h"
|
#include "common/textconsole.h"
|
||||||
|
#include "common/translation.h"
|
||||||
|
|
||||||
#include "engines/advancedDetector.h"
|
#include "engines/advancedDetector.h"
|
||||||
|
|
||||||
|
@ -196,12 +195,10 @@ static void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *
|
||||||
desc["gameid"] = params.singleid;
|
desc["gameid"] = params.singleid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(params.flags & kADFlagDontAugmentPreferredTarget)) {
|
if (!desc.contains("preferredtarget"))
|
||||||
if (!desc.contains("preferredtarget"))
|
desc["preferredtarget"] = desc["gameid"];
|
||||||
desc["preferredtarget"] = desc["gameid"];
|
|
||||||
|
|
||||||
desc["preferredtarget"] = generatePreferredTarget(desc["preferredtarget"], realDesc);
|
desc["preferredtarget"] = generatePreferredTarget(desc["preferredtarget"], realDesc);
|
||||||
}
|
|
||||||
|
|
||||||
if (params.flags & kADFlagUseExtraAsHint)
|
if (params.flags & kADFlagUseExtraAsHint)
|
||||||
desc["extra"] = realDesc->extra;
|
desc["extra"] = realDesc->extra;
|
||||||
|
@ -226,7 +223,7 @@ bool cleanupPirated(ADGameDescList &matched) {
|
||||||
// We ruled out all variants and now have nothing
|
// We ruled out all variants and now have nothing
|
||||||
if (matched.empty()) {
|
if (matched.empty()) {
|
||||||
|
|
||||||
warning("Illegitimate copy of the game detected. We give no support in such cases %d", matched.size());
|
warning("Illegitimate game copy detected. We give no support in such cases %d", matched.size());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -368,14 +365,18 @@ static void reportUnknown(const Common::FSNode &path, const SizeMD5Map &filesSiz
|
||||||
//
|
//
|
||||||
// Might also be helpful to display the full path (for when this is used
|
// Might also be helpful to display the full path (for when this is used
|
||||||
// from the mass detector).
|
// from the mass detector).
|
||||||
printf("The game in '%s' seems to be unknown.\n", path.getPath().c_str());
|
Common::String report = Common::String::format(_("The game in '%s' seems to be unknown."), path.getPath().c_str()) + "\n";
|
||||||
printf("Please, report the following data to the Residual team along with name\n");
|
report += _("Please, report the following data to the Residual team along with name");
|
||||||
printf("of the game you tried to add and its version/language/etc.:\n");
|
report += "\n";
|
||||||
|
report += _("of the game you tried to add and its version/language/etc.:");
|
||||||
|
report += "\n";
|
||||||
|
|
||||||
for (SizeMD5Map::const_iterator file = filesSizeMD5.begin(); file != filesSizeMD5.end(); ++file)
|
for (SizeMD5Map::const_iterator file = filesSizeMD5.begin(); file != filesSizeMD5.end(); ++file)
|
||||||
printf(" {\"%s\", 0, \"%s\", %d},\n", file->_key.c_str(), file->_value.md5.c_str(), file->_value.size);
|
report += Common::String::format(" {\"%s\", 0, \"%s\", %d},\n", file->_key.c_str(), file->_value.md5.c_str(), file->_value.size);
|
||||||
|
|
||||||
printf("\n");
|
report += "\n";
|
||||||
|
|
||||||
|
g_system->logMessage(LogMessageType::kInfo, report.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParams ¶ms);
|
static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParams ¶ms);
|
||||||
|
@ -628,10 +629,14 @@ static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParam
|
||||||
if (matchedDesc) { // We got a match
|
if (matchedDesc) { // We got a match
|
||||||
matched.push_back(matchedDesc);
|
matched.push_back(matchedDesc);
|
||||||
if (params.flags & kADFlagPrintWarningOnFileBasedFallback) {
|
if (params.flags & kADFlagPrintWarningOnFileBasedFallback) {
|
||||||
printf("Your game version has been detected using filename matching as a\n");
|
Common::String report = Common::String::format(_("Your game version has been detected using "
|
||||||
printf("variant of %s.\n", matchedDesc->gameid);
|
"filename matching as a variant of %s."), matchedDesc->gameid);
|
||||||
printf("If this is an original and unmodified version, please report any\n");
|
report += "\n";
|
||||||
printf("information previously printed by Residual to the team.\n");
|
report += _("If this is an original and unmodified version, please report any");
|
||||||
|
report += "\n";
|
||||||
|
report += _("information previously printed by Residual to the team.");
|
||||||
|
report += "\n";
|
||||||
|
g_system->logMessage(LogMessageType::kInfo, report.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,11 +100,6 @@ struct ADFileBasedFallback {
|
||||||
|
|
||||||
|
|
||||||
enum ADFlags {
|
enum ADFlags {
|
||||||
/**
|
|
||||||
* Generate/augment preferred target with information on the language (if
|
|
||||||
* not equal to english) and platform (if not equal to PC).
|
|
||||||
*/
|
|
||||||
kADFlagDontAugmentPreferredTarget = (1 << 0),
|
|
||||||
/**
|
/**
|
||||||
* Warn user about new variant if his version was detected with fallback
|
* Warn user about new variant if his version was detected with fallback
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -227,11 +227,11 @@ void MainMenuDialog::save() {
|
||||||
Common::String result(_saveDialog->getResultString());
|
Common::String result(_saveDialog->getResultString());
|
||||||
if (result.empty()) {
|
if (result.empty()) {
|
||||||
// If the user was lazy and entered no save name, come up with a default name.
|
// If the user was lazy and entered no save name, come up with a default name.
|
||||||
char buf[20];
|
Common::String buf;
|
||||||
snprintf(buf, 20, "Save %d", slot + 1);
|
buf = Common::String::format("Save %d", slot + 1);
|
||||||
_engine->saveGameState(slot, buf);
|
_engine->saveGameState(slot, buf);
|
||||||
} else {
|
} else {
|
||||||
_engine->saveGameState(slot, result.c_str());
|
_engine->saveGameState(slot, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
close();
|
close();
|
||||||
|
|
|
@ -310,7 +310,7 @@ bool Engine::canLoadGameStateCurrently() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::Error Engine::saveGameState(int slot, const char *desc) {
|
Common::Error Engine::saveGameState(int slot, const Common::String &desc) {
|
||||||
// Do nothing by default
|
// Do nothing by default
|
||||||
return Common::kNoError;
|
return Common::kNoError;
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,7 @@ public:
|
||||||
* @param desc a description for the savestate, entered by the user
|
* @param desc a description for the savestate, entered by the user
|
||||||
* @return returns kNoError on success, else an error code.
|
* @return returns kNoError on success, else an error code.
|
||||||
*/
|
*/
|
||||||
virtual Common::Error saveGameState(int slot, const char *desc);
|
virtual Common::Error saveGameState(int slot, const Common::String &desc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether a game state can be saved.
|
* Indicates whether a game state can be saved.
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#if defined (SDL_BACKEND) && !defined(__amigaos4__)
|
#if defined (SDL_BACKEND) && !defined(__amigaos4__)
|
||||||
#include <SDL_opengl.h>
|
#include <SDL_opengl.h>
|
||||||
|
#undef ARRAYSIZE
|
||||||
#else
|
#else
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <GL/glu.h>
|
#include <GL/glu.h>
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_getwd
|
#define FORBIDDEN_SYMBOL_EXCEPTION_getwd
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_unlink
|
#define FORBIDDEN_SYMBOL_EXCEPTION_unlink
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stdin
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_setjmp
|
#define FORBIDDEN_SYMBOL_EXCEPTION_setjmp
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_longjmp
|
#define FORBIDDEN_SYMBOL_EXCEPTION_longjmp
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
|
#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(disable:4611)
|
#pragma warning(disable:4611)
|
||||||
|
|
|
@ -11,6 +11,10 @@
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_fread
|
#define FORBIDDEN_SYMBOL_EXCEPTION_fread
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_fwrite
|
#define FORBIDDEN_SYMBOL_EXCEPTION_fwrite
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_fseek
|
#define FORBIDDEN_SYMBOL_EXCEPTION_fseek
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stdin
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stdout
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
|
||||||
|
|
||||||
#include "common/savefile.h"
|
#include "common/savefile.h"
|
||||||
#include "common/fs.h"
|
#include "common/fs.h"
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_setjmp
|
#define FORBIDDEN_SYMBOL_EXCEPTION_setjmp
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_longjmp
|
#define FORBIDDEN_SYMBOL_EXCEPTION_longjmp
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
|
#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
|
||||||
|
|
||||||
#include "engines/grim/lua/lauxlib.h"
|
#include "engines/grim/lua/lauxlib.h"
|
||||||
#include "engines/grim/lua/lmem.h"
|
#include "engines/grim/lua/lmem.h"
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
|
#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
|
||||||
#define FORBIDDEN_SYMBOL_EXCEPTION_fgetc
|
#define FORBIDDEN_SYMBOL_EXCEPTION_fgetc
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
|
||||||
|
#define FORBIDDEN_SYMBOL_EXCEPTION_stdin
|
||||||
|
|
||||||
#include "engines/grim/grim.h"
|
#include "engines/grim/grim.h"
|
||||||
#include "engines/grim/lua.h"
|
#include "engines/grim/lua.h"
|
||||||
|
|
|
@ -52,20 +52,20 @@ void SaveStateDescriptor::setWriteProtectedFlag(bool state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveStateDescriptor::setSaveDate(int year, int month, int day) {
|
void SaveStateDescriptor::setSaveDate(int year, int month, int day) {
|
||||||
char buffer[32];
|
Common::String buffer;
|
||||||
snprintf(buffer, 32, "%.2d.%.2d.%.4d", day, month, year);
|
buffer = Common::String::format("%.2d.%.2d.%.4d", day, month, year);
|
||||||
setVal("save_date", buffer);
|
setVal("save_date", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveStateDescriptor::setSaveTime(int hour, int min) {
|
void SaveStateDescriptor::setSaveTime(int hour, int min) {
|
||||||
char buffer[32];
|
Common::String buffer;
|
||||||
snprintf(buffer, 32, "%.2d:%.2d", hour, min);
|
buffer = Common::String::format("%.2d:%.2d", hour, min);
|
||||||
setVal("save_time", buffer);
|
setVal("save_time", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveStateDescriptor::setPlayTime(int hours, int minutes) {
|
void SaveStateDescriptor::setPlayTime(int hours, int minutes) {
|
||||||
char buffer[32];
|
Common::String buffer;
|
||||||
snprintf(buffer, 32, "%.2d:%.2d", hours, minutes);
|
buffer = Common::String::format("%.2d:%.2d", hours, minutes);
|
||||||
setVal("play_time", buffer);
|
setVal("play_time", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveStateDescriptor(int s, const Common::String &d) : _thumbnail() {
|
SaveStateDescriptor(int s, const Common::String &d) : _thumbnail() {
|
||||||
char buf[16];
|
setVal("save_slot", Common::String::format("%d", s));
|
||||||
sprintf(buf, "%d", s);
|
|
||||||
setVal("save_slot", buf);
|
|
||||||
setVal("description", d);
|
setVal("description", d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue