diff options
Diffstat (limited to 'backends')
28 files changed, 746 insertions, 279 deletions
diff --git a/backends/epoc/ScummApp.cpp b/backends/epoc/ScummApp.cpp index f4caa7ea33..408d52550f 100644 --- a/backends/epoc/ScummApp.cpp +++ b/backends/epoc/ScummApp.cpp @@ -29,7 +29,8 @@ extern "C" int _chkstk(int /*a*/) { return 1; } #endif -#if !defined (__AVKON_ELAF__) && !defined (S60) + +#ifdef EPOC_AS_APP // this function is called by Symbian to deliver the new CApaApplication object EXPORT_C CApaApplication* NewApplication() { // Return pointer to newly created CQMApp diff --git a/backends/epoc/ScummApp.h b/backends/epoc/ScummApp.h index af44952b16..eab91c736a 100644 --- a/backends/epoc/ScummApp.h +++ b/backends/epoc/ScummApp.h @@ -27,7 +27,7 @@ #include <eikapp.h> #include <e32base.h> #include <sdlapp.h> -#if!defined (__AVKON_ELAF__) && !defined(S60) +#ifdef EPOC_AS_APP #include "ECompXL.h" #endif @@ -37,7 +37,7 @@ public: ~CScummApp(); TUid AppDllUid() const; -#if!defined (__AVKON_ELAF__) && !defined(S60) +#ifdef EPOC_AS_APP TECompXL iECompXL; #endif }; diff --git a/backends/epoc/SymbianActions.cpp b/backends/epoc/SymbianActions.cpp new file mode 100644 index 0000000000..6ec2ed9484 --- /dev/null +++ b/backends/epoc/SymbianActions.cpp @@ -0,0 +1,190 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001-2005 The ScummVM project + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#include "stdafx.h" +#include "SymbianActions.h" + +#include "gui/message.h" +#include "scumm/scumm.h" +#include "common/config-manager.h" + +// this next one needs to be replaced with Symbian specific include(s) +//#include "EventsBuffer.h" for //EventsBuffer::simulateKey() +#include <sdl.h> +// and use the correct Symbian calls for: //_mainSystem->fcns() + +namespace GUI { + +// SumthinWicked says: we either split our Actions like WinCE did with Pocket/Smartphone +// or we put them in this file separated by #ifdefs, this one is up to you, AnotherGuest :) + +const Common::String actionNames[] = { + "Up", + "Down", + "Left", + "Right", + "Left Click", + "Right Click", + "Save", + "Skip", + "Zone", + "FT Cheat", + "Swap character", + "Skip text", + "Pause", + "Quit" +}; + +#ifdef UIQ +static const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, 0x11a, 0x11b, SDLK_MENU, SDLK_PAGEDOWN, 0, 0,SDLK_PAGEUP,0,0}; +#elif defined (S60) +const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, 0, 0, '*', '#', '0',0,0,0,0,0}; +#else +const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, 0x11a, 0x11b, SDLK_MENU, VK_ESCAPE, '9', 0,0,0,0}; +#endif +// creator function according to Factory Pattern +void SymbianActions::init(GameDetector &detector) { + _instance = new SymbianActions(detector); +} + + +Common::String SymbianActions::actionName(ActionType action) { + return actionNames[action]; +} + +int SymbianActions::size() { + return ACTION_LAST; +} + +Common::String SymbianActions::domain() { + return "symbian"; +} + +int SymbianActions::version() { + return ACTION_VERSION; +} + +SymbianActions::SymbianActions(GameDetector &detector) : + Actions(detector) +{ + int i; + + for (i=0; i<ACTION_LAST; i++) { + _action_mapping[i] = ACTIONS_DEFAULT[i]; + _action_enabled[i] = false; + } + +} + +void SymbianActions::initInstanceMain(OSystem *mainSystem) { + Actions::initInstanceMain(mainSystem); + + // Mouse Up + _action_enabled[ACTION_UP] = true; + + // Mouse Down + _action_enabled[ACTION_DOWN] = true; + + // Mouse Left + _action_enabled[ACTION_LEFT] = true; + + // Mouse Right + _action_enabled[ACTION_RIGHT] = true; + + // Left Click + _action_enabled[ACTION_LEFTCLICK] = true; + + // Right Click + _action_enabled[ACTION_RIGHTCLICK] = true; + + // Skip + _action_enabled[ACTION_SKIP] = true; + _key_action[ACTION_SKIP].setAscii(SDLK_ESCAPE); +} + +void SymbianActions::initInstanceGame() { + bool is_simon = (strncmp(_detector->_targetName.c_str(), "simon", 5) == 0); + bool is_sky = (_detector->_targetName == "sky"); + bool is_queen = (_detector->_targetName == "queen"); + bool is_gob = (strncmp(_detector->_targetName.c_str(), "gob", 3) == 0); + + Actions::initInstanceGame(); + + // See if a right click mapping could be needed + if (is_sky || _detector->_targetName == "samnmax" || is_gob) + _right_click_needed = true; + + // Initialize keys for different actions + // Save + if (is_simon || is_gob) + _action_enabled[ACTION_SAVE] = false; + else + if (is_queen) { + _action_enabled[ACTION_SAVE] = true; + _key_action[ACTION_SAVE].setAscii(SDLK_F1); // F1 key for FOTAQ or F5??!? + } + else + if (is_sky) { + _action_enabled[ACTION_SAVE] = true; + _key_action[ACTION_SAVE].setAscii(63); + } + else { + _action_enabled[ACTION_SAVE] = true; + _key_action[ACTION_SAVE].setAscii(SDLK_F5); // F5 key + } + + // Swap character + _action_enabled[ACTION_SWAPCHAR] = true; + _key_action[ACTION_SWAPCHAR].setAscii('b'); // b + + // Zone + _action_enabled[ACTION_ZONE] = true; + + // FT Cheat + _action_enabled[ACTION_FT_CHEAT] = true; + _key_action[ACTION_FT_CHEAT].setAscii(86); // shift-V + // Skip text + _action_enabled[ACTION_SKIP_TEXT]=true; + if (is_queen) { + _key_action[ACTION_SKIP_TEXT].setAscii(SDLK_SPACE); + } + else { + _key_action[ACTION_SKIP_TEXT].setAscii(SDLK_PERIOD); + } + + // Pause + _key_action[ACTION_PAUSE].setAscii(' '); + _action_enabled[ACTION_PAUSE] = true; + + // Quit + _action_enabled[ACTION_QUIT] = true; +} + + +SymbianActions::~SymbianActions() { +} + +bool SymbianActions::perform(ActionType action, bool pushed) { + + return false; +} + +} // namespace GUI diff --git a/backends/epoc/SymbianActions.h b/backends/epoc/SymbianActions.h new file mode 100644 index 0000000000..9e556a04af --- /dev/null +++ b/backends/epoc/SymbianActions.h @@ -0,0 +1,77 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001-2005 The ScummVM project + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef SYMBIANACTIONS_H +#define SYMBIANACTIONS_H + +#include "common/stdafx.h" +#include "common/scummsys.h" +#include "common/system.h" +#include "base/gameDetector.h" +#include "gui/Key.h" +#include "gui/Actions.h" +//#include "sdl.h" + +namespace GUI { + +#define ACTION_VERSION 6 + +enum actionType { + ACTION_UP = 0, + ACTION_DOWN, + ACTION_LEFT, + ACTION_RIGHT, + ACTION_LEFTCLICK, + ACTION_RIGHTCLICK, + ACTION_SAVE, + ACTION_SKIP, + ACTION_ZONE, + ACTION_FT_CHEAT, + ACTION_SWAPCHAR, + ACTION_SKIP_TEXT, + ACTION_PAUSE, + ACTION_QUIT, + ACTION_LAST +}; + +class SymbianActions : public Actions { +public: + // Actions + bool perform(ActionType action, bool pushed = true); + Common::String actionName(ActionType action); + int size(); + static void init(GameDetector &detector); + void initInstanceMain(OSystem *mainSystem); + void initInstanceGame(); + + // Action domain + Common::String domain(); + int version(); + + ~SymbianActions(); +private: + SymbianActions(GameDetector &detector); + bool _right_click_needed; +}; + +} // namespace GUI + +#endif diff --git a/backends/epoc/SymbianOS.cpp b/backends/epoc/SymbianOS.cpp index 55f52260a0..ce8722920c 100644 --- a/backends/epoc/SymbianOS.cpp +++ b/backends/epoc/SymbianOS.cpp @@ -22,7 +22,10 @@ */ #include "SymbianOS.h" - +#include "SymbianActions.h" +#include "Actions.h" +#include "Key.h" +#include "gui\message.h" static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { {"1x", "Fullscreen", GFX_NORMAL}, {0, 0, 0} @@ -37,11 +40,22 @@ OSystem *OSystem_SymbianOS_create() { extern Common::ConfigManager *g_config; -OSystem_SDL_Symbian::OSystem_SDL_Symbian() :_channels(0),_stereo_mix_buffer(0){ +OSystem_SDL_Symbian::zoneDesc OSystem_SDL_Symbian::_zones[TOTAL_ZONES] = { + { 0, 0, 320, 145 }, + { 0, 145, 150, 55 }, + { 150, 145, 170, 55 } +}; +OSystem_SDL_Symbian::OSystem_SDL_Symbian() :_channels(0),_stereo_mix_buffer(0) +{ ConfMan.set("FM_high_quality", false); ConfMan.set("FM_medium_quality", true); // ConfMan.set("joystick_num",0); // S60 should have joystick_num set to 0 in the ini file ConfMan.flushToDisk(); + // Initialize global key mapping for Smartphones + GUI::Actions* actions = GUI::Actions::Instance(); + actions->initInstanceMain(this); + actions->loadMapping(); + initZones(); } OSystem_SDL_Symbian::~OSystem_SDL_Symbian() { @@ -165,8 +179,7 @@ void OSystem_SDL_Symbian::symbianMix(byte *samples, int len){ int16* bitmixDst=(int16*)samples; int16* bitmixSrc=(int16*)_stereo_mix_buffer; - for(int loop=len/2;loop>=0;loop--) - { + for(int loop=len/2;loop>=0;loop--){ *bitmixDst=(*bitmixSrc+*(bitmixSrc+1))>>1; bitmixDst++; bitmixSrc+=2; @@ -177,6 +190,152 @@ void OSystem_SDL_Symbian::symbianMix(byte *samples, int len){ } +/** + * This is an implementation by the remapKey function + * @param SDL_Event to remap + * @param ScumVM event to modify if special result is requested + * @return true if Event has a valid return status + */ +bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev,Event &event) +{ + if(!GUI::Actions::Instance()->mappingActive() && ev.key.keysym.sym>SDLK_UNKNOWN) + for(TInt loop=0;loop<GUI::ACTION_LAST;loop++){ + if(GUI::Actions::Instance()->getMapping(loop) ==ev.key.keysym.sym && + GUI::Actions::Instance()->isEnabled(loop)){ + // Create proper event instead + switch(loop) + { + case GUI::ACTION_UP: + if(ev.type == SDL_KEYDOWN) + { + _km.y_vel = -1; + _km.y_down_count = 1; + } + else + { + _km.y_vel = 0; + _km.y_down_count = 0; + } + event.type = EVENT_MOUSEMOVE; + fillMouseEvent(event, _km.x, _km.y); + return true; + case GUI::ACTION_DOWN: + if(ev.type == SDL_KEYDOWN) + { + _km.y_vel = 1; + _km.y_down_count = 1; + } + else + { + _km.y_vel = 0; + _km.y_down_count = 0; + } + event.type = EVENT_MOUSEMOVE; + fillMouseEvent(event, _km.x, _km.y); + return true; + case GUI::ACTION_LEFT: + if(ev.type == SDL_KEYDOWN) + { + _km.x_vel = -1; + _km.x_down_count = 1; + } + else + { + _km.x_vel = 0; + _km.x_down_count = 0; + } + event.type = EVENT_MOUSEMOVE; + fillMouseEvent(event, _km.x, _km.y); + return true; + case GUI::ACTION_RIGHT: + if(ev.type == SDL_KEYDOWN) + { + _km.x_vel = 1; + _km.x_down_count = 1; + } + else + { + _km.x_vel = 0; + _km.x_down_count = 0; + } + event.type = EVENT_MOUSEMOVE; + fillMouseEvent(event, _km.x, _km.y); + return true; + case GUI::ACTION_LEFTCLICK: + event.type = ev.type == SDL_KEYDOWN?EVENT_LBUTTONDOWN:EVENT_LBUTTONUP; + fillMouseEvent(event, _km.x, _km.y); + return true; + case GUI::ACTION_RIGHTCLICK: + event.type = ev.type == SDL_KEYDOWN?EVENT_RBUTTONDOWN:EVENT_RBUTTONUP; + fillMouseEvent(event, _km.x, _km.y); + return true; + case GUI::ACTION_ZONE: + if(ev.type == SDL_KEYDOWN) + { + int i; + + for (i=0; i<TOTAL_ZONES; i++) + if (_km.x >= _zones[i].x && _km.y >= _zones[i].y && + _km.x <= _zones[i].x + _zones[i].width && _km.y <= _zones[i].y + _zones[i].height + ) { + _mouseXZone[i] = _km.x; + _mouseYZone[i] = _km.y; + break; + } + _currentZone++; + if (_currentZone >= TOTAL_ZONES) + _currentZone = 0; + event.type = EVENT_MOUSEMOVE; + fillMouseEvent(event, _mouseXZone[_currentZone],_mouseYZone[_currentZone]); + SDL_WarpMouse(event.mouse.x,event.mouse.y); + } + return true; + case GUI::ACTION_SAVE: + case GUI::ACTION_SKIP: + case GUI::ACTION_FT_CHEAT: + case GUI::ACTION_SKIP_TEXT: + case GUI::ACTION_PAUSE: + { + GUI::Key& key = GUI::Actions::Instance()->getKeyAction(loop); + ev.key.keysym.sym =(SDLKey) key.ascii(); + ev.key.keysym.scancode= key.keycode(); + ev.key.keysym.mod =(SDLMod) key.flags(); + return false; + } + case GUI::ACTION_QUIT:{ + GUI::MessageDialog alert("Do you want to quit ?", "Yes", "No"); + if (alert.runModal() == GUI::kMessageOK) + quit(); + return true; + } + } + } + } + return false; +} + +void OSystem_SDL_Symbian::setWindowCaption(const char *caption) { + OSystem_SDL::setWindowCaption(caption); + check_mappings(); +} + +void OSystem_SDL_Symbian::check_mappings() { + if (!GUI::Actions::Instance()->gameDetector()._targetName.size() || GUI::Actions::Instance()->initialized()) + return; + + GUI::Actions::Instance()->initInstanceGame(); +} + +void OSystem_SDL_Symbian::initZones() { + int i; + + _currentZone = 0; + for (i=0; i<TOTAL_ZONES; i++) { + _mouseXZone[i] = (_zones[i].x + (_zones[i].width / 2)); + _mouseYZone[i] = (_zones[i].y + (_zones[i].height / 2)); + } +} + /* // probably don't need this anymore: will remove later #define EMPTY_SCALER_IMPLEMENTATION(x) \ diff --git a/backends/epoc/SymbianOS.h b/backends/epoc/SymbianOS.h index abe72dc57d..5f281cfd3b 100644 --- a/backends/epoc/SymbianOS.h +++ b/backends/epoc/SymbianOS.h @@ -26,6 +26,8 @@ #include "sdl-common.h" +#define TOTAL_ZONES 3 + class OSystem_SDL_Symbian : public OSystem_SDL { public: OSystem_SDL_Symbian(); @@ -53,6 +55,23 @@ protected: */ void symbianMix(byte *samples, int len); + /** + * This is an implementation by the remapKey function + * @param SDL_Event to remap + * @param ScumVM event to modify if special result is requested + * @return true if Event has a valid return status + */ + bool remapKey(SDL_Event &ev,Event &event); + + void setWindowCaption(const char *caption); + + /** + * Used to intialized special game mappings + */ + void check_mappings(); + + void initZones(); + // Audio int _channels; @@ -60,6 +79,19 @@ protected: void *_sound_proc_param; byte* _stereo_mix_buffer; + // Used to handle joystick navi zones + int _mouseXZone[TOTAL_ZONES]; + int _mouseYZone[TOTAL_ZONES]; + int _currentZone; + + typedef struct zoneDesc { + int x; + int y; + int width; + int height; + } zoneDesc; + + static zoneDesc _zones[TOTAL_ZONES]; }; #endif diff --git a/backends/epoc/build/S60/BLD.INF b/backends/epoc/build/S60/BLD.INF index 25d2d236ca..b65f65c7e2 100644 --- a/backends/epoc/build/S60/BLD.INF +++ b/backends/epoc/build/S60/BLD.INF @@ -10,3 +10,4 @@ PRJ_MMPFILES ..\scummvm_gob.mmp .\EScummVM_S60.mmp .\EScummVM_S60_App.mmp +.\EScummVM_S60_Exe.mmp diff --git a/backends/epoc/build/S60/EScummVM_S60.mmp b/backends/epoc/build/S60/EScummVM_S60.mmp index 9fe8e1e9c7..143306a72c 100644 --- a/backends/epoc/build/S60/EScummVM_S60.mmp +++ b/backends/epoc/build/S60/EScummVM_S60.mmp @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: + * $Header$ */ // @@ -27,22 +27,22 @@ // *** Definitions -#if defined(WINS) - TARGET EScummVM.dll -#else - TARGET EScummVM.exe -#endif -TARGETPATH system\apps\EScummVMs60 -TARGETTYPE EXEDLL +TARGET ESCUMMVM.APP +TARGETPATH system\apps\EScummVM +TARGETTYPE app // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION MSVC /QIfist /Ob1 /Oy /GF //OPTION GCC -O3 -funroll-loops -finline-functions -ffast-math -frerun-loop-opt -fconserve-space -fexpensive-optimizations -Wno-multichar -Wno-reorder -sourcepath ..\ -EPOCSTACKSIZE 0x00008000 EPOCHEAPSIZE 1024 5242880 +EPOCSTACKSIZE 0x80008000 // this enables ECompXL app compression +AIF EScummVm.Aif ..\ ScummVmAif.rss c16 ScummL.bmp ScummLM.bmp ScummS.bmp ScummSM.bmp // mine still fails: I think it's because I have JRE 1.5 instead of 1.3 :P +UID 0x100039ce 0x101f9b57 + +RESOURCE EScummVM.rss MACRO S60 +MACRO EPOC_AS_APP MACRO NONSTANDARD_PORT // these need too high a resolution @@ -100,8 +100,12 @@ SOURCE backends\sdl\graphics.cpp SOURCE backends\sdl\sdl.cpp SOURCE backends\fs\symbian\symbian-fs.cpp SOURCE backends\epoc\SymbianOS.cpp +SOURCE backends\epoc\SymbianActions.cpp SOURCE backends\epoc\ScummApp.cpp +SOURCE gui\Key.cpp +SOURCE gui\KeysDialog.cpp +SOURCE gui\Actions.cpp // *** Dynamic Libraries LIBRARY cone.lib eikcore.lib diff --git a/backends/epoc/build/S60/EScummVM_S60_EXE.mmp b/backends/epoc/build/S60/EScummVM_S60_EXE.mmp new file mode 100644 index 0000000000..ebb58553bb --- /dev/null +++ b/backends/epoc/build/S60/EScummVM_S60_EXE.mmp @@ -0,0 +1,95 @@ +// +// EPOC S60 MMP makefile project for ScummVM +// + +// *** Definitions + +#if defined(WINS) + TARGET EScummVM.dll +#else + TARGET EScummVM.exe +#endif +TARGETPATH system\apps\EScummVMs60 +TARGETTYPE EXEDLL + // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp +OPTION MSVC /QIfist /Ob1 /Oy /GF +//OPTION GCC -O3 -funroll-loops -finline-functions -ffast-math -frerun-loop-opt -fconserve-space -fexpensive-optimizations -Wno-multichar -Wno-reorder +sourcepath ..\ + +EPOCSTACKSIZE 0x00008000 + +EPOCHEAPSIZE 1024 5242880 + +MACRO S60 +MACRO NONSTANDARD_PORT + +// these need too high a resolution +MACRO DISABLE_SWORD1 +MACRO DISABLE_SWORD2 +// these are not ready to be released +MACRO DISABLE_SAGA +MACRO DISABLE_KYRA +// these work, so don't disable them :) +//MACRO DISABLE_SIMON +//MACRO DISABLE_SKY +//MACRO DISABLE_QUEEN +//MACRO DISABLE_GOB + +// *** Static Libraries + +STATICLIBRARY scummvm_scumm.lib +STATICLIBRARY scummvm_simon.lib +STATICLIBRARY scummvm_sky.lib +STATICLIBRARY scummvm_queen.lib +STATICLIBRARY scummvm_gob.lib +STATICLIBRARY scummvm_base.lib + +STATICLIBRARY libmad.lib +STATICLIBRARY zlib.lib +STATICLIBRARY esdl_exe.lib +#if !defined(WINS) +STATICLIBRARY egcc.lib // for __fixunsdfsi +#endif +// *** Include paths + +USERINCLUDE ..\..\..\.. ..\..\..\..\common ..\..\..\..\gui +USERINCLUDE ..\..\..\..\backends\fs ..\..\..\..\backends\epoc ..\..\..\..\backends\sdl ..\..\..\..\sound + +SYSTEMINCLUDE \epoc32\include\ESDL +SYSTEMINCLUDE \epoc32\include\ZLIB // before \epoc32\include because symbian already has older version +SYSTEMINCLUDE \epoc32\include\libc +SYSTEMINCLUDE \epoc32\include +SYSTEMINCLUDE ..\..\..\..\backends\epoc // for portdefs.h + +// *** SOURCE files + +SOURCEPATH ..\..\..\.. + +//START_AUTO_OBJECTS_BASE_// Updated @ Tue May 31 18:35:38 2005 +SOURCE base\engine.cpp +SOURCE base\gameDetector.cpp +SOURCE base\main.cpp +SOURCE base\plugins.cpp +//STOP_AUTO_OBJECTS_BASE_// + +// backend EPOC/SDL/ESDL specific includes +SOURCE backends\sdl\events.cpp +SOURCE backends\sdl\graphics.cpp +SOURCE backends\sdl\sdl.cpp +SOURCE backends\fs\symbian\symbian-fs.cpp +SOURCE backends\epoc\SymbianOS.cpp +SOURCE backends\epoc\SymbianActions.cpp +SOURCE backends\epoc\ScummApp.cpp + +SOURCE gui\Key.cpp +SOURCE gui\KeysDialog.cpp +SOURCE gui\Actions.cpp +// *** Dynamic Libraries + +LIBRARY cone.lib eikcore.lib +LIBRARY euser.lib apparc.lib fbscli.lib +LIBRARY estlib.lib apgrfx.lib +LIBRARY gdi.lib hal.lib bitgdi.lib +LIBRARY mediaclientaudiostream.lib efsrv.lib ws32.lib +LIBRARY AVKON.LIB + diff --git a/backends/epoc/build/S60/ScummVMApp.cpp b/backends/epoc/build/S60/ScummVMApp.cpp index 1702a88ba7..93a28694c3 100644 --- a/backends/epoc/build/S60/ScummVMApp.cpp +++ b/backends/epoc/build/S60/ScummVMApp.cpp @@ -95,6 +95,7 @@ void CScummVMUi::ConstructL() { lsSession.StartApp(*cmdLine,iThreadId); CleanupStack::PopAndDestroy();//close lsSession CleanupStack::PopAndDestroy(cmdLine); + User::After(500000);// Let the application start TApaTaskList taskList(iEikonEnv->WsSession()); TApaTask myTask=taskList.FindApp(TUid::Uid(0x101f9b57)); diff --git a/backends/epoc/build/S80/EScummVM_S80.mmp b/backends/epoc/build/S80/EScummVM_S80.mmp index 4b12e269b7..3e843ab2cf 100644 --- a/backends/epoc/build/S80/EScummVM_S80.mmp +++ b/backends/epoc/build/S80/EScummVM_S80.mmp @@ -100,8 +100,12 @@ SOURCE backends\sdl\graphics.cpp SOURCE backends\sdl\sdl.cpp SOURCE backends\fs\symbian\symbian-fs.cpp SOURCE backends\epoc\SymbianOS.cpp +SOURCE backends\epoc\SymbianActions.cpp SOURCE backends\epoc\ScummApp.cpp +SOURCE gui\Key.cpp +SOURCE gui\KeysDialog.cpp +SOURCE gui\Actions.cpp // *** Dynamic Libraries LIBRARY cone.lib eikcore.lib diff --git a/backends/epoc/build/S90/EScummvm_S90.mmp b/backends/epoc/build/S90/EScummvm_S90.mmp index 6327b93c74..79d729b2a1 100644 --- a/backends/epoc/build/S90/EScummvm_S90.mmp +++ b/backends/epoc/build/S90/EScummvm_S90.mmp @@ -100,8 +100,12 @@ SOURCE backends\sdl\graphics.cpp SOURCE backends\sdl\sdl.cpp SOURCE backends\fs\symbian\symbian-fs.cpp SOURCE backends\epoc\SymbianOS.cpp +SOURCE backends\epoc\SymbianActions.cpp SOURCE backends\epoc\ScummApp.cpp +SOURCE gui\Key.cpp +SOURCE gui\KeysDialog.cpp +SOURCE gui\Actions.cpp // *** Dynamic Libraries LIBRARY cone.lib eikcore.lib diff --git a/backends/epoc/build/UIQ/EScummVM.rss b/backends/epoc/build/UIQ/EScummVM.rss index 470e819220..72f798781d 100644 --- a/backends/epoc/build/UIQ/EScummVM.rss +++ b/backends/epoc/build/UIQ/EScummVM.rss @@ -28,7 +28,7 @@ NAME SCUM // Include definitions of resource STRUCTS used by this // resource script #include <eikon.rh> -#include "..\backends\epoc\Scummvm.hrh" +#include "..\..\Scummvm.hrh" // Include the standard Eikon resource ids #include <eikon.rsg> @@ -41,22 +41,5 @@ RESOURCE TBUF16 { buf=""; } RESOURCE EIK_APP_INFO { - menubar = r_scum_menubar; } -RESOURCE MENU_BAR r_scum_menubar // *** Menu bar -{ - titles = - { - MENU_TITLE { menu_pane = r_scum_menu; txt = "ScummVM"; } - }; -} - -RESOURCE MENU_PANE r_scum_menu // *** Submenu -{ - items = - { - - MENU_ITEM{command = EEikCmdExit;txt = "Exit";} - }; -} diff --git a/backends/epoc/build/UIQ/EScummVM_UIQ.mmp b/backends/epoc/build/UIQ/EScummVM_UIQ.mmp index c0ad2e1bef..fd4acda861 100644 --- a/backends/epoc/build/UIQ/EScummVM_UIQ.mmp +++ b/backends/epoc/build/UIQ/EScummVM_UIQ.mmp @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: + * $Header$ */ // @@ -36,11 +36,12 @@ OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way RESOURCE EScummVM.rss EPOCSTACKSIZE 0x80008000 // this enables ECompXL app compression -AIF EScummVm.Aif ..\ ScummVmAif.rss c16 ScummL.bmp ScummLM.bmp ScummS.bmp ScummSM.bmp // still fails? +AIF EScummVm.Aif ..\ ScummVmAif.rss c16 ScummL.bmp ScummLM.bmp ScummS.bmp ScummSM.bmp // mine still fails: I think it's because I have JRE 1.5 instead of 1.3 :P UID 0x100039ce 0x101f9b57 MACRO UIQ MACRO NONSTANDARD_PORT +MACRO EPOC_AS_APP // these need too high a resolution MACRO DISABLE_SWORD1 @@ -98,8 +99,13 @@ SOURCE backends\sdl\graphics.cpp SOURCE backends\sdl\sdl.cpp SOURCE backends\fs\symbian\symbian-fs.cpp SOURCE backends\epoc\SymbianOS.cpp +SOURCE backends\epoc\SymbianActions.cpp SOURCE backends\epoc\ScummApp.cpp +SOURCE gui\Key.cpp +SOURCE gui\KeysDialog.cpp +SOURCE gui\Actions.cpp + // *** Dynamic Libraries LIBRARY cone.lib eikcore.lib diff --git a/backends/epoc/build/scummvm_base.mmp b/backends/epoc/build/scummvm_base.mmp index e7c0a5f3de..9fb213935f 100644 --- a/backends/epoc/build/scummvm_base.mmp +++ b/backends/epoc/build/scummvm_base.mmp @@ -21,7 +21,6 @@ * $Header: */ - // // EPOC MMP makefile project for ScummVM // diff --git a/backends/sdl/events.cpp b/backends/sdl/events.cpp index cdc803409c..f195b11e86 100644 --- a/backends/sdl/events.cpp +++ b/backends/sdl/events.cpp @@ -189,7 +189,7 @@ bool OSystem_SDL::pollEvent(Event &event) { while(SDL_PollEvent(&ev)) { switch(ev.type) { - case SDL_KEYDOWN: + case SDL_KEYDOWN:{ b = event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState()); // Alt-Return and Alt-Enter toggle full screen mode @@ -331,78 +331,24 @@ bool OSystem_SDL::pollEvent(Event &event) { } break; } - -#ifdef LINUPY - // On Yopy map the End button to quit - if ((ev.key.keysym.sym == 293)) { - event.type = EVENT_QUIT; - return true; - } - // Map menu key to f5 (scumm menu) - if (ev.key.keysym.sym == 306) { - event.type = EVENT_KEYDOWN; - event.kbd.keycode = SDLK_F5; - event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); - return true; - } - // Map action key to action - if (ev.key.keysym.sym == 291) { - event.type = EVENT_KEYDOWN; - event.kbd.keycode = SDLK_TAB; - event.kbd.ascii = mapKey(SDLK_TAB, ev.key.keysym.mod, 0); - return true; - } - // Map OK key to skip cinematic - if (ev.key.keysym.sym == 292) { - event.type = EVENT_KEYDOWN; - event.kbd.keycode = SDLK_ESCAPE; - event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); + const bool event_complete= remapKey(ev,event); + + if(event_complete) return true; - } -#endif -#ifdef QTOPIA - // quit on fn+backspace on zaurus - if (ev.key.keysym.sym == 127) { - event.type = EVENT_QUIT; - return true; - } - - // map menu key (f11) to f5 (scumm menu) - if (ev.key.keysym.sym == SDLK_F11) { - event.type = EVENT_KEYDOWN; - event.kbd.keycode = SDLK_F5; - event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); - } - // map center (space) to tab (default action ) - // I wanted to map the calendar button but the calendar comes up - // - else if (ev.key.keysym.sym == SDLK_SPACE) { - event.type = EVENT_KEYDOWN; - event.kbd.keycode = SDLK_TAB; - event.kbd.ascii = mapKey(SDLK_TAB, ev.key.keysym.mod, 0); - } - // since we stole space (pause) above we'll rebind it to the tab key on the keyboard - else if (ev.key.keysym.sym == SDLK_TAB) { - event.type = EVENT_KEYDOWN; - event.kbd.keycode = SDLK_SPACE; - event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); - } else { - // let the events fall through if we didn't change them, this may not be the best way to - // set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though. - // and yes i have an huge terminal size so i dont wrap soon enough. - event.type = EVENT_KEYDOWN; - event.kbd.keycode = ev.key.keysym.sym; - event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); - } -#else event.type = EVENT_KEYDOWN; event.kbd.keycode = ev.key.keysym.sym; event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); -#endif + return true; - + } case SDL_KEYUP: + { + const bool event_complete= remapKey(ev,event); + + if(event_complete) + return true; + event.type = EVENT_KEYUP; event.kbd.keycode = ev.key.keysym.sym; event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); @@ -415,7 +361,7 @@ bool OSystem_SDL::pollEvent(Event &event) { } return true; - + } case SDL_MOUSEMOTION: event.type = EVENT_MOUSEMOVE; fillMouseEvent(event, ev.motion.x, ev.motion.y); @@ -571,4 +517,71 @@ bool OSystem_SDL::pollEvent(Event &event) { return false; } +bool OSystem_SDL::remapKey(SDL_Event &ev,Event &event){ +#ifdef LINUPY + // On Yopy map the End button to quit + if ((ev.key.keysym.sym == 293)) { + event.type = EVENT_QUIT; + return true; + } + // Map menu key to f5 (scumm menu) + if (ev.key.keysym.sym == 306) { + event.type = EVENT_KEYDOWN; + event.kbd.keycode = SDLK_F5; + event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); + return true; + } + // Map action key to action + if (ev.key.keysym.sym == 291) { + event.type = EVENT_KEYDOWN; + event.kbd.keycode = SDLK_TAB; + event.kbd.ascii = mapKey(SDLK_TAB, ev.key.keysym.mod, 0); + return true; + } + // Map OK key to skip cinematic + if (ev.key.keysym.sym == 292) { + event.type = EVENT_KEYDOWN; + event.kbd.keycode = SDLK_ESCAPE; + event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); + return true; + } +#endif + +#ifdef QTOPIA + // quit on fn+backspace on zaurus + if (ev.key.keysym.sym == 127) { + event.type = EVENT_QUIT; + return true; + } + + // map menu key (f11) to f5 (scumm menu) + if (ev.key.keysym.sym == SDLK_F11) { + event.type = EVENT_KEYDOWN; + event.kbd.keycode = SDLK_F5; + event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); + } + // map center (space) to tab (default action ) + // I wanted to map the calendar button but the calendar comes up + // + else if (ev.key.keysym.sym == SDLK_SPACE) { + event.type = EVENT_KEYDOWN; + event.kbd.keycode = SDLK_TAB; + event.kbd.ascii = mapKey(SDLK_TAB, ev.key.keysym.mod, 0); + } + // since we stole space (pause) above we'll rebind it to the tab key on the keyboard + else if (ev.key.keysym.sym == SDLK_TAB) { + event.type = EVENT_KEYDOWN; + event.kbd.keycode = SDLK_SPACE; + event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); + } else { + // let the events fall through if we didn't change them, this may not be the best way to + // set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though. + // and yes i have an huge terminal size so i dont wrap soon enough. + event.type = EVENT_KEYDOWN; + event.kbd.keycode = ev.key.keysym.sym; + event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); + } +#endif + return false; +} diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index 036a63fd05..87e2eb3a34 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -196,6 +196,8 @@ public: #endif protected: + virtual bool remapKey(SDL_Event &ev, Event &event); + bool _inited; #ifdef USE_OSD diff --git a/backends/wince/CEActions.cpp b/backends/wince/CEActions.cpp index 534683ea62..2e7d9fd4b8 100644 --- a/backends/wince/CEActions.cpp +++ b/backends/wince/CEActions.cpp @@ -53,7 +53,7 @@ void CEActions::init(GameDetector &detector) { //#endif } -void CEActions::initInstanceMain(OSystem_WINCE3 *mainSystem) { +void CEActions::initInstanceMain(OSystem *mainSystem) { _mainSystem = mainSystem; } diff --git a/backends/wince/CEActions.h b/backends/wince/CEActions.h index e146fb5ae9..fddd935ba6 100644 --- a/backends/wince/CEActions.h +++ b/backends/wince/CEActions.h @@ -41,7 +41,7 @@ class CEActions { public: static CEActions* Instance(); static void init(GameDetector &detector); - virtual void initInstanceMain(OSystem_WINCE3 *mainSystem); + virtual void initInstanceMain(OSystem *mainSystem); virtual void initInstanceGame(); bool initialized(); diff --git a/backends/wince/CEActionsPocket.cpp b/backends/wince/CEActionsPocket.cpp index 342a3baa28..6c55be3fa5 100644 --- a/backends/wince/CEActionsPocket.cpp +++ b/backends/wince/CEActionsPocket.cpp @@ -51,7 +51,7 @@ void CEActionsPocket::init(GameDetector &detector) { } -String CEActionsPocket::actionName(ActionType action) { +String CEActionsPocket::actionName(GUI::ActionType action) { return pocketActionNames[action]; } @@ -68,7 +68,7 @@ int CEActionsPocket::version() { } CEActionsPocket::CEActionsPocket(GameDetector &detector) : - CEActions(detector) +GUI::Actions(detector) { int i; @@ -83,9 +83,10 @@ CEActionsPocket::CEActionsPocket(GameDetector &detector) : } -void CEActionsPocket::initInstanceMain(OSystem_WINCE3 *mainSystem) { +void CEActionsPocket::initInstanceMain(OSystem *mainSystem) { // Nothing generic to do for Pocket PC - CEActions::initInstanceMain(mainSystem); + _CESystem = static_cast<OSystem_WINCE3*>(mainSystem); + GUI_Actions::initInstanceMain(mainSystem); } void CEActionsPocket::initInstanceGame() { @@ -97,7 +98,7 @@ void CEActionsPocket::initInstanceGame() { bool is_comi = (strncmp(_detector->_targetName.c_str(), "comi", 4) == 0); bool is_gob = (strncmp(_detector->_targetName.c_str(), "gob", 3) == 0); - CEActions::initInstanceGame(); + 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 || @@ -164,11 +165,11 @@ void CEActionsPocket::initInstanceGame() { CEActionsPocket::~CEActionsPocket() { } -bool CEActionsPocket::perform(ActionType action, bool pushed) { +bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) { if (!pushed) { switch(action) { case POCKET_ACTION_RIGHTCLICK: - _mainSystem->add_right_click(false); + _CESystem->add_right_click(false); return true; case POCKET_ACTION_PAUSE: case POCKET_ACTION_SAVE: @@ -189,28 +190,28 @@ bool CEActionsPocket::perform(ActionType action, bool pushed) { EventsBuffer::simulateKey(&_key_action[action], true); return true; case POCKET_ACTION_KEYBOARD: - _mainSystem->swap_panel(); + _CESystem->swap_panel(); return true; case POCKET_ACTION_HIDE: - _mainSystem->swap_panel_visibility(); + _CESystem->swap_panel_visibility(); return true; case POCKET_ACTION_SOUND: - _mainSystem->swap_sound_master(); + _CESystem->swap_sound_master(); return true; case POCKET_ACTION_RIGHTCLICK: - _mainSystem->add_right_click(true); + _CESystem->add_right_click(true); return true; case POCKET_ACTION_CURSOR: - _mainSystem->swap_mouse_visibility(); + _CESystem->swap_mouse_visibility(); return true; case POCKET_ACTION_FREELOOK: - _mainSystem->swap_freeLook(); + _CESystem->swap_freeLook(); return true; case POCKET_ACTION_ZOOM_UP: - _mainSystem->swap_zoom_up(); + _CESystem->swap_zoom_up(); return true; case POCKET_ACTION_ZOOM_DOWN: - _mainSystem->swap_zoom_down(); + _CESystem->swap_zoom_down(); return true; case POCKET_ACTION_QUIT: GUI::MessageDialog alert("Do you want to quit ?", "Yes", "No"); diff --git a/backends/wince/CEActionsPocket.h b/backends/wince/CEActionsPocket.h index a473371a60..ce5ac1499a 100644 --- a/backends/wince/CEActionsPocket.h +++ b/backends/wince/CEActionsPocket.h @@ -29,9 +29,9 @@ #include "base/gameDetector.h" #include "wince-sdl.h" -#include "Key.h" +#include "gui/Key.h" -#include "CEActions.h" +#include "gui/Actions.h" #define POCKET_ACTION_VERSION 4 @@ -53,15 +53,15 @@ enum pocketActionType { POCKET_ACTION_LAST }; -class CEActionsPocket : public CEActions { +class CEActionsPocket : public GUI::Actions { public: // Actions - bool perform(ActionType action, bool pushed = true); - String actionName(ActionType action); + bool perform(GUI::ActionType action, bool pushed = true); + String actionName(GUI::ActionType action); int size(); static void init(GameDetector &detector); - void initInstanceMain(OSystem_WINCE3 *mainSystem); + void initInstanceMain(OSystem *mainSystem); void initInstanceGame(); // Action domain @@ -79,6 +79,7 @@ class CEActionsPocket : public CEActions { bool _right_click_needed; bool _hide_toolbar_needed; bool _zoom_needed; + OSystem_WINCE3 *_CESystem; }; #endif diff --git a/backends/wince/CEActionsSmartphone.cpp b/backends/wince/CEActionsSmartphone.cpp index b732360f28..c8938b8859 100644 --- a/backends/wince/CEActionsSmartphone.cpp +++ b/backends/wince/CEActionsSmartphone.cpp @@ -57,7 +57,7 @@ void CEActionsSmartphone::init(GameDetector &detector) { } -String CEActionsSmartphone::actionName(ActionType action) { +String CEActionsSmartphone::actionName(GUI::ActionType action) { return smartphoneActionNames[action]; } @@ -74,7 +74,7 @@ int CEActionsSmartphone::version() { } CEActionsSmartphone::CEActionsSmartphone(GameDetector &detector) : - CEActions(detector) +GUI::Actions(detector) { int i; @@ -85,9 +85,9 @@ CEActionsSmartphone::CEActionsSmartphone(GameDetector &detector) : } -void CEActionsSmartphone::initInstanceMain(OSystem_WINCE3 *mainSystem) { - CEActions::initInstanceMain(mainSystem); - +void CEActionsSmartphone::initInstanceMain(OSystem *mainSystem) { + _CESystem = static_cast<OSystem_WINCE3*>(mainSystem); + GUI_Actions::initInstanceMain(mainSystem); // Mouse Up _action_enabled[SMARTPHONE_ACTION_UP] = true; // Mouse Down @@ -108,7 +108,7 @@ void CEActionsSmartphone::initInstanceGame() { bool is_queen = (_detector->_targetName == "queen"); bool is_gob = (strncmp(_detector->_targetName.c_str(), "gob", 3) == 0); - CEActions::initInstanceGame(); + GUI_Actions::initInstanceGame(); // See if a right click mapping could be needed if (is_sky || _detector->_targetName == "samnmax" || is_gob) @@ -149,14 +149,14 @@ void CEActionsSmartphone::initInstanceGame() { CEActionsSmartphone::~CEActionsSmartphone() { } -bool CEActionsSmartphone::perform(ActionType action, bool pushed) { +bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { if (!pushed) { switch (action) { case SMARTPHONE_ACTION_RIGHTCLICK: - _mainSystem->add_right_click(false); + _CESystem->add_right_click(false); return true; case SMARTPHONE_ACTION_LEFTCLICK: - _mainSystem->add_left_click(false); + _CESystem->add_left_click(false); return true; case SMARTPHONE_ACTION_SAVE: case SMARTPHONE_ACTION_SKIP: @@ -174,25 +174,25 @@ bool CEActionsSmartphone::perform(ActionType action, bool pushed) { EventsBuffer::simulateKey(&_key_action[action], true); return true; case SMARTPHONE_ACTION_RIGHTCLICK: - _mainSystem->add_right_click(true); + _CESystem->add_right_click(true); return true; case SMARTPHONE_ACTION_LEFTCLICK: - _mainSystem->add_left_click(true); + _CESystem->add_left_click(true); return true; case SMARTPHONE_ACTION_UP: - _mainSystem->move_cursor_up(); + _CESystem->move_cursor_up(); return true; case SMARTPHONE_ACTION_DOWN: - _mainSystem->move_cursor_down(); + _CESystem->move_cursor_down(); return true; case SMARTPHONE_ACTION_LEFT: - _mainSystem->move_cursor_left(); + _CESystem->move_cursor_left(); return true; case SMARTPHONE_ACTION_RIGHT: - _mainSystem->move_cursor_right(); + _CESystem->move_cursor_right(); return true; case SMARTPHONE_ACTION_ZONE: - _mainSystem->switch_zone(); + _CESystem->switch_zone(); return true; } diff --git a/backends/wince/CEActionsSmartphone.h b/backends/wince/CEActionsSmartphone.h index 5a48b4c762..b532e2004c 100644 --- a/backends/wince/CEActionsSmartphone.h +++ b/backends/wince/CEActionsSmartphone.h @@ -31,9 +31,9 @@ #include "base/gameDetector.h" #include "wince-sdl.h" -#include "Key.h" +#include "gui/Key.h" -#include "CEActions.h" +#include "gui/Actions.h" #define SMARTPHONE_ACTION_VERSION 4 @@ -53,14 +53,14 @@ enum smartphoneActionType { }; -class CEActionsSmartphone : public CEActions { +class CEActionsSmartphone : public GUI::Actions { public: // Actions - bool perform(ActionType action, bool pushed = true); - String actionName(ActionType action); + bool perform(GUI::ActionType action, bool pushed = true); + String actionName(GUI::ActionType action); int size(); static void init(GameDetector &detector); - void initInstanceMain(OSystem_WINCE3 *mainSystem); + void initInstanceMain(OSystem *mainSystem); void initInstanceGame(); // Action domain @@ -71,6 +71,7 @@ class CEActionsSmartphone : public CEActions { private: CEActionsSmartphone(GameDetector &detector); bool _right_click_needed; + OSystem_WINCE3 *_CESystem; }; #endif diff --git a/backends/wince/CELauncherDialog.cpp b/backends/wince/CELauncherDialog.cpp index cf6d65c346..9de00a1231 100644 --- a/backends/wince/CELauncherDialog.cpp +++ b/backends/wince/CELauncherDialog.cpp @@ -43,7 +43,7 @@ public: : Dialog(10, 60, 300, 77) { char tempo[100]; - addButton((_w - kButtonWidth) / 2, 45, "OK", kCloseCmd, '\r'); // Close dialog - FIXME + addButton(this,(_w - kButtonWidth) / 2, 45, "OK", kCloseCmd, '\r'); // Close dialog - FIXME Common::String videoDriver("Using SDL driver "); SDL_VideoDriverName(tempo, sizeof(tempo)); @@ -61,7 +61,7 @@ public: CEConflictDialog::CEConflictDialog(const Common::String &name) : Dialog(10, 60, 300, 77) { - addButton((_w - kButtonWidth) / 2, 45, "OK", kCloseCmd, '\r'); // Close dialog - FIXME + addButton(this,(_w - kButtonWidth) / 2, 45, "OK", kCloseCmd, '\r'); // Close dialog - FIXME Common::String conflict("Too many matches for directory "); conflict += name; diff --git a/backends/wince/CEScaler.cpp b/backends/wince/CEScaler.cpp index e07c7f8ad2..394dbeb066 100644 --- a/backends/wince/CEScaler.cpp +++ b/backends/wince/CEScaler.cpp @@ -18,7 +18,7 @@ * $Header$ * */ - +#include "common/scaler/intern.h" #include "common/stdafx.h" #include "CEScaler.h" diff --git a/backends/wince/CEkeys/Key.cpp b/backends/wince/CEkeys/Key.cpp deleted file mode 100644 index 1cf9f0eaa2..0000000000 --- a/backends/wince/CEkeys/Key.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001-2005 The ScummVM project - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "common/stdafx.h" -#include "Key.h" - -namespace CEKEYS { - Key::Key() : - _ascii(0), _keycode(0), _flags(0) { - } - - Key::Key(int ascii, int keycode, int flags) : - _ascii(ascii), _keycode(keycode), _flags(flags) { - } - - int Key::ascii() { - return _ascii; - } - - int Key::keycode() { - return _keycode; - } - - int Key::flags() { - return _flags; - } - - - void Key::setAscii(int ascii) { - _ascii = ascii; - _keycode = ascii; // default - } - - void Key::setKeycode(int keycode) { - _keycode = keycode; - } - - void Key::setFlags(int flags) { - _flags = flags; - } -} diff --git a/backends/wince/CEkeys/Key.h b/backends/wince/CEkeys/Key.h deleted file mode 100644 index 0901f32444..0000000000 --- a/backends/wince/CEkeys/Key.h +++ /dev/null @@ -1,48 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001-2005 The ScummVM project - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#ifndef CEKEYS_KEY -#define CEKEYS_KEY - -#include "common/stdafx.h" -#include "common/scummsys.h" -#include "common/system.h" - -namespace CEKEYS { - - class Key { - public: - Key(int ascii, int keycode = 0, int flags = 0); - Key(); - void setAscii(int ascii); - void setKeycode(int keycode); - void setFlags(int flags); - int ascii(); - int keycode(); - int flags(); - private: - int _ascii; - int _keycode; - int _flags; - }; -} - -#endif
\ No newline at end of file diff --git a/backends/wince/wince-sdl.cpp b/backends/wince/wince-sdl.cpp index 1562832847..39aeae10cd 100644 --- a/backends/wince/wince-sdl.cpp +++ b/backends/wince/wince-sdl.cpp @@ -34,11 +34,11 @@ #include "resource.h" -#include "CEActions.h" +#include "gui/Actions.h" #include "CEActionsPocket.h" #include "CEActionsSmartphone.h" #include "ItemAction.h" -#include "CEKeysDialog.h" +#include "gui/KeysDialog.h" #include "gui/message.h" @@ -142,7 +142,7 @@ int SDL_main(int argc, char **argv) { /* Avoid print problems - this file will be put in RAM anyway */ stdout_file = fopen("\\scummvm_stdout.txt", "w"); stderr_file = fopen("\\scummvm_stderr.txt", "w"); - CEActions::init(_gameDetector); + GUI::Actions::init(_gameDetector); __try { return scummvm_main(_gameDetector, argc, argv); @@ -222,8 +222,8 @@ OSystem_WINCE3::OSystem_WINCE3() : OSystem_SDL(), } create_toolbar(); // Initialize global key mapping for Smartphones - CEActions::Instance()->initInstanceMain(this); - CEActions::Instance()->loadMapping(); + GUI_Actions::Instance()->initInstanceMain(this); + GUI_Actions::Instance()->loadMapping(); if (_isSmartphone) { loadSmartphoneConfiguration(); @@ -641,15 +641,15 @@ bool OSystem_WINCE3::setSoundCallback(SoundProc proc, void *param) { void OSystem_WINCE3::check_mappings() { CEActionsPocket *instance; - if (!_gameDetector._targetName.size() || CEActions::Instance()->initialized()) + if (!_gameDetector._targetName.size() || GUI_Actions::Instance()->initialized()) return; - CEActions::Instance()->initInstanceGame(); - instance = (CEActionsPocket*)CEActions::Instance(); + 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()) { - CEKeysDialog *keysDialog = new CEKeysDialog("Map right click action"); + GUI::KeysDialog *keysDialog = new GUI::KeysDialog("Map right click action"); while (!instance->getMapping(POCKET_ACTION_RIGHTCLICK)) { keysDialog->runModal(); if (!instance->getMapping(POCKET_ACTION_RIGHTCLICK)) { @@ -662,7 +662,7 @@ void OSystem_WINCE3::check_mappings() { // Map the "hide toolbar" action if needed if (instance->needsHideToolbarMapping()) { - CEKeysDialog *keysDialog = new CEKeysDialog("Map hide toolbar action"); + GUI::KeysDialog *keysDialog = new GUI::KeysDialog("Map hide toolbar action"); while (!instance->getMapping(POCKET_ACTION_HIDE)) { keysDialog->runModal(); if (!instance->getMapping(POCKET_ACTION_HIDE)) { @@ -675,17 +675,17 @@ void OSystem_WINCE3::check_mappings() { // Map the "zoom" actions if needed if (instance->needsZoomMapping()) { - CEKeysDialog *keysDialog = new CEKeysDialog("Map Zoom Up action (optional)"); + GUI::KeysDialog *keysDialog = new GUI::KeysDialog("Map Zoom Up action (optional)"); keysDialog->runModal(); delete keysDialog; - keysDialog = new CEKeysDialog("Map Zoom Down action (optional)"); + keysDialog = new GUI::KeysDialog("Map Zoom Down action (optional)"); keysDialog->runModal(); delete keysDialog; } // Extra warning for Zak Mc Kracken if (strncmp(_gameDetector._targetName.c_str(), "zak", 3) == 0 && - !CEActions::Instance()->getMapping(POCKET_ACTION_HIDE)) { + !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(); } @@ -1389,7 +1389,7 @@ bool OSystem_WINCE3::saveScreenshot(const char *filename) { static int mapKeyCE(SDLKey key, SDLMod mod, Uint16 unicode) { - if (CEActions::Instance()->mappingActive()) + if (GUI::Actions::Instance()->mappingActive()) return key; if (key >= SDLK_F1 && key <= SDLK_F9) { @@ -1540,7 +1540,7 @@ bool OSystem_WINCE3::pollEvent(Event &event) { _keyRepeat = 0; } - if (!CEActions::Instance()->mappingActive() && CEActions::Instance()->performMapped(ev.key.keysym.sym, true)) + if (!GUI_Actions::Instance()->mappingActive() && GUI_Actions::Instance()->performMapped(ev.key.keysym.sym, true)) return true; } @@ -1548,7 +1548,7 @@ bool OSystem_WINCE3::pollEvent(Event &event) { event.kbd.keycode = ev.key.keysym.sym; event.kbd.ascii = mapKeyCE(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); - if (CEActions::Instance()->mappingActive()) + if (GUI_Actions::Instance()->mappingActive()) event.kbd.flags = 0xFF; return true; @@ -1561,7 +1561,7 @@ bool OSystem_WINCE3::pollEvent(Event &event) { _lastKeyPressed = 0; } - if (!CEActions::Instance()->mappingActive() && CEActions::Instance()->performMapped(ev.key.keysym.sym, false)) + if (!GUI_Actions::Instance()->mappingActive() && GUI_Actions::Instance()->performMapped(ev.key.keysym.sym, false)) return true; } @@ -1569,7 +1569,7 @@ bool OSystem_WINCE3::pollEvent(Event &event) { event.kbd.keycode = ev.key.keysym.sym; event.kbd.ascii = mapKeyCE(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); - if (CEActions::Instance()->mappingActive()) + if (GUI_Actions::Instance()->mappingActive()) event.kbd.flags = 0xFF; return true; @@ -1648,7 +1648,7 @@ bool OSystem_WINCE3::pollEvent(Event &event) { if (currentTime > _keyRepeatTime + _keyRepeatTrigger) { _keyRepeatTime = currentTime; _keyRepeat++; - CEActions::Instance()->performMapped(_lastKeyPressed, true); + GUI_Actions::Instance()->performMapped(_lastKeyPressed, true); } } } |