[Scummvm-cvs-logs] SF.net SVN: scummvm: [24417] scummvm/branches/branch-0-9-0/backends/ platform/PalmOS/Src

chrilith at users.sourceforge.net chrilith at users.sourceforge.net
Sat Oct 21 20:37:33 CEST 2006


Revision: 24417
          http://svn.sourceforge.net/scummvm/?rev=24417&view=rev
Author:   chrilith
Date:     2006-10-21 11:36:35 -0700 (Sat, 21 Oct 2006)

Log Message:
-----------
Backport changes to PalmOS backend

Modified Paths:
--------------
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/base_event.cpp
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/base_mouse.cpp
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_base.cpp
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_base.h
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_os5.cpp
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_os5.h
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_zodiac.h
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/extend.cpp
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/init_stuffs.cpp
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/missing/ext_stdlib.c
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/missing/stdlib.h
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/modules.cpp
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/native/pnoARM.c
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/native/zodiacARM.cpp
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/os5_mouse.cpp
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/compile.h
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/prefix_os5.h
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/prefix_zodiac.h
    scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/zodiac_mouse.cpp

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/base_event.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/base_event.cpp	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/base_event.cpp	2006-10-21 18:36:35 UTC (rev 24417)
@@ -24,6 +24,10 @@
 
 #include "be_base.h"
 
+#ifdef STDLIB_TRACE_MEMORY
+#	include <stdlib.h>
+#endif
+
 #if defined(COMPILE_OS5) && defined(PALMOS_ARM)
 extern "C" void SysEventGet(EventType *eventP, Int32 timeout);
 extern "C" void SysEventAddToQueue (const EventType *eventP);
@@ -306,6 +310,11 @@
 				key = (key == '0') ? 324 : (315 + key - '1');
 				mask = 0;
 
+#ifdef STDLIB_TRACE_MEMORY
+			// print memory
+			} else if  (key == 'm' && mask == (KBD_CTRL|KBD_ALT)) {
+				printf("Used memory: %d\n", __stdlib_trace_memory);
+#endif
 			// exit
 			} else if  ((key == 'z' && mask == KBD_CTRL) || (mask == KBD_ALT && key == 'x')) {
 				event.type = EVENT_QUIT;
@@ -320,6 +329,7 @@
 			}
 			
 			// other keys
+			_lastEvent = keyDownEvent;
 			event.type = EVENT_KEYDOWN;
 			event.kbd.keycode = key;
 			event.kbd.ascii = key;
@@ -327,6 +337,11 @@
 			return true;
 
 		default:
+			if (_lastEvent == keyDownEvent) {
+				event.type = EVENT_KEYUP;
+				_lastEvent = nilEvent;
+				return true;
+			}
 			return false;
 		};
 	}

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/base_mouse.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/base_mouse.cpp	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/base_mouse.cpp	2006-10-21 18:36:35 UTC (rev 24417)
@@ -39,11 +39,6 @@
 	bool last = _mouseVisible;
 	_mouseVisible = visible;
 
-	if (visible)
-		draw_mouse();
-	else
-		undraw_mouse();
-
 	return last;
 }
 

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_base.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_base.cpp	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_base.cpp	2006-10-21 18:36:35 UTC (rev 24417)
@@ -57,7 +57,6 @@
 	_batCheckTicks = SysTicksPerSecond() * 15;
 	_batCheckLast = TimGetTicks();
 	
-	_mouseDataH = NULL;
 	_mouseDataP = NULL;
 	_mouseVisible = false;
 	_mouseDrawn = false;

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_base.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_base.h	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_base.h	2006-10-21 18:36:35 UTC (rev 24417)
@@ -102,8 +102,8 @@
 		kKeyAny				= 1 << 31
 	};
 	enum {
-		MAX_MOUSE_W = 40,
-		MAX_MOUSE_H = 40
+		MAX_MOUSE_W = 48,
+		MAX_MOUSE_H = 48
 	};
 	struct MousePos {
 		int16 x,y,w,h;
@@ -151,7 +151,7 @@
 	int16 _mouseHotspotY;
 	byte _mouseKeyColor;
 	byte *_mouseDataP, *_mouseBackupP;
-	WinHandle _mouseDataH, _mouseBackupH;
+	
 
 	eventsEnum _lastEvent;
 	WChar _lastKey;

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_os5.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_os5.cpp	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_os5.cpp	2006-10-21 18:36:35 UTC (rev 24417)
@@ -37,6 +37,7 @@
 	_overlayH = NULL;
 	_isSwitchable = false;
 	_wasRotated = false;
+	_cursorPaletteDisabled = true;
 
 	MemSet(&_soundEx, sizeof(SoundExType), 0);
 	_soundEx.sound = &_sound;
@@ -61,6 +62,15 @@
 	}
 }
 
