[Scummvm-cvs-logs] SF.net SVN: scummvm: [20503] scummvm/trunk/backends/PalmOS/Src

chrilith at users.sourceforge.net chrilith at users.sourceforge.net
Sat Feb 11 01:27:01 CET 2006


Revision: 20503
Author:   chrilith
Date:     2006-02-11 01:26:04 -0800 (Sat, 11 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20503&view=rev

Log Message:
-----------
- Added optional use of palette
- Common sound struct
- Move common quit stuff to the base class
- Fixed CD functions, now MP3s work properly
- Make mutex functions virtual so that they can be redefined
- little cleanup

Modified Paths:
--------------
    scummvm/trunk/backends/PalmOS/Src/be_base.cpp
    scummvm/trunk/backends/PalmOS/Src/be_base.h
Modified: scummvm/trunk/backends/PalmOS/Src/be_base.cpp
===================================================================
--- scummvm/trunk/backends/PalmOS/Src/be_base.cpp	2006-02-11 09:18:24 UTC (rev 20502)
+++ scummvm/trunk/backends/PalmOS/Src/be_base.cpp	2006-02-11 09:26:04 UTC (rev 20503)
@@ -1,7 +1,7 @@
 /* ScummVM - Scumm Interpreter
  * Copyright (C) 2001  Ludvig Strigeus
  * Copyright (C) 2001-2006 The ScummVM project
- * Copyright (C) 2002-2005 Chris Apers - PalmOS Backend
+ * Copyright (C) 2002-2006 Chris Apers - PalmOS Backend
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -17,7 +17,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 
@@ -39,6 +40,7 @@
 	_setMode = GFX_NORMAL;
 	_mode = _setMode;
 	_redawOSD = false;
+	_setPalette = true;
 	
 	_offScreenH = NULL;
 	_screenH = NULL;
@@ -63,6 +65,7 @@
 	MemSet(&_mouseCurState, sizeof(_mouseCurState), 0);
 	MemSet(&_mouseOldState, sizeof(_mouseOldState), 0);
 	MemSet(&_timer, sizeof(TimerType), 0);
+	MemSet(&_sound, sizeof(SoundType), 0);
 }
 
 void OSystem_PalmBase::initBackend() {
@@ -101,3 +104,10 @@
 		_timer.active = false;
 	}
 }
+
+void OSystem_PalmBase::quit() {
+	int_quit();
+	clearSoundCallback();
+	unload_gfx_mode();
+	exit(0);
+}

Modified: scummvm/trunk/backends/PalmOS/Src/be_base.h
===================================================================
--- scummvm/trunk/backends/PalmOS/Src/be_base.h	2006-02-11 09:18:24 UTC (rev 20502)
+++ scummvm/trunk/backends/PalmOS/Src/be_base.h	2006-02-11 09:26:04 UTC (rev 20503)
@@ -1,7 +1,7 @@
 /* ScummVM - Scumm Interpreter
  * Copyright (C) 2001  Ludvig Strigeus
  * Copyright (C) 2001-2006 The ScummVM project
- * Copyright (C) 2002-2005 Chris Apers - PalmOS Backend
+ * Copyright (C) 2002-2006 Chris Apers - PalmOS Backend
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -17,15 +17,14 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * $Header$
+ * $URL$
+ * $Id$
  *
  */
 
 #ifndef BE_BASE_H
 #define BE_BASE_H
 
-#define ALLOW_ACCESS_TO_INTERNALS_OF_BITMAPS
-
 #include "common/stdafx.h"
 #include "common/scummsys.h"
 #include "common/system.h"
@@ -51,11 +50,17 @@
 #define kDrawFight		3030
 
 typedef struct {
-	uint32 duration, nextExpiry;
-	bool active;
+	UInt32 duration, nextExpiry;
+	Boolean active;
 	OSystem::TimerProc callback;
 } TimerType, *TimerPtr;
 
+typedef struct {
+	Boolean	active;
+	void *proc;
+	void *param;
+} SoundType, *SoundPtr;
+
 extern "C" void SysEventGet(EventType *, Int32);
 
 class OSystem_PalmBase : public OSystem {
@@ -83,7 +88,7 @@
 	void battery_handler();
 	virtual void get_coordinates(EventPtr ev, Coord &x, Coord &y) = 0;
 	void simulate_mouse(Event &event, Int8 iHoriz, Int8 iVert, Coord *xr, Coord *yr);
-	virtual void sound_handler() {};
+	virtual void sound_handler() = 0;
 
 protected:
 	virtual void draw_osd(UInt16 id, Int32 x, Int32 y, Boolean show, UInt8 color = 0);
@@ -105,6 +110,7 @@
 	};
 
 	TimerType _timer;
+	SoundType _sound;
 
 	RGBColorType _currentPalette[256];
 	uint _paletteDirtyStart, _paletteDirtyEnd;
@@ -125,7 +131,7 @@
 	int _new_shake_pos;
 
 	Boolean _overlayVisible;
-	Boolean _redawOSD;
+	Boolean _redawOSD, _setPalette;
 
 	UInt32 _keyMouseMask;
 	struct {
@@ -222,22 +228,22 @@
 	
 	virtual void setTimerCallback(TimerProc callback, int interval);
 
-	MutexRef createMutex() { return NULL; }
-	void lockMutex(MutexRef mutex) {}
-	void unlockMutex(MutexRef mutex) {}
-	void deleteMutex(MutexRef mutex) {}
+	virtual MutexRef createMutex() { return NULL; }
+	virtual void lockMutex(MutexRef mutex) {}
+	virtual void unlockMutex(MutexRef mutex) {}
+	virtual void deleteMutex(MutexRef mutex) {}
 	
 	virtual bool setSoundCallback(SoundProc proc, void *param) = 0;
 	virtual void clearSoundCallback() = 0;
 	int getOutputSampleRate() const { return _samplesPerSec; }
 
-	bool openCD(int drive) { return true;};
-	bool pollCD() { return true;};
+	bool openCD(int drive) { return false;};
+	bool pollCD() { return false;};
 	void playCD(int track, int num_loops, int start_frame, int duration) {};
 	void stopCD() {};
 	void updateCD() {};
 	
-	void quit() { int_quit(); }
+	void quit();
 	virtual void setWindowCaption(const char *caption) = 0;
 	
 	Common::SaveFileManager *getSavefileManager();







More information about the Scummvm-git-logs mailing list