From bd82ebd080bf97fad8831d3ad6bdaa01d3158d21 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 9 Mar 2011 03:02:46 +0100 Subject: WINCE: Run astyle over WinCE source files. --- backends/platform/wince/CEActionsSmartphone.cpp | 180 ++++++++++++------------ 1 file changed, 90 insertions(+), 90 deletions(-) (limited to 'backends/platform/wince/CEActionsSmartphone.cpp') diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index a8684293f4..413c52af2b 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -36,7 +36,7 @@ #include "common/translation.h" -#define KEY_ALL_SKIP 3457 +#define KEY_ALL_SKIP 3457 const String smartphoneActionNames[] = { _s("Up"), @@ -79,10 +79,10 @@ int CEActionsSmartphone::version() { } CEActionsSmartphone::CEActionsSmartphone() -: GUI::Actions() { + : GUI::Actions() { int i; - for (i=0; i(mainSystem); + _CESystem = static_cast(mainSystem); GUI_Actions::initInstanceMain(mainSystem); @@ -117,7 +117,7 @@ void CEActionsSmartphone::initInstanceGame() { bool is_comi = (strncmp(gameid.c_str(), "comi", 4) == 0); bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0); bool is_saga = (gameid == "saga"); - bool is_kyra = (strncmp(gameid.c_str(), "kyra",4) == 0); + bool is_kyra = (strncmp(gameid.c_str(), "kyra", 4) == 0); bool is_samnmax = (gameid == "samnmax"); bool is_cine = (gameid == "cine"); bool is_touche = (gameid == "touche"); @@ -125,7 +125,7 @@ void CEActionsSmartphone::initInstanceGame() { bool is_parallaction = (gameid == "parallaction"); bool is_lure = (gameid == "lure"); bool is_feeble = (gameid == "feeble"); - bool is_drascula = (strncmp(gameid.c_str(), "drascula",8) == 0); + bool is_drascula = (strncmp(gameid.c_str(), "drascula", 8) == 0); bool is_tucker = (gameid == "tucker"); bool is_groovie = (gameid == "groovie"); bool is_tinsel = (gameid == "tinsel"); @@ -136,7 +136,7 @@ void CEActionsSmartphone::initInstanceGame() { // See if a right click mapping could be needed if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || is_tinsel || - is_samnmax || is_cine || is_touche || is_parallaction || is_drascula || is_cruise) + is_samnmax || is_cine || is_touche || is_parallaction || is_drascula || is_cruise) _right_click_needed = true; // Initialize keys for different actions @@ -168,8 +168,8 @@ void CEActionsSmartphone::initInstanceGame() { // Skip _action_enabled[SMARTPHONE_ACTION_SKIP] = true; if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob || is_tinsel || - is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula || is_tucker || - is_groovie || is_cruise || is_made) + is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula || is_tucker || + is_groovie || is_cruise || is_made) _key_action[SMARTPHONE_ACTION_SKIP].setKey(VK_ESCAPE); else _key_action[SMARTPHONE_ACTION_SKIP].setKey(KEY_ALL_SKIP); @@ -204,92 +204,92 @@ bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { if (!pushed) { switch (action) { - case SMARTPHONE_ACTION_RIGHTCLICK: - //_CESystem->add_right_click(false); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_right_click(false); - return true; - case SMARTPHONE_ACTION_LEFTCLICK: - //_CESystem->add_left_click(false); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_left_click(false); - return true; - case SMARTPHONE_ACTION_SAVE: - case SMARTPHONE_ACTION_SKIP: - case SMARTPHONE_ACTION_MULTI: - EventsBuffer::simulateKey(&_key_action[action], false); - return true; - } - return false; - } - - switch (action) { - case SMARTPHONE_ACTION_SAVE: - case SMARTPHONE_ACTION_SKIP: - case SMARTPHONE_ACTION_MULTI: - if (action == SMARTPHONE_ACTION_SAVE && ConfMan.get("gameid") == "parallaction") { - // FIXME: This is a temporary solution. The engine should handle its own menus. - // Note that the user can accomplish this via the virtual keyboard as well, this is just for convenience - GUI::MessageDialog alert(_("Do you want to load or save the game?"), _("Load"), _("Save")); - if (alert.runModal() == GUI::kMessageOK) - _key_action[action].setKey(SDLK_l); - else - _key_action[action].setKey(SDLK_s); - } - EventsBuffer::simulateKey(&_key_action[action], true); - return true; case SMARTPHONE_ACTION_RIGHTCLICK: - //_CESystem->add_right_click(true); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_right_click(true); + //_CESystem->add_right_click(false); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_right_click(false); return true; case SMARTPHONE_ACTION_LEFTCLICK: - //_CESystem->add_left_click(true); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_left_click(true); - return true; - case SMARTPHONE_ACTION_UP: - //_CESystem->move_cursor_up(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_up(); - return true; - case SMARTPHONE_ACTION_DOWN: - //_CESystem->move_cursor_down(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_down(); - return true; - case SMARTPHONE_ACTION_LEFT: - //_CESystem->move_cursor_left(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_left(); - return true; - case SMARTPHONE_ACTION_RIGHT: - //_CESystem->move_cursor_right(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_right(); - return true; - case SMARTPHONE_ACTION_ZONE: - //_CESystem->switch_zone(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->switch_zone(); + //_CESystem->add_left_click(false); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_left_click(false); return true; - case SMARTPHONE_ACTION_BINDKEYS: - if (!keydialogrunning) { - keydialogrunning = true; - GUI::KeysDialog *keysDialog = new GUI::KeysDialog(); - keysDialog->runModal(); - delete keysDialog; - keydialogrunning = false; - } - return true; - case SMARTPHONE_ACTION_KEYBOARD: - //_CESystem->swap_smartphone_keyboard(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->swap_smartphone_keyboard(); - return true; - case SMARTPHONE_ACTION_ROTATE: - //_CESystem->smartphone_rotate_display(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->smartphone_rotate_display(); - return true; - case SMARTPHONE_ACTION_QUIT: - if (!quitdialog) { - quitdialog = true; - GUI::MessageDialog alert(_(" Are you sure you want to quit ? "), _("Yes"), _("No")); - if (alert.runModal() == GUI::kMessageOK) - _mainSystem->quit(); - quitdialog = false; - } + case SMARTPHONE_ACTION_SAVE: + case SMARTPHONE_ACTION_SKIP: + case SMARTPHONE_ACTION_MULTI: + EventsBuffer::simulateKey(&_key_action[action], false); return true; + } + return false; + } + + switch (action) { + case SMARTPHONE_ACTION_SAVE: + case SMARTPHONE_ACTION_SKIP: + case SMARTPHONE_ACTION_MULTI: + if (action == SMARTPHONE_ACTION_SAVE && ConfMan.get("gameid") == "parallaction") { + // FIXME: This is a temporary solution. The engine should handle its own menus. + // Note that the user can accomplish this via the virtual keyboard as well, this is just for convenience + GUI::MessageDialog alert(_("Do you want to load or save the game?"), _("Load"), _("Save")); + if (alert.runModal() == GUI::kMessageOK) + _key_action[action].setKey(SDLK_l); + else + _key_action[action].setKey(SDLK_s); + } + EventsBuffer::simulateKey(&_key_action[action], true); + return true; + case SMARTPHONE_ACTION_RIGHTCLICK: + //_CESystem->add_right_click(true); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_right_click(true); + return true; + case SMARTPHONE_ACTION_LEFTCLICK: + //_CESystem->add_left_click(true); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_left_click(true); + return true; + case SMARTPHONE_ACTION_UP: + //_CESystem->move_cursor_up(); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_up(); + return true; + case SMARTPHONE_ACTION_DOWN: + //_CESystem->move_cursor_down(); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_down(); + return true; + case SMARTPHONE_ACTION_LEFT: + //_CESystem->move_cursor_left(); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_left(); + return true; + case SMARTPHONE_ACTION_RIGHT: + //_CESystem->move_cursor_right(); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_right(); + return true; + case SMARTPHONE_ACTION_ZONE: + //_CESystem->switch_zone(); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->switch_zone(); + return true; + case SMARTPHONE_ACTION_BINDKEYS: + if (!keydialogrunning) { + keydialogrunning = true; + GUI::KeysDialog *keysDialog = new GUI::KeysDialog(); + keysDialog->runModal(); + delete keysDialog; + keydialogrunning = false; + } + return true; + case SMARTPHONE_ACTION_KEYBOARD: + //_CESystem->swap_smartphone_keyboard(); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->swap_smartphone_keyboard(); + return true; + case SMARTPHONE_ACTION_ROTATE: + //_CESystem->smartphone_rotate_display(); + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->smartphone_rotate_display(); + return true; + case SMARTPHONE_ACTION_QUIT: + if (!quitdialog) { + quitdialog = true; + GUI::MessageDialog alert(_(" Are you sure you want to quit ? "), _("Yes"), _("No")); + if (alert.runModal() == GUI::kMessageOK) + _mainSystem->quit(); + quitdialog = false; + } + return true; } return false; -- cgit v1.2.3