+bool OSystem_PalmOS5::hasFeature(Feature f) {
+	switch (f) {
+		case kFeatureCursorHasPalette:
+			return true;
+	}
+
+	return false;
+}
+
 void OSystem_PalmOS5::setWindowCaption(const char *caption) {
 	Err e;
 	Char buf[64];

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_os5.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_os5.h	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_os5.h	2006-10-21 18:36:35 UTC (rev 24417)
@@ -105,7 +105,7 @@
 
 	OverlayColor *_overlayP;
 	WinHandle _overlayH, _workScreenH;
-	int16 _nativePal[256];
+	int16 _nativePal[256], _mousePal[256];
 	int16 *_workScreenP;
 	
 	Boolean _isSwitchable, _wasRotated;
@@ -135,16 +135,20 @@
 
 protected:
 	UInt16 _sysOldCoord, _sysOldOrientation;
-	Boolean _stretched;
+	Boolean _stretched, _cursorPaletteDisabled;
 
 public:
 	OSystem_PalmOS5();
 	static OSystem *create();
 
+	bool hasFeature(Feature f);
+
 	void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
 	void clearScreen();
 
 	void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int cursorTargetScale);
+	virtual void setCursorPalette(const byte *colors, uint start, uint num);
+	void disableCursorPalette(bool disable);
 
 	void showOverlay();
 	void hideOverlay();

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_zodiac.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_zodiac.h	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/be_zodiac.h	2006-10-21 18:36:35 UTC (rev 24417)
@@ -46,7 +46,7 @@
 	TwGfxType *_gfxH;
 	TwGfxSurfaceType *_palmScreenP, *_tmpScreenP;
 	TwGfxSurfaceType *_overlayP;
-	UInt16 _nativePal[256];
+	UInt16 _nativePal[256], _mousePal[256];
 	Boolean _fullscreen;
 	
 	TwGfxPointType _srcPos;
@@ -75,11 +75,14 @@
 	static OSystem *create();
 	
 	void setFeatureState(Feature f, bool enable);
+
 	int getDefaultGraphicsMode() const;
 
 	void updateScreen();
 	bool grabRawScreen(Graphics::Surface *surf);
 
+	void setCursorPalette(const byte *colors, uint start, uint num);
+
 	void clearOverlay();
 	void grabOverlay(OverlayColor *buf, int pitch);
 	void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/extend.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/extend.cpp	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/extend.cpp	2006-10-21 18:36:35 UTC (rev 24417)
@@ -21,7 +21,7 @@
  * $Id$
  *
  */
- 
+
 #include <stdlib.h>
 #include "globals.h"
 
@@ -84,25 +84,26 @@
 	MemSet(ptr, 0, size);
 	return ptr;
 }
-#elif defined(COMPILE_OS5)
+#elif defined(COMPILE_OS5) || defined(STDLIB_TRACE_MEMORY)
 
