From 56b9e6c9b70a5a1b00ddadfb9cc4e298c1153a0b Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Mon, 7 Jun 2010 03:19:18 +0000 Subject: Removed code that is now in managers. Added mutex and graphics manager initialization and functions redirections. svn-id: r49473 --- backends/platform/sdl/sdl.h | 241 ++++---------------------------------------- 1 file changed, 17 insertions(+), 224 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index c850ec5ab1..214a8a988c 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -33,6 +33,10 @@ #endif #include "backends/base-backend.h" + +#include "backends/mutex/sdl/sdl-mutex.h" +#include "backends/graphics/sdl/sdl-graphics.h" + #include "graphics/scaler.h" @@ -54,35 +58,6 @@ namespace Audio { #define MIXER_DOUBLE_BUFFERING 1 #endif - -enum { - GFX_NORMAL = 0, - GFX_DOUBLESIZE = 1, - GFX_TRIPLESIZE = 2, - GFX_2XSAI = 3, - GFX_SUPER2XSAI = 4, - GFX_SUPEREAGLE = 5, - GFX_ADVMAME2X = 6, - GFX_ADVMAME3X = 7, - GFX_HQ2X = 8, - GFX_HQ3X = 9, - GFX_TV2X = 10, - GFX_DOTMATRIX = 11 -}; - -class AspectRatio { - int _kw, _kh; -public: - AspectRatio() { _kw = _kh = 0; } - AspectRatio(int w, int h); - - bool isAuto() const { return (_kw | _kh) == 0; } - - int kw() const { return _kw; } - int kh() const { return _kh; } -}; - - class OSystem_SDL : public BaseBackend { public: OSystem_SDL(); @@ -90,12 +65,18 @@ public: virtual void initBackend(); + +protected: + SdlMutexManager *_mutexManager; + SdlGraphicsManager *_graphicsManager; + +public: void beginGFXTransaction(); TransactionError endGFXTransaction(); #ifdef USE_RGB_COLOR // Game screen - virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } + virtual Graphics::PixelFormat getScreenFormat() const; // Highest supported virtual Common::List getSupportedFormats(); @@ -105,7 +86,7 @@ public: // Typically, 320x200 CLUT8 virtual void initSize(uint w, uint h, const Graphics::PixelFormat *format); // overloaded by CE backend - virtual int getScreenChangeID() const { return _screenChangeCount; } + virtual int getScreenChangeID() const; // Set colors of the palette void setPalette(const byte *colors, uint start, uint num); @@ -138,10 +119,7 @@ public: void setCursorPalette(const byte *colors, uint start, uint num); // Disables or enables cursor palette - void disableCursorPalette(bool disable) { - _cursorPaletteDisabled = disable; - blitCursor(); - } + void disableCursorPalette(bool disable); // Shaking is used in SCUMM. Set current shake position. void setShakePos(int shake_pos); @@ -214,7 +192,7 @@ public: void deleteMutex(MutexRef mutex); // Overlay - virtual Graphics::PixelFormat getOverlayFormat() const { return _overlayFormat; } + virtual Graphics::PixelFormat getOverlayFormat() const; virtual void showOverlay(); virtual void hideOverlay(); @@ -223,8 +201,8 @@ public: virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); virtual int16 getHeight(); virtual int16 getWidth(); - virtual int16 getOverlayHeight() { return _videoMode.overlayHeight; } - virtual int16 getOverlayWidth() { return _videoMode.overlayWidth; } + virtual int16 getOverlayHeight(); + virtual int16 getOverlayWidth(); virtual const GraphicsMode *getSupportedGraphicsModes() const; virtual int getDefaultGraphicsMode() const; @@ -254,110 +232,11 @@ protected: bool _inited; SDL_AudioSpec _obtainedRate; -#ifdef USE_OSD - SDL_Surface *_osdSurface; - Uint8 _osdAlpha; // Transparency level of the OSD - uint32 _osdFadeStartTime; // When to start the fade out - enum { - kOSDFadeOutDelay = 2 * 1000, // Delay before the OSD is faded out (in milliseconds) - kOSDFadeOutDuration = 500, // Duration of the OSD fade out (in milliseconds) - kOSDColorKey = 1, - kOSDInitialAlpha = 80 // Initial alpha level, in percent - }; -#endif - - // hardware screen - SDL_Surface *_hwscreen; - - // unseen game screen - SDL_Surface *_screen; -#ifdef USE_RGB_COLOR - Graphics::PixelFormat _screenFormat; - Graphics::PixelFormat _cursorFormat; -#endif - - // temporary screen (for scalers) - SDL_Surface *_tmpscreen; - SDL_Surface *_tmpscreen2; - - // overlay - SDL_Surface *_overlayscreen; - bool _overlayVisible; - Graphics::PixelFormat _overlayFormat; - // CD Audio SDL_CD *_cdrom; int _cdTrack, _cdNumLoops, _cdStartFrame, _cdDuration; uint32 _cdEndTime, _cdStopTime; - enum { - DF_WANT_RECT_OPTIM = 1 << 0 - }; - - enum { - kTransactionNone = 0, - kTransactionActive = 1, - kTransactionRollback = 2 - }; - - struct TransactionDetails { - bool sizeChanged; - bool needHotswap; - bool needUpdatescreen; - bool normal1xScaler; -#ifdef USE_RGB_COLOR - bool formatChanged; -#endif - }; - TransactionDetails _transactionDetails; - - struct VideoState { - bool setup; - - bool fullscreen; - bool aspectRatioCorrection; - AspectRatio desiredAspectRatio; - - int mode; - int scaleFactor; - - int screenWidth, screenHeight; - int overlayWidth, overlayHeight; - int hardwareWidth, hardwareHeight; -#ifdef USE_RGB_COLOR - Graphics::PixelFormat format; -#endif - }; - VideoState _videoMode, _oldVideoMode; - - virtual void setGraphicsModeIntern(); // overloaded by CE backend - - /** Force full redraw on next updateScreen */ - bool _forceFull; - ScalerProc *_scalerProc; - int _scalerType; - int _transactionMode; - - bool _screenIsLocked; - Graphics::Surface _framebuffer; - - /** Current video mode flags (see DF_* constants) */ - uint32 _modeFlags; - bool _modeChanged; - int _screenChangeCount; - - enum { - NUM_DIRTY_RECT = 100, - MAX_SCALING = 3 - }; - - // Dirty rect management - SDL_Rect _dirtyRectList[NUM_DIRTY_RECT]; - int _numDirtyRects; - uint32 *_dirtyChecksums; - bool _cksumValid; - int _cksumNum; - // 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. @@ -366,50 +245,7 @@ protected: uint32 last_time, delay_time, x_down_time, y_down_time; }; - struct MousePos { - // The mouse position, using either virtual (game) or real - // (overlay) coordinates. - int16 x, y; - - // The size and hotspot of the original cursor image. - int16 w, h; - int16 hotX, hotY; - - // The size and hotspot of the pre-scaled cursor image, in real - // coordinates. - int16 rW, rH; - int16 rHotX, rHotY; - - // The size and hotspot of the pre-scaled cursor image, in game - // coordinates. - int16 vW, vH; - int16 vHotX, vHotY; - - MousePos() : x(0), y(0), w(0), h(0), hotX(0), hotY(0), - rW(0), rH(0), rHotX(0), rHotY(0), vW(0), vH(0), - vHotX(0), vHotY(0) - { } - }; - - // mouse KbdMouse _km; - bool _mouseVisible; - bool _mouseNeedsRedraw; - byte *_mouseData; - SDL_Rect _mouseBackup; - MousePos _mouseCurState; -#ifdef USE_RGB_COLOR - uint32 _mouseKeyColor; -#else - byte _mouseKeyColor; -#endif - int _cursorTargetScale; - bool _cursorPaletteDisabled; - SDL_Surface *_mouseOrigSurface; - SDL_Surface *_mouseSurface; - enum { - kMouseColorKey = 1 - }; // Scroll lock state - since SDL doesn't track it bool _scrollLock; @@ -417,23 +253,6 @@ protected: // joystick SDL_Joystick *_joystick; - // Shake mode - int _currentShakePos; - int _newShakePos; - - // Palette data - SDL_Color *_currentPalette; - uint _paletteDirtyStart, _paletteDirtyEnd; - - // Cursor palette data - SDL_Color *_cursorPalette; - - /** - * Mutex which prevents multiple threads from interfering with each other - * when accessing the screen. - */ - MutexRef _graphicsMutex; - #ifdef MIXER_DOUBLE_BUFFERING SDL_mutex *_soundMutex; SDL_cond *_soundCond; @@ -459,40 +278,14 @@ protected: Common::TimerManager *_timer; protected: - void addDirtyRgnAuto(const byte *buf); - void makeChecksums(const byte *buf); - - virtual void addDirtyRect(int x, int y, int w, int h, bool realCoordinates = false); // overloaded by CE backend - - virtual void drawMouse(); // overloaded by CE backend - virtual void undrawMouse(); // overloaded by CE backend (FIXME) - virtual void blitCursor(); // overloaded by CE backend (FIXME) - - /** Set the position of the virtual mouse cursor. */ - void setMousePos(int x, int y); virtual void fillMouseEvent(Common::Event &event, int x, int y); // overloaded by CE backend void toggleMouseGrab(); - virtual void internUpdateScreen(); // overloaded by CE backend - - virtual bool loadGFXMode(); // overloaded by CE backend - virtual void unloadGFXMode(); // overloaded by CE backend - virtual bool hotswapGFXMode(); // overloaded by CE backend - - void setFullscreenMode(bool enable); - void setAspectRatioCorrection(bool enable); - - virtual bool saveScreenshot(const char *filename); // overloaded by CE backend - - int effectiveScreenHeight() const; + void handleKbdMouse(); void setupIcon(); - void handleKbdMouse(); virtual bool remapKey(SDL_Event &ev, Common::Event &event); - - bool handleScalerHotkeys(const SDL_KeyboardEvent &key); - bool isScalerHotkey(const Common::Event &event); }; #endif -- cgit v1.2.3 From e991cd8c53ad21af037df1e0a16816aeea2d0fe2 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Wed, 9 Jun 2010 20:09:57 +0000 Subject: - Revised abstract AudioCDManager. - Removed AudioCDManager Singleton, and changed code for using AudioCDManager in OSystem. - Added initialization code for new AudioCDManager in BaseBackend and OSystem_SDL. svn-id: r49548 --- backends/platform/sdl/sdl.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 214a8a988c..ebe8728f51 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -36,6 +36,7 @@ #include "backends/mutex/sdl/sdl-mutex.h" #include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/audiocd/sdl/sdl-audiocd.h" #include "graphics/scaler.h" @@ -69,6 +70,7 @@ public: protected: SdlMutexManager *_mutexManager; SdlGraphicsManager *_graphicsManager; + SdlAudioCDManager *_audiocdManager; public: void beginGFXTransaction(); @@ -164,19 +166,6 @@ public: virtual Audio::Mixer *getMixer(); - // Poll CD status - // Returns true if cd audio is playing - bool pollCD(); - - // Play CD audio track - void playCD(int track, int num_loops, int start_frame, int duration); - - // Stop CD audio track - void stopCD(); - - // Update CD audio status - void updateCD(); - // Quit virtual void quit(); // overloaded by CE backend @@ -210,7 +199,6 @@ public: virtual int getGraphicsMode() const; virtual void setWindowCaption(const char *caption); - virtual bool openCD(int drive); virtual bool hasFeature(Feature f); virtual void setFeatureState(Feature f, bool enable); @@ -228,15 +216,12 @@ public: virtual Common::SeekableReadStream *createConfigReadStream(); virtual Common::WriteStream *createConfigWriteStream(); + virtual AudioCDManager *getAudioCD(); + protected: bool _inited; SDL_AudioSpec _obtainedRate; - // CD Audio - SDL_CD *_cdrom; - int _cdTrack, _cdNumLoops, _cdStartFrame, _cdDuration; - uint32 _cdEndTime, _cdStopTime; - // 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. @@ -277,7 +262,6 @@ protected: SDL_TimerID _timerID; Common::TimerManager *_timer; -protected: virtual void fillMouseEvent(Common::Event &event, int x, int y); // overloaded by CE backend void toggleMouseGrab(); -- cgit v1.2.3 From e81fb60d34029c761c8b935ceaad3322f7b8bdee Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Fri, 11 Jun 2010 02:50:25 +0000 Subject: Add Common::EventSource inheritance for ModularBackend. OSystem_SDL now subclass from ModularBackend insteand of BaseBackend. Added forceFullRedraw() to SdlGraphicsManager and removed _modeChanged. svn-id: r49590 --- backends/platform/sdl/sdl.h | 151 ++++++-------------------------------------- 1 file changed, 21 insertions(+), 130 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index ebe8728f51..67ad339da7 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -32,7 +32,7 @@ #include #endif -#include "backends/base-backend.h" +#include "backends/modular-backend.h" #include "backends/mutex/sdl/sdl-mutex.h" #include "backends/graphics/sdl/sdl-graphics.h" @@ -59,165 +59,46 @@ namespace Audio { #define MIXER_DOUBLE_BUFFERING 1 #endif -class OSystem_SDL : public BaseBackend { +class OSystem_SDL : public ModularBackend { public: OSystem_SDL(); virtual ~OSystem_SDL(); virtual void initBackend(); - -protected: - SdlMutexManager *_mutexManager; - SdlGraphicsManager *_graphicsManager; - SdlAudioCDManager *_audiocdManager; - -public: - void beginGFXTransaction(); - TransactionError endGFXTransaction(); - -#ifdef USE_RGB_COLOR - // Game screen - virtual Graphics::PixelFormat getScreenFormat() const; - - // Highest supported - virtual Common::List getSupportedFormats(); -#endif - - // Set the size and format of the video bitmap. - // Typically, 320x200 CLUT8 - virtual void initSize(uint w, uint h, const Graphics::PixelFormat *format); // overloaded by CE backend - - virtual int getScreenChangeID() const; - - // Set colors of the palette - void setPalette(const byte *colors, uint start, uint num); - - // Get colors of the palette - void grabPalette(byte *colors, uint start, uint num); - - // Draw a bitmap to screen. - // The screen will not be updated to reflect the new bitmap - virtual void copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h); // overloaded by CE backend (FIXME) - - virtual Graphics::Surface *lockScreen(); - virtual void unlockScreen(); - - // Update the dirty areas of the screen - void updateScreen(); - - // Either show or hide the mouse cursor - bool showMouse(bool visible); - - // Warp the mouse cursor. Where set_mouse_pos() only informs the - // backend of the mouse cursor's current position, this function - // actually moves the cursor to the specified position. - virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME) - - // Set the bitmap that's used when drawing the cursor. - virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format); // overloaded by CE backend (FIXME) - - // Set colors of cursor palette - void setCursorPalette(const byte *colors, uint start, uint num); - - // Disables or enables cursor palette - void disableCursorPalette(bool disable); - - // Shaking is used in SCUMM. Set current shake position. - void setShakePos(int shake_pos); - // Get the number of milliseconds since the program was started. uint32 getMillis(); // Delay for a specified amount of milliseconds void delayMillis(uint msecs); + virtual void getTimeAndDate(TimeDate &t) const; + // Get the next event. // Returns true if an event was retrieved. virtual bool pollEvent(Common::Event &event); // overloaded by CE backend -protected: - virtual bool dispatchSDLEvent(SDL_Event &ev, Common::Event &event); - - // Handlers for specific SDL events, called by pollEvent. - // This way, if a backend inherits fromt the SDL backend, it can - // change the behavior of only a single event, without having to override all - // of pollEvent. - 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); - virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event); - virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event); - 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); - -public: - - // Define all hardware keys for keymapper virtual Common::HardwareKeySet *getHardwareKeySet(); + virtual void preprocessEvents(SDL_Event *event) {} + // Set function that generates samples virtual void setupMixer(); static void mixCallback(void *s, byte *samples, int len); - virtual void closeMixer(); - virtual Audio::Mixer *getMixer(); - // Quit virtual void quit(); // overloaded by CE backend void deinit(); - virtual void getTimeAndDate(TimeDate &t) const; - virtual Common::TimerManager *getTimerManager(); - - // Mutex handling - MutexRef createMutex(); - void lockMutex(MutexRef mutex); - void unlockMutex(MutexRef mutex); - void deleteMutex(MutexRef mutex); - - // Overlay - virtual Graphics::PixelFormat getOverlayFormat() const; - - virtual void showOverlay(); - virtual void hideOverlay(); - virtual void clearOverlay(); - virtual void grabOverlay(OverlayColor *buf, int pitch); - virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); - virtual int16 getHeight(); - virtual int16 getWidth(); - virtual int16 getOverlayHeight(); - virtual int16 getOverlayWidth(); - - virtual const GraphicsMode *getSupportedGraphicsModes() const; - virtual int getDefaultGraphicsMode() const; - virtual bool setGraphicsMode(int mode); - virtual int getGraphicsMode() const; - virtual void setWindowCaption(const char *caption); - virtual bool hasFeature(Feature f); - virtual void setFeatureState(Feature f, bool enable); - virtual bool getFeatureState(Feature f); - virtual void preprocessEvents(SDL_Event *event) {} - -#ifdef USE_OSD - void displayMessageOnOSD(const char *msg); -#endif - - virtual Common::SaveFileManager *getSavefileManager(); - virtual FilesystemFactory *getFilesystemFactory(); virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); - virtual Common::SeekableReadStream *createConfigReadStream(); virtual Common::WriteStream *createConfigWriteStream(); - virtual AudioCDManager *getAudioCD(); - protected: bool _inited; SDL_AudioSpec _obtainedRate; @@ -238,6 +119,21 @@ protected: // joystick SDL_Joystick *_joystick; + virtual bool dispatchSDLEvent(SDL_Event &ev, Common::Event &event); + + // Handlers for specific SDL events, called by pollEvent. + // This way, if a backend inherits fromt the SDL backend, it can + // change the behavior of only a single event, without having to override all + // of pollEvent. + 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); + virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event); + virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event); + 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); + #ifdef MIXER_DOUBLE_BUFFERING SDL_mutex *_soundMutex; SDL_cond *_soundCond; @@ -255,12 +151,7 @@ protected: void deinitThreadedMixer(); #endif - FilesystemFactory *_fsFactory; - Common::SaveFileManager *_savefile; - Audio::MixerImpl *_mixer; - SDL_TimerID _timerID; - Common::TimerManager *_timer; virtual void fillMouseEvent(Common::Event &event, int x, int y); // overloaded by CE backend void toggleMouseGrab(); -- cgit v1.2.3 From b49814f274c5634324680567d4d1dfea1d23b698 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Fri, 11 Jun 2010 23:04:57 +0000 Subject: Fixed compilation error on Mac. svn-id: r49600 --- backends/platform/sdl/sdl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 67ad339da7..9cd7da0b4f 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -147,7 +147,7 @@ protected: void mixerProducerThread(); static int SDLCALL mixerProducerThreadEntry(void *arg); - void initThreadedMixer(Audio::MixerImpl *mixer, uint bufSize); + void initThreadedMixer(Audio::Mixer *mixer, uint bufSize); void deinitThreadedMixer(); #endif -- cgit v1.2.3 From 3cfa482b43dcfef774fb0c284bf19ab07cdc4f20 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sat, 12 Jun 2010 02:54:51 +0000 Subject: Created SdlMixerImpl. Added setSampleRate method to Audio::MixerImpl. Updated and removed mixer code in OSystem_SDL for using SdlMixerImpl. svn-id: r49602 --- backends/platform/sdl/sdl.h | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 9cd7da0b4f..cb157b003e 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -50,15 +50,6 @@ namespace Audio { #define USE_OSD 1 #endif -#if defined(MACOSX) -// On Mac OS X, we need to double buffer the audio buffer, else anything -// which produces sampled data with high latency (like the MT-32 emulator) -// will sound terribly. -// This could be enabled for more / most ports in the future, but needs some -// testing. -#define MIXER_DOUBLE_BUFFERING 1 -#endif - class OSystem_SDL : public ModularBackend { public: OSystem_SDL(); @@ -83,11 +74,6 @@ public: virtual void preprocessEvents(SDL_Event *event) {} - // Set function that generates samples - virtual void setupMixer(); - static void mixCallback(void *s, byte *samples, int len); - virtual void closeMixer(); - // Quit virtual void quit(); // overloaded by CE backend @@ -101,7 +87,6 @@ public: protected: bool _inited; - SDL_AudioSpec _obtainedRate; // Keyboard mouse emulation. Disabled by fingolfin 2004-12-18. // I am keeping the rest of the code in for now, since the joystick @@ -134,23 +119,6 @@ protected: virtual bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event); virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event); -#ifdef MIXER_DOUBLE_BUFFERING - SDL_mutex *_soundMutex; - SDL_cond *_soundCond; - SDL_Thread *_soundThread; - bool _soundThreadIsRunning; - bool _soundThreadShouldQuit; - - byte _activeSoundBuf; - uint _soundBufSize; - byte *_soundBuffers[2]; - - void mixerProducerThread(); - static int SDLCALL mixerProducerThreadEntry(void *arg); - void initThreadedMixer(Audio::Mixer *mixer, uint bufSize); - void deinitThreadedMixer(); -#endif - SDL_TimerID _timerID; virtual void fillMouseEvent(Common::Event &event, int x, int y); // overloaded by CE backend -- cgit v1.2.3 From 360b82858cd21307a784fe1029825021e076756f Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sun, 13 Jun 2010 20:31:25 +0000 Subject: Added SdlEventManager. svn-id: r49635 --- backends/platform/sdl/sdl.h | 48 ++++----------------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index cb157b003e..5a621a8645 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -65,15 +65,9 @@ public: virtual void getTimeAndDate(TimeDate &t) const; - // Get the next event. - // Returns true if an event was retrieved. - virtual bool pollEvent(Common::Event &event); // overloaded by CE backend - // Define all hardware keys for keymapper virtual Common::HardwareKeySet *getHardwareKeySet(); - virtual void preprocessEvents(SDL_Event *event) {} - // Quit virtual void quit(); // overloaded by CE backend @@ -85,50 +79,16 @@ public: virtual Common::SeekableReadStream *createConfigReadStream(); virtual Common::WriteStream *createConfigWriteStream(); + SdlGraphicsManager *getGraphicsManager(); + + virtual bool pollEvent(Common::Event &event); + protected: bool _inited; - // 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 - bool _scrollLock; - - // joystick - SDL_Joystick *_joystick; - - virtual bool dispatchSDLEvent(SDL_Event &ev, Common::Event &event); - - // Handlers for specific SDL events, called by pollEvent. - // This way, if a backend inherits fromt the SDL backend, it can - // change the behavior of only a single event, without having to override all - // of pollEvent. - 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); - virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event); - virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event); - 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); - SDL_TimerID _timerID; - virtual void fillMouseEvent(Common::Event &event, int x, int y); // overloaded by CE backend - void toggleMouseGrab(); - - void handleKbdMouse(); - void setupIcon(); - - virtual bool remapKey(SDL_Event &ev, Common::Event &event); }; #endif -- cgit v1.2.3 From 77f114b835eaafcc334ad38c407faaa04cb62eb8 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sun, 13 Jun 2010 21:09:52 +0000 Subject: Added SdlTimerManager. Added getMillis, delayMillis and getTimeAndDate to Common::TimerManager, DefaultTimerManager and ModularBackend. Removed timer code from OSystem_SDL. svn-id: r49637 --- backends/platform/sdl/sdl.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 5a621a8645..8dae6a779c 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -33,22 +33,7 @@ #endif #include "backends/modular-backend.h" - -#include "backends/mutex/sdl/sdl-mutex.h" #include "backends/graphics/sdl/sdl-graphics.h" -#include "backends/audiocd/sdl/sdl-audiocd.h" - -#include "graphics/scaler.h" - - -namespace Audio { - class MixerImpl; -} - -#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) -// Uncomment this to enable the 'on screen display' code. -#define USE_OSD 1 -#endif class OSystem_SDL : public ModularBackend { public: @@ -57,14 +42,6 @@ public: virtual void initBackend(); - // Get the number of milliseconds since the program was started. - uint32 getMillis(); - - // Delay for a specified amount of milliseconds - void delayMillis(uint msecs); - - virtual void getTimeAndDate(TimeDate &t) const; - // Define all hardware keys for keymapper virtual Common::HardwareKeySet *getHardwareKeySet(); @@ -86,8 +63,6 @@ public: protected: bool _inited; - SDL_TimerID _timerID; - void setupIcon(); }; -- cgit v1.2.3 From 4a850209d739111b539fc39bcf003abd6e061538 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sun, 20 Jun 2010 20:11:30 +0000 Subject: Removed getMillis, delayMillis and getTimeAndDate functions from TimerManager. svn-id: r50095 --- backends/platform/sdl/sdl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 8dae6a779c..46053faf46 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -60,6 +60,10 @@ public: virtual bool pollEvent(Common::Event &event); + uint32 getMillis(); + void delayMillis(uint msecs); + void getTimeAndDate(TimeDate &td) const; + protected: bool _inited; -- cgit v1.2.3 From 9d41a45976767a6337d756e547fd9b7c2d6ef4aa Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sun, 20 Jun 2010 22:45:09 +0000 Subject: Created win32 port from sdl backend. svn-id: r50103 --- backends/platform/sdl/sdl.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 46053faf46..f5289edbe8 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -48,7 +48,7 @@ public: // Quit virtual void quit(); // overloaded by CE backend - void deinit(); + virtual void deinit(); virtual void setWindowCaption(const char *caption); @@ -60,14 +60,16 @@ public: virtual bool pollEvent(Common::Event &event); - uint32 getMillis(); - void delayMillis(uint msecs); - void getTimeAndDate(TimeDate &td) const; + virtual uint32 getMillis(); + virtual void delayMillis(uint msecs); + virtual void getTimeAndDate(TimeDate &td) const; protected: bool _inited; void setupIcon(); + + virtual Common::String getDefaultConfigFileName(); }; #endif -- cgit v1.2.3 From 04dce6a10646d1060813c90c9270be46c36c02cd Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Wed, 23 Jun 2010 19:34:07 +0000 Subject: Fixed AudioCDManager not having a public inheritance. Backend code cleanup. svn-id: r50189 --- backends/platform/sdl/sdl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index f5289edbe8..40fbcd9d37 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -42,12 +42,9 @@ public: virtual void initBackend(); - // Define all hardware keys for keymapper virtual Common::HardwareKeySet *getHardwareKeySet(); - // Quit - virtual void quit(); // overloaded by CE backend - + virtual void quit(); virtual void deinit(); virtual void setWindowCaption(const char *caption); @@ -56,7 +53,7 @@ public: virtual Common::SeekableReadStream *createConfigReadStream(); virtual Common::WriteStream *createConfigWriteStream(); - SdlGraphicsManager *getGraphicsManager(); + virtual SdlGraphicsManager *getGraphicsManager(); virtual bool pollEvent(Common::Event &event); @@ -66,8 +63,11 @@ public: protected: bool _inited; + bool _initedSDL; + + virtual void initSDL(); - void setupIcon(); + virtual void setupIcon(); virtual Common::String getDefaultConfigFileName(); }; -- cgit v1.2.3 From d89cb33bcbca0334344501a86d30655d6a055262 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Thu, 24 Jun 2010 04:11:54 +0000 Subject: Refactored SDL mixer manager. Created a SdlMixerManager subclass for Mac OSX. svn-id: r50198 --- backends/platform/sdl/sdl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 40fbcd9d37..ec6432830b 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -34,6 +34,7 @@ #include "backends/modular-backend.h" #include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/mixer/sdl/sdl-mixer.h" class OSystem_SDL : public ModularBackend { public: @@ -61,9 +62,12 @@ public: virtual void delayMillis(uint msecs); virtual void getTimeAndDate(TimeDate &td) const; + virtual Audio::Mixer *getMixer(); + protected: bool _inited; bool _initedSDL; + SdlMixerManager *_mixerManager; virtual void initSDL(); -- cgit v1.2.3 From 307d7aeb4fc044d925295b6ed1d4c7c359a99920 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Thu, 24 Jun 2010 17:37:09 +0000 Subject: Added a init function to OSystem_SDL for early backend setup, and so allowing better sub classing. svn-id: r50224 --- backends/platform/sdl/sdl.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index ec6432830b..8740b82b9f 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -41,6 +41,12 @@ public: OSystem_SDL(); virtual ~OSystem_SDL(); + /** Pre-initialize backend, it should be called after + * instantiating the backend. Early needed managers + * are created here. + */ + virtual void init(); + virtual void initBackend(); virtual Common::HardwareKeySet *getHardwareKeySet(); -- cgit v1.2.3 From 70e9a5b951e9086eb08aed8ce95b22eab0354637 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sat, 26 Jun 2010 03:44:47 +0000 Subject: Removed DEFAULT_CONFIG_FILE define in favor of new getConfigFileNameString function. svn-id: r50301 --- backends/platform/sdl/sdl.h | 1 + 1 file changed, 1 insertion(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 8740b82b9f..53b38d1dd6 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -79,6 +79,7 @@ protected: virtual void setupIcon(); + virtual const char *getConfigFileNameString(); virtual Common::String getDefaultConfigFileName(); }; -- cgit v1.2.3 From 936f5585794972bb76b25164890315786dbe3401 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sun, 27 Jun 2010 05:12:37 +0000 Subject: Improved getDefaultConfigFileName(). Code cleanup. svn-id: r50364 --- backends/platform/sdl/sdl.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 53b38d1dd6..c61b8c810f 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -60,8 +60,6 @@ public: virtual Common::SeekableReadStream *createConfigReadStream(); virtual Common::WriteStream *createConfigWriteStream(); - virtual SdlGraphicsManager *getGraphicsManager(); - virtual bool pollEvent(Common::Event &event); virtual uint32 getMillis(); @@ -70,16 +68,24 @@ public: virtual Audio::Mixer *getMixer(); + // Get the Graphics Manager instance, used by other managers + virtual SdlGraphicsManager *getGraphicsManager(); + protected: bool _inited; bool _initedSDL; + + // Mixer manager that encapsulates the actual Audio::Mixer SdlMixerManager *_mixerManager; + // Initialze SDL library virtual void initSDL(); + // Setup the window icon virtual void setupIcon(); - virtual const char *getConfigFileNameString(); + // Get the file path where the user configuration + // of ScummVM will be saved virtual Common::String getDefaultConfigFileName(); }; -- cgit v1.2.3 From fd77e4b09c8ca80c8e449ad7266afaa494f98500 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Tue, 29 Jun 2010 01:08:36 +0000 Subject: Modularized Linuxmoto port. svn-id: r50474 --- backends/platform/sdl/sdl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index c61b8c810f..c238422906 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -71,6 +71,9 @@ public: // Get the Graphics Manager instance, used by other managers virtual SdlGraphicsManager *getGraphicsManager(); + // Get the Sdl Mixer Manager instance (not the Audio::Mixer) + virtual SdlMixerManager *getMixerManager(); + protected: bool _inited; bool _initedSDL; -- cgit v1.2.3 From f9c3a4547cbf1b1942402d618fa403a7fb1cb656 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Fri, 2 Jul 2010 06:44:42 +0000 Subject: Cleanup and documentation. svn-id: r50589 --- backends/platform/sdl/sdl.h | 59 +++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 23 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index c238422906..f2b513752f 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -23,8 +23,8 @@ * */ -#ifndef SDL_COMMON_H -#define SDL_COMMON_H +#ifndef PLATFORM_SDL_H +#define PLATFORM_SDL_H #if defined(__SYMBIAN32__) #include @@ -36,59 +36,72 @@ #include "backends/graphics/sdl/sdl-graphics.h" #include "backends/mixer/sdl/sdl-mixer.h" +/** + * Base OSystem class for all SDL ports. + */ class OSystem_SDL : public ModularBackend { public: OSystem_SDL(); virtual ~OSystem_SDL(); - /** Pre-initialize backend, it should be called after - * instantiating the backend. Early needed managers - * are created here. + /** + * Pre-initialize backend. It should be called after + * instantiating the backend. Early needed managers are + * created here. */ virtual void init(); - virtual void initBackend(); + /** + * Get the Graphics Manager instance. Used by other managers. + */ + virtual SdlGraphicsManager *getGraphicsManager(); - virtual Common::HardwareKeySet *getHardwareKeySet(); + /** + * Get the Mixer Manager instance. Not to confuse with getMixer(), + * that returns Audio::Mixer. The Mixer Manager is a SDL wrapper class + * for the Audio::Mixer. Used by other managers. + */ + virtual SdlMixerManager *getMixerManager(); + // Override functions from ModularBackend + virtual void initBackend(); + virtual Common::HardwareKeySet *getHardwareKeySet(); virtual void quit(); virtual void deinit(); - virtual void setWindowCaption(const char *caption); - virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); virtual Common::SeekableReadStream *createConfigReadStream(); virtual Common::WriteStream *createConfigWriteStream(); - virtual bool pollEvent(Common::Event &event); - virtual uint32 getMillis(); virtual void delayMillis(uint msecs); virtual void getTimeAndDate(TimeDate &td) const; - virtual Audio::Mixer *getMixer(); - // Get the Graphics Manager instance, used by other managers - virtual SdlGraphicsManager *getGraphicsManager(); - - // Get the Sdl Mixer Manager instance (not the Audio::Mixer) - virtual SdlMixerManager *getMixerManager(); - protected: bool _inited; bool _initedSDL; - // Mixer manager that encapsulates the actual Audio::Mixer + /** + * Mixer manager that configures and setups SDL for + * the wrapped Audio::Mixer, the true mixer. + */ SdlMixerManager *_mixerManager; - // Initialze SDL library + /** + * Initialze the SDL library. + */ virtual void initSDL(); - // Setup the window icon + /** + * Setup the window icon. + */ virtual void setupIcon(); - // Get the file path where the user configuration - // of ScummVM will be saved + /** + * Get the file path where the user configuration + * of ScummVM will be saved. + */ virtual Common::String getDefaultConfigFileName(); }; -- cgit v1.2.3 From 4e50b23005b1f27d7598b7dc1373a00cd0175e65 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sat, 3 Jul 2010 00:25:06 +0000 Subject: Cleanup and documentation. svn-id: r50610 --- backends/platform/sdl/sdl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index f2b513752f..eb3d22d524 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -63,7 +63,7 @@ public: */ virtual SdlMixerManager *getMixerManager(); - // Override functions from ModularBackend + // Override functions from ModularBackend and OSystem virtual void initBackend(); virtual Common::HardwareKeySet *getHardwareKeySet(); virtual void quit(); -- cgit v1.2.3 From 85034dc730148dab3eb85b47be3f3984337e9484 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sat, 10 Jul 2010 22:47:29 +0000 Subject: Added BaseSdlGraphicsManager. Added GLTexture. svn-id: r50795 --- backends/platform/sdl/sdl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index eb3d22d524..97c91966c1 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -33,7 +33,7 @@ #endif #include "backends/modular-backend.h" -#include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/graphics/sdl/basesdl-graphics.h" #include "backends/mixer/sdl/sdl-mixer.h" /** @@ -54,7 +54,7 @@ public: /** * Get the Graphics Manager instance. Used by other managers. */ - virtual SdlGraphicsManager *getGraphicsManager(); + virtual BaseSdlGraphicsManager *getGraphicsManager(); /** * Get the Mixer Manager instance. Not to confuse with getMixer(), -- cgit v1.2.3 From 4dca7c7e02a111a950124ee26a6d46090a0f755c Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sun, 11 Jul 2010 04:32:24 +0000 Subject: Moved getGraphicsManager() from OSystem_SDL to ModularBackend. Moved public SDL graphics manager functions to graphics manager (Allowing OpenGLSdlGraphicsMaanger to be used with other SDL managers easily). Removed BaseSdlGraphicsManager. Implemented in the opengl manager basic screen functions. svn-id: r50796 --- backends/platform/sdl/sdl.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 97c91966c1..3bb09683b5 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -33,7 +33,6 @@ #endif #include "backends/modular-backend.h" -#include "backends/graphics/sdl/basesdl-graphics.h" #include "backends/mixer/sdl/sdl-mixer.h" /** @@ -51,11 +50,6 @@ public: */ virtual void init(); - /** - * Get the Graphics Manager instance. Used by other managers. - */ - virtual BaseSdlGraphicsManager *getGraphicsManager(); - /** * Get the Mixer Manager instance. Not to confuse with getMixer(), * that returns Audio::Mixer. The Mixer Manager is a SDL wrapper class -- cgit v1.2.3 From 38b4098f676cd222ba6c5f638d3a6a61974d5f88 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Mon, 19 Jul 2010 05:33:58 +0000 Subject: SDL: Hack to handle special SDL events. svn-id: r51015 --- backends/platform/sdl/sdl.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 3bb09683b5..cf02438e91 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -72,6 +72,12 @@ public: virtual void getTimeAndDate(TimeDate &td) const; virtual Audio::Mixer *getMixer(); + // HACK: Special SDL events types + enum SdlEvent { + kSdlEventExpose = 100, + kSdlEventResize = 101 + }; + protected: bool _inited; bool _initedSDL; -- cgit v1.2.3 From 7b070bbef8275ff25dfc2cbc3106acfdc8de74a5 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Fri, 30 Jul 2010 03:31:05 +0000 Subject: SDL/OPENGL: Add ability to switch between SDL and OpenGL graphics managers. OSystem_SDL will create a merged list of all graphics modes from SDL and OpenGL. When the user changes the graphics mode in options and restarts ScummVM should switch to that graphics mode in the corresponding graphics manager. svn-id: r51493 --- backends/platform/sdl/sdl.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index cf02438e91..17d4dc4ed9 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -103,6 +103,23 @@ protected: * of ScummVM will be saved. */ virtual Common::String getDefaultConfigFileName(); + +#ifdef USE_OPENGL + OSystem::GraphicsMode *_graphicsModes; + int _graphicsMode; + int _sdlModesCount; + int _glModesCount; + + /** + * Creates the merged graphics modes list + */ + virtual void setupGraphicsModes(); + + virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const; + virtual int getDefaultGraphicsMode() const; + virtual bool setGraphicsMode(int mode); + virtual int getGraphicsMode() const; +#endif }; #endif -- cgit v1.2.3 From a2b96a2516cd87203b22f7496a8d5a6b65749da3 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 13 Oct 2010 15:42:16 +0000 Subject: OPENGL: Replace SdlEventManager by SdlEventSource. Formerly SdlEventManager was a subclass of DefaultEventManager but did not really have anything in common with the idea of our EventManager interface. Now I made a new object SdlEventSource which only subclasses EventSource and which is responsible for obtaining events from SDL (and processing them). svn-id: r53433 --- backends/platform/sdl/sdl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 17d4dc4ed9..9ef2573dad 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -34,11 +34,12 @@ #include "backends/modular-backend.h" #include "backends/mixer/sdl/sdl-mixer.h" +#include "backends/events/sdl/sdl-events.h" /** * Base OSystem class for all SDL ports. */ -class OSystem_SDL : public ModularBackend { +class OSystem_SDL : public ModularBackend, public SdlEventSource { public: OSystem_SDL(); virtual ~OSystem_SDL(); @@ -66,7 +67,6 @@ public: virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); virtual Common::SeekableReadStream *createConfigReadStream(); virtual Common::WriteStream *createConfigWriteStream(); - virtual bool pollEvent(Common::Event &event); virtual uint32 getMillis(); virtual void delayMillis(uint msecs); virtual void getTimeAndDate(TimeDate &td) const; -- cgit v1.2.3 From b713beed189b439853be50fa330d06b3275f9713 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 21 Oct 2010 18:13:13 +0000 Subject: OPENGL: Add an SdlEventSource member to OSystem_SDL instead of subclassing SdlEventSource. Derived backends are allowed to overwrite that member in case they need special handling of SDL events. svn-id: r53675 --- backends/platform/sdl/sdl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 9ef2573dad..5b1ce8f803 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -39,7 +39,7 @@ /** * Base OSystem class for all SDL ports. */ -class OSystem_SDL : public ModularBackend, public SdlEventSource { +class OSystem_SDL : public ModularBackend { public: OSystem_SDL(); virtual ~OSystem_SDL(); @@ -88,6 +88,11 @@ protected: */ SdlMixerManager *_mixerManager; + /** + * The event source we use for obtaining SDL events. + */ + SdlEventSource *_eventSource; + /** * Initialze the SDL library. */ -- cgit v1.2.3