diff options
| author | Kamil Zbróg | 2014-01-27 21:43:05 +0100 | 
|---|---|---|
| committer | Kamil Zbróg | 2014-01-27 21:43:05 +0100 | 
| commit | 8eac80cfc59c34299899ebe18a3b0582ef76e0d2 (patch) | |
| tree | 5d02a8fba0559c16f2a2045b14e3e292509c6924 /backends/platform | |
| parent | 444934a0accec982f55db92c17ef65270fe18e66 (diff) | |
| parent | 0f5eeaed7b3c9d2f74eee7dff2114c5f4dc63f00 (diff) | |
| download | scummvm-rg350-8eac80cfc59c34299899ebe18a3b0582ef76e0d2.tar.gz scummvm-rg350-8eac80cfc59c34299899ebe18a3b0582ef76e0d2.tar.bz2 scummvm-rg350-8eac80cfc59c34299899ebe18a3b0582ef76e0d2.zip  | |
Merge remote-tracking branch 'sync/master' into prince-malik
Diffstat (limited to 'backends/platform')
| -rw-r--r-- | backends/platform/android/gfx.cpp | 3 | ||||
| -rw-r--r-- | backends/platform/android/texture.cpp | 17 | ||||
| -rw-r--r-- | backends/platform/android/texture.h | 12 | ||||
| -rw-r--r-- | backends/platform/sdl/posix/posix.cpp | 4 | ||||
| -rw-r--r-- | backends/platform/sdl/sdl.cpp | 10 | ||||
| -rw-r--r-- | backends/platform/wii/main.cpp | 3 | ||||
| -rw-r--r-- | backends/platform/wii/osystem_events.cpp | 2 | ||||
| -rw-r--r-- | backends/platform/wii/wii.mk | 4 | ||||
| -rw-r--r-- | backends/platform/wince/CEActionsPocket.cpp | 2 | ||||
| -rw-r--r-- | backends/platform/wince/CEActionsSmartphone.cpp | 2 | ||||
| -rw-r--r-- | backends/platform/wince/CELauncherDialog.cpp | 4 | ||||
| -rw-r--r-- | backends/platform/wince/wince-sdl.cpp | 9 | 
12 files changed, 50 insertions, 22 deletions
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<Graphics::PixelFormat> OSystem_Android::getSupportedFormats() const  	Common::List<Graphics::PixelFormat> 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, 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 diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 178eeb96af..913ae51f69 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<SdlGraphicsManager *>(_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<SdlGraphicsManager *>(_graphicsManager)->activateManager();  }  #if defined(USE_TASKBAR) @@ -579,14 +579,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<SdlGraphicsManager *>(_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<SdlGraphicsManager *>(_graphicsManager)->deactivateManager();  		delete _graphicsManager;  		_graphicsManager = new OpenGLSdlGraphicsManager(_desktopWidth, _desktopHeight, _eventSource); @@ -596,7 +596,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) {  	_graphicsMode = mode;  	if (switchedManager) { -		_graphicsManager->activateManager(); +		dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->activateManager();  		_graphicsManager->beginGFXTransaction();  #ifdef USE_RGB_COLOR 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 diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index 5980a41caa..493a5e688c 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -236,7 +236,7 @@ CEActionsPocket::~CEActionsPocket() {  bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) {  	static bool keydialogrunning = false, quitdialog = false; -	_graphicsMan = ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager()); +	_graphicsMan = dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager());  	if (!pushed) {  		switch (action) { diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index 2cce288323..d2bc449dfc 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -202,7 +202,7 @@ CEActionsSmartphone::~CEActionsSmartphone() {  bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) {  	static bool keydialogrunning = false, quitdialog = false; -	_graphicsMan = ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager()); +	_graphicsMan = dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager());  	if (!pushed) {  		switch (action) { diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp index dd6076e0af..3908294682 100644 --- a/backends/platform/wince/CELauncherDialog.cpp +++ b/backends/platform/wince/CELauncherDialog.cpp @@ -65,12 +65,12 @@ public:  };  CELauncherDialog::CELauncherDialog() : GUI::LauncherDialog() { -	((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->reset_panel(); +	dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager())->reset_panel();  }  void CELauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {  	if ((cmd == 'STRT') || (cmd == kListItemActivatedCmd) || (cmd == kListItemDoubleClickedCmd)) { -		((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->init_panel(); +		dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager())->init_panel();  	}  	LauncherDialog::handleCommand(sender, cmd, data);  	if (cmd == 'ABOU') { diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 1c5cd5565b..1c9c178460 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -422,7 +422,7 @@ void OSystem_WINCE3::initBackend() {  	if (_graphicsManager == 0)  		_graphicsManager = new WINCESdlGraphicsManager(_eventSource); -	((WINCESdlEventSource *)_eventSource)->init((WINCESdlGraphicsManager *)_graphicsManager); +	((WINCESdlEventSource *)_eventSource)->init(dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager));  	// Call parent implementation of this method  	OSystem_SDL::initBackend(); @@ -486,15 +486,16 @@ void OSystem_WINCE3::swap_sound_master() {  	//WINCESdlGraphicsManager _graphicsManager -	if (((WINCESdlGraphicsManager *)_graphicsManager)->_toolbarHandler.activeName() == NAME_MAIN_PANEL) -		((WINCESdlGraphicsManager *)_graphicsManager)->_toolbarHandler.forceRedraw(); // redraw sound icon +	WINCESdlGraphicsManager *graphicsManager = dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager); +	if (graphicsManager->_toolbarHandler.activeName() == NAME_MAIN_PANEL) +		graphicsManager->_toolbarHandler.forceRedraw(); // redraw sound icon  }  void OSystem_WINCE3::engineInit() {  	check_mappings(); // called here to initialize virtual keys handling -	((WINCESdlGraphicsManager *)_graphicsManager)->update_game_settings(); +	dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager)->update_game_settings();  	// finalize mixer init  	_mixerManager->init();  }  | 
