Sync with ScummVM rev. 654b8208b8
This commit is contained in:
parent
2fa313def1
commit
8f4e1c6cf3
185 changed files with 6769 additions and 2586 deletions
|
@ -4,3 +4,6 @@ indent_size = 4
|
|||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
vc_generate_documentation_comments = doxygen_slash_star
|
||||
|
||||
[*.lingo]
|
||||
charset = macroman
|
||||
|
|
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -6,3 +6,4 @@
|
|||
/po/uk_UA.po encoding=iso-8859-5
|
||||
/po/el.po encoding=iso-8859-7
|
||||
/po/he.po encoding=iso-8859-8
|
||||
*.lingo encoding=MacRoman
|
||||
|
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -152,6 +152,7 @@ LLVM64/
|
|||
|
||||
#Ignore files generated by Visual Studio Code
|
||||
.vscode/
|
||||
compile_commands.json
|
||||
|
||||
#Ignore gettext generated files
|
||||
/messages.mo
|
||||
|
@ -207,9 +208,12 @@ gmon.out
|
|||
#Ignore Android Studio files
|
||||
.idea
|
||||
|
||||
#Ingore temporary Android project folder
|
||||
#Ignore temporary Android project folder
|
||||
android_project
|
||||
|
||||
#Ignore snapcraft build artifacts
|
||||
.snap
|
||||
|
||||
# Emacs files
|
||||
*~
|
||||
.#*
|
||||
|
|
|
@ -57,6 +57,22 @@ const byte MidiDriver::_gmToMt32[128] = {
|
|||
101, 103, 100, 120, 117, 113, 99, 128, 128, 128, 128, 124, 123, 128, 128, 128, // 7x
|
||||
};
|
||||
|
||||
// These are the power-on default instruments of the Roland MT-32 family.
|
||||
const byte MidiDriver::_mt32DefaultInstruments[8] = {
|
||||
0x44, 0x30, 0x5F, 0x4E, 0x29, 0x03, 0x6E, 0x7A
|
||||
};
|
||||
|
||||
// These are the power-on default panning settings for channels 2-9 of the Roland MT-32 family.
|
||||
// Internally, the MT-32 has 15 panning positions (0-E with 7 being center).
|
||||
// This has been translated to the equivalent MIDI panning values (0-127).
|
||||
// These are used for setting default panning on GM devices when using them with MT-32 data.
|
||||
// Note that MT-32 panning is reversed compared to the MIDI specification. This is not reflected
|
||||
// here; the driver is expected to flip these values based on the _reversePanning variable.
|
||||
const byte MidiDriver::_mt32DefaultPanning[8] = {
|
||||
// 7, 8, 7, 8, 4, A, 0, E
|
||||
0x40, 0x49, 0x40, 0x49, 0x25, 0x5B, 0x00, 0x7F
|
||||
};
|
||||
|
||||
// This is the drum map for the Roland Sound Canvas SC-55 v1.xx. It had a fallback mechanism
|
||||
// to correct invalid drumkit selections. Some games rely on this mechanism to select the
|
||||
// correct Roland GS drumkit. Use this map to emulate this mechanism.
|
||||
|
@ -157,6 +173,9 @@ Common::String MidiDriver::getDeviceString(DeviceHandle handle, DeviceStringType
|
|||
MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
|
||||
// Query the selected music device (defaults to MT_AUTO device).
|
||||
Common::String selDevStr = ConfMan.hasKey("music_driver") ? ConfMan.get("music_driver") : Common::String("auto");
|
||||
if ((flags & MDT_PREFER_FLUID) && selDevStr == "auto") {
|
||||
selDevStr = "fluidsynth";
|
||||
}
|
||||
DeviceHandle hdl = getDeviceHandle(selDevStr.empty() ? Common::String("auto") : selDevStr);
|
||||
DeviceHandle reslt = 0;
|
||||
|
||||
|
@ -431,19 +450,78 @@ MidiDriver::DeviceHandle MidiDriver::getDeviceHandle(const Common::String &ident
|
|||
return 0;
|
||||
}
|
||||
|
||||
void MidiDriver::initMT32(bool initForGM) {
|
||||
sendMT32Reset();
|
||||
|
||||
if (initForGM) {
|
||||
// Set up MT-32 for GM data.
|
||||
// This is based on Roland's GM settings for MT-32.
|
||||
debug("Initializing MT-32 for General MIDI data");
|
||||
|
||||
byte buffer[17];
|
||||
|
||||
// Roland MT-32 SysEx for system area
|
||||
memcpy(&buffer[0], "\x41\x10\x16\x12\x10\x00", 6);
|
||||
|
||||
// Set reverb parameters:
|
||||
// - Mode 2 (Plate)
|
||||
// - Time 3
|
||||
// - Level 4
|
||||
memcpy(&buffer[6], "\x01\x02\x03\x04\x66", 5);
|
||||
sysEx(buffer, 11);
|
||||
|
||||
// Set partial reserve to match SC-55
|
||||
memcpy(&buffer[6], "\x04\x08\x04\x04\x03\x03\x03\x03\x02\x02\x4C", 11);
|
||||
sysEx(buffer, 17);
|
||||
|
||||
// Use MIDI instrument channels 1-8 instead of 2-9
|
||||
memcpy(&buffer[6], "\x0D\x00\x01\x02\x03\x04\x05\x06\x07\x09\x3E", 11);
|
||||
sysEx(buffer, 17);
|
||||
|
||||
// The MT-32 has reversed stereo panning compared to the MIDI spec.
|
||||
// GM does use panning as specified by the MIDI spec.
|
||||
_reversePanning = true;
|
||||
|
||||
int i;
|
||||
|
||||
// Set default GM panning (center on all channels)
|
||||
for (i = 0; i < 8; ++i) {
|
||||
send((0x40 << 16) | (10 << 8) | (0xB0 | i));
|
||||
}
|
||||
|
||||
// Set default GM instruments (0 on all channels).
|
||||
// This is expected to be mapped to the MT-32 equivalent by the driver.
|
||||
for (i = 0; i < 8; ++i) {
|
||||
send((0 << 8) | (0xC0 | i));
|
||||
}
|
||||
|
||||
// Set Pitch Bend Sensitivity to 2 semitones.
|
||||
for (i = 0; i < 8; ++i) {
|
||||
setPitchBendRange(i, 2);
|
||||
}
|
||||
setPitchBendRange(9, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void MidiDriver::sendMT32Reset() {
|
||||
static const byte resetSysEx[] = { 0x41, 0x10, 0x16, 0x12, 0x7F, 0x00, 0x00, 0x01, 0x00 };
|
||||
sysEx(resetSysEx, sizeof(resetSysEx));
|
||||
g_system->delayMillis(100);
|
||||
}
|
||||
|
||||
void MidiDriver::sendGMReset() {
|
||||
static const byte resetSysEx[] = { 0x7E, 0x7F, 0x09, 0x01 };
|
||||
sysEx(resetSysEx, sizeof(resetSysEx));
|
||||
g_system->delayMillis(100);
|
||||
void MidiDriver::initGM(bool initForMT32, bool enableGS) {
|
||||
// ResidualVM - not used
|
||||
}
|
||||
|
||||
void MidiDriver::sendGMReset() {
|
||||
// ResidualVM - not used
|
||||
}
|
||||
|
||||
byte MidiDriver::correctInstrumentBank(byte outputChannel, byte patchId) {
|
||||
// ResidualVM - not used
|
||||
return 0xFF;
|
||||
|
||||
}
|
||||
void MidiDriver_BASE::midiDumpInit() {
|
||||
// ResidualVM - not used
|
||||
}
|
||||
|
@ -482,6 +560,10 @@ void MidiDriver_BASE::send(byte status, byte firstOp, byte secondOp) {
|
|||
send(status | ((uint32)firstOp << 8) | ((uint32)secondOp << 16));
|
||||
}
|
||||
|
||||
void MidiDriver_BASE::send(int8 source, byte status, byte firstOp, byte secondOp) {
|
||||
send(source, status | ((uint32)firstOp << 8) | ((uint32)secondOp << 16));
|
||||
}
|
||||
|
||||
void MidiDriver::midiDriverCommonSend(uint32 b) {
|
||||
// ResidualVM - not used
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "common/scummsys.h"
|
||||
#include "common/str.h"
|
||||
#include "common/stream.h"
|
||||
#include "common/timer.h"
|
||||
#include "common/array.h"
|
||||
|
||||
|
@ -79,7 +80,8 @@ enum MidiDriverFlags {
|
|||
MDT_PC98 = 1 << 8, // FM-TOWNS: Maps to MT_PC98
|
||||
MDT_MIDI = 1 << 9, // Real MIDI
|
||||
MDT_PREFER_MT32 = 1 << 10, // MT-32 output is preferred
|
||||
MDT_PREFER_GM = 1 << 11 // GM output is preferred
|
||||
MDT_PREFER_GM = 1 << 11, // GM output is preferred
|
||||
MDT_PREFER_FLUID= 1 << 12 // FluidSynth driver is preferred
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -99,6 +101,12 @@ public:
|
|||
*/
|
||||
virtual void send(uint32 b) = 0;
|
||||
|
||||
/**
|
||||
* Send a MIDI command from a specific source. If the MIDI driver
|
||||
* does not support multiple sources, the source parameter is
|
||||
* ignored.
|
||||
*/
|
||||
virtual void send(int8 source, uint32 b) { send(b); }
|
||||
|
||||
/**
|
||||
* Output a midi command to the midi stream. Convenience wrapper
|
||||
|
@ -110,7 +118,14 @@ public:
|
|||
void send(byte status, byte firstOp, byte secondOp);
|
||||
|
||||
/**
|
||||
* Transmit a sysEx to the midi device.
|
||||
* Send a MIDI command from a specific source. If the MIDI driver
|
||||
* does not support multiple sources, the source parameter is
|
||||
* ignored.
|
||||
*/
|
||||
void send(int8 source, byte status, byte firstOp, byte secondOp);
|
||||
|
||||
/**
|
||||
* Transmit a SysEx to the MIDI device.
|
||||
*
|
||||
* The given msg MUST NOT contain the usual SysEx frame, i.e.
|
||||
* do NOT include the leading 0xF0 and the trailing 0xF7.
|
||||
|
@ -121,9 +136,29 @@ public:
|
|||
*/
|
||||
virtual void sysEx(const byte *msg, uint16 length) { }
|
||||
|
||||
/**
|
||||
* Transmit a SysEx to the MIDI device and return the necessary
|
||||
* delay until the next SysEx event in milliseconds.
|
||||
*
|
||||
* This can be used to implement an alternate delay method than the
|
||||
* OSystem::delayMillis function used by most sysEx implementations.
|
||||
* Note that not every driver needs a delay, or supports this method.
|
||||
* In this case, 0 is returned and the driver itself will do a delay
|
||||
* if necessary.
|
||||
*
|
||||
* For information on the SysEx data requirements, see the sysEx method.
|
||||
*/
|
||||
virtual uint16 sysExNoDelay(const byte *msg, uint16 length) { sysEx(msg, length); return 0; }
|
||||
|
||||
// TODO: Document this.
|
||||
virtual void metaEvent(byte type, byte *data, uint16 length) { }
|
||||
|
||||
/**
|
||||
* Send a meta event from a specific source. If the MIDI driver
|
||||
* does not support multiple sources, the source parameter is
|
||||
* ignored.
|
||||
*/
|
||||
virtual void metaEvent(int8 source, byte type, byte *data, uint16 length) { metaEvent(type, data, length); }
|
||||
protected:
|
||||
|
||||
/**
|
||||
|
@ -207,6 +242,13 @@ public:
|
|||
/** Common operations to be done by all drivers on start of sysEx */
|
||||
void midiDriverCommonSysEx(const byte *msg, uint16 length);
|
||||
|
||||
protected:
|
||||
// True if stereo panning should be reversed.
|
||||
bool _reversePanning;
|
||||
// True if GS percussion channel volume should be scaled to match MT-32 volume.
|
||||
bool _scaleGSPercussionVolumeToMT32;
|
||||
// The currently selected GS instrument bank / variation for each channel.
|
||||
byte _gsBank[16];
|
||||
|
||||
private:
|
||||
// If detectDevice() detects MT32 and we have a preferred MT32 device
|
||||
|
@ -217,10 +259,16 @@ private:
|
|||
static bool _forceTypeMT32;
|
||||
|
||||
public:
|
||||
MidiDriver() : _reversePanning(false),
|
||||
_scaleGSPercussionVolumeToMT32(false) {
|
||||
memset(_gsBank, 0, sizeof(_gsBank));
|
||||
}
|
||||
virtual ~MidiDriver() { }
|
||||
|
||||
static const byte _mt32ToGm[128];
|
||||
static const byte _gmToMt32[128];
|
||||
static const byte _mt32DefaultInstruments[8];
|
||||
static const byte _mt32DefaultPanning[8];
|
||||
// Map for correcting Roland GS drumkit numbers.
|
||||
static const uint8 _gsDrumkitFallbackMap[128];
|
||||
|
||||
|
@ -273,11 +321,28 @@ public:
|
|||
send(0xB0 | channel, 100, 127);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the MT-32 MIDI device. The device will be reset and,
|
||||
* if the parameter is specified, set up for General MIDI data.
|
||||
* @param initForGM True if the MT-32 should be initialized for GM mapping
|
||||
*/
|
||||
void initMT32(bool initForGM);
|
||||
|
||||
/**
|
||||
* Send a Roland MT-32 reset sysEx to the midi device.
|
||||
*/
|
||||
void sendMT32Reset();
|
||||
|
||||
/**
|
||||
* Initializes the General MIDI device. The device will be reset.
|
||||
* If the initForMT32 parameter is specified, the device will be set up for
|
||||
* MT-32 MIDI data. If the device supports Roland GS, the enableGS
|
||||
* parameter can be specified for enhanced GS MT-32 compatiblity.
|
||||
* @param initForMT32 True if the device should be initialized for MT-32 mapping
|
||||
* @param enableGS True if the device should be initialized for GS MT-32 mapping
|
||||
*/
|
||||
void initGM(bool initForMT32, bool enableGS);
|
||||
|
||||
/**
|
||||
* Send a General MIDI reset sysEx to the midi device.
|
||||
*/
|
||||
|
@ -294,6 +359,24 @@ public:
|
|||
// Channel allocation functions
|
||||
virtual MidiChannel *allocateChannel() = 0;
|
||||
virtual MidiChannel *getPercussionChannel() = 0;
|
||||
|
||||
// Allow an engine to supply its own soundFont data. This stream will be destroyed after use.
|
||||
virtual void setEngineSoundFont(Common::SeekableReadStream *soundFontData) { }
|
||||
|
||||
// Does this driver accept soundFont data?
|
||||
virtual bool acceptsSoundFontData() { return false; }
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Checks if the currently selected GS bank / instrument variation
|
||||
* on the specified channel is valid for the specified patch.
|
||||
* If this is not the case, the correct bank will be returned which
|
||||
* can be set by sending a bank select message. If no correction is
|
||||
* needed, 0xFF will be returned.
|
||||
* This emulates the fallback functionality of the Roland SC-55 v1.2x,
|
||||
* on which some games rely to correct wrong bank selects.
|
||||
*/
|
||||
byte correctInstrumentBank(byte outputChannel, byte patchId);
|
||||
};
|
||||
|
||||
class MidiChannel {
|
||||
|
|
|
@ -41,7 +41,7 @@ DefaultEventManager::DefaultEventManager(Common::EventSource *boss) :
|
|||
_buttonState(0),
|
||||
_modifierState(0),
|
||||
_shouldQuit(false),
|
||||
_shouldRTL(false),
|
||||
_shouldReturnToLauncher(false),
|
||||
_confirmExitDialogActive(false) {
|
||||
|
||||
assert(boss);
|
||||
|
@ -95,9 +95,9 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
|
|||
event = _eventQueue.pop();
|
||||
bool forwardEvent = true;
|
||||
|
||||
// If the backend has the kFeatureNoQuit, replace Quit event with RTL
|
||||
// If the backend has the kFeatureNoQuit, replace Quit event with Return to Launcher
|
||||
if (event.type == Common::EVENT_QUIT && g_system->hasFeature(OSystem::kFeatureNoQuit))
|
||||
event.type = Common::EVENT_RTL;
|
||||
event.type = Common::EVENT_RETURN_TO_LAUNCHER;
|
||||
|
||||
switch (event.type) {
|
||||
case Common::EVENT_KEYDOWN:
|
||||
|
@ -149,8 +149,8 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
|
|||
|
||||
if (_shouldQuit)
|
||||
event.type = Common::EVENT_QUIT;
|
||||
else if (_shouldRTL)
|
||||
event.type = Common::EVENT_RTL;
|
||||
else if (_shouldReturnToLauncher)
|
||||
event.type = Common::EVENT_RETURN_TO_LAUNCHER;
|
||||
break;
|
||||
#ifdef ENABLE_VKEYBD
|
||||
case Common::EVENT_VIRTUAL_KEYBOARD:
|
||||
|
@ -160,25 +160,23 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
|
|||
if (_vk->isDisplaying()) {
|
||||
_vk->close(true);
|
||||
} else {
|
||||
PauseToken pt;
|
||||
if (g_engine)
|
||||
g_engine->pauseEngine(true);
|
||||
pt = g_engine->pauseEngine();
|
||||
_vk->show();
|
||||
if (g_engine)
|
||||
g_engine->pauseEngine(false);
|
||||
forwardEvent = false;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case Common::EVENT_RTL:
|
||||
case Common::EVENT_RETURN_TO_LAUNCHER:
|
||||
if (ConfMan.getBool("confirm_exit")) {
|
||||
PauseToken pt;
|
||||
if (g_engine)
|
||||
g_engine->pauseEngine(true);
|
||||
pt = g_engine->pauseEngine();
|
||||
GUI::MessageDialog alert(_("Do you really want to return to the Launcher?"), _("Launcher"), _("Cancel"));
|
||||
forwardEvent = _shouldRTL = (alert.runModal() == GUI::kMessageOK);
|
||||
if (g_engine)
|
||||
g_engine->pauseEngine(false);
|
||||
forwardEvent = _shouldReturnToLauncher = (alert.runModal() == GUI::kMessageOK);
|
||||
} else
|
||||
_shouldRTL = true;
|
||||
_shouldReturnToLauncher = true;
|
||||
break;
|
||||
|
||||
case Common::EVENT_MUTE:
|
||||
|
@ -193,12 +191,14 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
|
|||
break;
|
||||
}
|
||||
_confirmExitDialogActive = true;
|
||||
|
||||
{
|
||||
PauseToken pt;
|
||||
if (g_engine)
|
||||
g_engine->pauseEngine(true);
|
||||
pt = g_engine->pauseEngine();
|
||||
GUI::MessageDialog alert(_("Do you really want to quit?"), _("Quit"), _("Cancel"));
|
||||
forwardEvent = _shouldQuit = (alert.runModal() == GUI::kMessageOK);
|
||||
if (g_engine)
|
||||
g_engine->pauseEngine(false);
|
||||
}
|
||||
_confirmExitDialogActive = false;
|
||||
} else {
|
||||
_shouldQuit = true;
|
||||
|
|
|
@ -56,7 +56,7 @@ class DefaultEventManager : public Common::EventManager, Common::EventObserver {
|
|||
int _buttonState;
|
||||
int _modifierState;
|
||||
bool _shouldQuit;
|
||||
bool _shouldRTL;
|
||||
bool _shouldReturnToLauncher;
|
||||
bool _confirmExitDialogActive;
|
||||
|
||||
public:
|
||||
|
@ -72,9 +72,9 @@ public:
|
|||
virtual int getButtonState() const override { return _buttonState; }
|
||||
virtual int getModifierState() const override { return _modifierState; }
|
||||
virtual int shouldQuit() const override { return _shouldQuit; }
|
||||
virtual int shouldRTL() const override { return _shouldRTL; }
|
||||
virtual void resetRTL() override { _shouldRTL = false; }
|
||||
#ifdef FORCE_RTL
|
||||
virtual int shouldReturnToLauncher() const override { return _shouldReturnToLauncher; }
|
||||
virtual void resetReturnToLauncher() override { _shouldReturnToLauncher = false; }
|
||||
#ifdef FORCE_RETURN_TO_LAUNCHER
|
||||
virtual void resetQuit() override { _shouldQuit = false; }
|
||||
#endif
|
||||
|
||||
|
|
|
@ -37,9 +37,10 @@
|
|||
*/
|
||||
void PS3SdlEventSource::preprocessEvents(SDL_Event *event) {
|
||||
if (event->type == SDL_APP_DIDENTERBACKGROUND) {
|
||||
PauseToken pt;
|
||||
// XMB opened
|
||||
if (g_engine)
|
||||
g_engine->pauseEngine(true);
|
||||
pt = g_engine->pauseEngine();
|
||||
|
||||
for (;;) {
|
||||
if (!SDL_PollEvent(event)) {
|
||||
|
@ -56,8 +57,6 @@ void PS3SdlEventSource::preprocessEvents(SDL_Event *event) {
|
|||
return;
|
||||
if (event->type == SDL_APP_DIDENTERFOREGROUND) {
|
||||
// XMB closed
|
||||
if (g_engine)
|
||||
g_engine->pauseEngine(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ SdlEventSource::~SdlEventSource() {
|
|||
int SdlEventSource::mapKey(SDL_Keycode sdlKey, SDL_Keymod mod, Uint16 unicode) {
|
||||
Common::KeyCode key = SDLToOSystemKeycode(sdlKey);
|
||||
|
||||
// Keep unicode in case it's regular ASCII text or in case we didn't get a valid keycode
|
||||
// Keep unicode in case it's regular ASCII text, Hebrew or in case we didn't get a valid keycode
|
||||
//
|
||||
// We need to use unicode in those cases, simply because SDL1.x passes us non-layout-adjusted keycodes.
|
||||
// So unicode is the only way to get layout-adjusted keys.
|
||||
|
@ -136,6 +136,10 @@ int SdlEventSource::mapKey(SDL_Keycode sdlKey, SDL_Keymod mod, Uint16 unicode) {
|
|||
if (unicode > 0x7E)
|
||||
unicode = 0; // do not allow any characters above 0x7E
|
||||
} else {
|
||||
// We allow Hebrew characters
|
||||
if (unicode >= 0x05D0 && unicode <= 0x05EA)
|
||||
return unicode;
|
||||
|
||||
// We must not restrict as much as when Ctrl/Alt-modifiers are active, otherwise
|
||||
// we wouldn't let umlauts through for SDL1. For SDL1 umlauts may set for example KEYCODE_QUOTE, KEYCODE_MINUS, etc.
|
||||
if (unicode > 0xFF)
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(POSIX)
|
||||
|
||||
#define FORBIDDEN_SYMBOL_ALLOW_ALL
|
||||
|
||||
#include "backends/fs/posix-drives/posix-drives-fs-factory.h"
|
||||
#include "backends/fs/posix-drives/posix-drives-fs.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void DrivesPOSIXFilesystemFactory::addDrive(const Common::String &name) {
|
||||
_config.drives.push_back(Common::normalizePath(name, '/'));
|
||||
}
|
||||
|
||||
void DrivesPOSIXFilesystemFactory::configureBuffering(DrivePOSIXFilesystemNode::BufferingMode bufferingMode, uint32 bufferSize) {
|
||||
_config.bufferingMode = bufferingMode;
|
||||
_config.bufferSize = bufferSize;
|
||||
}
|
||||
|
||||
AbstractFSNode *DrivesPOSIXFilesystemFactory::makeRootFileNode() const {
|
||||
return new DrivePOSIXFilesystemNode(_config);
|
||||
}
|
||||
|
||||
AbstractFSNode *DrivesPOSIXFilesystemFactory::makeCurrentDirectoryFileNode() const {
|
||||
char buf[MAXPATHLEN];
|
||||
return getcwd(buf, MAXPATHLEN) ? new DrivePOSIXFilesystemNode(buf, _config) : nullptr;
|
||||
}
|
||||
|
||||
AbstractFSNode *DrivesPOSIXFilesystemFactory::makeFileNodePath(const Common::String &path) const {
|
||||
assert(!path.empty());
|
||||
return new DrivePOSIXFilesystemNode(path, _config);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,63 +0,0 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef POSIX_DRIVES_FILESYSTEM_FACTORY_H
|
||||
#define POSIX_DRIVES_FILESYSTEM_FACTORY_H
|
||||
|
||||
#include "backends/fs/fs-factory.h"
|
||||
#include "backends/fs/posix-drives/posix-drives-fs.h"
|
||||
|
||||
/**
|
||||
* A FilesystemFactory implementation for filesystems with a special
|
||||
* top-level directory with hard-coded entries but that otherwise
|
||||
* implement the POSIX APIs.
|
||||
*
|
||||
* For used with paths like these:
|
||||
* - 'sdcard:/games/scummvm.ini'
|
||||
* - 'hdd1:/usr/bin'
|
||||
*/
|
||||
class DrivesPOSIXFilesystemFactory : public FilesystemFactory {
|
||||
public:
|
||||
/**
|
||||
* Add a drive to the top-level directory
|
||||
*/
|
||||
void addDrive(const Common::String &name);
|
||||
|
||||
/**
|
||||
* Configure file stream buffering
|
||||
*
|
||||
* @param bufferingMode select the buffering implementation to use
|
||||
* @param bufferSize the size of the IO buffer in bytes. A buffer size of 0 means the default size should be used
|
||||
*/
|
||||
void configureBuffering(DrivePOSIXFilesystemNode::BufferingMode bufferingMode, uint32 bufferSize);
|
||||
|
||||
protected:
|
||||
// FilesystemFactory API
|
||||
AbstractFSNode *makeRootFileNode() const override;
|
||||
AbstractFSNode *makeCurrentDirectoryFileNode() const override;
|
||||
AbstractFSNode *makeFileNodePath(const Common::String &path) const override;
|
||||
|
||||
private:
|
||||
DrivePOSIXFilesystemNode::Config _config;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,205 +0,0 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(POSIX)
|
||||
|
||||
#define FORBIDDEN_SYMBOL_ALLOW_ALL
|
||||
|
||||
#include "backends/fs/posix-drives/posix-drives-fs.h"
|
||||
#include "backends/fs/posix/posix-iostream.h"
|
||||
|
||||
#include "common/algorithm.h"
|
||||
#include "common/bufferedstream.h"
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
DrivePOSIXFilesystemNode::Config::Config() {
|
||||
bufferingMode = kBufferingModeStdio;
|
||||
bufferSize = 0; // Use the default stdio buffer size
|
||||
}
|
||||
|
||||
DrivePOSIXFilesystemNode::DrivePOSIXFilesystemNode(const Common::String &path, const Config &config) :
|
||||
POSIXFilesystemNode(path),
|
||||
_isPseudoRoot(false),
|
||||
_config(config) {
|
||||
|
||||
if (isDrive(path)) {
|
||||
_isDirectory = true;
|
||||
_isValid = true;
|
||||
|
||||
// FIXME: Add a setting for deciding whether drive paths need to end with a slash
|
||||
if (!_path.hasSuffix("/")) {
|
||||
_path += "/";
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DrivePOSIXFilesystemNode::DrivePOSIXFilesystemNode(const Config &config) :
|
||||
_isPseudoRoot(true),
|
||||
_config(config) {
|
||||
_isDirectory = true;
|
||||
_isValid = false;
|
||||
}
|
||||
|
||||
void DrivePOSIXFilesystemNode::configureStream(StdioStream *stream) {
|
||||
if (!stream) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_config.bufferingMode != kBufferingModeStdio) {
|
||||
// Disable stdio buffering
|
||||
stream->setBufferSize(0);
|
||||
} else if (_config.bufferSize) {
|
||||
stream->setBufferSize(_config.bufferSize);
|
||||
}
|
||||
}
|
||||
|
||||
Common::SeekableReadStream *DrivePOSIXFilesystemNode::createReadStream() {
|
||||
PosixIoStream *readStream = PosixIoStream::makeFromPath(getPath(), false);
|
||||
|
||||
configureStream(readStream);
|
||||
|
||||
if (_config.bufferingMode == kBufferingModeScummVM) {
|
||||
uint32 bufferSize = _config.bufferSize != 0 ? _config.bufferSize : 1024;
|
||||
return Common::wrapBufferedSeekableReadStream(readStream, bufferSize, DisposeAfterUse::YES);
|
||||
}
|
||||
|
||||
return readStream;
|
||||
}
|
||||
|
||||
Common::WriteStream *DrivePOSIXFilesystemNode::createWriteStream() {
|
||||
PosixIoStream *writeStream = PosixIoStream::makeFromPath(getPath(), true);
|
||||
|
||||
configureStream(writeStream);
|
||||
|
||||
if (_config.bufferingMode == kBufferingModeScummVM) {
|
||||
uint32 bufferSize = _config.bufferSize != 0 ? _config.bufferSize : 1024;
|
||||
return Common::wrapBufferedWriteStream(writeStream, bufferSize);
|
||||
}
|
||||
|
||||
return writeStream;
|
||||
}
|
||||
|
||||
DrivePOSIXFilesystemNode *DrivePOSIXFilesystemNode::getChildWithKnownType(const Common::String &n, bool isDirectoryFlag) const {
|
||||
assert(_isDirectory);
|
||||
|
||||
// Make sure the string contains no slashes
|
||||
assert(!n.contains('/'));
|
||||
|
||||
Common::String newPath(_path);
|
||||
if (_path.lastChar() != '/')
|
||||
newPath += '/';
|
||||
newPath += n;
|
||||
|
||||
DrivePOSIXFilesystemNode *child = new DrivePOSIXFilesystemNode(_config);
|
||||
child->_path = newPath;
|
||||
child->_isValid = true;
|
||||
child->_isPseudoRoot = false;
|
||||
child->_isDirectory = isDirectoryFlag;
|
||||
child->_displayName = n;
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
AbstractFSNode *DrivePOSIXFilesystemNode::getChild(const Common::String &n) const {
|
||||
DrivePOSIXFilesystemNode *child = getChildWithKnownType(n, false);
|
||||
child->setFlags();
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
bool DrivePOSIXFilesystemNode::getChildren(AbstractFSList &list, AbstractFSNode::ListMode mode, bool hidden) const {
|
||||
assert(_isDirectory);
|
||||
|
||||
if (_isPseudoRoot) {
|
||||
for (uint i = 0; i < _config.drives.size(); i++) {
|
||||
list.push_back(makeNode(_config.drives[i]));
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
DIR *dirp = opendir(_path.c_str());
|
||||
struct dirent *dp;
|
||||
|
||||
if (!dirp)
|
||||
return false;
|
||||
|
||||
while ((dp = readdir(dirp)) != nullptr) {
|
||||
// Skip 'invisible' files if necessary
|
||||
if (dp->d_name[0] == '.' && !hidden) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip '.' and '..' to avoid cycles
|
||||
if ((dp->d_name[0] == '.' && dp->d_name[1] == 0) || (dp->d_name[0] == '.' && dp->d_name[1] == '.')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
AbstractFSNode *child = nullptr;
|
||||
|
||||
#if !defined(SYSTEM_NOT_SUPPORTING_D_TYPE)
|
||||
if (dp->d_type == DT_DIR || dp->d_type == DT_REG) {
|
||||
child = getChildWithKnownType(dp->d_name, dp->d_type == DT_DIR);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
child = getChild(dp->d_name);
|
||||
}
|
||||
|
||||
// Honor the chosen mode
|
||||
if ((mode == Common::FSNode::kListFilesOnly && child->isDirectory()) ||
|
||||
(mode == Common::FSNode::kListDirectoriesOnly && !child->isDirectory())) {
|
||||
delete child;
|
||||
continue;
|
||||
}
|
||||
|
||||
list.push_back(child);
|
||||
}
|
||||
|
||||
closedir(dirp);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
AbstractFSNode *DrivePOSIXFilesystemNode::getParent() const {
|
||||
if (_isPseudoRoot) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (isDrive(_path)) {
|
||||
DrivePOSIXFilesystemNode *root = new DrivePOSIXFilesystemNode(_config);
|
||||
return root;
|
||||
}
|
||||
|
||||
return POSIXFilesystemNode::getParent();
|
||||
}
|
||||
|
||||
bool DrivePOSIXFilesystemNode::isDrive(const Common::String &path) const {
|
||||
Common::String normalizedPath = Common::normalizePath(path, '/');
|
||||
DrivesArray::const_iterator drive = Common::find(_config.drives.begin(), _config.drives.end(), normalizedPath);
|
||||
return drive != _config.drives.end();
|
||||
}
|
||||
|
||||
|
||||
#endif //#if defined(POSIX)
|
|
@ -1,79 +0,0 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef POSIX_DRIVES_FILESYSTEM_H
|
||||
#define POSIX_DRIVES_FILESYSTEM_H
|
||||
|
||||
#include "backends/fs/posix/posix-fs.h"
|
||||
|
||||
class StdioStream;
|
||||
|
||||
/**
|
||||
* POSIX file system node where the top-level directory is a hardcoded
|
||||
* list of drives.
|
||||
*/
|
||||
class DrivePOSIXFilesystemNode : public POSIXFilesystemNode {
|
||||
protected:
|
||||
AbstractFSNode *makeNode(const Common::String &path) const override {
|
||||
return new DrivePOSIXFilesystemNode(path, _config);
|
||||
}
|
||||
|
||||
public:
|
||||
typedef Common::Array<Common::String> DrivesArray;
|
||||
|
||||
enum BufferingMode {
|
||||
/** IO buffering is fully disabled */
|
||||
kBufferingModeDisabled,
|
||||
/** IO buffering is enabled and uses the libc implemenation */
|
||||
kBufferingModeStdio,
|
||||
/** IO buffering is enabled and uses ScummVM's buffering stream wraappers */
|
||||
kBufferingModeScummVM
|
||||
};
|
||||
|
||||
struct Config {
|
||||
DrivesArray drives;
|
||||
BufferingMode bufferingMode;
|
||||
uint32 bufferSize;
|
||||
|
||||
Config();
|
||||
};
|
||||
|
||||
DrivePOSIXFilesystemNode(const Common::String &path, const Config &config);
|
||||
DrivePOSIXFilesystemNode(const Config &config);
|
||||
|
||||
// AbstractFSNode API
|
||||
Common::SeekableReadStream *createReadStream() override;
|
||||
Common::WriteStream *createWriteStream() override;
|
||||
AbstractFSNode *getChild(const Common::String &n) const override;
|
||||
bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override;
|
||||
AbstractFSNode *getParent() const override;
|
||||
|
||||
private:
|
||||
bool _isPseudoRoot;
|
||||
const Config &_config;
|
||||
|
||||
DrivePOSIXFilesystemNode *getChildWithKnownType(const Common::String &n, bool isDirectoryFlag) const;
|
||||
bool isDrive(const Common::String &path) const;
|
||||
void configureStream(StdioStream *stream);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -176,7 +176,7 @@ void SdlGraphicsManager::initSizeHint(const Graphics::ModeList &modes) {
|
|||
#endif
|
||||
}
|
||||
|
||||
bool SdlGraphicsManager::showMouse(const bool visible) {
|
||||
bool SdlGraphicsManager::showMouse(bool visible) {
|
||||
if (visible == _cursorVisible) {
|
||||
return visible;
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ protected:
|
|||
*/
|
||||
virtual void setSystemMousePosition(const int x, const int y) = 0;
|
||||
|
||||
virtual bool showMouse(const bool visible) override {
|
||||
virtual bool showMouse(bool visible) override {
|
||||
if (_cursorVisible == visible) {
|
||||
return visible;
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ protected:
|
|||
* @param x The new X position of the mouse in virtual screen coordinates.
|
||||
* @param y The new Y position of the mouse in virtual screen coordinates.
|
||||
*/
|
||||
void warpMouse(const int x, const int y) override {
|
||||
void warpMouse(int x, int y) override {
|
||||
// Check active coordinate instead of window coordinate to avoid warping
|
||||
// the mouse if it is still within the same virtual pixel
|
||||
const Common::Point virtualCursor = convertWindowToVirtual(_cursorX, _cursorY);
|
||||
|
|
|
@ -124,10 +124,10 @@ const Action *Keymap::findAction(const char *id) const {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Keymap::ActionArray Keymap::getMappedActions(const Event &event) const {
|
||||
Keymap::KeymapMatch Keymap::getMappedActions(const Event &event, ActionArray &actions) const {
|
||||
// ResidualVM specific START
|
||||
if (event.type == EVENT_JOYAXIS_MOTION) {
|
||||
return ActionArray();
|
||||
return kKeymapMatchNone;
|
||||
}
|
||||
// ResidualVM specific END
|
||||
|
||||
|
@ -136,68 +136,102 @@ Keymap::ActionArray Keymap::getMappedActions(const Event &event) const {
|
|||
case EVENT_KEYUP: {
|
||||
KeyState normalizedKeystate = KeyboardHardwareInputSet::normalizeKeyState(event.kbd);
|
||||
HardwareInput hardwareInput = HardwareInput::createKeyboard("", normalizedKeystate, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
if (!actions.empty()) {
|
||||
return kKeymapMatchExact;
|
||||
}
|
||||
|
||||
if (normalizedKeystate.flags & KBD_NON_STICKY) {
|
||||
// If no matching actions and non-sticky keyboard modifiers are down,
|
||||
// check again for matches without the exact keyboard modifiers
|
||||
for (HardwareActionMap::const_iterator itInput = _hwActionMap.begin(); itInput != _hwActionMap.end(); ++itInput) {
|
||||
if (itInput->_key.type == kHardwareInputTypeKeyboard && itInput->_key.key.keycode == normalizedKeystate.keycode) {
|
||||
int flags = itInput->_key.key.flags;
|
||||
if (flags & KBD_NON_STICKY && (flags & normalizedKeystate.flags) == flags) {
|
||||
actions.push_back(itInput->_value);
|
||||
return kKeymapMatchPartial;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Lastly check again for matches no non-sticky keyboard modifiers
|
||||
normalizedKeystate.flags &= ~KBD_NON_STICKY;
|
||||
hardwareInput = HardwareInput::createKeyboard("", normalizedKeystate, "");
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
return actions.empty() ? kKeymapMatchNone : kKeymapMatchPartial;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EVENT_LBUTTONDOWN:
|
||||
case EVENT_LBUTTONUP: {
|
||||
HardwareInput hardwareInput = HardwareInput::createMouse("", MOUSE_BUTTON_LEFT, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
break;
|
||||
}
|
||||
case EVENT_RBUTTONDOWN:
|
||||
case EVENT_RBUTTONUP: {
|
||||
HardwareInput hardwareInput = HardwareInput::createMouse("", MOUSE_BUTTON_RIGHT, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
break;
|
||||
}
|
||||
case EVENT_MBUTTONDOWN:
|
||||
case EVENT_MBUTTONUP: {
|
||||
HardwareInput hardwareInput = HardwareInput::createMouse("", MOUSE_BUTTON_MIDDLE, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
break;
|
||||
}
|
||||
case Common::EVENT_WHEELUP: {
|
||||
HardwareInput hardwareInput = HardwareInput::createMouse("", MOUSE_WHEEL_UP, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
break;
|
||||
}
|
||||
case Common::EVENT_WHEELDOWN: {
|
||||
HardwareInput hardwareInput = HardwareInput::createMouse("", MOUSE_WHEEL_DOWN, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
break;
|
||||
}
|
||||
case EVENT_X1BUTTONDOWN:
|
||||
case EVENT_X1BUTTONUP: {
|
||||
HardwareInput hardwareInput = HardwareInput::createMouse("", MOUSE_BUTTON_X1, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
break;
|
||||
}
|
||||
case EVENT_X2BUTTONDOWN:
|
||||
case EVENT_X2BUTTONUP: {
|
||||
HardwareInput hardwareInput = HardwareInput::createMouse("", MOUSE_BUTTON_X2, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
break;
|
||||
}
|
||||
case EVENT_JOYBUTTON_DOWN:
|
||||
case EVENT_JOYBUTTON_UP: {
|
||||
HardwareInput hardwareInput = HardwareInput::createJoystickButton("", event.joystick.button, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
break;
|
||||
}
|
||||
case EVENT_JOYAXIS_MOTION: {
|
||||
if (event.joystick.position != 0) {
|
||||
bool positiveHalf = event.joystick.position >= 0;
|
||||
HardwareInput hardwareInput = HardwareInput::createJoystickHalfAxis("", event.joystick.axis, positiveHalf, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
} else {
|
||||
// Axis position zero is part of both half axes, and triggers actions bound to both
|
||||
Keymap::ActionArray actions;
|
||||
HardwareInput hardwareInputPos = HardwareInput::createJoystickHalfAxis("", event.joystick.axis, true, "");
|
||||
HardwareInput hardwareInputNeg = HardwareInput::createJoystickHalfAxis("", event.joystick.axis, false, "");
|
||||
actions.push_back(_hwActionMap[hardwareInputPos]);
|
||||
actions.push_back(_hwActionMap[hardwareInputNeg]);
|
||||
return actions;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EVENT_CUSTOM_BACKEND_HARDWARE: {
|
||||
HardwareInput hardwareInput = HardwareInput::createCustom("", event.customType, "");
|
||||
return _hwActionMap[hardwareInput];
|
||||
actions.push_back(_hwActionMap[hardwareInput]);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return ActionArray();
|
||||
break;
|
||||
}
|
||||
|
||||
return actions.empty() ? kKeymapMatchNone : kKeymapMatchExact;
|
||||
}
|
||||
|
||||
void Keymap::setConfigDomain(ConfigManager::Domain *configDomain) {
|
||||
|
|
|
@ -72,6 +72,12 @@ public:
|
|||
kKeymapTypeGame
|
||||
};
|
||||
|
||||
enum KeymapMatch {
|
||||
kKeymapMatchNone,
|
||||
kKeymapMatchPartial,
|
||||
kKeymapMatchExact
|
||||
};
|
||||
|
||||
typedef Array<Action *> ActionArray;
|
||||
|
||||
Keymap(KeymapType type, const String &id, const String &description);
|
||||
|
@ -109,9 +115,10 @@ public:
|
|||
/**
|
||||
* Find the Actions that a hardware input is mapped to
|
||||
* @param hardwareInput the input that is mapped to the required Action
|
||||
* @return an array containing pointers to the actions
|
||||
* @param actions an array containing pointers to the actions
|
||||
* @return the matching status for the retieved actions
|
||||
*/
|
||||
ActionArray getMappedActions(const Event &event) const;
|
||||
KeymapMatch getMappedActions(const Event &event, ActionArray &actions) const;
|
||||
|
||||
/**
|
||||
* Adds a new Action to this Map
|
||||
|
|
|
@ -170,44 +170,21 @@ List<Event> Keymapper::mapEvent(const Event &ev) {
|
|||
|
||||
hardcodedEventMapping(ev);
|
||||
|
||||
List<Event> mappedEvents;
|
||||
bool matchedAction = mapEvent(ev, _enabledKeymapType, mappedEvents);
|
||||
if (!matchedAction) {
|
||||
// If we found actions matching this input in the game / gui keymaps,
|
||||
Keymap::ActionArray actions;
|
||||
Keymap::KeymapMatch match = getMappedActions(ev, actions, _enabledKeymapType);
|
||||
if (match != Keymap::kKeymapMatchExact) {
|
||||
// If we found exact matching actions this input in the game / gui keymaps,
|
||||
// no need to look at the global keymaps. An input resulting in actions
|
||||
// from system and game keymaps would lead to unexpected user experience.
|
||||
matchedAction = mapEvent(ev, Keymap::kKeymapTypeGlobal, mappedEvents);
|
||||
}
|
||||
|
||||
if (ev.type == EVENT_JOYAXIS_MOTION && ev.joystick.axis < ARRAYSIZE(_joystickAxisPreviouslyPressed)) {
|
||||
if (ABS<int32>(ev.joystick.position) >= kJoyAxisPressedTreshold) {
|
||||
_joystickAxisPreviouslyPressed[ev.joystick.axis] = true;
|
||||
} else if (ABS<int32>(ev.joystick.position) < kJoyAxisUnpressedTreshold) {
|
||||
_joystickAxisPreviouslyPressed[ev.joystick.axis] = false;
|
||||
Keymap::ActionArray globalActions;
|
||||
match = getMappedActions(ev, globalActions, Keymap::kKeymapTypeGlobal);
|
||||
if (match == Keymap::kKeymapMatchExact || actions.empty()) {
|
||||
actions = globalActions;
|
||||
}
|
||||
}
|
||||
|
||||
if (!matchedAction) {
|
||||
// if it didn't get mapped, just pass it through
|
||||
mappedEvents.push_back(ev);
|
||||
}
|
||||
|
||||
return mappedEvents;
|
||||
}
|
||||
|
||||
bool Keymapper::mapEvent(const Event &ev, Keymap::KeymapType keymapType, List<Event> &mappedEvents) {
|
||||
bool matchedAction = false;
|
||||
|
||||
for (uint i = 0; i < _keymaps.size(); i++) {
|
||||
if (!_keymaps[i]->isEnabled() || _keymaps[i]->getType() != keymapType) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Keymap::ActionArray actions = _keymaps[i]->getMappedActions(ev);
|
||||
if (!actions.empty()) {
|
||||
matchedAction = true;
|
||||
}
|
||||
|
||||
bool matchedAction = !actions.empty();
|
||||
List<Event> mappedEvents;
|
||||
for (Keymap::ActionArray::const_iterator it = actions.begin(); it != actions.end(); it++) {
|
||||
Event mappedEvent = executeAction(*it, ev);
|
||||
if (mappedEvent.type == EVENT_INVALID) {
|
||||
|
@ -228,9 +205,42 @@ bool Keymapper::mapEvent(const Event &ev, Keymap::KeymapType keymapType, List<Ev
|
|||
|
||||
mappedEvents.push_back(mappedEvent);
|
||||
}
|
||||
|
||||
if (ev.type == EVENT_JOYAXIS_MOTION && ev.joystick.axis < ARRAYSIZE(_joystickAxisPreviouslyPressed)) {
|
||||
if (ABS<int32>(ev.joystick.position) >= kJoyAxisPressedTreshold) {
|
||||
_joystickAxisPreviouslyPressed[ev.joystick.axis] = true;
|
||||
} else if (ABS<int32>(ev.joystick.position) < kJoyAxisUnpressedTreshold) {
|
||||
_joystickAxisPreviouslyPressed[ev.joystick.axis] = false;
|
||||
}
|
||||
}
|
||||
|
||||
return matchedAction;
|
||||
if (!matchedAction) {
|
||||
// if it didn't get mapped, just pass it through
|
||||
mappedEvents.push_back(ev);
|
||||
}
|
||||
|
||||
return mappedEvents;
|
||||
}
|
||||
|
||||
Keymap::KeymapMatch Keymapper::getMappedActions(const Event &event, Keymap::ActionArray &actions, Keymap::KeymapType keymapType) const {
|
||||
Keymap::KeymapMatch match = Keymap::kKeymapMatchNone;
|
||||
|
||||
for (uint i = 0; i < _keymaps.size(); i++) {
|
||||
if (!_keymaps[i]->isEnabled() || _keymaps[i]->getType() != keymapType) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Keymap::ActionArray array;
|
||||
Keymap::KeymapMatch match2 = _keymaps[i]->getMappedActions(event, array);
|
||||
if (match2 == match) {
|
||||
actions.push_back(array);
|
||||
} else if (match2 > match) {
|
||||
match = match2;
|
||||
actions.clear();
|
||||
actions.push_back(array);
|
||||
}
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
||||
Keymapper::IncomingEventType Keymapper::convertToIncomingEventType(const Event &ev) const {
|
||||
|
|
|
@ -150,7 +150,7 @@ private:
|
|||
|
||||
bool _joystickAxisPreviouslyPressed[6];
|
||||
|
||||
bool mapEvent(const Event &ev, Keymap::KeymapType keymapType, List<Event> &mappedEvents);
|
||||
Keymap::KeymapMatch getMappedActions(const Event &event, Keymap::ActionArray &actions, Keymap::KeymapType keymapType) const;
|
||||
Event executeAction(const Action *act, const Event &incomingEvent);
|
||||
EventType convertStartToEnd(EventType eventType);
|
||||
IncomingEventType convertToIncomingEventType(const Event &ev) const;
|
||||
|
|
|
@ -274,7 +274,7 @@ void RemapWidget::refreshKeymap() {
|
|||
ActionRow &row = _actions[i];
|
||||
|
||||
if (!row.actionText) {
|
||||
row.actionText = new GUI::StaticTextWidget(widgetsBoss(), 0, 0, 0, 0, "", Graphics::kTextAlignLeft, nullptr, GUI::ThemeEngine::kFontStyleNormal);
|
||||
row.actionText = new GUI::StaticTextWidget(widgetsBoss(), 0, 0, 0, 0, "", Graphics::kTextAlignStart, nullptr, GUI::ThemeEngine::kFontStyleNormal);
|
||||
row.actionText->setLabel(row.action->description);
|
||||
|
||||
row.keyButton = new GUI::DropdownButtonWidget(widgetsBoss(), 0, 0, 0, 0, "", nullptr, kRemapCmd + i);
|
||||
|
@ -303,7 +303,7 @@ void RemapWidget::refreshKeymap() {
|
|||
|
||||
KeymapTitleRow &keymapTitle = _keymapSeparators[row.keymap];
|
||||
if (!keymapTitle.descriptionText) {
|
||||
keymapTitle.descriptionText = new GUI::StaticTextWidget(widgetsBoss(), 0, 0, 0, 0, row.keymap->getDescription(), Graphics::kTextAlignLeft);
|
||||
keymapTitle.descriptionText = new GUI::StaticTextWidget(widgetsBoss(), 0, 0, 0, 0, row.keymap->getDescription(), Graphics::kTextAlignStart);
|
||||
keymapTitle.resetButton = new GUI::ButtonWidget(widgetsBoss(), 0, 0, 0, 0, "", nullptr, kResetKeymapCmd + i);
|
||||
|
||||
// I18N: Button to reset keymap mappings to defaults
|
||||
|
|
|
@ -146,14 +146,12 @@ static uint32 roundDownPowerOfTwo(uint32 samples) {
|
|||
SDL_AudioSpec SdlMixerManager::getAudioSpec(uint32 outputRate) {
|
||||
SDL_AudioSpec desired;
|
||||
|
||||
const char *const appDomain = Common::ConfigManager::kApplicationDomain;
|
||||
|
||||
// There was once a GUI option for this, but it was never used;
|
||||
// configurability is retained for advanced users only who wish to modify
|
||||
// their ScummVM config file directly
|
||||
// There was once a GUI option for this, which was removed. Configurability
|
||||
// is retained for advanced users only who wish to use the commandline
|
||||
// option (--output-rate) or modify their ScummVM config file directly.
|
||||
uint32 freq = 0;
|
||||
if (ConfMan.hasKey("output_rate", appDomain))
|
||||
freq = ConfMan.getInt("output_rate", appDomain);
|
||||
if (ConfMan.hasKey("output_rate"))
|
||||
freq = ConfMan.getInt("output_rate");
|
||||
if (freq <= 0)
|
||||
freq = outputRate;
|
||||
|
||||
|
@ -164,8 +162,8 @@ SDL_AudioSpec SdlMixerManager::getAudioSpec(uint32 outputRate) {
|
|||
// characteristics which are not easily measured, so allow advanced users to
|
||||
// tweak their audio buffer size if they are experience excess latency or
|
||||
// drop-outs by setting this value in their ScummVM config file directly
|
||||
if (ConfMan.hasKey("audio_buffer_size", appDomain))
|
||||
samples = ConfMan.getInt("audio_buffer_size", appDomain);
|
||||
if (ConfMan.hasKey("audio_buffer_size", Common::ConfigManager::kApplicationDomain))
|
||||
samples = ConfMan.getInt("audio_buffer_size", Common::ConfigManager::kApplicationDomain);
|
||||
|
||||
// 256 is an arbitrary minimum; 32768 is the largest power-of-two value
|
||||
// representable with uint16
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "gui/EventRecorder.h"
|
||||
|
||||
#include "audio/mixer.h"
|
||||
#include "common/timer.h"
|
||||
#include "graphics/pixelformat.h"
|
||||
#include "graphics/pixelbuffer.h" // ResidualVM specific:
|
||||
|
||||
|
@ -44,6 +45,9 @@ ModularBackend::~ModularBackend() {
|
|||
_graphicsManager = 0;
|
||||
delete _mixer;
|
||||
_mixer = 0;
|
||||
// _timerManager needs to be deleted before _mutexManager to avoid a crash.
|
||||
delete _timerManager;
|
||||
_timerManager = 0;
|
||||
delete _mutexManager;
|
||||
_mutexManager = 0;
|
||||
}
|
||||
|
|
|
@ -14,10 +14,14 @@ ifdef DIST_FILES_NETWORKING
|
|||
endif
|
||||
ifdef DIST_FILES_VKEYBD
|
||||
cp $(DIST_FILES_VKEYBD) ps3pkg/USRDIR/data/
|
||||
endif
|
||||
ifdef DIST_PS3_EXTRA_FILES
|
||||
@cp -a $(DIST_PS3_EXTRA_FILES) ps3pkg/USRDIR/data/
|
||||
endif
|
||||
cp $(DIST_FILES_DOCS) ps3pkg/USRDIR/doc/
|
||||
cp $(srcdir)/dists/ps3/readme-ps3.md ps3pkg/USRDIR/doc/
|
||||
cp $(srcdir)/dists/ps3/ICON0.PNG ps3pkg/
|
||||
cp $(srcdir)/dists/ps3/PIC1.PNG ps3pkg/
|
||||
sfo.py -f $(srcdir)/dists/ps3/sfo.xml ps3pkg/PARAM.SFO
|
||||
pkg.py --contentid UP0001-RESI12000_00-0000000000000000 ps3pkg/ residualvm-ps3.pkg
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#define _WIN32_IE 0x500
|
||||
#endif
|
||||
#include <shlobj.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include "common/scummsys.h"
|
||||
#include "common/config-manager.h"
|
||||
|
@ -436,9 +437,11 @@ char *OSystem_Win32::convertEncoding(const char* to, const char *from, const cha
|
|||
#endif
|
||||
// UTF-32 is really important for us, because it is used for the
|
||||
// transliteration in Common::Encoding and Win32 cannot convert it
|
||||
Common::String tempString;
|
||||
if (Common::String(from).hasPrefixIgnoreCase("utf-32")) {
|
||||
Common::U32String UTF32Str((const uint32 *)string, length / 4);
|
||||
string = Common::convertUtf32ToUtf8(UTF32Str).c_str();
|
||||
tempString = Common::convertUtf32ToUtf8(UTF32Str);
|
||||
string = tempString.c_str();
|
||||
from = "utf-8";
|
||||
}
|
||||
if (Common::String(to).hasPrefixIgnoreCase("utf-32")) {
|
||||
|
|
|
@ -100,7 +100,7 @@ static const char HELP_STRING[] =
|
|||
" -g, --gfx-mode=MODE Select graphics scaler (1x,2x,3x,2xsai,super2xsai,\n"
|
||||
" supereagle,advmame2x,advmame3x,hq2x,hq3x,tv2x,\n"
|
||||
" dotmatrix)\n"
|
||||
" --stretch-mode=MODE Select stretch mode (center, integral, fit, stretch)"
|
||||
" --stretch-mode=MODE Select stretch mode (center, integral, fit, stretch)\n"
|
||||
" --filtering Force filtered graphics mode\n"
|
||||
" --no-filtering Force unfiltered graphics mode\n"
|
||||
#endif
|
||||
|
|
|
@ -555,13 +555,17 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
|
|||
#endif
|
||||
#ifdef USE_TTS
|
||||
Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
|
||||
if (ttsMan != nullptr) {
|
||||
ttsMan->pushState();
|
||||
}
|
||||
#endif
|
||||
// Try to run the game
|
||||
Common::Error result = runGame(plugin, system, specialDebug);
|
||||
|
||||
#ifdef USE_TTS
|
||||
if (ttsMan != nullptr) {
|
||||
ttsMan->popState();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_EVENTRECORDER
|
||||
|
@ -586,13 +590,13 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
|
|||
}
|
||||
|
||||
// Quit unless an error occurred, or Return to launcher was requested
|
||||
#ifndef FORCE_RTL
|
||||
if (result.getCode() == Common::kNoError && !g_system->getEventManager()->shouldRTL())
|
||||
#ifndef FORCE_RETURN_TO_LAUNCHER
|
||||
if (result.getCode() == Common::kNoError && !g_system->getEventManager()->shouldReturnToLauncher())
|
||||
break;
|
||||
#endif
|
||||
// Reset RTL flag in case we want to load another engine
|
||||
g_system->getEventManager()->resetRTL();
|
||||
#ifdef FORCE_RTL
|
||||
// Reset the return to launcher flag in case we want to load another engine
|
||||
g_system->getEventManager()->resetReturnToLauncher();
|
||||
#ifdef FORCE_RETURN_TO_LAUNCHER
|
||||
g_system->getEventManager()->resetQuit();
|
||||
#endif
|
||||
#ifdef ENABLE_EVENTRECORDER
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
MODULE := base
|
||||
|
||||
MODULE_OBJS := \
|
||||
test_new_standards.o \
|
||||
main.o \
|
||||
commandLine.o \
|
||||
plugins.o \
|
||||
|
|
322
base/test_new_standards.cpp
Normal file
322
base/test_new_standards.cpp
Normal file
|
@ -0,0 +1,322 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
// This file does nothing functional!
|
||||
// It test support for main C++11 features
|
||||
// In the future, it might be extended to test also C++14, C++17, C++20 and any future standard
|
||||
//
|
||||
// In order to enable the tests, we have to `define ENABLE_TEST_CPP_11` (and of course, compile this file)
|
||||
// Then it should print "Testing C++11" *during compilation*
|
||||
// If the message is printed, and there are no compilation errors - great, C++11 is supported on this platform
|
||||
// If there are errors, each one of the tests can be disabled, by defining the relevant DONT_TEST_*
|
||||
// It's important to disable failing tests, because we might decide to support only specific subset of C++11
|
||||
//
|
||||
// Note: there are 3 warnings in my GCC run, they have no signficance
|
||||
|
||||
#if defined(NONSTANDARD_PORT)
|
||||
#include "portdefs.h"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_TEST_CPP_11
|
||||
#pragma message("Testing C++11")
|
||||
// The tests are based on https://blog.petrzemek.net/2014/12/07/improving-cpp98-code-with-cpp11/
|
||||
// See there for further links and explanations
|
||||
//
|
||||
// We're not testing `nullptr` and `override`, since they're defined in common/c++11-compat.h
|
||||
|
||||
#include "common/array.h"
|
||||
#include "common/hashmap.h"
|
||||
#include "common/hash-str.h"
|
||||
#include "common/rect.h"
|
||||
|
||||
#ifndef DONT_TEST_INITIALIZIER_LIST1
|
||||
#ifndef USE_INITIALIZIER_LIST_REPLACEMENT
|
||||
#include <initializer_list>
|
||||
#else
|
||||
namespace std {
|
||||
template<class T> class initializer_list {
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef const T& reference;
|
||||
typedef const T& const_reference;
|
||||
typedef size_t size_type;
|
||||
typedef const T* iterator;
|
||||
typedef const T* const_iterator;
|
||||
|
||||
constexpr initializer_list() noexcept = default;
|
||||
constexpr size_t size() const noexcept { return m_size; };
|
||||
constexpr const T* begin() const noexcept { return m_begin; };
|
||||
constexpr const T* end() const noexcept { return m_begin + m_size; }
|
||||
|
||||
private:
|
||||
// Note: begin has to be first or the compiler gets very upset
|
||||
const T* m_begin = { nullptr };
|
||||
size_t m_size = { 0 };
|
||||
|
||||
// The compiler is allowed to call this constructor
|
||||
constexpr initializer_list(const T* t, size_t s) noexcept : m_begin(t) , m_size(s) {}
|
||||
};
|
||||
|
||||
template<class T> constexpr const T* begin(initializer_list<T> il) noexcept {
|
||||
return il.begin();
|
||||
}
|
||||
|
||||
template<class T> constexpr const T* end(initializer_list<T> il) noexcept {
|
||||
return il.end();
|
||||
}
|
||||
} // end namespace std
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_CLASS_ENUM
|
||||
// ----------------------------------
|
||||
// Scoped/Strongly Typed Enumerations
|
||||
// ----------------------------------
|
||||
enum class MyEnum {
|
||||
VAL1,
|
||||
VAL2,
|
||||
VAL3
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_FINAL_CLASS
|
||||
// ----------------------------------
|
||||
// Non-Inheritable Classes (final)
|
||||
// ----------------------------------
|
||||
// C++11
|
||||
class TestNewStandards final {
|
||||
#else
|
||||
class TestNewStandards {
|
||||
#endif
|
||||
private:
|
||||
void do_nothing(const int &i) {
|
||||
// don't do anything with i
|
||||
};
|
||||
|
||||
#ifndef DONT_TEST_FINAL_FUNCTION
|
||||
// ----------------------------------
|
||||
// Non-Overridable Member Functions (final)
|
||||
// ----------------------------------
|
||||
virtual void f() final {}
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_VARIADIC_TEMPLATES
|
||||
// ------------------------
|
||||
// Variadic Templates
|
||||
// ------------------------
|
||||
template <typename T>
|
||||
void variadic_function(const T &value) {
|
||||
do_nothing(value);
|
||||
}
|
||||
|
||||
template <typename U, typename... T>
|
||||
void variadic_function(const U &head, const T &... tail) {
|
||||
do_nothing(head);
|
||||
variadic_function(tail...);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_TYPE_ALIASES
|
||||
// ------------------------
|
||||
// Type Aliases
|
||||
// * note - this test has another bunch of code below
|
||||
// ------------------------
|
||||
// C++98
|
||||
template<typename T>
|
||||
struct Dictionary_98 {
|
||||
typedef Common::HashMap<Common::String, T, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> type;
|
||||
};
|
||||
// Usage:
|
||||
Dictionary_98<int>::type d98;
|
||||
|
||||
// C++11
|
||||
template <typename T>
|
||||
using Dictionary_11 = Common::HashMap<Common::String, T, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>;
|
||||
// Usage:
|
||||
Dictionary_11<int> d11;
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_INITIALIZIER_LIST1
|
||||
// Array with C++11 initialization list
|
||||
template<class T> class ArrayCpp11 : public Common::Array<T> {
|
||||
public:
|
||||
ArrayCpp11(std::initializer_list<T> list) {
|
||||
if (list.size()) {
|
||||
this->allocCapacity(list.size());
|
||||
Common::uninitialized_copy(list.begin(), list.end(), this->_storage);
|
||||
}
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
void test_cpp11() {
|
||||
#ifdef DONT_TEST_INITIALIZIER_LIST1
|
||||
// ------------------------
|
||||
// Initializer list
|
||||
// ------------------------
|
||||
// C++98
|
||||
Common::Array<int> arr;
|
||||
arr.push_back(1);
|
||||
arr.push_back(2);
|
||||
arr.push_back(3);
|
||||
#else
|
||||
// C++11
|
||||
ArrayCpp11<int> arr = {1, 2, 3};
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_INITIALIZIER_LIST2
|
||||
// C++11
|
||||
Common::Point arr3[] = {{0, 0}, {1, 1}};
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_AUTO_TYPE_INFERENCE
|
||||
// ------------------------
|
||||
// Automatic Type Inference
|
||||
// ------------------------
|
||||
// C++98
|
||||
for (Common::Array<int>::iterator i = arr.begin(), e = arr.end(); i != e; ++i)
|
||||
;
|
||||
|
||||
// C++11
|
||||
for (auto i = arr.begin(), e = arr.end(); i != e; ++i)
|
||||
;
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_RANGE_BASED_FOR_LOOP
|
||||
// ------------------------
|
||||
// Range based for loop
|
||||
// ------------------------
|
||||
// C++98
|
||||
for (Common::Array<int>::iterator i = arr.begin(), e = arr.end(); i != e; ++i)
|
||||
do_nothing(*i);
|
||||
|
||||
// C++11
|
||||
for (int &i : arr)
|
||||
do_nothing(i);
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_LAMBDA_FUNCTIONS
|
||||
// ------------------------
|
||||
// Lambda functions
|
||||
// ------------------------
|
||||
// C++98
|
||||
// the following isn't working in VS, but it's not really important to debug...
|
||||
// Common::for_each(arr.begin(), arr.end(), do_nothing);
|
||||
|
||||
// C++11
|
||||
Common::for_each(arr.begin(), arr.end(),
|
||||
[](int i) {
|
||||
// don't do anything with i
|
||||
}
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_VARIADIC_TEMPLATES
|
||||
variadic_function(1, 1, 2, 3, 5, 8, 13, 21, 34);
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_GET_RID_OF_SPACE_IN_NESTED_TEMPLATES
|
||||
// ------------------------
|
||||
// No Need For an Extra Space In Nested Template Declarations
|
||||
// ------------------------
|
||||
// C++98
|
||||
Common::Array<Common::Array<int> > v_98;
|
||||
|
||||
// C++11
|
||||
Common::Array<Common::Array<int>> v_11;
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_TYPE_ALIASES
|
||||
// ------------------------
|
||||
// Type Aliases
|
||||
// * note - this test has another bunch of code above
|
||||
// ------------------------
|
||||
// C++98
|
||||
typedef void (*fp_98)(int, int);
|
||||
|
||||
// C++11
|
||||
using fp_11 = void (*)(int, int);
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#ifndef DONT_TEST_ALT_FUNCTION_SYNTAX
|
||||
// ------------------------
|
||||
// Alternative Function Syntax
|
||||
// ------------------------
|
||||
// C++98
|
||||
int f_98(int x, int y) {return x;}
|
||||
|
||||
// C++11
|
||||
auto f_11(int x, int y) -> int {return x;}
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_NON_STATIC_INIT
|
||||
// ------------------------
|
||||
// Non-Static Data Member Initializers
|
||||
// ------------------------
|
||||
int j = 3;
|
||||
Common::String s = "non static init";
|
||||
#endif
|
||||
|
||||
#ifndef DONT_TEST_EXPLICIT
|
||||
// ------------------------
|
||||
// Explicit Conversion Operators
|
||||
// ------------------------
|
||||
explicit operator bool() const {return true;}
|
||||
#endif
|
||||
|
||||
|
||||
public:
|
||||
TestNewStandards() {
|
||||
test_cpp11();
|
||||
}
|
||||
|
||||
#ifndef DONT_TEST_MOVE_SEMANTICS
|
||||
// ------------------------
|
||||
// Move semantics
|
||||
// Note: this test hasn't been taken from the aforementioned web page
|
||||
// ------------------------
|
||||
TestNewStandards(TestNewStandards&& t) {
|
||||
// I'm not convinced that it's a good example of move sematics, it's a complicated topic. But just checking the syntax.
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef DONT_TEST_DELETED_FUNCTIONS
|
||||
// ------------------------
|
||||
// Explicitly Deleted Functions
|
||||
// (useful for non copyable classes,
|
||||
// particularly for our Singleton class)
|
||||
// ------------------------
|
||||
TestNewStandards &operator=(const TestNewStandards &) = delete;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
static TestNewStandards test = TestNewStandards();
|
||||
|
||||
#endif
|
|
@ -39,12 +39,13 @@
|
|||
#endif
|
||||
|
||||
//
|
||||
// Replacement for the override keyword. This allows compilation of code
|
||||
// which uses it, but does not feature any semantic.
|
||||
// Replacement for the override & final keywords. This allows compilation of
|
||||
// code which uses it, but does not feature any semantic.
|
||||
//
|
||||
// MSVC 2012 and newer fully support override: http://msdn.microsoft.com/en-us/library/hh567368.aspx
|
||||
// MSVC 2012 and newer fully support these: http://msdn.microsoft.com/en-us/library/hh567368.aspx
|
||||
#if !defined(_MSC_VER) || _MSC_VER < 1700
|
||||
#define override
|
||||
#define final
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -527,6 +527,19 @@ void ConfigManager::set(const String &key, const String &value) {
|
|||
_appDomain[key] = value;
|
||||
}
|
||||
|
||||
void ConfigManager::setAndFlush(const String &key, const Common::String &value) {
|
||||
if (value.empty() && !hasKey(key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasKey(key) && get(key) == value) {
|
||||
return;
|
||||
}
|
||||
|
||||
set(key, value);
|
||||
flushToDisk();
|
||||
}
|
||||
|
||||
void ConfigManager::set(const String &key, const String &value, const String &domName) {
|
||||
// FIXME: For now we continue to allow empty domName to indicate
|
||||
// "use 'default' domain". This is mainly needed for the SCUMM ConfigDialog
|
||||
|
|
|
@ -118,6 +118,12 @@ public:
|
|||
const String & get(const String &key) const;
|
||||
void set(const String &key, const String &value);
|
||||
|
||||
/**
|
||||
* Update a configuration entry for the active domain and flush
|
||||
* the configuration file to disk if the value changed
|
||||
*/
|
||||
void setAndFlush(const String &key, const Common::String &value);
|
||||
|
||||
#if 1
|
||||
//
|
||||
// Domain specific access methods: Acces *one specific* domain and modify it.
|
||||
|
|
|
@ -60,7 +60,7 @@ enum EventType {
|
|||
EVENT_MBUTTONUP = 14,
|
||||
|
||||
EVENT_MAINMENU = 15,
|
||||
EVENT_RTL = 16,
|
||||
EVENT_RETURN_TO_LAUNCHER = 16,
|
||||
EVENT_MUTE = 17,
|
||||
|
||||
EVENT_QUIT = 10,
|
||||
|
@ -504,14 +504,14 @@ public:
|
|||
/**
|
||||
* Should we return to the launcher?
|
||||
*/
|
||||
virtual int shouldRTL() const = 0;
|
||||
virtual int shouldReturnToLauncher() const = 0;
|
||||
|
||||
/**
|
||||
* Reset the "return to launcher" flag (as returned shouldRTL()) to false.
|
||||
* Reset the "return to launcher" flag (as returned shouldReturnToLauncher()) to false.
|
||||
* Used when we have returned to the launcher.
|
||||
*/
|
||||
virtual void resetRTL() = 0;
|
||||
#ifdef FORCE_RTL
|
||||
virtual void resetReturnToLauncher() = 0;
|
||||
#ifdef FORCE_RETURN_TO_LAUNCHER
|
||||
virtual void resetQuit() = 0;
|
||||
#endif
|
||||
// Optional: check whether a given key is currently pressed ????
|
||||
|
|
|
@ -128,12 +128,7 @@ const String getGameGUIOptionsDescription(const String &options) {
|
|||
|
||||
void updateGameGUIOptions(const String &options, const String &langOption) {
|
||||
const String newOptionString = getGameGUIOptionsDescription(options) + " " + langOption;
|
||||
|
||||
if ((!options.empty() && !ConfMan.hasKey("guioptions")) ||
|
||||
(ConfMan.hasKey("guioptions") && ConfMan.get("guioptions") != newOptionString)) {
|
||||
ConfMan.set("guioptions", newOptionString);
|
||||
ConfMan.flushToDisk();
|
||||
}
|
||||
ConfMan.setAndFlush("guioptions", newOptionString);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#include "common/str.h"
|
||||
|
||||
// Win32 incompatibilities
|
||||
#if defined(WIN32) && !defined(__GNUC__)
|
||||
#if (defined(WIN32) && !defined(__GNUC__)) || defined(__PLAYSTATION2__)
|
||||
static inline bool isnan(double x) {
|
||||
return x != x;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ const LanguageDescription g_languages[] = {
|
|||
{ "kr", "ko_KR", "Korean", KO_KOR },
|
||||
{ "lv", "lv_LV", "Latvian", LV_LAT },
|
||||
{ "nb", "nb_NO", "Norwegian Bokm\xE5l", NB_NOR },
|
||||
{ "fa", "fa_IR", "Persian (Iran)", FA_IRN },
|
||||
{ "pl", "pl_PL", "Polish", PL_POL },
|
||||
{ "br", "pt_BR", "Portuguese (Brazil)", PT_BRA },
|
||||
{ "pt", "pt_PT", "Portuguese (Portugal)", PT_POR },
|
||||
|
|
|
@ -55,6 +55,7 @@ enum Language {
|
|||
KO_KOR,
|
||||
LV_LAT,
|
||||
NB_NOR,
|
||||
FA_IRN,
|
||||
PL_POL,
|
||||
PT_BRA,
|
||||
PT_POR,
|
||||
|
|
|
@ -162,7 +162,8 @@ bool MacResManager::open(const String &fileName) {
|
|||
if (file->open(fileName)) {
|
||||
_baseFileName = fileName;
|
||||
|
||||
// FIXME: Is this really needed?
|
||||
// Maybe file is in MacBinary but without .bin extension?
|
||||
// Check it here
|
||||
if (isMacBinary(*file)) {
|
||||
file->seek(0);
|
||||
if (loadFromMacBinary(*file))
|
||||
|
|
|
@ -166,6 +166,8 @@ public:
|
|||
*/
|
||||
String getBaseFileName() const { return _baseFileName; }
|
||||
|
||||
void setBaseFileName(Common::String str) { _baseFileName = str; }
|
||||
|
||||
/**
|
||||
* Return list of resource IDs with specified type ID
|
||||
*/
|
||||
|
|
|
@ -163,6 +163,11 @@ inline T deg2rad(T deg) {
|
|||
return deg2rad<T,T>(deg);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T hypotenuse(T xv, T yv) {
|
||||
return (T)sqrt((double)(xv * xv + yv * yv));
|
||||
}
|
||||
|
||||
} // End of namespace Common
|
||||
|
||||
#endif // COMMON_MATH_H
|
||||
|
|
|
@ -40,6 +40,7 @@ MODULE_OBJS := \
|
|||
tokenizer.o \
|
||||
translation.o \
|
||||
unarj.o \
|
||||
unicode-bidi.o \
|
||||
unzip.o \
|
||||
ustr.o \
|
||||
util.o \
|
||||
|
|
|
@ -249,6 +249,23 @@ static const uint32 g_windows1255ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x
|
|||
0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
|
||||
0x05E8, 0x05E9, 0x05EA, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x00FF};
|
||||
|
||||
static const uint32 g_windows1256ConversionTable[] = {0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
|
||||
0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688,
|
||||
0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
|
||||
0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA,
|
||||
0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
|
||||
0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
|
||||
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
|
||||
0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F,
|
||||
0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
|
||||
0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
|
||||
0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7,
|
||||
0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643,
|
||||
0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7,
|
||||
0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
|
||||
0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7,
|
||||
0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2};
|
||||
|
||||
static const uint32 g_windows1257ConversionTable[] = {0x20AC, 0x0081, 0x201A, 0x0083, 0x201E, 0x2026, 0x2020, 0x2021,
|
||||
0x0088, 0x2030, 0x008A, 0x2039, 0x008C, 0x00A8, 0x02C7, 0x00B8,
|
||||
0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
|
||||
|
@ -276,6 +293,7 @@ static char const *const g_codePageMap[] = {
|
|||
"WINDOWS-1253", /* kWindows1253 */
|
||||
"WINDOWS-1254", /* kWindows1254 */
|
||||
"WINDOWS-1255", /* kWindows1255 */
|
||||
"WINDOWS-1256", /* kWindows1256 */
|
||||
"WINDOWS-1257", /* kWindows1257 */
|
||||
"MS932", /* kWindows932 */
|
||||
"MSCP949", /* kWindows949 */
|
||||
|
@ -310,6 +328,9 @@ void String::decodeOneByte(U32String &dst, CodePage page) const {
|
|||
case kWindows1255:
|
||||
dst += g_windows1255ConversionTable[index];
|
||||
break;
|
||||
case kWindows1256:
|
||||
dst += g_windows1256ConversionTable[index];
|
||||
break;
|
||||
case kWindows1257:
|
||||
dst += g_windows1257ConversionTable[index];
|
||||
break;
|
||||
|
@ -363,6 +384,9 @@ void U32String::encodeOneByte(String &dst, CodePage page) const {
|
|||
case kWindows1255:
|
||||
conversionTable = g_windows1255ConversionTable;
|
||||
break;
|
||||
case kWindows1256:
|
||||
conversionTable = g_windows1256ConversionTable;
|
||||
break;
|
||||
case kWindows1257:
|
||||
conversionTable = g_windows1257ConversionTable;
|
||||
break;
|
||||
|
|
|
@ -37,6 +37,7 @@ enum CodePage {
|
|||
kWindows1253,
|
||||
kWindows1254,
|
||||
kWindows1255,
|
||||
kWindows1256,
|
||||
kWindows1257,
|
||||
kWindows932,
|
||||
kWindows949,
|
||||
|
|
|
@ -1323,3 +1323,22 @@ char *scumm_strdup(const char *in) {
|
|||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// Portable implementation of strcasestr.
|
||||
const char *scumm_strcasestr(const char *s, const char *find) {
|
||||
char c, sc;
|
||||
size_t len;
|
||||
|
||||
if ((c = *find++) != 0) {
|
||||
c = (char)tolower((unsigned char)c);
|
||||
len = strlen(find);
|
||||
do {
|
||||
do {
|
||||
if ((sc = *s++) == 0)
|
||||
return (NULL);
|
||||
} while ((char)tolower((unsigned char)sc) != c);
|
||||
} while (scumm_strnicmp(s, find, len) != 0);
|
||||
s--;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
|
|
@ -568,4 +568,6 @@ extern char *scumm_strdup(const char *in);
|
|||
extern int scumm_compareDictionary(const char *s1, const char *s2);
|
||||
extern const char *scumm_skipArticle(const char *s1);
|
||||
|
||||
extern const char *scumm_strcasestr(const char *s, const char *find);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -124,7 +124,7 @@ enum {
|
|||
CR = 0x0D
|
||||
};
|
||||
|
||||
char *SeekableReadStream::readLine(char *buf, size_t bufSize) {
|
||||
char *SeekableReadStream::readLine(char *buf, size_t bufSize, bool handleCR) {
|
||||
assert(buf != nullptr && bufSize > 1);
|
||||
char *p = buf;
|
||||
size_t len = 0;
|
||||
|
@ -159,7 +159,7 @@ char *SeekableReadStream::readLine(char *buf, size_t bufSize) {
|
|||
// * DOS and Windows use CRLF line breaks
|
||||
// * Unix and OS X use LF line breaks
|
||||
// * Macintosh before OS X used CR line breaks
|
||||
if (c == CR) {
|
||||
if (c == CR && handleCR) {
|
||||
// Look at the next char -- is it LF? If not, seek back
|
||||
c = readByte();
|
||||
|
||||
|
@ -187,12 +187,12 @@ char *SeekableReadStream::readLine(char *buf, size_t bufSize) {
|
|||
return buf;
|
||||
}
|
||||
|
||||
String SeekableReadStream::readLine() {
|
||||
String SeekableReadStream::readLine(bool handleCR) {
|
||||
// Read a line
|
||||
String line;
|
||||
while (line.lastChar() != '\n') {
|
||||
char buf[256];
|
||||
if (!readLine(buf, 256))
|
||||
if (!readLine(buf, 256, handleCR))
|
||||
break;
|
||||
line += buf;
|
||||
}
|
||||
|
|
|
@ -629,9 +629,10 @@ public:
|
|||
*
|
||||
* @param s the buffer to store into
|
||||
* @param bufSize the size of the buffer
|
||||
* @param handleCR if set (default), then CR and CR/LF are handled as well as LF
|
||||
* @return a pointer to the read string, or NULL if an error occurred
|
||||
*/
|
||||
virtual char *readLine(char *s, size_t bufSize);
|
||||
virtual char *readLine(char *s, size_t bufSize, bool handleCR = true);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -643,8 +644,10 @@ public:
|
|||
* of the line, *without* the end of a line marker. This method
|
||||
* does not indicate whether an error occurred. Callers must use
|
||||
* err() or eos() to determine whether an exception occurred.
|
||||
*
|
||||
* @param handleCR if set (default), then CR and CR/LF are handled as well as LF
|
||||
*/
|
||||
virtual String readLine();
|
||||
virtual String readLine(bool handleCR = true);
|
||||
|
||||
/**
|
||||
* Print a hexdump of the stream while maintaing position. The number
|
||||
|
|
|
@ -1064,7 +1064,7 @@ public:
|
|||
* @param shakeYOffset the shake y offset
|
||||
*
|
||||
* @note This is currently used in the SCUMM, QUEEN, KYRA, SCI, DREAMWEB,
|
||||
* SUPERNOVA, TEENAGENT, and TOLTECS engines.
|
||||
* SUPERNOVA, TEENAGENT, TOLTECS, ULTIMA, and PETKA engines.
|
||||
*/
|
||||
virtual void setShakePos(int shakeXOffset, int shakeYOffset) = 0;
|
||||
|
||||
|
|
|
@ -293,6 +293,11 @@ public:
|
|||
*/
|
||||
Array<int> getVoiceIndicesByGender (TTSVoice::Gender gender);
|
||||
|
||||
/**
|
||||
* returns the index for the default voice.
|
||||
*/
|
||||
virtual int getDefaultVoice() { return 0; }
|
||||
|
||||
/**
|
||||
* Pushes the current state of the TTS
|
||||
*/
|
||||
|
|
|
@ -33,13 +33,10 @@
|
|||
#include "common/fs.h"
|
||||
#include "common/system.h"
|
||||
#include "common/textconsole.h"
|
||||
#include "common/unicode-bidi.h"
|
||||
|
||||
#ifdef USE_TRANSLATION
|
||||
|
||||
#ifdef USE_FRIBIDI
|
||||
#include <fribidi/fribidi.h>
|
||||
#endif
|
||||
|
||||
namespace Common {
|
||||
|
||||
DECLARE_SINGLETON(TranslationManager);
|
||||
|
@ -463,58 +460,9 @@ String TranslationManager::convertBiDiString(const String &input) {
|
|||
return input;
|
||||
};
|
||||
|
||||
return TranslationManager::convertBiDiString(input, HE_ISR);
|
||||
return Common::convertBiDiString(input, HE_ISR);
|
||||
}
|
||||
|
||||
#ifdef USE_FRIBIDI
|
||||
String TranslationManager::convertBiDiString(const String &input, const Common::Language lang) {
|
||||
if (lang != HE_ISR) //TODO: modify when we'll support other RTL languages, such as Arabic and Farsi
|
||||
return input;
|
||||
|
||||
int buff_length = (input.size() + 2) * 2; // it's more than enough, but it's better to be on the safe side
|
||||
FriBidiChar *input_unicode = (FriBidiChar *)malloc(buff_length * sizeof(FriBidiChar));
|
||||
FriBidiChar *visual_str = (FriBidiChar *)malloc(buff_length * sizeof(FriBidiChar));
|
||||
char *output = (char *)malloc(buff_length);
|
||||
|
||||
FriBidiCharType pbase_dir = FRIBIDI_TYPE_ON;
|
||||
FriBidiCharSet char_set = FRIBIDI_CHAR_SET_ISO8859_8;
|
||||
|
||||
FriBidiStrIndex length = fribidi_charset_to_unicode(char_set, input.c_str(), input.size(), input_unicode);
|
||||
|
||||
if (!fribidi_log2vis(
|
||||
/* input */
|
||||
input_unicode,
|
||||
length,
|
||||
&pbase_dir,
|
||||
/* output */
|
||||
visual_str,
|
||||
NULL, // position_L_to_V_list,
|
||||
NULL, // position_V_to_L_list,
|
||||
NULL // embedding_level_list
|
||||
)) {
|
||||
warning("convertBiDiString: calling fribidi_log2vis failed");
|
||||
free(input_unicode);
|
||||
free(visual_str);
|
||||
free(output);
|
||||
return input;
|
||||
}
|
||||
|
||||
fribidi_unicode_to_charset(char_set, visual_str, length, output);
|
||||
|
||||
String result = String(output);
|
||||
free(input_unicode);
|
||||
free(visual_str);
|
||||
free(output);
|
||||
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
String TranslationManager::convertBiDiString(const String &input, const Common::Language lang) {
|
||||
return input;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
} // End of namespace Common
|
||||
|
||||
|
|
|
@ -181,7 +181,6 @@ public:
|
|||
* For RTL (Right To Left) languages, returns visual representation of a logical single-line input
|
||||
*/
|
||||
String convertBiDiString(const String &input);
|
||||
String convertBiDiString(const String &input, const Common::Language lang);
|
||||
|
||||
private:
|
||||
/**
|
||||
|
|
113
common/unicode-bidi.cpp
Normal file
113
common/unicode-bidi.cpp
Normal file
|
@ -0,0 +1,113 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/ustr.h"
|
||||
#include "common/unicode-bidi.h"
|
||||
#include "common/textconsole.h"
|
||||
|
||||
#ifdef USE_FRIBIDI
|
||||
#include <fribidi/fribidi.h>
|
||||
#endif
|
||||
|
||||
namespace Common {
|
||||
|
||||
UnicodeBiDiText::UnicodeBiDiText(const Common::U32String &str) : logical(str), _log_to_vis_index(NULL), _vis_to_log_index(NULL) {
|
||||
initWithU32String(str);
|
||||
}
|
||||
|
||||
UnicodeBiDiText::UnicodeBiDiText(const Common::String &str, const Common::CodePage page) : logical(str), _log_to_vis_index(NULL), _vis_to_log_index(NULL) {
|
||||
initWithU32String(str.decode(page));
|
||||
}
|
||||
|
||||
UnicodeBiDiText::~UnicodeBiDiText() {
|
||||
delete[] _log_to_vis_index;
|
||||
delete[] _vis_to_log_index;
|
||||
}
|
||||
|
||||
uint32 UnicodeBiDiText::getVisualPosition(uint32 logicalPos) const {
|
||||
if (NULL != _log_to_vis_index && logicalPos < size()) {
|
||||
return _log_to_vis_index[logicalPos];
|
||||
}
|
||||
return logicalPos;
|
||||
}
|
||||
uint32 UnicodeBiDiText::getLogicalPosition(uint32 visualPos) const {
|
||||
if (NULL != _log_to_vis_index && visualPos < size()) {
|
||||
return _vis_to_log_index[visualPos];
|
||||
}
|
||||
return visualPos;
|
||||
}
|
||||
|
||||
void UnicodeBiDiText::initWithU32String(const U32String &input) {
|
||||
|
||||
#ifdef USE_FRIBIDI
|
||||
uint32 input_size = input.size();
|
||||
uint32 buff_length = (input_size + 2) * 2; // it's more than enough, but it's better to be on the safe side
|
||||
FriBidiChar *visual_str = new FriBidiChar[buff_length * sizeof(FriBidiChar)];
|
||||
_log_to_vis_index = new uint32[input_size];
|
||||
_vis_to_log_index = new uint32[input_size];
|
||||
FriBidiCharType pbase_dir = FRIBIDI_TYPE_ON;
|
||||
|
||||
if (!fribidi_log2vis(
|
||||
/* input */
|
||||
(const FriBidiChar *)input.c_str(),
|
||||
input_size,
|
||||
&pbase_dir,
|
||||
/* output */
|
||||
visual_str,
|
||||
(FriBidiStrIndex *)_log_to_vis_index, // position_L_to_V_list,
|
||||
(FriBidiStrIndex *)_vis_to_log_index, // position_V_to_L_list,
|
||||
NULL // embedding_level_list
|
||||
)) {
|
||||
warning("initWithU32String: calling fribidi_log2vis failed");
|
||||
delete[] visual_str;
|
||||
delete[] _log_to_vis_index;
|
||||
delete[] _vis_to_log_index;
|
||||
visual = input;
|
||||
_log_to_vis_index = NULL;
|
||||
_vis_to_log_index = NULL;
|
||||
} else {
|
||||
visual = U32String((uint32 *)visual_str, input.size());
|
||||
delete[] visual_str;
|
||||
}
|
||||
#else
|
||||
warning("initWithU32String: Fribidi not available, using input string as fallback");
|
||||
visual = input;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
String convertBiDiString(const String &input, const Common::Language lang) {
|
||||
if (lang != Common::HE_ISR) //TODO: modify when we'll support other RTL languages, such as Arabic and Farsi
|
||||
return input;
|
||||
|
||||
return Common::convertBiDiString(input, kWindows1255);
|
||||
}
|
||||
|
||||
String convertBiDiString(const String &input, const Common::CodePage page) {
|
||||
return convertBiDiU32String(input.decode(page)).visual.encode(page);
|
||||
}
|
||||
|
||||
UnicodeBiDiText convertBiDiU32String(const U32String &input) {
|
||||
return UnicodeBiDiText(input);
|
||||
}
|
||||
|
||||
} // End of namespace Common
|
57
common/unicode-bidi.h
Normal file
57
common/unicode-bidi.h
Normal file
|
@ -0,0 +1,57 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef COMMON_STRING_BIDI_H
|
||||
#define COMMON_STRING_BIDI_H
|
||||
|
||||
#include "common/str.h"
|
||||
#include "common/ustr.h"
|
||||
#include "common/language.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
class UnicodeBiDiText {
|
||||
private:
|
||||
uint32 *_log_to_vis_index; // from fribidi conversion
|
||||
uint32 *_vis_to_log_index; // from fribidi conversion
|
||||
void initWithU32String(const Common::U32String &str);
|
||||
public:
|
||||
const Common::U32String logical; // original string, ordered logically
|
||||
Common::U32String visual; // from fribidi conversion, ordered visually
|
||||
|
||||
UnicodeBiDiText(const Common::U32String &str);
|
||||
UnicodeBiDiText(const Common::String &str, const Common::CodePage page);
|
||||
~UnicodeBiDiText();
|
||||
|
||||
uint32 getVisualPosition(uint32 logicalPos) const;
|
||||
uint32 getLogicalPosition(uint32 visualPos) const;
|
||||
uint32 size() const { return logical.size(); }
|
||||
};
|
||||
|
||||
/* just call the constructor for convenience */
|
||||
UnicodeBiDiText convertBiDiU32String(const U32String &input);
|
||||
String convertBiDiString(const String &input, const Common::Language lang);
|
||||
String convertBiDiString(const String &input, const Common::CodePage page);
|
||||
|
||||
} // End of namespace Common
|
||||
|
||||
#endif
|
|
@ -23,6 +23,7 @@
|
|||
#include "common/ustr.h"
|
||||
#include "common/memorypool.h"
|
||||
#include "common/util.h"
|
||||
#include "unicode-bidi.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
|
@ -94,6 +95,10 @@ U32String::U32String(const String &str) : _size(0), _str(_storage) {
|
|||
initWithCStr(str.c_str(), str.size());
|
||||
}
|
||||
|
||||
U32String::U32String(const UnicodeBiDiText &txt) : _size(0), _str(_storage) {
|
||||
initWithCStr(txt.visual.c_str(), txt.visual.size());
|
||||
}
|
||||
|
||||
U32String::~U32String() {
|
||||
decRefCount(_extern._refCount);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
namespace Common {
|
||||
|
||||
class String;
|
||||
class UnicodeBiDiText;
|
||||
|
||||
/**
|
||||
* Very simple string class for UTF-32 strings in ScummVM. The main intention
|
||||
|
@ -103,6 +104,9 @@ public:
|
|||
/** Construct a copy of the given string. */
|
||||
U32String(const U32String &str);
|
||||
|
||||
/** Construct a copy of the given unicode BiDi converted string. */
|
||||
U32String(const UnicodeBiDiText &txt);
|
||||
|
||||
/** Construct a new string from the given NULL-terminated C string. */
|
||||
explicit U32String(const char *str);
|
||||
|
||||
|
|
|
@ -49,7 +49,18 @@ template<typename T> inline T ABS(T x) { return (x >= 0) ? x : -x; }
|
|||
template<typename T> inline T MIN(T a, T b) { return (a < b) ? a : b; }
|
||||
template<typename T> inline T MAX(T a, T b) { return (a > b) ? a : b; }
|
||||
template<typename T> inline T CLIP(T v, T amin, T amax)
|
||||
{ if (v < amin) return amin; else if (v > amax) return amax; else return v; }
|
||||
{
|
||||
#if !defined(RELEASE_BUILD)
|
||||
// debug builds use this assert to pinpoint
|
||||
// any problematic cases, where amin and amax
|
||||
// are incorrectly ordered
|
||||
// and thus CLIP() would return an invalid result
|
||||
assert(amin <= amax);
|
||||
#endif
|
||||
if (v < amin) return amin;
|
||||
else if (v > amax) return amax;
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Template method which swaps the values of its two parameters.
|
||||
|
|
17
config.guess
vendored
17
config.guess
vendored
|
@ -1,8 +1,8 @@
|
|||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright 1992-2019 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2020 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2019-09-10'
|
||||
timestamp='2020-04-26'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
|
@ -50,7 +50,7 @@ version="\
|
|||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright 1992-2019 Free Software Foundation, Inc.
|
||||
Copyright 1992-2020 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
@ -99,6 +99,8 @@ tmp=
|
|||
trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
|
||||
|
||||
set_cc_for_build() {
|
||||
# prevent multiple calls if $tmp is already set
|
||||
test "$tmp" && return 0
|
||||
: "${TMPDIR=/tmp}"
|
||||
# shellcheck disable=SC2039
|
||||
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
|
@ -924,7 +926,7 @@ EOF
|
|||
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
EV56) UNAME_MACHINE=alphaev56 ;;
|
||||
PCA56) UNAME_MACHINE=alphapca56 ;;
|
||||
|
@ -1627,6 +1629,12 @@ copies of config.guess and config.sub with the latest versions from:
|
|||
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
|
||||
and
|
||||
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
|
||||
EOF
|
||||
|
||||
year=`echo $timestamp | sed 's,-.*,,'`
|
||||
# shellcheck disable=SC2003
|
||||
if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
|
||||
cat >&2 <<EOF
|
||||
|
||||
If $0 has already been updated, send the following data and any
|
||||
information you think might be pertinent to config-patches@gnu.org to
|
||||
|
@ -1654,6 +1662,7 @@ UNAME_RELEASE = "$UNAME_RELEASE"
|
|||
UNAME_SYSTEM = "$UNAME_SYSTEM"
|
||||
UNAME_VERSION = "$UNAME_VERSION"
|
||||
EOF
|
||||
fi
|
||||
|
||||
exit 1
|
||||
|
||||
|
|
8
config.sub
vendored
8
config.sub
vendored
|
@ -1,8 +1,8 @@
|
|||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright 1992-2019 Free Software Foundation, Inc.
|
||||
# Copyright 1992-2020 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2019-06-30'
|
||||
timestamp='2020-05-04'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
|
@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright 1992-2019 Free Software Foundation, Inc.
|
||||
Copyright 1992-2020 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
@ -1366,7 +1366,7 @@ case $os in
|
|||
| skyos* | haiku* | rdos* | toppers* | drops* | es* \
|
||||
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
||||
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
||||
| nsk* | powerunix)
|
||||
| nsk* | powerunix* | genode*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
qnx*)
|
||||
|
|
77
configure
vendored
77
configure
vendored
|
@ -270,6 +270,7 @@ add_feature vorbis "Vorbis file support" "_vorbis _tremor"
|
|||
add_feature zlib "zlib" "_zlib"
|
||||
add_feature lua "lua" "_lua"
|
||||
add_feature fribidi "FriBidi" "_fribidi"
|
||||
add_feature test_cxx11 "Test C++11" "_test_cxx11"
|
||||
|
||||
# Directories for installing ScummVM.
|
||||
# This list is closely based on what GNU autoconf does,
|
||||
|
@ -1210,6 +1211,8 @@ for ac_option in $@; do
|
|||
--disable-mad) _mad=no ;;
|
||||
--enable-fribidi) _fribidi=yes ;;
|
||||
--disable-fribidi) _fribidi=no ;;
|
||||
--enable-test-c++11) _test_cxx11=yes ;;
|
||||
--disable-test-c++11) _test_cxx11=no ;;
|
||||
--enable-zlib) _zlib=yes ;;
|
||||
--disable-zlib) _zlib=no ;;
|
||||
--enable-sparkle) _sparkle=yes ;;
|
||||
|
@ -1249,6 +1252,10 @@ for ac_option in $@; do
|
|||
--disable-updates) _updates=no ;;
|
||||
--enable-libunity) _libunity=yes ;;
|
||||
--disable-libunity) _libunity=no ;;
|
||||
--enable-tts) _tts=yes ;;
|
||||
--disable-tts) _tts=no ;;
|
||||
--enable-gtk) _gtk=yes ;;
|
||||
--disable-gtk) _gtk=no ;;
|
||||
--enable-glew) _glew=yes ;; #ResidualVM specific option
|
||||
--disable-glew) _glew=no ;; #ResidualVM specific option
|
||||
--enable-opengl) _opengl=yes ;; #ResidualVM specific option
|
||||
|
@ -1563,7 +1570,7 @@ case $_host in
|
|||
datadir='${datarootdir}'
|
||||
docdir='${prefix}/doc'
|
||||
;;
|
||||
android | android-arm | android-v7a | android-arm-v7a | ouya)
|
||||
android-arm-v7a | ouya)
|
||||
_host_os=android
|
||||
_host_cpu=arm
|
||||
_host_alias=arm-linux-androideabi
|
||||
|
@ -1767,6 +1774,8 @@ switch)
|
|||
datarootdir='${prefix}/data'
|
||||
datadir='${datarootdir}'
|
||||
docdir='${prefix}/doc'
|
||||
# Switch SDK has C++11 constructs so we must enable it
|
||||
_use_cxx11=yes
|
||||
;;
|
||||
tizen)
|
||||
_host_os=tizen
|
||||
|
@ -2181,16 +2190,17 @@ if test "$have_gcc" = yes ; then
|
|||
if test "$_cxx_major" -ge "3" ; then
|
||||
# Try to use ANSI mode when C++11 is disabled.
|
||||
if test "$_use_cxx11" = "no" ; then
|
||||
append_var CXXFLAGS "-ansi"
|
||||
fi
|
||||
case $_host_os in
|
||||
# newlib-based system include files suppress non-C89 function
|
||||
# declarations under __STRICT_ANSI__
|
||||
# declarations under __STRICT_ANSI__, undefine it
|
||||
3ds | amigaos* | android | androidsdl | dreamcast | ds | gamecube | mingw* | mint* | n64 | psp | ps2 | ps3 | psp2 | switch | tizen | wii )
|
||||
append_var CXXFLAGS "-U__STRICT_ANSI__"
|
||||
;;
|
||||
*)
|
||||
append_var CXXFLAGS "-ansi"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
append_var CXXFLAGS "-W -Wno-unused-parameter"
|
||||
add_line_to_config_mk 'HAVE_GCC3 = 1'
|
||||
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
|
||||
|
@ -2202,6 +2212,7 @@ if test "$have_gcc" = yes ; then
|
|||
else
|
||||
append_var CXXFLAGS "-Wconversion"
|
||||
fi;
|
||||
append_var CXXFLAGS "-fno-operator-names"
|
||||
elif test "$have_icc" = yes ; then
|
||||
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
|
||||
fi;
|
||||
|
@ -2498,7 +2509,7 @@ case $_host_cpu in
|
|||
openpandora)
|
||||
define_in_config_if_yes yes 'USE_ARM_NEON_ASPECT_CORRECTOR'
|
||||
;;
|
||||
android | android-arm | androidsdl-armeabi | arm-*riscos | caanoo | ds | gp2x | gp2xwiz | maemo | tizen)
|
||||
androidsdl-armeabi | arm-*riscos | caanoo | ds | gp2x | gp2xwiz | maemo | tizen)
|
||||
define_in_config_if_yes yes 'USE_ARM_SCALER_ASM'
|
||||
# FIXME: The following feature exhibits a bug. It produces distorted
|
||||
# sound since 9003ce517ff9906b0288f9f7c02197fd091d4554. The ARM
|
||||
|
@ -2578,45 +2589,45 @@ case $_host_os in
|
|||
;;
|
||||
android)
|
||||
case $_host in
|
||||
android | android-arm)
|
||||
append_var CXXFLAGS "-march=armv5te"
|
||||
append_var CXXFLAGS "-mtune=xscale"
|
||||
append_var CXXFLAGS "-mfloat-abi=softfp"
|
||||
append_var LDFLAGS "-mthumb"
|
||||
ABI="armeabi"
|
||||
;;
|
||||
android-v7a | android-arm-v7a)
|
||||
append_var CXXFLAGS "-march=armv7-a"
|
||||
append_var CXXFLAGS "-mfloat-abi=softfp"
|
||||
android-arm-v7a)
|
||||
# Disable NEON for older devices (like with Tegra 2)
|
||||
append_var CXXFLAGS "-mfpu=vfp"
|
||||
# This is really old CPU but might be still used with android 4.1, it slightly increases code size and decreases performance.
|
||||
append_var LDFLAGS "-Wl,--fix-cortex-a8"
|
||||
ABI="armeabi-v7a"
|
||||
;;
|
||||
android-mips)
|
||||
append_var CXXFLAGS "-march=mips32"
|
||||
append_var CXXFLAGS "-mtune=mips32"
|
||||
ABI="mips"
|
||||
android-arm64-v8a)
|
||||
ABI="arm64-v8a"
|
||||
;;
|
||||
android-x86)
|
||||
append_var CXXFLAGS "-march=i686"
|
||||
append_var CXXFLAGS "-mtune=i686"
|
||||
ABI="x86"
|
||||
;;
|
||||
android-x86_64)
|
||||
ABI="x86_64"
|
||||
;;
|
||||
ouya)
|
||||
append_var CXXFLAGS "-mtune=cortex-a9"
|
||||
ABI="armeabi-v7a"
|
||||
;;
|
||||
esac
|
||||
|
||||
append_var LDFLAGS "-static-libstdc++"
|
||||
append_var LDFLAGS "-Wl,--build-id=sha1"
|
||||
append_var CXXFLAGS "-Wno-inconsistent-missing-override"
|
||||
|
||||
append_var CXXFLAGS "-fpic"
|
||||
append_var CXXFLAGS "-ffunction-sections"
|
||||
append_var CXXFLAGS "-funwind-tables"
|
||||
if test "$_debug_build" = yes; then
|
||||
append_var CXXFLAGS "-fno-omit-frame-pointer"
|
||||
append_var CXXFLAGS "-fno-strict-aliasing"
|
||||
else
|
||||
if test "$_debug_build" = no; then
|
||||
_optimization_level=-Os
|
||||
append_var CXXFLAGS "-fomit-frame-pointer"
|
||||
append_var CXXFLAGS "-fstrict-aliasing"
|
||||
else
|
||||
_optimization_level=-O0
|
||||
append_var CXXFLAGS "-fno-omit-frame-pointer"
|
||||
append_var CXXFLAGS "-fno-strict-aliasing"
|
||||
fi
|
||||
_optimization_level=-Os
|
||||
|
||||
# Build ID is needed for native debugging in Android Studio
|
||||
append_var LDFLAGS "-Wl,--build-id=sha1"
|
||||
|
||||
add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK"
|
||||
_seq_midi=no
|
||||
|
@ -3108,7 +3119,7 @@ if test -n "$_host"; then
|
|||
_vorbis=no
|
||||
_port_mk="backends/platform/3ds/3ds.mk"
|
||||
;;
|
||||
android | android-arm | android-v7a | android-arm-v7a | android-arm64-v8a | android-mips | android-x86 | ouya)
|
||||
android-arm-v7a | android-arm64-v8a | android-x86 | android-x86_64 | ouya)
|
||||
# also __ANDROID__ is defined by Clang in the NDK
|
||||
DEFINES="$DEFINES -D__ANDROID_PLAIN_PORT__ -DANDROID_PLAIN_PORT"
|
||||
# we link a .so as default
|
||||
|
@ -3651,7 +3662,7 @@ case $_backend in
|
|||
;;
|
||||
ps2)
|
||||
append_var DEFINES "-D_EE"
|
||||
append_var DEFINES "-DFORCE_RTL"
|
||||
append_var DEFINES "-DFORCE_RETURN_TO_LAUNCHER"
|
||||
append_var INCLUDES "-I$PS2SDK/ee/include"
|
||||
append_var INCLUDES "-I$PS2SDK/common/include"
|
||||
append_var INCLUDES "-I$PS2SDK/ports/include"
|
||||
|
@ -5601,6 +5612,12 @@ fi
|
|||
define_in_config_if_yes "$_fribidi" 'USE_FRIBIDI'
|
||||
echo "$_fribidi"
|
||||
|
||||
#
|
||||
# Test C++11 Compatibility
|
||||
#
|
||||
define_in_config_if_yes "$_test_cxx11" 'ENABLE_TEST_CPP_11'
|
||||
echo_n "Test C++11 compatibility during compilation... "
|
||||
echo "$_test_cxx11"
|
||||
|
||||
# Default to plain text output for pandoc
|
||||
if test -z "$_pandocformat" -o "$_pandocformat" = "default"; then
|
||||
|
|
|
@ -51,6 +51,7 @@ const CMakeProvider::Library *CMakeProvider::getLibraryFromFeature(const char *f
|
|||
{ "theora", kSDLVersionAny, 0, 0, 0, 0, "theoradec" },
|
||||
{ "fluidsynth",kSDLVersionAny, 0, 0, 0, 0, "fluidsynth" },
|
||||
{ "faad", kSDLVersionAny, 0, 0, 0, 0, "faad" },
|
||||
{ "fribidi", kSDLVersionAny, 0, 0, 0, 0, "fribidi" },
|
||||
{ "opengl", kSDLVersionAny, "FindOpenGL", "OpenGL", "OPENGL_INCLUDE_DIR", "OPENGL_gl_LIBRARY", 0 }, // ResidualVM specific
|
||||
{ "glew", kSDLVersionAny, "FindGLEW", "GLEW", "GLEW_INCLUDE_DIR", "GLEW_LIBRARIES", 0 }, // ResidualVM specific
|
||||
{ "libcurl", kSDLVersionAny, "FindCURL", "CURL", "CURL_INCLUDE_DIRS", "CURL_LIBRARIES", 0 },
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "create_project", "create_project.vcxproj", "{CF177559-077D-4A08-AABE-BE0FD35F6C63}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,125 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{CF177559-077D-4A08-AABE-BE0FD35F6C63}</ProjectGuid>
|
||||
<RootNamespace>create_project</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<DisableSpecificWarnings>4003;4512;4127;4100;4244</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>@echo off
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc10\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc9\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\codeblocks\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\iphone\"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4003;4512;4127</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>@echo off
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc10\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc9\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\codeblocks\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\iphone\"</Command>
|
||||
</PostBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\cmake.cpp" />
|
||||
<ClCompile Include="..\codeblocks.cpp" />
|
||||
<ClCompile Include="..\create_project.cpp" />
|
||||
<ClCompile Include="..\msbuild.cpp" />
|
||||
<ClCompile Include="..\msvc.cpp" />
|
||||
<ClCompile Include="..\visualstudio.cpp" />
|
||||
<ClCompile Include="..\xcode.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\cmake.h" />
|
||||
<ClInclude Include="..\codeblocks.h" />
|
||||
<ClInclude Include="..\config.h" />
|
||||
<ClInclude Include="..\create_project.h" />
|
||||
<ClInclude Include="..\msbuild.h" />
|
||||
<ClInclude Include="..\msvc.h" />
|
||||
<ClInclude Include="..\visualstudio.h" />
|
||||
<ClInclude Include="..\xcode.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\scripts\installer.vbs" />
|
||||
<None Include="..\scripts\postbuild.cmd" />
|
||||
<None Include="..\scripts\prebuild.cmd" />
|
||||
<None Include="..\scripts\revision.vbs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,71 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{2e3580c8-ec3a-4c81-8351-b668c668db2a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{31aaf58c-d3cb-4ed6-8eca-163b4a9b31a6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="scripts">
|
||||
<UniqueIdentifier>{f980f6fb-41b6-4161-b035-58b200c85cad}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\codeblocks.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\create_project.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\msvc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\msbuild.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\visualstudio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\xcode.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\codeblocks.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\create_project.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\msvc.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\msbuild.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\visualstudio.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\xcode.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\scripts\prebuild.cmd">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\scripts\revision.vbs">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\scripts\postbuild.cmd">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\scripts\installer.vbs">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "create_project", "create_project.vcxproj", "{CF177559-077D-4A08-AABE-BE0FD35F6C63}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,131 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{CF177559-077D-4A08-AABE-BE0FD35F6C63}</ProjectGuid>
|
||||
<RootNamespace>create_project</RootNamespace>
|
||||
<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and $(VisualStudioVersion) == ''">$(VCTargetsPath11)</VCTargetsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<DisableSpecificWarnings>4003;4512;4127;4100;4244</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>@echo off
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc11\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc10\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc9\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\codeblocks\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\iphone\"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4003;4512;4127</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>@echo off
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc11\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc10\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc9\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\codeblocks\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\iphone\"</Command>
|
||||
</PostBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\cmake.cpp" />
|
||||
<ClCompile Include="..\codeblocks.cpp" />
|
||||
<ClCompile Include="..\create_project.cpp" />
|
||||
<ClCompile Include="..\msbuild.cpp" />
|
||||
<ClCompile Include="..\msvc.cpp" />
|
||||
<ClCompile Include="..\visualstudio.cpp" />
|
||||
<ClCompile Include="..\xcode.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\cmake.h" />
|
||||
<ClInclude Include="..\codeblocks.h" />
|
||||
<ClInclude Include="..\config.h" />
|
||||
<ClInclude Include="..\create_project.h" />
|
||||
<ClInclude Include="..\msbuild.h" />
|
||||
<ClInclude Include="..\msvc.h" />
|
||||
<ClInclude Include="..\visualstudio.h" />
|
||||
<ClInclude Include="..\xcode.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\scripts\installer.vbs" />
|
||||
<None Include="..\scripts\postbuild.cmd" />
|
||||
<None Include="..\scripts\prebuild.cmd" />
|
||||
<None Include="..\scripts\revision.vbs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,71 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{2e3580c8-ec3a-4c81-8351-b668c668db2a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{31aaf58c-d3cb-4ed6-8eca-163b4a9b31a6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="scripts">
|
||||
<UniqueIdentifier>{f980f6fb-41b6-4161-b035-58b200c85cad}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\codeblocks.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\create_project.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\msvc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\msbuild.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\visualstudio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\xcode.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\codeblocks.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\create_project.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\msvc.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\msbuild.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\visualstudio.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\xcode.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\scripts\prebuild.cmd">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\scripts\revision.vbs">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\scripts\postbuild.cmd">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\scripts\installer.vbs">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "create_project", "create_project.vcxproj", "{CF177559-077D-4A08-AABE-BE0FD35F6C63}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,132 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{CF177559-077D-4A08-AABE-BE0FD35F6C63}</ProjectGuid>
|
||||
<RootNamespace>create_project</RootNamespace>
|
||||
<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and $(VisualStudioVersion) == ''">$(VCTargetsPath11)</VCTargetsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableLanguageExtensions>false</DisableLanguageExtensions>
|
||||
<DisableSpecificWarnings>4003;4512;4127;4100;4244</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>@echo off
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc12\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc11\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc10\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc9\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\codeblocks\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\iphone\"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4003;4512;4127</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>@echo off
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc12\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc11\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc10\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\msvc9\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\codeblocks\"
|
||||
xcopy /Y "$(TargetPath)" "$(SolutionDir)\..\..\..\dists\iphone\"</Command>
|
||||
</PostBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\cmake.cpp" />
|
||||
<ClCompile Include="..\codeblocks.cpp" />
|
||||
<ClCompile Include="..\create_project.cpp" />
|
||||
<ClCompile Include="..\msbuild.cpp" />
|
||||
<ClCompile Include="..\msvc.cpp" />
|
||||
<ClCompile Include="..\visualstudio.cpp" />
|
||||
<ClCompile Include="..\xcode.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\cmake.h" />
|
||||
<ClInclude Include="..\codeblocks.h" />
|
||||
<ClInclude Include="..\config.h" />
|
||||
<ClInclude Include="..\create_project.h" />
|
||||
<ClInclude Include="..\msbuild.h" />
|
||||
<ClInclude Include="..\msvc.h" />
|
||||
<ClInclude Include="..\visualstudio.h" />
|
||||
<ClInclude Include="..\xcode.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\scripts\installer.vbs" />
|
||||
<None Include="..\scripts\postbuild.cmd" />
|
||||
<None Include="..\scripts\prebuild.cmd" />
|
||||
<None Include="..\scripts\revision.vbs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,71 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{2e3580c8-ec3a-4c81-8351-b668c668db2a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{31aaf58c-d3cb-4ed6-8eca-163b4a9b31a6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="scripts">
|
||||
<UniqueIdentifier>{f980f6fb-41b6-4161-b035-58b200c85cad}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\codeblocks.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\create_project.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\msvc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\msbuild.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\visualstudio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\xcode.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\codeblocks.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\create_project.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\msvc.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\msbuild.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\visualstudio.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\xcode.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\scripts\prebuild.cmd">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\scripts\revision.vbs">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\scripts\postbuild.cmd">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\scripts\installer.vbs">
|
||||
<Filter>scripts</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "create_project", "create_project.vcproj", "{CF177559-077D-4A08-AABE-BE0FD35F6C63}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CF177559-077D-4A08-AABE-BE0FD35F6C63}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,260 +0,0 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="create_project"
|
||||
ProjectGUID="{CF177559-077D-4A08-AABE-BE0FD35F6C63}"
|
||||
RootNamespace="create_project"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="4"
|
||||
DisableSpecificWarnings="4003;4512;4127;4100;4244"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Rpcrt4.lib"
|
||||
GenerateDebugInformation="true"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4003;4512;4127"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Rpcrt4.lib"
|
||||
GenerateDebugInformation="true"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\create_project.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\cmake.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\codeblocks.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\msvc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\msbuild.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\visualstudio.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\xcode.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\create_project.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\cmake.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\codeblocks.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\config.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\msvc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\msbuild.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\visualstudio.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\xcode.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Scripts"
|
||||
Filter="vbs;cmd"
|
||||
UniqueIdentifier="{45B110C8-4C64-4677-8ED6-F9A93C6D55A0}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\scripts\prebuild.cmd"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\postbuild.cmd"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\revision.vbs"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\installer.vbs"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -289,15 +289,11 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
|
|||
if (!agdDesc.desc)
|
||||
return Common::kNoGameDataFoundError;
|
||||
|
||||
DetectedGame gameDescriptor = toDetectedGame(agdDesc);
|
||||
|
||||
// If the GUI options were updated, we catch this here and update them in the users config
|
||||
// file transparently.
|
||||
Common::String lang = getGameGUIOptionsDescriptionLanguage(agdDesc.desc->language);
|
||||
if (agdDesc.desc->flags & ADGF_ADDENGLISH)
|
||||
lang += " " + getGameGUIOptionsDescriptionLanguage(Common::EN_ANY);
|
||||
|
||||
Common::updateGameGUIOptions(agdDesc.desc->guiOptions + _guiOptions, lang);
|
||||
|
||||
DetectedGame gameDescriptor = toDetectedGame(agdDesc);
|
||||
ConfMan.setAndFlush("guioptions", gameDescriptor.getGUIOptions());
|
||||
|
||||
bool showTestingWarning = false;
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ protected:
|
|||
bool getFileProperties(const Common::FSNode &parent, const FileMap &allFiles, const ADGameDescription &game, const Common::String fname, FileProperties &fileProps) const;
|
||||
|
||||
/** Convert an AD game description into the shared game description format */
|
||||
DetectedGame toDetectedGame(const ADDetectedGame &adGame) const;
|
||||
virtual DetectedGame toDetectedGame(const ADDetectedGame &adGame) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -90,10 +90,10 @@ MainMenuDialog::MainMenuDialog(Engine *engine)
|
|||
new GUI::ButtonWidget(this, "GlobalMenu.About", _("~A~bout"), 0, kAboutCmd);
|
||||
|
||||
if (g_system->getOverlayWidth() > 320)
|
||||
_rtlButton = new GUI::ButtonWidget(this, "GlobalMenu.RTL", _("~R~eturn to Launcher"), 0, kRTLCmd);
|
||||
_returnToLauncherButton = new GUI::ButtonWidget(this, "GlobalMenu.ReturnToLauncher", _("~R~eturn to Launcher"), 0, kLauncherCmd);
|
||||
else
|
||||
_rtlButton = new GUI::ButtonWidget(this, "GlobalMenu.RTL", _c("~R~eturn to Launcher", "lowres"), 0, kRTLCmd);
|
||||
_rtlButton->setEnabled(_engine->hasFeature(Engine::kSupportsRTL));
|
||||
_returnToLauncherButton = new GUI::ButtonWidget(this, "GlobalMenu.ReturnToLauncher", _c("~R~eturn to Launcher", "lowres"), 0, kLauncherCmd);
|
||||
_returnToLauncherButton->setEnabled(_engine->hasFeature(Engine::kSupportsReturnToLauncher));
|
||||
|
||||
if (!g_system->hasFeature(OSystem::kFeatureNoQuit))
|
||||
new GUI::ButtonWidget(this, "GlobalMenu.Quit", _("~Q~uit"), 0, kQuitCmd);
|
||||
|
@ -136,10 +136,10 @@ void MainMenuDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint3
|
|||
dialog.runModal();
|
||||
}
|
||||
break;
|
||||
case kRTLCmd: {
|
||||
Common::Event eventRTL;
|
||||
eventRTL.type = Common::EVENT_RTL;
|
||||
g_system->getEventManager()->pushEvent(eventRTL);
|
||||
case kLauncherCmd: {
|
||||
Common::Event eventReturnToLauncher;
|
||||
eventReturnToLauncher.type = Common::EVENT_RETURN_TO_LAUNCHER;
|
||||
g_system->getEventManager()->pushEvent(eventReturnToLauncher);
|
||||
close();
|
||||
}
|
||||
break;
|
||||
|
@ -166,9 +166,9 @@ void MainMenuDialog::reflowLayout() {
|
|||
// FIXME: it might be better to declare GUI::StaticTextWidget::setLabel() virtual
|
||||
// and to reimplement it in GUI::ButtonWidget to handle the hotkey.
|
||||
if (g_system->getOverlayWidth() > 320)
|
||||
_rtlButton->setLabel(_rtlButton->cleanupHotkey(_("~R~eturn to Launcher")));
|
||||
_returnToLauncherButton->setLabel(_returnToLauncherButton->cleanupHotkey(_("~R~eturn to Launcher")));
|
||||
else
|
||||
_rtlButton->setLabel(_rtlButton->cleanupHotkey(_c("~R~eturn to Launcher", "lowres")));
|
||||
_returnToLauncherButton->setLabel(_returnToLauncherButton->cleanupHotkey(_c("~R~eturn to Launcher", "lowres")));
|
||||
|
||||
#ifndef DISABLE_FANCY_THEMES
|
||||
if (g_gui.xmlEval()->getVar("Globals.ShowGlobalMenuLogo", 0) == 1 && g_gui.theme()->supportsImages()) {
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
kHelpCmd = 'HELP',
|
||||
kAboutCmd = 'ABOU',
|
||||
kQuitCmd = 'QUIT',
|
||||
kRTLCmd = 'RTL ',
|
||||
kLauncherCmd = 'LNCR',
|
||||
kChooseCmd = 'CHOS'
|
||||
};
|
||||
|
||||
|
@ -67,7 +67,7 @@ protected:
|
|||
|
||||
GUI::GraphicsWidget *_logo;
|
||||
|
||||
GUI::ButtonWidget *_rtlButton;
|
||||
GUI::ButtonWidget *_returnToLauncherButton;
|
||||
GUI::ButtonWidget *_loadButton;
|
||||
GUI::ButtonWidget *_saveButton;
|
||||
GUI::ButtonWidget *_helpButton;
|
||||
|
|
|
@ -530,18 +530,25 @@ void Engine::errorString(const char *buf1, char *buf2, int size) {
|
|||
Common::strlcpy(buf2, buf1, size);
|
||||
}
|
||||
|
||||
void Engine::pauseEngine(bool pause) {
|
||||
assert((pause && _pauseLevel >= 0) || (!pause && _pauseLevel));
|
||||
PauseToken Engine::pauseEngine() {
|
||||
assert(_pauseLevel >= 0);
|
||||
|
||||
if (pause)
|
||||
_pauseLevel++;
|
||||
else
|
||||
_pauseLevel--;
|
||||
|
||||
if (_pauseLevel == 1 && pause) {
|
||||
if (_pauseLevel == 1) {
|
||||
_pauseStartTime = _system->getMillis();
|
||||
pauseEngineIntern(true);
|
||||
} else if (_pauseLevel == 0) {
|
||||
}
|
||||
|
||||
return PauseToken(this);
|
||||
}
|
||||
|
||||
void Engine::resumeEngine() {
|
||||
assert(_pauseLevel > 0);
|
||||
|
||||
_pauseLevel--;
|
||||
|
||||
if (_pauseLevel == 0) {
|
||||
pauseEngineIntern(false);
|
||||
_engineStartTime += _system->getMillis() - _pauseStartTime;
|
||||
_pauseStartTime = 0;
|
||||
|
@ -558,8 +565,10 @@ void Engine::openMainMenuDialog() {
|
|||
_mainMenuDialog = new MainMenuDialog(this);
|
||||
#ifdef USE_TTS
|
||||
Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
|
||||
if (ttsMan != nullptr) {
|
||||
ttsMan->pushState();
|
||||
g_gui.initTextToSpeech();
|
||||
}
|
||||
#endif
|
||||
|
||||
setGameToLoadSlot(-1);
|
||||
|
@ -584,6 +593,7 @@ void Engine::openMainMenuDialog() {
|
|||
applyGameSettings();
|
||||
syncSoundSettings();
|
||||
#ifdef USE_TTS
|
||||
if (ttsMan != nullptr)
|
||||
ttsMan->popState();
|
||||
#endif
|
||||
}
|
||||
|
@ -618,9 +628,8 @@ void Engine::setTotalPlayTime(uint32 time) {
|
|||
}
|
||||
|
||||
int Engine::runDialog(GUI::Dialog &dialog) {
|
||||
pauseEngine(true);
|
||||
PauseToken pt = pauseEngine();
|
||||
int result = dialog.runModal();
|
||||
pauseEngine(false);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -738,9 +747,13 @@ bool Engine::loadGameDialog() {
|
|||
}
|
||||
|
||||
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load"), false);
|
||||
pauseEngine(true);
|
||||
int slotNum = dialog->runModalWithCurrentTarget();
|
||||
pauseEngine(false);
|
||||
|
||||
int slotNum;
|
||||
{
|
||||
PauseToken pt = pauseEngine();
|
||||
slotNum = dialog->runModalWithCurrentTarget();
|
||||
}
|
||||
|
||||
delete dialog;
|
||||
|
||||
if (slotNum < 0)
|
||||
|
@ -763,9 +776,11 @@ bool Engine::saveGameDialog() {
|
|||
}
|
||||
|
||||
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
|
||||
pauseEngine(true);
|
||||
int slotNum = dialog->runModalWithCurrentTarget();
|
||||
pauseEngine(false);
|
||||
int slotNum;
|
||||
{
|
||||
PauseToken pt = pauseEngine();
|
||||
slotNum = dialog->runModalWithCurrentTarget();
|
||||
}
|
||||
|
||||
Common::String desc = dialog->getResultString();
|
||||
if (desc.empty())
|
||||
|
@ -795,7 +810,7 @@ void Engine::quitGame() {
|
|||
|
||||
bool Engine::shouldQuit() {
|
||||
Common::EventManager *eventMan = g_system->getEventManager();
|
||||
return (eventMan->shouldQuit() || eventMan->shouldRTL());
|
||||
return (eventMan->shouldQuit() || eventMan->shouldReturnToLauncher());
|
||||
}
|
||||
|
||||
GUI::Debugger *Engine::getOrCreateDebugger() {
|
||||
|
@ -819,3 +834,51 @@ MetaEngine &Engine::getMetaEngine() {
|
|||
assert(plugin);
|
||||
return plugin->get<MetaEngine>();
|
||||
}
|
||||
|
||||
PauseToken::PauseToken() : _engine(nullptr) {}
|
||||
|
||||
PauseToken::PauseToken(Engine *engine) : _engine(engine) {}
|
||||
|
||||
void PauseToken::operator=(const PauseToken &t2) {
|
||||
if (_engine) {
|
||||
error("Tried to assign to an already busy PauseToken");
|
||||
}
|
||||
_engine = t2._engine;
|
||||
if (_engine) {
|
||||
_engine->_pauseLevel++;
|
||||
}
|
||||
}
|
||||
|
||||
PauseToken::PauseToken(const PauseToken &t2) : _engine(t2._engine) {
|
||||
if (_engine) {
|
||||
_engine->_pauseLevel++;
|
||||
}
|
||||
}
|
||||
|
||||
void PauseToken::clear() {
|
||||
if (!_engine) {
|
||||
error("Tried to clear an already cleared PauseToken");
|
||||
}
|
||||
_engine->resumeEngine();
|
||||
_engine = nullptr;
|
||||
}
|
||||
|
||||
PauseToken::~PauseToken() {
|
||||
if (_engine) {
|
||||
_engine->resumeEngine();
|
||||
}
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
PauseToken::PauseToken(PauseToken &&t2) : _engine(t2._engine) {
|
||||
t2._engine = nullptr;
|
||||
}
|
||||
|
||||
void PauseToken::operator=(PauseToken &&t2) {
|
||||
if (_engine) {
|
||||
error("Tried to assign to an already busy PauseToken");
|
||||
}
|
||||
_engine = t2._engine;
|
||||
t2._engine = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -56,6 +56,37 @@ class Dialog;
|
|||
void GUIErrorMessage(const Common::String &msg);
|
||||
void GUIErrorMessageFormat(const char *fmt, ...) GCC_PRINTF(1, 2);
|
||||
|
||||
class Engine;
|
||||
|
||||
|
||||
/**
|
||||
* Manages pausing by Engine::pauseEngine handing out tokens that
|
||||
* each represent one requested level of pause.
|
||||
*/
|
||||
class PauseToken {
|
||||
public:
|
||||
PauseToken();
|
||||
PauseToken(const PauseToken &);
|
||||
#if __cplusplus >= 201103L
|
||||
PauseToken(PauseToken &&);
|
||||
#endif
|
||||
~PauseToken();
|
||||
|
||||
void operator=(const PauseToken &);
|
||||
#if __cplusplus >= 201103L
|
||||
void operator=(PauseToken &&);
|
||||
#endif
|
||||
/** Manually releases the PauseToken. Only allowed if the token
|
||||
* currently represents a pause request.
|
||||
*/
|
||||
void clear();
|
||||
private:
|
||||
PauseToken(Engine *);
|
||||
|
||||
Engine *_engine;
|
||||
|
||||
friend class Engine;
|
||||
};
|
||||
|
||||
class Engine {
|
||||
public:
|
||||
|
@ -129,11 +160,11 @@ public:
|
|||
kSupportsSubtitleOptions,
|
||||
|
||||
/**
|
||||
* 'Return to launcher' feature is supported, i.e., EVENT_RTL is handled
|
||||
* 'Return to launcher' feature is supported, i.e., EVENT_RETURN_TO_LAUNCHER is handled
|
||||
* either directly, or indirectly (that is, the engine calls and honors
|
||||
* the result of the Engine::shouldQuit() method appropriately).
|
||||
*/
|
||||
kSupportsRTL,
|
||||
kSupportsReturnToLauncher,
|
||||
|
||||
/**
|
||||
* Loading savestates during runtime is supported, that is, this engine
|
||||
|
@ -354,17 +385,25 @@ public:
|
|||
static MetaEngine &getMetaEngine();
|
||||
|
||||
/**
|
||||
* Pause or resume the engine. This should stop/resume any audio playback
|
||||
* Pause the engine. This should stop any audio playback
|
||||
* and other stuff. Called right before the system runs a global dialog
|
||||
* (like a global pause, main menu, options or 'confirm exit' dialog).
|
||||
*
|
||||
* This is a convenience tracker which automatically keeps track on how
|
||||
* often the engine has been paused, ensuring that after pausing an engine
|
||||
* e.g. twice, it has to be unpaused twice before actuallying resuming.
|
||||
*
|
||||
* @param pause true to pause the engine, false to resume it
|
||||
* Returns a PauseToken. Multiple pause tokens may exist. The engine will
|
||||
* be resumed when all associated pause tokens reach the end of their lives.
|
||||
*/
|
||||
void pauseEngine(bool pause);
|
||||
PauseToken pauseEngine();
|
||||
private:
|
||||
/** Resume the engine. This should resume any audio playback and other stuff.
|
||||
*
|
||||
* Only PauseToken is allowed to call this member function. Use the PauseToken
|
||||
* that you got from pauseEngine to resume the engine.
|
||||
*/
|
||||
void resumeEngine();
|
||||
|
||||
friend class PauseToken;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Return whether the engine is currently paused or not.
|
||||
|
|
|
@ -1382,7 +1382,7 @@ void GrimEngine::clearEventQueue() {
|
|||
|
||||
bool GrimEngine::hasFeature(EngineFeature f) const {
|
||||
return
|
||||
(f == kSupportsRTL) ||
|
||||
(f == kSupportsReturnToLauncher) ||
|
||||
(f == kSupportsLoadingDuringRuntime) ||
|
||||
(f == kSupportsJoystick);
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ bool Myst3Engine::hasFeature(EngineFeature f) const {
|
|||
bool softRenderer = matchingRendererType == Graphics::kRendererTypeTinyGL;
|
||||
|
||||
return
|
||||
(f == kSupportsRTL) ||
|
||||
(f == kSupportsReturnToLauncher) ||
|
||||
(f == kSupportsLoadingDuringRuntime) ||
|
||||
(f == kSupportsSavingDuringRuntime) ||
|
||||
(f == kSupportsArbitraryResolutions && !softRenderer);
|
||||
|
|
|
@ -521,9 +521,13 @@ void UserInterface::handleKeyPress(const Common::KeyState &keyState) {
|
|||
confirm(GameMessage::kQuitPrompt, this, &UserInterface::notifyShouldExit);
|
||||
} else if (keyState.keycode == Common::KEYCODE_p) {
|
||||
if (isInGameScreen()) {
|
||||
g_engine->pauseEngine(true);
|
||||
if (g_engine->isPaused()) {
|
||||
_gamePauseToken.clear();
|
||||
} else {
|
||||
_gamePauseToken = g_engine->pauseEngine();
|
||||
debug("The game is paused");
|
||||
}
|
||||
}
|
||||
} else if (keyState.keycode == Common::KEYCODE_PAGEUP) {
|
||||
if (isInGameScreen()) {
|
||||
if (isInventoryOpen()) {
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
|
||||
#include "engines/stark/services/gamemessage.h"
|
||||
|
||||
#include "engines/engine.h"
|
||||
|
||||
#include "common/keyboard.h"
|
||||
#include "common/rect.h"
|
||||
#include "common/str-array.h"
|
||||
|
@ -215,6 +217,7 @@ private:
|
|||
Gfx::Driver *_gfx;
|
||||
bool _exitGame;
|
||||
bool _quitToMainMenu;
|
||||
PauseToken _gamePauseToken;
|
||||
|
||||
bool _interactive;
|
||||
bool _interactionAttemptDenied;
|
||||
|
|
|
@ -187,7 +187,7 @@ void StarkEngine::processEvents() {
|
|||
if (isPaused()) {
|
||||
// Only pressing key P to resume the game is allowed when the game is paused
|
||||
if (e.type == Common::EVENT_KEYDOWN && e.kbd.keycode == Common::KEYCODE_p) {
|
||||
pauseEngine(false);
|
||||
_gamePauseToken.clear();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ void StarkEngine::processEvents() {
|
|||
StarkGfx->toggleFullscreen();
|
||||
} else if (e.kbd.keycode == Common::KEYCODE_p) {
|
||||
if (StarkUserInterface->isInGameScreen()) {
|
||||
pauseEngine(true);
|
||||
_gamePauseToken = pauseEngine();
|
||||
debug("The game is paused");
|
||||
}
|
||||
} else {
|
||||
|
@ -341,7 +341,7 @@ bool StarkEngine::hasFeature(EngineFeature f) const {
|
|||
(f == kSupportsLoadingDuringRuntime) ||
|
||||
(f == kSupportsSavingDuringRuntime) ||
|
||||
(f == kSupportsArbitraryResolutions) ||
|
||||
(f == kSupportsRTL);
|
||||
(f == kSupportsReturnToLauncher);
|
||||
}
|
||||
|
||||
bool StarkEngine::canLoadGameStateCurrently() {
|
||||
|
|
|
@ -89,6 +89,7 @@ private:
|
|||
static void checkRecommendedDatafiles();
|
||||
|
||||
Gfx::FrameLimiter *_frameLimiter;
|
||||
PauseToken _gamePauseToken;
|
||||
|
||||
const ADGameDescription *_gameDescription;
|
||||
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
engines/wintermute/detection.cpp
|
||||
engines/wintermute/wintermute.cpp
|
||||
engines/wintermute/keymapper_tables.h
|
||||
|
|
|
@ -440,6 +440,17 @@ bool AdGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
|
|||
stack->correctParams(1);
|
||||
ScValue *val = stack->pop();
|
||||
AdObject *obj = (AdObject *)val->getNative();
|
||||
|
||||
// HACK: We take corrosion screenshot before entering main menu
|
||||
// Unused screenshots must be deleted, after main menu is closed
|
||||
if (obj && BaseEngine::instance().getGameId() == "corrosion") {
|
||||
const char *mm = "interface\\system\\mainmenu.window";
|
||||
const char *fn = obj->getFilename();
|
||||
if (fn && strcmp(fn, mm) == 0) {
|
||||
deleteSaveThumbnail();
|
||||
}
|
||||
}
|
||||
|
||||
removeObject(obj);
|
||||
if (val->getType() == VAL_VARIABLE_REF) {
|
||||
val->setNULL();
|
||||
|
|
|
@ -94,7 +94,6 @@ void AdScene::setDefaults() {
|
|||
_pfTargetPath = nullptr;
|
||||
_pfRequester = nullptr;
|
||||
_mainLayer = nullptr;
|
||||
|
||||
#ifdef ENABLE_WME3D
|
||||
_sceneGeometry = nullptr;
|
||||
_showGeometry = false;
|
||||
|
@ -191,7 +190,6 @@ void AdScene::cleanup() {
|
|||
_gameRef->unregisterObject(_objects[i]);
|
||||
}
|
||||
_objects.clear();
|
||||
|
||||
#ifdef ENABLE_WME3D
|
||||
delete _sceneGeometry;
|
||||
#endif
|
||||
|
@ -552,7 +550,6 @@ bool AdScene::initLoop() {
|
|||
return _sceneGeometry->initLoop();
|
||||
}
|
||||
#endif
|
||||
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
|
@ -1239,7 +1236,6 @@ bool AdScene::updateFreeObjects() {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
adGame->_objects[i]->update();
|
||||
adGame->_objects[i]->_drawn = false;
|
||||
}
|
||||
|
@ -1249,7 +1245,6 @@ bool AdScene::updateFreeObjects() {
|
|||
if (!_objects[i]->_active) {
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WME3D
|
||||
if (_objects[i]->_is3D && _sceneGeometry) {
|
||||
Camera3D* activeCamera = _sceneGeometry->getActiveCamera();
|
||||
|
@ -1355,8 +1350,6 @@ bool AdScene::compareObjs(const AdObject *obj1, const AdObject *obj2) {
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool AdScene::displayRegionContentOld(AdRegion *region) {
|
||||
// is this function actually used?
|
||||
|
||||
AdGame *adGame = (AdGame *)_gameRef;
|
||||
AdObject *obj;
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ class AdPathPoint;
|
|||
#ifdef ENABLE_WME3D
|
||||
class AdSceneGeometry;
|
||||
#endif
|
||||
|
||||
class AdScene : public BaseObject {
|
||||
public:
|
||||
|
||||
|
|
|
@ -86,7 +86,6 @@ BaseActiveRect::BaseActiveRect(BaseGame *inGame, BaseObject *owner, ModelX *mode
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
BaseActiveRect::~BaseActiveRect() {
|
||||
_owner = nullptr;
|
||||
|
|
|
@ -78,6 +78,10 @@ enum WMETargetExecutable {
|
|||
WME_1_8_8, // DEAD:CODE 2008, released as "1.8.8 beta"
|
||||
WME_1_8_9, // DEAD:CODE 2008, released as "1.8.9 beta"
|
||||
WME_1_8_10, // DEAD:CODE 2009
|
||||
|
||||
// fork of WME_1_8_10
|
||||
WME_ANDISHE_VARAN, // Andishe Varan Engine 1.0.0.0
|
||||
|
||||
WME_1_8_11, // DEAD:CODE 2009
|
||||
WME_1_9_0, // DEAD:CODE 2009, released as "1.9.0 beta"
|
||||
|
||||
|
@ -115,6 +119,8 @@ enum WMETargetExecutable {
|
|||
FOXTAIL_1_2_304,
|
||||
FOXTAIL_1_2_362,
|
||||
FOXTAIL_1_2_527,
|
||||
FOXTAIL_1_2_896,
|
||||
FOXTAIL_1_2_902,
|
||||
FOXTAIL_LATEST_VERSION
|
||||
};
|
||||
|
||||
|
@ -168,6 +174,7 @@ public:
|
|||
bool isFoxTail(WMETargetExecutable v1=FOXTAIL_OLDEST_VERSION, WMETargetExecutable v2=FOXTAIL_LATEST_VERSION) const {
|
||||
return isFoxTailCheck(_targetExecutable, v1, v2);
|
||||
}
|
||||
void addFlags(uint32 flags) { _flags |= flags; }
|
||||
};
|
||||
|
||||
} // End of namespace Wintermute
|
||||
|
|
|
@ -395,10 +395,24 @@ bool BaseFileManager::hasFile(const Common::String &filename) {
|
|||
return false;
|
||||
}
|
||||
|
||||
int BaseFileManager::listMatchingMembers(Common::ArchiveMemberList &list, const Common::String &pattern) {
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
int BaseFileManager::listMatchingPackageMembers(Common::ArchiveMemberList &list, const Common::String &pattern) {
|
||||
return _packages.listMatchingMembers(list, pattern);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
int BaseFileManager::listMatchingFiles(Common::StringArray &list, const Common::String &pattern) {
|
||||
list = sfmFileList(pattern);
|
||||
|
||||
Common::ArchiveMemberList files;
|
||||
listMatchingDiskFileMembers(files, pattern);
|
||||
for (Common::ArchiveMemberList::const_iterator it = files.begin(); it != files.end(); ++it) {
|
||||
list.push_back((*it)->getName());
|
||||
}
|
||||
|
||||
return list.size();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
Common::SeekableReadStream *BaseFileManager::openFile(const Common::String &filename, bool absPathWarning, bool keepTrackOf) {
|
||||
if (strcmp(filename.c_str(), "") == 0) {
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include "common/archive.h"
|
||||
#include "common/str.h"
|
||||
#include "common/str-array.h"
|
||||
#include "common/fs.h"
|
||||
#include "common/file.h"
|
||||
#include "common/language.h"
|
||||
|
@ -42,7 +43,8 @@ public:
|
|||
|
||||
bool closeFile(Common::SeekableReadStream *File);
|
||||
bool hasFile(const Common::String &filename);
|
||||
int listMatchingMembers(Common::ArchiveMemberList &list, const Common::String &pattern);
|
||||
int listMatchingPackageMembers(Common::ArchiveMemberList &list, const Common::String &pattern);
|
||||
int listMatchingFiles(Common::StringArray &list, const Common::String &pattern);
|
||||
Common::SeekableReadStream *openFile(const Common::String &filename, bool absPathWarning = true, bool keepTrackOf = true);
|
||||
Common::WriteStream *openFileForWrite(const Common::String &filename);
|
||||
byte *readWholeFile(const Common::String &filename, uint32 *size = nullptr, bool mustExist = true);
|
||||
|
|
|
@ -36,7 +36,9 @@
|
|||
#include "engines/wintermute/base/font/base_font.h"
|
||||
#include "engines/wintermute/base/font/base_font_storage.h"
|
||||
#include "engines/wintermute/base/gfx/base_renderer.h"
|
||||
#ifdef ENABLE_WME3D
|
||||
#include "engines/wintermute/base/gfx/opengl/base_render_opengl3d.h"
|
||||
#endif
|
||||
#include "engines/wintermute/base/base_keyboard_state.h"
|
||||
#include "engines/wintermute/base/base_parser.h"
|
||||
#include "engines/wintermute/base/base_quick_msg.h"
|
||||
|
@ -55,6 +57,7 @@
|
|||
#include "engines/wintermute/base/scriptables/script_stack.h"
|
||||
#include "engines/wintermute/base/scriptables/script.h"
|
||||
#include "engines/wintermute/base/sound/base_sound.h"
|
||||
#include "engines/wintermute/ext/plugins.h"
|
||||
#include "engines/wintermute/video/video_player.h"
|
||||
#include "engines/wintermute/video/video_theora_player.h"
|
||||
#include "engines/wintermute/utils/utils.h"
|
||||
|
@ -252,8 +255,6 @@ BaseGame::~BaseGame() {
|
|||
|
||||
cleanup();
|
||||
|
||||
delete _cachedThumbnail;
|
||||
|
||||
delete _mathClass;
|
||||
delete _directoryClass;
|
||||
|
||||
|
@ -270,8 +271,6 @@ BaseGame::~BaseGame() {
|
|||
delete _musicSystem;
|
||||
delete _settings;
|
||||
|
||||
_cachedThumbnail = nullptr;
|
||||
|
||||
_mathClass = nullptr;
|
||||
_directoryClass = nullptr;
|
||||
|
||||
|
@ -302,6 +301,8 @@ bool BaseGame::cleanup() {
|
|||
delete _loadingIcon;
|
||||
_loadingIcon = nullptr;
|
||||
|
||||
deleteSaveThumbnail();
|
||||
|
||||
_engineLogCallback = nullptr;
|
||||
_engineLogCallbackData = nullptr;
|
||||
|
||||
|
@ -1443,6 +1444,19 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
|
|||
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// [FoxTail] ValidSaveSlotVersion
|
||||
// Checks if given slot stores game state of compatible game version
|
||||
// This version always returs true
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "ValidSaveSlotVersion") == 0) {
|
||||
stack->correctParams(1);
|
||||
/* int slot = */ stack->pop()->getInt();
|
||||
// do nothing
|
||||
stack->pushBool(true);
|
||||
return STATUS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1624,6 +1638,13 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
|
|||
byte blue = stack->pop()->getInt(0);
|
||||
byte alpha = stack->pop()->getInt(0xFF);
|
||||
|
||||
// HACK: Corrosion fades screen to black while opening main menu
|
||||
// Thus, we get black screenshots when saving game from in-game menus
|
||||
// Let's take & keep screenshot before entering main menu
|
||||
if (duration == 750 && BaseEngine::instance().getGameId() == "corrosion") {
|
||||
storeSaveThumbnail();
|
||||
}
|
||||
|
||||
bool system = (strcmp(name, "SystemFadeOut") == 0 || strcmp(name, "SystemFadeOutAsync") == 0);
|
||||
|
||||
_fader->fadeOut(BYTETORGBA(red, green, blue, alpha), duration, system);
|
||||
|
@ -1929,16 +1950,7 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "StoreSaveThumbnail") == 0) {
|
||||
stack->correctParams(0);
|
||||
delete _cachedThumbnail;
|
||||
_cachedThumbnail = new SaveThumbHelper(this);
|
||||
if (DID_FAIL(_cachedThumbnail->storeThumbnail())) {
|
||||
delete _cachedThumbnail;
|
||||
_cachedThumbnail = nullptr;
|
||||
stack->pushBool(false);
|
||||
} else {
|
||||
stack->pushBool(true);
|
||||
}
|
||||
|
||||
stack->pushBool(storeSaveThumbnail());
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
|
@ -1947,10 +1959,8 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "DeleteSaveThumbnail") == 0) {
|
||||
stack->correctParams(0);
|
||||
delete _cachedThumbnail;
|
||||
_cachedThumbnail = nullptr;
|
||||
deleteSaveThumbnail();
|
||||
stack->pushNULL();
|
||||
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
|
@ -2192,6 +2202,32 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
|
|||
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// [FoxTail] GetFiles
|
||||
// Used at kalimba.script on F9 keypress to reload list of available music
|
||||
// Known params: "*.mb"
|
||||
// Original implementation does not seem to look up at DCP packages
|
||||
// This implementation looks up at savegame storage and for actual files
|
||||
// Return value expected to be an Array of Strings
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "GetFiles") == 0) {
|
||||
stack->correctParams(1);
|
||||
const char *pattern = stack->pop()->getString();
|
||||
|
||||
Common::StringArray fnames;
|
||||
BaseFileManager::getEngineInstance()->listMatchingFiles(fnames, pattern);
|
||||
|
||||
stack->pushInt(0);
|
||||
BaseScriptable *arr = makeSXArray(_gameRef, stack);
|
||||
for (uint32 i = 0; i < fnames.size(); i++) {
|
||||
stack->pushString(fnames[i].c_str());
|
||||
((SXArray *)arr)->push(stack->pop());
|
||||
}
|
||||
|
||||
stack->pushNative(arr, false);
|
||||
return STATUS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -2675,6 +2711,10 @@ ScValue *BaseGame::scGetProperty(const Common::String &name) {
|
|||
_scValue->setString("1.2.362");
|
||||
} else if (BaseEngine::instance().getTargetExecutable() == FOXTAIL_1_2_527) {
|
||||
_scValue->setString("1.2.527");
|
||||
} else if (BaseEngine::instance().getTargetExecutable() == FOXTAIL_1_2_896) {
|
||||
_scValue->setString("1.2.896");
|
||||
} else if (BaseEngine::instance().getTargetExecutable() == FOXTAIL_1_2_902) {
|
||||
_scValue->setString("1.2.902");
|
||||
} else {
|
||||
_scValue->setString("UNKNOWN");
|
||||
}
|
||||
|
@ -3158,26 +3198,6 @@ bool BaseGame::externalCall(ScScript *script, ScStack *stack, ScStack *thisStack
|
|||
stack->pushNULL();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// SteamAPI
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "SteamAPI") == 0) {
|
||||
thisObj = thisStack->getTop();
|
||||
|
||||
thisObj->setNative(makeSXSteamAPI(_gameRef, stack));
|
||||
stack->pushNULL();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// WMEGalaxyAPI
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "WMEGalaxyAPI") == 0) {
|
||||
thisObj = thisStack->getTop();
|
||||
|
||||
thisObj->setNative(makeSXWMEGalaxyAPI(_gameRef, stack));
|
||||
stack->pushNULL();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Object
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -3388,18 +3408,43 @@ bool BaseGame::externalCall(ScScript *script, ScStack *stack, ScStack *thisStack
|
|||
}
|
||||
|
||||
#ifdef ENABLE_FOXTAIL
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// [FoxTail] IsNumber
|
||||
// Used at kalimba.script to check if string token is a number
|
||||
// If true is returned, then ToInt() is called for same parameter
|
||||
// ToInt(string) implementation is using atoi(), so let's use it here too
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "IsNumber") == 0) {
|
||||
stack->correctParams(1);
|
||||
ScValue *val = stack->pop();
|
||||
|
||||
bool result = false;
|
||||
if (val->isInt() || val->isFloat()) {
|
||||
result = true;
|
||||
} else if (val->isString()) {
|
||||
const char *str = val->getString();
|
||||
result = (atoi(str) != 0) || (strcmp(str, "0") == 0);
|
||||
}
|
||||
|
||||
stack->pushBool(result);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// [FoxTail] Split
|
||||
// Returns array of words of a string, using another as a delimeter
|
||||
// Used to split strings by 1 character delimeter in various scripts
|
||||
// All the delimeters ever used in FoxTail are: " ", "@", "#", "$", "&"
|
||||
// So, this implementation takes 1st char of delimeter string only
|
||||
// Used to split strings by 1-2 characters delimeter in various scripts
|
||||
// All the delimeters ever used in FoxTail are:
|
||||
// " ", "@", "#", "$", "&", ",", "\\", "@h", "@i", "@p", "@s"
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "Split") == 0) {
|
||||
stack->correctParams(2);
|
||||
const char *str = stack->pop()->getString();
|
||||
const char sep = stack->pop()->getString()[0];
|
||||
size_t size = strlen(str) + 1;
|
||||
Common::String sep = stack->pop()->getString();
|
||||
uint32 size = strlen(str) + 1;
|
||||
|
||||
// Let's make copies before modifying stack
|
||||
char *copy = new char[size];
|
||||
strcpy(copy, str);
|
||||
|
||||
// There is no way to makeSXArray() with exactly 1 given element
|
||||
// That's why we are creating empty Array and SXArray::push() later
|
||||
|
@ -3407,15 +3452,17 @@ bool BaseGame::externalCall(ScScript *script, ScStack *stack, ScStack *thisStack
|
|||
BaseScriptable *arr = makeSXArray(_gameRef, stack);
|
||||
|
||||
// Iterating string copy, replacing delimeter with '\0' and pushing matches
|
||||
char *copy = new char[size];
|
||||
strcpy(copy, str);
|
||||
// Only non-empty matches should be pushed
|
||||
char *begin = copy;
|
||||
for (char *it = copy; it < copy + size; it++) {
|
||||
if (*it == sep || *it == '\0') {
|
||||
if (strncmp(it, sep.c_str(), sep.size()) == 0 || *it == '\0') {
|
||||
*it = '\0';
|
||||
if (it != begin) {
|
||||
stack->pushString(begin);
|
||||
((SXArray *)arr)->push(stack->pop());
|
||||
begin = it + 1;
|
||||
}
|
||||
begin = it + sep.size();
|
||||
it = begin - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3423,8 +3470,38 @@ bool BaseGame::externalCall(ScScript *script, ScStack *stack, ScStack *thisStack
|
|||
|
||||
delete[] copy;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// [FoxTail] Trim / lTrim / rTrim
|
||||
// Removes whitespaces from a string from the left & right
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "Trim") == 0 || strcmp(name, "lTrim") == 0 || strcmp(name, "rTrim") == 0) {
|
||||
stack->correctParams(1);
|
||||
const char *str = stack->pop()->getString();
|
||||
char *copy = new char[strlen(str) + 1];
|
||||
strcpy(copy, str);
|
||||
|
||||
char *ptr = copy;
|
||||
if (strcmp(name, "rTrim") != 0) {
|
||||
ptr = Common::ltrim(ptr);
|
||||
}
|
||||
if (strcmp(name, "lTrim") != 0) {
|
||||
ptr = Common::rtrim(ptr);
|
||||
}
|
||||
|
||||
stack->pushString(ptr);
|
||||
|
||||
delete[] copy;
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Plugins: emulate object constructors from known "wme_*.dll" plugins
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if(!DID_FAIL(EmulatePluginCall(_gameRef, stack, thisStack, name))) {
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// failure
|
||||
else {
|
||||
|
@ -3723,6 +3800,59 @@ bool BaseGame::handleMouseWheel(int32 delta) {
|
|||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool BaseGame::handleCustomActionStart(BaseGameCustomAction action) {
|
||||
if (BaseEngine::instance().getGameId() == "corrosion") {
|
||||
// Keyboard walking is added, for both original game & Enhanced Edition
|
||||
|
||||
// However, Enhanced Edition contain city map screen, which is
|
||||
// mouse controlled and conflicts with those custom actions
|
||||
const char *m = "items\\street_map\\windows\\street_map_window.script";
|
||||
if (_scEngine->isRunningScript(m)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Point32 p;
|
||||
switch (action) {
|
||||
case kClickAtCenter:
|
||||
p.x = _renderer->getWidth() / 2;
|
||||
p.y = _renderer->getHeight() / 2;
|
||||
break;
|
||||
case kClickAtLeft:
|
||||
p.x = 30;
|
||||
p.y = _renderer->getHeight() / 2;
|
||||
break;
|
||||
case kClickAtRight:
|
||||
p.x = _renderer->getWidth() - 30;
|
||||
p.y = _renderer->getHeight() / 2;
|
||||
break;
|
||||
case kClickAtTop:
|
||||
p.x = _renderer->getWidth() / 2;
|
||||
p.y = 10;
|
||||
break;
|
||||
case kClickAtBottom:
|
||||
p.x = _renderer->getWidth() / 2;
|
||||
p.y = _renderer->getHeight();
|
||||
p.y -= ConfMan.get("extra").contains("Enhanced") ? 35 : 90;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
BasePlatform::setCursorPos(p.x, p.y);
|
||||
setActiveObject(_gameRef->_renderer->getObjectAt(p.x, p.y));
|
||||
onMouseLeftDown();
|
||||
onMouseLeftUp();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool BaseGame::handleCustomActionEnd(BaseGameCustomAction action) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool BaseGame::getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) const {
|
||||
|
@ -4011,6 +4141,23 @@ bool BaseGame::drawCursor(BaseSprite *cursor) {
|
|||
return cursor->draw(_mousePos.x, _mousePos.y);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool BaseGame::storeSaveThumbnail() {
|
||||
delete _cachedThumbnail;
|
||||
_cachedThumbnail = new SaveThumbHelper(this);
|
||||
if (DID_FAIL(_cachedThumbnail->storeThumbnail())) {
|
||||
deleteSaveThumbnail();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void BaseGame::deleteSaveThumbnail() {
|
||||
delete _cachedThumbnail;
|
||||
_cachedThumbnail = nullptr;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#define WINTERMUTE_BASE_GAME_H
|
||||
|
||||
#include "engines/wintermute/base/base_object.h"
|
||||
#include "engines/wintermute/base/base_game_custom_actions.h"
|
||||
#include "engines/wintermute/base/timer.h"
|
||||
#include "engines/wintermute/persistent.h"
|
||||
#include "engines/wintermute/coll_templ.h"
|
||||
|
@ -210,6 +211,8 @@ public:
|
|||
|
||||
bool handleKeypress(Common::Event *event, bool printable = false) override;
|
||||
virtual void handleKeyRelease(Common::Event *event);
|
||||
bool handleCustomActionStart(BaseGameCustomAction action);
|
||||
bool handleCustomActionEnd(BaseGameCustomAction action);
|
||||
|
||||
bool unfreeze();
|
||||
bool freeze(bool includingMusic = true);
|
||||
|
@ -267,6 +270,8 @@ public:
|
|||
bool setActiveObject(BaseObject *Obj);
|
||||
BaseSprite *_lastCursor;
|
||||
bool drawCursor(BaseSprite *Cursor);
|
||||
bool storeSaveThumbnail();
|
||||
void deleteSaveThumbnail();
|
||||
|
||||
SaveThumbHelper *_cachedThumbnail;
|
||||
void addMem(int32 bytes);
|
||||
|
|
44
engines/wintermute/base/base_game_custom_actions.h
Normal file
44
engines/wintermute/base/base_game_custom_actions.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is based on WME Lite.
|
||||
* http://dead-code.org/redir.php?target=wmelite
|
||||
* Copyright (c) 2011 Jan Nedoma
|
||||
*/
|
||||
|
||||
#ifndef WINTERMUTE_BASE_GAME_CUSTOM_ACTION_H
|
||||
#define WINTERMUTE_BASE_GAME_CUSTOM_ACTION_H
|
||||
|
||||
namespace Wintermute {
|
||||
|
||||
enum BaseGameCustomAction {
|
||||
kClickAtCenter = 0,
|
||||
kClickAtLeft = 1,
|
||||
kClickAtRight = 2,
|
||||
kClickAtTop = 3,
|
||||
kClickAtBottom = 4
|
||||
};
|
||||
|
||||
} // End of namespace Wintermute
|
||||
|
||||
#endif
|
|
@ -49,6 +49,8 @@ BaseGameMusic::BaseGameMusic(BaseGame *gameRef) : _gameRef(gameRef) {
|
|||
_musicCrossfadeChannel1 = -1;
|
||||
_musicCrossfadeChannel2 = -1;
|
||||
_musicCrossfadeSwap = false;
|
||||
_musicCrossfadeVolume1 = 0;
|
||||
_musicCrossfadeVolume2 = 100;
|
||||
}
|
||||
|
||||
void BaseGameMusic::cleanup() {
|
||||
|
@ -152,8 +154,6 @@ bool BaseGameMusic::setMusicStartTime(int channel, uint32 time) {
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool BaseGameMusic::updateMusicCrossfade() {
|
||||
/* byte globMusicVol = _soundMgr->getVolumePercent(SOUND_MUSIC); */
|
||||
|
||||
if (!_musicCrossfadeRunning) {
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
@ -181,13 +181,22 @@ bool BaseGameMusic::updateMusicCrossfade() {
|
|||
|
||||
if (currentTime >= _musicCrossfadeLength) {
|
||||
_musicCrossfadeRunning = false;
|
||||
//_music[_musicCrossfadeChannel2]->setVolume(GlobMusicVol);
|
||||
|
||||
if (_musicCrossfadeVolume2 == 0) {
|
||||
_music[_musicCrossfadeChannel2]->stop();
|
||||
_music[_musicCrossfadeChannel2]->setVolumePercent(100);
|
||||
} else {
|
||||
_music[_musicCrossfadeChannel2]->setVolumePercent(_musicCrossfadeVolume2);
|
||||
}
|
||||
|
||||
if (_musicCrossfadeChannel1 != _musicCrossfadeChannel2) {
|
||||
if (_musicCrossfadeVolume1 == 0) {
|
||||
_music[_musicCrossfadeChannel1]->stop();
|
||||
//_music[_musicCrossfadeChannel1]->setVolume(GlobMusicVol);
|
||||
_music[_musicCrossfadeChannel1]->setVolumePercent(100);
|
||||
|
||||
} else {
|
||||
_music[_musicCrossfadeChannel1]->setVolumePercent(_musicCrossfadeVolume1);
|
||||
}
|
||||
}
|
||||
|
||||
if (_musicCrossfadeSwap) {
|
||||
// swap channels
|
||||
|
@ -201,12 +210,15 @@ bool BaseGameMusic::updateMusicCrossfade() {
|
|||
_musicStartTime[_musicCrossfadeChannel2] = dummyInt;
|
||||
}
|
||||
} else {
|
||||
//_music[_musicCrossfadeChannel1]->setVolume(GlobMusicVol - (float)CurrentTime / (float)_musicCrossfadeLength * GlobMusicVol);
|
||||
//_music[_musicCrossfadeChannel2]->setVolume((float)CurrentTime / (float)_musicCrossfadeLength * GlobMusicVol);
|
||||
_music[_musicCrossfadeChannel1]->setVolumePercent((int)(100.0f - (float)currentTime / (float)_musicCrossfadeLength * 100.0f));
|
||||
_music[_musicCrossfadeChannel2]->setVolumePercent((int)((float)currentTime / (float)_musicCrossfadeLength * 100.0f));
|
||||
float progress = (float)currentTime / (float)_musicCrossfadeLength;
|
||||
int volumeDelta = (int)((_musicCrossfadeVolume1 - _musicCrossfadeVolume2)*progress);
|
||||
_music[_musicCrossfadeChannel2]->setVolumePercent(_musicCrossfadeVolume1 - volumeDelta);
|
||||
BaseEngine::LOG(0, "Setting music channel %d volume to %d", _musicCrossfadeChannel2, _musicCrossfadeVolume1 - volumeDelta);
|
||||
|
||||
//_gameRef->QuickMessageForm("%d %d", _music[_musicCrossfadeChannel1]->GetVolume(), _music[_musicCrossfadeChannel2]->GetVolume());
|
||||
if (_musicCrossfadeChannel1 != _musicCrossfadeChannel2) {
|
||||
_music[_musicCrossfadeChannel1]->setVolumePercent(_musicCrossfadeVolume2 + volumeDelta);
|
||||
BaseEngine::LOG(0, "Setting music channel %d volume to %d", _musicCrossfadeChannel1, _musicCrossfadeVolume2 + volumeDelta);
|
||||
}
|
||||
}
|
||||
|
||||
return STATUS_OK;
|
||||
|
@ -227,6 +239,12 @@ bool BaseGameMusic::persistCrossfadeSettings(BasePersistenceManager *persistMgr)
|
|||
persistMgr->transferSint32(TMEMBER(_musicCrossfadeChannel1));
|
||||
persistMgr->transferSint32(TMEMBER(_musicCrossfadeChannel2));
|
||||
persistMgr->transferBool(TMEMBER(_musicCrossfadeSwap));
|
||||
|
||||
// let's keep savegame compatibility for the price of small possibility of wrong volume at game load
|
||||
if (!persistMgr->getIsSaving()) {
|
||||
_musicCrossfadeVolume1 = 0;
|
||||
_musicCrossfadeVolume2 = 100;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -472,6 +490,8 @@ bool BaseGameMusic::scCallMethod(ScScript *script, ScStack *stack, ScStack *this
|
|||
_musicCrossfadeStartTime = _gameRef->getLiveTimer()->getTime();
|
||||
_musicCrossfadeChannel1 = channel1;
|
||||
_musicCrossfadeChannel2 = channel2;
|
||||
_musicCrossfadeVolume1 = 0;
|
||||
_musicCrossfadeVolume2 = 100;
|
||||
_musicCrossfadeLength = fadeLength;
|
||||
_musicCrossfadeSwap = swap;
|
||||
|
||||
|
@ -481,6 +501,38 @@ bool BaseGameMusic::scCallMethod(ScScript *script, ScStack *stack, ScStack *this
|
|||
return STATUS_OK;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FOXTAIL
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// [FoxTail] MusicCrossfadeVolume
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "MusicCrossfadeVolume") == 0) {
|
||||
stack->correctParams(4);
|
||||
int channel = stack->pop()->getInt(0);
|
||||
int volume1 = stack->pop()->getInt(0);
|
||||
int volume2 = stack->pop()->getInt(0);
|
||||
uint32 fadeLength = (uint32)stack->pop()->getInt(0);
|
||||
|
||||
if (_musicCrossfadeRunning) {
|
||||
script->runtimeError("Game.MusicCrossfade: Music crossfade is already in progress.");
|
||||
stack->pushBool(false);
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
_musicCrossfadeStartTime = _gameRef->getLiveTimer()->getTime();
|
||||
_musicCrossfadeChannel1 = channel;
|
||||
_musicCrossfadeChannel2 = channel;
|
||||
_musicCrossfadeVolume1 = volume1;
|
||||
_musicCrossfadeVolume2 = volume2;
|
||||
_musicCrossfadeLength = fadeLength;
|
||||
_musicCrossfadeSwap = false;
|
||||
|
||||
_musicCrossfadeRunning = true;
|
||||
|
||||
stack->pushBool(true);
|
||||
return STATUS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// GetSoundLength
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -66,6 +66,8 @@ private:
|
|||
uint32 _musicCrossfadeLength;
|
||||
int32 _musicCrossfadeChannel1;
|
||||
int32 _musicCrossfadeChannel2;
|
||||
int32 _musicCrossfadeVolume1;
|
||||
int32 _musicCrossfadeVolume2;
|
||||
};
|
||||
|
||||
} // End of namespace Wintermute
|
||||
|
|
|
@ -496,6 +496,23 @@ bool BaseObject::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSta
|
|||
return STATUS_OK;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FOXTAIL
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// [FoxTail] GetSoundFilename
|
||||
// Used to save/restore ambient sounds
|
||||
// Should contain '\\' character, because Split("\\") is called on result
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
else if (strcmp(name, "GetSoundFilename") == 0) {
|
||||
stack->correctParams(0);
|
||||
|
||||
if (!_sFX) {
|
||||
stack->pushNULL();
|
||||
} else {
|
||||
stack->pushString(_sFX->getFilename());
|
||||
}
|
||||
return STATUS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// SoundFXNone
|
||||
|
|
|
@ -79,8 +79,6 @@ BaseScriptable *makeSXMemBuffer(BaseGame *inGame, ScStack *stack);
|
|||
BaseScriptable *makeSXObject(BaseGame *inGame, ScStack *stack);
|
||||
BaseScriptable *makeSXStore(BaseGame *inGame);
|
||||
BaseScriptable *makeSXString(BaseGame *inGame, ScStack *stack);
|
||||
BaseScriptable *makeSXSteamAPI(BaseGame *inGame, ScStack *stack);
|
||||
BaseScriptable *makeSXWMEGalaxyAPI(BaseGame *inGame, ScStack *stack);
|
||||
|
||||
} // End of namespace Wintermute
|
||||
|
||||
|
|
|
@ -61,8 +61,8 @@ static Common::FSNode getNodeForRelativePath(const Common::String &filename) {
|
|||
}
|
||||
|
||||
// Relative path:
|
||||
if (filename.contains('\\')) {
|
||||
Common::StringTokenizer path(filename, "\\");
|
||||
if (filename.contains('/')) {
|
||||
Common::StringTokenizer path(filename, "/");
|
||||
|
||||
// Start traversing relative to the game-data-dir
|
||||
const Common::FSNode gameDataDir(ConfMan.get("path"));
|
||||
|
@ -70,7 +70,7 @@ static Common::FSNode getNodeForRelativePath(const Common::String &filename) {
|
|||
|
||||
// Parse all path-elements
|
||||
while (!path.empty()) {
|
||||
// Get the next path-component by slicing on '\\'
|
||||
// Get the next path-component by slicing on '/'
|
||||
Common::String pathPart = path.nextToken();
|
||||
// Get the next FSNode in the chain, if it exists as a child from the previous.
|
||||
curNode = curNode.getChild(pathPart);
|
||||
|
@ -109,6 +109,11 @@ bool diskFileExists(const Common::String &filename) {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
int listMatchingDiskFileMembers(Common::ArchiveMemberList &list, const Common::String &pattern) {
|
||||
return Common::FSDirectory(ConfMan.get("path")).listMatchingMembers(list, pattern);
|
||||
}
|
||||
|
||||
Common::SeekableReadStream *openDiskFile(const Common::String &filename) {
|
||||
uint32 prefixSize = 0;
|
||||
Common::SeekableReadStream *file = nullptr;
|
||||
|
|
|
@ -29,12 +29,14 @@
|
|||
#ifndef WINTERMUTE_BASE_DISKFILE_H
|
||||
#define WINTERMUTE_BASE_DISKFILE_H
|
||||
|
||||
#include "common/archive.h"
|
||||
#include "common/stream.h"
|
||||
|
||||
namespace Wintermute {
|
||||
|
||||
Common::SeekableReadStream *openDiskFile(const Common::String &filename);
|
||||
bool diskFileExists(const Common::String &filename);
|
||||
int listMatchingDiskFileMembers(Common::ArchiveMemberList &list, const Common::String &pattern);
|
||||
|
||||
} // End of namespace Wintermute
|
||||
|
||||
|
|
|
@ -42,6 +42,9 @@ Common::String makeSfmFilename(const Common::String &filename) {
|
|||
smFilename.setChar('_', i);
|
||||
}
|
||||
}
|
||||
while (smFilename.hasPrefix("._")) {
|
||||
smFilename = smFilename.substr(2);
|
||||
}
|
||||
return BaseEngine::instance().getGameTargetName() + "." + smFilename;
|
||||
}
|
||||
|
||||
|
@ -60,4 +63,14 @@ Common::WriteStream *openSfmFileForWrite(const Common::String &filename) {
|
|||
return g_system->getSavefileManager()->openForSaving(smFilename, false);
|
||||
}
|
||||
|
||||
Common::StringArray sfmFileList(const Common::String &mask) {
|
||||
Common::String prefix = BaseEngine::instance().getGameTargetName() + ".";
|
||||
Common::String smMask = makeSfmFilename(mask);
|
||||
Common::StringArray array = g_system->getSavefileManager()->listSavefiles(smMask);
|
||||
for (uint32 i = 0; i < array.size(); i++) {
|
||||
array[i] = array[i].substr(prefix.size());
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
} // End of namespace Wintermute
|
||||
|
|
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