-__inline void *operator new(UInt32 size) {
+void *operator new(UInt32 size) {
 	void *ptr = malloc(size);
 	MemSet(ptr, 0, size);
 	return ptr;
 }
 
-__inline void *operator new [] (UInt32 size) {
+void *operator new [] (UInt32 size) {
 	void *ptr = malloc(size);
 	MemSet(ptr, 0, size);
 	return ptr;
 }
 
-__inline void operator delete(void *ptr) throw() {
+void operator delete(void *ptr) throw() {
 	if (ptr) free(ptr);
 }
 
-__inline void operator delete[](void *ptr) throw() {
+void operator delete[](void *ptr) throw() {
 	if (ptr) free(ptr);
 }
+
 #endif

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/init_stuffs.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/init_stuffs.cpp	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/init_stuffs.cpp	2006-10-21 18:36:35 UTC (rev 24417)
@@ -1,5 +1,9 @@
 #include <PalmOS.h>
+
+#ifndef DISABLE_SONY
 #include <SonyClie.h>
+#endif
+
 #include <PalmNavigator.h>
 #include <HsExtCommon.h>
 #include <HsNavCommon.h>
@@ -127,4 +131,4 @@
 	if (!WinScreenMode(winScreenModeGetSupportedDepths, NULL, NULL, &depth, &color))
 		OPTIONS_SET(((depth & 0x8000) ? kOptMode16Bit : kOptNone));
 
-}
\ No newline at end of file
+}

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/missing/ext_stdlib.c
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/missing/ext_stdlib.c	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/missing/ext_stdlib.c	2006-10-21 18:36:35 UTC (rev 24417)
@@ -24,6 +24,10 @@
 
 #include <stdlib.h>
 
+#ifdef STDLIB_TRACE_MEMORY
+UInt32 __stdlib_trace_memory = 0;
+#endif
+
 #define memNewChunkFlagAllowLarge	0x1000 
 SysAppInfoPtr SysGetAppInfo(SysAppInfoPtr *uiAppPP, SysAppInfoPtr *actionCodeAppPP) SYS_TRAP(sysTrapSysGetAppInfo);
 
@@ -60,6 +64,9 @@
 		newP = MemChunkNew(0, size, attr);
 	}
 
+#ifdef STDLIB_TRACE_MEMORY
+	__stdlib_trace_memory += size;
+#endif
 	return newP;
 }
 
@@ -72,18 +79,33 @@
 	if (newP)
 		MemSet(newP,size,0);
 
