[Scummvm-cvs-logs] SF.net SVN: scummvm:[50609] scummvm/branches/gsoc2010-opengl/backends

vgvgf at users.sourceforge.net vgvgf at users.sourceforge.net
Sat Jul 3 02:13:47 CEST 2010


Revision: 50609
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50609&view=rev
Author:   vgvgf
Date:     2010-07-03 00:13:45 +0000 (Sat, 03 Jul 2010)

Log Message:
-----------
Cleanup and documentation.

Modified Paths:
--------------
    scummvm/branches/gsoc2010-opengl/backends/audiocd/default/default-audiocd.h
    scummvm/branches/gsoc2010-opengl/backends/audiocd/sdl/sdl-audiocd.h
    scummvm/branches/gsoc2010-opengl/backends/events/gp2xsdl/gp2xsdl-events.h
    scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
    scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.h
    scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.h
    scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h
    scummvm/branches/gsoc2010-opengl/backends/events/symbiansdl/symbiansdl-events.cpp
    scummvm/branches/gsoc2010-opengl/backends/events/symbiansdl/symbiansdl-events.h
    scummvm/branches/gsoc2010-opengl/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h
    scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.h
    scummvm/branches/gsoc2010-opengl/backends/mixer/symbiansdl/symbiansdl-mixer.h
    scummvm/branches/gsoc2010-opengl/backends/mutex/mutex.h
    scummvm/branches/gsoc2010-opengl/backends/mutex/null/null-mutex.h
    scummvm/branches/gsoc2010-opengl/backends/mutex/sdl/sdl-mutex.h
    scummvm/branches/gsoc2010-opengl/backends/timer/default/default-timer.h
    scummvm/branches/gsoc2010-opengl/backends/timer/sdl/sdl-timer.cpp
    scummvm/branches/gsoc2010-opengl/backends/timer/sdl/sdl-timer.h

