JANITORIAL: Remove more trailing spaces
This commit is contained in:
parent
dead4aa014
commit
355c4fa646
60 changed files with 211 additions and 211 deletions
|
@ -123,7 +123,7 @@ void OPL::clear() {
|
||||||
} else if (_type == Config::kOpl2) {
|
} else if (_type == Config::kOpl2) {
|
||||||
for (int i = 0; i < kOpl2Operators; ++i) {
|
for (int i = 0; i < kOpl2Operators; ++i) {
|
||||||
_oper[i].left = 1;
|
_oper[i].left = 1;
|
||||||
_oper[i].right = 1;
|
_oper[i].right = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ bool OPL::init() {
|
||||||
while (!snd_ctl_hwdep_next_device(ctl, &dev) && dev >= 0) {
|
while (!snd_ctl_hwdep_next_device(ctl, &dev) && dev >= 0) {
|
||||||
name = Common::String::format("hw:%d,%d", card, dev);
|
name = Common::String::format("hw:%d,%d", card, dev);
|
||||||
|
|
||||||
if (snd_hwdep_open(&_opl, name.c_str(), SND_HWDEP_OPEN_WRITE) < 0)
|
if (snd_hwdep_open(&_opl, name.c_str(), SND_HWDEP_OPEN_WRITE) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!snd_hwdep_info(_opl, info)) {
|
if (!snd_hwdep_info(_opl, info)) {
|
||||||
|
|
|
@ -248,7 +248,7 @@ void RealOPL::onTimer() {
|
||||||
if (_baseFreq > kMaxFreq) {
|
if (_baseFreq > kMaxFreq) {
|
||||||
// We run faster than our max, so run the callback multiple
|
// We run faster than our max, so run the callback multiple
|
||||||
// times to approximate the actual timer callback frequency.
|
// times to approximate the actual timer callback frequency.
|
||||||
uint totalTicks = _baseFreq + _remainingTicks;
|
uint totalTicks = _baseFreq + _remainingTicks;
|
||||||
callbacks = totalTicks / kMaxFreq;
|
callbacks = totalTicks / kMaxFreq;
|
||||||
_remainingTicks = totalTicks % kMaxFreq;
|
_remainingTicks = totalTicks % kMaxFreq;
|
||||||
}
|
}
|
||||||
|
|
|
@ -561,7 +561,7 @@ void MidiDriver_Miles_AdLib::noteOff(byte midiChannel, byte note) {
|
||||||
_virtualFmVoices[virtualFmVoice].sustained = true;
|
_virtualFmVoices[virtualFmVoice].sustained = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
releaseFmVoice(virtualFmVoice);
|
releaseFmVoice(virtualFmVoice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -601,7 +601,7 @@ void MidiDriver_Miles_AdLib::prioritySort() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
while (virtualFmVoicesCount) {
|
while (virtualFmVoicesCount) {
|
||||||
uint16 unvoicedHighestPriority = 0;
|
uint16 unvoicedHighestPriority = 0;
|
||||||
byte unvoicedHighestFmVoice = 0;
|
byte unvoicedHighestFmVoice = 0;
|
||||||
|
@ -688,7 +688,7 @@ void MidiDriver_Miles_AdLib::releaseFmVoice(byte virtualFmVoice) {
|
||||||
|
|
||||||
// One less voice active on this MIDI channel
|
// One less voice active on this MIDI channel
|
||||||
assert(_midiChannels[midiChannel].currentActiveVoicesCount);
|
assert(_midiChannels[midiChannel].currentActiveVoicesCount);
|
||||||
_midiChannels[midiChannel].currentActiveVoicesCount--;
|
_midiChannels[midiChannel].currentActiveVoicesCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MidiDriver_Miles_AdLib::releaseSustain(byte midiChannel) {
|
void MidiDriver_Miles_AdLib::releaseSustain(byte midiChannel) {
|
||||||
|
|
|
@ -62,7 +62,7 @@ bool EuphonyPlayer::init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_drivers[0] || !_drivers[1])
|
if (!_drivers[0] || !_drivers[1])
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ bool EuphonyPlayer::parseEvent() {
|
||||||
EVENT(programChange_channelAftertouch),
|
EVENT(programChange_channelAftertouch),
|
||||||
EVENT(programChange_channelAftertouch),
|
EVENT(programChange_channelAftertouch),
|
||||||
EVENT(controlChange_pitchWheel),
|
EVENT(controlChange_pitchWheel),
|
||||||
|
|
||||||
EVENT(sysex),
|
EVENT(sysex),
|
||||||
EVENT(advanceBar),
|
EVENT(advanceBar),
|
||||||
EVENT(notImpl),
|
EVENT(notImpl),
|
||||||
|
@ -661,7 +661,7 @@ bool EuphonyDriver::init() {
|
||||||
delete[] _channels;
|
delete[] _channels;
|
||||||
delete[] _partToChanMapping;
|
delete[] _partToChanMapping;
|
||||||
delete[] _sustainChannels;
|
delete[] _sustainChannels;
|
||||||
|
|
||||||
_channels = new Channel[128];
|
_channels = new Channel[128];
|
||||||
_partToChanMapping = new int8[16];
|
_partToChanMapping = new int8[16];
|
||||||
_sustainChannels = new int8[16];
|
_sustainChannels = new int8[16];
|
||||||
|
@ -674,7 +674,7 @@ void EuphonyDriver::reset() {
|
||||||
_intf->callback(74);
|
_intf->callback(74);
|
||||||
_intf->callback(70, 0);
|
_intf->callback(70, 0);
|
||||||
_intf->callback(75, 3);
|
_intf->callback(75, 3);
|
||||||
|
|
||||||
_currentEvent.clear();
|
_currentEvent.clear();
|
||||||
memset(_sustainChannels, 0, 16);
|
memset(_sustainChannels, 0, 16);
|
||||||
memset(_partToChanMapping, -1, 16);
|
memset(_partToChanMapping, -1, 16);
|
||||||
|
|
|
@ -120,7 +120,7 @@ public:
|
||||||
|
|
||||||
int setTempo(int tempo);
|
int setTempo(int tempo);
|
||||||
void setLoopStatus(bool loop);
|
void setLoopStatus(bool loop);
|
||||||
|
|
||||||
bool isPlaying() {return _playing; }
|
bool isPlaying() {return _playing; }
|
||||||
|
|
||||||
int configPart_enable(int part, int val);
|
int configPart_enable(int part, int val);
|
||||||
|
@ -148,10 +148,10 @@ private:
|
||||||
|
|
||||||
void updateHangingNotes();
|
void updateHangingNotes();
|
||||||
void clearHangingNotes();
|
void clearHangingNotes();
|
||||||
|
|
||||||
void resetAllControls();
|
void resetAllControls();
|
||||||
void allPartsOff();
|
void allPartsOff();
|
||||||
|
|
||||||
uint8 appendEvent(uint8 evt, uint8 chan);
|
uint8 appendEvent(uint8 evt, uint8 chan);
|
||||||
|
|
||||||
typedef bool(EuphonyPlayer::*EuphonyEvent)();
|
typedef bool(EuphonyPlayer::*EuphonyEvent)();
|
||||||
|
@ -190,7 +190,7 @@ private:
|
||||||
uint16 len;
|
uint16 len;
|
||||||
SavedEvent *next;
|
SavedEvent *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
SavedEvent *_savedEventsChain;
|
SavedEvent *_savedEventsChain;
|
||||||
|
|
||||||
uint8 _defaultBarLength;
|
uint8 _defaultBarLength;
|
||||||
|
|
|
@ -58,4 +58,4 @@ AudioCDManager *createMacOSXAudioCDManager();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //
|
#endif //
|
||||||
|
|
|
@ -385,4 +385,4 @@ AudioCDManager *createWin32AudioCDManager() {
|
||||||
return new Win32AudioCDManager();
|
return new Win32AudioCDManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
|
@ -84,7 +84,7 @@ bool AndroidSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
|
||||||
|
|
||||||
int AndroidSdlEventSource::mapKey(SDLKey sdlKey, SDLMod mod, Uint16 unicode) {
|
int AndroidSdlEventSource::mapKey(SDLKey sdlKey, SDLMod mod, Uint16 unicode) {
|
||||||
Common::KeyCode key = SDLToOSystemKeycode(sdlKey);
|
Common::KeyCode key = SDLToOSystemKeycode(sdlKey);
|
||||||
|
|
||||||
if (key >= Common::KEYCODE_F1 && key <= Common::KEYCODE_F9) {
|
if (key >= Common::KEYCODE_F1 && key <= Common::KEYCODE_F9) {
|
||||||
return key - Common::KEYCODE_F1 + Common::ASCII_F1;
|
return key - Common::KEYCODE_F1 + Common::ASCII_F1;
|
||||||
} else if (key >= Common::KEYCODE_KP0 && key <= Common::KEYCODE_KP9) {
|
} else if (key >= Common::KEYCODE_KP0 && key <= Common::KEYCODE_KP9) {
|
||||||
|
|
|
@ -267,7 +267,7 @@ bool POSIXFilesystemNode::create(bool isDir) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
setFlags();
|
setFlags();
|
||||||
if (_isValid) {
|
if (_isValid) {
|
||||||
if (_isDirectory != isDir) warning("failed to create %s: got %s", isDir ? "directory" : "file", _isDirectory ? "directory" : "file");
|
if (_isDirectory != isDir) warning("failed to create %s: got %s", isDir ? "directory" : "file", _isDirectory ? "directory" : "file");
|
||||||
|
|
|
@ -168,7 +168,7 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
|
||||||
if (newPath.lastChar() != '/')
|
if (newPath.lastChar() != '/')
|
||||||
newPath += '/';
|
newPath += '/';
|
||||||
newPath += pent->d_name;
|
newPath += pent->d_name;
|
||||||
|
|
||||||
bool isDir = false;
|
bool isDir = false;
|
||||||
tmpdir = opendir(newPath.c_str());
|
tmpdir = opendir(newPath.c_str());
|
||||||
if(tmpdir)
|
if(tmpdir)
|
||||||
|
@ -176,17 +176,17 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
|
||||||
isDir = true;
|
isDir = true;
|
||||||
closedir(tmpdir);
|
closedir(tmpdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mode == Common::FSNode::kListFilesOnly && isDir) ||
|
if ((mode == Common::FSNode::kListFilesOnly && isDir) ||
|
||||||
(mode == Common::FSNode::kListDirectoriesOnly && !isDir))
|
(mode == Common::FSNode::kListDirectoriesOnly && !isDir))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
st.st_mode = 0;
|
st.st_mode = 0;
|
||||||
st.st_mode |= ( isDir ? S_IFDIR : 0 );
|
st.st_mode |= ( isDir ? S_IFDIR : 0 );
|
||||||
st.st_mode |= S_IRUSR;
|
st.st_mode |= S_IRUSR;
|
||||||
st.st_mode |= S_IWUSR;
|
st.st_mode |= S_IWUSR;
|
||||||
|
|
||||||
list.push_back(new WiiFilesystemNode(newPath, &st));
|
list.push_back(new WiiFilesystemNode(newPath, &st));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ void loadConfig() {
|
||||||
config.stretchToFit = confGetBool("stretchtofit", false);
|
config.stretchToFit = confGetBool("stretchtofit", false);
|
||||||
config.sensitivity = confGetInt("sensitivity", -5);
|
config.sensitivity = confGetInt("sensitivity", -5);
|
||||||
config.screen = confGetInt("screen", kScreenBoth);
|
config.screen = confGetInt("screen", kScreenBoth);
|
||||||
|
|
||||||
// Turn off the backlight of any screen not used
|
// Turn off the backlight of any screen not used
|
||||||
if (R_SUCCEEDED(gspLcdInit())) {
|
if (R_SUCCEEDED(gspLcdInit())) {
|
||||||
if (config.screen == kScreenTop) {
|
if (config.screen == kScreenTop) {
|
||||||
|
@ -70,7 +70,7 @@ void loadConfig() {
|
||||||
GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTH);
|
GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTH);
|
||||||
gspLcdExit();
|
gspLcdExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
OSystem_3DS *osys = (OSystem_3DS *)g_system;
|
OSystem_3DS *osys = (OSystem_3DS *)g_system;
|
||||||
osys->updateConfig();
|
osys->updateConfig();
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "common/str.h"
|
#include "common/str.h"
|
||||||
|
|
||||||
namespace _3DS {
|
namespace _3DS {
|
||||||
|
|
||||||
struct Config {
|
struct Config {
|
||||||
bool showCursor;
|
bool showCursor;
|
||||||
bool snapToBorder;
|
bool snapToBorder;
|
||||||
|
|
|
@ -33,7 +33,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void close();
|
virtual void close();
|
||||||
|
|
||||||
uint32 _timer;
|
uint32 _timer;
|
||||||
static StatusMessageDialog* _opened;
|
static StatusMessageDialog* _opened;
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,13 +41,13 @@ int main(int argc, char *argv[]) {
|
||||||
scummvm_main(0, nullptr);
|
scummvm_main(0, nullptr);
|
||||||
|
|
||||||
delete dynamic_cast<_3DS::OSystem_3DS*>(g_system);
|
delete dynamic_cast<_3DS::OSystem_3DS*>(g_system);
|
||||||
|
|
||||||
// Turn on both screen backlights before exiting.
|
// Turn on both screen backlights before exiting.
|
||||||
if (R_SUCCEEDED(gspLcdInit())) {
|
if (R_SUCCEEDED(gspLcdInit())) {
|
||||||
GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTH);
|
GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTH);
|
||||||
gspLcdExit();
|
gspLcdExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
cfguExit();
|
cfguExit();
|
||||||
gfxExit();
|
gfxExit();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -33,11 +33,11 @@
|
||||||
#include "common/translation.h"
|
#include "common/translation.h"
|
||||||
|
|
||||||
namespace _3DS {
|
namespace _3DS {
|
||||||
|
|
||||||
bool optionMenuOpened = false;
|
bool optionMenuOpened = false;
|
||||||
|
|
||||||
OptionsDialog::OptionsDialog() : GUI::Dialog(20, 20, 280, 200) {
|
OptionsDialog::OptionsDialog() : GUI::Dialog(20, 20, 280, 200) {
|
||||||
|
|
||||||
optionMenuOpened = true;
|
optionMenuOpened = true;
|
||||||
|
|
||||||
new GUI::ButtonWidget(this, 120, 180, 72, 16, _("~C~lose"), 0, GUI::kCloseCmd);
|
new GUI::ButtonWidget(this, 120, 180, 72, 16, _("~C~lose"), 0, GUI::kCloseCmd);
|
||||||
|
@ -45,10 +45,10 @@ OptionsDialog::OptionsDialog() : GUI::Dialog(20, 20, 280, 200) {
|
||||||
|
|
||||||
_showCursorCheckbox = new GUI::CheckboxWidget(this, 5, 5, 130, 20, _("Show mouse cursor"), 0, 0, 'T');
|
_showCursorCheckbox = new GUI::CheckboxWidget(this, 5, 5, 130, 20, _("Show mouse cursor"), 0, 0, 'T');
|
||||||
_showCursorCheckbox->setState(config.showCursor);
|
_showCursorCheckbox->setState(config.showCursor);
|
||||||
|
|
||||||
_snapToBorderCheckbox = new GUI::CheckboxWidget(this, 5, 22, 130, 20, _("Snap to edges"), 0, 0, 'T');
|
_snapToBorderCheckbox = new GUI::CheckboxWidget(this, 5, 22, 130, 20, _("Snap to edges"), 0, 0, 'T');
|
||||||
_snapToBorderCheckbox->setState(config.snapToBorder);
|
_snapToBorderCheckbox->setState(config.snapToBorder);
|
||||||
|
|
||||||
_stretchToFitCheckbox = new GUI::CheckboxWidget(this, 140, 5, 130, 20, _("Stretch to fit"), 0, 0, 'T');
|
_stretchToFitCheckbox = new GUI::CheckboxWidget(this, 140, 5, 130, 20, _("Stretch to fit"), 0, 0, 'T');
|
||||||
_stretchToFitCheckbox->setState(config.stretchToFit);
|
_stretchToFitCheckbox->setState(config.stretchToFit);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "scumm/dialogs.h"
|
#include "scumm/dialogs.h"
|
||||||
|
|
||||||
namespace _3DS {
|
namespace _3DS {
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kSave = 0x10000000,
|
kSave = 0x10000000,
|
||||||
kScreenRadioGroup,
|
kScreenRadioGroup,
|
||||||
|
@ -41,7 +41,7 @@ enum {
|
||||||
kScreenBottom,
|
kScreenBottom,
|
||||||
kScreenBoth,
|
kScreenBoth,
|
||||||
};
|
};
|
||||||
|
|
||||||
extern bool optionMenuOpened;
|
extern bool optionMenuOpened;
|
||||||
|
|
||||||
class OptionsDialog : public GUI::Dialog {
|
class OptionsDialog : public GUI::Dialog {
|
||||||
|
|
|
@ -41,31 +41,31 @@ static void audioThreadFunc(void *arg) {
|
||||||
uint32 lastTime = osys->getMillis(true);
|
uint32 lastTime = osys->getMillis(true);
|
||||||
uint32 time = lastTime;
|
uint32 time = lastTime;
|
||||||
ndspWaveBuf buffers[bufferCount];
|
ndspWaveBuf buffers[bufferCount];
|
||||||
|
|
||||||
for (i = 0; i < bufferCount; ++i) {
|
for (i = 0; i < bufferCount; ++i) {
|
||||||
memset(&buffers[i], 0, sizeof(ndspWaveBuf));
|
memset(&buffers[i], 0, sizeof(ndspWaveBuf));
|
||||||
buffers[i].data_vaddr = linearAlloc(bufferSize);
|
buffers[i].data_vaddr = linearAlloc(bufferSize);
|
||||||
buffers[i].looping = false;
|
buffers[i].looping = false;
|
||||||
buffers[i].status = NDSP_WBUF_FREE;
|
buffers[i].status = NDSP_WBUF_FREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ndspChnReset(channel);
|
ndspChnReset(channel);
|
||||||
ndspChnSetInterp(channel, NDSP_INTERP_LINEAR);
|
ndspChnSetInterp(channel, NDSP_INTERP_LINEAR);
|
||||||
ndspChnSetRate(channel, sampleRate);
|
ndspChnSetRate(channel, sampleRate);
|
||||||
ndspChnSetFormat(channel, NDSP_FORMAT_STEREO_PCM16);
|
ndspChnSetFormat(channel, NDSP_FORMAT_STEREO_PCM16);
|
||||||
|
|
||||||
while (!osys->exiting) {
|
while (!osys->exiting) {
|
||||||
osys->delayMillis(100); // Note: Increasing the delay requires a bigger buffer
|
osys->delayMillis(100); // Note: Increasing the delay requires a bigger buffer
|
||||||
|
|
||||||
time = osys->getMillis(true);
|
time = osys->getMillis(true);
|
||||||
sampleLen = (time - lastTime) * 22 * 4; // sampleRate / 1000 * channelCount * sizeof(int16);
|
sampleLen = (time - lastTime) * 22 * 4; // sampleRate / 1000 * channelCount * sizeof(int16);
|
||||||
lastTime = time;
|
lastTime = time;
|
||||||
|
|
||||||
if (!osys->sleeping && sampleLen > 0) {
|
if (!osys->sleeping && sampleLen > 0) {
|
||||||
bufferIndex++;
|
bufferIndex++;
|
||||||
bufferIndex %= bufferCount;
|
bufferIndex %= bufferCount;
|
||||||
ndspWaveBuf *buf = &buffers[bufferIndex];
|
ndspWaveBuf *buf = &buffers[bufferIndex];
|
||||||
|
|
||||||
buf->nsamples = mixer->mixCallback(buf->data_adpcm, sampleLen);
|
buf->nsamples = mixer->mixCallback(buf->data_adpcm, sampleLen);
|
||||||
if (buf->nsamples > 0) {
|
if (buf->nsamples > 0) {
|
||||||
DSP_FlushDataCache(buf->data_vaddr, bufferSize);
|
DSP_FlushDataCache(buf->data_vaddr, bufferSize);
|
||||||
|
@ -73,14 +73,14 @@ static void audioThreadFunc(void *arg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < bufferCount; ++i)
|
for (i = 0; i < bufferCount; ++i)
|
||||||
linearFree(buffers[i].data_pcm8);
|
linearFree(buffers[i].data_pcm8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSystem_3DS::initAudio() {
|
void OSystem_3DS::initAudio() {
|
||||||
_mixer = new Audio::MixerImpl(this, 22050);
|
_mixer = new Audio::MixerImpl(this, 22050);
|
||||||
|
|
||||||
hasAudio = R_SUCCEEDED(ndspInit());
|
hasAudio = R_SUCCEEDED(ndspInit());
|
||||||
_mixer->setReady(false);
|
_mixer->setReady(false);
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ void OSystem_3DS::destroyAudio() {
|
||||||
threadFree(audioThread);
|
threadFree(audioThread);
|
||||||
ndspExit();
|
ndspExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
delete _mixer;
|
delete _mixer;
|
||||||
_mixer = 0;
|
_mixer = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ static void pushEventQueue(Common::Queue<Common::Event> *queue, Common::Event &e
|
||||||
static void eventThreadFunc(void *arg) {
|
static void eventThreadFunc(void *arg) {
|
||||||
OSystem_3DS *osys = (OSystem_3DS *)g_system;
|
OSystem_3DS *osys = (OSystem_3DS *)g_system;
|
||||||
auto eventQueue = (Common::Queue<Common::Event> *)arg;
|
auto eventQueue = (Common::Queue<Common::Event> *)arg;
|
||||||
|
|
||||||
uint32 touchStartTime = osys->getMillis();
|
uint32 touchStartTime = osys->getMillis();
|
||||||
touchPosition lastTouch = {0, 0};
|
touchPosition lastTouch = {0, 0};
|
||||||
bool isRightClick = false;
|
bool isRightClick = false;
|
||||||
|
@ -55,19 +55,19 @@ static void eventThreadFunc(void *arg) {
|
||||||
int circleDeadzone = 20;
|
int circleDeadzone = 20;
|
||||||
int borderSnapZone = 6;
|
int borderSnapZone = 6;
|
||||||
Common::Event event;
|
Common::Event event;
|
||||||
|
|
||||||
while (!osys->exiting) {
|
while (!osys->exiting) {
|
||||||
do {
|
do {
|
||||||
osys->delayMillis(10);
|
osys->delayMillis(10);
|
||||||
} while (osys->sleeping && !osys->exiting);
|
} while (osys->sleeping && !osys->exiting);
|
||||||
|
|
||||||
hidScanInput();
|
hidScanInput();
|
||||||
touchPosition touch;
|
touchPosition touch;
|
||||||
circlePosition circle;
|
circlePosition circle;
|
||||||
u32 held = hidKeysHeld();
|
u32 held = hidKeysHeld();
|
||||||
u32 keysPressed = hidKeysDown();
|
u32 keysPressed = hidKeysDown();
|
||||||
u32 keysReleased = hidKeysUp();
|
u32 keysReleased = hidKeysUp();
|
||||||
|
|
||||||
// C-Pad used to control the cursor
|
// C-Pad used to control the cursor
|
||||||
hidCircleRead(&circle);
|
hidCircleRead(&circle);
|
||||||
if (circle.dx < circleDeadzone && circle.dx > -circleDeadzone)
|
if (circle.dx < circleDeadzone && circle.dx > -circleDeadzone)
|
||||||
|
@ -76,7 +76,7 @@ static void eventThreadFunc(void *arg) {
|
||||||
circle.dy = 0;
|
circle.dy = 0;
|
||||||
cursorDeltaX = (0.0002f + config.sensitivity / 100000.f) * circle.dx * abs(circle.dx);
|
cursorDeltaX = (0.0002f + config.sensitivity / 100000.f) * circle.dx * abs(circle.dx);
|
||||||
cursorDeltaY = (0.0002f + config.sensitivity / 100000.f) * circle.dy * abs(circle.dy);
|
cursorDeltaY = (0.0002f + config.sensitivity / 100000.f) * circle.dy * abs(circle.dy);
|
||||||
|
|
||||||
// Touch screen events
|
// Touch screen events
|
||||||
if (held & KEY_TOUCH) {
|
if (held & KEY_TOUCH) {
|
||||||
hidTouchRead(&touch);
|
hidTouchRead(&touch);
|
||||||
|
@ -97,7 +97,7 @@ static void eventThreadFunc(void *arg) {
|
||||||
osys->warpMouse(touch.px, touch.py);
|
osys->warpMouse(touch.px, touch.py);
|
||||||
event.mouse.x = touch.px;
|
event.mouse.x = touch.px;
|
||||||
event.mouse.y = touch.py;
|
event.mouse.y = touch.py;
|
||||||
|
|
||||||
if (keysPressed & KEY_TOUCH) {
|
if (keysPressed & KEY_TOUCH) {
|
||||||
touchStartTime = osys->getMillis();
|
touchStartTime = osys->getMillis();
|
||||||
isRightClick = (held & KEY_X || held & KEY_DUP);
|
isRightClick = (held & KEY_X || held & KEY_DUP);
|
||||||
|
@ -109,7 +109,7 @@ static void eventThreadFunc(void *arg) {
|
||||||
event.type = Common::EVENT_MOUSEMOVE;
|
event.type = Common::EVENT_MOUSEMOVE;
|
||||||
pushEventQueue(eventQueue, event);
|
pushEventQueue(eventQueue, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastTouch = touch;
|
lastTouch = touch;
|
||||||
} else if (keysReleased & KEY_TOUCH) {
|
} else if (keysReleased & KEY_TOUCH) {
|
||||||
event.mouse.x = lastTouch.px;
|
event.mouse.x = lastTouch.px;
|
||||||
|
@ -136,13 +136,13 @@ static void eventThreadFunc(void *arg) {
|
||||||
lastTouch.px = cursorX;
|
lastTouch.px = cursorX;
|
||||||
lastTouch.py = cursorY;
|
lastTouch.py = cursorY;
|
||||||
osys->transformPoint(lastTouch);
|
osys->transformPoint(lastTouch);
|
||||||
osys->warpMouse(lastTouch.px, lastTouch.py);
|
osys->warpMouse(lastTouch.px, lastTouch.py);
|
||||||
event.mouse.x = lastTouch.px;
|
event.mouse.x = lastTouch.px;
|
||||||
event.mouse.y = lastTouch.py;
|
event.mouse.y = lastTouch.py;
|
||||||
event.type = Common::EVENT_MOUSEMOVE;
|
event.type = Common::EVENT_MOUSEMOVE;
|
||||||
pushEventQueue(eventQueue, event);
|
pushEventQueue(eventQueue, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Button events
|
// Button events
|
||||||
if (keysPressed & KEY_R) {
|
if (keysPressed & KEY_R) {
|
||||||
if (inputMode == MODE_DRAG) {
|
if (inputMode == MODE_DRAG) {
|
||||||
|
@ -195,7 +195,7 @@ static void eventThreadFunc(void *arg) {
|
||||||
event.kbd.flags = 0;
|
event.kbd.flags = 0;
|
||||||
pushEventQueue(eventQueue, event);
|
pushEventQueue(eventQueue, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: EVENT_PREDICTIVE_DIALOG
|
// TODO: EVENT_PREDICTIVE_DIALOG
|
||||||
// EVENT_SCREEN_CHANGED
|
// EVENT_SCREEN_CHANGED
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ static void eventThreadFunc(void *arg) {
|
||||||
|
|
||||||
static void aptHookFunc(APT_HookType hookType, void *param) {
|
static void aptHookFunc(APT_HookType hookType, void *param) {
|
||||||
OSystem_3DS *osys = (OSystem_3DS *)g_system;
|
OSystem_3DS *osys = (OSystem_3DS *)g_system;
|
||||||
|
|
||||||
switch (hookType) {
|
switch (hookType) {
|
||||||
case APTHOOK_ONSUSPEND:
|
case APTHOOK_ONSUSPEND:
|
||||||
case APTHOOK_ONSLEEP:
|
case APTHOOK_ONSLEEP:
|
||||||
|
@ -246,7 +246,7 @@ void OSystem_3DS::initEvents() {
|
||||||
svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);
|
svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);
|
||||||
_timerThread = threadCreate(&timerThreadFunc, this, 32 * 1024, prio - 1, -2, false);
|
_timerThread = threadCreate(&timerThreadFunc, this, 32 * 1024, prio - 1, -2, false);
|
||||||
_eventThread = threadCreate(&eventThreadFunc, &_eventQueue, 32 * 1024, prio - 1, -2, false);
|
_eventThread = threadCreate(&eventThreadFunc, &_eventQueue, 32 * 1024, prio - 1, -2, false);
|
||||||
|
|
||||||
aptHook(&cookie, aptHookFunc, this);
|
aptHook(&cookie, aptHookFunc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ bool OSystem_3DS::pollEvent(Common::Event &event) {
|
||||||
StatusMessageDialog dialog(messageOSD, 800);
|
StatusMessageDialog dialog(messageOSD, 800);
|
||||||
dialog.runModal();
|
dialog.runModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
aptMainLoop(); // Call apt hook when necessary
|
aptMainLoop(); // Call apt hook when necessary
|
||||||
|
|
||||||
if (optionMenuOpening) {
|
if (optionMenuOpening) {
|
||||||
|
@ -289,12 +289,12 @@ bool OSystem_3DS::pollEvent(Common::Event &event) {
|
||||||
if (g_engine)
|
if (g_engine)
|
||||||
g_engine->pauseEngine(false);
|
g_engine->pauseEngine(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::StackLock lock(*eventMutex);
|
Common::StackLock lock(*eventMutex);
|
||||||
|
|
||||||
if (_eventQueue.empty())
|
if (_eventQueue.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
event = _eventQueue.pop();
|
event = _eventQueue.pop();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
GX_TRANSFER_SCALING(GX_TRANSFER_SCALE_NO))
|
GX_TRANSFER_SCALING(GX_TRANSFER_SCALE_NO))
|
||||||
|
|
||||||
namespace _3DS {
|
namespace _3DS {
|
||||||
|
|
||||||
void OSystem_3DS::initGraphics() {
|
void OSystem_3DS::initGraphics() {
|
||||||
_pfGame = Graphics::PixelFormat::createFormatCLUT8();
|
_pfGame = Graphics::PixelFormat::createFormatCLUT8();
|
||||||
_pfGameTexture = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
|
_pfGameTexture = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
|
||||||
|
@ -60,23 +60,23 @@ void OSystem_3DS::initGraphics() {
|
||||||
shaderProgramInit(&_program);
|
shaderProgramInit(&_program);
|
||||||
shaderProgramSetVsh(&_program, &_dvlb->DVLE[0]);
|
shaderProgramSetVsh(&_program, &_dvlb->DVLE[0]);
|
||||||
C3D_BindProgram(&_program);
|
C3D_BindProgram(&_program);
|
||||||
|
|
||||||
_projectionLocation = shaderInstanceGetUniformLocation(_program.vertexShader, "projection");
|
_projectionLocation = shaderInstanceGetUniformLocation(_program.vertexShader, "projection");
|
||||||
_modelviewLocation = shaderInstanceGetUniformLocation(_program.vertexShader, "modelView");
|
_modelviewLocation = shaderInstanceGetUniformLocation(_program.vertexShader, "modelView");
|
||||||
|
|
||||||
C3D_AttrInfo *attrInfo = C3D_GetAttrInfo();
|
C3D_AttrInfo *attrInfo = C3D_GetAttrInfo();
|
||||||
AttrInfo_Init(attrInfo);
|
AttrInfo_Init(attrInfo);
|
||||||
AttrInfo_AddLoader(attrInfo, 0, GPU_FLOAT, 3); // v0=position
|
AttrInfo_AddLoader(attrInfo, 0, GPU_FLOAT, 3); // v0=position
|
||||||
AttrInfo_AddLoader(attrInfo, 1, GPU_FLOAT, 2); // v1=texcoord
|
AttrInfo_AddLoader(attrInfo, 1, GPU_FLOAT, 2); // v1=texcoord
|
||||||
|
|
||||||
Mtx_OrthoTilt(&_projectionTop, 0.0, 400.0, 240.0, 0.0, 0.0, 1.0);
|
Mtx_OrthoTilt(&_projectionTop, 0.0, 400.0, 240.0, 0.0, 0.0, 1.0);
|
||||||
Mtx_OrthoTilt(&_projectionBottom, 0.0, 320.0, 240.0, 0.0, 0.0, 1.0);
|
Mtx_OrthoTilt(&_projectionBottom, 0.0, 320.0, 240.0, 0.0, 0.0, 1.0);
|
||||||
|
|
||||||
C3D_TexEnv *env = C3D_GetTexEnv(0);
|
C3D_TexEnv *env = C3D_GetTexEnv(0);
|
||||||
C3D_TexEnvSrc(env, C3D_Both, GPU_TEXTURE0, 0, 0);
|
C3D_TexEnvSrc(env, C3D_Both, GPU_TEXTURE0, 0, 0);
|
||||||
C3D_TexEnvOp(env, C3D_Both, 0, 0, 0);
|
C3D_TexEnvOp(env, C3D_Both, 0, 0, 0);
|
||||||
C3D_TexEnvFunc(env, C3D_Both, GPU_REPLACE);
|
C3D_TexEnvFunc(env, C3D_Both, GPU_REPLACE);
|
||||||
|
|
||||||
C3D_DepthTest(false, GPU_GEQUAL, GPU_WRITE_ALL);
|
C3D_DepthTest(false, GPU_GEQUAL, GPU_WRITE_ALL);
|
||||||
C3D_CullFace(GPU_CULL_NONE);
|
C3D_CullFace(GPU_CULL_NONE);
|
||||||
}
|
}
|
||||||
|
@ -148,14 +148,14 @@ void OSystem_3DS::initSize(uint width, uint height,
|
||||||
_gameHeight = height;
|
_gameHeight = height;
|
||||||
_gameTopTexture.create(width, height, _pfGameTexture);
|
_gameTopTexture.create(width, height, _pfGameTexture);
|
||||||
_overlay.create(getOverlayWidth(), getOverlayHeight(), _pfGameTexture);
|
_overlay.create(getOverlayWidth(), getOverlayHeight(), _pfGameTexture);
|
||||||
|
|
||||||
if (format) {
|
if (format) {
|
||||||
debug("pixelformat: %d %d %d %d %d", format->bytesPerPixel, format->rBits(), format->gBits(), format->bBits(), format->aBits());;
|
debug("pixelformat: %d %d %d %d %d", format->bytesPerPixel, format->rBits(), format->gBits(), format->bBits(), format->aBits());;
|
||||||
_pfGame = *format;
|
_pfGame = *format;
|
||||||
}
|
}
|
||||||
|
|
||||||
_gameScreen.create(width, height, _pfGame);
|
_gameScreen.create(width, height, _pfGame);
|
||||||
|
|
||||||
_focusDirty = true;
|
_focusDirty = true;
|
||||||
_focusRect = Common::Rect(_gameWidth, _gameHeight);
|
_focusRect = Common::Rect(_gameWidth, _gameHeight);
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ void OSystem_3DS::updateSize() {
|
||||||
_gameBottomTexture.setScale(320.f / _gameWidth, 240.f / _gameHeight);
|
_gameBottomTexture.setScale(320.f / _gameWidth, 240.f / _gameHeight);
|
||||||
} else {
|
} else {
|
||||||
float ratio = static_cast<float>(_gameWidth) / _gameHeight;
|
float ratio = static_cast<float>(_gameWidth) / _gameHeight;
|
||||||
|
|
||||||
if (ratio > 400.f / 240.f) {
|
if (ratio > 400.f / 240.f) {
|
||||||
float r = 400.f / _gameWidth;
|
float r = 400.f / _gameWidth;
|
||||||
_gameTopTexture.setScale(r, r);
|
_gameTopTexture.setScale(r, r);
|
||||||
|
@ -224,7 +224,7 @@ OSystem::TransactionError OSystem_3DS::endGFXTransaction() {
|
||||||
void OSystem_3DS::setPalette(const byte *colors, uint start, uint num) {
|
void OSystem_3DS::setPalette(const byte *colors, uint start, uint num) {
|
||||||
assert(start + num <= 256);
|
assert(start + num <= 256);
|
||||||
memcpy(_palette + 3 * start, colors, 3 * num);
|
memcpy(_palette + 3 * start, colors, 3 * num);
|
||||||
|
|
||||||
// Manually update all color that were changed
|
// Manually update all color that were changed
|
||||||
if (_gameScreen.format.bytesPerPixel == 1) {
|
if (_gameScreen.format.bytesPerPixel == 1) {
|
||||||
flushGameScreen();
|
flushGameScreen();
|
||||||
|
@ -240,10 +240,10 @@ void OSystem_3DS::copyRectToScreen(const void *buf, int pitch, int x,
|
||||||
Common::Rect rect(x, y, x+w, y+h);
|
Common::Rect rect(x, y, x+w, y+h);
|
||||||
_gameScreen.copyRectToSurface(buf, pitch, x, y, w, h);
|
_gameScreen.copyRectToSurface(buf, pitch, x, y, w, h);
|
||||||
Graphics::Surface subSurface = _gameScreen.getSubArea(rect);
|
Graphics::Surface subSurface = _gameScreen.getSubArea(rect);
|
||||||
|
|
||||||
Graphics::Surface *convertedSubSurface = subSurface.convertTo(_pfGameTexture, _palette);
|
Graphics::Surface *convertedSubSurface = subSurface.convertTo(_pfGameTexture, _palette);
|
||||||
_gameTopTexture.copyRectToSurface(*convertedSubSurface, x, y, Common::Rect(w, h));
|
_gameTopTexture.copyRectToSurface(*convertedSubSurface, x, y, Common::Rect(w, h));
|
||||||
|
|
||||||
convertedSubSurface->free();
|
convertedSubSurface->free();
|
||||||
delete convertedSubSurface;
|
delete convertedSubSurface;
|
||||||
_gameTopTexture.markDirty();
|
_gameTopTexture.markDirty();
|
||||||
|
@ -268,7 +268,7 @@ void OSystem_3DS::updateScreen() {
|
||||||
|
|
||||||
if (sleeping || exiting)
|
if (sleeping || exiting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// updateFocus();
|
// updateFocus();
|
||||||
|
|
||||||
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
|
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
|
||||||
|
@ -288,7 +288,7 @@ void OSystem_3DS::updateScreen() {
|
||||||
_cursorTexture.render();
|
_cursorTexture.render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render bottom screen
|
// Render bottom screen
|
||||||
C3D_FrameDrawOn(_renderTargetBottom);
|
C3D_FrameDrawOn(_renderTargetBottom);
|
||||||
if (config.screen == kScreenBottom || config.screen == kScreenBoth) {
|
if (config.screen == kScreenBottom || config.screen == kScreenBoth) {
|
||||||
|
@ -327,7 +327,7 @@ void OSystem_3DS::clearFocusRectangle() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSystem_3DS::updateFocus() {
|
void OSystem_3DS::updateFocus() {
|
||||||
|
|
||||||
if (_focusClearTime && getMillis() - _focusClearTime > 5000) {
|
if (_focusClearTime && getMillis() - _focusClearTime > 5000) {
|
||||||
_focusClearTime = 0;
|
_focusClearTime = 0;
|
||||||
_focusDirty = true;
|
_focusDirty = true;
|
||||||
|
@ -361,26 +361,26 @@ void OSystem_3DS::updateFocus() {
|
||||||
_focusStepScaleX = duration * (_focusTargetScaleX - _focusScaleX);
|
_focusStepScaleX = duration * (_focusTargetScaleX - _focusScaleX);
|
||||||
_focusStepScaleY = duration * (_focusTargetScaleY - _focusScaleY);
|
_focusStepScaleY = duration * (_focusTargetScaleY - _focusScaleY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_focusDirty || _focusPosX != _focusTargetPosX || _focusPosY != _focusTargetPosY ||
|
if (_focusDirty || _focusPosX != _focusTargetPosX || _focusPosY != _focusTargetPosY ||
|
||||||
_focusScaleX != _focusTargetScaleX || _focusScaleY != _focusTargetScaleY) {
|
_focusScaleX != _focusTargetScaleX || _focusScaleY != _focusTargetScaleY) {
|
||||||
_focusDirty = false;
|
_focusDirty = false;
|
||||||
|
|
||||||
if ((_focusStepPosX > 0 && _focusPosX > _focusTargetPosX) || (_focusStepPosX < 0 && _focusPosX < _focusTargetPosX))
|
if ((_focusStepPosX > 0 && _focusPosX > _focusTargetPosX) || (_focusStepPosX < 0 && _focusPosX < _focusTargetPosX))
|
||||||
_focusPosX = _focusTargetPosX;
|
_focusPosX = _focusTargetPosX;
|
||||||
else if (_focusPosX != _focusTargetPosX)
|
else if (_focusPosX != _focusTargetPosX)
|
||||||
_focusPosX += _focusStepPosX;
|
_focusPosX += _focusStepPosX;
|
||||||
|
|
||||||
if ((_focusStepPosY > 0 && _focusPosY > _focusTargetPosY) || (_focusStepPosY < 0 && _focusPosY < _focusTargetPosY))
|
if ((_focusStepPosY > 0 && _focusPosY > _focusTargetPosY) || (_focusStepPosY < 0 && _focusPosY < _focusTargetPosY))
|
||||||
_focusPosY = _focusTargetPosY;
|
_focusPosY = _focusTargetPosY;
|
||||||
else if (_focusPosY != _focusTargetPosY)
|
else if (_focusPosY != _focusTargetPosY)
|
||||||
_focusPosY += _focusStepPosY;
|
_focusPosY += _focusStepPosY;
|
||||||
|
|
||||||
if ((_focusStepScaleX > 0 && _focusScaleX > _focusTargetScaleX) || (_focusStepScaleX < 0 && _focusScaleX < _focusTargetScaleX))
|
if ((_focusStepScaleX > 0 && _focusScaleX > _focusTargetScaleX) || (_focusStepScaleX < 0 && _focusScaleX < _focusTargetScaleX))
|
||||||
_focusScaleX = _focusTargetScaleX;
|
_focusScaleX = _focusTargetScaleX;
|
||||||
else if (_focusScaleX != _focusTargetScaleX)
|
else if (_focusScaleX != _focusTargetScaleX)
|
||||||
_focusScaleX += _focusStepScaleX;
|
_focusScaleX += _focusStepScaleX;
|
||||||
|
|
||||||
if ((_focusStepScaleY > 0 && _focusScaleY > _focusTargetScaleY) || (_focusStepScaleY < 0 && _focusScaleY < _focusTargetScaleY))
|
if ((_focusStepScaleY > 0 && _focusScaleY > _focusTargetScaleY) || (_focusStepScaleY < 0 && _focusScaleY < _focusTargetScaleY))
|
||||||
_focusScaleY = _focusTargetScaleY;
|
_focusScaleY = _focusTargetScaleY;
|
||||||
else if (_focusScaleY != _focusTargetScaleY)
|
else if (_focusScaleY != _focusTargetScaleY)
|
||||||
|
@ -476,10 +476,10 @@ void OSystem_3DS::setMouseCursor(const void *buf, uint w, uint h,
|
||||||
_cursor.create(w, h, _pfCursor);
|
_cursor.create(w, h, _pfCursor);
|
||||||
_cursorTexture.create(w, h, _pfGameTexture);
|
_cursorTexture.create(w, h, _pfGameTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
_cursor.copyRectToSurface(buf, w, 0, 0, w, h);
|
_cursor.copyRectToSurface(buf, w, 0, 0, w, h);
|
||||||
flushCursor();
|
flushCursor();
|
||||||
|
|
||||||
warpMouse(_cursorX, _cursorY);
|
warpMouse(_cursorX, _cursorY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -497,7 +497,7 @@ void OSystem_3DS::flushCursor() {
|
||||||
_cursorTexture.markDirty();
|
_cursorTexture.markDirty();
|
||||||
converted->free();
|
converted->free();
|
||||||
delete converted;
|
delete converted;
|
||||||
|
|
||||||
if (_pfCursor.bytesPerPixel == 1) {
|
if (_pfCursor.bytesPerPixel == 1) {
|
||||||
uint* dest = (uint*) _cursorTexture.getPixels();
|
uint* dest = (uint*) _cursorTexture.getPixels();
|
||||||
byte* src = (byte*) _cursor.getPixels();
|
byte* src = (byte*) _cursor.getPixels();
|
||||||
|
|
|
@ -85,7 +85,7 @@ OSystem_3DS::~OSystem_3DS() {
|
||||||
destroyEvents();
|
destroyEvents();
|
||||||
destroyAudio();
|
destroyAudio();
|
||||||
destroyGraphics();
|
destroyGraphics();
|
||||||
|
|
||||||
delete _timerManager;
|
delete _timerManager;
|
||||||
_timerManager = 0;
|
_timerManager = 0;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ void OSystem_3DS::initBackend() {
|
||||||
|
|
||||||
_timerManager = new DefaultTimerManager();
|
_timerManager = new DefaultTimerManager();
|
||||||
_savefileManager = new DefaultSaveFileManager("/3ds/scummvm/saves/");
|
_savefileManager = new DefaultSaveFileManager("/3ds/scummvm/saves/");
|
||||||
|
|
||||||
initGraphics();
|
initGraphics();
|
||||||
initAudio();
|
initAudio();
|
||||||
initEvents();
|
initEvents();
|
||||||
|
|
|
@ -57,12 +57,12 @@ class OSystem_3DS : public EventsBaseBackend, public PaletteManager {
|
||||||
public:
|
public:
|
||||||
OSystem_3DS();
|
OSystem_3DS();
|
||||||
virtual ~OSystem_3DS();
|
virtual ~OSystem_3DS();
|
||||||
|
|
||||||
volatile bool exiting;
|
volatile bool exiting;
|
||||||
volatile bool sleeping;
|
volatile bool sleeping;
|
||||||
|
|
||||||
virtual void initBackend();
|
virtual void initBackend();
|
||||||
|
|
||||||
virtual bool hasFeature(OSystem::Feature f);
|
virtual bool hasFeature(OSystem::Feature f);
|
||||||
virtual void setFeatureState(OSystem::Feature f, bool enable);
|
virtual void setFeatureState(OSystem::Feature f, bool enable);
|
||||||
virtual bool getFeatureState(OSystem::Feature f);
|
virtual bool getFeatureState(OSystem::Feature f);
|
||||||
|
@ -72,22 +72,22 @@ public:
|
||||||
virtual uint32 getMillis(bool skipRecord = false);
|
virtual uint32 getMillis(bool skipRecord = false);
|
||||||
virtual void delayMillis(uint msecs);
|
virtual void delayMillis(uint msecs);
|
||||||
virtual void getTimeAndDate(TimeDate &t) const;
|
virtual void getTimeAndDate(TimeDate &t) const;
|
||||||
|
|
||||||
virtual MutexRef createMutex();
|
virtual MutexRef createMutex();
|
||||||
virtual void lockMutex(MutexRef mutex);
|
virtual void lockMutex(MutexRef mutex);
|
||||||
virtual void unlockMutex(MutexRef mutex);
|
virtual void unlockMutex(MutexRef mutex);
|
||||||
virtual void deleteMutex(MutexRef mutex);
|
virtual void deleteMutex(MutexRef mutex);
|
||||||
|
|
||||||
virtual void logMessage(LogMessageType::Type type, const char *message);
|
virtual void logMessage(LogMessageType::Type type, const char *message);
|
||||||
|
|
||||||
virtual Audio::Mixer *getMixer();
|
virtual Audio::Mixer *getMixer();
|
||||||
virtual PaletteManager *getPaletteManager() { return this; }
|
virtual PaletteManager *getPaletteManager() { return this; }
|
||||||
virtual Common::String getSystemLanguage() const;
|
virtual Common::String getSystemLanguage() const;
|
||||||
virtual void fatalError();
|
virtual void fatalError();
|
||||||
virtual void quit();
|
virtual void quit();
|
||||||
|
|
||||||
virtual Common::String getDefaultConfigFileName();
|
virtual Common::String getDefaultConfigFileName();
|
||||||
|
|
||||||
// Graphics
|
// Graphics
|
||||||
virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
|
virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
|
||||||
int getDefaultGraphicsMode() const;
|
int getDefaultGraphicsMode() const;
|
||||||
|
@ -131,16 +131,16 @@ public:
|
||||||
int hotspotY, uint32 keycolor, bool dontScale = false,
|
int hotspotY, uint32 keycolor, bool dontScale = false,
|
||||||
const Graphics::PixelFormat *format = NULL);
|
const Graphics::PixelFormat *format = NULL);
|
||||||
void setCursorPalette(const byte *colors, uint start, uint num);
|
void setCursorPalette(const byte *colors, uint start, uint num);
|
||||||
|
|
||||||
// Transform point from touchscreen coords into gamescreen coords
|
// Transform point from touchscreen coords into gamescreen coords
|
||||||
void transformPoint(touchPosition &point);
|
void transformPoint(touchPosition &point);
|
||||||
|
|
||||||
void setCursorDelta(float deltaX, float deltaY);
|
void setCursorDelta(float deltaX, float deltaY);
|
||||||
|
|
||||||
void updateFocus();
|
void updateFocus();
|
||||||
void updateConfig();
|
void updateConfig();
|
||||||
void updateSize();
|
void updateSize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initGraphics();
|
void initGraphics();
|
||||||
void destroyGraphics();
|
void destroyGraphics();
|
||||||
|
@ -148,18 +148,18 @@ private:
|
||||||
void destroyAudio();
|
void destroyAudio();
|
||||||
void initEvents();
|
void initEvents();
|
||||||
void destroyEvents();
|
void destroyEvents();
|
||||||
|
|
||||||
void flushGameScreen();
|
void flushGameScreen();
|
||||||
void flushCursor();
|
void flushCursor();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Audio::MixerImpl *_mixer;
|
Audio::MixerImpl *_mixer;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
u16 _gameWidth, _gameHeight;
|
u16 _gameWidth, _gameHeight;
|
||||||
u16 _gameTopX, _gameTopY;
|
u16 _gameTopX, _gameTopY;
|
||||||
u16 _gameBottomX, _gameBottomY;
|
u16 _gameBottomX, _gameBottomY;
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
Thread audioThread;
|
Thread audioThread;
|
||||||
|
|
||||||
|
@ -169,15 +169,15 @@ private:
|
||||||
Graphics::PixelFormat _pfCursor;
|
Graphics::PixelFormat _pfCursor;
|
||||||
byte _palette[3 * 256];
|
byte _palette[3 * 256];
|
||||||
byte _cursorPalette[3 * 256];
|
byte _cursorPalette[3 * 256];
|
||||||
|
|
||||||
Graphics::Surface _gameScreen;
|
Graphics::Surface _gameScreen;
|
||||||
Sprite _gameTopTexture;
|
Sprite _gameTopTexture;
|
||||||
Sprite _gameBottomTexture;
|
Sprite _gameBottomTexture;
|
||||||
Sprite _overlay;
|
Sprite _overlay;
|
||||||
|
|
||||||
int _screenShakeOffset;
|
int _screenShakeOffset;
|
||||||
bool _overlayVisible;
|
bool _overlayVisible;
|
||||||
|
|
||||||
DVLB_s *_dvlb;
|
DVLB_s *_dvlb;
|
||||||
shaderProgram_s _program;
|
shaderProgram_s _program;
|
||||||
int _projectionLocation;
|
int _projectionLocation;
|
||||||
|
@ -186,7 +186,7 @@ private:
|
||||||
C3D_Mtx _projectionBottom;
|
C3D_Mtx _projectionBottom;
|
||||||
C3D_RenderTarget* _renderTargetTop;
|
C3D_RenderTarget* _renderTargetTop;
|
||||||
C3D_RenderTarget* _renderTargetBottom;
|
C3D_RenderTarget* _renderTargetBottom;
|
||||||
|
|
||||||
// Focus
|
// Focus
|
||||||
Common::Rect _focusRect;
|
Common::Rect _focusRect;
|
||||||
bool _focusDirty;
|
bool _focusDirty;
|
||||||
|
@ -198,12 +198,12 @@ private:
|
||||||
float _focusTargetScaleX, _focusTargetScaleY;
|
float _focusTargetScaleX, _focusTargetScaleY;
|
||||||
float _focusStepScaleX, _focusStepScaleY;
|
float _focusStepScaleX, _focusStepScaleY;
|
||||||
uint32 _focusClearTime;
|
uint32 _focusClearTime;
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
Thread _eventThread;
|
Thread _eventThread;
|
||||||
Thread _timerThread;
|
Thread _timerThread;
|
||||||
Common::Queue<Common::Event> _eventQueue;
|
Common::Queue<Common::Event> _eventQueue;
|
||||||
|
|
||||||
// Cursor
|
// Cursor
|
||||||
Graphics::Surface _cursor;
|
Graphics::Surface _cursor;
|
||||||
Sprite _cursorTexture;
|
Sprite _cursorTexture;
|
||||||
|
|
|
@ -57,7 +57,7 @@ Sprite::~Sprite() {
|
||||||
|
|
||||||
void Sprite::create(uint16 width, uint16 height, const Graphics::PixelFormat &f) {
|
void Sprite::create(uint16 width, uint16 height, const Graphics::PixelFormat &f) {
|
||||||
free();
|
free();
|
||||||
|
|
||||||
actualWidth = width;
|
actualWidth = width;
|
||||||
actualHeight = height;
|
actualHeight = height;
|
||||||
format = f;
|
format = f;
|
||||||
|
@ -73,7 +73,7 @@ void Sprite::create(uint16 width, uint16 height, const Graphics::PixelFormat &f)
|
||||||
assert(pixels && texture.data);
|
assert(pixels && texture.data);
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
float x = 0.f, y = 0.f;
|
float x = 0.f, y = 0.f;
|
||||||
float u = (float)width/w;
|
float u = (float)width/w;
|
||||||
float v = (float)height/h;
|
float v = (float)height/h;
|
||||||
|
|
|
@ -46,16 +46,16 @@ public:
|
||||||
void render();
|
void render();
|
||||||
void clear(uint32 color = 0);
|
void clear(uint32 color = 0);
|
||||||
void markDirty(){ dirtyPixels = true; }
|
void markDirty(){ dirtyPixels = true; }
|
||||||
|
|
||||||
void setPosition(int x, int y);
|
void setPosition(int x, int y);
|
||||||
void setScale(float x, float y);
|
void setScale(float x, float y);
|
||||||
float getScaleX(){ return scaleX; }
|
float getScaleX(){ return scaleX; }
|
||||||
float getScaleY(){ return scaleY; }
|
float getScaleY(){ return scaleY; }
|
||||||
C3D_Mtx* getMatrix();
|
C3D_Mtx* getMatrix();
|
||||||
|
|
||||||
uint16 actualWidth;
|
uint16 actualWidth;
|
||||||
uint16 actualHeight;
|
uint16 actualHeight;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool dirtyPixels;
|
bool dirtyPixels;
|
||||||
bool dirtyMatrix;
|
bool dirtyMatrix;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
void OSystem_ANDROIDSDL::initBackend() {
|
void OSystem_ANDROIDSDL::initBackend() {
|
||||||
// Create the backend custom managers
|
// Create the backend custom managers
|
||||||
|
|
||||||
if (_eventSource == 0)
|
if (_eventSource == 0)
|
||||||
_eventSource = new AndroidSdlEventSource();
|
_eventSource = new AndroidSdlEventSource();
|
||||||
|
|
||||||
|
@ -37,10 +37,10 @@ void OSystem_ANDROIDSDL::initBackend() {
|
||||||
|
|
||||||
if (!ConfMan.hasKey("browser_lastpath"))
|
if (!ConfMan.hasKey("browser_lastpath"))
|
||||||
ConfMan.set("browser_lastpath", "/storage");
|
ConfMan.set("browser_lastpath", "/storage");
|
||||||
|
|
||||||
if (!ConfMan.hasKey("gfx_mode"))
|
if (!ConfMan.hasKey("gfx_mode"))
|
||||||
ConfMan.set("gfx_mode", "2x");
|
ConfMan.set("gfx_mode", "2x");
|
||||||
|
|
||||||
// Call parent implementation of this method
|
// Call parent implementation of this method
|
||||||
OSystem_POSIX::initBackend();
|
OSystem_POSIX::initBackend();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ class GBAMPSaveFileManager : public Common::SaveFileManager {
|
||||||
public:
|
public:
|
||||||
virtual void updateSavefilesList(Common::StringArray &lockedFiles);
|
virtual void updateSavefilesList(Common::StringArray &lockedFiles);
|
||||||
virtual Common::InSaveFile *openRawFile(const Common::String &filename);
|
virtual Common::InSaveFile *openRawFile(const Common::String &filename);
|
||||||
|
|
||||||
virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
|
virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
|
||||||
virtual Common::InSaveFile *openForLoading(const Common::String &filename);
|
virtual Common::InSaveFile *openForLoading(const Common::String &filename);
|
||||||
|
|
||||||
|
|
|
@ -91,16 +91,16 @@ bool OSystem_iOS7::pollEvent(Common::Event &event) {
|
||||||
if (!handleEvent_secondMouseUp(event, internalEvent.value1, internalEvent.value2))
|
if (!handleEvent_secondMouseUp(event, internalEvent.value1, internalEvent.value2))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kInputKeyPressed:
|
case kInputKeyPressed:
|
||||||
handleEvent_keyPressed(event, internalEvent.value1);
|
handleEvent_keyPressed(event, internalEvent.value1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kInputSwipe:
|
case kInputSwipe:
|
||||||
if (!handleEvent_swipe(event, internalEvent.value1, internalEvent.value2))
|
if (!handleEvent_swipe(event, internalEvent.value1, internalEvent.value2))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kInputTap:
|
case kInputTap:
|
||||||
if (!handleEvent_tap(event, (UIViewTapDescription) internalEvent.value1, internalEvent.value2))
|
if (!handleEvent_tap(event, (UIViewTapDescription) internalEvent.value1, internalEvent.value2))
|
||||||
return false;
|
return false;
|
||||||
|
@ -109,7 +109,7 @@ bool OSystem_iOS7::pollEvent(Common::Event &event) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -499,14 +499,14 @@ bool OSystem_iOS7::handleEvent_swipe(Common::Event &event, int direction, int to
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.kbd.keycode = _queuedInputEvent.kbd.keycode = keycode;
|
event.kbd.keycode = _queuedInputEvent.kbd.keycode = keycode;
|
||||||
event.kbd.ascii = _queuedInputEvent.kbd.ascii = 0;
|
event.kbd.ascii = _queuedInputEvent.kbd.ascii = 0;
|
||||||
event.type = Common::EVENT_KEYDOWN;
|
event.type = Common::EVENT_KEYDOWN;
|
||||||
_queuedInputEvent.type = Common::EVENT_KEYUP;
|
_queuedInputEvent.type = Common::EVENT_KEYUP;
|
||||||
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
|
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
|
||||||
_queuedEventTime = getMillis() + kQueuedInputEventDelay;
|
_queuedEventTime = getMillis() + kQueuedInputEventDelay;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (touches == 2) {
|
else if (touches == 2) {
|
||||||
|
|
|
@ -931,7 +931,7 @@ uint getSizeNextPOT(uint size) {
|
||||||
CGPoint point = [touch locationInView:self];
|
CGPoint point = [touch locationInView:self];
|
||||||
if (![self getMouseCoords:point eventX:&x eventY:&y])
|
if (![self getMouseCoords:point eventX:&x eventY:&y])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
[self addEvent:InternalEvent(kInputMouseSecondDragged, x, y)];
|
[self addEvent:InternalEvent(kInputMouseSecondDragged, x, y)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,7 @@ int loadIrxModules(int device, const char *irxPath, IrxReference **modules, IrxT
|
||||||
irxFiles = irxType[type];
|
irxFiles = irxType[type];
|
||||||
numFiles = numIrx[type];
|
numFiles = numIrx[type];
|
||||||
resModules = (IrxReference *)memalign(64, numFiles * sizeof(IrxReference));
|
resModules = (IrxReference *)memalign(64, numFiles * sizeof(IrxReference));
|
||||||
curModule = resModules;
|
curModule = resModules;
|
||||||
|
|
||||||
for (int i = 0; i < numFiles; i++) {
|
for (int i = 0; i < numFiles; i++) {
|
||||||
curModule->fileRef = irxFiles + i;
|
curModule->fileRef = irxFiles + i;
|
||||||
|
|
|
@ -628,7 +628,7 @@ bool OSystem_PS2::usbMassPresent(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OSystem_PS2::netPresent(void) {
|
bool OSystem_PS2::netPresent(void) {
|
||||||
if (_useNet)
|
if (_useNet)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -56,7 +56,7 @@ void OSystem_MacOSX::init() {
|
||||||
// Initialize taskbar manager
|
// Initialize taskbar manager
|
||||||
_taskbarManager = new MacOSXTaskbarManager();
|
_taskbarManager = new MacOSXTaskbarManager();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Invoke parent implementation of this method
|
// Invoke parent implementation of this method
|
||||||
OSystem_POSIX::init();
|
OSystem_POSIX::init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
|
|
||||||
virtual bool hasTextInClipboard();
|
virtual bool hasTextInClipboard();
|
||||||
virtual Common::String getTextFromClipboard();
|
virtual Common::String getTextFromClipboard();
|
||||||
|
|
||||||
virtual bool openUrl(const Common::String &url);
|
virtual bool openUrl(const Common::String &url);
|
||||||
|
|
||||||
virtual Common::String getSystemLanguage() const;
|
virtual Common::String getSystemLanguage() const;
|
||||||
|
|
|
@ -65,7 +65,7 @@ protected:
|
||||||
virtual Common::WriteStream *createLogFile();
|
virtual Common::WriteStream *createLogFile();
|
||||||
|
|
||||||
virtual AudioCDManager *createAudioCDManager();
|
virtual AudioCDManager *createAudioCDManager();
|
||||||
|
|
||||||
bool launchBrowser(const Common::String& client, const Common::String &url);
|
bool launchBrowser(const Common::String& client, const Common::String &url);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -318,16 +318,16 @@ void TizenAppForm::invokeShortcut() {
|
||||||
case kControlMouse:
|
case kControlMouse:
|
||||||
setButtonShortcut();
|
setButtonShortcut();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kEscapeKey:
|
case kEscapeKey:
|
||||||
pushKey(Common::KEYCODE_ESCAPE);
|
pushKey(Common::KEYCODE_ESCAPE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kGameMenu:
|
case kGameMenu:
|
||||||
_buttonState = kLeftButton;
|
_buttonState = kLeftButton;
|
||||||
pushKey(Common::KEYCODE_F5);
|
pushKey(Common::KEYCODE_F5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kShowKeypad:
|
case kShowKeypad:
|
||||||
showKeypad();
|
showKeypad();
|
||||||
break;
|
break;
|
||||||
|
@ -338,7 +338,7 @@ void TizenAppForm::showKeypad() {
|
||||||
// display the soft keyboard
|
// display the soft keyboard
|
||||||
if (_state == kActiveState) {
|
if (_state == kActiveState) {
|
||||||
_buttonState = kLeftButton;
|
_buttonState = kLeftButton;
|
||||||
|
|
||||||
Common::Event e;
|
Common::Event e;
|
||||||
e.type = Common::EVENT_VIRTUAL_KEYBOARD;
|
e.type = Common::EVENT_VIRTUAL_KEYBOARD;
|
||||||
if (_eventQueueLock) {
|
if (_eventQueueLock) {
|
||||||
|
|
|
@ -103,7 +103,7 @@ Common::List<Graphics::PixelFormat> TizenGraphicsManager::getSupportedFormats()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TizenGraphicsManager::hasFeature(OSystem::Feature f) {
|
bool TizenGraphicsManager::hasFeature(OSystem::Feature f) {
|
||||||
bool result =
|
bool result =
|
||||||
(f == OSystem::kFeatureVirtualKeyboard ||
|
(f == OSystem::kFeatureVirtualKeyboard ||
|
||||||
OpenGLGraphicsManager::hasFeature(f));
|
OpenGLGraphicsManager::hasFeature(f));
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -181,7 +181,7 @@ bool DefaultSaveFileManager::removeSavefile(const Common::String &filename) {
|
||||||
assureCached(getSavePath());
|
assureCached(getSavePath());
|
||||||
if (getError().getCode() != Common::kNoError)
|
if (getError().getCode() != Common::kNoError)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef USE_LIBCURL
|
#ifdef USE_LIBCURL
|
||||||
// Update file's timestamp
|
// Update file's timestamp
|
||||||
Common::HashMap<Common::String, uint32> timestamps = loadTimestamps();
|
Common::HashMap<Common::String, uint32> timestamps = loadTimestamps();
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
NSString *gameId = [recentGame valueForKey:@"game"];
|
NSString *gameId = [recentGame valueForKey:@"game"];
|
||||||
NSString *desc = [recentGame valueForKey:@"description"];
|
NSString *desc = [recentGame valueForKey:@"description"];
|
||||||
NSString *iconFile = [recentGame valueForKey:@"icon"];
|
NSString *iconFile = [recentGame valueForKey:@"icon"];
|
||||||
|
|
||||||
StartGameMenuItem *menuItem = [[StartGameMenuItem alloc] initWithGame:gameId description:desc icon:iconFile];
|
StartGameMenuItem *menuItem = [[StartGameMenuItem alloc] initWithGame:gameId description:desc icon:iconFile];
|
||||||
[recentGamesMenu addItem:menuItem];
|
[recentGamesMenu addItem:menuItem];
|
||||||
[menuItem release];
|
[menuItem release];
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
- (NSMenuItem*)initWithGame:(NSString *)gameId description:(NSString*)desc icon:(NSString*)iconFile {
|
- (NSMenuItem*)initWithGame:(NSString *)gameId description:(NSString*)desc icon:(NSString*)iconFile {
|
||||||
self = [super initWithTitle:(desc == nil ? gameId : desc) action:@selector(startGame) keyEquivalent:@""];
|
self = [super initWithTitle:(desc == nil ? gameId : desc) action:@selector(startGame) keyEquivalent:@""];
|
||||||
[self setTarget:self];
|
[self setTarget:self];
|
||||||
|
|
||||||
if (iconFile != nil) {
|
if (iconFile != nil) {
|
||||||
NSImage *image = [[NSImage alloc] initWithContentsOfFile:iconFile];
|
NSImage *image = [[NSImage alloc] initWithContentsOfFile:iconFile];
|
||||||
[self setImage:image];
|
[self setImage:image];
|
||||||
|
@ -97,7 +97,7 @@
|
||||||
|
|
||||||
game = gameId;
|
game = gameId;
|
||||||
[game retain];
|
[game retain];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
|
|
||||||
- (IBAction) startGame {
|
- (IBAction) startGame {
|
||||||
NSLog(@"Starting Game %@...", game);
|
NSLog(@"Starting Game %@...", game);
|
||||||
|
|
||||||
NSString *scummVMPath = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"org.scummvm.scummvm"];
|
NSString *scummVMPath = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"org.scummvm.scummvm"];
|
||||||
if (scummVMPath == nil) {
|
if (scummVMPath == nil) {
|
||||||
NSLog(@"Cannot find ScummVM.app!");
|
NSLog(@"Cannot find ScummVM.app!");
|
||||||
|
|
|
@ -40,16 +40,16 @@ public:
|
||||||
virtual void addRecent(const Common::String &name, const Common::String &description);
|
virtual void addRecent(const Common::String &name, const Common::String &description);
|
||||||
virtual void notifyError();
|
virtual void notifyError();
|
||||||
virtual void clearError();
|
virtual void clearError();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Common::String getIconPath(const Common::String&);
|
Common::String getIconPath(const Common::String&);
|
||||||
|
|
||||||
void initApplicationIconView();
|
void initApplicationIconView();
|
||||||
void clearApplicationIconView();
|
void clearApplicationIconView();
|
||||||
|
|
||||||
void initOverlayIconView();
|
void initOverlayIconView();
|
||||||
void clearOverlayIconView();
|
void clearOverlayIconView();
|
||||||
|
|
||||||
double _progress;
|
double _progress;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -112,11 +112,11 @@ void MacOSXTaskbarManager::setOverlayIcon(const Common::String &name, const Comm
|
||||||
[_dockTile performSelector:@selector(display)];
|
[_dockTile performSelector:@selector(display)];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::String path = getIconPath(name);
|
Common::String path = getIconPath(name);
|
||||||
if (path.empty())
|
if (path.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
initOverlayIconView();
|
initOverlayIconView();
|
||||||
|
|
||||||
CFStringRef imageFile = CFStringCreateWithCString(0, path.c_str(), kCFStringEncodingASCII);
|
CFStringRef imageFile = CFStringCreateWithCString(0, path.c_str(), kCFStringEncodingASCII);
|
||||||
|
@ -136,7 +136,7 @@ void MacOSXTaskbarManager::setProgressValue(int completed, int total) {
|
||||||
_progress = (double)completed / (double)total;
|
_progress = (double)completed / (double)total;
|
||||||
else if (_progress < 0)
|
else if (_progress < 0)
|
||||||
_progress = 0.0;
|
_progress = 0.0;
|
||||||
|
|
||||||
NSImage *mainIcon = [[NSApp applicationIconImage] copy];
|
NSImage *mainIcon = [[NSApp applicationIconImage] copy];
|
||||||
double barSize = [mainIcon size].width;
|
double barSize = [mainIcon size].width;
|
||||||
double progressSize = barSize * _progress;
|
double progressSize = barSize * _progress;
|
||||||
|
@ -150,7 +150,7 @@ void MacOSXTaskbarManager::setProgressValue(int completed, int total) {
|
||||||
initApplicationIconView();
|
initApplicationIconView();
|
||||||
[_applicationIconView setImage:mainIcon];
|
[_applicationIconView setImage:mainIcon];
|
||||||
[mainIcon release];
|
[mainIcon release];
|
||||||
|
|
||||||
[_dockTile performSelector:@selector(display)];
|
[_dockTile performSelector:@selector(display)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,50 +207,50 @@ Common::String MacOSXTaskbarManager::getIconPath(const Common::String& target) {
|
||||||
// fallback to the extra path
|
// fallback to the extra path
|
||||||
//
|
//
|
||||||
// Icons can be either in a subfolder named "icons" or directly in the path
|
// Icons can be either in a subfolder named "icons" or directly in the path
|
||||||
|
|
||||||
Common::String iconsPath = ConfMan.get("iconspath");
|
Common::String iconsPath = ConfMan.get("iconspath");
|
||||||
Common::String extraPath = ConfMan.get("extrapath");
|
Common::String extraPath = ConfMan.get("extrapath");
|
||||||
|
|
||||||
#define TRY_ICON_PATH(path) { \
|
#define TRY_ICON_PATH(path) { \
|
||||||
Common::FSNode node((path)); \
|
Common::FSNode node((path)); \
|
||||||
if (node.exists()) \
|
if (node.exists()) \
|
||||||
return (path); \
|
return (path); \
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!iconsPath.empty()) {
|
if (!iconsPath.empty()) {
|
||||||
TRY_ICON_PATH(iconsPath + "/" + target + ".png");
|
TRY_ICON_PATH(iconsPath + "/" + target + ".png");
|
||||||
TRY_ICON_PATH(iconsPath + "/" + ConfMan.get("gameid") + ".png");
|
TRY_ICON_PATH(iconsPath + "/" + ConfMan.get("gameid") + ".png");
|
||||||
TRY_ICON_PATH(iconsPath + "/icons/" + target + ".png");
|
TRY_ICON_PATH(iconsPath + "/icons/" + target + ".png");
|
||||||
TRY_ICON_PATH(iconsPath + "/icons/" + ConfMan.get("gameid") + ".png");
|
TRY_ICON_PATH(iconsPath + "/icons/" + ConfMan.get("gameid") + ".png");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!extraPath.empty()) {
|
if (!extraPath.empty()) {
|
||||||
TRY_ICON_PATH(extraPath + "/" + target + ".png");
|
TRY_ICON_PATH(extraPath + "/" + target + ".png");
|
||||||
TRY_ICON_PATH(extraPath + "/" + ConfMan.get("gameid") + ".png");
|
TRY_ICON_PATH(extraPath + "/" + ConfMan.get("gameid") + ".png");
|
||||||
TRY_ICON_PATH(extraPath + "/icons/" + target + ".png");
|
TRY_ICON_PATH(extraPath + "/icons/" + target + ".png");
|
||||||
TRY_ICON_PATH(extraPath + "/icons/" + ConfMan.get("gameid") + ".png");
|
TRY_ICON_PATH(extraPath + "/icons/" + ConfMan.get("gameid") + ".png");
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacOSXTaskbarManager::addRecent(const Common::String &name, const Common::String &description) {
|
void MacOSXTaskbarManager::addRecent(const Common::String &name, const Common::String &description) {
|
||||||
//warning("[MacOSXTaskbarManager::addRecent] Adding recent list entry: %s (%s)", name.c_str(), description.c_str());
|
//warning("[MacOSXTaskbarManager::addRecent] Adding recent list entry: %s (%s)", name.c_str(), description.c_str());
|
||||||
|
|
||||||
if (_dockTile == nil)
|
if (_dockTile == nil)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Store the game, description and icon in user preferences.
|
// Store the game, description and icon in user preferences.
|
||||||
// The NSDockTilePlugin will retrieve them there to list them in the dock tile menu.
|
// The NSDockTilePlugin will retrieve them there to list them in the dock tile menu.
|
||||||
|
|
||||||
CFStringRef gameName = CFStringCreateWithCString(0, name.c_str(), kCFStringEncodingASCII);
|
CFStringRef gameName = CFStringCreateWithCString(0, name.c_str(), kCFStringEncodingASCII);
|
||||||
CFStringRef desc = CFStringCreateWithCString(0, description.c_str(), kCFStringEncodingASCII);
|
CFStringRef desc = CFStringCreateWithCString(0, description.c_str(), kCFStringEncodingASCII);
|
||||||
|
|
||||||
// First build the dictionary for this game.
|
// First build the dictionary for this game.
|
||||||
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
|
||||||
[dict setObject:(NSString *)gameName forKey:@"game"];
|
[dict setObject:(NSString *)gameName forKey:@"game"];
|
||||||
[dict setObject:(NSString *)desc forKey:@"description"];
|
[dict setObject:(NSString *)desc forKey:@"description"];
|
||||||
|
|
||||||
// Icon
|
// Icon
|
||||||
Common::String iconPath = getIconPath(name);
|
Common::String iconPath = getIconPath(name);
|
||||||
if (!iconPath.empty()) {
|
if (!iconPath.empty()) {
|
||||||
|
@ -258,7 +258,7 @@ void MacOSXTaskbarManager::addRecent(const Common::String &name, const Common::S
|
||||||
[dict setObject:(NSString *)icon forKey:@"icon"];
|
[dict setObject:(NSString *)icon forKey:@"icon"];
|
||||||
CFRelease(icon);
|
CFRelease(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve the current list of recent items and update it.
|
// Retrieve the current list of recent items and update it.
|
||||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
NSArray *oldArray = [defaults arrayForKey:@"recentGames"];
|
NSArray *oldArray = [defaults arrayForKey:@"recentGames"];
|
||||||
|
|
|
@ -55,7 +55,7 @@ Win32UpdateManager::Win32UpdateManager() {
|
||||||
|
|
||||||
win_sparkle_set_appcast_url(appcastUrl);
|
win_sparkle_set_appcast_url(appcastUrl);
|
||||||
win_sparkle_init();
|
win_sparkle_init();
|
||||||
|
|
||||||
if (!ConfMan.hasKey("updates_check")
|
if (!ConfMan.hasKey("updates_check")
|
||||||
|| ConfMan.getInt("updates_check") == Common::UpdateManager::kUpdateIntervalNotSupported) {
|
|| ConfMan.getInt("updates_check") == Common::UpdateManager::kUpdateIntervalNotSupported) {
|
||||||
setAutomaticallyChecksForUpdates(kUpdateStateDisabled);
|
setAutomaticallyChecksForUpdates(kUpdateStateDisabled);
|
||||||
|
@ -117,7 +117,7 @@ int Win32UpdateManager::getUpdateCheckInterval() {
|
||||||
bool Win32UpdateManager::getLastUpdateCheckTimeAndDate(TimeDate &t) {
|
bool Win32UpdateManager::getLastUpdateCheckTimeAndDate(TimeDate &t) {
|
||||||
time_t updateTime = win_sparkle_get_last_check_time();
|
time_t updateTime = win_sparkle_get_last_check_time();
|
||||||
tm *ut = localtime(&updateTime);
|
tm *ut = localtime(&updateTime);
|
||||||
|
|
||||||
t.tm_wday = ut->tm_wday;
|
t.tm_wday = ut->tm_wday;
|
||||||
t.tm_year = ut->tm_year;
|
t.tm_year = ut->tm_year;
|
||||||
t.tm_mon = ut->tm_mon;
|
t.tm_mon = ut->tm_mon;
|
||||||
|
|
|
@ -482,7 +482,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
|
||||||
dlg.runModal();
|
dlg.runModal();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_LIBCURL
|
#ifdef USE_LIBCURL
|
||||||
CloudMan.init();
|
CloudMan.init();
|
||||||
CloudMan.syncSaves();
|
CloudMan.syncSaves();
|
||||||
|
|
|
@ -274,7 +274,7 @@ T gcd(T a, T b) {
|
||||||
* Replacement algorithm for iterables.
|
* Replacement algorithm for iterables.
|
||||||
*
|
*
|
||||||
* Replaces all occurrences of "original" in [begin, end) with occurrences of "replaced".
|
* Replaces all occurrences of "original" in [begin, end) with occurrences of "replaced".
|
||||||
*
|
*
|
||||||
* @param[in, out] begin: First element to be examined.
|
* @param[in, out] begin: First element to be examined.
|
||||||
* @param[in] end: Last element in the seubsection. Not examined.
|
* @param[in] end: Last element in the seubsection. Not examined.
|
||||||
* @param[in] original: Elements to be replaced.
|
* @param[in] original: Elements to be replaced.
|
||||||
|
|
|
@ -180,7 +180,7 @@ bool isPrint(int c);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test whether the given character is a punctuation character,
|
* Test whether the given character is a punctuation character,
|
||||||
* (i.e not alphanumeric.
|
* (i.e not alphanumeric.
|
||||||
*
|
*
|
||||||
* @param c the character to test
|
* @param c the character to test
|
||||||
|
|
|
@ -132,7 +132,7 @@ static void writeStringList(PAKFile &out, const char *filename, const StringList
|
||||||
|
|
||||||
// Step 2: Write data
|
// Step 2: Write data
|
||||||
byte *const output = new byte[size];
|
byte *const output = new byte[size];
|
||||||
|
|
||||||
byte *dst = output;
|
byte *dst = output;
|
||||||
WRITE_BE_UINT32(dst, provider->numEntries); dst += 4;
|
WRITE_BE_UINT32(dst, provider->numEntries); dst += 4;
|
||||||
for (uint i = 0; i < provider->numEntries; ++i) {
|
for (uint i = 0; i < provider->numEntries; ++i) {
|
||||||
|
|
|
@ -113,7 +113,7 @@ void openOutputFile(const char *outFilename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write out the data for the font
|
* Write out the data for the font
|
||||||
*/
|
*/
|
||||||
void writeFontBlock() {
|
void writeFontBlock() {
|
||||||
const int knownAddr[3] = {0x30cd, 0x36b0, 0x36c0};
|
const int knownAddr[3] = {0x30cd, 0x36b0, 0x36c0};
|
||||||
|
@ -149,7 +149,7 @@ void writeFontBlock() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeStaticStrings(const char **strings, DataType dataType, int languageId) {
|
void writeStaticStrings(const char **strings, DataType dataType, int languageId) {
|
||||||
// Write out a section header
|
// Write out a section header
|
||||||
const char sStaticStrings[4] = { 'S', 'S', 'T', 'R' };
|
const char sStaticStrings[4] = { 'S', 'S', 'T', 'R' };
|
||||||
const char sGameStrings[4] = { 'G', 'S', 'T', 'R' };
|
const char sGameStrings[4] = { 'G', 'S', 'T', 'R' };
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ const char *engineDataEn[] = {
|
||||||
"% of hints...",
|
"% of hints...",
|
||||||
"Do you want to wake up?",
|
"Do you want to wake up?",
|
||||||
"OK",
|
"OK",
|
||||||
"",
|
"",
|
||||||
" Save",
|
" Save",
|
||||||
|
|
||||||
" Load",
|
" Load",
|
||||||
|
@ -96,7 +96,7 @@ const char *engineDataFr[] = {
|
||||||
"% des indices...",
|
"% des indices...",
|
||||||
"D\202sirez-vous vous r\202veiller?",
|
"D\202sirez-vous vous r\202veiller?",
|
||||||
"OK",
|
"OK",
|
||||||
"",
|
"",
|
||||||
" Sauvegarde",
|
" Sauvegarde",
|
||||||
|
|
||||||
" Chargement",
|
" Chargement",
|
||||||
|
@ -150,7 +150,7 @@ const char *engineDataDe[] = {
|
||||||
"% der Hinweise| bemerken muessen...",
|
"% der Hinweise| bemerken muessen...",
|
||||||
"Moechten Sie aufwachen?",
|
"Moechten Sie aufwachen?",
|
||||||
"OK",
|
"OK",
|
||||||
"",
|
"",
|
||||||
" schreiben",
|
" schreiben",
|
||||||
|
|
||||||
" lesen",
|
" lesen",
|
||||||
|
|
|
@ -527,7 +527,7 @@ static const char *const STRINGS_DE[] = {
|
||||||
"Sie befinden sich bereits an Ihrem gew\xFCnschten Reiseziel.",
|
"Sie befinden sich bereits an Ihrem gew\xFCnschten Reiseziel.",
|
||||||
"Passagieren Ihrer Klasse ist der Zugang zu diesem Bereich nicht gestattet.",
|
"Passagieren Ihrer Klasse ist der Zugang zu diesem Bereich nicht gestattet.",
|
||||||
"Wir bedauern, aber Sie m\xFCssen mindestens Dritte Klasse sein "
|
"Wir bedauern, aber Sie m\xFCssen mindestens Dritte Klasse sein "
|
||||||
"bevor Sie um Hilfe bitten k\xF6nnen.",
|
"bevor Sie um Hilfe bitten k\xF6nnen.",
|
||||||
"Ihnen wurde keine Kabine zugeteilt.",
|
"Ihnen wurde keine Kabine zugeteilt.",
|
||||||
"Wir bedauern, aber dieser Aufzug geht nicht tiefer als bis in den 27. Stock.",
|
"Wir bedauern, aber dieser Aufzug geht nicht tiefer als bis in den 27. Stock.",
|
||||||
"Sie m\xFCssen zuerst das Spiel selektieren, das Sie laden m\xF6" "chten.",
|
"Sie m\xFCssen zuerst das Spiel selektieren, das Sie laden m\xF6" "chten.",
|
||||||
|
@ -560,7 +560,7 @@ static const char *const STRINGS_DE[] = {
|
||||||
"aber das k\xF6nnen Sie eben nicht.",
|
"aber das k\xF6nnen Sie eben nicht.",
|
||||||
"Eine Schale Pistazien.",
|
"Eine Schale Pistazien.",
|
||||||
"Keine Schale Pistazien.",
|
"Keine Schale Pistazien.",
|
||||||
|
|
||||||
"Sommer",
|
"Sommer",
|
||||||
"Herbst",
|
"Herbst",
|
||||||
"Winter",
|
"Winter",
|
||||||
|
@ -572,7 +572,7 @@ static const char *const STRINGS_DE[] = {
|
||||||
"Pflanzen bitte nicht ber\0xFC" "nhren.",
|
"Pflanzen bitte nicht ber\0xFC" "nhren.",
|
||||||
"!\0xBC" "ta'\0xAD" "ta! !T\0xAA" "z n\0xAA" " sappibundli t\0xAA"
|
"!\0xBC" "ta'\0xAD" "ta! !T\0xAA" "z n\0xAA" " sappibundli t\0xAA"
|
||||||
"cn\0xAA" "z!",
|
"cn\0xAA" "z!",
|
||||||
|
|
||||||
"Stop",
|
"Stop",
|
||||||
"!Hanaz!",
|
"!Hanaz!",
|
||||||
"VorwSrts",
|
"VorwSrts",
|
||||||
|
|
|
@ -88,7 +88,7 @@ public:
|
||||||
|
|
||||||
/** Return a stream to the specified resource (or 0 if non-existent). */
|
/** Return a stream to the specified resource (or 0 if non-existent). */
|
||||||
File *getResource(const WinResourceID &type, const WinResourceID &name, const WinResourceID &lang);
|
File *getResource(const WinResourceID &type, const WinResourceID &name, const WinResourceID &lang);
|
||||||
|
|
||||||
/** Returns true if the resources is empty */
|
/** Returns true if the resources is empty */
|
||||||
bool empty() const { return _sections.empty(); }
|
bool empty() const { return _sections.empty(); }
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -850,7 +850,7 @@ blitSubSurfaceClip(const Graphics::Surface *source, const Common::Rect &r, const
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename PixelType>
|
template<typename PixelType>
|
||||||
void VectorRendererSpec<PixelType>::
|
void VectorRendererSpec<PixelType>::
|
||||||
blitKeyBitmap(const Graphics::Surface *source, const Common::Rect &r) {
|
blitKeyBitmap(const Graphics::Surface *source, const Common::Rect &r) {
|
||||||
int16 x = r.left;
|
int16 x = r.left;
|
||||||
int16 y = r.top;
|
int16 y = r.top;
|
||||||
|
@ -3125,7 +3125,7 @@ drawBorderRoundedSquareAlgClip(int x1, int y1, int r, int w, int h, PixelType co
|
||||||
|
|
||||||
PixelType color1 = color;
|
PixelType color1 = color;
|
||||||
PixelType color2 = color;
|
PixelType color2 = color;
|
||||||
|
|
||||||
while (sw++ < Base::_strokeWidth) {
|
while (sw++ < Base::_strokeWidth) {
|
||||||
blendFillClip(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color1, alpha_t,
|
blendFillClip(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color1, alpha_t,
|
||||||
x1 + r, y1 + sp/pitch); // top
|
x1 + r, y1 + sp/pitch); // top
|
||||||
|
@ -3297,7 +3297,7 @@ drawInteriorRoundedSquareAlgClip(int x1, int y1, int r, int w, int h, PixelType
|
||||||
x1 + r - x, y1 + h - r + y);
|
x1 + r - x, y1 + h - r + y);
|
||||||
gradientFillClip(ptr_bl - y + px, w - 2 * r + 2 * y, x1 + r - y - x, long_h - r + x,
|
gradientFillClip(ptr_bl - y + px, w - 2 * r + 2 * y, x1 + r - y - x, long_h - r + x,
|
||||||
x1 + r - y, y1 + h - r + x);
|
x1 + r - y, y1 + h - r + x);
|
||||||
|
|
||||||
BE_DRAWCIRCLE_XCOLOR_CLIP(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py,
|
BE_DRAWCIRCLE_XCOLOR_CLIP(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py,
|
||||||
x1 + w - r, y1 + r, x1 + r, y1 + r, x1 + r, y1 + h - r, x1 + w - r, y1 + h - r);
|
x1 + w - r, y1 + r, x1 + r, y1 + r, x1 + r, y1 + h - r, x1 + w - r, y1 + h - r);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace Graphics {
|
||||||
|
|
||||||
const int SCALE_THRESHOLD = 0x100;
|
const int SCALE_THRESHOLD = 0x100;
|
||||||
|
|
||||||
ManagedSurface::ManagedSurface() :
|
ManagedSurface::ManagedSurface() :
|
||||||
w(_innerSurface.w), h(_innerSurface.h), pitch(_innerSurface.pitch), format(_innerSurface.format),
|
w(_innerSurface.w), h(_innerSurface.h), pitch(_innerSurface.pitch), format(_innerSurface.format),
|
||||||
_disposeAfterUse(DisposeAfterUse::NO), _owner(nullptr) {
|
_disposeAfterUse(DisposeAfterUse::NO), _owner(nullptr) {
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ void ManagedSurface::create(uint16 width, uint16 height, const PixelFormat &pixe
|
||||||
|
|
||||||
void ManagedSurface::create(ManagedSurface &surf, const Common::Rect &bounds) {
|
void ManagedSurface::create(ManagedSurface &surf, const Common::Rect &bounds) {
|
||||||
free();
|
free();
|
||||||
|
|
||||||
_offsetFromOwner = Common::Point(bounds.left, bounds.top);
|
_offsetFromOwner = Common::Point(bounds.left, bounds.top);
|
||||||
_innerSurface.setPixels(surf.getBasePtr(bounds.left, bounds.top));
|
_innerSurface.setPixels(surf.getBasePtr(bounds.left, bounds.top));
|
||||||
_innerSurface.pitch = surf.pitch;
|
_innerSurface.pitch = surf.pitch;
|
||||||
|
@ -164,7 +164,7 @@ void ManagedSurface::blitFrom(const Surface &src, const Common::Point &destPos)
|
||||||
void ManagedSurface::blitFrom(const Surface &src, const Common::Rect &srcRect,
|
void ManagedSurface::blitFrom(const Surface &src, const Common::Rect &srcRect,
|
||||||
const Common::Point &destPos) {
|
const Common::Point &destPos) {
|
||||||
Common::Rect srcBounds = srcRect;
|
Common::Rect srcBounds = srcRect;
|
||||||
Common::Rect destBounds(destPos.x, destPos.y, destPos.x + srcRect.width(),
|
Common::Rect destBounds(destPos.x, destPos.y, destPos.x + srcRect.width(),
|
||||||
destPos.y + srcRect.height());
|
destPos.y + srcRect.height());
|
||||||
assert(src.format.bytesPerPixel == format.bytesPerPixel);
|
assert(src.format.bytesPerPixel == format.bytesPerPixel);
|
||||||
|
|
||||||
|
|
|
@ -95,12 +95,12 @@ public:
|
||||||
* Create the managed surface
|
* Create the managed surface
|
||||||
*/
|
*/
|
||||||
ManagedSurface(int width, int height);
|
ManagedSurface(int width, int height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the managed surface
|
* Create the managed surface
|
||||||
*/
|
*/
|
||||||
ManagedSurface(int width, int height, const Graphics::PixelFormat &pixelFormat);
|
ManagedSurface(int width, int height, const Graphics::PixelFormat &pixelFormat);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the managed surface
|
* Create the managed surface
|
||||||
*/
|
*/
|
||||||
|
@ -211,7 +211,7 @@ public:
|
||||||
const Common::Rect getBounds() const {
|
const Common::Rect getBounds() const {
|
||||||
return Common::Rect(0, 0, this->w, this->h);
|
return Common::Rect(0, 0, this->w, this->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies another surface into this one
|
* Copies another surface into this one
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace Graphics {
|
||||||
/**
|
/**
|
||||||
* Implements a specialised surface that represents the screen.
|
* Implements a specialised surface that represents the screen.
|
||||||
* It keeps track of any areas of itself that are updated by drawing
|
* It keeps track of any areas of itself that are updated by drawing
|
||||||
* calls, and provides an update that method that blits the affected
|
* calls, and provides an update that method that blits the affected
|
||||||
* areas to the physical screen
|
* areas to the physical screen
|
||||||
*/
|
*/
|
||||||
class Screen : public ManagedSurface {
|
class Screen : public ManagedSurface {
|
||||||
|
@ -72,7 +72,7 @@ public:
|
||||||
bool isDirty() const { return !_dirtyRects.empty(); }
|
bool isDirty() const { return !_dirtyRects.empty(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks the whole screen as dirty. This forces the next call to update
|
* Marks the whole screen as dirty. This forces the next call to update
|
||||||
* to copy the entire screen contents
|
* to copy the entire screen contents
|
||||||
*/
|
*/
|
||||||
void makeAllDirty();
|
void makeAllDirty();
|
||||||
|
|
|
@ -346,7 +346,7 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p
|
||||||
TransparentSurface srcImage(*this, false);
|
TransparentSurface srcImage(*this, false);
|
||||||
// TODO: Is the data really in the screen format?
|
// TODO: Is the data really in the screen format?
|
||||||
if (format.bytesPerPixel != 4) {
|
if (format.bytesPerPixel != 4) {
|
||||||
warning("TransparentSurface can only blit 32bpp images, but got %d", format.bytesPerPixel * 8);
|
warning("TransparentSurface can only blit 32bpp images, but got %d", format.bytesPerPixel * 8);
|
||||||
return retSize;
|
return retSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
- (id) init {
|
- (id) init {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
_panel = 0;
|
_panel = 0;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ StorageWizardDialog::StorageWizardDialog(uint32 storageId):
|
||||||
_openUrlWidget = new ButtonWidget(container, "GlobalOptions_Cloud_ConnectionWizard_Container.OpenUrlButton", _("Open URL"), 0, kOpenUrlCmd);
|
_openUrlWidget = new ButtonWidget(container, "GlobalOptions_Cloud_ConnectionWizard_Container.OpenUrlButton", _("Open URL"), 0, kOpenUrlCmd);
|
||||||
_pasteCodeWidget = new ButtonWidget(container, "GlobalOptions_Cloud_ConnectionWizard_Container.PasteCodeButton", _("Paste"), _("Pastes clipboard contents into fields"), kPasteCodeCmd);
|
_pasteCodeWidget = new ButtonWidget(container, "GlobalOptions_Cloud_ConnectionWizard_Container.PasteCodeButton", _("Paste"), _("Pastes clipboard contents into fields"), kPasteCodeCmd);
|
||||||
_connectWidget = new ButtonWidget(container, "GlobalOptions_Cloud_ConnectionWizard_Container.ConnectButton", _("Connect"), 0, kConnectCmd);
|
_connectWidget = new ButtonWidget(container, "GlobalOptions_Cloud_ConnectionWizard_Container.ConnectButton", _("Connect"), 0, kConnectCmd);
|
||||||
|
|
||||||
// Initialy the code is empty, so disable the connect button
|
// Initialy the code is empty, so disable the connect button
|
||||||
_connectWidget->setEnabled(false);
|
_connectWidget->setEnabled(false);
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ StorageWizardDialog::StorageWizardDialog(uint32 storageId):
|
||||||
_returnLine1->setLabel(_("You will be directed to ScummVM's page where"));
|
_returnLine1->setLabel(_("You will be directed to ScummVM's page where"));
|
||||||
_returnLine2->setLabel(_("you should allow it to access your storage."));
|
_returnLine2->setLabel(_("you should allow it to access your storage."));
|
||||||
}
|
}
|
||||||
|
|
||||||
_picture = new GraphicsWidget(container, "GlobalOptions_Cloud_ConnectionWizard_Container.Picture");
|
_picture = new GraphicsWidget(container, "GlobalOptions_Cloud_ConnectionWizard_Container.Picture");
|
||||||
#ifndef DISABLE_FANCY_THEMES
|
#ifndef DISABLE_FANCY_THEMES
|
||||||
if (g_gui.theme()->supportsImages()) {
|
if (g_gui.theme()->supportsImages()) {
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
#include "graphics/surface.h"
|
#include "graphics/surface.h"
|
||||||
#include "image/codecs/codec.h"
|
#include "image/codecs/codec.h"
|
||||||
|
|
||||||
/* Common structures, macros, and base class shared by both Indeo4 and
|
/* Common structures, macros, and base class shared by both Indeo4 and
|
||||||
* Indeo5 decoders, derived from ffmpeg. We don't currently support Indeo5
|
* Indeo5 decoders, derived from ffmpeg. We don't currently support Indeo5
|
||||||
* decoding, but just in case we eventually need it, this is kept as a separate
|
* decoding, but just in case we eventually need it, this is kept as a separate
|
||||||
* file like it is in ffmpeg.
|
* file like it is in ffmpeg.
|
||||||
*
|
*
|
||||||
|
@ -343,7 +343,7 @@ struct AVFrame {
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
AVFrame();
|
AVFrame();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
|
@ -564,7 +564,7 @@ protected:
|
||||||
virtual int decodeMbInfo(IVIBandDesc *band, IVITile *tile) = 0;
|
virtual int decodeMbInfo(IVIBandDesc *band, IVITile *tile) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decodes the Indeo frame from the bit reader already
|
* Decodes the Indeo frame from the bit reader already
|
||||||
* loaded into the context
|
* loaded into the context
|
||||||
*/
|
*/
|
||||||
int decodeIndeoFrame();
|
int decodeIndeoFrame();
|
||||||
|
|
|
@ -610,7 +610,7 @@ int Indeo4Decoder::decodePlaneSubdivision() {
|
||||||
if (_ctx._gb->getBits(2) != 3)
|
if (_ctx._gb->getBits(2) != 3)
|
||||||
return 0;
|
return 0;
|
||||||
return 4;
|
return 4;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -459,7 +459,7 @@ int Indeo5Decoder::decode_gop_header() {
|
||||||
mbSize = _ctx._gb->getBit();
|
mbSize = _ctx._gb->getBit();
|
||||||
blkSize = 8 >> _ctx._gb->getBit();
|
blkSize = 8 >> _ctx._gb->getBit();
|
||||||
mbSize = blkSize << (!mbSize ? 1 : 0);
|
mbSize = blkSize << (!mbSize ? 1 : 0);
|
||||||
|
|
||||||
if (p == 0 && blkSize == 4) {
|
if (p == 0 && blkSize == 4) {
|
||||||
warning("4x4 luma blocks are unsupported!");
|
warning("4x4 luma blocks are unsupported!");
|
||||||
return -2;
|
return -2;
|
||||||
|
|
|
@ -535,7 +535,7 @@ void QTRLEDecoder::createSurface() {
|
||||||
if (_surface) {
|
if (_surface) {
|
||||||
_surface->free();
|
_surface->free();
|
||||||
delete _surface;
|
delete _surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
_surface = new Graphics::Surface();
|
_surface = new Graphics::Surface();
|
||||||
_surface->create(_paddedWidth, _height, getPixelFormat());
|
_surface->create(_paddedWidth, _height, getPixelFormat());
|
||||||
|
|
|
@ -28,8 +28,8 @@ class AlgorithmTestSuite : public CxxTest::TestSuite {
|
||||||
/**
|
/**
|
||||||
* Auxiliary function to check the equality of two generic collections (A and B), from one_first to one_last.
|
* Auxiliary function to check the equality of two generic collections (A and B), from one_first to one_last.
|
||||||
*
|
*
|
||||||
* @note: It assumes that other has at least (one_last - one-first) lenght, starting from other_first.
|
* @note: It assumes that other has at least (one_last - one-first) lenght, starting from other_first.
|
||||||
*
|
*
|
||||||
* @param one_first: The first element of the first collection to be compared.
|
* @param one_first: The first element of the first collection to be compared.
|
||||||
* @param one_last: The last element of the first collection to be compared.
|
* @param one_last: The last element of the first collection to be compared.
|
||||||
* @param other_first: The first element of the collection to be compared.
|
* @param other_first: The first element of the collection to be compared.
|
||||||
|
@ -37,19 +37,19 @@ class AlgorithmTestSuite : public CxxTest::TestSuite {
|
||||||
*/
|
*/
|
||||||
template<typename It>
|
template<typename It>
|
||||||
bool checkEqual(It one_first, It one_last, It other_first) {
|
bool checkEqual(It one_first, It one_last, It other_first) {
|
||||||
if (one_first == one_last)
|
if (one_first == one_last)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Check whether two containers have the same items in the same order,
|
// Check whether two containers have the same items in the same order,
|
||||||
// starting from some iterators one_first and other_first
|
// starting from some iterators one_first and other_first
|
||||||
//
|
//
|
||||||
// It iterates through the containers, comparing the elements one by one.
|
// It iterates through the containers, comparing the elements one by one.
|
||||||
// If it finds a discrepancy, it returns false. Otherwise, it returns true.
|
// If it finds a discrepancy, it returns false. Otherwise, it returns true.
|
||||||
|
|
||||||
for (; one_first != one_last; ++one_first, ++other_first)
|
for (; one_first != one_last; ++one_first, ++other_first)
|
||||||
if (*one_first != *other_first)
|
if (*one_first != *other_first)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,19 +125,19 @@ public:
|
||||||
Common::sort(list.begin(), list.end());
|
Common::sort(list.begin(), list.end());
|
||||||
TS_ASSERT_EQUALS(checkSort(list.begin(), list.end(), Common::Less<Item>()), true);
|
TS_ASSERT_EQUALS(checkSort(list.begin(), list.end(), Common::Less<Item>()), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_string_replace() {
|
void test_string_replace() {
|
||||||
|
|
||||||
Common::String original = "Hello World";
|
Common::String original = "Hello World";
|
||||||
Common::String expected = "Hells Wsrld";
|
Common::String expected = "Hells Wsrld";
|
||||||
|
|
||||||
Common::replace(original.begin(), original.end(), 'o', 's');
|
Common::replace(original.begin(), original.end(), 'o', 's');
|
||||||
|
|
||||||
TS_ASSERT_EQUALS(original, expected);
|
TS_ASSERT_EQUALS(original, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_container_replace() {
|
void test_container_replace() {
|
||||||
|
|
||||||
Common::List<int> original;
|
Common::List<int> original;
|
||||||
Common::List<int> expected;
|
Common::List<int> expected;
|
||||||
for (int i = 0; i < 6; ++i) {
|
for (int i = 0; i < 6; ++i) {
|
||||||
|
@ -150,7 +150,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::replace(original.begin(), original.end(), 3, 5);
|
Common::replace(original.begin(), original.end(), 3, 5);
|
||||||
|
|
||||||
TS_ASSERT_EQUALS(checkEqual(original.begin(), original.end(), expected.begin()), true);
|
TS_ASSERT_EQUALS(checkEqual(original.begin(), original.end(), expected.begin()), true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -438,16 +438,16 @@ class StringTestSuite : public CxxTest::TestSuite
|
||||||
|
|
||||||
// Using iterators (also a terribly useless program as a test).
|
// Using iterators (also a terribly useless program as a test).
|
||||||
testString.replace(testString.begin(), testString.end(), "That is the supernew string.");
|
testString.replace(testString.begin(), testString.end(), "That is the supernew string.");
|
||||||
TS_ASSERT_EQUALS(testString, Common::String("That is the supernew string."));
|
TS_ASSERT_EQUALS(testString, Common::String("That is the supernew string."));
|
||||||
|
|
||||||
// With sub strings of character arrays.
|
// With sub strings of character arrays.
|
||||||
testString.replace(21, 6, "That phrase is new.", 5, 6);
|
testString.replace(21, 6, "That phrase is new.", 5, 6);
|
||||||
TS_ASSERT_EQUALS(testString, Common::String("That is the supernew phrase."));
|
TS_ASSERT_EQUALS(testString, Common::String("That is the supernew phrase."));
|
||||||
|
|
||||||
// Now with substrings.
|
// Now with substrings.
|
||||||
testString.replace(12, 2, Common::String("That hy is new."), 5, 2);
|
testString.replace(12, 2, Common::String("That hy is new."), 5, 2);
|
||||||
TS_ASSERT_EQUALS(testString, Common::String("That is the hypernew phrase."));
|
TS_ASSERT_EQUALS(testString, Common::String("That is the hypernew phrase."));
|
||||||
|
|
||||||
// --------------------------
|
// --------------------------
|
||||||
// Tests with displacement
|
// Tests with displacement
|
||||||
// --------------------------
|
// --------------------------
|
||||||
|
@ -463,20 +463,20 @@ class StringTestSuite : public CxxTest::TestSuite
|
||||||
|
|
||||||
// Using iterators (also a terribly useless program as a test)
|
// Using iterators (also a terribly useless program as a test)
|
||||||
testString.replace(testString.begin() + 4, testString.begin() + 5, " coffee ");
|
testString.replace(testString.begin() + 4, testString.begin() + 5, " coffee ");
|
||||||
TS_ASSERT_EQUALS(testString, Common::String("Good coffee friends"));
|
TS_ASSERT_EQUALS(testString, Common::String("Good coffee friends"));
|
||||||
|
|
||||||
// With sub strings of character arrays
|
// With sub strings of character arrays
|
||||||
testString.replace(4, 0, "Lorem ipsum expresso dolor sit amet", 11, 9);
|
testString.replace(4, 0, "Lorem ipsum expresso dolor sit amet", 11, 9);
|
||||||
TS_ASSERT_EQUALS(testString, Common::String("Good expresso coffee friends"));
|
TS_ASSERT_EQUALS(testString, Common::String("Good expresso coffee friends"));
|
||||||
|
|
||||||
// Now with substrings
|
// Now with substrings
|
||||||
testString.replace(5, 9, Common::String("Displaced ristretto string"), 10, 10);
|
testString.replace(5, 9, Common::String("Displaced ristretto string"), 10, 10);
|
||||||
TS_ASSERT_EQUALS(testString, Common::String("Good ristretto coffee friends"));
|
TS_ASSERT_EQUALS(testString, Common::String("Good ristretto coffee friends"));
|
||||||
|
|
||||||
// -----------------------
|
// -----------------------
|
||||||
// Deep copy compliance
|
// Deep copy compliance
|
||||||
// -----------------------
|
// -----------------------
|
||||||
|
|
||||||
// Makes a deep copy without changing the length of the original
|
// Makes a deep copy without changing the length of the original
|
||||||
Common::String s1 = "TestTestTestTestTestTestTestTestTestTestTest";
|
Common::String s1 = "TestTestTestTestTestTestTestTestTestTestTest";
|
||||||
Common::String s2(s1);
|
Common::String s2(s1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue