aboutsummaryrefslogtreecommitdiff
path: root/wince
diff options
context:
space:
mode:
authorNicolas Bacca2002-05-14 22:29:08 +0000
committerNicolas Bacca2002-05-14 22:29:08 +0000
commitc9fb5690fa95728a46c237c6f092dea106c80960 (patch)
tree54aa6b552da7155683d6e646c51da4f9a24298c8 /wince
parent850b717ec1dca6890321688b25c55a64ad37cfbf (diff)
downloadscummvm-rg350-c9fb5690fa95728a46c237c6f092dea106c80960.tar.gz
scummvm-rg350-c9fb5690fa95728a46c237c6f092dea106c80960.tar.bz2
scummvm-rg350-c9fb5690fa95728a46c237c6f092dea106c80960.zip
Update port for new timer function & fix toolbar in Zak
svn-id: r4330
Diffstat (limited to 'wince')
-rw-r--r--wince/pocketpc.cpp23
-rw-r--r--wince/screen.cpp27
-rw-r--r--wince/screen.h2
3 files changed, 47 insertions, 5 deletions
diff --git a/wince/pocketpc.cpp b/wince/pocketpc.cpp
index d80ff69f55..2cdb0b775b 100644
--- a/wince/pocketpc.cpp
+++ b/wince/pocketpc.cpp
@@ -31,10 +31,15 @@
#define VERSION "Build " POCKETSCUMM_BUILD " (VM " SCUMMVM_CVS ")"
+typedef int (*tTimeCallback)(int);
+
GameDetector detector;
Gui gui;
Scumm *g_scumm;
Config *scummcfg;
+tTimeCallback timer_callback;
+int timer_interval;
+
extern void Cls();
@@ -114,6 +119,9 @@ public:
// Update cdrom audio status
void update_cdrom();
+ // Add a new callback timer
+ void set_timer(int timer, int (*callback)(int));
+
// Quit
void quit();
@@ -549,7 +557,7 @@ LRESULT CALLBACK OSystem_WINCE3::WndProc(HWND hWnd, UINT message, WPARAM wParam,
break;
case IDC_LANDSCAPE:
- HWND taskbar;
+ //HWND taskbar;
//SHFullScreen (hWnd, SHFS_HIDESIPBUTTON | SHFS_HIDETASKBAR | SHFS_HIDESTARTICON);
//InvalidateRect(HWND_DESKTOP, NULL, TRUE);
SetScreenMode(!GetScreenMode());
@@ -732,6 +740,9 @@ LRESULT CALLBACK OSystem_WINCE3::WndProc(HWND hWnd, UINT message, WPARAM wParam,
case WM_LBUTTONDBLCLK: // doesn't seem to work right now
//wm->_scumm->_rightBtnPressed |= msClicked | msDown;
break;
+ case WM_TIMER:
+ timer_callback(timer_interval);
+ break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
@@ -866,6 +877,10 @@ void action_skip() {
void action_hide() {
hide_toolbar = !hide_toolbar;
+ if (hide_toolbar)
+ RestoreScreenGeometry();
+ else
+ LimitScreenGeometry();
Cls();
toolbar_drawn = hide_toolbar;
g_scumm->_system->update_screen();
@@ -978,6 +993,12 @@ OSystem *OSystem_WINCE3_create() {
return OSystem_WINCE3::create(0, 0);
}
+void OSystem_WINCE3::set_timer(int timer, int (*callback)(int)) {
+ SetTimer(hWnd, 1, timer, NULL);
+ timer_interval = timer;
+ timer_callback = callback;
+}
+
void OSystem_WINCE3::set_palette(const byte *colors, uint start, uint num) {
const byte *b = colors;
uint i;
diff --git a/wince/screen.cpp b/wince/screen.cpp
index 894ee0b768..f7e88507e3 100644
--- a/wince/screen.cpp
+++ b/wince/screen.cpp
@@ -86,6 +86,9 @@ void palette_update();
static tCls pCls = NULL;
static tBlt pBlt = NULL;
+static int _geometry_w;
+static int _geometry_h;
+
HWND hWndMain;
@@ -133,9 +136,25 @@ void SetScreenGeometry(int w, int h) {
MessageBox(NULL, TEXT("Unsupported screen geometry !"), TEXT("Error"), MB_OK);
exit(1);
}
- geom[0].lineLimit = w*h;
- geom[1].lineLimit = w*h;
- geom[2].lineLimit = w*h;
+
+ _geometry_w = w;
+ _geometry_h = h;
+ RestoreScreenGeometry();
+}
+
+void LimitScreenGeometry() {
+
+ if (_geometry_h > 200) {
+ geom[0].lineLimit = _geometry_w*200;
+ geom[1].lineLimit = _geometry_w*200;
+ geom[1].lineLimit = _geometry_w*200;
+ }
+}
+
+void RestoreScreenGeometry() {
+ geom[0].lineLimit = _geometry_w * _geometry_h;
+ geom[1].lineLimit = _geometry_w * _geometry_h;
+ geom[2].lineLimit = _geometry_w * _geometry_h;
}
int GraphicsOn(HWND hWndMain_param)
@@ -1139,4 +1158,4 @@ void Translate(int* px, int* py)
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/wince/screen.h b/wince/screen.h
index 23aed048a5..404bd81458 100644
--- a/wince/screen.h
+++ b/wince/screen.h
@@ -8,6 +8,8 @@
#endif
void SetScreenGeometry(int w, int h);
+void LimitScreenGeometry();
+void RestoreScreenGeometry();
int GraphicsOn(HWND hWndMain);
void GraphicsOff();
void GraphicsSuspend();