Modified: scummvm/branches/gsoc2010-opengl/backends/audiocd/default/default-audiocd.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/audiocd/default/default-audiocd.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/audiocd/default/default-audiocd.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -30,8 +30,8 @@
 #include "sound/mixer.h"
 
 /**
-* The default audio cd manager. Implements emulation of audio cd playback.
-*/
+ * The default audio cd manager. Implements emulation of audio cd playback.
+ */
 class DefaultAudioCDManager : public AudioCDManager {
 public:
 	DefaultAudioCDManager();

Modified: scummvm/branches/gsoc2010-opengl/backends/audiocd/sdl/sdl-audiocd.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/audiocd/sdl/sdl-audiocd.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/audiocd/sdl/sdl-audiocd.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -35,8 +35,8 @@
 #endif
 
 /**
-* The SDL audio cd manager. Implements real audio cd playback.
-*/
+ * The SDL audio cd manager. Implements real audio cd playback.
+ */
 class SdlAudioCDManager : public DefaultAudioCDManager {
 public:
 	SdlAudioCDManager();

Modified: scummvm/branches/gsoc2010-opengl/backends/events/gp2xsdl/gp2xsdl-events.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/gp2xsdl/gp2xsdl-events.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/events/gp2xsdl/gp2xsdl-events.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -28,14 +28,22 @@
 
 #include "backends/events/sdl/sdl-events.h"
 
+/**
+ * SDL events manager for GP2X and GP2XWIZ
+ */
 class GP2XSdlEventManager : public SdlEventManager {
 public:
 	GP2XSdlEventManager(Common::EventSource *boss);
 
 protected:
 	bool _stickBtn[32];
+
+	/** Button state for L button modifier */
 	bool _buttonStateL;
 
+	/**
+	 * Handles the stick movement
+	 */
 	void moveStick();
 
 	virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event);

Modified: scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.cpp	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.cpp	2010-07-03 00:13:45 UTC (rev 50609)
@@ -38,10 +38,6 @@
 
 }
 
-LinuxmotoSdlEventManager::~LinuxmotoSdlEventManager() {
-
-}
-
 void LinuxmotoSdlEventManager::preprocessEvents(SDL_Event *event) {
 	if (event->type == SDL_ACTIVEEVENT) {
 		if (event->active.state == SDL_APPINPUTFOCUS && !event->active.gain) {

Modified: scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -28,10 +28,12 @@
 
 #include "backends/events/sdl/sdl-events.h"
 
+/**
+ * SDL events manager for LINUXMOTO
+ */
 class LinuxmotoSdlEventManager : public SdlEventManager {
 public:
 	LinuxmotoSdlEventManager(Common::EventSource *boss);
-	virtual ~LinuxmotoSdlEventManager();
 
 protected:
 	virtual void preprocessEvents(SDL_Event *event);

Modified: scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/events/samsungtvsdl/samsungtvsdl-events.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -28,10 +28,12 @@
 
 #include "backends/events/sdl/sdl-events.h"
 
+/**
+ * SDL events manager for Samsung TV
+ */
 class SamsungTVSdlEventManager : public SdlEventManager {
 public:
 	SamsungTVSdlEventManager(Common::EventSource *boss);
-	~SamsungTVSdlEventManager() {}
 
 protected:
 	virtual bool remapKey(SDL_Event &ev, Common::Event &event);

Modified: scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -34,45 +34,73 @@
 #include <SDL.h>
 #endif
 
+/**
+ * The SDL event manager class.
+ */
 class SdlEventManager : public DefaultEventManager {
 public:
 	SdlEventManager(Common::EventSource *boss);
 	virtual ~SdlEventManager();
 
+	/**
+	 * Gets and proccess SDL events
+	 */
 	virtual bool pollSdlEvent(Common::Event &event);
 
+	/**
+	 * Resets keyboard emulation after a video screen change
+	 */
 	virtual void resetKeyboadEmulation(int16 x_max, int16 y_max);
 
+	/**
+	 * Toggles mouse input grab
+	 */
 	virtual void toggleMouseGrab();
 
 protected:
-	// Keyboard mouse emulation.  Disabled by fingolfin 2004-12-18.
-	// I am keeping the rest of the code in for now, since the joystick
-	// code (or rather, "hack") uses it, too.
+	/** @name Keyboard mouse emulation
+	 * Disabled by fingolfin 2004-12-18.
+	 * I am keeping the rest of the code in for now, since the joystick
+	 * code (or rather, "hack") uses it, too.
+	 */
+	//@{
+
 	struct KbdMouse {
 		int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count;
 		uint32 last_time, delay_time, x_down_time, y_down_time;
 	};
 	KbdMouse _km;
 
-	// Scroll lock state - since SDL doesn't track it
+	//@}
+
+	/** Scroll lock state - since SDL doesn't track it */
 	bool _scrollLock;
 	
-	// Joystick
+	/** Joystick */
 	SDL_Joystick *_joystick;
 
+	/** Last screen id for checking if it was modified */
 	int _lastScreenID;
 
-	// Pre process an event before it is dispatched.
+	/**
+	 * Pre process an event before it is dispatched.
+	 */
 	virtual void preprocessEvents(SDL_Event *event) {}
 
-	// Dispatchs SDL events for each handler.
+	/**
+	 * Dispatchs SDL events for each handler.
+	 */
 	virtual bool dispatchSDLEvent(SDL_Event &ev, Common::Event &event);
 
-	// Handlers for specific SDL events, called by pollEvent.
-	// This way, if a managers inherits fromt this SDL events manager, it can
-	// change the behavior of only a single event, without having to override all
-	// of pollEvent.
+
+	/** @name Event Handlers
+	 * Handlers for specific SDL events, called by SdlEventManager::dispatchSDLEvent().
+	 * This way, if a managers inherits fromt this SDL events manager, it can
+	 * change the behavior of only a single event, without having to override all
+	 * of SdlEventManager::dispatchSDLEvent().
+	 */
+	//@{
+
 	virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event);
 	virtual bool handleKeyUp(SDL_Event &ev, Common::Event &event);
 	virtual bool handleMouseMotion(SDL_Event &ev, Common::Event &event);
@@ -81,13 +109,29 @@
 	virtual bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event);
 	virtual bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event);
 	virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event);
+	virtual void handleKbdMouse();
 
+	//@}
+
+	/**
+	 * Assigns the mouse coords to the mouse event
+	 */
 	virtual void fillMouseEvent(Common::Event &event, int x, int y);
 
-	virtual void handleKbdMouse();
+	/**
+	 * Remaps key events. This allows platforms to configure
+	 * their custom keys.
+	 */
 	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
 
+	/**
+	 * Maps the ASCII value of key
+	 */
 	virtual int mapKey(SDLKey key, SDLMod mod, Uint16 unicode);
+
+	/**
+	 * Configures the key modifiers flags status
+	 */
 	virtual void SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event);
 };
 

Modified: scummvm/branches/gsoc2010-opengl/backends/events/symbiansdl/symbiansdl-events.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/symbiansdl/symbiansdl-events.cpp	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/events/symbiansdl/symbiansdl-events.cpp	2010-07-03 00:13:45 UTC (rev 50609)
@@ -47,10 +47,6 @@
 	}
 }
 
