SDL: Various more SdlEventSource related fixes

svn-id: r54553
This commit is contained in:
Max Horn 2010-11-28 22:04:39 +00:00
parent 5a825eaae2
commit a162ff18bc
11 changed files with 26 additions and 23 deletions

View file

@ -38,7 +38,7 @@ SymbianSdlEventSource::zoneDesc SymbianSdlEventSource::_zones[TOTAL_ZONES] = {
{ 150, 145, 170, 55 } { 150, 145, 170, 55 }
}; };
SymbianSdlEventSource::SymbianSdlEventSource(Common::EventSource *boss) SymbianSdlEventSource::SymbianSdlEventSource()
: _currentZone(0) { : _currentZone(0) {
for (int i = 0; i < TOTAL_ZONES; i++) { for (int i = 0; i < TOTAL_ZONES; i++) {
_mouseXZone[i] = (_zones[i].x + (_zones[i].width / 2)); _mouseXZone[i] = (_zones[i].x + (_zones[i].width / 2));

View file

@ -38,8 +38,8 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
{0, 0, 0} {0, 0, 0}
}; };
DINGUXSdlGraphicsManager::DINGUXSdlGraphicsManager(SdlEventSource *boss) : SdlGraphicsManager(boss) { DINGUXSdlGraphicsManager::DINGUXSdlGraphicsManager(SdlEventSource *boss)
_evSrc = boss; : SdlGraphicsManager(boss) {
} }
const OSystem::GraphicsMode *DINGUXSdlGraphicsManager::getSupportedGraphicsModes() const { const OSystem::GraphicsMode *DINGUXSdlGraphicsManager::getSupportedGraphicsModes() const {
@ -125,7 +125,7 @@ void DINGUXSdlGraphicsManager::initSize(uint w, uint h) {
if (w > 320 || h > 240) { if (w > 320 || h > 240) {
setGraphicsMode(GFX_HALF); setGraphicsMode(GFX_HALF);
setGraphicsModeIntern(); setGraphicsModeIntern();
_evSrc->toggleMouseGrab(); _sdlEventSource->toggleMouseGrab();
} }
_transactionDetails.sizeChanged = true; _transactionDetails.sizeChanged = true;

View file

@ -61,9 +61,6 @@ public:
SdlGraphicsManager::VideoState *getVideoMode(); SdlGraphicsManager::VideoState *getVideoMode();
virtual void adjustMouseEvent(const Common::Event &event); virtual void adjustMouseEvent(const Common::Event &event);
protected:
SdlEventSource *_evSrc;
}; };
#endif /* BACKENDS_GRAPHICS_SDL_DINGUX_H */ #endif /* BACKENDS_GRAPHICS_SDL_DINGUX_H */

View file

@ -34,10 +34,8 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
{0, 0, 0} {0, 0, 0}
}; };
GP2XSdlGraphicsManager::GP2XSdlGraphicsManager() GP2XSdlGraphicsManager::GP2XSdlGraphicsManager(SdlEventSource *sdlEventSource)
: : SdlGraphicsManager(sdlEventSource), _adjustZoomOnMouse(false) {
_adjustZoomOnMouse(false) {
} }
const OSystem::GraphicsMode *GP2XSdlGraphicsManager::getSupportedGraphicsModes() const { const OSystem::GraphicsMode *GP2XSdlGraphicsManager::getSupportedGraphicsModes() const {

View file

@ -30,6 +30,7 @@
class GP2XSdlGraphicsManager : public SdlGraphicsManager { class GP2XSdlGraphicsManager : public SdlGraphicsManager {
public: public:
GP2XSdlGraphicsManager(SdlEventSource *sdlEventSource);
virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const; virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const; virtual int getDefaultGraphicsMode() const;

View file

@ -28,6 +28,10 @@
#include "backends/graphics/symbiansdl/symbiansdl-graphics.h" #include "backends/graphics/symbiansdl/symbiansdl-graphics.h"
#include "backends/platform/symbian/src/SymbianActions.h" #include "backends/platform/symbian/src/SymbianActions.h"
SymbianSdlGraphicsManager::SymbianSdlGraphicsManager(SdlEventSource *sdlEventSource)
: SdlGraphicsManager(sdlEventSource) {
}
int SymbianSdlGraphicsManager::getDefaultGraphicsMode() const { int SymbianSdlGraphicsManager::getDefaultGraphicsMode() const {
return GFX_NORMAL; return GFX_NORMAL;
} }

View file

@ -29,6 +29,9 @@
#include "backends/graphics/sdl/sdl-graphics.h" #include "backends/graphics/sdl/sdl-graphics.h"
class SymbianSdlGraphicsManager : public SdlGraphicsManager { class SymbianSdlGraphicsManager : public SdlGraphicsManager {
public:
SymbianSdlGraphicsManager(SdlEventSource *sdlEventSource);
public: public:
virtual bool hasFeature(OSystem::Feature f); virtual bool hasFeature(OSystem::Feature f);
virtual void setFeatureState(OSystem::Feature f, bool enable); virtual void setFeatureState(OSystem::Feature f, bool enable);

View file

@ -136,12 +136,12 @@ void OSystem_GP2X::initBackend() {
GP2X_HW::mixerMoveVolume(0); GP2X_HW::mixerMoveVolume(0);
// Create the events manager // Create the events manager
if (_eventManager == 0) if (_eventSource == 0)
_eventManager = new GP2XSdlEventSource(this); _eventSource = new GP2XSdlEventSource();
// Create the graphics manager // Create the graphics manager
if (_graphicsManager == 0) if (_graphicsManager == 0)
_graphicsManager = new GP2XSdlGraphicsManager(); _graphicsManager = new GP2XSdlGraphicsManager(_eventSource);
// Call parent implementation of this method // Call parent implementation of this method
OSystem_POSIX::initBackend(); OSystem_POSIX::initBackend();

View file

@ -30,11 +30,11 @@
void OSystem_LINUXMOTO::initBackend() { void OSystem_LINUXMOTO::initBackend() {
// Create the backend custom managers // Create the backend custom managers
if (_eventManager == 0) if (_eventSource == 0)
_eventManager = new LinuxmotoSdlEventSource(this); _eventSource = new LinuxmotoSdlEventSource();
if (_graphicsManager == 0) if (_graphicsManager == 0)
_graphicsManager = new LinuxmotoSdlGraphicsManager(); _graphicsManager = new LinuxmotoSdlGraphicsManager(_eventSource);
// Call parent implementation of this method // Call parent implementation of this method
OSystem_POSIX::initBackend(); OSystem_POSIX::initBackend();

View file

@ -41,8 +41,8 @@ bool OSystem_SDL_SamsungTV::hasFeature(Feature f) {
void OSystem_SDL_SamsungTV::initBackend() { void OSystem_SDL_SamsungTV::initBackend() {
// Create the events manager // Create the events manager
if (_eventManager == 0) if (_eventSource == 0)
_eventManager = new SamsungTVSdlEventSource(this); _eventSource = new SamsungTVSdlEventSource();
// Call parent implementation of this method // Call parent implementation of this method
OSystem_SDL::initBackend(); OSystem_SDL::initBackend();

View file

@ -101,8 +101,8 @@ void OSystem_SDL_Symbian::initBackend() {
GUI::Actions::init(); GUI::Actions::init();
// Creates the backend managers // Creates the backend managers
if (_eventManager == 0) if (_eventSource == 0)
_eventManager = new SymbianSdlEventSource(this); _eventSource = new SymbianSdlEventSource();
if (_mixerManager == 0) { if (_mixerManager == 0) {
_mixerManager = new SymbianSdlMixerManager(); _mixerManager = new SymbianSdlMixerManager();
@ -110,7 +110,7 @@ void OSystem_SDL_Symbian::initBackend() {
_mixerManager->init(); _mixerManager->init();
} }
if (_graphicsManager == 0) if (_graphicsManager == 0)
_graphicsManager = new SymbianSdlGraphicsManager(); _graphicsManager = new SymbianSdlGraphicsManager(_eventSource);
// Call parent implementation of this method // Call parent implementation of this method
OSystem_SDL::initBackend(); OSystem_SDL::initBackend();