mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-07 02:12:14 +00:00
SDL: Hack to handle special SDL events.
svn-id: r51015
This commit is contained in:
parent
6215f2b6d4
commit
38b4098f67
@ -238,6 +238,18 @@ bool SdlEventManager::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) {
|
||||
case SDL_JOYAXISMOTION:
|
||||
return handleJoyAxisMotion(ev, event);
|
||||
|
||||
case SDL_VIDEOEXPOSE:
|
||||
// HACK: Send a fake event, handled by SdlGraphicsManager
|
||||
event.type = (Common::EventType)OSystem_SDL::kSdlEventExpose;
|
||||
return true;
|
||||
|
||||
case SDL_VIDEORESIZE:
|
||||
// HACK: Send a fake event, handled by OpenGLSdlGraphicsManager
|
||||
event.type = (Common::EventType)OSystem_SDL::kSdlEventResize;
|
||||
event.mouse.x = ev.resize.w;
|
||||
event.mouse.y = ev.resize.h;
|
||||
return true;
|
||||
|
||||
case SDL_QUIT:
|
||||
event.type = Common::EVENT_QUIT;
|
||||
return true;
|
||||
|
@ -26,7 +26,8 @@
|
||||
#if defined(WIN32) || defined(UNIX) || defined(MACOSX)
|
||||
|
||||
#include "backends/graphics/sdl/sdl-graphics.h"
|
||||
#include "common/system.h"
|
||||
#include "backends/events/sdl/sdl-events.h"
|
||||
#include "backends/platform/sdl/sdl.h"
|
||||
#include "common/config-manager.h"
|
||||
#include "common/mutex.h"
|
||||
#include "common/translation.h"
|
||||
@ -39,7 +40,6 @@
|
||||
#include "graphics/scaler.h"
|
||||
#include "graphics/scaler/aspect.h"
|
||||
#include "graphics/surface.h"
|
||||
#include "backends/events/sdl/sdl-events.h"
|
||||
|
||||
static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
|
||||
{"1x", _s("Normal (no scaling)"), GFX_NORMAL},
|
||||
@ -2122,7 +2122,7 @@ void SdlGraphicsManager::toggleFullScreen() {
|
||||
}
|
||||
|
||||
bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
|
||||
switch (event.type) {
|
||||
switch ((int)event.type) {
|
||||
case Common::EVENT_KEYDOWN:
|
||||
// Alt-Return and Alt-Enter toggle full screen mode
|
||||
if (event.kbd.hasFlags(Common::KBD_ALT) &&
|
||||
@ -2172,9 +2172,11 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
|
||||
case Common::EVENT_MBUTTONUP:
|
||||
adjustMouseEvent(event);
|
||||
return !event.synthetic;
|
||||
/*case SDL_VIDEOEXPOSE:
|
||||
|
||||
// HACK: Handle special SDL event
|
||||
case OSystem_SDL::kSdlEventExpose:
|
||||
_forceFull = true;
|
||||
return false;*/
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user