diff options
Diffstat (limited to 'backends/platform')
59 files changed, 0 insertions, 5418 deletions
diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp deleted file mode 100644 index 09286f2e9f..0000000000 --- a/backends/platform/wince/CEActionsPocket.cpp +++ /dev/null @@ -1,365 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include "backends/platform/wince/wince-sdl.h" - -#include "CEActionsPocket.h" -#include "EventsBuffer.h" -#include "gui/message.h" -#include "common/config-manager.h" -#include "gui/KeysDialog.h" - -#include "common/translation.h" - - -#ifdef _WIN32_WCE -#define KEY_ALL_SKIP 3457 -#endif - -const Common::String pocketActionNames[] = { - _s("Pause"), - _s("Save"), - _s("Quit"), - _s("Skip"), - _s("Hide Toolbar"), - _s("Show Keyboard"), - _s("Sound on/off"), - _s("Right click"), - _s("Show/Hide Cursor"), - _s("Free look"), - _s("Zoom up"), - _s("Zoom down"), - _s("Multi Function"), - _s("Bind Keys"), - _s("Cursor Up"), - _s("Cursor Down"), - _s("Cursor Left"), - _s("Cursor Right"), - _s("Left Click") -}; - -void CEActionsPocket::init() { - _instance = new CEActionsPocket(ConfMan.get("gameid")); -} - - -Common::String CEActionsPocket::actionName(GUI::ActionType action) { - return _(pocketActionNames[action]); -} - -int CEActionsPocket::size() { - return POCKET_ACTION_LAST; -} - -Common::String CEActionsPocket::domain() { - return ConfMan.kApplicationDomain; -} - -int CEActionsPocket::version() { - return POCKET_ACTION_VERSION; -} - -CEActionsPocket::CEActionsPocket(const Common::String &gameid) : - GUI::Actions() { - int i; - - _right_click_needed = false; - _hide_toolbar_needed = false; - _zoom_needed = false; - - for (i = 0; i < POCKET_ACTION_LAST; i++) { - _action_mapping[i] = 0; - _action_enabled[i] = false; - } - - // apply some default settings for emulated mouse - _action_enabled[POCKET_ACTION_LEFTCLICK] = true; - _action_enabled[POCKET_ACTION_UP] = true; - _action_enabled[POCKET_ACTION_DOWN] = true; - _action_enabled[POCKET_ACTION_LEFT] = true; - _action_enabled[POCKET_ACTION_RIGHT] = true; - _action_mapping[POCKET_ACTION_LEFTCLICK] = SDLK_F1; - _action_mapping[POCKET_ACTION_UP] = SDLK_UP; - _action_mapping[POCKET_ACTION_DOWN] = SDLK_DOWN; - _action_mapping[POCKET_ACTION_LEFT] = SDLK_LEFT; - _action_mapping[POCKET_ACTION_RIGHT] = SDLK_RIGHT; -} - -void CEActionsPocket::initInstanceMain(OSystem *mainSystem) { - // Nothing generic to do for Pocket PC - _CESystem = static_cast<OSystem_WINCE3 *>(mainSystem); - GUI_Actions::initInstanceMain(mainSystem); -} - -void CEActionsPocket::initInstanceGame() { - Common::String gameid(ConfMan.get("gameid")); - bool is_simon = (strncmp(gameid.c_str(), "simon", 5) == 0); - bool is_sword1 = (gameid == "sword1"); - bool is_sword2 = (strcmp(gameid.c_str(), "sword2") == 0); - bool is_queen = (gameid == "queen"); - bool is_sky = (gameid == "sky"); - 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_samnmax = (gameid == "samnmax"); - bool is_cine = (gameid == "cine"); - bool is_touche = (gameid == "touche"); - bool is_agi = (gameid == "agi"); - 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_tucker = (gameid == "tucker"); - bool is_groovie = (gameid == "groovie"); - bool is_tinsel = (gameid == "tinsel"); - bool is_cruise = (gameid == "cruise"); - bool is_made = (gameid == "made"); - bool is_sci = (gameid == "sci"); - - GUI_Actions::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) - _right_click_needed = true; - - // See if a "hide toolbar" mapping could be needed - if (is_sword1 || is_sword2 || is_comi || is_groovie) - _hide_toolbar_needed = true; - - // Initialize keys for different actions - // Pause - _key_action[POCKET_ACTION_PAUSE].setKey(VK_SPACE); - _action_enabled[POCKET_ACTION_PAUSE] = true; - // Save - if (is_simon || is_sword2 || is_gob || is_kyra || is_feeble || is_tucker || is_groovie) - _action_enabled[POCKET_ACTION_SAVE] = false; - else if (is_queen) { - _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F1 key for FOTAQ - } else if (is_sky) { - _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); - } else if (is_cine || is_drascula || is_cruise) { - _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F10, SDLK_F10); // F10 - } else if (is_agi || is_made) { - _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_ESCAPE, SDLK_ESCAPE); - } else if (is_parallaction) { - _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setKey('s', SDLK_s); - } else if (is_tinsel) { - _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F1, SDLK_F1); - } else { - _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F5 key - } - // Quit - _action_enabled[POCKET_ACTION_QUIT] = true; - // Skip - if (!is_cine && !is_parallaction && !is_groovie && !is_cruise && !is_made) - _action_enabled[POCKET_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) - _key_action[POCKET_ACTION_SKIP].setKey(VK_ESCAPE); - else - _key_action[POCKET_ACTION_SKIP].setKey(KEY_ALL_SKIP); - // Hide - _action_enabled[POCKET_ACTION_HIDE] = true; - // Keyboard - _action_enabled[POCKET_ACTION_KEYBOARD] = true; - // Sound - _action_enabled[POCKET_ACTION_SOUND] = true; - // RightClick - _action_enabled[POCKET_ACTION_RIGHTCLICK] = true; - // Cursor - _action_enabled[POCKET_ACTION_CURSOR] = true; - // Freelook - _action_enabled[POCKET_ACTION_FREELOOK] = true; - // Zoom - if (is_sword1 || is_sword2 || is_comi || is_touche) { - _zoom_needed = true; - _action_enabled[POCKET_ACTION_ZOOM_UP] = true; - _action_enabled[POCKET_ACTION_ZOOM_DOWN] = true; - } - // Multi function key - _action_enabled[POCKET_ACTION_MULTI] = true; - if (is_agi) - _key_action[POCKET_ACTION_MULTI].setKey(SDLK_PAUSE); // agi: show predictive dialog - else if (is_gob) - _key_action[POCKET_ACTION_MULTI].setKey(Common::ASCII_F1, SDLK_F1); // bargon : F1 to start - else if (gameid == "atlantis") - _key_action[POCKET_ACTION_MULTI].setKey(0, SDLK_KP0); // fate of atlantis : Ins to sucker-punch - else if (is_simon) - _key_action[POCKET_ACTION_MULTI].setKey(Common::ASCII_F10, SDLK_F10); // F10 - else - _key_action[POCKET_ACTION_MULTI].setKey('V', SDLK_v, KMOD_SHIFT); // FT cheat : shift-V - // Key bind method - _action_enabled[POCKET_ACTION_BINDKEYS] = true; - // Disable double-tap right-click for convenience - if (is_tinsel || is_cruise || is_sci) - if (!ConfMan.hasKey("no_doubletap_rightclick")) { - ConfMan.setBool("no_doubletap_rightclick", true); - ConfMan.flushToDisk(); - } -} - - -CEActionsPocket::~CEActionsPocket() { -} - -bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) { - static bool keydialogrunning = false, quitdialog = false; - - _graphicsMan = dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager()); - - if (!pushed) { - switch (action) { - case POCKET_ACTION_RIGHTCLICK: - _graphicsMan->add_right_click(false); - return true; - case POCKET_ACTION_LEFTCLICK: - _graphicsMan->add_left_click(false); - return true; - case POCKET_ACTION_PAUSE: - case POCKET_ACTION_SAVE: - case POCKET_ACTION_SKIP: - case POCKET_ACTION_MULTI: - EventsBuffer::simulateKey(&_key_action[action], false); - return true; - } - return false; - } - - switch (action) { - case POCKET_ACTION_PAUSE: - case POCKET_ACTION_SAVE: - case POCKET_ACTION_SKIP: - case POCKET_ACTION_MULTI: - if (action == POCKET_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); - } - if (action == POCKET_ACTION_SKIP && ConfMan.get("gameid") == "agi") { - // In several AGI games (for example SQ2) it is needed to press F10 to exit from - // a screen. But we still want be able to skip normally with the skip button. - // Because of this, we inject a F10 keystroke here (this works and doesn't seem - // to have side-effects) - _key_action[action].setKey(Common::ASCII_F10, SDLK_F10); // F10 - EventsBuffer::simulateKey(&_key_action[action], true); - _key_action[action].setKey(KEY_ALL_SKIP); - } - EventsBuffer::simulateKey(&_key_action[action], true); - return true; - case POCKET_ACTION_KEYBOARD: - _graphicsMan->swap_panel(); - return true; - case POCKET_ACTION_HIDE: - _graphicsMan->swap_panel_visibility(); - return true; - case POCKET_ACTION_SOUND: - _CESystem->swap_sound_master(); - return true; - case POCKET_ACTION_RIGHTCLICK: - _graphicsMan->add_right_click(true); - return true; - case POCKET_ACTION_CURSOR: - _graphicsMan->swap_mouse_visibility(); - return true; - case POCKET_ACTION_FREELOOK: - _graphicsMan->swap_freeLook(); - return true; - case POCKET_ACTION_ZOOM_UP: - _graphicsMan->swap_zoom_up(); - return true; - case POCKET_ACTION_ZOOM_DOWN: - _graphicsMan->swap_zoom_down(); - return true; - case POCKET_ACTION_LEFTCLICK: - _graphicsMan->add_left_click(true); - return true; - case POCKET_ACTION_UP: - _graphicsMan->move_cursor_up(); - return true; - case POCKET_ACTION_DOWN: - _graphicsMan->move_cursor_down(); - return true; - case POCKET_ACTION_LEFT: - _graphicsMan->move_cursor_left(); - return true; - case POCKET_ACTION_RIGHT: - _graphicsMan->move_cursor_right(); - return true; - case POCKET_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; - case POCKET_ACTION_BINDKEYS: - if (!keydialogrunning) { - keydialogrunning = true; - GUI::KeysDialog *keysDialog = new GUI::KeysDialog(); - keysDialog->runModal(); - delete keysDialog; - keydialogrunning = false; - } - return true; - } - return false; -} - -bool CEActionsPocket::needsRightClickMapping() { - if (!_right_click_needed) - return false; - else - return (_action_mapping[POCKET_ACTION_RIGHTCLICK] == 0); -} - -bool CEActionsPocket::needsHideToolbarMapping() { - if (!_hide_toolbar_needed) - return false; - else - return (_action_mapping[POCKET_ACTION_HIDE] == 0); -} - - -bool CEActionsPocket::needsZoomMapping() { - if (!_zoom_needed) - return false; - else - return (_action_mapping[POCKET_ACTION_ZOOM_UP] == 0 || _action_mapping[POCKET_ACTION_ZOOM_DOWN] == 0); -} diff --git a/backends/platform/wince/CEActionsPocket.h b/backends/platform/wince/CEActionsPocket.h deleted file mode 100644 index f2952c059a..0000000000 --- a/backends/platform/wince/CEActionsPocket.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEACTIONSPOCKET_H -#define CEACTIONSPOCKET_H - -#include "common/scummsys.h" -#include "common/system.h" -#include "common/str.h" -#include "gui/Key.h" -#include "gui/Actions.h" -#include "backends/graphics/wincesdl/wincesdl-graphics.h" - -#define POCKET_ACTION_VERSION 5 - -enum pocketActionType { - POCKET_ACTION_PAUSE = 0, - POCKET_ACTION_SAVE, - POCKET_ACTION_QUIT, - POCKET_ACTION_SKIP, - POCKET_ACTION_HIDE, - POCKET_ACTION_KEYBOARD, - POCKET_ACTION_SOUND, - POCKET_ACTION_RIGHTCLICK, - POCKET_ACTION_CURSOR, - POCKET_ACTION_FREELOOK, - POCKET_ACTION_ZOOM_UP, - POCKET_ACTION_ZOOM_DOWN, - POCKET_ACTION_MULTI, - POCKET_ACTION_BINDKEYS, - POCKET_ACTION_UP, - POCKET_ACTION_DOWN, - POCKET_ACTION_LEFT, - POCKET_ACTION_RIGHT, - POCKET_ACTION_LEFTCLICK, - - POCKET_ACTION_LAST -}; - -class OSystem_WINCE3; - -class CEActionsPocket : public GUI::Actions { -public: - // Actions - bool perform(GUI::ActionType action, bool pushed = true); - Common::String actionName(GUI::ActionType action); - int size(); - - static void init(); - void initInstanceMain(OSystem *mainSystem); - void initInstanceGame(); - - // Action domain - Common::String domain(); - int version(); - - // Utility - bool needsRightClickMapping(); - bool needsHideToolbarMapping(); - bool needsZoomMapping(); - - ~CEActionsPocket(); -private: - CEActionsPocket(const Common::String &gameid); - WINCESdlGraphicsManager *_graphicsMan; - bool _right_click_needed; - bool _hide_toolbar_needed; - bool _zoom_needed; - OSystem_WINCE3 *_CESystem; -}; - -#endif diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp deleted file mode 100644 index 95957707e3..0000000000 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ /dev/null @@ -1,296 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include "backends/platform/wince/wince-sdl.h" - -#include "CEActionsSmartphone.h" -#include "EventsBuffer.h" -#include "gui/message.h" -#include "common/config-manager.h" -#include "gui/KeysDialog.h" - -#include "common/translation.h" - -#define KEY_ALL_SKIP 3457 - -const String smartphoneActionNames[] = { - _s("Up"), - _s("Down"), - _s("Left"), - _s("Right"), - _s("Left Click"), - _s("Right Click"), - _s("Save"), - _s("Skip"), - _s("Zone"), - _s("Multi Function"), - _s("Bind Keys"), - _s("Keyboard"), - _s("Rotate"), - _s("Quit") -}; - -const int ACTIONS_SMARTPHONE_DEFAULT[] = { SDLK_UP, SDLK_DOWN, SDLK_LEFT, SDLK_RIGHT, SDLK_F1, SDLK_F2, SDLK_F3, SDLK_ESCAPE, SDLK_9, SDLK_8, SDLK_F4, SDLK_RETURN, SDLK_5, SDLK_0 }; - -void CEActionsSmartphone::init() { - _instance = new CEActionsSmartphone(); -} - - -String CEActionsSmartphone::actionName(GUI::ActionType action) { - return _(smartphoneActionNames[action]); -} - -int CEActionsSmartphone::size() { - return SMARTPHONE_ACTION_LAST; -} - -String CEActionsSmartphone::domain() { - return ConfMan.kApplicationDomain; -} - -int CEActionsSmartphone::version() { - return SMARTPHONE_ACTION_VERSION; -} - -CEActionsSmartphone::CEActionsSmartphone() - : GUI::Actions() { - int i; - - for (i = 0; i < SMARTPHONE_ACTION_LAST; i++) { - _action_mapping[i] = ACTIONS_SMARTPHONE_DEFAULT[i]; - _action_enabled[i] = false; - } - -} - -void CEActionsSmartphone::initInstanceMain(OSystem *mainSystem) { - _CESystem = static_cast<OSystem_WINCE3 *>(mainSystem); - - GUI_Actions::initInstanceMain(mainSystem); - - // These actions are always on - _action_enabled[SMARTPHONE_ACTION_UP] = true; - _action_enabled[SMARTPHONE_ACTION_DOWN] = true; - _action_enabled[SMARTPHONE_ACTION_LEFT] = true; - _action_enabled[SMARTPHONE_ACTION_RIGHT] = true; - _action_enabled[SMARTPHONE_ACTION_LEFTCLICK] = true; - _action_enabled[SMARTPHONE_ACTION_RIGHTCLICK] = true; - _action_enabled[SMARTPHONE_ACTION_KEYBOARD] = true; - _action_enabled[SMARTPHONE_ACTION_ROTATE] = true; - _action_enabled[SMARTPHONE_ACTION_QUIT] = true; - _action_enabled[SMARTPHONE_ACTION_BINDKEYS] = true; -} - -void CEActionsSmartphone::initInstanceGame() { - String gameid(ConfMan.get("gameid")); - bool is_simon = (strncmp(gameid.c_str(), "simon", 5) == 0); - bool is_sword1 = (gameid == "sword1"); - bool is_sword2 = (strcmp(gameid.c_str(), "sword2") == 0); - bool is_queen = (gameid == "queen"); - bool is_sky = (gameid == "sky"); - 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_samnmax = (gameid == "samnmax"); - bool is_cine = (gameid == "cine"); - bool is_touche = (gameid == "touche"); - bool is_agi = (gameid == "agi"); - 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_tucker = (gameid == "tucker"); - bool is_groovie = (gameid == "groovie"); - bool is_tinsel = (gameid == "tinsel"); - bool is_cruise = (gameid == "cruise"); - bool is_made = (gameid == "made"); - bool is_sci = (gameid == "sci"); - - GUI_Actions::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) - _right_click_needed = true; - - // Initialize keys for different actions - // Save - if (is_simon || is_sword2 || is_gob || is_kyra || is_feeble || is_groovie) - _action_enabled[SMARTPHONE_ACTION_SAVE] = false; - else if (is_queen) { - _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F1 key for FOTAQ - } else if (is_sky) { - _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); - } else if (is_cine || is_drascula || is_cruise) { - _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F10, SDLK_F10); //F10 - } else if (is_agi || is_made) { - _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_ESCAPE, SDLK_ESCAPE); - } else if (is_parallaction) { - _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setKey('s', SDLK_s); - } else if (is_tinsel) { - _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F1, SDLK_F1); - } else { - _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F5 key - } - // 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) - _key_action[SMARTPHONE_ACTION_SKIP].setKey(VK_ESCAPE); - else - _key_action[SMARTPHONE_ACTION_SKIP].setKey(KEY_ALL_SKIP); - // Zone - _action_enabled[SMARTPHONE_ACTION_ZONE] = true; - // Multi function key - _action_enabled[SMARTPHONE_ACTION_MULTI] = true; - if (is_agi) - _key_action[SMARTPHONE_ACTION_MULTI].setKey(SDLK_PAUSE); // agi: show predictive dialog - else if (is_gob) - _key_action[SMARTPHONE_ACTION_MULTI].setKey(Common::ASCII_F1, SDLK_F1); // bargon : F1 to start - else if (gameid == "atlantis") - _key_action[SMARTPHONE_ACTION_MULTI].setKey(0, SDLK_KP0); // fate of atlantis : Ins to sucker-punch - else if (is_simon) - _key_action[SMARTPHONE_ACTION_MULTI].setKey(Common::ASCII_F10, SDLK_F10); // F10 - else - _key_action[SMARTPHONE_ACTION_MULTI].setKey('V', SDLK_v, KMOD_SHIFT); // FT cheat : shift-V - // Bind keys - _action_enabled[SMARTPHONE_ACTION_BINDKEYS] = true; - // Disable double-tap right-click for convenience - if (is_tinsel || is_cruise || is_sci) - if (!ConfMan.hasKey("no_doubletap_rightclick")) { - ConfMan.setBool("no_doubletap_rightclick", true); - ConfMan.flushToDisk(); - } -} - - -CEActionsSmartphone::~CEActionsSmartphone() { -} - -bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { - static bool keydialogrunning = false, quitdialog = false; - - _graphicsMan = dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager()); - - if (!pushed) { - switch (action) { - case SMARTPHONE_ACTION_RIGHTCLICK: - _graphicsMan->add_right_click(false); - return true; - case SMARTPHONE_ACTION_LEFTCLICK: - _graphicsMan->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); - } - if (action == SMARTPHONE_ACTION_SKIP && ConfMan.get("gameid") == "agi") { - // In several AGI games (for example SQ2) it is needed to press F10 to exit from - // a screen. But we still want be able to skip normally with the skip button. - // Because of this, we inject a F10 keystroke here (this works and doesn't seem - // to have side-effects) - _key_action[action].setKey(Common::ASCII_F10, SDLK_F10); // F10 - EventsBuffer::simulateKey(&_key_action[action], true); - _key_action[action].setKey(KEY_ALL_SKIP); - } - EventsBuffer::simulateKey(&_key_action[action], true); - return true; - case SMARTPHONE_ACTION_RIGHTCLICK: - _graphicsMan->add_right_click(true); - return true; - case SMARTPHONE_ACTION_LEFTCLICK: - _graphicsMan->add_left_click(true); - return true; - case SMARTPHONE_ACTION_UP: - _graphicsMan->move_cursor_up(); - return true; - case SMARTPHONE_ACTION_DOWN: - _graphicsMan->move_cursor_down(); - return true; - case SMARTPHONE_ACTION_LEFT: - _graphicsMan->move_cursor_left(); - return true; - case SMARTPHONE_ACTION_RIGHT: - _graphicsMan->move_cursor_right(); - return true; - case SMARTPHONE_ACTION_ZONE: - _graphicsMan->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: - _graphicsMan->swap_smartphone_keyboard(); - return true; - case SMARTPHONE_ACTION_ROTATE: - _graphicsMan->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; -} diff --git a/backends/platform/wince/CEActionsSmartphone.h b/backends/platform/wince/CEActionsSmartphone.h deleted file mode 100644 index 46529bbd99..0000000000 --- a/backends/platform/wince/CEActionsSmartphone.h +++ /dev/null @@ -1,77 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEACTIONSSMARTPHONE_H -#define CEACTIONSSMARTPHONE_H - -#include "common/scummsys.h" -#include "common/system.h" -#include "common/str.h" -#include "gui/Key.h" -#include "gui/Actions.h" -#include "backends/graphics/wincesdl/wincesdl-graphics.h" - -#define SMARTPHONE_ACTION_VERSION 5 - -enum smartphoneActionType { - SMARTPHONE_ACTION_UP = 0, - SMARTPHONE_ACTION_DOWN, - SMARTPHONE_ACTION_LEFT, - SMARTPHONE_ACTION_RIGHT, - SMARTPHONE_ACTION_LEFTCLICK, - SMARTPHONE_ACTION_RIGHTCLICK, - SMARTPHONE_ACTION_SAVE, - SMARTPHONE_ACTION_SKIP, - SMARTPHONE_ACTION_ZONE, - SMARTPHONE_ACTION_MULTI, - SMARTPHONE_ACTION_BINDKEYS, - SMARTPHONE_ACTION_KEYBOARD, - SMARTPHONE_ACTION_ROTATE, - SMARTPHONE_ACTION_QUIT, - - SMARTPHONE_ACTION_LAST -}; - - -class CEActionsSmartphone : public GUI::Actions { -public: - // Actions - bool perform(GUI::ActionType action, bool pushed = true); - Common::String actionName(GUI::ActionType action); - int size(); - static void init(); - void initInstanceMain(OSystem *mainSystem); - void initInstanceGame(); - - // Action domain - Common::String domain(); - int version(); - - ~CEActionsSmartphone(); -private: - CEActionsSmartphone(); - WINCESdlGraphicsManager *_graphicsMan; - bool _right_click_needed; - OSystem_WINCE3 *_CESystem; -}; - -#endif diff --git a/backends/platform/wince/CEDevice.cpp b/backends/platform/wince/CEDevice.cpp deleted file mode 100644 index ffadfeb993..0000000000 --- a/backends/platform/wince/CEDevice.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "CEDevice.h" - -#include "backends/platform/sdl/sdl-sys.h" - -#include "backends/platform/wince/wince-sdl.h" - -static void (WINAPI *_SHIdleTimerReset)(void) = NULL; -static HANDLE(WINAPI *_SetPowerRequirement)(PVOID, int, ULONG, PVOID, ULONG) = NULL; -static DWORD (WINAPI *_ReleasePowerRequirement)(HANDLE) = NULL; -static HANDLE _hPowerManagement = NULL; -static DWORD _lastTime = 0; -static DWORD REG_bat = 0, REG_ac = 0, REG_disp = 0, bat_timeout = 0; -static bool REG_tampered = false; -#ifdef __GNUC__ -extern "C" void WINAPI SystemIdleTimerReset(void); -#define SPI_SETBATTERYIDLETIMEOUT 251 -#define SPI_GETBATTERYIDLETIMEOUT 252 -#endif - -#define TIMER_TRIGGER 9000 - -DWORD CEDevice::reg_access(const TCHAR *key, const TCHAR *val, DWORD data) { - HKEY regkey; - DWORD tmpval, cbdata; - - if (RegOpenKeyEx(HKEY_CURRENT_USER, key, 0, 0, ®key) != ERROR_SUCCESS) - return data; - - cbdata = sizeof(DWORD); - if (RegQueryValueEx(regkey, val, NULL, NULL, (LPBYTE) &tmpval, &cbdata) != ERROR_SUCCESS) { - RegCloseKey(regkey); - return data; - } - - cbdata = sizeof(DWORD); - if (RegSetValueEx(regkey, val, 0, REG_DWORD, (LPBYTE) &data, cbdata) != ERROR_SUCCESS) { - RegCloseKey(regkey); - return data; - } - - RegCloseKey(regkey); - return tmpval; -} - -void CEDevice::backlight_xchg() { - HANDLE h; - - REG_bat = reg_access(TEXT("ControlPanel\\BackLight"), (const TCHAR *)TEXT("BatteryTimeout"), REG_bat); - REG_ac = reg_access(TEXT("ControlPanel\\BackLight"), TEXT("ACTimeout"), REG_ac); - REG_disp = reg_access(TEXT("ControlPanel\\Power"), TEXT("Display"), REG_disp); - - h = CreateEvent(NULL, FALSE, FALSE, TEXT("BackLightChangeEvent")); - if (h) { - SetEvent(h); - CloseHandle(h); - } -} - -void CEDevice::init() { - // 2003+ power management code borrowed from MoDaCo & Betaplayer. Thanks ! - HINSTANCE dll = LoadLibrary(TEXT("aygshell.dll")); - if (dll) { - _SHIdleTimerReset = (void (*)())GetProcAddress(dll, MAKEINTRESOURCE(2006)); - } - dll = LoadLibrary(TEXT("coredll.dll")); - if (dll) { - _SetPowerRequirement = (HANDLE (*)(PVOID, int, ULONG, PVOID, ULONG))GetProcAddress(dll, TEXT("SetPowerRequirement")); - _ReleasePowerRequirement = (DWORD (*)(HANDLE))GetProcAddress(dll, TEXT("ReleasePowerRequirement")); - } - if (_SetPowerRequirement) - _hPowerManagement = _SetPowerRequirement((PVOID) TEXT("BKL1:"), 0, 1, (PVOID) NULL, 0); - _lastTime = GetTickCount(); - - // older devices - REG_bat = REG_ac = REG_disp = 2 * 60 * 60 * 1000; // 2hrs should do it - backlight_xchg(); - REG_tampered = true; - SystemParametersInfo(SPI_GETBATTERYIDLETIMEOUT, 0, (void *) &bat_timeout, 0); - SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, 60 * 60 * 2, NULL, SPIF_SENDCHANGE); -} - -void CEDevice::end() { - if (_ReleasePowerRequirement && _hPowerManagement) - _ReleasePowerRequirement(_hPowerManagement); - if (REG_tampered) - backlight_xchg(); - SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, bat_timeout, NULL, SPIF_SENDCHANGE); -} - -void CEDevice::wakeUp() { - DWORD currentTime = GetTickCount(); - if (currentTime > _lastTime + TIMER_TRIGGER) { - _lastTime = currentTime; - SystemIdleTimerReset(); - if (_SHIdleTimerReset) - _SHIdleTimerReset(); - } -} - -bool CEDevice::hasSquareQVGAResolution() { - return (OSystem_WINCE3::getScreenWidth() == 240 && OSystem_WINCE3::getScreenHeight() == 240); -} - -bool CEDevice::hasWideResolution() { - return (OSystem_WINCE3::getScreenWidth() >= 640 || OSystem_WINCE3::getScreenHeight() >= 640); -} - -bool CEDevice::hasPocketPCResolution() { - if (OSystem_WINCE3::isOzone() && hasWideResolution()) - return true; - return (OSystem_WINCE3::getScreenWidth() <= 320 && OSystem_WINCE3::getScreenWidth() >= 240); -} - -bool CEDevice::hasDesktopResolution() { - if (OSystem_WINCE3::isOzone() && hasWideResolution()) - return true; - return (OSystem_WINCE3::getScreenWidth() > 320); -} - -bool CEDevice::hasSmartphoneResolution() { - return (OSystem_WINCE3::getScreenWidth() < 240); -} - -bool CEDevice::isSmartphone() { - TCHAR platformType[100]; - BOOL result = SystemParametersInfo(SPI_GETPLATFORMTYPE, sizeof(platformType), platformType, 0); - if (!result && GetLastError() == ERROR_ACCESS_DENIED) - return true; - return (_wcsnicmp(platformType, TEXT("SmartPhone"), 10) == 0); -} diff --git a/backends/platform/wince/CEDevice.h b/backends/platform/wince/CEDevice.h deleted file mode 100644 index c43e4e6999..0000000000 --- a/backends/platform/wince/CEDevice.h +++ /dev/null @@ -1,49 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEDEVICE_H -#define CEDEVICE_H - -#include <windows.h> - -#include "common/scummsys.h" -#include "common/system.h" -#include "common/str.h" - -class CEDevice { -public: - static void init(); - static void end(); - static void wakeUp(); - static bool hasPocketPCResolution(); - static bool hasSquareQVGAResolution(); - static bool hasDesktopResolution(); - static bool hasWideResolution(); - static bool hasSmartphoneResolution(); - static bool isSmartphone(); - -private: - static DWORD reg_access(const TCHAR *key, const TCHAR *val, DWORD data); - static void backlight_xchg(); -}; - -#endif diff --git a/backends/platform/wince/CEException.cpp b/backends/platform/wince/CEException.cpp deleted file mode 100644 index 46bb618e39..0000000000 --- a/backends/platform/wince/CEException.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "CEException.h" - -void CEException::writeString(HANDLE file, char *data) { - DWORD dummy; - WriteFile(file, data, strlen(data), &dummy, NULL); - WriteFile(file, "\r\n", 2, &dummy, NULL); -} - -void CEException::writeBreak(HANDLE file) { - char tempo[100]; - int i; - - memset(tempo, 0, sizeof(tempo)); - for (i = 0; i < 40; i++) - tempo[i] = '-'; - writeString(file, tempo); -} - -void CEException::dumpContext(HANDLE file, HANDLE hProcess, CONTEXT *context) { - char tempo[200]; - unsigned char memoryDump[100]; - 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, - context->R2, context->R3, context->R4); - writeString(file, tempo); - sprintf(tempo, "R5=%.8x R6=%.8x R7=%.8x R8=%.8x R9=%.8x", context->R5, context->R6, - context->R7, context->R8, context->R9); - writeString(file, tempo); - sprintf(tempo, "R10=%.8x R11=%.8x R12=%.8x", context->R10, context->R11, - context->R12); - writeString(file, tempo); - sprintf(tempo, "Sp=%.8x Lr=%.8x Pc=%.8x Psr=%.8x", context->Sp, context->Lr, - context->Pc, context->Psr); - writeString(file, tempo); - writeBreak(file); - - sprintf(tempo, "Memory dump at %.8x", context->Pc - (sizeof(memoryDump) / 2)); - writeString(file, tempo); - if (ReadProcessMemory(hProcess, (LPCVOID)(context->Pc - (sizeof(memoryDump) / 2)), memoryDump, sizeof(memoryDump), &size)) { - for (i = 0; i < size; i += 8) { - int j; - char digit[4]; - int max; - max = size - i; - if (max > 8) - max = 8; - tempo[0] = '\0'; - for (j = 0; j < max; j++) { - sprintf(digit, "%.2x ", memoryDump[i + j]); - strcat(tempo, digit); - } - 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 : - strcpy(exceptionName, "Access Violation"); - break; - case EXCEPTION_ARRAY_BOUNDS_EXCEEDED : - strcpy(exceptionName, "Array Bounds Exceeded"); - break; - case EXCEPTION_DATATYPE_MISALIGNMENT : - strcpy(exceptionName, "Datatype Misalignment"); - break; - case EXCEPTION_IN_PAGE_ERROR : - strcpy(exceptionName, "In Page Error"); - break; - case EXCEPTION_INT_DIVIDE_BY_ZERO : - strcpy(exceptionName, "Int Divide By Zero"); - break; - case EXCEPTION_INT_OVERFLOW : - strcpy(exceptionName, "Int Overflow"); - break; - case EXCEPTION_STACK_OVERFLOW : - strcpy(exceptionName, "Stack Overflow"); - break; - default: - sprintf(exceptionName, "%.8x", exceptionRecord->ExceptionCode); - break; - } - sprintf(tempo, "Exception %s Flags %.8x Address %.8x", exceptionName, exceptionRecord->ExceptionFlags, - exceptionRecord->ExceptionAddress); - writeString(file, tempo); - if (exceptionRecord->NumberParameters) { - for (i = 0; i < exceptionRecord->NumberParameters; i++) { - sprintf(tempo, "Parameter %d %.8x", i, exceptionRecord->ExceptionInformation[i]); - writeString(file, tempo); - } - } - 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) { - HANDLE dumpFile; - TCHAR dumpFileName[MAX_PATH]; - SYSTEMTIME systemTime; - - GetSystemTime(&systemTime); - wsprintf(dumpFileName, TEXT("%s_%.2d_%.2d_%.4d_%.2d_%.2d_%.2d.txt"), - path, systemTime.wDay, systemTime.wMonth, systemTime.wYear, - systemTime.wHour, systemTime.wMinute, systemTime.wSecond); - dumpFile = CreateFile(dumpFileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (dumpFile == INVALID_HANDLE_VALUE) - return false; - - dumpException(dumpFile, exceptionPointers->ExceptionRecord); - dumpContext(dumpFile, GetCurrentProcess(), exceptionPointers->ContextRecord); - - CloseHandle(dumpFile); - - return true; -} diff --git a/backends/platform/wince/CEException.h b/backends/platform/wince/CEException.h deleted file mode 100644 index 8ce6bd7dc0..0000000000 --- a/backends/platform/wince/CEException.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include <windows.h> - -class CEException { -public: - static bool writeException(TCHAR *path, EXCEPTION_POINTERS *exceptionPointers); -private: - static void writeString(HANDLE file, char *data); - static void writeBreak(HANDLE file); - static void dumpContext(HANDLE file, HANDLE hProcess, CONTEXT *context); - static void dumpException(HANDLE file, EXCEPTION_RECORD *exceptionRecord); - -}; diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp deleted file mode 100644 index 71650060a7..0000000000 --- a/backends/platform/wince/CELauncherDialog.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include "backends/platform/wince/wince-sdl.h" -#include "backends/graphics/wincesdl/wincesdl-graphics.h" - -#include "CELauncherDialog.h" - -#include "engines/metaengine.h" - -#include "gui/gui-manager.h" -#include "gui/widget.h" -#include "gui/browser.h" -#include "gui/message.h" -#include "gui/ThemeEval.h" -#include "gui/widgets/list.h" - -#include "common/config-manager.h" - -#include "common/translation.h" - -using namespace GUI; -using namespace Common; - -class CEAboutDialog : public Dialog { -public: - CEAboutDialog() - : Dialog(10, 60, 300, 77) { - char tempo[100]; - const int buttonWidth = g_gui.xmlEval()->getVar("Globals.Button.Width", 0); - const int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0); - new ButtonWidget(this, (_w - buttonWidth) / 2, 55, buttonWidth, buttonHeight, _("OK"), 0, kCloseCmd, '\r'); - - Common::String videoDriver(_("Using SDL driver ")); - SDL_VideoDriverName(tempo, sizeof(tempo)); - videoDriver += tempo; - new StaticTextWidget(this, 0, 10, _w, kLineHeight, videoDriver, Graphics::kTextAlignCenter); - Common::String displayInfos(_("Display ")); - sprintf(tempo, "%dx%d (real %dx%d)", GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), OSystem_WINCE3::getScreenWidth(), OSystem_WINCE3::getScreenHeight()); - displayInfos += tempo; - new StaticTextWidget(this, 0, 30, _w, kLineHeight, displayInfos, Graphics::kTextAlignCenter); - } -}; - -CELauncherDialog::CELauncherDialog() : GUI::LauncherDialog() { - dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager())->reset_panel(); -} - -void CELauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { - if ((cmd == 'STRT') || (cmd == kListItemActivatedCmd) || (cmd == kListItemDoubleClickedCmd)) { - dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager())->init_panel(); - } - LauncherDialog::handleCommand(sender, cmd, data); - if (cmd == 'ABOU') { - CEAboutDialog about; - about.runModal(); - } -} - -void CELauncherDialog::addGame() { - MessageDialog alert(_("Do you want to perform an automatic scan ?"), _("Yes"), _("No")); - if (alert.runModal() == kMessageOK && _browser->runModal() > 0) { - MassAddDialog massAddDlg(_browser->getResult()); - - massAddDlg.runModal(); - - // Update the ListWidget and force a redraw - - // If new target(s) were added, update the ListWidget and move - // the selection to to first newly detected game. - Common::String newTarget = massAddDlg.getFirstAddedTarget(); - if (!newTarget.empty()) { - updateListing(); - selectTarget(newTarget); - } - g_gui.scheduleTopDialogRedraw(); - } else - GUILauncherDialog::addGame(); -} diff --git a/backends/platform/wince/CELauncherDialog.h b/backends/platform/wince/CELauncherDialog.h deleted file mode 100644 index 9f69b8500f..0000000000 --- a/backends/platform/wince/CELauncherDialog.h +++ /dev/null @@ -1,41 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CELAUNCHERDIALOG_H -#define CELAUNCHERDIALOG_H - -#include "base/plugins.h" -#include "common/fs.h" -#include "gui/launcher.h" -#include "gui/massadd.h" - -class CELauncherDialog : public GUI::LauncherDialog { -public: - CELauncherDialog(); - virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); -protected: - void addGame(); -}; - -typedef GUI::LauncherDialog GUILauncherDialog; - -#endif diff --git a/backends/platform/wince/CEScaler.cpp b/backends/platform/wince/CEScaler.cpp deleted file mode 100644 index 321bdd92a9..0000000000 --- a/backends/platform/wince/CEScaler.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "graphics/scaler/intern.h" -#include "CEScaler.h" - -extern int gBitFormat; -#ifdef ARM -extern "C" { - void SmartphoneLandscapeARM(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int mask); -} - -void SmartphoneLandscape(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { - // Rounding constants and masks used for different pixel formats - static const int redbluegreenMasks[] = { 0x03E07C1F, 0x07E0F81F }; - const int maskUsed = (gBitFormat == 565); - SmartphoneLandscapeARM(srcPtr, srcPitch, dstPtr, dstPitch, width, height, redbluegreenMasks[maskUsed]); -} - -#else - -template<typename ColorMask> -void SmartphoneLandscapeTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { - int line = 0; - - assert((width % 16) == 0); - - while (height--) { - uint16 *d = (uint16 *)dstPtr; - - const uint16 *s = (const uint16 *)srcPtr; - for (int i = 0; i < width; i += 16) { - // Downscale horizontally to 11/16. - // See smartLandScale.s for an explanation of the scale pattern. - *d++ = interpolate32_3_1<ColorMask>(s[0], s[1]); - *d++ = interpolate32_1_1<ColorMask>(s[1], s[2]); - *d++ = interpolate32_3_1<ColorMask>(s[3], s[2]); - *d++ = interpolate32_1_1<ColorMask>(s[4], s[5]); - *d++ = interpolate32_3_1<ColorMask>(s[6], s[7]); - *d++ = interpolate32_1_1<ColorMask>(s[7], s[8]); - *d++ = interpolate32_3_1<ColorMask>(s[9], s[8]); - *d++ = interpolate32_1_1<ColorMask>(s[10], s[11]); - *d++ = interpolate32_3_1<ColorMask>(s[12], s[13]); - *d++ = interpolate32_1_1<ColorMask>(s[13], s[14]); - *d++ = interpolate32_3_1<ColorMask>(s[15], s[14]); - - s += 16; - } - srcPtr += srcPitch; - dstPtr += dstPitch; - line++; - - // Skip every 8th row - if (line == 7) { - line = 0; - srcPtr += srcPitch; - height--; - } - } -} - -void SmartphoneLandscape(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { - if (gBitFormat == 565) - SmartphoneLandscapeTemplate<Graphics::ColorMasks<565> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); - else - SmartphoneLandscapeTemplate<Graphics::ColorMasks<555> >(srcPtr, srcPitch, dstPtr, dstPitch, width, height); -} - -#endif diff --git a/backends/platform/wince/CEScaler.h b/backends/platform/wince/CEScaler.h deleted file mode 100644 index fc6540a33c..0000000000 --- a/backends/platform/wince/CEScaler.h +++ /dev/null @@ -1,37 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CESCALER_H -#define CESCALER_H - -#include "common/scummsys.h" -#include "common/system.h" -#include "graphics/scaler.h" -#include "graphics/scaler/intern.h" - -/** - * This filter (down)scales the source image horizontally by a factor of 11/16 - * and vertically by 7/8. For example, a 320x200 image is scaled to 220x175. - */ -DECLARE_SCALER(SmartphoneLandscape); - -#endif diff --git a/backends/platform/wince/CEgui/CEGUI.h b/backends/platform/wince/CEgui/CEGUI.h deleted file mode 100644 index 8b6db6b099..0000000000 --- a/backends/platform/wince/CEgui/CEGUI.h +++ /dev/null @@ -1,26 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "ToolbarHandler.h" -#include "Panel.h" -#include "ItemSwitch.h" -#include "PanelKeyboard.h" diff --git a/backends/platform/wince/CEgui/GUIElement.cpp b/backends/platform/wince/CEgui/GUIElement.cpp deleted file mode 100644 index e33e7f7f9d..0000000000 --- a/backends/platform/wince/CEgui/GUIElement.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "backends/platform/sdl/sdl-sys.h" - -#include "Toolbar.h" - -#include "SDL_ImageResource.h" - -namespace CEGUI { - -GUIElement::GUIElement(int x, int y, int width, int height) : - _background(0), _drawn(false), _visible(true), _x(x), _y(y), _width(width), _height(height) { -} - -bool GUIElement::setBackground(WORD backgroundReference) { - _background = new SDL_ImageResource(); - if (!_background->load(backgroundReference)) { - delete _background; - _background = NULL; - return false; - } - if (!_height && !_width) { - _height = _background->height(); - _width = _background->width(); - } else if (_background->height() != _height || _background->width() != _width) { - delete _background; - _background = NULL; - return false; - } - return true; -} - -void GUIElement::move(int x, int y) { - _x = x; - _y = y; -} - -bool GUIElement::draw(SDL_Surface *surface) { - if (_background && !_drawn && _visible) { - SDL_Rect rect; - - rect.x = _x; - rect.y = _y; - rect.w = _width; - rect.h = _height; - - SDL_BlitSurface(_background->get(), NULL, surface, &rect); - - _drawn = true; - - return true; - } else - return false; -} - -bool GUIElement::checkInside(int x, int y) { - if (x >= _x && x <= _x + _width && y >= _y && y <= _y + _height) - return true; - else - return false; -} - -void GUIElement::setVisible(bool visibility) { - if (visibility && !_visible) - _drawn = false; - _visible = visibility; -} - -bool GUIElement::visible() { - return _visible; -} - -void GUIElement::forceRedraw() { - _drawn = false; -} - -bool GUIElement::drawn() { - return _drawn; -} - -int GUIElement::getX() { - return _x; -} - -int GUIElement::getY() { - return _y; -} - -int GUIElement::getWidth() { - return _width; -} - -int GUIElement::getHeight() { - return _height; -} - -GUIElement::~GUIElement() { - delete _background; -} - -} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/GUIElement.h b/backends/platform/wince/CEgui/GUIElement.h deleted file mode 100644 index 57c6e321e7..0000000000 --- a/backends/platform/wince/CEgui/GUIElement.h +++ /dev/null @@ -1,67 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEGUI_GUIELEMENT_H -#define CEGUI_GUIELEMENT_H - -#include <windows.h> - -#include "common/scummsys.h" -#include "common/system.h" - -struct SDL_Surface; - -namespace CEGUI { - -class SDL_ImageResource; - -class GUIElement { -public: - bool setBackground(WORD backgroundReference); - void setVisible(bool visibility); - virtual void forceRedraw(); - virtual bool draw(SDL_Surface *surface); - virtual ~GUIElement(); - void move(int x, int y); - int getWidth(); - int getHeight(); - int getX(); - int getY(); - virtual bool action(int x, int y, bool pushed) = 0; - bool visible(); - bool drawn(); -protected: - GUIElement(int x = 0, int y = 0, int width = 0, int height = 0); - bool checkInside(int x, int y); - bool _visible; - SDL_ImageResource *_background; - int _x; - int _y; - bool _drawn; -private: - int _width; - int _height; -}; - -} // End of namespace CEGUI - -#endif diff --git a/backends/platform/wince/CEgui/ItemAction.cpp b/backends/platform/wince/CEgui/ItemAction.cpp deleted file mode 100644 index 89ca48efdc..0000000000 --- a/backends/platform/wince/CEgui/ItemAction.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "ItemAction.h" - -namespace CEGUI { - -ItemAction::ItemAction(WORD reference, GUI::ActionType action) : - PanelItem(reference) { - _action = action; - if (!GUI::Actions::Instance()->isEnabled(_action)) - _visible = false; -} - - -ItemAction::~ItemAction() { -} - -bool ItemAction::action(int x, int y, bool pushed) { - - if (checkInside(x, y) && _visible && pushed) { - GUI::Actions::Instance()->perform(_action, true); - GUI::Actions::Instance()->perform(_action, false); - return true; - } else - return false; -} - -} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/ItemAction.h b/backends/platform/wince/CEgui/ItemAction.h deleted file mode 100644 index 8de0046d4c..0000000000 --- a/backends/platform/wince/CEgui/ItemAction.h +++ /dev/null @@ -1,45 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEGUI_ITEMACTION_H -#define CEGUI_ITEMACTION_H - -#include "common/scummsys.h" -#include "common/system.h" - -#include "gui/Actions.h" -#include "CEgui/PanelItem.h" - -namespace CEGUI { - -class ItemAction : public PanelItem { -public: - ItemAction(WORD reference, GUI::ActionType action); - virtual ~ItemAction(); - virtual bool action(int x, int y, bool pushed); -private: - GUI::ActionType _action; -}; - -} // End of namespace CEGUI - -#endif diff --git a/backends/platform/wince/CEgui/ItemSwitch.cpp b/backends/platform/wince/CEgui/ItemSwitch.cpp deleted file mode 100644 index 7bb0a23a7b..0000000000 --- a/backends/platform/wince/CEgui/ItemSwitch.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "ItemSwitch.h" -#include "SDL_ImageResource.h" - -namespace CEGUI { - -void ItemSwitch::init(WORD referenceTrue, WORD referenceFalse) { - _backgroundTrue = _background; - _backgroundFalse = new SDL_ImageResource(); - if (!_backgroundFalse->load(referenceFalse)) { - delete _backgroundFalse; - delete _background; - _background = NULL; - _backgroundFalse = NULL; - } -} - -ItemSwitch::ItemSwitch(WORD referenceTrue, WORD referenceFalse, bool *item) : - PanelItem(referenceTrue) { - init(referenceTrue, referenceFalse); - _item = item; - _itemmax = -1; - if (!*_item) - _background = _backgroundFalse; -} - -ItemSwitch::ItemSwitch(WORD referenceTrue, WORD referenceFalse, int *item, int max) : - PanelItem(referenceTrue) { - init(referenceTrue, referenceFalse); - _itemmultiple = item; - _itemmax = max; - if (!*item) - _background = _backgroundFalse; -} - -ItemSwitch::~ItemSwitch() { - delete _backgroundFalse; -} - -bool ItemSwitch::action(int x, int y, bool pushed) { - - if (checkInside(x, y) && _visible && pushed) { - if (_itemmax <= 0) { - *_item = !*_item; - if (*_item) - _background = _backgroundTrue; - else - _background = _backgroundFalse; - - if (_panel) - _panel->forceRedraw(); - - return true; - } else { - *_itemmultiple = *_itemmultiple + 1; - if (*_itemmultiple > _itemmax) - *_itemmultiple = 0; - if (*_itemmultiple) - _background = _backgroundTrue; - else - _background = _backgroundFalse; - - if (_panel) - _panel->forceRedraw(); - - return true; - } - } else - return false; -} - -} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/ItemSwitch.h b/backends/platform/wince/CEgui/ItemSwitch.h deleted file mode 100644 index e54b4b1b99..0000000000 --- a/backends/platform/wince/CEgui/ItemSwitch.h +++ /dev/null @@ -1,55 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEGUI_ITEMSWITCH_H -#define CEGUI_ITEMSWITCH_H - -#include "common/scummsys.h" -#include "common/system.h" - -#include "Panel.h" -#include "EventsBuffer.h" - -using GUI::Key; - -namespace CEGUI { - -class SDL_ImageResource; - -class ItemSwitch : public PanelItem { -public: - ItemSwitch(WORD referenceTrue, WORD referenceFalse, bool *item); - ItemSwitch(WORD referenceTrue, WORD referenceFalse, int *item, int max); - virtual ~ItemSwitch(); - virtual bool action(int x, int y, bool pushed); -private: - void init(WORD referenceTrue, WORD referenceFalse); - bool *_item; - static bool _itemdummy; - int *_itemmultiple, _itemmax; - SDL_ImageResource *_backgroundTrue; - SDL_ImageResource *_backgroundFalse; -}; - -} // End of namespace CEGUI - -#endif diff --git a/backends/platform/wince/CEgui/Panel.cpp b/backends/platform/wince/CEgui/Panel.cpp deleted file mode 100644 index 273d06a054..0000000000 --- a/backends/platform/wince/CEgui/Panel.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "Panel.h" - -namespace CEGUI { - -Panel::Panel(int interleave_first, int interleave) : Toolbar() { - _interleave = interleave; - _currentItem = interleave_first; -} - - -bool Panel::add(const String &name, const PanelItem *item) { - _itemsMap[name] = (PanelItem *)item; - _itemsMap[name]->move(_currentItem, _y + 10); - _itemsMap[name]->setPanel(this); - _currentItem += _interleave; - - return true; -} - -bool Panel::draw(SDL_Surface *surface) { - ItemMap::const_iterator iterator; - if (!_drawn && _visible) { - GUIElement::draw(surface); - for (iterator = _itemsMap.begin(); iterator != _itemsMap.end(); ++iterator) { - ((GUIElement *)(iterator->_value))->draw(surface); - } - return true; - } else - return false; -} - -void Panel::forceRedraw() { - ItemMap::const_iterator iterator; - GUIElement::forceRedraw(); - for (iterator = _itemsMap.begin(); iterator != _itemsMap.end(); ++iterator) - ((GUIElement *)(iterator->_value))->forceRedraw(); -} - -bool Panel::action(int x, int y, bool pushed) { - ItemMap::const_iterator iterator; - bool result = false; - if (!_visible || !checkInside(x, y)) - return false; - - for (iterator = _itemsMap.begin(); !result && iterator != _itemsMap.end(); ++iterator) - result = ((GUIElement *)(iterator->_value))->action(x, y, pushed); - return result; -} - -void Panel::clear() { - _itemsMap.clear(); -} - -Panel::~Panel() { - _itemsMap.clear(); -} - -} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/Panel.h b/backends/platform/wince/CEgui/Panel.h deleted file mode 100644 index db38751073..0000000000 --- a/backends/platform/wince/CEgui/Panel.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEGUI_PANEL_H -#define CEGUI_PANEL_H - -#include "common/scummsys.h" -#include "common/system.h" -#include "common/hashmap.h" -#include "common/str.h" -#include "common/config-manager.h" - -#include "PanelItem.h" -#include "Toolbar.h" - -using Common::String; -using Common::HashMap; - -namespace CEGUI { - -class Panel : public Toolbar { -public: - Panel(int interleave_first, int interleave); - virtual bool draw(SDL_Surface *surface); - virtual ~Panel(); - bool add(const String &name, const PanelItem *item); - void clear(); - virtual void forceRedraw(); - virtual bool action(int x, int y, bool pushed); -private: - - typedef HashMap<String, PanelItem *, Common::IgnoreCase_Hash , Common::IgnoreCase_EqualTo> ItemMap; - - ItemMap _itemsMap; - int _interleave; - int _currentItem; -}; - -} // End of namespace CEGUI - -#endif diff --git a/backends/platform/wince/CEgui/PanelItem.cpp b/backends/platform/wince/CEgui/PanelItem.cpp deleted file mode 100644 index 186b5161ef..0000000000 --- a/backends/platform/wince/CEgui/PanelItem.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "PanelItem.h" - -namespace CEGUI { - -PanelItem::PanelItem(WORD reference) : GUIElement() { - setBackground(reference); - _panel = NULL; -} - - -PanelItem::~PanelItem() { -} - -bool PanelItem::action(int x, int y, bool pushed) { - return false; -} - -void PanelItem::setPanel(Panel *panel) { - _panel = panel; -} - -} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/PanelItem.h b/backends/platform/wince/CEgui/PanelItem.h deleted file mode 100644 index a0a72c2525..0000000000 --- a/backends/platform/wince/CEgui/PanelItem.h +++ /dev/null @@ -1,48 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEGUI_PANELITEM_H -#define CEGUI_PANELITEM_H - -#include "common/scummsys.h" -#include "common/system.h" - -#include "Toolbar.h" - -namespace CEGUI { - -class Panel; - -class PanelItem : public GUIElement { - friend class Panel; -public: - PanelItem(WORD reference); - virtual ~PanelItem(); - virtual bool action(int x, int y, bool pushed); -protected: - void setPanel(Panel *panel); - Panel *_panel; -}; - -} // End of namespace CEGUI - -#endif diff --git a/backends/platform/wince/CEgui/PanelKeyboard.cpp b/backends/platform/wince/CEgui/PanelKeyboard.cpp deleted file mode 100644 index 34ba8d6473..0000000000 --- a/backends/platform/wince/CEgui/PanelKeyboard.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "backends/platform/sdl/sdl-sys.h" -#include "PanelKeyboard.h" - -namespace CEGUI { - -const char KEYBOARD_MAPPING_ALPHA[][14] = { {"abcdefghijklm"}, {"nopqrstuvwxyz"} }; -const char KEYBOARD_MAPPING_NUMERIC[][6] = { {"12345"}, {"67890"} }; -const int KEYBOARD_MAPPING_SPECIAL[][3][2] = { { {1, SDLK_ESCAPE}, {224, SDLK_UP}, {32, SDLK_SPACE} }, - { {224, SDLK_LEFT}, {224, SDLK_DOWN}, {224, SDLK_RIGHT} } -}; - -PanelKeyboard::PanelKeyboard(WORD reference) : Toolbar() { - setBackground(reference); - _state = false; - _lastKey.setKey(0); -} - - -PanelKeyboard::~PanelKeyboard() { -} - -bool PanelKeyboard::action(int x, int y, bool pushed) { - Key key; - - if (checkInside(x, y)) { - int keyAscii = 0; - int keyCode = 0; - if (x < 185) { - // Alpha selection - keyCode = keyAscii = KEYBOARD_MAPPING_ALPHA[y >= _y + 20][((x + 10) / 14) - 1]; - } else if (x >= 186 && x <= 255) { - // Numeric selection - keyCode = keyAscii = KEYBOARD_MAPPING_NUMERIC[y >= _y + 20][((x - 187 + 10) / 14) - 1]; - } else if (x >= 258 && x <= 300) { - // Special keys - keyAscii = KEYBOARD_MAPPING_SPECIAL[y >= _y + 20][((x - 259 + 10) / 14) - 1][0]; - keyCode = KEYBOARD_MAPPING_SPECIAL[y >= _y + 20][((x - 259 + 10) / 14) - 1][1]; - } else if (x >= 302 && x <= 316) { - if (y < _y + 20) { - // Backspace - keyAscii = VK_BACK; - keyCode = keyAscii; - } else { - // Enter - keyAscii = 13; - keyCode = 13; - } - } - - if (keyAscii != 0) { - if (_state && pushed && keyCode != _lastKey.keycode()) // if cursor is still down and off the current key - return false; - else if (_state && !pushed && keyCode != _lastKey.keycode()) { // cursor is up but off the current key - keyAscii = _lastKey.ascii(); - keyCode = _lastKey.keycode(); - } - _state = pushed; - _lastKey.setKey(keyAscii, tolower(keyCode)); - - key.setKey(keyAscii, tolower(keyCode)); - return EventsBuffer::simulateKey(&key, pushed); - } else if (_state && !pushed) { // cursor is in some forbidden region and is up - _state = false; - key = _lastKey; - return EventsBuffer::simulateKey(&key, false); - } else - return false; - } else if (_state && !pushed) { // cursor left the keyboard area and is up - _state = false; - key = _lastKey; - return EventsBuffer::simulateKey(&key, false); - } else - return false; -} - -} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/PanelKeyboard.h b/backends/platform/wince/CEgui/PanelKeyboard.h deleted file mode 100644 index a0daca81e3..0000000000 --- a/backends/platform/wince/CEgui/PanelKeyboard.h +++ /dev/null @@ -1,49 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEGUI_PANELKEYBOARD_H -#define CEGUI_PANELKEYBOARD_H - -#include "common/scummsys.h" -#include "common/system.h" - -#include "Toolbar.h" -#include "EventsBuffer.h" - -using GUI::Key; -using CEKEYS::EventsBuffer; - -namespace CEGUI { - -class PanelKeyboard : public Toolbar { -public: - PanelKeyboard(WORD reference); - virtual ~PanelKeyboard(); - virtual bool action(int x, int y, bool pushed); -private: - bool _state; - Key _lastKey; -}; - -} // End of namespace CEGUI - -#endif diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.cpp b/backends/platform/wince/CEgui/SDL_ImageResource.cpp deleted file mode 100644 index ec430fc848..0000000000 --- a/backends/platform/wince/CEgui/SDL_ImageResource.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "backends/platform/sdl/sdl-sys.h" -#include "SDL_ImageResource.h" - -namespace CEGUI { - -SDL_ImageResource::SDL_ImageResource() : - _surface(0) { -} - -SDL_Surface *SDL_ImageResource::load(WORD resourceID) { - HRSRC resource; - HGLOBAL resourceGlobal; - LPVOID resourcePointer; - DWORD resourceSize; - SDL_RWops *surfaceData; - HMODULE moduleHandle; - - moduleHandle = GetModuleHandle(NULL); - resource = FindResource(moduleHandle, MAKEINTRESOURCE(resourceID), TEXT("BINARY")); - if (!resource) - return NULL; - resourceSize = SizeofResource(moduleHandle, resource); - if (!resourceSize) - return NULL; - resourceGlobal = LoadResource(moduleHandle, resource); - if (!resourceGlobal) - return NULL; - resourcePointer = LockResource(resourceGlobal); - if (!resourcePointer) - return NULL; - - surfaceData = SDL_RWFromMem(resourcePointer, resourceSize); - if (!surfaceData) - return NULL; - _surface = SDL_LoadBMP_RW(surfaceData, 1); - - return _surface; -} - -SDL_Surface *SDL_ImageResource::get() { - return _surface; -} - -int SDL_ImageResource::height() { - if (_surface) - return _surface->h; - return 0; -} - -int SDL_ImageResource::width() { - if (_surface) - return _surface->w; - return 0; -} - -SDL_ImageResource::~SDL_ImageResource() { - if (_surface) - SDL_FreeSurface(_surface); -} - -} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.h b/backends/platform/wince/CEgui/SDL_ImageResource.h deleted file mode 100644 index 4fd7932743..0000000000 --- a/backends/platform/wince/CEgui/SDL_ImageResource.h +++ /dev/null @@ -1,47 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEGUI_SDL_IMAGERESOURCE_H -#define CEGUI_SDL_IMAGERESOURCE_H - -#include "common/scummsys.h" -#include "common/system.h" - -struct SDL_Surface; - -namespace CEGUI { - -class SDL_ImageResource { -public: - SDL_ImageResource(); - SDL_Surface *load(WORD resourceID); - SDL_Surface *get(); - int height(); - int width(); - virtual ~SDL_ImageResource(); -private: - SDL_Surface *_surface; -}; - -} // End of namespace CEGUI - -#endif diff --git a/backends/platform/wince/CEgui/Toolbar.cpp b/backends/platform/wince/CEgui/Toolbar.cpp deleted file mode 100644 index 9e04a30210..0000000000 --- a/backends/platform/wince/CEgui/Toolbar.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "Toolbar.h" - -namespace CEGUI { - -// Not to be drawn on game screen ! -Toolbar::Toolbar() : GUIElement(0, 0, 320, 40) { -} - - -Toolbar::~Toolbar() { -} - -} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/Toolbar.h b/backends/platform/wince/CEgui/Toolbar.h deleted file mode 100644 index d0ac2cdcb3..0000000000 --- a/backends/platform/wince/CEgui/Toolbar.h +++ /dev/null @@ -1,43 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEGUI_TOOLBAR_H -#define CEGUI_TOOLBAR_H - -#include "common/scummsys.h" - -#include "GUIElement.h" - -namespace CEGUI { - -class Toolbar : public GUIElement { -public: - virtual ~Toolbar(); - virtual bool action(int x, int y, bool pushed) = 0; -protected: - Toolbar(); - -}; - -} // End of namespace CEGUI - -#endif diff --git a/backends/platform/wince/CEgui/ToolbarHandler.cpp b/backends/platform/wince/CEgui/ToolbarHandler.cpp deleted file mode 100644 index 534b338cdb..0000000000 --- a/backends/platform/wince/CEgui/ToolbarHandler.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "backends/platform/sdl/sdl-sys.h" -#include "ToolbarHandler.h" - -namespace CEGUI { - -ToolbarHandler::ToolbarHandler(): - _current(""), _active(NULL) { -} - - -bool ToolbarHandler::add(const String &name, const Toolbar &toolbar) { - _toolbarMap[name] = (Toolbar *)&toolbar; - - if (!_active) { - _active = &((Toolbar &)toolbar); - _current = name; - } - - return true; -} - -String ToolbarHandler::activeName() { - return _current; -} - -bool ToolbarHandler::setActive(const String &name) { - if (!_toolbarMap.contains(name)) - return false; - if (_current == name) - return true; - _active->action(0, 0, false); // make sure any items are unpushed when changing toolbars (e.g. forced VK->main panel) - _current = name; - _active = _toolbarMap[name]; - _active->forceRedraw(); - return true; -} - -bool ToolbarHandler::action(int x, int y, bool pushed) { - if (_active && _active->visible()) { - // FIXME ! - if (_offset > 240) - return _active->action(x / 2, (y - _offset) / 2, pushed); - else - return _active->action(x, y - _offset, pushed); - } else - return false; -} - -void ToolbarHandler::setVisible(bool visible) { - if (_active) - _active->setVisible(visible); -} - -bool ToolbarHandler::visible() { - if (_active) - return _active->visible(); - else - return false; -} - -void ToolbarHandler::forceRedraw() { - if (_active) - _active->forceRedraw(); -} - -bool ToolbarHandler::drawn() { - if (_active) - return _active->drawn(); - else - return false; -} - -bool ToolbarHandler::draw(SDL_Surface *surface, SDL_Rect *rect) { - if (_active) { - bool result = _active->draw(surface); - if (result) { - rect->x = _active->getX(); - rect->y = _active->getY(); - rect->w = _active->getWidth(); - rect->h = _active->getHeight(); - } - return result; - } else - return false; -} - -void ToolbarHandler::setOffset(int offset) { - _offset = offset; -} - -int ToolbarHandler::getOffset() { - return _offset; -} - -Toolbar *ToolbarHandler::active() { - return _active; -} - -ToolbarHandler::~ToolbarHandler() { - _toolbarMap.clear(); -} - -} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/ToolbarHandler.h b/backends/platform/wince/CEgui/ToolbarHandler.h deleted file mode 100644 index 36f4022bd8..0000000000 --- a/backends/platform/wince/CEgui/ToolbarHandler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEGUI_TOOLBARHANDLER_H -#define CEGUI_TOOLBARHANDLER_H - -#include "common/scummsys.h" -#include "common/system.h" -#include "common/str.h" -#include "common/hashmap.h" -#include "common/config-manager.h" - -#include "Toolbar.h" - -using Common::String; -using Common::HashMap; - -namespace CEGUI { - -class ToolbarHandler { -public: - ToolbarHandler(); - bool add(const String &name, const Toolbar &toolbar); - bool setActive(const String &name); - bool action(int x, int y, bool pushed); - void setVisible(bool visible); - bool visible(); - String activeName(); - void forceRedraw(); - void setOffset(int offset); - int getOffset(); - bool draw(SDL_Surface *surface, SDL_Rect *rect); - bool drawn(); - Toolbar *active(); - virtual ~ToolbarHandler(); -private: - - HashMap<String, Toolbar *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _toolbarMap; - String _current; - Toolbar *_active; - int _offset; -}; - -} // End of namespace CEGUI - -#endif diff --git a/backends/platform/wince/CEkeys/CEKeys.h b/backends/platform/wince/CEkeys/CEKeys.h deleted file mode 100644 index 31f5ba839c..0000000000 --- a/backends/platform/wince/CEkeys/CEKeys.h +++ /dev/null @@ -1,23 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "EventsBuffer.h" diff --git a/backends/platform/wince/CEkeys/EventsBuffer.cpp b/backends/platform/wince/CEkeys/EventsBuffer.cpp deleted file mode 100644 index b4fdc0010d..0000000000 --- a/backends/platform/wince/CEkeys/EventsBuffer.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "backends/platform/sdl/sdl-sys.h" - -#include "EventsBuffer.h" - -namespace CEKEYS { - -bool EventsBuffer::simulateKey(GUI::Key *key, bool pushed) { - SDL_Event ev = {0}; - - if (!key->keycode()) - key->setKey(key->ascii(), key->ascii()); - else if (!key->ascii()) - key->setKey(key->keycode()); - - ev.type = (pushed ? SDL_KEYDOWN : SDL_KEYUP); - ev.key.keysym.unicode = (SDLMod)key->flags(); // HACK: put the flags into the unused unicode field - ev.key.keysym.sym = (SDLKey)key->keycode(); - ev.key.keysym.mod = KMOD_RESERVED; - return (SDL_PushEvent(&ev) == 0); -} - -bool EventsBuffer::simulateMouseMove(int x, int y) { - SDL_Event ev = {0}; - - ev.type = SDL_MOUSEMOTION; - ev.motion.x = x; - ev.motion.y = y; - return (SDL_PushEvent(&ev) == 0); -} - -bool EventsBuffer::simulateMouseLeftClick(int x, int y, bool pushed) { - SDL_Event ev = {0}; - static bool state = false; - - if (pushed == state) return 0; - state = pushed; - ev.type = (pushed ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP); - ev.button.button = SDL_BUTTON_LEFT; - ev.button.x = x; - ev.button.y = y; - return (SDL_PushEvent(&ev) == 0); -} - -bool EventsBuffer::simulateMouseRightClick(int x, int y, bool pushed) { - SDL_Event ev = {0}; - static bool state = false; - - if (pushed == state) return 0; - state = pushed; - ev.type = (pushed ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP); - ev.button.button = SDL_BUTTON_RIGHT; - ev.button.x = x; - ev.button.y = y; - return (SDL_PushEvent(&ev) == 0); -} -} diff --git a/backends/platform/wince/CEkeys/EventsBuffer.h b/backends/platform/wince/CEkeys/EventsBuffer.h deleted file mode 100644 index 6c1b12cc24..0000000000 --- a/backends/platform/wince/CEkeys/EventsBuffer.h +++ /dev/null @@ -1,44 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CEKEYS_EVENTSBUFFER_H -#define CEKEYS_EVENTSBUFFER_H - -#include "common/scummsys.h" -#include "common/system.h" -#include "common/list.h" - -#include "gui/Key.h" - -namespace CEKEYS { - -class EventsBuffer { -public: - static bool simulateKey(GUI::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); - -}; -} - -#endif diff --git a/backends/platform/wince/Makefile b/backends/platform/wince/Makefile deleted file mode 100644 index f0606c9ba1..0000000000 --- a/backends/platform/wince/Makefile +++ /dev/null @@ -1,255 +0,0 @@ -# ScummVM Makefile for Windows CE port -# Uses the cegcc toolchain. For build info check out the wiki: https://wiki.scummvm.org - -######################################################################## -## Do you want a debug build or not? - -#WINCE_DEBUG_BUILD = 1 -#UNOPTIMIZED_BUILD = 1 - -######################################################################## -## Do you want a build using plugins? - -#DYNAMIC_MODULES = 1 -# TODO: You'll need to change STATIC_PLUGIN to DYNAMIC_PLUGIN below - -######################################################################## -## Enable whichever engines you want here - -ENABLE_SCUMM = STATIC_PLUGIN -ENABLE_SCUMM_7_8 = 1 -ENABLE_HE = 1 -ENABLE_SKY = STATIC_PLUGIN -ENABLE_QUEEN = STATIC_PLUGIN -ENABLE_GOB = STATIC_PLUGIN -ENABLE_LURE = STATIC_PLUGIN -ENABLE_CINE = STATIC_PLUGIN -ENABLE_SAGA = STATIC_PLUGIN -ENABLE_IHNM = 1 -#ENABLE_SAGA2 = 1 -ENABLE_KYRA = STATIC_PLUGIN -ENABLE_AGI = STATIC_PLUGIN -ENABLE_AGOS = STATIC_PLUGIN -ENABLE_SWORD1 = STATIC_PLUGIN -ENABLE_SWORD2 = STATIC_PLUGIN -ENABLE_TOUCHE = STATIC_PLUGIN -ENABLE_PARALLACTION = STATIC_PLUGIN -ENABLE_DRASCULA = STATIC_PLUGIN -ENABLE_GROOVIE = STATIC_PLUGIN -ENABLE_TUCKER = STATIC_PLUGIN -ENABLE_TINSEL = STATIC_PLUGIN -ENABLE_CRUISE = STATIC_PLUGIN -ENABLE_MADE = STATIC_PLUGIN -#ENABLE_SCI = STATIC_PLUGIN -#ENABLE_M4 = STATIC_PLUGIN - -######################################################################## -## Pick which libraries you want to use here - -USE_MAD = 1 -#USE_TREMOR = 1 -USE_TREMOLO = 1 -#USE_FLAC = 1 -USE_ZLIB = 1 - -######################################################################## -## For remote deployment (copying the built files onto a device -## automatically), we need to know various things, like which -## tools to use. I use pput and pdel from -## http://www.xs4all.nl/~itsme/projects/xda/tools.html -## and I keep my installation on the storage card, but other people -## may prefer other things. - -REMOTE_COPY = pput -REMOTE_DELETE = pdel -REMOTE_DIRECTORY = \Storage Card\Program Files\Scummvm - -######################################################################## -## You're probably not going to want to change these defines... - -USE_SCALERS = 1 -USE_HQ_SCALERS = 1 -USE_ARM_SOUND_ASM = 1 -USE_ARM_SMUSH_ASM = 1 -USE_ARM_GFX_ASM = 1 -USE_ARM_COSTUME_ASM = 1 -USE_ARM_SCALER_ASM = 1 - -######################################################################## -## Hopefully you shouldn't need to change anything below here. ## -######################################################################## - - -srcdir = ../../.. -VPATH = $(srcdir) - -CXX = arm-wince-mingw32ce-g++ -LD = arm-wince-mingw32ce-g++ -AR = arm-wince-mingw32ce-ar cru -RANLIB = arm-wince-mingw32ce-ranlib -STRIP = arm-wince-mingw32ce-strip -WINDRES= arm-wince-mingw32ce-windres -MKDIR = mkdir -p -RM = rm -f -RM_REC = rm -rf -ECHO = echo -n -CAT = cat -AS = arm-wince-mingw32ce-as - -######################################################################## -## Set up defines, includes, cflags etc - -DEFINES := -D_WIN32_WCE=300 -D__ARM__ -D_ARM_ -DUNICODE -DSCUMM_NEED_ALIGNMENT -DEFINES += -DFPM_DEFAULT - -DEFINES += -DNONSTANDARD_PORT -DEFINES += -DWIN32 -DEFINES += -Dcdecl= -D__cdecl__= -Wno-multichar - -INCLUDES := -I$(srcdir) -I. -I$(srcdir)/engines -Imissing/gcc -Ilibs/include -Ilibs/include/sdl -ICEgui -ICEkeys - -CFLAGS := -ifndef UNOPTIMIZED_BUILD -CFLAGS += -O3 -fno-inline-functions -march=armv4 -mtune=xscale -endif - -LDFLAGS := -Wl,-Map,scummvm.exe.map -Wl,--stack,65536 -LIBS := -Llibs/lib -lSDL - -ifdef WINCE_DEBUG_BUILD -DEFINES += -DDEBUG -DUSE_WINDBG -CFLAGS += -g -LDFLAGS += -debug -endif - -ifdef USE_ZLIB -DEFINES += -DUSE_ZLIB -LIBS += -lzlib -endif - -ifdef USE_MAD -DEFINES += -DUSE_MAD -LIBS += -lmad -endif - -ifdef USE_TREMOR -DEFINES += -DUSE_TREMOR -DUSE_VORBIS -LIBS += -ltremorce -endif - -ifdef USE_TREMOLO -DEFINES += -DUSE_TREMOR -DUSE_VORBIS -DUSE_TREMOLO -INCLUDES += -Ilibs/include/tremolo -LIBS += -llibTremolo -endif - -ifdef USE_FLAC -DEFINES += -DUSE_FLAC -LIBS += -lFLAC -endif - -ifdef USE_SCALERS -DEFINES += -DUSE_SCALERS -endif - -ifdef USE_HQ_SCALERS -DEFINES += -DUSE_HQ_SCALERS -endif - -ifdef USE_ARM_SMUSH_ASM -DEFINES += -DUSE_ARM_SMUSH_ASM -endif - -ifdef USE_ARM_GFX_ASM -DEFINES += -DUSE_ARM_GFX_ASM -endif - -ifdef USE_ARM_COSTUME_ASM -DEFINES += -DUSE_ARM_COSTUME_ASM -endif - -ifdef USE_ARM_SCALER_ASM -DEFINES += -DUSE_ARM_SCALER_ASM -endif - -######################################################################## -# Targets follow here - -EXECUTABLE = scummvm.exe -CXXFLAGS := $(CFLAGS) -OBJS := -MODULE_DIRS += ./ -DEPDIR = .deps - -OBJS += CEActionsPocket.o CEDevice.o CEScaler.o \ - CEActionsSmartphone.o CELauncherDialog.o wince-sdl.o -OBJS += CEgui/GUIElement.o CEgui/Panel.o CEgui/SDL_ImageResource.o \ - CEgui/ItemAction.o CEgui/PanelItem.o CEgui/Toolbar.o \ - CEgui/ItemSwitch.o CEgui/PanelKeyboard.o CEgui/ToolbarHandler.o -OBJS += CEkeys/EventsBuffer.o -OBJS += $(srcdir)/gui/Actions.o $(srcdir)/gui/Key.o $(srcdir)/gui/KeysDialog.o -OBJS += ../sdl/sdl.o ../sdl/graphics.o ../sdl/events.o ../sdl/hardwarekeys.o -OBJS += missing/missing.o -OBJS += smartLandScale.o -ifndef DYNAMIC_MODULES -OBJS += PocketSCUMM.o -endif - -ifdef DYNAMIC_MODULES -EXECUTABLE = scummvm.dll -PLUGIN_PREFIX := -PLUGIN_SUFFIX := .dll -PLUGIN_EXTRA_DEPS = $(EXECUTABLE) -CXXFLAGS += -DDYNAMIC_MODULES -PLUGIN_LDFLAGS := -shared -L. -lscummvm -Llibs/lib -PRE_OBJS_FLAGS := -Wl,--whole-archive -POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-implib,./libscummvm.a -shared -endif - -include $(srcdir)/Makefile.common - -######################################################################## -## Our top level target, and what we deploy depends on whether we are -## building the plugin version or not... -ifdef DYNAMIC_MODULES - -all: dist-plugins - -deploy: deploy-plugins deploy-exe - -else - -all: dist - -deploy: deploy-exe - -endif - -dist: PocketSCUMM.o $(EXECUTABLE) - -dist-plugins: $(EXECUTABLE) plugins PocketSCUMM.o plugins-stub - -plugins-stub: stub.o - $(CXX) stub.o PocketSCUMM.o -L. -lscummvm -o scummvm.exe - -PocketSCUMM.o: PocketSCUMM.rc - $(WINDRES) $*.rc $@ - -all-clean: clean - $(RM) PocketSCUMM.o stub.o - -deploy-plugins: dist-plugins - @echo Deploying DLLs - -$(REMOTE_MKDIR) "$(REMOTE_DIRECTORY)" - -$(REMOTE_DELETE) "$(REMOTE_DIRECTORY)\*.dll" - $(REMOTE_COPY) plugins/*.dll "$(REMOTE_DIRECTORY)" - $(REMOTE_COPY) scummvm.dll "$(REMOTE_DIRECTORY)" - -deploy-exe: dist - @echo Deploying modern theme - errors are normal here! - -$(REMOTE_MKDIR) "$(REMOTE_DIRECTORY)" - @-$(REMOTE_COPY) ../../../gui/themes/modern.ini "$(REMOTE_DIRECTORY)" - @-$(REMOTE_COPY) ../../../gui/themes/modern.zip "$(REMOTE_DIRECTORY)" - @echo Deploying EXE - -$(REMOTE_DELETE) "$(REMOTE_DIRECTORY)\scummvm.exe" - $(REMOTE_COPY) scummvm.exe "$(REMOTE_DIRECTORY)" diff --git a/backends/platform/wince/PocketSCUMM.rc b/backends/platform/wince/PocketSCUMM.rc deleted file mode 100644 index 1e22a68c3d..0000000000 --- a/backends/platform/wince/PocketSCUMM.rc +++ /dev/null @@ -1,24 +0,0 @@ -#include "resource.h" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -IDI_POCKETSCUMM ICON DISCARDABLE "images/scumm_icon.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// BINARY -// - -PANEL_GENERIC BINARY DISCARDABLE "images/panelbig.bmp" -PANEL_KEYBOARD BINARY DISCARDABLE "images/keyboard.bmp" -ITEM_SKIP BINARY DISCARDABLE "images/Action.bmp" -ITEM_OPTIONS BINARY DISCARDABLE "images/DiskwFolder.bmp" -ITEM_SOUND_ON BINARY DISCARDABLE "images/SoundOn.bmp" -ITEM_SOUND_OFF BINARY DISCARDABLE "images/SoundOff.bmp" -ITEM_VIEW_PORTRAIT BINARY DISCARDABLE "images/MonkeyPortrait.bmp" -ITEM_VIEW_LANDSCAPE BINARY DISCARDABLE "images/MonkeyLandscape.bmp" -ITEM_BINDKEYS BINARY DISCARDABLE "images/bindkeys.bmp" -HI_RES_AWARE CEUX {1} diff --git a/backends/platform/wince/README-WinCE.txt b/backends/platform/wince/README-WinCE.txt deleted file mode 100644 index 0626f7b022..0000000000 --- a/backends/platform/wince/README-WinCE.txt +++ /dev/null @@ -1,823 +0,0 @@ -ScummVM Windows CE FAQ -Last updated: 2011-12-05 -Release version: x.x.x ------------------------------------------------------------------------- - -New in this version -------------------- -x.x.x: -- Removed FLAC support for audio datafiles (now for real, this was originally - announced for 1.0.0, but the library was still included until now). This is - done because of size constrains of the executable and also FLAC on a mobile - device isn't really recommended - so please use MP3 or Ogg for your audio - datafiles. - -1.4.0: -- Changed the memory management so that it is finally possible to break the - 32MB per process barrier on Windows CE. It should be possible now (finally) - to play nearly every game with the "big" binary (scummvm.exe, which includes - all game engines). -- Changed default values for "high_sample_rate" & "FM_high_quality" to "true" - as most devices today are fast enough to handle this. It's still possible to - set this to "false" if you have a slower device. -- Fix for TeenAgent & Hugo engines (both weren't running at all, crashed right - at the beginning) -- Discworld 2 is now playable (works now because of the new memory management) -- Replaced the game mass-adding functionality with the functionality used on - all other platforms. It now shows progress while searching for games. -- Mapped "Skip" button to F10 for AGI games -- Mapped "Multi Function" to F10 in Simon 1 & 2 (enables hotspot highlighting) - -1.3.1: -- Fix for Normal2xAspect scaler which was causing screen update issues in some - games. -- Fix for Normal1xAspect scaler which caused problems in the bottom part of the - screen when toolbar was hidden. -- Fix for freelook mode. -- Fix for timer manager, caused timing issues in some games. -- Activated runtime language detection for ScummVM gui. -- Toolbar is now hidden when returning to the game list. -- Double-tap right-click emulation is now turned off for SCI games by default. -- Added a new option "no_doubletap_paneltoggle" for scummvm.ini to disable - toolbar toggling when double-tapping on the top part of the screen. -- SDL library related fixes: - * Fix for screen/mouse-cursor rotation issues (fixes erratic touchscreen - behaviour) - * Fix for hardware keyboard on some devices (HTC Touch Pro, etc.) - -1.3.0: -This is the first official Windows CE release since 1.1.1. - -The following new engines are now included (changes since last WinCE release): - - Draci Engine (Dragon History) - - Hugo Engine (Hugo Trilogy) - - Mohawk Engine (Myst, Riven, Living Book games & Where in Time is Carmen - Sandiego?) - - SCI Engine (Sierra SCI games, see main README for a list of supported games) - - Toon Engine (Toonstruck) - -Also, there are now 4 binaries in this distribution, a single executable -which contains all engines (for devices with enough memory) and 3 smaller -binaries which contain only some of the engines. The following lists all -executables and the engines they contain: - -scummvm.exe: - - all supported engines -scummvm1.exe: - - scumm, agi, cruise, draci, lure, queen, sky, sword1, tinsel, touche -scummvm2.exe: - - agos, cine, drascula, gob, groovie, kyra, made, parallaction, saga, - teenagent, tucker -scummvm3.exe: - - hugo, mohawk, sci, sword2, toon, tsage - -There are no other port specific changes. - -1.2.1: -(Note: No official 1.2.1 release) - -1.2.0: -(Note: No official 1.2.0 release) - -1.1.1: -Fix to the Normal2xAspect scaler that was causing crashes. - -1.1.0: -The TeenAgent engine is now included, but there are no other port specific -changes since 1.0.0. - -This are 3 binaries in this distribution. Combining all the engines into a -single executable produces something that is too large to run on most -devices. We have therefore split the engines roughly into two and built 2 -separate exes as follows: - -scummvm1.exe: - - scumm, sword1, sword2, queen, sky, lure, agi, touche, tinsel, cruise -scummvm2.exe: - - gob, cine, saga, kyra, agos, parallaction, drascula, groovie, tucker, made, - teenagent - -For those lucky enough to have devices with enough memory we also have a -combined executable scummvm.exe which contains all of those engines. - -1.0.0: -(Note: No changes since 1.0.0rc1) -This version features optimized ARM assembly versions for the Smartphone, -Normal2x and Normal2xAspect scalers, courtesy of Robin Watts. There should -be a speed improvement when using these scalers. - -Also new is the aspect 2x upscaling mode, which is auto detected and used -when the scaler is set to (normal) 2x mode and the panel is hidden. Hence, -a 320x200 game running on a VGA or higher resolution device will be -aspect scaled to fill the 640x480 screen. - -Be aware that Discworld 2 tries to allocate a big chunk of memory (10 MB) -and this will fail on many devices (file under the not enough memory -category). - -From this version on, we're dropping support for FLAC and MPEG-2. The first -is a pain to maintain, while the second has been gradually phased out in -scummvm. Be sure to update your add-on packs and/or recompress your sound. - - ------------------------------------------------------------------------- - -This document is intended to give common answers to specific ScummVM -issues on Windows CE, in 3 sections - * "General questions" : browse this section to get started and see - general issues - * "Game specific questions" : lists some common game specific issues - * "Support and links" : how to get support if you're still puzzled - ------------------------------------------------------------------------- -General questions ------------------------------------------------------------------------- - -Which devices are supported ? ------------------------------ - -Official build --------------- - -The official build is based on the ARM architecture and should work with any -Pocket PC 2002, Pocket PC 2003, Pocket PC 2003 SE, Smartphone 2002, -Smartphone 2003 or Windows Mobile 5 and 6 based device. It is known to work -on Pocket PC 2000 devices, but it has not been officially tested. - -Support for old ARM architectures (Handheld PCs, Palm Size PCs) and other CPUs -(MIPS, SH3) is discontinued. Feel free to generate builds for these -architectures and contact us to include them on ScummVM website. - -Games supported ---------------- - -The Windows CE port of ScummVM supports all available game engines. - -ScummVM distinguishes devices based on two characteristics: Type and resolution. -Supported types of devices are Smartphones (usually no stylus) and Pocket PCs -(stylus). The supported resolutions are 176x220 (Smartphone), 240x240 (QVGA -square), 240x320 (QVGA), 320x240 (QVGA landscape), 480x640 (VGA). Devices with -resolutions larger than VGA should also be supported with automatic screen -centering. - -* Low resolution Smartphones (176x220) - -Support is only provided for all 320x200 or 320x240 games. The font can get -hard to read (you should prefer talkie games, or wear glasses :-P) -Games with 640x480 resolution such as COMI or BSWORD cannot be scaled down -to this resolution and still be playable. - -* QVGA square devices (240x240) - -Only 320x200 or 320x240 games are supported due to lack of downsampling scaler. - -* QVGA Pocket PCs or Smartphones (240x320 or 320x240) - -All games are playable in these devices. Landscape devices may not be able to -rotate the screen around. - -* VGA (640x480) or higher Pocket PCs - -All non VGA games should work properly on these devices. They can be resized -with different scalers. Moreover, VGA games will be displayed in true VGA mode. - -Partial / Discontinued support ------------------------------- - -Support for the following devices is not complete, not working properly or -discontinued because the device is now obsolete. Feel free to contribute and -improve the port for your favorite device, or use the last release built with -the previous port architecture (0.5.1) which was less resource hungry and -supported more exotic devices. - -* "Palleted" devices (non "true color") - -These devices will be supported through the GDI layer which will slow down the -games a lot. You can try to disable the music/sound effects to get a better -game experience. - -* "Mono" devices - -I don't even think anything will be displayed on these devices :) you can try -and report your success ... - -How do I install ScummVM for Windows CE ? ------------------------------------------ - -Simple! Unpack the release package on your desktop pc, then copy all its -contents to a folder on your device. Typically, you should at least have -scummvm.exe, modern.ini and modern.zip in the same directory. Finally, upload -your beloved games and fire it up :-) - -Some devices (like Pocket PC 2000) require GAPI to be present. - -How do I install a game ? -------------------------- - -You'll at least need to copy all the data files from your game, in a -sub-directory of your game directory. - -You'll need to put the data files in a directory named after ScummVM game -name (see "Supported Games" section in ScummVM readme) for the games having -"generic" data files (.LFL files). Recent games can be put in any directory. - -You can compress the multimedia files (sound/video) as described in the -ScummVM readme. - -You can compress the audio tracks of Loom or Monkey Island 1 as described in -the ScummVM readme. If you are running these games on a slow device with Ogg -Vorbis compression, it's recommended to sample the files to 11 kHz (this sample -rate is not supported by other versions of ScummVM). - -If you need more details, you can check SirDave's mini-manual online available -at: https://forums.scummvm.org/viewtopic.php?t=936 -and at: http://www.pocketmatrix.com/forums/viewtopic.php?t=8606 - -How do I run a game ? ---------------------- - -If it's the first time you're running ScummVM for Windows CE, have installed or -removed games, you need to rescan your game directory. - * Select Add Game, tap the root directory of your games, and tap "Yes" to begin - an automatic scan of the installed games. - -Usually all games are detected and you can start playing right away. If your -game is not detected check its directory name and your data files. - -To play a game, tap on its name then tap the "Start" button or double tap its -name. - -How do I play a game on a Pocket PC or Handheld PC device ? ------------------------------------------------------------ - -The stylus is your mouse cursor, and a tap is a left mouse button click. - -As the Pocket PC lacks some keys, a toolbar is displayed at the bottom of the -screen to make the most common functions just a tap away - * The disk icon opens ScummVM options menu to save your game, or change your - current game settings (depends on the game) - * The movie icon skips a non interactive sequence, the current dialog or - behaves like the ESC key on a regular keyboard (depends on the game) - * The sound icon turns all sound effects and music off and on - * The key icon allow you to map a key action to a device button - * The monkey icon switches between portrait, landscape and inverse landscape - mode (depends on the display drivers) - -You can map additional actions on your device hardware buttons using the -"Options" / "Key" menu in the ScummVM options menu. To associate an action to -a key, tap the action, then the "Map" button and press the hardware key. -The following actions are available : - - * Pause : pause the game - * Save : open ScummVM option menu - * Quit : quit ScummVM (without saving, be careful when using it) - * Skip : skip a non interactive sequence, the current dialog or - behaves like the ESC key on a regular keyboard - All AGI games -> F10 to quit full-screen dialogs - * Hide : hide or display the toolbar - * Keyboard : hide or display the virtual keyboard - * Sound : turns all sound effects and music off and on - * Right click : acts as a right mouse button click - * Cursor : hide or display the mouse cursor - * Free look : go in or out of free-look mode. In this mode, you can tap - the screen to look for interesting locations without - walking. Click a second time near the pointer's location - equals to a left click. - * Zoom up : magnify the upper part of the screen for 640x480 games - rendered on a QVGA device. - * Zoom down : magnify the lower part of the screen for 640x480 games - rendered on a QVGA device. - * Multi Function : performs a different function depending on the game : - Full Throttle -> win an action sequence (cheat) - Fate of Atlantis -> sucker punch (cheat) - Bargon -> F1 (start the game) - All AGI games -> bring up the predictive input dialog - Simon 1 & 2 -> highlight all hotspots in screen - * Bind keys map a key action to a device button - * Up,Down,Left : - Right, : emulate mouse/stylus behavior - Left Click : - -The default key bindings for Pocket PCs are (note that not all keys are mapped): - * Up, Down, Left, Right : (dpad) arrow keys - * Left Click : softkey A - -If you start a game when a Right click mapping is necessary, ScummVM will ask -you to map one of your hardware key to this action before playing. Just press -the key you want to map if you see this message. - -Notes: -- THE TOOLBAR CAN BE CYCLED BY DOUBLE TAPPING (SEE BELOW) -- YOU MUST HIDE THE TOOLBAR TO SCROLL THROUGH THE INVENTORY IN ZAK -- YOU MUST DISPLAY THE KEYBOARD TO FIGHT IN INDIANA JONES 3 -- YOU MUST MAP THE RIGHT CLICK ACTION TO PLAY SEVERAL GAMES -- YOU MUST USE THE FREE LOOK ACTION TO PLAY LURE OF THE TEMPTRESS - -How do I hide the toolbar ? ---------------------------- - -Note: THIS IS A VERY USEFUL AND SOMETIMES NECESSARY SHORTCUT - -Double tapping the stylus at the top of the screen will switch between a -visible toolbar panel, a virtual keyboard, and hiding panel. If any part of -the screen is obscured by the toolbar (like the load/save game dialogs) you can -use the invisible panel mode to get to it. For 320x200 games on QVGA Pocket -PCs, when the panel is hidden the game screen is resized to 320x240 (aspect -ratio correction) for better gaming experience. - -How do I play a game on a Smartphone device ? ---------------------------------------------- - -On non-stylus devices, the mouse cursor is emulated via a set of keys. -The cursor will move faster if you keep the key down. You can tweak this -behaviour in the configuration file described below. - -Here is -the list of available actions for Smartphones: - - * Up,Down,Left : - Right, : emulate mouse/stylus behavior - Left Click : - Right Click : - * Save : open ScummVM option menu - * Skip : skip a non interactive sequence, the current dialog or - behaves like the ESC key on a regular keyboard - * Zone : switch between the 3 different mouse zones - * Multi Function : performs a different function depending on the game - Full Throttle -> win an action sequence (cheat) - Fate of Atlantis -> sucker punch (cheat) - Bargon -> F1 (start the game) - All AGI games -> bring up the predictive input dialog - * Bind keys : map a key action to a device button - * Keyboard : hide or display the virtual keyboard - * Rotate : rotate the screen (also rotates dpad keys) - * Quit : quit ScummVM (without saving, be careful when using it) - -The "Zone" key is a *very* valuable addition allowing you to jump quickly -between three screen zones : the game zone, the verbs zone and the inventory -zone. When you switch to a zone the cursor will be reset to its former location -in this zone. - -The default key map for these actions is: - - * Up, Down, Left, Right : (dpad) arrow keys - * Left Click : softkey A - * Right Click : softkey B - * Save : call/talk - * Skip : back - * Zone : 9 - * Multi Function : 8 - * Bind keys : end call - * Keyboard : (dpad) enter - * Rotate : 5 - * Quit : 0 - -You can change the key mapping at any time by bringing up the key mapping menu -(Bind keys action). - -How do I tweak the configuration of ScummVM ? ---------------------------------------------- - -See the section regarding the configuration file (scummvm.ini) in ScummVM -README file - the same keywords apply. - -Some parameters are specific to this port : - -Game specific sections (f.e. [monkey2]) - performance options - - * high_sample_rate bool Desktop quality (22 kHz) sound output if - set. This is the default. - If you have a slow device, you can set this - to false to prevent lags/delays in the game. - * FM_high_quality bool Desktop quality FM synthesis if set. Lower - quality otherwise. The default is high - quality. You can change this if you have a - slow device. - * sound_thread_priority int Set the priority of the sound thread (0, 1, - 2). Depending on the release, this is set - to 1 internally (above normal). - If you get sound stuttering try setting - this to a higher value. - Set to 0 if your device is fast enough or if - you prefer better audio/video sync. - -Game specific sections (f.e. [monkey2]) - game options - - * landscape int 0: Portrait, 1: Landscape, - 2: Inverse Landscape. - You can also use this in the [scummvm] - section to display the launcher in landscape - for example, at startup. - * no_doubletap_rightclick int 1: Turn off the default behavior of - simulating a right-click when the screen is - double-tapped. - - -[scummvm] section - keys definition - -You usually do not wish to modify these values directly, as they are set -by the option dialog, and are only given here for reference. - - * action_mapping_version int Mapping version linked to ScummVM version. - * action_mapping string Hex codes describing the key associated to - each different action. - * debuglevel int Debug Level 1 is used by the WinCE port - for reporting diagnostic output in the - scummvm_stdout.txt and scummvm.stderr.txt - files in the current working directory. - -[scummvm] section - mouse emulation tuning - -You can tweak these parameters to customize how the cursor is handled. - - * repeatTrigger int Number of milliseconds a key must be held to - consider being repeated. - * repeatX int Number of key repeat events before changing - horizontal cursor behaviour. - * stepX1 int Horizontal cursor offset value when the key - is not repeated. - * stepX2 int Horizontal cursor offset value when the key - is repeated less than repeatX. - * stepX3 int Horizontal cursor offset value when the key - is repeated more than repeatX. - * repeatY int Number of key repeat events before changing - vertical cursor behavior. - * stepY1 int Vertical cursor offset value when the key is - not repeated. - * stepY2 int Horizontal cursor offset value when the key - is repeated less than repeatY. - * stepY3 int Vertical cursor offset value when the key is - repeated more than repeatY. - ------------------------------------------------------------------------- -Game specific questions ------------------------------------------------------------------------- - ---------------- --- All Games -- ---------------- - -I need to press a special key ------------------------------ - -Bring up the virtual keyboard. On Smartphones take a look at the Keyboard -action above. On Pocket PCs it's easier to double-tap at the top of the screen. - -The panel is obscuring the playfield area ------------------------------------------ - -Double tap at the top of the screen to hide it. As an aside, the aspect ratio -correction scaler will kick in if the game/device combo is appropriate. - -How do I name my save games ? ------------------------------ - -Use the virtual keyboard (Keyboard action). - -ScummVM is stuck for some reason --------------------------------- - -Bind and use the quit action to quit. - -I cannot rotate the screen to landscape/inverse landscape ---------------------------------------------------------- - -Depending on the video driver, ScummVM may opt to not provide such -functionality. In general, when ScummVM starts in normal "portrait" -orientation, the device driver reports better display characteristics and you -should consider launching from portrait. - -I'm having problems. Is there diagnostic output available ? ------------------------------------------------------------ - -Insert a line in the [scummvm] section of scummvm.ini with the following: -debuglevel=1 -Run ScummVM. When it closes scummvm_stdout.txt and scummvm_stderr.txt files -will be available at the program directory (see section above). - -ScummVM crashes and returns to desktop --------------------------------------- - -File a bug report including diagnostic output (see previous question). - --------------------------- --- Beneath a Steel Sky -- --------------------------- - -Introduction movie is too slow or never ends ... -------------------------------------------------- - -Skip it :) - -How can I open the inventory in Beneath a Steel Sky ? ---------------------------------------------------- - -Tap the top of the screen. Check your stylus calibration if you still cannot -open it. - -How can I use an item in Beneath a Steel Sky ? ----------------------------------------------- - -You need to map the right click button (see the General Questions section). - ----------------------------- --- Curse of Monkey Island -- ----------------------------- - -How can I open the inventory in Curse of Monkey Island ? ------------------------------------------------------- - -You need to map the right click button (see the General Questions section). - -I'm experiencing random crashes ... ------------------------------------- - -This game has high memory requirements, and may crash sometimes on low -memory devices. Continue your game with the latest automatically saved -game and everything should be fine. -You can consider removing the music and voice files (VOXDISK.BUN, MUSDISK.BUN) -to lower these requirements. - -Sound synchronization is lost in Curse of Monkey Island videos --------------------------------------------------------------- - -Use a faster device :-( - --------------------- --- Full Throttle -- --------------------- - -I'm experiencing random crashes ... ------------------------------------- - -This game has high memory requirements, and may crash sometimes on low -memory devices. Continue your game with the latest automatically saved -game and everything should be fine. -You can consider removing the voice file (MONSTER.SOU) and disable the -music to lower these requirements. - ----------------------------------------- --- Indiana Jones and the Last Crusade -- ----------------------------------------- - -How can I fight in Indiana Jones and the Last Crusade ? ------------------------------------------------------ - -You need to map the keyboard button (see the General Questions section). - ---------------- --- Sam & Max -- ---------------- - -How can I change the current action ? -------------------------------------- - -You need to map the right click button (see the General Questions section). - -How can I exit a mini game ? ----------------------------- - -Use the skip toolbar icon (see the General Questions section). - -------------------- --- Simon 1 and 2 -- -------------------- - -How can I save or quit in Simon ? --------------------------------- - -"Use" (use the use verb :p) the postcard. The ScummVM option dialog is disabled -in Simon games. - -On Smartphone, you'll need to push the Action button (center of the pad) to -quit the game. - -------------- --- The Dig -- -------------- - -I'm experiencing random crashes ... ------------------------------------- - -This game has high memory requirements, and may crash sometimes on low -memory devices. Continue your game with the latest automatically saved -game and everything should be fine. -You can consider removing the music and voice files (VOXDISK.BUN, MUSDISK.BUN) -to lower these requirements. - --------------------- --- Zak Mc Kracken -- --------------------- - -How can I scroll through my inventory items in Zak Mc Kracken ? ---------------------------------------------------------------- - -You need to map the hide toolbar button (see the General Questions section) or -double tap at the top of the screen (from 0.8.0+) - -------------------------- --- Broken Sword I & II -- -------------------------- - -I've installed the movies pack but they are not playing/they are slow ---------------------------------------------------------------------- - -MPEG 2 playback takes too much memory in the current release, and may prevent -movies from playing in VGA mode. Consider changing to the DXA cutscene pack -which is many times faster. - ---------------- --- Gobliiins -- ---------------- - -How do I enter a code ? ------------------------ - -Use the virtual keyboard. - -------------------- --- Bargon Attack -- -------------------- - -How do I start the game (F1 : Game, F2 : Demo) ----------------------------------------------- - -Use the Multi Function action. - ----------------------- --- AGI engine games -- ----------------------- - -Do you expect me to play these games on keyboard-less devices ? ---------------------------------------------------------------- - -Sure we do :-) -If you want to get some mileage on your stylus you can use the virtual -keyboard. There is a very useful alternative though, the AGI engine's -predictive input dialog. It requires a dictionary to be present. Just tap on -the command line or use the Multi Function action to bring it up. On -Smartphones, when the dialog is shown all key mapping is disabled temporarily -(including mouse emulation). Input is performed either by pressing the phone's -numeric keypad keys and dpad enter to close the dialog, or by navigating the -buttons using the dpad arrows and pressing with dpad enter. Check the main -Readme file for more information on this. - ---------------------------- --- Lure of the Temptress -- ---------------------------- - -The control scheme is awkward (Pocket PCs) ------------------------------------------- - -Map and use the 'Free Look' action. Since normal pointer operation is to -enter a left click at each tap position, the free look mode enables -'hovering' the mouse on an object, then right clicking either by using the -double tap method or by pressing the 'Right Click' action. Also, a left click -can be entered while in free look mode, by clicking a second time near the -current pointer's location. Note that two taps equal a left click. - ---------------- --- Discworld -- ---------------- - -By default, the double tap to right click action is disabled in this game -as this interferes with the game's controls. This setting can be overridden -(see 'no_doubletap_rightclick' parameter above). - ------------------ --- Discworld 2 -- ------------------ - -Crashes at startup of this game are usually due to the high memory -requirements of this game. - -------------------------- --- Cruise for a Corpse -- -------------------------- - -As with Discworld, the double-tap-to-right-click action interferes and will -be disabled by default. - - ------------------------------------------------------------------------- -Support ------------------------------------------------------------------------- - -Help, I've read everything and ... ------------------------------------ - -Luckily, as there is a huge variety of Windows CE devices, a specific forum -is dedicated to this ScummVM port. You can ask your question on the WinCE -ScummVM forum available at https://forums.scummvm.org/viewforum.php?f=6 - -Some older questions and very nice tutorials are still available on the historic -PocketMatrix forum at http://www.pocketmatrix.com/forums/viewforum.php?f=20 -where the community is always glad to help and have dealt with all the bugs for -many years now :) - -I think I found a bug, ScummVM crashes in ... ---------------------------------------------- - -See the "Reporting Bugs" section in ScummVM readme. - -If you have a Pocket PC or Handheld PC, be sure to include its resolution -(obtained on the second dialog displayed on the "About" menu) in your bug -report. - -If you cannot reproduce this bug on another ScummVM version, you can cross -post your bug report on ScummVM forums. - -I want to compile my own ScummVM for Windows CE ------------------------------------------------ - -Take a look at: -https://wiki.scummvm.org/index.php/Compiling_ScummVM/Windows_CE - - ------------------------------------------------------------------------- -Good Luck and Happy Adventuring! -The ScummVM team. -https://www.scummvm.org/ ------------------------------------------------------------------------- - - ------------------------------------------------------------------------- -Old news follow ... ------------------------------------------------------------------------- - -0.13.0: -Important: Two builds for ScummVM CE - -For this release, two binaries (executables) are provided. The first, -with file name scummvm1.exe, includes support for the following engines: - - scumm, sword1, sword2, queen, sky, lure, agi, touche -while the second, with file name scummvm2.exe: - - gob, cine, saga, kyra, agos, parallaction, drascula, groovie, tucker -The user must make sure to execute the correct file for a game. All -previously detected games will be shown in the launcher. Trying to launch -a gob engine game with scummvm1.exe will not work. -Detection also works as implied: scummvm1.exe will detect only the games -for which it has support; the same holds for scummvm2.exe. -This change has been done so users with less free memory can play more -memory hungry games. - -Also noted are problems with flac support. Your mileage may vary. Please -consider using ogg or mp3 for those games (smaller sizes are better for -handheld devices too!) - - -0.12.0: -- Improved SMUSH support (deprecated 'Smush_force_redraw' option) -No skipped frames in Full Throttle action sequences. The 'Smush_force_redraw' -option is not needed/honored anymore. - -- Fixed MultiFuntion key in Full Throttle - -- Improved sound output -Fixed a long standing bug which led to distorted sound output in all games. - -- Switched to faster ogg vorbis library -Robin Watts' libTremolo is used for ogg vorbis (tremor) replay. Info patch -by Lostech. - -- New right click through double tap inhibiting option -Check out the 'no_doubletap_rightclick' option if double-tapping as a right -click input method annoys you. Patch by spookypeanut. - - -0.11.0: -- Redesigned 'Free Look' action (Pocket PCs) -In order to accommodate for the requirements of the lure engine, the -usage characteristics of the 'Free Look' action have been improved. The -new behavior is available for use in all engines, but is is *strongly* -recommended for at least when playing 'Lure of the Temptress'. By using -the new scheme, when in 'Free Look' mode, it is now possible to enter -left clicks by clicking a second time near the current location of the -mouse pointer. Left and Right clicks at the current point location -are also available by using the respective actions' bound key. - -- Reduced optimization build -The ScummVM executable has grown quite large, prohibiting some devices -from running memory demanding games (or any games at all). Code -optimization level has been reduced to offset the growth of the executable. -Games run slightly slower. This will be addressed before next release. - -- Several bugfixes - - -0.10.0: -Major improvements have taken place in this version, mostly for behind- -the-scenes stuff. First, we have migrated to GCC for building the Windows -CE port. This helped take care of some obscure compiler bugs which were -in there for quite a long time. It has also lead to efficient code -generation due to GCC's advanced capabilities and consequently increased -runtime speed. The second important change was the overhaul of the SDL -library port. The benefits from this are twofold: The real-time code paths -have been optimized, including contributed ARM assembly code for critical -functions. Further, the screen display and mouse/keyboard input code has -been partially rewritten to allow for increased compatibility across all -devices. -Due to the update of keyboard handling code, the keycodes have changed -slightly. Running this version of ScummVM will overwrite your key bindings -with the new defaults. See the section on how to play on Smartphones and -Pocket PCs below for the new default key bindings. diff --git a/backends/platform/wince/images/Action.bmp b/backends/platform/wince/images/Action.bmp Binary files differdeleted file mode 100644 index 4985512cf4..0000000000 --- a/backends/platform/wince/images/Action.bmp +++ /dev/null diff --git a/backends/platform/wince/images/DiskwFolder.bmp b/backends/platform/wince/images/DiskwFolder.bmp Binary files differdeleted file mode 100644 index 82b4019930..0000000000 --- a/backends/platform/wince/images/DiskwFolder.bmp +++ /dev/null diff --git a/backends/platform/wince/images/MonkeyLandscape.bmp b/backends/platform/wince/images/MonkeyLandscape.bmp Binary files differdeleted file mode 100644 index 70f6ed69e7..0000000000 --- a/backends/platform/wince/images/MonkeyLandscape.bmp +++ /dev/null diff --git a/backends/platform/wince/images/MonkeyPortrait.bmp b/backends/platform/wince/images/MonkeyPortrait.bmp Binary files differdeleted file mode 100644 index 00619c2985..0000000000 --- a/backends/platform/wince/images/MonkeyPortrait.bmp +++ /dev/null diff --git a/backends/platform/wince/images/SoundOff.bmp b/backends/platform/wince/images/SoundOff.bmp Binary files differdeleted file mode 100644 index 2f7b26deaf..0000000000 --- a/backends/platform/wince/images/SoundOff.bmp +++ /dev/null diff --git a/backends/platform/wince/images/SoundOn.bmp b/backends/platform/wince/images/SoundOn.bmp Binary files differdeleted file mode 100644 index 2988b87224..0000000000 --- a/backends/platform/wince/images/SoundOn.bmp +++ /dev/null diff --git a/backends/platform/wince/images/bindkeys.bmp b/backends/platform/wince/images/bindkeys.bmp Binary files differdeleted file mode 100644 index 8a6cfc9347..0000000000 --- a/backends/platform/wince/images/bindkeys.bmp +++ /dev/null diff --git a/backends/platform/wince/images/keyboard.bmp b/backends/platform/wince/images/keyboard.bmp Binary files differdeleted file mode 100644 index 14217e1eac..0000000000 --- a/backends/platform/wince/images/keyboard.bmp +++ /dev/null diff --git a/backends/platform/wince/images/panelbig.bmp b/backends/platform/wince/images/panelbig.bmp Binary files differdeleted file mode 100644 index 8cf12178a7..0000000000 --- a/backends/platform/wince/images/panelbig.bmp +++ /dev/null diff --git a/backends/platform/wince/images/scumm_icon.ico b/backends/platform/wince/images/scumm_icon.ico Binary files differdeleted file mode 100644 index 24daa4da7d..0000000000 --- a/backends/platform/wince/images/scumm_icon.ico +++ /dev/null diff --git a/backends/platform/wince/missing/errno.h b/backends/platform/wince/missing/errno.h deleted file mode 100644 index 1d13c5d7d8..0000000000 --- a/backends/platform/wince/missing/errno.h +++ /dev/null @@ -1,4 +0,0 @@ -/* Header is not present in Windows CE SDK */ - -extern int errno; -#define EINTR 4 diff --git a/backends/platform/wince/missing/fopen.h b/backends/platform/wince/missing/fopen.h deleted file mode 100644 index b4f7d03129..0000000000 --- a/backends/platform/wince/missing/fopen.h +++ /dev/null @@ -1,11 +0,0 @@ -/* Header is not present in Windows CE SDK */ - -extern "C" { -/* This stuff will live here until port configuration file is in place */ -#ifndef _FILE_DEFINED -typedef void FILE; -#define _FILE_DEFINED -#endif -FILE *wce_fopen(const char *fname, const char *fmode); -#define fopen wce_fopen -} diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp deleted file mode 100644 index ab193a198b..0000000000 --- a/backends/platform/wince/missing/missing.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* Original code: - * Implementation for standard and semi-standard C library calls missing in WinCE - * environment. - * by Vasyl Tsvirkunov - */ - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include <windows.h> -#include <tchar.h> -#include <string.h> -#include <stdlib.h> -#include <stdio.h> -#include "common/debug.h" - -#ifdef __GNUC__ -#define EXT_C extern "C" -#else -#define EXT_C -#endif - -// common missing functions required by both gcc and evc - -#ifndef USE_ZLIB -int errno = 0; -#endif - -void *bsearch(const void *key, const void *base, size_t nmemb, - size_t size, int (*compar)(const void *, const void *)) { - // Perform binary search - size_t lo = 0; - size_t hi = nmemb; - while (lo < hi) { - size_t mid = (lo + hi) / 2; - const void *p = ((const char *)base) + mid * size; - int tmp = (*compar)(key, p); - if (tmp < 0) - hi = mid; - else if (tmp > 0) - lo = mid + 1; - else - return const_cast<void *>(p); - } - - return NULL; -} - -static char cwd[MAX_PATH + 1] = ""; - -EXT_C char *wce_getcwd(char *buffer, int maxlen) { - TCHAR fileUnc[MAX_PATH + 1]; - char *plast; - - if (cwd[0] == 0) { - GetModuleFileName(NULL, fileUnc, MAX_PATH); - WideCharToMultiByte(CP_ACP, 0, fileUnc, -1, cwd, MAX_PATH, NULL, NULL); - plast = strrchr(cwd, '\\'); - if (plast) - *plast = 0; - /* Special trick to keep start menu clean... */ - if (_stricmp(cwd, "\\windows\\start menu") == 0) - strcpy(cwd, "\\Apps"); - } - if (buffer) - strncpy(buffer, cwd, maxlen); - return cwd; -} - -#ifdef __GNUC__ -#undef GetCurrentDirectory -#endif -EXT_C void GetCurrentDirectory(int len, char *buf) { - wce_getcwd(buf, len); -} - -/* -Windows CE fopen has non-standard behavior -- not -fully qualified paths refer to root folder rather -than current folder (concept not implemented in CE). -*/ -#undef fopen -EXT_C FILE *wce_fopen(const char *fname, const char *fmode) { - char fullname[MAX_PATH + 1]; - - if (!fname || fname[0] == '\0') - return NULL; - if (fname[0] != '\\' && fname[0] != '/') { - wce_getcwd(fullname, MAX_PATH); - strcat(fullname, "\\"); - strcat(fullname, fname); - return fopen(fullname, fmode); - } else - return fopen(fname, fmode); -} - -/* Remove file by name */ -int remove(const char *path) { - TCHAR pathUnc[MAX_PATH + 1]; - MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH); - return !DeleteFile(pathUnc); -} - - -/* check out file access permissions */ -int _access(const char *path, int mode) { - TCHAR fname[MAX_PATH]; - char fullname[MAX_PATH + 1]; - - if (path[0] != '\\' && path[0] != '/') { - wce_getcwd(fullname, MAX_PATH); - strcat(fullname, "\\"); - strcat(fullname, path); - MultiByteToWideChar(CP_ACP, 0, fullname, -1, fname, sizeof(fname) / sizeof(TCHAR)); - } else - MultiByteToWideChar(CP_ACP, 0, path, -1, fname, sizeof(fname) / sizeof(TCHAR)); - - WIN32_FIND_DATA ffd; - HANDLE h = FindFirstFile(fname, &ffd); - FindClose(h); - - if (h == INVALID_HANDLE_VALUE) { - // WORKAROUND: WinCE 3.0 doesn't find paths ending in '\' - if (path[strlen(path) - 1] == '\\') { - char p2[MAX_PATH]; - strncpy(p2, path, strlen(path) - 1); - p2[strlen(path) - 1] = '\0'; - return _access(p2, mode); - } else - return -1; //Can't find file - } - - if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - // WORKAROUND: WinCE (or the emulator) sometimes returns bogus directory - // hits for files that don't exist. TRIPLE checking for the same fname - // seems to weed out those false positives. - // Exhibited in kyra engine. - h = FindFirstFile(fname, &ffd); - FindClose(h); - if (h == INVALID_HANDLE_VALUE) - return -1; //Can't find file - h = FindFirstFile(fname, &ffd); - FindClose(h); - if (h == INVALID_HANDLE_VALUE) - return -1; //Can't find file - - return 0; //Always return success if target is directory and exists - } - switch (mode) { - case 00: //Check existence - return 0; - case 06: //Check Read & Write permission - case 02: //Check Write permission - return ffd.dwFileAttributes & FILE_ATTRIBUTE_READONLY ? -1 : 0; - case 04: //Check Read permission - return 0; //Assume always have read permission - } - //Bad mode value supplied, return failure - return -1; -} - -// gcc build only functions follow -#if defined(__GNUC__) - -#ifndef __MINGW32CE__ -int islower(int c) { - return (c >= 'a' && c <= 'z'); -} - -int isspace(int c) { - return (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v'); -} - -int isalpha(int c) { - return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); -} - -int isalnum(int c) { - return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')); -} - -int isprint(int c) { - //static const char punct[] = "!\"#%&'();<=>?[\\]*+,-./:^_{|}~"; - //return (isalnum(c) || strchr(punct, c)); - return (32 <= c && c <= 126); // based on BSD manpage -} -#endif - -#endif diff --git a/backends/platform/wince/missing/time.h b/backends/platform/wince/missing/time.h deleted file mode 100644 index 156d2f6a36..0000000000 --- a/backends/platform/wince/missing/time.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Header is not present in Windows CE SDK */ - -#ifndef A800_TIME_H -#define A800_TIME_H - -#include <stdlib.h> - -#ifdef __MINGW32CE__ -#include_next <time.h> -#else -struct tm { - short tm_year; - short tm_mon; - short tm_mday; - short tm_wday; - short tm_hour; - short tm_min; - short tm_sec; -}; - -#ifdef __GNUC__ -#define EXT_C extern "C" -#else -#define EXT_C -#endif - -EXT_C time_t time(time_t *dummy); -EXT_C struct tm *localtime(time_t *dummy); - -unsigned int clock(); - -#endif -#endif diff --git a/backends/platform/wince/module.mk b/backends/platform/wince/module.mk deleted file mode 100644 index ddad024084..0000000000 --- a/backends/platform/wince/module.mk +++ /dev/null @@ -1,36 +0,0 @@ -MODULE := backends/platform/wince - -MODULE_OBJS := \ - CEActionsPocket.o \ - CEDevice.o \ - CEScaler.o \ - CEActionsSmartphone.o \ - CELauncherDialog.o \ - wince-sdl.o \ - CEgui/GUIElement.o \ - CEgui/Panel.o \ - CEgui/SDL_ImageResource.o \ - CEgui/ItemAction.o \ - CEgui/PanelItem.o \ - CEgui/Toolbar.o \ - CEgui/ItemSwitch.o \ - CEgui/PanelKeyboard.o \ - CEgui/ToolbarHandler.o \ - CEkeys/EventsBuffer.o \ - ../../../gui/Actions.o \ - ../../../gui/Key.o \ - ../../../gui/KeysDialog.o \ - missing/missing.o \ - smartLandScale.o - -ifndef DYNAMIC_MODULES -MODULE_OBJS += PocketSCUMM.o -endif - -# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. -MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) -OBJS := $(MODULE_OBJS) $(OBJS) -MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) - -# HACK: The wince backend is based on the SDL one, so we load that, too. -include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/wince/portdefs.h b/backends/platform/wince/portdefs.h deleted file mode 100644 index 5c24b4b510..0000000000 --- a/backends/platform/wince/portdefs.h +++ /dev/null @@ -1,86 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef WINCE_PORTDEFS_H -#define WINCE_PORTDEFS_H - -#ifndef _WIN32_WCE -#error For use on WinCE only -#endif - -// Missing string/stdlib/assert declarations for WinCE 2.xx -#if _WIN32_WCE < 300 - - #define GUI_ENABLE_KEYSDIALOG - - void *calloc(size_t n, size_t s); - int isalnum(int c); - int isdigit(int c); - int isprint(int c); - int isspace(int c); - char *strrchr(const char *s, int c); - void assert(void *expression); - void assert(int expression); - long int strtol(const char *nptr, char **endptr, int base); - char *strpbrk(const char *s, const char *accept); - -#endif - - -#ifndef __GNUC__ - void *bsearch(const void *, const void *, size_t, size_t, int (*x)(const void *, const void *)); - typedef int ptrdiff_t; - void GetCurrentDirectory(int len, char *buf); - #define INVALID_FILE_ATTRIBUTES 0xffffffff -#else - #include <math.h> - #undef GetCurrentDirectory - extern "C" void GetCurrentDirectory(int len, char *buf); - #define snprintf _snprintf - #define fopen wce_fopen -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <io.h> -#include <stdarg.h> -#include <assert.h> -#include <ctype.h> -//#include <direct.h> -#include <new> - -#ifdef __MINGW32CE__ - void *bsearch(const void *, const void *, size_t, size_t, int (*x)(const void *, const void *)); -#endif -int remove(const char *path); -int _access(const char *path, int mode); -extern "C" { - char *wce_getcwd(char *buf, int size); -} - -void drawError(char *); - -#define vsnprintf _vsnprintf - - -#endif diff --git a/backends/platform/wince/resource.h b/backends/platform/wince/resource.h deleted file mode 100644 index 73e57ae46d..0000000000 --- a/backends/platform/wince/resource.h +++ /dev/null @@ -1,11 +0,0 @@ -#define IDI_POCKETSCUMM 101 -#define IMAGE_PANEL 109 -#define PANEL_GENERIC 109 -#define PANEL_KEYBOARD 110 -#define ITEM_SKIP 114 -#define ITEM_OPTIONS 115 -#define ITEM_SOUND_ON 118 -#define ITEM_SOUND_OFF 119 -#define ITEM_VIEW_PORTRAIT 120 -#define ITEM_VIEW_LANDSCAPE 122 -#define ITEM_BINDKEYS 125 diff --git a/backends/platform/wince/smartLandScale.s b/backends/platform/wince/smartLandScale.s deleted file mode 100644 index f8771bc524..0000000000 --- a/backends/platform/wince/smartLandScale.s +++ /dev/null @@ -1,187 +0,0 @@ -@ ScummVM - Graphic Adventure Engine -@ -@ ScummVM is the legal property of its developers, whose names -@ are too numerous to list here. Please refer to the COPYRIGHT -@ file distributed with this source distribution. -@ -@ This program is free software; you can redistribute it and/or -@ modify it under the terms of the GNU General Public License -@ as published by the Free Software Foundation; either version 2 -@ of the License, or (at your option) any later version. -@ -@ This program is distributed in the hope that it will be useful, -@ but WITHOUT ANY WARRANTY; without even the implied warranty of -@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@ GNU General Public License for more details. -@ -@ You should have received a copy of the GNU General Public License -@ along with this program; if not, write to the Free Software -@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -@ -@ @author Robin Watts (robin@wss.co.uk) - - @ For 16 source pixels 0123456789ABCDEF, we want to produce 11 output - @ pixels. - - @0000000000011111111111222222222223333333333344444444444555555555 - @<------||------><------||------><------||------><------||------> - - @5566666666666777777777778888888888899999999999AAAAAAAAAAABBBBBBB - @<------||------><------||------><------||------><------||------> - - @BBBBCCCCCCCCCCCDDDDDDDDDDDEEEEEEEEEEEFFFFFFFFFFF - @<------||------><------||------><------||------> - - @ So, use the following weights (approximately right) - - @ d0 = (3*s0 + 1*s1)>>2 Every source pixel constitutes - @ d1 = (2*s1 + 2*s2)>>2 3/4 of a destination pixel, - @ d2 = (1*s2 + 3*s3)>>2 except for s4,s5,sA and sB which - @ d3 = (2*s4 + 2*s5)>>2 constitute 1/2 each. - @ d4 = (3*s6 + 1*s7)>>2 - @ d5 = (2*s7 + 2*s8)>>2 - @ d6 = (1*s8 + 3*s9)>>2 - @ d7 = (2*sA + 2*sB)>>2 - @ d8 = (3*sC + 1*sD)>>2 - @ d9 = (2*sD + 2*sE)>>2 - @ dA = (1*sE + 3*sF)>>2 - - .text - - .global SmartphoneLandscapeARM - - @ scales a width x height block of 16bpp pixels from srcPtr to dstPtr, - @ scaling each scanline down by 11/16ths. Every 8th scanline is dropped - @ srcPitch and dstPitch identify how to reach subsequent lines. - @ mask allows for one routine to do both 565 and 565 formats. - -SmartphoneLandscapeARM: - @ r0 = srcPtr - @ r1 = srcSpan - @ r2 = dstPtr - @ r3 = dstSpan - @ <> = width - @ <> = height - @ <> = mask - MOV r12,r13 - STMFD r13!,{r4-r11,r14} - LDMFD r12,{r4,r5,r11} @ r4 = width - @ r5 = height - @ r11= mask - MOV r7, #7 @ r7 = line - SUB r8, r1, r4, LSL #1 @ r8 = srcSpan - width*2 -y_loop: - MOV r6, r4 @ r6 = i - MOV r9, r2 @ r9 = dstPtr -x_loop: - LDRH r14,[r0],#2 @ r14 = s0 - LDRH r12,[r0],#2 @ r12 = s1 - LDRH r10,[r0],#2 @ r10 = s2 - ORR r14,r14,r14,LSL #16 @ r14 = s0s0 - ORR r12,r12,r12,LSL #16 @ r12 = s1s1 - AND r14,r14,r11 @ r14 = s0 as g_b_r - AND r12,r12,r11 @ r12 = s1 as g_b_r - ADD r14,r14,r14,LSL #1 @ r14 = s0*3 as g_b_r - ORR r10,r10,r10,LSL #16 @ r10 = s2s2 - ADD r14,r14,r12 @ r14 = (s0*3 + s1) as g_b_r - AND r10,r10,r11 @ r10 = s2 as g_b_r - AND r14,r11,r14,LSR #2 @ r14 = d0 as g_b_r - ORR r14,r14,r14,LSR #16 @ r14 = d0 - STRH r14,[r9],#2 @ store d0 - ADD r12,r12,r10 @ r12 = (s1 + s2) as g_b_r - LDRH r14,[r0],#2 @ r14 = s3 - AND r12,r11,r12,LSR #1 @ r12 = d1 as g_b_r - ORR r12,r12,r12,LSR #16 @ r12 = d1 - STRH r12,[r9],#2 @ store d1 - ORR r14,r14,r14,LSL #16 @ r14 = s3s3 - AND r14,r14,r11 @ r14 = s3 as g_b_r - ADD r10,r10,r14 @ r10 = (s2 + s3) as g_b_r - ADD r10,r10,r14,LSL #1 @ r10 = (s2 + s3*3) as g_b_r - LDRH r14,[r0],#2 @ r14 = s4 - LDRH r12,[r0],#2 @ r12 = s5 - AND r10,r11,r10,LSR #2 @ r10 = d2 as g_b_r - ORR r10,r10,r10,LSR #16 @ r10 = d2 - STRH r10,[r9],#2 @ store d2 - ORR r14,r14,r14,LSL #16 @ r14 = s4s4 - ORR r12,r12,r12,LSL #16 @ r12 = s5s5 - AND r14,r14,r11 @ r14 = s4 as g_b_r - AND r12,r12,r11 @ r12 = s5 as g_b_r - ADD r14,r14,r12 @ r14 = (s4 + s5) as g_b_r - LDRH r12,[r0],#2 @ r12 = s6 - LDRH r10,[r0],#2 @ r10 = s7 - AND r14,r11,r14,LSR #1 @ r14 = d3 as g_b_r - ORR r14,r14,r14,LSR #16 @ r14 = d3 - STRH r14,[r9],#2 @ store d3 - ORR r12,r12,r12,LSL #16 @ r12 = s6s6 - ORR r10,r10,r10,LSL #16 @ r10 = s7s7 - LDRH r14,[r0],#2 @ r14 = s8 - AND r12,r12,r11 @ r12 = s6 as g_b_r - AND r10,r10,r11 @ r10 = s7 as g_b_r - ORR r14,r14,r14,LSL #16 @ r14 = s8s8 - ADD r12,r12,r12,LSL #1 @ r12 = 3*s6 as g_b_r - AND r14,r14,r11 @ r14 = s8 as g_b_r - ADD r12,r12,r10 @ r12 = (3*s6+s7) as g_b_r - AND r12,r11,r12,LSR #2 @ r12 = d4 as g_b_r - ORR r12,r12,r12,LSR #16 @ r12 = d4 - STRH r12,[r9],#2 @ store d4 - ADD r10,r10,r14 @ r10 = (s7+s8) as g_b_r - AND r10,r11,r10,LSR #1 @ r10 = d5 as g_b_r - LDRH r12,[r0],#2 @ r12 = s9 - ORR r10,r10,r10,LSR #16 @ r10 = d5 - STRH r10,[r9],#2 @ store d5 - ORR r12,r12,r12,LSL #16 @ r12 = s9s9 - AND r12,r12,r11 @ r12 = s9 as g_b_r - ADD r12,r12,r12,LSL #1 @ r12 = s9*3 as g_b_r - ADD r12,r12,r14 @ r12 = (s8+s9*3) as g_b_r - AND r12,r11,r12,LSR #2 @ r12 = d6 as g_b_r - LDRH r14,[r0],#2 @ r14 = sA - LDRH r10,[r0],#2 @ r10 = sB - ORR r12,r12,r12,LSR #16 @ r12 = d6 - STRH r12,[r9],#2 @ store d6 - ORR r14,r14,r14,LSL #16 @ r14 = sAsA - ORR r10,r10,r10,LSL #16 @ r10 = sBsB - LDRH r12,[r0],#2 @ r12 = sC - AND r14,r14,r11 @ r14 = sA as g_b_r - AND r10,r10,r11 @ r10 = sB as g_b_r - ORR r12,r12,r12,LSL #16 @ r12 = sCsC - ADD r14,r14,r10 @ r14 = (sA + sB) as g_b_r - LDRH r10,[r0],#2 @ r10 = sD - AND r14,r11,r14,LSR #1 @ r14 = d7 as g_b_r - AND r12,r12,r11 @ r12 = sC as g_b_r - ORR r14,r14,r14,LSR #16 @ r14 = d7 - ORR r10,r10,r10,LSL #16 @ r10 = sDsD - STRH r14,[r9],#2 @ store d7 - AND r10,r10,r11 @ r10 = sD as g_b_r - ADD r12,r12,r12,LSL #1 @ r12 = 3*sC as g_b_r - LDRH r14,[r0],#2 @ r14 = sE - ADD r12,r12,r10 @ r12 = (3*sC+sD) as g_b_r - AND r12,r11,r12,LSR #2 @ r12 = d8 as g_b_r - ORR r14,r14,r14,LSL #16 @ r14 = sEsE - ORR r12,r12,r12,LSR #16 @ r12 = d8 - AND r14,r14,r11 @ r14 = sE as g_b_r - STRH r12,[r9],#2 @ store d8 - ADD r10,r10,r14 @ r10 = (sD+sE) as g_b_r - LDRH r12,[r0],#2 @ r12 = sF - AND r10,r11,r10,LSR #1 @ r10 = d9 as g_b_r - ORR r10,r10,r10,LSR #16 @ r10 = d9 - STRH r10,[r9],#2 @ store d9 - ORR r12,r12,r12,LSL #16 @ r12 = sFsF - AND r12,r12,r11 @ r12 = sF as g_b_r - ADD r12,r12,r12,LSL #1 @ r12 = 3*sF as g_b_r - ADD r12,r12,r14 @ r12 = (sE+3*sF) as g_b_r - AND r12,r11,r12,LSR #2 @ r12 = dA as g_b_r - ORR r12,r12,r12,LSR #16 @ r12 = dA - SUBS r6,r6,#16 @ width -= 16 - STRH r12,[r9],#2 @ store dA - BGT x_loop - - ADD r0, r0, r8 @ srcPtr += srcSpan - ADD r2, r2, r3 @ dstPtr += dstSpan - SUBS r7, r7, #1 - ADDEQ r0, r0, r1 - MOVEQ r7, #7 - SUBEQ r5, r5, #1 - SUBS r5, r5, #1 - BGT y_loop - - LDMFD r13!,{r4-r11,PC} diff --git a/backends/platform/wince/stub.cpp b/backends/platform/wince/stub.cpp deleted file mode 100644 index aba3fb973e..0000000000 --- a/backends/platform/wince/stub.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include <windows.h> - -extern int dynamic_modules_main(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw); - -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw) { - - /* Hello! - * This thing looks trivial, right? Guess again :-) - * Observe: - * 1) Because of the way plugins are done within the scummvm core - * (read: slightly dirty) it is required that the plugins - * (built as dlls in win32 systems) have to "backlink" into the - * main executable. More specifically, the dlls have to call - * functions from the (separately built) main module. - * This means trouble for wince, as the dynamic linker does not - * resolve imported symbols to a dll from an executable. - * 2) But wait! DLLs can have any way of importing/exporting symbols - * between them. Hmmm... - * - * Right! The solution is thus: We build everything as a dll. This means - * the individual engines (plugins) and also the scummvm core application. - * It is in fact "The sub-DLL solution" described over at edll - * (ref. http://edll.sourceforge.net/). - * - * The last thing to watch out for is that in a plugin build, we already - * supply a WinMain function (this one, right here) which supersedes - * SDL's one. So we need to do the startup things SDL does in scummvm - * before running SDL_main. - * - * All this leaves us, for this source file, to do this crummy little... */ - - dynamic_modules_main(hInst, hPrev, szCmdLine, sw); -} diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp deleted file mode 100644 index cb26071c97..0000000000 --- a/backends/platform/wince/wince-sdl.cpp +++ /dev/null @@ -1,716 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include <windows.h> - -#include "backends/platform/wince/missing/fopen.h" -#include "backends/platform/wince/wince-sdl.h" - -#include "common/config-manager.h" -#include "common/debug.h" -#include "common/events.h" -#include "common/util.h" -#include "common/textconsole.h" -#include "common/timer.h" -#include "common/translation.h" - -#include "engines/engine.h" - -#include "base/main.h" -#include "base/plugins.h" - -#include "audio/mixer_intern.h" -#include "audio/fmopl.h" - -#include "backends/mutex/sdl/sdl-mutex.h" -#include "backends/timer/sdl/sdl-timer.h" - -#include "gui/Actions.h" -#include "gui/KeysDialog.h" -#include "gui/message.h" - -#include "backends/platform/wince/CEActionsPocket.h" -#include "backends/platform/wince/CEActionsSmartphone.h" -#include "backends/platform/wince/CEgui/ItemAction.h" - -#include "graphics/scaler/downscaler.h" -#include "graphics/scaler/aspect.h" - -#include "backends/platform/wince/CEException.h" -#include "backends/platform/wince/CEScaler.h" - -#include "backends/graphics/wincesdl/wincesdl-graphics.h" -#include "backends/events/wincesdl/wincesdl-events.h" -#include "backends/mixer/wincesdl/wincesdl-mixer.h" - -#ifdef DYNAMIC_MODULES -#include <malloc.h> -#include "backends/plugins/win32/win32-provider.h" -#endif - -#ifdef __GNUC__ -extern "C" _CRTIMP FILE *__cdecl _wfreopen(const wchar_t *, const wchar_t *, FILE *); -#endif - -#ifdef WRAP_MALLOC - -extern "C" void *__real_malloc(size_t size); -extern "C" void __real_free(void *ptr); - -extern "C" void *__wrap_malloc(size_t size) { -/* - void *ptr = __real_malloc(size); - printf("malloc(%d) = %p\n", size, ptr); - return ptr; -*/ - if (size < 64 * 1024) { - void *ptr = __real_malloc(size+4); -// printf("malloc(%d) = %p\n", size, ptr); - if (ptr != NULL) { - *((HANDLE *)ptr) = 0; - return 4+(char *)ptr; - } - return NULL; - } - HANDLE H = CreateFileMapping((HANDLE)INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size+4, 0); - void *ptr = MapViewOfFile(H, FILE_MAP_ALL_ACCESS, 0, 0, 0); - *((HANDLE *)ptr) = H; - return 4+(char *)ptr; -} - -extern "C" void __wrap_free(void *ptr) { -/* - __real_free(ptr); - printf("free(%p)\n", ptr); -*/ - if (ptr != NULL) { - HANDLE H = *(HANDLE *)((char *)ptr-4); - if (H == 0) { - __real_free((char *)ptr-4); - return; - } - UnmapViewOfFile((char *)ptr-4); - CloseHandle(H); - } -} - -#endif - -using namespace CEGUI; - -// ******************************************************************************************** - -// stdin/err redirection -#define STDOUT_FNAME "\\scummvm_stdout.txt" -#define STDERR_FNAME "\\scummvm_stderr.txt" -static FILE *stdout_file = NULL, *stderr_file = NULL; -static char stdout_fname[MAX_PATH], stderr_fname[MAX_PATH]; - -// Static member inits -typedef void (*SoundProc)(void *param, byte *buf, int len); -bool OSystem_WINCE3::_soundMaster = true; - -bool _isSmartphone = false; -bool _hasSmartphoneResolution = false; - -#define DEFAULT_CONFIG_FILE "scummvm.ini" - -// ******************************************************************************************** - -bool isSmartphone() { - //return _isSmartphone; - return _hasSmartphoneResolution; -} - -const TCHAR *ASCIItoUnicode(const char *str) { - static TCHAR ustr[MAX_PATH]; // size good enough - - MultiByteToWideChar(CP_ACP, 0, str, strlen(str) + 1, ustr, sizeof(ustr) / sizeof(TCHAR)); - return ustr; -} - -// MAIN -#ifndef __GNUC__ -int handleException(EXCEPTION_POINTERS *exceptionPointers) { - CEException::writeException(TEXT("\\scummvmCrash"), exceptionPointers); - drawError("Unrecoverable exception occurred - see crash dump in latest \\scummvmCrash file"); - fclose(stdout_file); - fclose(stderr_file); - CEDevice::end(); - SDL_Quit(); - exit(0); - return EXCEPTION_EXECUTE_HANDLER; -} -#endif - -int SDL_main(int argc, char **argv) { - FILE *newfp = NULL; -#ifdef __GNUC__ - // Due to incomplete crt0.o implementation, we go through the constructor function - // list provided by the linker and init all of them - // thanks to joostp and DJWillis - extern void (*__CTOR_LIST__)(); - void (**constructor)() = &__CTOR_LIST__; - constructor++; // First item in list of constructors has special meaning (platform dependent), ignore it. - while (*constructor) { - (*constructor)(); - constructor++; - } -#endif - - CEDevice::init(); - - /* Redirect standard input and standard output */ - strcpy(stdout_fname, wce_getcwd(NULL, MAX_PATH)); - strcpy(stderr_fname, wce_getcwd(NULL, MAX_PATH)); - strcat(stdout_fname, STDOUT_FNAME); - strcat(stderr_fname, STDERR_FNAME); -#ifndef __GNUC__ - stdout_file = fopen(stdout_fname, "w"); - stderr_file = fopen(stderr_fname, "w"); -#else - stdout_file = newfp = _wfreopen(ASCIItoUnicode(stdout_fname), TEXT("w"), stdout); - if (newfp == NULL) { -#if !defined(stdout) - stdout = fopen(stdout_fname, "w"); - stdout_file = stdout; -#else - newfp = fopen(stdout_fname, "w"); - if (newfp) { - //*stdout = *newfp; - stdout_file = stdout; - } -#endif - } - stderr_file = newfp = _wfreopen(ASCIItoUnicode(stderr_fname), TEXT("w"), stderr); - if (newfp == NULL) { -#if !defined(stderr) - stderr = fopen(stderr_fname, "w"); - stderr_file = stderr; -#else - newfp = fopen(stderr_fname, "w"); - if (newfp) { - //*stderr = *newfp; - stderr_file = stderr; - } -#endif - } -#endif - -#ifdef DYNAMIC_MODULES - PluginManager::instance().addPluginProvider(new Win32PluginProvider()); -#endif - - - int res = 0; -#if !defined(DEBUG) && !defined(__GNUC__) - __try { -#endif - g_system = new OSystem_WINCE3(); - assert(g_system); - - // Pre initialize the backend - ((OSystem_WINCE3 *)g_system)->init(); - - // Invoke the actual ScummVM main entry point: - res = scummvm_main(argc, argv); - - // Free OSystem - g_system->destroy(); -#if !defined(DEBUG) && !defined(__GNUC__) - } - __except(handleException(GetExceptionInformation())) { - } -#endif - - return res; -} - -#ifdef DYNAMIC_MODULES - -/* This is the OS startup code in the case of a plugin-enabled build. - * It contains copied and slightly modified parts of SDL's win32/ce startup functions. - * We copy these here because the calling stub already has a WinMain procedure - * which overrides SDL's one and hence we essentially re-implement the startup procedure. - * Note also that this has to be here and not in the stub because SDL is statically - * linked in the scummvm.dll archive. - * Take a look at the comments in stub.cpp as well. - */ - -int console_main(int argc, char *argv[]) { - int n; - char *bufp, *appname; - - appname = argv[0]; - if ((bufp = strrchr(argv[0], '\\')) != NULL) - appname = bufp + 1; - else if ((bufp = strrchr(argv[0], '/')) != NULL) - appname = bufp + 1; - - if ((bufp = strrchr(appname, '.')) == NULL) - n = strlen(appname); - else - n = (bufp - appname); - - bufp = (char *) alloca(n + 1); - strncpy(bufp, appname, n); - bufp[n] = '\0'; - appname = bufp; - - if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0) { - error("WinMain() error: %s", SDL_GetError()); - return(FALSE); - } - - SDL_SetModuleHandle(GetModuleHandle(NULL)); - - // Run the application main() code - SDL_main(argc, argv); - - return(0); -} - -static int ParseCommandLine(char *cmdline, char **argv) { - char *bufp; - int argc; - - argc = 0; - for (bufp = cmdline; *bufp;) { - // Skip leading whitespace - while (isspace(*bufp)) - ++bufp; - - // Skip over argument - if (*bufp == '"') { - ++bufp; - if (*bufp) { - if (argv) - argv[argc] = bufp; - ++argc; - } - // Skip over word - while (*bufp && (*bufp != '"')) - ++bufp; - } else { - if (*bufp) { - if (argv) - argv[argc] = bufp; - ++argc; - } - // Skip over word - while (*bufp && ! isspace(*bufp)) - ++bufp; - } - if (*bufp) { - if (argv) - *bufp = '\0'; - ++bufp; - } - } - if (argv) - argv[argc] = NULL; - - return(argc); -} - -int dynamic_modules_main(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw) { - HINSTANCE handle; - char **argv; - int argc; - char *cmdline; - wchar_t *bufp; - int nLen; - - if (wcsncmp(szCmdLine, TEXT("\\"), 1)) { - nLen = wcslen(szCmdLine) + 128 + 1; - bufp = (wchar_t *) alloca(nLen * 2); - wcscpy(bufp, TEXT("\"")); - GetModuleFileName(NULL, bufp + 1, 128 - 3); - wcscpy(bufp + wcslen(bufp), TEXT("\" ")); - wcsncpy(bufp + wcslen(bufp), szCmdLine, nLen - wcslen(bufp)); - } else - bufp = szCmdLine; - - nLen = wcslen(bufp) + 1; - cmdline = (char *) alloca(nLen); - WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL); - - // Parse command line into argv and argc - argc = ParseCommandLine(cmdline, NULL); - argv = (char **) alloca((argc + 1) * (sizeof * argv)); - ParseCommandLine(cmdline, argv); - - // fix gdb-emulator combo - while (argc > 1 && !strstr(argv[0], ".exe")) { - OutputDebugString(TEXT("SDL: gdb argv[0] fixup\n")); - *(argv[1] - 1) = ' '; - int i; - for (i = 1; i < argc; i++) - argv[i] = argv[i + 1]; - argc--; - } - - // Run the main program (after a little SDL initialization) - return(console_main(argc, argv)); - -} -#endif - -// ******************************************************************************************** - -// ******************************************************************************************** - -void pumpMessages() { - MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } -} - -void drawError(char *error) { - TCHAR errorUnicode[200]; - MultiByteToWideChar(CP_ACP, 0, error, strlen(error) + 1, errorUnicode, sizeof(errorUnicode)); - pumpMessages(); - MessageBox(GetActiveWindow(), errorUnicode, TEXT("ScummVM error"), MB_OK | MB_ICONERROR); - pumpMessages(); -} - -// ******************************************************************************************** -static Uint32 timer_handler_wrapper(Uint32 interval) { - DefaultTimerManager *tm = (DefaultTimerManager *)g_system->getTimerManager(); - tm->handler(); - return interval; -} - -void OSystem_WINCE3::initBackend() { - - assert(!_inited); - - // Create the backend custom managers - if (_eventSource == 0) - _eventSource = new WINCESdlEventSource(); - - if (_mixerManager == 0) { - _mixerManager = new WINCESdlMixerManager(); - - // Setup and start mixer - _mixerManager->init(); - } - - if (_graphicsManager == 0) - _graphicsManager = new WINCESdlGraphicsManager(_eventSource, _window); - - ((WINCESdlEventSource *)_eventSource)->init(dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager)); - - // Call parent implementation of this method - OSystem_SDL::initBackend(); - - // Initialize global key mapping - GUI::Actions::init(); - GUI_Actions::Instance()->initInstanceMain(this); - if (!GUI_Actions::Instance()->loadMapping()) { // error during loading means not present/wrong version - warning("Setting default action mappings"); - GUI_Actions::Instance()->saveMapping(); // write defaults - } - - _inited = true; -} - -int OSystem_WINCE3::getScreenWidth() { - return _platformScreenWidth; -} - -void OSystem_WINCE3::initScreenInfos() { - // sdl port ensures that we use correctly full screen - _isOzone = 0; - SDL_Rect **r; - r = SDL_ListModes(NULL, 0); - _platformScreenWidth = r[0]->w; - _platformScreenHeight = r[0]->h; -} - -int OSystem_WINCE3::getScreenHeight() { - return _platformScreenHeight; -} - -bool OSystem_WINCE3::isOzone() { - return _isOzone; -} - -Common::String OSystem_WINCE3::getDefaultConfigFileName() { - char configFile[MAXPATHLEN]; - strcpy(configFile, wce_getcwd(NULL, MAX_PATH)); - strcat(configFile, "\\"); - strcat(configFile, DEFAULT_CONFIG_FILE); - return configFile; -} - -// ******************************************************************************************** - - -OSystem_WINCE3::OSystem_WINCE3() : OSystem_SDL(), - _forcePanelInvisible(false) { - // Initialze File System Factory - _fsFactory = new WindowsFilesystemFactory(); - _mixer = 0; -} - -OSystem_WINCE3::~OSystem_WINCE3() { - delete _mixer; -} - -void OSystem_WINCE3::swap_sound_master() { - _soundMaster = !_soundMaster; - - //WINCESdlGraphicsManager _graphicsManager - - WINCESdlGraphicsManager *graphicsManager = dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager); - if (graphicsManager->_toolbarHandler.activeName() == NAME_MAIN_PANEL) - graphicsManager->_toolbarHandler.forceRedraw(); // redraw sound icon -} - - -void OSystem_WINCE3::engineInit() { - check_mappings(); // called here to initialize virtual keys handling - - dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager)->update_game_settings(); - // finalize mixer init - _mixerManager->init(); -} - -void OSystem_WINCE3::check_mappings() { - CEActionsPocket *instance; - - Common::String gameid(ConfMan.get("gameid")); - - if (gameid.empty() || GUI_Actions::Instance()->initialized()) - return; - - GUI_Actions::Instance()->initInstanceGame(); - instance = (CEActionsPocket *)GUI_Actions::Instance(); - - // Some games need to map the right click button, signal it here if it wasn't done - if (instance->needsRightClickMapping()) { - GUI::KeysDialog *keysDialog = new GUI::KeysDialog(_("Map right click action")); - while (!instance->getMapping(POCKET_ACTION_RIGHTCLICK)) { - keysDialog->runModal(); - if (!instance->getMapping(POCKET_ACTION_RIGHTCLICK)) { - GUI::MessageDialog alert(_("You must map a key to the 'Right Click' action to play this game")); - alert.runModal(); - } - } - delete keysDialog; - } - - // Map the "hide toolbar" action if needed - if (instance->needsHideToolbarMapping()) { - GUI::KeysDialog *keysDialog = new GUI::KeysDialog(_("Map hide toolbar action")); - while (!instance->getMapping(POCKET_ACTION_HIDE)) { - keysDialog->runModal(); - if (!instance->getMapping(POCKET_ACTION_HIDE)) { - GUI::MessageDialog alert(_("You must map a key to the 'Hide toolbar' action to play this game")); - alert.runModal(); - } - } - delete keysDialog; - } - - // Map the "zoom" actions if needed - if (instance->needsZoomMapping()) { - GUI::KeysDialog *keysDialog = new GUI::KeysDialog(_("Map Zoom Up action (optional)")); - keysDialog->runModal(); - delete keysDialog; - keysDialog = new GUI::KeysDialog(_("Map Zoom Down action (optional)")); - keysDialog->runModal(); - delete keysDialog; - } - - // Extra warning for Zak Mc Kracken - if (strncmp(gameid.c_str(), "zak", 3) == 0 && - !GUI_Actions::Instance()->getMapping(POCKET_ACTION_HIDE)) { - GUI::MessageDialog alert(_("Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory")); - alert.runModal(); - } - -} - -void OSystem_WINCE3::setGraphicsModeIntern() { - // Scalers have been pre-selected for the desired mode. - // No further tuning required. -} - -void OSystem_WINCE3::initSDL() { - // Check if SDL has not been initialized - if (!_initedSDL) { - uint32 sdlFlags = SDL_INIT_EVENTTHREAD | SDL_INIT_VIDEO; - if (ConfMan.hasKey("disable_sdl_parachute")) - sdlFlags |= SDL_INIT_NOPARACHUTE; - - if (ConfMan.hasKey("use_GDI") && ConfMan.getBool("use_GDI")) { - SDL_VideoInit("windib", 0); - sdlFlags ^= SDL_INIT_VIDEO; - } - - // Initialize SDL (SDL Subsystems are initiliazed in the corresponding sdl managers) - if (SDL_Init(sdlFlags) == -1) - error("Could not initialize SDL: %s", SDL_GetError()); - - _initedSDL = true; - } -} - -void OSystem_WINCE3::init() { - // Create SdlMutexManager instance as the TimerManager relies on the - // MutexManager being already initialized - if (_mutexManager == 0) - _mutexManager = new SdlMutexManager(); - - // Create the timer. CE SDL does not support multiple timers (SDL_AddTimer). - // We work around this by using the SetTimer function, since we only use - // one timer in scummvm (for the time being) - if (_timerManager == 0) { - _timerManager = new DefaultTimerManager(); - SDL_SetTimer(10, &timer_handler_wrapper); - } - - // Call parent implementation of this method - OSystem_SDL::init(); -} - -void OSystem_WINCE3::quit() { - fclose(stdout_file); - fclose(stderr_file); - if (gDebugLevel <= 0) { - DeleteFile(ASCIItoUnicode(stdout_fname)); - DeleteFile(ASCIItoUnicode(stderr_fname)); - } - CEDevice::end(); - OSystem_SDL::quit(); -} - -void OSystem_WINCE3::getTimeAndDate(TimeDate &t) const { - SYSTEMTIME systime; - - GetLocalTime(&systime); - t.tm_year = systime.wYear - 1900; - t.tm_mon = systime.wMonth - 1; - t.tm_mday = systime.wDay; - t.tm_hour = systime.wHour; - t.tm_min = systime.wMinute; - t.tm_sec = systime.wSecond; - t.tm_wday = systime.wDayOfWeek; -} - -void OSystem_WINCE3::logMessage(LogMessageType::Type type, const char *message) { - OSystem_SDL::logMessage(type, message); - -#if defined( USE_WINDBG ) - TCHAR buf_unicode[1024]; - MultiByteToWideChar(CP_ACP, 0, message, strlen(message) + 1, buf_unicode, sizeof(buf_unicode)); - OutputDebugString(buf_unicode); - - if (type == LogMessageType::kError) { -#ifndef DEBUG - drawError(message); -#else - int cmon_break_into_the_debugger_if_you_please = *(int *)(message + 1); // bus error - printf("%d", cmon_break_into_the_debugger_if_you_please); // don't optimize the int out -#endif - } -#endif -} - -Common::String OSystem_WINCE3::getSystemLanguage() const { -#ifdef USE_DETECTLANG - // We can not use "setlocale" (at least not for MSVC builds), since it - // will return locales like: "English_USA.1252", thus we need a special - // way to determine the locale string for Win32. - char langName[9]; - char ctryName[9]; - TCHAR langNameW[32]; - TCHAR ctryNameW[32]; - int i = 0; - bool localeFound = false; - Common::String localeName; - - // Really not nice, but the only way to map Windows CE language/country codes to posix NLS names, - // because Windows CE doesn't support LOCALE_SISO639LANGNAME and LOCALE_SISO3166CTRYNAME, - // according to this: http://msdn.microsoft.com/en-us/library/aa912934.aspx - // - // See http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx for a translation table - // This table has to be updated manually when new translations are added - const char *posixMappingTable[][3] = { - {"CAT", "ESP", "ca_ES"}, - {"CSY", "CZE", "cs_CZ"}, - {"DAN", "DNK", "da_DK"}, - {"DEU", "DEU", "de_DE"}, - {"ESN", "ESP", "es_ES"}, - {"ESP", "ESP", "es_ES"}, - {"FRA", "FRA", "fr_FR"}, - {"HUN", "HUN", "hu_HU"}, - {"ITA", "ITA", "it_IT"}, - {"NOR", "NOR", "nb_NO"}, - {"NON", "NOR", "nn_NO"}, - {"PLK", "POL", "pl_PL"}, - {"PTB", "BRA", "pt_BR"}, - {"RUS", "RUS", "ru_RU"}, - {"SVE", "SWE", "sv_SE"}, - {"UKR", "UKR", "uk_UA"}, - {NULL, NULL, NULL} - }; - - if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME, langNameW, sizeof(langNameW)) != 0 && - GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVCTRYNAME, ctryNameW, sizeof(ctryNameW)) != 0) { - WideCharToMultiByte(CP_ACP, 0, langNameW, -1, langName, (wcslen(langNameW) + 1), NULL, NULL); - WideCharToMultiByte(CP_ACP, 0, ctryNameW, -1, ctryName, (wcslen(ctryNameW) + 1), NULL, NULL); - - debug(1, "Trying to find posix locale name for %s_%s", langName, ctryName); - while (posixMappingTable[i][0] && !localeFound) { - if ( (!strcmp(posixMappingTable[i][0], langName) || !strcmp(posixMappingTable[i][0], "*")) && - (!strcmp(posixMappingTable[i][1], ctryName) || !strcmp(posixMappingTable[i][0], "*")) ) { - localeFound = true; - localeName = posixMappingTable[i][2]; - } - i++; - } - if (!localeFound) warning("No posix locale name found for %s_%s", langName, ctryName); - } - - if (localeFound) { - debug(1, "Found posix locale name: %s", localeName.c_str()); - return localeName; - } else { - return ModularBackend::getSystemLanguage(); - } -#else // USE_DETECTLANG - return ModularBackend::getSystemLanguage(); -#endif // USE_DETECTLANG -} - -int OSystem_WINCE3::_platformScreenWidth; -int OSystem_WINCE3::_platformScreenHeight; -bool OSystem_WINCE3::_isOzone; diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h deleted file mode 100644 index 1fbdbde9cb..0000000000 --- a/backends/platform/wince/wince-sdl.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef WINCE_SDL_H -#define WINCE_SDL_H - -#include "common/scummsys.h" -#include "common/system.h" -#include "graphics/scaler.h" -#include "backends/platform/sdl/sdl.h" - -#include "backends/platform/wince/CEgui/CEGUI.h" -#include "backends/platform/wince/CEkeys/CEKeys.h" -#include "backends/platform/wince/CEDevice.h" - -#include "backends/graphics/wincesdl/wincesdl-graphics.h" -#include "backends/events/wincesdl/wincesdl-events.h" -#include "backends/timer/default/default-timer.h" -#include "backends/fs/windows/windows-fs-factory.h" - -// defines used for implementing the raw frame buffer access method (2003+) -#define GETRAWFRAMEBUFFER 0x00020001 -#define FORMAT_565 1 -#define FORMAT_555 2 -#define FORMAT_OTHER 3 - -class OSystem_WINCE3 : public OSystem_SDL { -public: - OSystem_WINCE3(); - virtual ~OSystem_WINCE3(); - - void setGraphicsModeIntern(); - void initBackend(); - - // Overloaded from SDL backend - void init(); - void quit(); - virtual void logMessage(LogMessageType::Type type, const char *message); - virtual Common::String getSystemLanguage() const; - - // Overloaded from OSystem - void engineInit(); - void getTimeAndDate(TimeDate &t) const; - - virtual Common::String getDefaultConfigFileName(); - - void swap_sound_master(); - - static int getScreenWidth(); - static int getScreenHeight(); - static void initScreenInfos(); - static bool isOzone(); - - static bool _soundMaster; // turn off sound after all calculations - // static since needed by the SDL callback - -protected: - void initSDL(); - Audio::MixerImpl *_mixer; - -private: - void check_mappings(); - - bool _forcePanelInvisible; // force panel visibility for some cases - - static int _platformScreenWidth; - static int _platformScreenHeight; - static bool _isOzone; // true if running on Windows 2003 SE - -}; - -#endif diff --git a/backends/platform/wince/wince.mk b/backends/platform/wince/wince.mk deleted file mode 100644 index 5ccc0a4a44..0000000000 --- a/backends/platform/wince/wince.mk +++ /dev/null @@ -1,11 +0,0 @@ -ifdef WRAP_MALLOC - LDFLAGS += -Wl,--wrap,malloc -Wl,--wrap,free -endif - -ifdef DYNAMIC_MODULES -plugins: $(EXECUTABLE) backends/platform/wince/stub.o backends/platform/wince/PocketSCUMM.o - $(CXX) -nostdlib backends/platform/wince/stub.o backends/platform/wince/PocketSCUMM.o -L. -lscummvm -o scummvm.exe - -backends/platform/wince/stub.o: $(srcdir)/backends/platform/wince/stub.cpp - $(CXX) -c $(srcdir)/backends/platform/wince/stub.cpp -o backends/platform/wince/stub.o -endif |