From ea6d38d5f3b123b765e5bf8e2dc4f957e4b43eb6 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 24 Oct 2013 00:06:32 +0200 Subject: SDL: Make activateManager/deactivateManager SdlGraphicsManager specific. We can do this now that we can use virtual inheritance and dynamic_cast because we enabled RTTI. --- backends/platform/sdl/sdl.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index c240727069..6175f07a53 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -91,7 +91,7 @@ OSystem_SDL::~OSystem_SDL() { delete _savefileManager; _savefileManager = 0; if (_graphicsManager) { - _graphicsManager->deactivateManager(); + dynamic_cast(_graphicsManager)->deactivateManager(); } delete _graphicsManager; _graphicsManager = 0; @@ -240,7 +240,7 @@ void OSystem_SDL::initBackend() { // so the virtual keyboard can be initialized, but we have to add the // graphics manager as an event observer after initializing the event // manager. - _graphicsManager->activateManager(); + dynamic_cast(_graphicsManager)->activateManager(); } #if defined(USE_TASKBAR) @@ -585,14 +585,14 @@ bool OSystem_SDL::setGraphicsMode(int mode) { // manager, delete and create the new mode graphics manager if (_graphicsMode >= _firstGLMode && mode < _firstGLMode) { debug(1, "switching to plain SDL graphics"); - _graphicsManager->deactivateManager(); + dynamic_cast(_graphicsManager)->deactivateManager(); delete _graphicsManager; _graphicsManager = new SurfaceSdlGraphicsManager(_eventSource); switchedManager = true; } else if (_graphicsMode < _firstGLMode && mode >= _firstGLMode) { debug(1, "switching to OpenGL graphics"); - _graphicsManager->deactivateManager(); + dynamic_cast(_graphicsManager)->deactivateManager(); delete _graphicsManager; _graphicsManager = new OpenGLSdlGraphicsManager(_desktopWidth, _desktopHeight, _eventSource); @@ -602,7 +602,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) { _graphicsMode = mode; if (switchedManager) { - _graphicsManager->activateManager(); + dynamic_cast(_graphicsManager)->activateManager(); _graphicsManager->beginGFXTransaction(); #ifdef USE_RGB_COLOR -- cgit v1.2.3 From eff22cb43d22b0f47ac2bf5063916639a632705d Mon Sep 17 00:00:00 2001 From: AReim1982 Date: Fri, 22 Nov 2013 15:13:56 +0100 Subject: WII: Implement changes needed by DevKitPPC R26 and later This changes makes ScummVM compilable with newer versions of DevKitPPC. ScummVM can be linked against the original libogc and libfat. That makes some newer WiiMotes work, improves audio-/video-playback and contains various improvements. --- backends/platform/wii/main.cpp | 3 ++- backends/platform/wii/osystem_events.cpp | 2 +- backends/platform/wii/wii.mk | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp index affe053b6a..ec6231522e 100644 --- a/backends/platform/wii/main.cpp +++ b/backends/platform/wii/main.cpp @@ -225,7 +225,8 @@ int main(int argc, char *argv[]) { printf("shutdown\n"); SYS_UnregisterResetFunc(&resetinfo); - fatUnmountDefault(); + fatUnmount("usb:/"); + fatUnmount("sd:/"); if (res) show_console(res); diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp index 3ba66aed89..aa63c8aa22 100644 --- a/backends/platform/wii/osystem_events.cpp +++ b/backends/platform/wii/osystem_events.cpp @@ -188,7 +188,7 @@ void OSystem_Wii::initEvents() { _padAcceleration = 9 - ConfMan.getInt("wii_pad_acceleration"); #ifdef USE_WII_KBD - _kbd_active = KEYBOARD_Init() >= 0; + _kbd_active = KEYBOARD_Init(NULL) >= 0; #endif } diff --git a/backends/platform/wii/wii.mk b/backends/platform/wii/wii.mk index 7d2db68b4e..99ef46338c 100644 --- a/backends/platform/wii/wii.mk +++ b/backends/platform/wii/wii.mk @@ -17,10 +17,10 @@ geckoupload: $(WII_EXE_STRIPPED) $(DEVKITPPC)/bin/geckoupload $< wiigdb: - $(DEVKITPPC)/bin/powerpc-gekko-gdb -n $(EXECUTABLE) + $(DEVKITPPC)/bin/powerpc-eabi-gdb -n $(EXECUTABLE) wiidebug: - $(DEVKITPPC)/bin/powerpc-gekko-gdb -n $(EXECUTABLE) -x $(srcdir)/backends/platform/wii/gdb.txt + $(DEVKITPPC)/bin/powerpc-eabi-gdb -n $(EXECUTABLE) -x $(srcdir)/backends/platform/wii/gdb.txt # target to create a Wii snapshot wiidist: all -- cgit v1.2.3 From 4412e12debd77a5cef60054d2ad437a180d00817 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 21 Jan 2014 19:01:28 +0100 Subject: BUILD: Rename libunity support variable to "USE_UNITY" instead of "USE_TASKBAR_UNITY". This makes it consistent with other library support variables. --- backends/platform/sdl/posix/posix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index 954f404ac6..1752153f29 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -50,7 +50,7 @@ void OSystem_POSIX::init() { // Initialze File System Factory _fsFactory = new POSIXFilesystemFactory(); -#if defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY) +#if defined(USE_TASKBAR) && defined(USE_UNITY) // Initialize taskbar manager _taskbarManager = new UnityTaskbarManager(); #endif @@ -67,7 +67,7 @@ void OSystem_POSIX::initBackend() { // Invoke parent implementation of this method OSystem_SDL::initBackend(); -#if defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY) +#if defined(USE_TASKBAR) && defined(USE_UNITY) // Register the taskbar manager as an event source (this is necessary for the glib event loop to be run) _eventManager->getEventDispatcher()->registerSource((UnityTaskbarManager *)_taskbarManager, false); #endif -- cgit v1.2.3 From 6927e570bbbd69886b5fe2c2ce484ae236af61db Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Thu, 23 Jan 2014 22:46:34 +0100 Subject: ANDROID: Add 32bpp support. We still prefer 16bpp for performance reasons. --- backends/platform/android/gfx.cpp | 3 +++ backends/platform/android/texture.cpp | 17 ++++++++++++++--- backends/platform/android/texture.h | 12 ++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 0ce95a3cfb..9f6c759c75 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -94,6 +94,7 @@ Common::List OSystem_Android::getSupportedFormats() const Common::List res; res.push_back(GLES565Texture::pixelFormat()); res.push_back(GLES5551Texture::pixelFormat()); + res.push_back(GLES8888Texture::pixelFormat()); res.push_back(GLES4444Texture::pixelFormat()); res.push_back(Graphics::PixelFormat::createFormatCLUT8()); @@ -147,6 +148,8 @@ void OSystem_Android::initTexture(GLESBaseTexture **texture, *texture = new GLES565Texture(); else if (format_new == GLES5551Texture::pixelFormat()) *texture = new GLES5551Texture(); + else if (format_new == GLES8888Texture::pixelFormat()) + *texture = new GLES8888Texture(); else if (format_new == GLES4444Texture::pixelFormat()) *texture = new GLES4444Texture(); else { diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index cc41c0d8a6..87fd2d976c 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -259,11 +259,15 @@ void GLESTexture::fillBuffer(uint32 color) { assert(_surface.getPixels()); if (_pixelFormat.bytesPerPixel == 1 || - ((color & 0xff) == ((color >> 8) & 0xff))) + (_pixelFormat.bytesPerPixel == 2 && + ((color & 0xff) == ((color >> 8) & 0xff)))) memset(_pixels, color & 0xff, _surface.pitch * _surface.h); - else - Common::fill(_pixels, _pixels + _surface.pitch * _surface.h, + else if (_pixelFormat.bytesPerPixel == 2) + Common::fill((uint16 *)_pixels, (uint16 *)(_pixels + _surface.pitch * _surface.h), (uint16)color); + else + Common::fill((uint32 *)_pixels, (uint32 *)(_pixels + _surface.pitch * _surface.h), + color); setDirty(); } @@ -334,6 +338,13 @@ GLES565Texture::GLES565Texture() : GLES565Texture::~GLES565Texture() { } +GLES8888Texture::GLES8888Texture() : + GLESTexture(GL_RGBA, GL_UNSIGNED_BYTE, pixelFormat()) { +} + +GLES8888Texture::~GLES8888Texture() { +} + GLESFakePaletteTexture::GLESFakePaletteTexture(GLenum glFormat, GLenum glType, Graphics::PixelFormat pixelFormat) : GLESBaseTexture(glFormat, glType, pixelFormat), diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h index 4307b5a1bc..67f7343c98 100644 --- a/backends/platform/android/texture.h +++ b/backends/platform/android/texture.h @@ -224,6 +224,18 @@ public: } }; +// RGBA8888 texture +class GLES8888Texture : public GLESTexture { +public: + GLES8888Texture(); + virtual ~GLES8888Texture(); + + static inline Graphics::PixelFormat pixelFormat() { + // We assume LE since all Android platforms are LE. + return Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24); + } +}; + class GLESFakePaletteTexture : public GLESBaseTexture { protected: GLESFakePaletteTexture(GLenum glFormat, GLenum glType, -- cgit v1.2.3