[Scummvm-cvs-logs] SF.net SVN: scummvm: [22956] scummvm/trunk/backends/wince
knakos at users.sourceforge.net
knakos at users.sourceforge.net
Tue Jun 6 21:32:31 CEST 2006
Revision: 22956
Author: knakos
Date: 2006-06-06 12:31:49 -0700 (Tue, 06 Jun 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22956&view=rev
Log Message:
-----------
update the CE port to work under 0.9.0 codebase
Modified Paths:
--------------
scummvm/trunk/backends/wince/CEActionsPocket.cpp
scummvm/trunk/backends/wince/CEActionsPocket.h
scummvm/trunk/backends/wince/CEActionsSmartphone.h
scummvm/trunk/backends/wince/CEKeysDialog.cpp
scummvm/trunk/backends/wince/CELauncherDialog.cpp
scummvm/trunk/backends/wince/CEScaler.cpp
scummvm/trunk/backends/wince/CEScaler.h
scummvm/trunk/backends/wince/CEgui/Panel.cpp
scummvm/trunk/backends/wince/CEgui/Panel.h
scummvm/trunk/backends/wince/CEgui/Toolbar.h
scummvm/trunk/backends/wince/CEgui/ToolbarHandler.cpp
scummvm/trunk/backends/wince/CEgui/ToolbarHandler.h
scummvm/trunk/backends/wince/missing/assert.h
scummvm/trunk/backends/wince/missing/missing.cpp
scummvm/trunk/backends/wince/ozone.h
scummvm/trunk/backends/wince/portdefs.h
scummvm/trunk/backends/wince/wince-sdl.cpp
scummvm/trunk/backends/wince/wince-sdl.h
Modified: scummvm/trunk/backends/wince/CEActionsPocket.cpp
===================================================================
--- scummvm/trunk/backends/wince/CEActionsPocket.cpp 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEActionsPocket.cpp 2006-06-06 19:31:49 UTC (rev 22956)
@@ -54,8 +54,8 @@
"Bind Keys"
};
-void CEActionsPocket::init(const Common::String &gameid) {
- _instance = new CEActionsPocket(gameid);
+void CEActionsPocket::init() {
+ _instance = new CEActionsPocket(ConfMan.get("gameid"));
}
@@ -68,7 +68,7 @@
}
String CEActionsPocket::domain() {
- return "pocketpc";
+ return "scummvm";
}
int CEActionsPocket::version() {
@@ -76,7 +76,7 @@
}
CEActionsPocket::CEActionsPocket(const Common::String &gameid) :
-GUI::Actions(gameid)
+GUI::Actions()
{
int i;
Modified: scummvm/trunk/backends/wince/CEActionsPocket.h
===================================================================
--- scummvm/trunk/backends/wince/CEActionsPocket.h 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEActionsPocket.h 2006-06-06 19:31:49 UTC (rev 22956)
@@ -61,7 +61,7 @@
String actionName(GUI::ActionType action);
int size();
- static void init(const Common::String &gameid);
+ static void init();
void initInstanceMain(OSystem *mainSystem);
void initInstanceGame();
Modified: scummvm/trunk/backends/wince/CEActionsSmartphone.h
===================================================================
--- scummvm/trunk/backends/wince/CEActionsSmartphone.h 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEActionsSmartphone.h 2006-06-06 19:31:49 UTC (rev 22956)
@@ -60,7 +60,7 @@
bool perform(GUI::ActionType action, bool pushed = true);
String actionName(GUI::ActionType action);
int size();
- static void init(const Common::String &gameid);
+ static void init();
void initInstanceMain(OSystem *mainSystem);
void initInstanceGame();
@@ -70,7 +70,7 @@
~CEActionsSmartphone();
private:
- CEActionsSmartphone(const Common::String &gameid);
+ CEActionsSmartphone();
bool _right_click_needed;
OSystem_WINCE3 *_CESystem;
};
Modified: scummvm/trunk/backends/wince/CEKeysDialog.cpp
===================================================================
--- scummvm/trunk/backends/wince/CEKeysDialog.cpp 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEKeysDialog.cpp 2006-06-06 19:31:49 UTC (rev 22956)
@@ -42,19 +42,19 @@
CEKeysDialog::CEKeysDialog(const Common::String &title)
: GUI::Dialog(30, 20, 260, 160) {
- addButton(this, 160, 20, "Map", kMapCmd, 'M', GUI::kDefaultWidgetSize); // Map
- addButton(this, 160, 40, "OK", kOKCmd, 'O', GUI::kDefaultWidgetSize); // OK
- addButton(this, 160, 60, "Cancel", kCloseCmd, 'C', GUI::kDefaultWidgetSize); // Cancel
+ addButton(this, 160, 20, "Map", kMapCmd, 'M'); // Map
+ addButton(this, 160, 40, "OK", kOKCmd, 'O'); // OK
+ addButton(this, 160, 60, "Cancel", kCloseCmd, 'C'); // Cancel
- _actionsList = new ListWidget(this, 10, 20, 140, 90);
- _actionsList->setNumberingMode(kListNumberingZero);
-
_actionTitle = new StaticTextWidget(this, 10, 120, 240, 16, title, kTextAlignCenter);
_keyMapping = new StaticTextWidget(this, 10, 140, 240, 16, "", kTextAlignCenter);
_actionTitle->setFlags(WIDGET_CLEARBG);
_keyMapping->setFlags(WIDGET_CLEARBG);
+ _actionsList = new ListWidget(this, "Actions List");
+ _actionsList->setNumberingMode(kListNumberingZero);
+
// Get actions names
Common::StringList l;
Modified: scummvm/trunk/backends/wince/CELauncherDialog.cpp
===================================================================
--- scummvm/trunk/backends/wince/CELauncherDialog.cpp 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CELauncherDialog.cpp 2006-06-06 19:31:49 UTC (rev 22956)
@@ -99,7 +99,7 @@
strcpy(candidateName, &path[i + 1]);
candidateName[strlen(candidateName) - 1] = '\0';
for (i=0; i<candidates.size(); i++) {
- if (scumm_stricmp(candidateName, candidates[i].description) == 0) {
+ if (scumm_stricmp(candidateName, candidates[i].description.c_str()) == 0) {
idx = i;
break;
}
@@ -119,7 +119,7 @@
// The auto detector or the user made a choice.
// Pick a domain name which does not yet exist (after all, we
// are *adding* a game to the config, not replacing).
- String domain(result.description);
+ String domain(result.gameid);
if (ConfMan.hasGameDomain(domain)) {
char suffix = 'a';
domain += suffix;
@@ -131,7 +131,9 @@
}
ConfMan.set("gameid", result.description, domain);
ConfMan.set("description", result.description, domain);
- }
+ } else
+ ConfMan.addGameDomain(domain);
+
ConfMan.set("path", path, domain);
// Set language if specified
Modified: scummvm/trunk/backends/wince/CEScaler.cpp
===================================================================
--- scummvm/trunk/backends/wince/CEScaler.cpp 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEScaler.cpp 2006-06-06 19:31:49 UTC (rev 22956)
@@ -19,7 +19,7 @@
* $Id$
*
*/
-#include "common/scaler/intern.h"
+#include "graphics/scaler/intern.h"
#include "common/stdafx.h"
#include "CEScaler.h"
Modified: scummvm/trunk/backends/wince/CEScaler.h
===================================================================
--- scummvm/trunk/backends/wince/CEScaler.h 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEScaler.h 2006-06-06 19:31:49 UTC (rev 22956)
@@ -26,8 +26,8 @@
#include "common/stdafx.h"
#include "common/scummsys.h"
#include "common/system.h"
-#include "common/scaler.h"
-#include "common/scaler/intern.h"
+#include "graphics/scaler.h"
+#include "graphics/scaler/intern.h"
DECLARE_SCALER(PocketPCPortrait);
DECLARE_SCALER(PocketPCHalf);
Modified: scummvm/trunk/backends/wince/CEgui/Panel.cpp
===================================================================
--- scummvm/trunk/backends/wince/CEgui/Panel.cpp 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEgui/Panel.cpp 2006-06-06 19:31:49 UTC (rev 22956)
@@ -33,10 +33,10 @@
bool Panel::add(const String &name, const PanelItem *item) {
- _itemsMap.addKey(name);
- _itemsMap[name] = (PanelItem*)item;
- _itemsMap[name]->move(_currentItem, _y + 10);
- _itemsMap[name]->setPanel(this);
+ PanelItem *ni;
+ ni = _itemsMap[name] = (PanelItem*)item;
+ ni->move(_currentItem, _y + 10);
+ ni->setPanel(this);
_currentItem += _interleave;
return true;
Modified: scummvm/trunk/backends/wince/CEgui/Panel.h
===================================================================
--- scummvm/trunk/backends/wince/CEgui/Panel.h 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEgui/Panel.h 2006-06-06 19:31:49 UTC (rev 22956)
@@ -26,14 +26,15 @@
#include "common/stdafx.h"
#include "common/scummsys.h"
#include "common/system.h"
-#include "common/map.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::Map;
+using Common::HashMap;
namespace CEGUI {
@@ -52,7 +53,7 @@
return scumm_stricmp(x.c_str(), y.c_str()); }
};
- typedef Map<String, PanelItem*, IgnoreCaseComparator> ItemMap;
+ typedef HashMap<String, PanelItem*, Common::IgnoreCase_Hash , IgnoreCaseComparator> ItemMap;
ItemMap _itemsMap;
int _interleave;
Modified: scummvm/trunk/backends/wince/CEgui/Toolbar.h
===================================================================
--- scummvm/trunk/backends/wince/CEgui/Toolbar.h 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEgui/Toolbar.h 2006-06-06 19:31:49 UTC (rev 22956)
@@ -27,7 +27,7 @@
#include "common/scummsys.h"
#include "common/system.h"
-#include "common/map.h"
+//#include "common/map.h"
#include "common/str.h"
#include "GUIElement.h"
Modified: scummvm/trunk/backends/wince/CEgui/ToolbarHandler.cpp
===================================================================
--- scummvm/trunk/backends/wince/CEgui/ToolbarHandler.cpp 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEgui/ToolbarHandler.cpp 2006-06-06 19:31:49 UTC (rev 22956)
@@ -31,7 +31,6 @@
bool ToolbarHandler::add(const String &name, const Toolbar &toolbar) {
- _toolbarMap.addKey(name);
_toolbarMap[name] = (Toolbar*)&toolbar;
if (!_active) {
Modified: scummvm/trunk/backends/wince/CEgui/ToolbarHandler.h
===================================================================
--- scummvm/trunk/backends/wince/CEgui/ToolbarHandler.h 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/CEgui/ToolbarHandler.h 2006-06-06 19:31:49 UTC (rev 22956)
@@ -27,12 +27,13 @@
#include "common/scummsys.h"
#include "common/system.h"
#include "common/str.h"
-#include "common/map.h"
+#include "common/hashmap.h"
+#include "common/config-manager.h"
#include "Toolbar.h"
using Common::String;
-using Common::Map;
+using Common::HashMap;
namespace CEGUI {
@@ -59,7 +60,7 @@
return scumm_stricmp(x.c_str(), y.c_str()); }
};
- Map<String, Toolbar*, IgnoreCaseComparator> _toolbarMap;
+ HashMap<String, Toolbar*, Common::IgnoreCase_Hash, IgnoreCaseComparator> _toolbarMap;
String _current;
Toolbar *_active;
int _offset;
Modified: scummvm/trunk/backends/wince/missing/assert.h
===================================================================
--- scummvm/trunk/backends/wince/missing/assert.h 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/missing/assert.h 2006-06-06 19:31:49 UTC (rev 22956)
@@ -1,6 +1,7 @@
/* Header is not present in Windows CE SDK */
-#include "common/util.h"
+// defined in common/util.h
+void CDECL _declspec(noreturn) error(const char *s, ...);
#define assert(e) ((e) ? 0 : (::error("Assertion failed " #e " (%s, %d)", __FILE__, __LINE__)))
Modified: scummvm/trunk/backends/wince/missing/missing.cpp
===================================================================
--- scummvm/trunk/backends/wince/missing/missing.cpp 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/missing/missing.cpp 2006-06-06 19:31:49 UTC (rev 22956)
@@ -287,6 +287,11 @@
return cwd;
}
+void GetCurrentDirectory(int len, char *buf)
+{
+ getcwd(buf,len);
+};
+
/* Limited implementation of time.h. time_t formula is possibly incorrect. */
time_t time(time_t* res)
{
Modified: scummvm/trunk/backends/wince/ozone.h
===================================================================
--- scummvm/trunk/backends/wince/ozone.h 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/ozone.h 2006-06-06 19:31:49 UTC (rev 22956)
@@ -26,6 +26,7 @@
#define FORMAT_555 2
#define FORMAT_OTHER 3
+#if defined(_WIN32_WCE) && _WIN32_WCE <= 300
typedef struct _RawFrameBufferInfo
{
WORD wFormat;
@@ -36,4 +37,4 @@
int cxPixels;
int cyPixels;
} RawFrameBufferInfo;
-
+#endif
Modified: scummvm/trunk/backends/wince/portdefs.h
===================================================================
--- scummvm/trunk/backends/wince/portdefs.h 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/portdefs.h 2006-06-06 19:31:49 UTC (rev 22956)
@@ -47,6 +47,8 @@
void *bsearch(const void *, const void *, size_t, size_t, int (*x) (const void *, const void *));
char *getcwd(char *buf, int size);
+void GetCurrentDirectory(int len, char *buf);
+#define INVALID_FILE_ATTRIBUTES 0xbadc0de
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
@@ -66,6 +68,6 @@
void drawError(char*);
#define vsnprintf _vsnprintf
+typedef int ptrdiff_t;
-
#endif
Modified: scummvm/trunk/backends/wince/wince-sdl.cpp
===================================================================
--- scummvm/trunk/backends/wince/wince-sdl.cpp 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/wince-sdl.cpp 2006-06-06 19:31:49 UTC (rev 22956)
@@ -49,8 +49,12 @@
#include "CEException.h"
#ifdef USE_VORBIS
+#ifndef USE_TREMOR
#include <vorbis/vorbisfile.h>
+#else
+#include <tremor/ivorbisfile.h>
#endif
+#endif
using namespace CEGUI;
@@ -129,6 +133,10 @@
return EXCEPTION_EXECUTE_HANDLER;
}
+OSystem *OSystem_WINCE3_create() {
+ return new OSystem_WINCE3();
+}
+
int SDL_main(int argc, char **argv) {
CEDevice::init();
OSystem_WINCE3::initScreenInfos();
@@ -143,18 +151,22 @@
stdout_file = fopen("\\scummvm_stdout.txt", "w");
stderr_file = fopen("\\scummvm_stderr.txt", "w");
- int rest = 0;
+ int res = 0;
+#ifndef DEBUG
__try {
+#endif
g_system = OSystem_WINCE3_create();
assert(g_system);
// Invoke the actual ScummVM main entry point:
res = scummvm_main(argc, argv);
g_system->quit(); // TODO: Consider removing / replacing this!
+#ifndef DEBUG
}
__except (handleException(GetExceptionInformation())) {
}
+#endif
return res;
}
@@ -182,6 +194,11 @@
// ********************************************************************************************
+void OSystem_WINCE3::initBackend()
+{
+ //GUI::Actions::init();
+}
+
int OSystem_WINCE3::getScreenWidth() {
return _platformScreenWidth;
}
@@ -210,10 +227,6 @@
// ********************************************************************************************
-OSystem *OSystem_WINCE3_create() {
- return new OSystem_WINCE3();
-}
-
OSystem_WINCE3::OSystem_WINCE3() : OSystem_SDL(),
_orientationLandscape(false), _newOrientation(false), _panelInitialized(false),
_panelVisible(false), _panelStateForced(false), _forceHideMouse(false),
@@ -229,6 +242,7 @@
}
create_toolbar();
// Initialize global key mapping for Smartphones
+ GUI::Actions::init();
GUI_Actions::Instance()->initInstanceMain(this);
GUI_Actions::Instance()->loadMapping();
@@ -364,7 +378,7 @@
value = ConfMan.getInt(element, "smartphone");
if (!value) {
value = defaultValue;
- ConfMan.set(element, value, "smartphone");
+ ConfMan.setInt(element, value, "smartphone");
}
}
@@ -526,12 +540,12 @@
if (gameid == "queen") {
if (!((ConfMan.hasKey("FM_high_quality") && ConfMan.getBool("FM_high_quality")) ||
(ConfMan.hasKey("FM_medium_quality") && ConfMan.getBool("FM_medium_quality")))) {
- ConfMan.set("FM_medium_quality", true);
+ ConfMan.setBool("FM_medium_quality", true);
ConfMan.flushToDisk();
}
}
// See if the output frequency is forced by the game
- if ((gameid == "ft" ||
+ if (gameid == "ft" ||
gameid == "dig" ||
gameid == "comi" ||
gameid == "queen" ||
@@ -748,7 +762,7 @@
// Set Smush Force Redraw rate for Full Throttle
if (!ConfMan.hasKey("Smush_force_redraw")) {
- ConfMan.set("Smush_force_redraw", 30);
+ ConfMan.setInt("Smush_force_redraw", 30);
ConfMan.flushToDisk();
}
}
@@ -785,9 +799,12 @@
_toolbarHandler.setOffset(400);
}
- if (w != _screenWidth || h != _screenHeight)
+ if (w != (uint) _screenWidth || h != (uint) _screenHeight)
_scalersChanged = false;
+ _overlayWidth = w;
+ _overlayHeight = h;
+
OSystem_SDL::initSize(w, h);
if (_scalersChanged) {
@@ -1965,7 +1982,7 @@
internUpdateScreen();
if (_newOrientation != _orientationLandscape && _mode == GFX_NORMAL) {
_orientationLandscape = _newOrientation;
- ConfMan.set("landscape", _orientationLandscape);
+ ConfMan.setBool("landscape", _orientationLandscape);
ConfMan.flushToDisk();
setGraphicsMode(GFX_NORMAL);
hotswapGFXMode();
Modified: scummvm/trunk/backends/wince/wince-sdl.h
===================================================================
--- scummvm/trunk/backends/wince/wince-sdl.h 2006-06-06 18:34:03 UTC (rev 22955)
+++ scummvm/trunk/backends/wince/wince-sdl.h 2006-06-06 19:31:49 UTC (rev 22956)
@@ -26,7 +26,7 @@
#include "common/stdafx.h"
#include "common/scummsys.h"
#include "common/system.h"
-#include "common/scaler.h"
+#include "graphics/scaler.h"
#include "backends/intern.h"
#include "backends/sdl/sdl-common.h"
@@ -50,6 +50,8 @@
void initSize(uint w, uint h);
+ void initBackend();
+
// Overloaded from SDL_Common (toolbar handling)
bool pollEvent(Event &event);
// Overloaded from SDL_Common (toolbar handling)
@@ -191,7 +193,7 @@
long _tapTime;
// Mouse
-
+ int _mouseHotspotX, _mouseHotspotY;
byte *_mouseBackupOld;
// Smartphone specific variables
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list