-SymbianSdlEventManager::~SymbianSdlEventManager() {
-
-}
-
 bool SymbianSdlEventManager::remapKey(SDL_Event &ev, Common::Event &event) {
 	if (GUI::Actions::Instance()->mappingActive() || ev.key.keysym.sym <= SDLK_UNKNOWN)
 		return false;

Modified: scummvm/branches/gsoc2010-opengl/backends/events/symbiansdl/symbiansdl-events.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/symbiansdl/symbiansdl-events.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/events/symbiansdl/symbiansdl-events.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -30,13 +30,13 @@
 
 #define TOTAL_ZONES 3
 
+/**
+ * SDL events manager for Symbian
+ */
 class SymbianSdlEventManager : public SdlEventManager {
 public:
 	SymbianSdlEventManager(Common::EventSource *boss);
-	~SymbianSdlEventManager();
 
-	bool remapKey(SDL_Event &ev, Common::Event &event);
-
 protected:
 	// Used to handle joystick navi zones
 	int _mouseXZone[TOTAL_ZONES];
@@ -51,6 +51,8 @@
 	};
 
 	static zoneDesc _zones[TOTAL_ZONES];
+
+	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
 };
 
 #endif

Modified: scummvm/branches/gsoc2010-opengl/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -28,10 +28,13 @@
 
 #include "backends/mixer/sdl/sdl-mixer.h"
 