+#ifdef STDLIB_TRACE_MEMORY
+	__stdlib_trace_memory += size;
+#endif
 	return newP;
 }
 
 Err free(MemPtr memP) {
-	if (memP)
+	if (memP) {
+#ifdef STDLIB_TRACE_MEMORY
+		UInt32 sz = MemPtrSize(memP);
+		__stdlib_trace_memory -= sz;
+#endif
 		return MemPtrFree(memP);
+	}
+
 	return memErrInvalidParam;
 }
 
 MemPtr realloc(MemPtr oldP, UInt32 size) {
 	MemPtr newP;
 
+#ifdef STDLIB_TRACE_MEMORY
+	UInt32 sz = MemPtrSize(oldP);
+	__stdlib_trace_memory -= sz;
+	__stdlib_trace_memory += size;
+#endif
+
 	if (oldP != NULL)
 		if (MemPtrResize(oldP, size) == 0)
 			return oldP;

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/missing/stdlib.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/missing/stdlib.h	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/missing/stdlib.h	2006-10-21 18:36:35 UTC (rev 24417)
@@ -36,12 +36,17 @@
 #endif
 
 /* malloc stuff */
-#if defined(COMPILE_ZODIAC)
-#	define malloc	MemPtrNew
-#elif defined(COMPILE_OS5) && defined(PALMOS_ARM)
+#ifdef STDLIB_TRACE_MEMORY
 #	define malloc	__malloc
+	extern UInt32 __stdlib_trace_memory;
 #else
-#	define malloc	MemGluePtrNew
+#	if defined(COMPILE_ZODIAC)
+#		define malloc	MemPtrNew
+#	elif defined(COMPILE_OS5) && defined(PALMOS_ARM)
+#		define malloc	__malloc
+#	else
+#		define malloc	MemGluePtrNew
+#	endif
 #endif
 
 /* custom exit (true exit !) */

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/modules.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/modules.cpp	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/modules.cpp	2006-10-21 18:36:35 UTC (rev 24417)
@@ -1,7 +1,4 @@
 #include <PalmOS.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
 
 #include "palmdefs.h"
 #include "args.h"
@@ -32,8 +29,6 @@
 #ifdef COMPILE_ZODIAC
 #	include <tapwave.h>
 #	include <TwRuntime.h>
-#else
-#	include <TwDefs.h>
 #endif
 
 void run(int argc, char *argv[]) {
@@ -58,12 +53,9 @@
 	NativeFuncType *entry;
 	TwLoadModule(0, 0, 0, 1, twLoadFlagTNA|twLoadFlagQuickRun, &entry);
 #else
-	UInt32 glue;
-	FtrGet(twFtrCreator, twFtrAPIGlue, &glue);
-
 	PnoDescriptor pno;
 	PnoLoadFromResources(&pno, 'ARMC', 1, appFileCreator, 1);
-	PnoCall(&pno, (void*)glue);
+	PnoCall(&pno, 0);
 	PnoUnload(&pno);
 #endif
 

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/native/pnoARM.c
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/native/pnoARM.c	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/native/pnoARM.c	2006-10-21 18:36:35 UTC (rev 24417)
@@ -24,7 +24,6 @@
 
 #ifdef COMPILE_OS5
 
-//#include <tapwave.h>
 #include <PalmOS.h>
 #include <stdlib.h>
 #include "pace.h"
@@ -38,7 +37,6 @@
 	const void*      twEmulState;
 	Call68KFuncType* twCall68KFunc;
 #endif
-struct TwGlue*   twGlue;
 
 unsigned long PNO_Main(const void *emulStateP, void *userData68KP, Call68KFuncType *call68KFuncP) {
 #ifdef COMPILE_ZODIAC
@@ -48,7 +46,7 @@
 	global.emulStateP = (EmulStateType *)emulStateP;
 	global.call68KFuncP = call68KFuncP;
 #endif
-    twGlue = (struct TwGlue*) userData68KP;
+
 	return PilotMain(sysAppLaunchCmdNormalLaunch, userData68KP, 0);
 }
 

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/native/zodiacARM.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/native/zodiacARM.cpp	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/native/zodiacARM.cpp	2006-10-21 18:36:35 UTC (rev 24417)
@@ -34,12 +34,14 @@
 #include "rumble.h"
 
 
-#include <AdnDebugMgr.h>
+//#include <AdnDebugMgr.h>
 //#define DEBUG_ARM
 
 #include "stdafx.h"
 #include "base/main.h"
-#include "be_zodiac.h"
+#ifdef COMPILE_ZODIAC
+#	include "be_zodiac.h"
+#endif
 #include "be_os5ex.h"
 
 GlobalsDataType g_vars;
@@ -143,4 +145,3 @@
 
 	return 0;
 }
-

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/os5_mouse.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/os5_mouse.cpp	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/os5_mouse.cpp	2006-10-21 18:36:35 UTC (rev 24417)
@@ -24,6 +24,19 @@
 
 #include "be_os5.h"
 
+void OSystem_PalmOS5::setCursorPalette(const byte *colors, uint start, uint num) {
+	for(uint i = 0; i < num; i++) {
+		_mousePal[i + start] = gfxMakeDisplayRGB(colors[0], colors[1], colors[2]);
+		colors += 4;
+	}
+	
+	_cursorPaletteDisabled = false;
+}
+
+void OSystem_PalmOS5::disableCursorPalette(bool disable) {
+	_cursorPaletteDisabled = disable;
+}
+
 void OSystem_PalmOS5::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int cursorTargetScale) {
 	if (w == 0 || h == 0)
 		return;
@@ -38,6 +51,7 @@
 
 	// copy new cursor
 	byte *dst = _mouseDataP;
+	memset(dst, MAX_MOUSE_W * MAX_MOUSE_H, keycolor);
 	while (h--) {
 		memcpy(dst, buf, w);
 		dst += MAX_MOUSE_W;
@@ -105,14 +119,15 @@
 	if (_overlayVisible) {
 		int16 *bak = (int16 *)_mouseBackupP;			// Surface used to backup the area obscured by the mouse
 		int16 *dst = _overlayP + y * _screenWidth + x;
-		
+		int16 *pal = _cursorPaletteDisabled ? _nativePal : _mousePal;
+
 		do {
 			width = w;
 			do {
 				*bak++ = *dst;
 				color = *src++;
 				if (color != _mouseKeyColor)	// transparent, don't draw
-					*dst = _nativePal[color];
+					*dst = pal[color];
 				dst++;
 			} while (--width);
 

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/compile.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/compile.h	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/compile.h	2006-10-21 18:36:35 UTC (rev 24417)
@@ -42,18 +42,29 @@
 #define DISABLE_CINE
 #define DISABLE_AGI
 
+// ScummVM
 #define DISABLE_HQ_SCALERS
+#define DISABLE_FANCY_THEMES
+//#define CT_NO_TRANSPARENCY
+//#define REDUCE_MEMORY_USAGE
 
 // PalmOS
+//#define STDLIB_TRACE_MEMORY
+//#define _DEBUG
+
 #define PALMOS_MODE
-#define COMPILE_ZODIAC
-//#define COMPILE_OS5
+//#define COMPILE_ZODIAC
+#define COMPILE_OS5
 
 //#define DISABLE_ADLIB
 //#define DISABLE_LIGHTSPEED
-//#define DISABLE_TAPWAVE
-//#define REDUCE_MEMORY_USAGE
 
-//#define _DEBUG
+#ifdef COMPILE_ZODIAC
+#	define DISABLE_SONY
+#endif
 
+#ifdef COMPILE_OS5
+#	define DISABLE_TAPWAVE
 #endif
+
+#endif

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/prefix_os5.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/prefix_os5.h	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/prefix_os5.h	2006-10-21 18:36:35 UTC (rev 24417)
@@ -7,5 +7,7 @@
 #define PALMOS_NATIVE
 
 #define COMPILE_OS5
+#define DISABLE_SONY
+#define DISABLE_PA1LIB
 
 #endif

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/prefix_zodiac.h
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/prefix_zodiac.h	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/prefixes/prefix_zodiac.h	2006-10-21 18:36:35 UTC (rev 24417)
@@ -7,5 +7,7 @@
 #define PALMOS_NATIVE
 
 #define COMPILE_ZODIAC
+#define DISABLE_SONY
+#define DISABLE_PA1LIB
 
 #endif

Modified: scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/zodiac_mouse.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/zodiac_mouse.cpp	2006-10-21 18:23:03 UTC (rev 24416)
+++ scummvm/branches/branch-0-9-0/backends/platform/PalmOS/Src/zodiac_mouse.cpp	2006-10-21 18:36:35 UTC (rev 24417)
@@ -24,6 +24,14 @@
 
 #include "be_zodiac.h"
 
+void OSystem_PalmZodiac::setCursorPalette(const byte *colors, uint start, uint num) {
+	for(uint i = 0; i < num; i++) {
+		_mousePal[i + start] = TwGfxMakeDisplayRGB(colors[0], colors[1], colors[2]);
+		colors += 4;
+	}
+	_cursorPaletteDisabled = false;
+}
+
 void OSystem_PalmZodiac::draw_mouse() {
 	if (_mouseDrawn || !_mouseVisible)
 		return;
@@ -72,18 +80,18 @@
 	// Backup the covered area draw the mouse cursor
 	if (_overlayVisible) {
 		uint16 *bak = (uint16 *)_mouseBackupP;			// Surface used to backup the area obscured by the mouse
-		uint16 *dst;
+		uint16 *dst, *pal = _cursorPaletteDisabled ? _nativePal : _mousePal;
 
 		TwGfxLockSurface(_overlayP, (void **)&dst);
 		dst += y * _screenWidth + x;
-		
+
 		do {
 			width = w;
 			do {
 				*bak++ = *dst;
 				color = *src++;
 				if (color != _mouseKeyColor)	// transparent, don't draw
-					*dst = _nativePal[color];
+					*dst = pal[color];
 				dst++;
 			} while (--width);
 
@@ -126,7 +134,7 @@
 	if (_overlayVisible) {
 		uint16 *bak = (uint16 *)_mouseBackupP;
 		uint16 *dst;
-		
+
 		TwGfxLockSurface(_overlayP, (void **)&dst);
 		dst += _mouseOldState.y * _screenWidth + _mouseOldState.x;
 


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