mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 12:39:56 +00:00
Update to latest branch fixes
svn-id: r16683
This commit is contained in:
parent
4b3dda6184
commit
bf55edd72a
@ -116,7 +116,7 @@ void CEActionsPocket::initInstanceGame() {
|
||||
else
|
||||
if (is_queen) {
|
||||
_action_enabled[POCKET_ACTION_SAVE] = true;
|
||||
_key_action[POCKET_ACTION_SAVE].setAscii(282); // F1 key
|
||||
_key_action[POCKET_ACTION_SAVE].setAscii(286); // F5 key for FOTAQ
|
||||
}
|
||||
else
|
||||
if (is_sky) {
|
||||
@ -165,6 +165,12 @@ bool CEActionsPocket::perform(ActionType action, bool pushed) {
|
||||
case POCKET_ACTION_RIGHTCLICK:
|
||||
_mainSystem->add_right_click(false);
|
||||
return true;
|
||||
case POCKET_ACTION_PAUSE:
|
||||
case POCKET_ACTION_SAVE:
|
||||
case POCKET_ACTION_SKIP:
|
||||
EventsBuffer::simulateKey(&_key_action[action], false);
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -173,7 +179,7 @@ bool CEActionsPocket::perform(ActionType action, bool pushed) {
|
||||
case POCKET_ACTION_PAUSE:
|
||||
case POCKET_ACTION_SAVE:
|
||||
case POCKET_ACTION_SKIP:
|
||||
EventsBuffer::simulateKey(&_key_action[action]);
|
||||
EventsBuffer::simulateKey(&_key_action[action], true);
|
||||
return true;
|
||||
case POCKET_ACTION_KEYBOARD:
|
||||
_mainSystem->swap_panel();
|
||||
@ -190,9 +196,9 @@ bool CEActionsPocket::perform(ActionType action, bool pushed) {
|
||||
case POCKET_ACTION_CURSOR:
|
||||
_mainSystem->swap_mouse_visibility();
|
||||
return true;
|
||||
case POCKET_ACTION_FREELOOK:
|
||||
_mainSystem->swap_freeLook();
|
||||
return true;
|
||||
case POCKET_ACTION_FREELOOK:
|
||||
_mainSystem->swap_freeLook();
|
||||
return true;
|
||||
case POCKET_ACTION_ZOOM_UP:
|
||||
_mainSystem->swap_zoom_up();
|
||||
return true;
|
||||
|
@ -48,7 +48,7 @@ const String smartphoneActionNames[] = {
|
||||
#ifdef SIMU_SMARTPHONE
|
||||
const int ACTIONS_SMARTPHONE_DEFAULT[] = { 0x111, 0x112, 0x114, 0x113, 0x11a, 0x11b, VK_LWIN, VK_ESCAPE, VK_F8 };
|
||||
#else
|
||||
const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, VK_F10 };
|
||||
const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, '9' };
|
||||
#endif
|
||||
|
||||
void CEActionsSmartphone::init(GameDetector &detector) {
|
||||
@ -119,7 +119,7 @@ void CEActionsSmartphone::initInstanceGame() {
|
||||
else
|
||||
if (is_queen) {
|
||||
_action_enabled[SMARTPHONE_ACTION_SAVE] = true;
|
||||
_key_action[SMARTPHONE_ACTION_SAVE].setAscii(282); // F1 key
|
||||
_key_action[SMARTPHONE_ACTION_SAVE].setAscii(286); // F1 key for FOTAQ
|
||||
}
|
||||
else
|
||||
if (is_sky) {
|
||||
@ -137,7 +137,7 @@ void CEActionsSmartphone::initInstanceGame() {
|
||||
else
|
||||
_key_action[SMARTPHONE_ACTION_SKIP].setAscii(Scumm::KEY_ALL_SKIP);
|
||||
// Zone
|
||||
_key_action[SMARTPHONE_ACTION_ZONE] = true;
|
||||
_action_enabled[SMARTPHONE_ACTION_ZONE] = true;
|
||||
}
|
||||
|
||||
|
||||
@ -153,6 +153,10 @@ bool CEActionsSmartphone::perform(ActionType action, bool pushed) {
|
||||
case SMARTPHONE_ACTION_LEFTCLICK:
|
||||
_mainSystem->add_left_click(false);
|
||||
return true;
|
||||
case SMARTPHONE_ACTION_SAVE:
|
||||
case SMARTPHONE_ACTION_SKIP:
|
||||
EventsBuffer::simulateKey(&_key_action[action], false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -160,7 +164,7 @@ bool CEActionsSmartphone::perform(ActionType action, bool pushed) {
|
||||
switch (action) {
|
||||
case SMARTPHONE_ACTION_SAVE:
|
||||
case SMARTPHONE_ACTION_SKIP:
|
||||
EventsBuffer::simulateKey(&_key_action[action]);
|
||||
EventsBuffer::simulateKey(&_key_action[action], true);
|
||||
return true;
|
||||
case SMARTPHONE_ACTION_RIGHTCLICK:
|
||||
_mainSystem->add_right_click(true);
|
||||
|
@ -171,3 +171,4 @@ Common::String CEDevice::getKeyName(unsigned int keyCode) {
|
||||
sprintf(key_name, "Key %.4x", keyCode);
|
||||
return key_name;
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,7 @@ void CEException::dumpContext(HANDLE file, HANDLE hProcess, CONTEXT *context) {
|
||||
DWORD size;
|
||||
unsigned int i;
|
||||
|
||||
#ifdef ARM
|
||||
writeBreak(file);
|
||||
writeString(file, "Context dump");
|
||||
sprintf(tempo, "R0=%.8x R1=%.8x R2=%.8x R3=%.8x R4=%.8x", context->R0, context->R1,
|
||||
@ -77,13 +78,17 @@ void CEException::dumpContext(HANDLE file, HANDLE hProcess, CONTEXT *context) {
|
||||
writeString(file, tempo);
|
||||
}
|
||||
}
|
||||
#else
|
||||
writeBreak(file);
|
||||
writeString(file, "Context dump only available on ARM devices");
|
||||
#endif
|
||||
}
|
||||
|
||||
void CEException::dumpException(HANDLE file, EXCEPTION_RECORD *exceptionRecord) {
|
||||
char tempo[200];
|
||||
char exceptionName[50];
|
||||
unsigned int i;
|
||||
|
||||
#if (_WIN32_WCE >= 300)
|
||||
writeBreak(file);
|
||||
switch(exceptionRecord->ExceptionCode) {
|
||||
case EXCEPTION_ACCESS_VIOLATION :
|
||||
@ -122,6 +127,10 @@ void CEException::dumpException(HANDLE file, EXCEPTION_RECORD *exceptionRecord)
|
||||
}
|
||||
if (exceptionRecord->ExceptionRecord)
|
||||
dumpException(file, exceptionRecord->ExceptionRecord);
|
||||
#else
|
||||
writeBreak(file);
|
||||
writeString(file, "Cannot get exception information on this CE version");
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CEException::writeException(TCHAR *path, EXCEPTION_POINTERS *exceptionPointers) {
|
||||
@ -143,4 +152,4 @@ bool CEException::writeException(TCHAR *path, EXCEPTION_POINTERS *exceptionPoint
|
||||
CloseHandle(dumpFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ CEKeysDialog::CEKeysDialog(const Common::String &title)
|
||||
// Get actions names
|
||||
Common::StringList l;
|
||||
|
||||
for (int i = 1; i < CEActions::Instance()->size(); i++)
|
||||
for (int i = 0; i < CEActions::Instance()->size(); i++)
|
||||
l.push_back(CEActions::Instance()->actionName((ActionType)i));
|
||||
|
||||
_actionsList->setList(l);
|
||||
@ -72,7 +72,7 @@ void CEKeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data)
|
||||
if (_actionsList->getSelected() >= 0) {
|
||||
char selection[100];
|
||||
|
||||
sprintf(selection, "Associated key : %s", CEDevice::getKeyName(CEActions::Instance()->getMapping((ActionType)(_actionsList->getSelected() + 1))).c_str());
|
||||
sprintf(selection, "Associated key : %s", CEDevice::getKeyName(CEActions::Instance()->getMapping((ActionType)(_actionsList->getSelected()))).c_str());
|
||||
_keyMapping->setLabel(selection);
|
||||
_keyMapping->draw();
|
||||
}
|
||||
@ -84,7 +84,7 @@ void CEKeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data)
|
||||
else {
|
||||
char selection[100];
|
||||
|
||||
_actionSelected = _actionsList->getSelected() + 1;
|
||||
_actionSelected = _actionsList->getSelected();
|
||||
sprintf(selection, "Associated key : %s", CEDevice::getKeyName(CEActions::Instance()->getMapping((ActionType)_actionSelected)).c_str());
|
||||
_actionTitle->setLabel("Press the key to associate");
|
||||
_keyMapping->setLabel(selection);
|
||||
|
@ -80,3 +80,4 @@ namespace CEGUI {
|
||||
_itemsMap.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,4 +40,5 @@ namespace CEGUI {
|
||||
void PanelItem::setPanel(Panel *panel) {
|
||||
_panel = panel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,10 +72,10 @@ namespace CEGUI {
|
||||
keyCode = 10;
|
||||
}
|
||||
|
||||
if (keyAscii != 0 && pushed) {
|
||||
if (keyAscii != 0) {
|
||||
_key.setAscii(keyAscii);
|
||||
_key.setKeycode(tolower(keyAscii));
|
||||
return EventsBuffer::simulateKey(&_key);
|
||||
return EventsBuffer::simulateKey(&_key, pushed);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
@ -83,4 +83,5 @@ namespace CEGUI {
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
namespace CEKEYS {
|
||||
|
||||
bool EventsBuffer::simulateKey(Key *key) {
|
||||
bool EventsBuffer::simulateKey(Key *key, bool pushed) {
|
||||
SDL_Event ev = {0};
|
||||
|
||||
if (!key->keycode())
|
||||
@ -33,13 +33,11 @@ namespace CEKEYS {
|
||||
if (!key->ascii())
|
||||
key->setAscii(key->keycode());
|
||||
|
||||
ev.type = SDL_KEYDOWN;
|
||||
ev.type = (pushed ? SDL_KEYDOWN : SDL_KEYUP);
|
||||
ev.key.keysym.mod = (SDLMod)key->flags();
|
||||
ev.key.keysym.sym = (SDLKey)key->keycode();
|
||||
ev.key.keysym.unicode = key->keycode();
|
||||
if (SDL_PushEvent(&ev))
|
||||
return false;
|
||||
ev.type = SDL_KEYUP;
|
||||
ev.key.keysym.mod = KMOD_RESERVED;
|
||||
return (SDL_PushEvent(&ev) == 0);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ namespace CEKEYS {
|
||||
|
||||
class EventsBuffer {
|
||||
public:
|
||||
static bool simulateKey(Key *key);
|
||||
static bool simulateKey(Key *key, bool pushed);
|
||||
static bool simulateMouseMove(int x, int y);
|
||||
static bool simulateMouseLeftClick(int x, int y, bool pushed);
|
||||
static bool simulateMouseRightClick(int x, int y, bool pushed);
|
||||
|
@ -118,7 +118,7 @@ bool isSmartphone() {
|
||||
|
||||
extern "C" int scummvm_main(GameDetector &gameDetector, int argc, char **argv);
|
||||
|
||||
void handleException(EXCEPTION_POINTERS *exceptionPointers) {
|
||||
int handleException(EXCEPTION_POINTERS *exceptionPointers) {
|
||||
CEException::writeException(TEXT("\\scummvmCrash"), exceptionPointers);
|
||||
drawError("Unrecoverable exception occurred - see crash dump in latest \\scummvmCrash file");
|
||||
fclose(stdout_file);
|
||||
@ -126,6 +126,7 @@ void handleException(EXCEPTION_POINTERS *exceptionPointers) {
|
||||
CEDevice::end();
|
||||
SDL_Quit();
|
||||
exit(0);
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
|
||||
int SDL_main(int argc, char **argv) {
|
||||
@ -228,6 +229,7 @@ OSystem_WINCE3::OSystem_WINCE3() : OSystem_SDL(),
|
||||
loadSmartphoneConfiguration();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void OSystem_WINCE3::swap_panel_visibility() {
|
||||
@ -345,8 +347,8 @@ void OSystem_WINCE3::initZones() {
|
||||
|
||||
_currentZone = 0;
|
||||
for (i=0; i<TOTAL_ZONES; i++) {
|
||||
_mouseXZone[i] = _zones[i].x + (_zones[i].width / 2);
|
||||
_mouseYZone[i] = _zones[i].y + (_zones[i].height / 2);
|
||||
_mouseXZone[i] = (_zones[i].x + (_zones[i].width / 2)) * _scaleFactorXm / _scaleFactorXd;
|
||||
_mouseYZone[i] = (_zones[i].y + (_zones[i].height / 2)) * _scaleFactorYm / _scaleFactorYd;
|
||||
}
|
||||
}
|
||||
|
||||
@ -510,6 +512,14 @@ bool OSystem_WINCE3::checkOggHighSampleRate() {
|
||||
#endif
|
||||
|
||||
void OSystem_WINCE3::get_sample_rate() {
|
||||
// Force at least medium quality FM synthesis for FOTAQ
|
||||
if (_gameDetector._targetName == "queen") {
|
||||
if (!((ConfMan.hasKey("FM_high_quality") && ConfMan.getBool("FM_high_quality")) ||
|
||||
(ConfMan.hasKey("FM_medium_quality") && ConfMan.getBool("FM_medium_quality")))) {
|
||||
ConfMan.set("FM_medium_quality", true);
|
||||
ConfMan.flushToDisk();
|
||||
}
|
||||
}
|
||||
// See if the output frequency is forced by the game
|
||||
if ((_gameDetector._game.features & Scumm::GF_DIGI_IMUSE) ||
|
||||
_gameDetector._targetName == "queen" ||
|
||||
@ -814,6 +824,7 @@ bool OSystem_WINCE3::update_scalers() {
|
||||
_scaleFactorYd = 8;
|
||||
_scalerProc = SmartphoneLandscape;
|
||||
_modeFlags = 0;
|
||||
initZones();
|
||||
return true;
|
||||
}
|
||||
//#endif
|
||||
@ -855,7 +866,7 @@ bool OSystem_WINCE3::setGraphicsMode(int mode) {
|
||||
_scaleFactorXm = -1;
|
||||
|
||||
if (CEDevice::hasPocketPCResolution() && !CEDevice::hasWideResolution() && _orientationLandscape)
|
||||
_mode = GFX_NORMAL;
|
||||
_mode = GFX_NORMAL;
|
||||
else
|
||||
_mode = mode;
|
||||
|
||||
@ -1487,21 +1498,24 @@ bool OSystem_WINCE3::pollEvent(Event &event) {
|
||||
|
||||
CEDevice::wakeUp();
|
||||
|
||||
if (isSmartphone)
|
||||
if (_isSmartphone)
|
||||
currentTime = GetTickCount();
|
||||
|
||||
while(SDL_PollEvent(&ev)) {
|
||||
switch(ev.type) {
|
||||
case SDL_KEYDOWN:
|
||||
if (_isSmartphone) {
|
||||
keyEvent = true;
|
||||
_lastKeyPressed = ev.key.keysym.sym;
|
||||
_keyRepeatTime = currentTime;
|
||||
_keyRepeat = 0;
|
||||
}
|
||||
// KMOD_RESERVED is used if the key has been injected by an external buffer
|
||||
if (ev.key.keysym.mod != KMOD_RESERVED) {
|
||||
if (_isSmartphone) {
|
||||
keyEvent = true;
|
||||
_lastKeyPressed = ev.key.keysym.sym;
|
||||
_keyRepeatTime = currentTime;
|
||||
_keyRepeat = 0;
|
||||
}
|
||||
|
||||
if (CEActions::Instance()->performMapped(ev.key.keysym.sym, true))
|
||||
return true;
|
||||
if (CEActions::Instance()->performMapped(ev.key.keysym.sym, true))
|
||||
return true;
|
||||
}
|
||||
|
||||
event.type = EVENT_KEYDOWN;
|
||||
event.kbd.keycode = ev.key.keysym.sym;
|
||||
@ -1513,13 +1527,16 @@ bool OSystem_WINCE3::pollEvent(Event &event) {
|
||||
return true;
|
||||
|
||||
case SDL_KEYUP:
|
||||
if (_isSmartphone) {
|
||||
keyEvent = true;
|
||||
_lastKeyPressed = 0;
|
||||
}
|
||||
// KMOD_RESERVED is used if the key has been injected by an external buffer
|
||||
if (ev.key.keysym.mod != KMOD_RESERVED) {
|
||||
if (_isSmartphone) {
|
||||
keyEvent = true;
|
||||
_lastKeyPressed = 0;
|
||||
}
|
||||
|
||||
if (CEActions::Instance()->performMapped(ev.key.keysym.sym, false))
|
||||
return true;
|
||||
if (CEActions::Instance()->performMapped(ev.key.keysym.sym, false))
|
||||
return true;
|
||||
}
|
||||
|
||||
event.type = EVENT_KEYUP;
|
||||
event.kbd.keycode = ev.key.keysym.sym;
|
||||
|
Loading…
Reference in New Issue
Block a user