+/**
+ * SDL mixer manager with double buffering support.
+ */
 class DoubleBufferSDLMixerManager : public SdlMixerManager {
 public:
 	DoubleBufferSDLMixerManager();
-	~DoubleBufferSDLMixerManager();
+	virtual ~DoubleBufferSDLMixerManager();
 
 protected:
 	SDL_mutex *_soundMutex;
@@ -44,8 +47,19 @@
 	uint _soundBufSize;
 	byte *_soundBuffers[2];
 
+	/**
+	 * Handles and swap the sound buffers
+	 */
 	void mixerProducerThread();
+
+	/**
+	 * Finish the mixer manager
+	 */
 	void deinitThreadedMixer();
+
+	/**
+	 * Callback entry point for the sound thread
+	 */
 	static int SDLCALL mixerProducerThreadEntry(void *arg);
 
 	virtual void startAudio();

Modified: scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -34,28 +34,71 @@
 
 #include "sound/mixer_intern.h"
 
+/**
+ * SDL mixer manager. It wraps the actual implementation
+ * of the Audio:Mixer used by the engine, and setups
+ * the SDL audio subsystem and the callback for the
+ * audio mixer implementation.
+ */
 class SdlMixerManager {
 public:
 	SdlMixerManager();
 	virtual ~SdlMixerManager();
 
+	/**
+	 * Initialize and setups the mixer
+	 */
 	virtual void init();
 
+	/**
+	 * Get the audio mixer implementation
+	 */
 	Audio::Mixer *getMixer() { return (Audio::Mixer *)_mixer; }
 
 	// Used by LinuxMoto Port
+
+	/**
+	 * Pauses the audio system
+	 */
 	virtual void suspendAudio();
+
+	/**
+	 * Resumes the audio system
+	 */
 	virtual int resumeAudio();
 
 protected:
+	/** The mixer implementation */
 	Audio::MixerImpl *_mixer;
+
+	/**
+	 * The obtained audio specification after opening the
+	 * audio system.
+	 */
 	SDL_AudioSpec _obtainedRate;
+
+	/** State of the audio system */
 	bool _audioSuspended;
 
+	/**
+	 * Returns the desired audio specification 
+	 */
 	virtual SDL_AudioSpec getAudioSpec();
+
+	/**
+	 * Starts SDL audio
+	 */
 	virtual void startAudio();
 
+	/**
+	 * Handles the audio callback
+	 */
 	virtual void callbackHandler(byte *samples, int len);
+
+	/**
+	 * The mixer callback entry point. Static functions can't be overrided
+	 * by subclasses, so it invokes the non-static function callbackHandler()
+	 */
 	static void sdlCallback(void *this_, byte *samples, int len);
 };
 

Modified: scummvm/branches/gsoc2010-opengl/backends/mixer/symbiansdl/symbiansdl-mixer.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/mixer/symbiansdl/symbiansdl-mixer.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/mixer/symbiansdl/symbiansdl-mixer.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -28,18 +28,21 @@
 
 #include "backends/mixer/sdl/sdl-mixer.h"
 
+/**
+ * SDL mixer manager for Symbian
+ */
 class SymbianSdlMixerManager : public SdlMixerManager {
 public:
 	SymbianSdlMixerManager();
-	~SymbianSdlMixerManager();
+	virtual ~SymbianSdlMixerManager();
 
-	void init();
+	virtual void init();
 
 protected:
 	int _channels;
 	byte *_stereo_mix_buffer;
 
-	void callbackHandler(byte *samples, int len);
+	virtual void callbackHandler(byte *samples, int len);
 };
 
 #endif

Modified: scummvm/branches/gsoc2010-opengl/backends/mutex/mutex.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/mutex/mutex.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/mutex/mutex.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -29,6 +29,10 @@
 #include "common/system.h"
 #include "common/noncopyable.h"
 
+/**
+ * Abstract class for mutex manager. Subclasses
+ * implement the real functionality.
+ */
 class MutexManager : Common::NonCopyable {
 public:
 	virtual ~MutexManager() {}
@@ -39,5 +43,4 @@
 	virtual void deleteMutex(OSystem::MutexRef mutex) = 0;
 };
 
-
 #endif

Modified: scummvm/branches/gsoc2010-opengl/backends/mutex/null/null-mutex.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/mutex/null/null-mutex.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/mutex/null/null-mutex.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -28,12 +28,15 @@
 
 #include "backends/mutex/mutex.h"
 
+/**
+ * Null mutex manager
+ */
 class NullMutexManager : MutexManager {
 public:
-	OSystem::MutexRef createMutex() { return OSystem::MutexRef(); }
-	void lockMutex(OSystem::MutexRef mutex) {}
-	void unlockMutex(OSystem::MutexRef mutex) {}
-	void deleteMutex(OSystem::MutexRef mutex) {}
+	virtual OSystem::MutexRef createMutex() { return OSystem::MutexRef(); }
+	virtual void lockMutex(OSystem::MutexRef mutex) {}
+	virtual void unlockMutex(OSystem::MutexRef mutex) {}
+	virtual void deleteMutex(OSystem::MutexRef mutex) {}
 };
 
 #endif

Modified: scummvm/branches/gsoc2010-opengl/backends/mutex/sdl/sdl-mutex.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/mutex/sdl/sdl-mutex.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/mutex/sdl/sdl-mutex.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -28,12 +28,15 @@
 
 #include "backends/mutex/mutex.h"
 
+/**
+ * SDL mutex manager
+ */
 class SdlMutexManager : public MutexManager {
 public:
-	OSystem::MutexRef createMutex();
-	void lockMutex(OSystem::MutexRef mutex);
-	void unlockMutex(OSystem::MutexRef mutex);
-	void deleteMutex(OSystem::MutexRef mutex);
+	virtual OSystem::MutexRef createMutex();
+	virtual void lockMutex(OSystem::MutexRef mutex);
+	virtual void unlockMutex(OSystem::MutexRef mutex);
+	virtual void deleteMutex(OSystem::MutexRef mutex);
 };
 
 

Modified: scummvm/branches/gsoc2010-opengl/backends/timer/default/default-timer.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/timer/default/default-timer.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/timer/default/default-timer.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -40,7 +40,8 @@
 
 public:
 	DefaultTimerManager();
-	~DefaultTimerManager();
+	virtual ~DefaultTimerManager();
+
 	bool installTimerProc(TimerProc proc, int32 interval, void *refCon);
 	void removeTimerProc(TimerProc proc);
 

Modified: scummvm/branches/gsoc2010-opengl/backends/timer/sdl/sdl-timer.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/timer/sdl/sdl-timer.cpp	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/timer/sdl/sdl-timer.cpp	2010-07-03 00:13:45 UTC (rev 50609)
@@ -34,14 +34,17 @@
 }
 
 SdlTimerManager::SdlTimerManager() {
+	// Initializes the SDL timer subsystem
 	if (SDL_InitSubSystem(SDL_INIT_TIMER) == -1) {
 		error("Could not initialize SDL: %s", SDL_GetError());
 	}
 
+	// Creates the timer callback
 	_timerID = SDL_AddTimer(10, &timer_handler, this);
 }
 
 SdlTimerManager::~SdlTimerManager() {
+	// Removes the timer callback
 	SDL_RemoveTimer(_timerID);
 }
 

Modified: scummvm/branches/gsoc2010-opengl/backends/timer/sdl/sdl-timer.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/timer/sdl/sdl-timer.h	2010-07-03 00:06:54 UTC (rev 50608)
+++ scummvm/branches/gsoc2010-opengl/backends/timer/sdl/sdl-timer.h	2010-07-03 00:13:45 UTC (rev 50609)
@@ -34,10 +34,14 @@
 #include <SDL.h>
 #endif
 
+/**
+ * SDL timer manager. Setups the timer callback for
+ * DefaultTimerManager.
+ */
 class SdlTimerManager : public DefaultTimerManager {
 public:
 	SdlTimerManager();
-	~SdlTimerManager();
+	virtual ~SdlTimerManager();
 
 protected:
 	SDL_TimerID _timerID;


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