diff options
| author | Littleboy | 2011-05-02 17:18:22 -0400 |
|---|---|---|
| committer | Littleboy | 2011-05-02 17:21:10 -0400 |
| commit | 0e45aa8655dc3122e8d88dbcb67ab2013a292989 (patch) | |
| tree | f523e5c1870497528d85385ce5ef24259937813c /backends | |
| parent | 580986aa42889c9a775b3ebe5709292d779f41cf (diff) | |
| parent | 1aff380a15f12e53bd380fc2a189882e2d6172c0 (diff) | |
| download | scummvm-rg350-0e45aa8655dc3122e8d88dbcb67ab2013a292989.tar.gz scummvm-rg350-0e45aa8655dc3122e8d88dbcb67ab2013a292989.tar.bz2 scummvm-rg350-0e45aa8655dc3122e8d88dbcb67ab2013a292989.zip | |
Merge remote-tracking branch 'upstream/master' into nsis
Conflicts:
devtools/create_project/scripts/postbuild.cmd
devtools/create_project/visualstudio.cpp
ports.mk
Diffstat (limited to 'backends')
74 files changed, 246 insertions, 129 deletions
diff --git a/backends/audiocd/sdl/sdl-audiocd.cpp b/backends/audiocd/sdl/sdl-audiocd.cpp index 4136c34403..82c9549a57 100644 --- a/backends/audiocd/sdl/sdl-audiocd.cpp +++ b/backends/audiocd/sdl/sdl-audiocd.cpp @@ -27,6 +27,7 @@ #if defined(SDL_BACKEND) +#include "common/textconsole.h" #include "backends/audiocd/sdl/sdl-audiocd.h" SdlAudioCDManager::SdlAudioCDManager() diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index 06db1dc027..73dc60695b 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -31,10 +31,10 @@ namespace Common { #ifdef ENABLE_KEYMAPPER - class Keymapper; +class Keymapper; #endif #ifdef ENABLE_VKEYBD - class VirtualKeyboard; +class VirtualKeyboard; #endif } diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp index ce846a0836..6e343b63f5 100644 --- a/backends/events/sdl/sdl-events.cpp +++ b/backends/events/sdl/sdl-events.cpp @@ -31,6 +31,7 @@ #include "backends/platform/sdl/sdl.h" #include "backends/graphics/graphics.h" #include "common/config-manager.h" +#include "common/textconsole.h" // FIXME move joystick defines out and replace with confile file options // we should really allow users to map any key to a joystick button @@ -65,7 +66,7 @@ SdlEventSource::SdlEventSource() // Enable joystick if (SDL_NumJoysticks() > 0) { - printf("Using joystick: %s\n", SDL_JoystickName(0)); + debug("Using joystick: %s", SDL_JoystickName(0)); _joystick = SDL_JoystickOpen(joystick_num); } } diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp index fd9628995d..045d077af2 100644 --- a/backends/events/webossdl/webossdl-events.cpp +++ b/backends/events/webossdl/webossdl-events.cpp @@ -26,6 +26,7 @@ #ifdef WEBOS #include "common/scummsys.h" +#include "common/system.h" #include "sys/time.h" #include "time.h" diff --git a/backends/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp index df21d41dda..4d23a9e095 100644 --- a/backends/fs/posix/posix-fs-factory.cpp +++ b/backends/fs/posix/posix-fs-factory.cpp @@ -23,6 +23,12 @@ */ #if defined(UNIX) + +// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h. +#define FORBIDDEN_SYMBOL_EXCEPTION_chdir +#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir +#define FORBIDDEN_SYMBOL_EXCEPTION_unlink + #include "backends/fs/posix/posix-fs-factory.h" #include "backends/fs/posix/posix-fs.cpp" diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index 3c043ca986..b50c3a75be 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -31,6 +31,7 @@ #include "backends/events/dinguxsdl/dinguxsdl-events.h" #include "graphics/scaler/aspect.h" #include "common/mutex.h" +#include "common/textconsole.h" static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { {"1x", "Standard", GFX_NORMAL}, diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp index 4f2185ef4b..6d23777903 100644 --- a/backends/graphics/gph/gph-graphics.cpp +++ b/backends/graphics/gph/gph-graphics.cpp @@ -28,6 +28,7 @@ #include "backends/events/gph/gph-events.h" #include "graphics/scaler/aspect.h" #include "common/mutex.h" +#include "common/textconsole.h" static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { {"1x", "Standard", GFX_NORMAL}, diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp index c2dcb7f587..ebfd4714d8 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp @@ -30,6 +30,7 @@ #include "backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h" #include "backends/events/linuxmotosdl/linuxmotosdl-events.h" #include "common/mutex.h" +#include "common/textconsole.h" #include "graphics/font.h" #include "graphics/fontman.h" #include "graphics/scaler.h" diff --git a/backends/graphics/opengl/gltexture.h b/backends/graphics/opengl/gltexture.h index e7951a0c96..238b035425 100644 --- a/backends/graphics/opengl/gltexture.h +++ b/backends/graphics/opengl/gltexture.h @@ -42,9 +42,6 @@ #include "graphics/surface.h" -#include "common/rect.h" -#include "common/array.h" - /** * OpenGL texture manager class */ diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 4ac2747d25..b85cac809e 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -32,6 +32,7 @@ #include "common/config-manager.h" #include "common/file.h" #include "common/mutex.h" +#include "common/textconsole.h" #include "common/translation.h" #ifdef USE_OSD #include "common/tokenizer.h" @@ -355,9 +356,9 @@ void OpenGLGraphicsManager::copyRectToScreen(const byte *buf, int pitch, int x, // Copy buffer data to game screen internal buffer const byte *src = buf; - byte *dst = (byte *)_screenData.pixels + y * _screenData.pitch + x * _screenData.bytesPerPixel; + byte *dst = (byte *)_screenData.pixels + y * _screenData.pitch + x * _screenData.format.bytesPerPixel; for (int i = 0; i < h; i++) { - memcpy(dst, src, w * _screenData.bytesPerPixel); + memcpy(dst, src, w * _screenData.format.bytesPerPixel); src += pitch; dst += _screenData.pitch; } @@ -466,7 +467,7 @@ void OpenGLGraphicsManager::clearOverlay() { } void OpenGLGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) { - assert(_overlayData.bytesPerPixel == sizeof(buf[0])); + assert(_overlayData.format.bytesPerPixel == sizeof(buf[0])); const byte *src = (byte *)_overlayData.pixels; for (int i = 0; i < _overlayData.h; i++) { // Copy overlay data to buffer @@ -519,7 +520,7 @@ void OpenGLGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch const byte *src = (const byte *)buf; byte *dst = (byte *)_overlayData.pixels + y * _overlayData.pitch; for (int i = 0; i < h; i++) { - memcpy(dst + x * _overlayData.bytesPerPixel, src, w * _overlayData.bytesPerPixel); + memcpy(dst + x * _overlayData.format.bytesPerPixel, src, w * _overlayData.format.bytesPerPixel); src += pitch * sizeof(buf[0]); dst += _overlayData.pitch; } @@ -616,8 +617,8 @@ void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int // Allocate space for cursor data if (_cursorData.w != w || _cursorData.h != h || - _cursorData.bytesPerPixel != _cursorFormat.bytesPerPixel) - _cursorData.create(w, h, _cursorFormat.bytesPerPixel); + _cursorData.format.bytesPerPixel != _cursorFormat.bytesPerPixel) + _cursorData.create(w, h, _cursorFormat); // Save cursor data memcpy(_cursorData.pixels, buf, h * _cursorData.pitch); @@ -699,13 +700,13 @@ void OpenGLGraphicsManager::refreshGameScreen() { int w = _screenDirtyRect.width(); int h = _screenDirtyRect.height(); - if (_screenData.bytesPerPixel == 1) { + if (_screenData.format.bytesPerPixel == 1) { // Create a temporary RGB888 surface byte *surface = new byte[w * h * 3]; // Convert the paletted buffer to RGB888 const byte *src = (byte *)_screenData.pixels + y * _screenData.pitch; - src += x * _screenData.bytesPerPixel; + src += x * _screenData.format.bytesPerPixel; byte *dst = surface; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { @@ -725,7 +726,7 @@ void OpenGLGraphicsManager::refreshGameScreen() { } else { // Update the texture _gameTexture->updateBuffer((byte *)_screenData.pixels + y * _screenData.pitch + - x * _screenData.bytesPerPixel, _screenData.pitch, x, y, w, h); + x * _screenData.format.bytesPerPixel, _screenData.pitch, x, y, w, h); } _screenNeedsRedraw = false; @@ -741,13 +742,13 @@ void OpenGLGraphicsManager::refreshOverlay() { int w = _overlayDirtyRect.width(); int h = _overlayDirtyRect.height(); - if (_overlayData.bytesPerPixel == 1) { + if (_overlayData.format.bytesPerPixel == 1) { // Create a temporary RGB888 surface byte *surface = new byte[w * h * 3]; // Convert the paletted buffer to RGB888 const byte *src = (byte *)_overlayData.pixels + y * _overlayData.pitch; - src += x * _overlayData.bytesPerPixel; + src += x * _overlayData.format.bytesPerPixel; byte *dst = surface; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { @@ -767,7 +768,7 @@ void OpenGLGraphicsManager::refreshOverlay() { } else { // Update the texture _overlayTexture->updateBuffer((byte *)_overlayData.pixels + y * _overlayData.pitch + - x * _overlayData.bytesPerPixel, _overlayData.pitch, x, y, w, h); + x * _overlayData.format.bytesPerPixel, _overlayData.pitch, x, y, w, h); } _overlayNeedsRedraw = false; @@ -1175,9 +1176,9 @@ void OpenGLGraphicsManager::loadTextures() { _oldVideoMode.screenHeight != _videoMode.screenHeight) _screenData.create(_videoMode.screenWidth, _videoMode.screenHeight, #ifdef USE_RGB_COLOR - _screenFormat.bytesPerPixel + _screenFormat #else - 1 + Graphics::PixelFormat::createFormatCLUT8() #endif ); @@ -1185,7 +1186,7 @@ void OpenGLGraphicsManager::loadTextures() { if (_oldVideoMode.overlayWidth != _videoMode.overlayWidth || _oldVideoMode.overlayHeight != _videoMode.overlayHeight) _overlayData.create(_videoMode.overlayWidth, _videoMode.overlayHeight, - _overlayFormat.bytesPerPixel); + _overlayFormat); _screenNeedsRedraw = true; _overlayNeedsRedraw = true; @@ -1387,7 +1388,7 @@ void OpenGLGraphicsManager::updateOSD() { const Graphics::Font *font = FontMan.getFontByUsage(Graphics::FontManager::kOSDFont); if (_osdSurface.w != _osdTexture->getWidth() || _osdSurface.h != _osdTexture->getHeight()) - _osdSurface.create(_osdTexture->getWidth(), _osdTexture->getHeight(), 2); + _osdSurface.create(_osdTexture->getWidth(), _osdTexture->getHeight(), _overlayFormat); else // Clear everything memset(_osdSurface.pixels, 0, _osdSurface.h * _osdSurface.pitch); diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 374f1c196e..1725817730 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -28,7 +28,9 @@ #include "backends/graphics/opengl/gltexture.h" #include "backends/graphics/graphics.h" +#include "common/array.h" #include "common/events.h" +#include "graphics/pixelformat.h" // Uncomment this to enable the 'on screen display' code. #define USE_OSD 1 diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index b9022af120..fe86dd2098 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -30,6 +30,7 @@ #include "backends/graphics/openglsdl/openglsdl-graphics.h" #include "backends/platform/sdl/sdl.h" #include "common/config-manager.h" +#include "common/textconsole.h" OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager() : @@ -487,9 +488,9 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { SDL_RWclose(file); } if (saveScreenshot(filename)) - printf("Saved '%s'\n", filename); + debug("Saved screenshot '%s'", filename); else - printf("Could not save screenshot!\n"); + warning("Could not save screenshot"); return true; } } diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 67b979a830..3ae9597f1c 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -32,6 +32,7 @@ #include "backends/platform/sdl/sdl.h" #include "common/config-manager.h" #include "common/mutex.h" +#include "common/textconsole.h" #include "common/translation.h" #include "common/util.h" #ifdef USE_RGB_COLOR @@ -1287,9 +1288,9 @@ Graphics::Surface *SdlGraphicsManager::lockScreen() { _framebuffer.h = _screen->h; _framebuffer.pitch = _screen->pitch; #ifdef USE_RGB_COLOR - _framebuffer.bytesPerPixel = _screenFormat.bytesPerPixel; + _framebuffer.format = _screenFormat; #else - _framebuffer.bytesPerPixel = 1; + _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); #endif return &_framebuffer; @@ -2054,7 +2055,11 @@ void SdlGraphicsManager::displayMessageOnOSD(const char *msg) { dst.w = _osdSurface->w; dst.h = _osdSurface->h; dst.pitch = _osdSurface->pitch; - dst.bytesPerPixel = _osdSurface->format->BytesPerPixel; + dst.format = Graphics::PixelFormat(_osdSurface->format->BytesPerPixel, + 8 - _osdSurface->format->Rloss, 8 - _osdSurface->format->Gloss, + 8 - _osdSurface->format->Bloss, 8 - _osdSurface->format->Aloss, + _osdSurface->format->Rshift, _osdSurface->format->Gshift, + _osdSurface->format->Bshift, _osdSurface->format->Ashift); // The font we are going to use: const Graphics::Font *font = FontMan.getFontByUsage(Graphics::FontManager::kOSDFont); @@ -2274,9 +2279,9 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) { SDL_RWclose(file); } if (saveScreenshot(filename)) - printf("Saved '%s'\n", filename); + debug("Saved screenshot '%s'", filename); else - printf("Could not save screenshot!\n"); + warning("Could not save screenshot"); return true; } diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h index f467c38d5f..4895b240b0 100644 --- a/backends/graphics/sdl/sdl-graphics.h +++ b/backends/graphics/sdl/sdl-graphics.h @@ -27,6 +27,7 @@ #define BACKENDS_GRAPHICS_SDL_H #include "backends/graphics/graphics.h" +#include "graphics/pixelformat.h" #include "graphics/scaler.h" #include "common/events.h" #include "common/system.h" diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index 37c6624560..b15f86e8fe 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -28,6 +28,7 @@ #ifdef _WIN32_WCE #include "common/system.h" +#include "common/textconsole.h" #include "common/translation.h" #include "common/mutex.h" diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h index 7c608a53fc..b6d9dbf042 100644 --- a/backends/keymapper/hardware-key.h +++ b/backends/keymapper/hardware-key.h @@ -31,6 +31,7 @@ #ifdef ENABLE_KEYMAPPER #include "backends/keymapper/types.h" +#include "common/textconsole.h" namespace Common { diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index 2f913055fc..8edc26a526 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -26,6 +26,7 @@ #ifdef ENABLE_KEYMAPPER +#include "common/system.h" #include "gui/gui-manager.h" #include "gui/widgets/popup.h" #include "gui/widgets/scrollbar.h" diff --git a/backends/keymapper/remap-dialog.h b/backends/keymapper/remap-dialog.h index 2c0e79a79d..5721d368a4 100644 --- a/backends/keymapper/remap-dialog.h +++ b/backends/keymapper/remap-dialog.h @@ -33,8 +33,10 @@ #include "gui/dialog.h" namespace GUI { - class PopupWidget; - class ScrollBarWidget; +class ButtonWidget; +class PopUpWidget; +class ScrollBarWidget; +class StaticTextWidget; } namespace Common { diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp index 2257f60e27..5110734a18 100644 --- a/backends/midi/alsa.cpp +++ b/backends/midi/alsa.cpp @@ -30,6 +30,8 @@ #if defined(USE_ALSA) #include "common/config-manager.h" +#include "common/error.h" +#include "common/textconsole.h" #include "common/util.h" #include "audio/musicplugin.h" #include "audio/mpu401.h" diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp index ee3baaadd2..cc791cf7c0 100644 --- a/backends/midi/camd.cpp +++ b/backends/midi/camd.cpp @@ -29,6 +29,8 @@ #if defined(__amigaos4__) +#include "common/textconsole.h" +#include "common/error.h" #include "common/endian.h" #include "common/util.h" #include "audio/musicplugin.h" @@ -135,8 +137,8 @@ void MidiDriver_CAMD::sysEx(const byte *msg, uint16 length) { char *MidiDriver_CAMD::getDevice() { char *retname = NULL; - APTR key; - if (key = _ICamd->LockCAMD(CD_Linkages)) { + APTR key = _ICamd->LockCAMD(CD_Linkages); + if (key != NULL) { struct MidiCluster *cluster = _ICamd->NextCluster(NULL); while (cluster && !retname) { diff --git a/backends/midi/coreaudio.cpp b/backends/midi/coreaudio.cpp index 0158cc4a1d..52d32cb5e3 100644 --- a/backends/midi/coreaudio.cpp +++ b/backends/midi/coreaudio.cpp @@ -41,6 +41,8 @@ #include "common/config-manager.h" +#include "common/error.h" +#include "common/textconsole.h" #include "common/util.h" #include "audio/musicplugin.h" #include "audio/mpu401.h" diff --git a/backends/midi/coremidi.cpp b/backends/midi/coremidi.cpp index 9123c9bc8c..87cd6307ba 100644 --- a/backends/midi/coremidi.cpp +++ b/backends/midi/coremidi.cpp @@ -30,6 +30,8 @@ #ifdef MACOSX #include "common/config-manager.h" +#include "common/error.h" +#include "common/textconsole.h" #include "common/util.h" #include "audio/musicplugin.h" #include "audio/mpu401.h" diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp index 7cd7f0a38e..b90a9b19e0 100644 --- a/backends/midi/seq.cpp +++ b/backends/midi/seq.cpp @@ -35,6 +35,8 @@ #if defined(USE_SEQ_MIDI) +#include "common/error.h" +#include "common/textconsole.h" #include "common/util.h" #include "audio/musicplugin.h" #include "audio/mpu401.h" diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp index c01b9bbef7..dd76196ae0 100644 --- a/backends/midi/timidity.cpp +++ b/backends/midi/timidity.cpp @@ -41,13 +41,13 @@ #if defined(USE_TIMIDITY) -#include "common/util.h" #include "common/endian.h" +#include "common/error.h" #include "common/str.h" +#include "common/textconsole.h" #include "audio/musicplugin.h" #include "audio/mpu401.h" -#include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <string.h> diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp index aad7f48d94..292bbea79e 100644 --- a/backends/midi/windows.cpp +++ b/backends/midi/windows.cpp @@ -38,6 +38,8 @@ #include "audio/mpu401.h" #include "common/config-manager.h" #include "common/translation.h" +#include "common/textconsole.h" +#include "common/error.h" #include <mmsystem.h> diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp index fa2bf3e232..90629954c5 100644 --- a/backends/mixer/sdl/sdl-mixer.cpp +++ b/backends/mixer/sdl/sdl-mixer.cpp @@ -26,8 +26,10 @@ #if defined(SDL_BACKEND) #include "backends/mixer/sdl/sdl-mixer.h" +#include "common/debug.h" #include "common/system.h" #include "common/config-manager.h" +#include "common/textconsole.h" #ifdef GP2X #define SAMPLES_PER_SEC 11025 diff --git a/backends/mixer/wincesdl/wincesdl-mixer.cpp b/backends/mixer/wincesdl/wincesdl-mixer.cpp index a8b03e81c4..17cf0ced49 100644 --- a/backends/mixer/wincesdl/wincesdl-mixer.cpp +++ b/backends/mixer/wincesdl/wincesdl-mixer.cpp @@ -32,6 +32,7 @@ #include "backends/platform/wince/wince-sdl.h" #include "backends/mixer/wincesdl/wincesdl-mixer.h" #include "common/system.h" +#include "common/textconsole.h" #ifdef USE_VORBIS #ifndef USE_TREMOR diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index 19cba89af3..b691250289 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -26,12 +26,14 @@ #include "backends/modular-backend.h" #include "backends/fs/fs-factory.h" -#include "backends/events/default/default-events.h" -#include "backends/audiocd/default/default-audiocd.h" -#include "backends/mutex/null/null-mutex.h" -#include "backends/graphics/null/null-graphics.h" +#include "backends/audiocd/audiocd.h" +#include "backends/graphics/graphics.h" +#include "backends/mutex/mutex.h" +#include "audio/mixer.h" +#include "common/events.h" #include "gui/message.h" +#include "graphics/pixelformat.h" ModularBackend::ModularBackend() : diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index bbfdb06b8d..c7f62f523b 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -32,6 +32,7 @@ #include <unistd.h> #include "common/util.h" +#include "common/textconsole.h" #include "common/rect.h" #include "common/queue.h" #include "common/mutex.h" diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h index 6eebdb97d9..109d252a99 100644 --- a/backends/platform/android/android.h +++ b/backends/platform/android/android.h @@ -31,6 +31,7 @@ #include "common/fs.h" #include "common/archive.h" #include "audio/mixer_intern.h" +#include "graphics/palette.h" #include "graphics/surface.h" #include "backends/base-backend.h" #include "backends/plugins/posix/posix-provider.h" diff --git a/backends/platform/android/asset-archive.cpp b/backends/platform/android/asset-archive.cpp index 8e95029894..7c21b35281 100644 --- a/backends/platform/android/asset-archive.cpp +++ b/backends/platform/android/asset-archive.cpp @@ -35,6 +35,7 @@ #include "common/util.h" #include "common/archive.h" #include "common/debug.h" +#include "common/textconsole.h" #include "backends/platform/android/jni.h" #include "backends/platform/android/asset-archive.h" diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 86232030ff..fae428d29f 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -628,13 +628,13 @@ void OSystem_Android::grabOverlay(OverlayColor *buf, int pitch) { GLTHREADCHECK; const Graphics::Surface *surface = _overlay_texture->surface_const(); - assert(surface->bytesPerPixel == sizeof(buf[0])); + assert(surface->format.bytesPerPixel == sizeof(buf[0])); const byte *src = (const byte *)surface->pixels; uint h = surface->h; do { - memcpy(buf, src, surface->w * surface->bytesPerPixel); + memcpy(buf, src, surface->w * surface->format.bytesPerPixel); src += surface->pitch; // This 'pitch' is pixels not bytes buf += pitch; diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp index 08a1491998..f23d71b2a4 100644 --- a/backends/platform/android/jni.cpp +++ b/backends/platform/android/jni.cpp @@ -28,6 +28,8 @@ #include "base/main.h" #include "base/version.h" #include "common/config-manager.h" +#include "common/error.h" +#include "common/textconsole.h" #include "engines/engine.h" #include "backends/platform/android/android.h" diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java index 8bf40ac553..c4de6d62f8 100644 --- a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java +++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java @@ -35,7 +35,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable { private String[] _args; - final private native void create(AssetManager _asset_manager, + final private native void create(AssetManager asset_manager, EGL10 egl, EGLDisplay egl_display, AudioTrack audio_track, int sample_rate, int buffer_size); diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index a6b28ca485..2d73783309 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -147,7 +147,7 @@ void GLESBaseTexture::setLinearFilter(bool value) { void GLESBaseTexture::allocBuffer(GLuint w, GLuint h) { _surface.w = w; _surface.h = h; - _surface.bytesPerPixel = _pixelFormat.bytesPerPixel; + _surface.format = _pixelFormat; if (w == _texture_width && h == _texture_height) return; @@ -241,14 +241,14 @@ void GLESTexture::allocBuffer(GLuint w, GLuint h) { delete[] _buf; delete[] _pixels; - _pixels = new byte[w * h * _surface.bytesPerPixel]; + _pixels = new byte[w * h * _surface.format.bytesPerPixel]; assert(_pixels); _surface.pixels = _pixels; fillBuffer(0); - _buf = new byte[w * h * _surface.bytesPerPixel]; + _buf = new byte[w * h * _surface.format.bytesPerPixel]; assert(_buf); } @@ -257,10 +257,10 @@ void GLESTexture::updateBuffer(GLuint x, GLuint y, GLuint w, GLuint h, setDirtyRect(Common::Rect(x, y, x + w, y + h)); const byte *src = (const byte *)buf; - byte *dst = _pixels + y * _surface.pitch + x * _surface.bytesPerPixel; + byte *dst = _pixels + y * _surface.pitch + x * _surface.format.bytesPerPixel; do { - memcpy(dst, src, w * _surface.bytesPerPixel); + memcpy(dst, src, w * _surface.format.bytesPerPixel); dst += _surface.pitch; src += pitch_buf; } while (--h); @@ -301,10 +301,10 @@ void GLESTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) { _tex = _buf; byte *src = _pixels + _dirty_rect.top * _surface.pitch + - _dirty_rect.left * _surface.bytesPerPixel; + _dirty_rect.left * _surface.format.bytesPerPixel; byte *dst = _buf; - uint16 l = dwidth * _surface.bytesPerPixel; + uint16 l = dwidth * _surface.format.bytesPerPixel; for (uint16 i = 0; i < dheight; ++i) { memcpy(dst, src, l); @@ -373,7 +373,7 @@ void GLESFakePaletteTexture::allocBuffer(GLuint w, GLuint h) { GLESBaseTexture::allocBuffer(w, h); - _surface.bytesPerPixel = 1; + _surface.format = Graphics::PixelFormat::createFormatCLUT8(); _surface.pitch = w; if (_surface.w == oldw && _surface.h == oldh) { diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index f0c8c1f96c..060eff2b48 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -26,6 +26,7 @@ #include "backends/base-backend.h" #include <graphics/surface.h> #include <graphics/colormasks.h> +#include <graphics/palette.h> #include <ronin/soundcommon.h> #include "backends/timer/default/default-timer.h" #include "backends/audiocd/default/default-audiocd.h" diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp index b297022775..78fa2182dc 100644 --- a/backends/platform/dc/display.cpp +++ b/backends/platform/dc/display.cpp @@ -720,7 +720,7 @@ Graphics::Surface *OSystem_Dreamcast::lockScreen() _framebuffer.w = _screen_w; _framebuffer.h = _screen_h; _framebuffer.pitch = SCREEN_W*2; - _framebuffer.bytesPerPixel = (_screenFormat == 0? 1 : 2); + _framebuffer.format = screenFormats[_screenFormat]; return &_framebuffer; } diff --git a/backends/platform/dc/dreamcast.mk b/backends/platform/dc/dreamcast.mk index 8651a2936c..666e03eece 100644 --- a/backends/platform/dc/dreamcast.mk +++ b/backends/platform/dc/dreamcast.mk @@ -35,3 +35,7 @@ ip.txt : $(srcdir)/backends/platform/dc/ip.txt.in ver="V$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)"; fi; \ sed -e 's/[@]VERSION[@]/'"$$ver"/ -e 's/[@]DATE[@]/$(shell date '+%Y%m%d')/' < $< > $@ + +dcdist : dist + mkdir -p dcdist/scummvm + cp scummvm.elf SCUMMVM.BIN IP.BIN *.PLG dcdist/scummvm/ diff --git a/backends/platform/dc/plugins.cpp b/backends/platform/dc/plugins.cpp index be329ab314..44b8960513 100644 --- a/backends/platform/dc/plugins.cpp +++ b/backends/platform/dc/plugins.cpp @@ -39,6 +39,7 @@ static void drawPluginProgress(const Common::String &filename) { ta_sync(); void *mark = ta_txmark(); + const char *fn = filename.c_str(); Label lab1, lab2, lab3; char buf[32]; unsigned memleft = 0x8cf00000-((unsigned)sbrk(0)); @@ -46,20 +47,21 @@ static void drawPluginProgress(const Common::String &filename) int fcol = (memleft < (1<<20)? 0xffff0000: (memleft < (4<<20)? 0xffffff00: 0xff00ff00)); snprintf(buf, sizeof(buf), "%dK free memory", memleft>>10); + if (fn[0] == '/') fn++; lab1.create_texture("Loading plugins, please wait..."); - lab2.create_texture(filename.c_str()); + lab2.create_texture(fn); lab3.create_texture(buf); ta_begin_frame(); - draw_solid_quad(80.0, 320.0, 560.0, 350.0, + draw_solid_quad(80.0, 270.0, 560.0, 300.0, 0xff808080, 0xff808080, 0xff808080, 0xff808080); - draw_solid_quad(85.0, 325.0, 555.0, 345.0, + draw_solid_quad(85.0, 275.0, 555.0, 295.0, 0xff202020, 0xff202020, 0xff202020, 0xff202020); - draw_solid_quad(85.0, 325.0, 85.0+470.0*ffree, 345.0, + draw_solid_quad(85.0, 275.0, 85.0+470.0*ffree, 295.0, fcol, fcol, fcol, fcol); ta_commit_end(); - lab1.draw(100.0, 200.0, 0xffffffff); - lab2.draw(100.0, 240.0, 0xffffffff); - lab3.draw(100.0, 280.0, 0xffffffff); + lab1.draw(100.0, 150.0, 0xffffffff); + lab2.draw(100.0, 190.0, 0xffaaffaa); + lab3.draw(100.0, 230.0, 0xffffffff); ta_commit_frame(); ta_sync(); ta_txrelease(mark); diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 576b70dd2a..49818a0034 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -243,7 +243,7 @@ void OSystem_DS::setCursorPalette(const byte *colors, uint start, uint num) { } bool OSystem_DS::grabRawScreen(Graphics::Surface *surf) { - surf->create(DS::getGameWidth(), DS::getGameHeight(), 1); + surf->create(DS::getGameWidth(), DS::getGameHeight(), Graphics::PixelFormat::createFormatCLUT8()); // Ensure we copy using 16 bit quantities due to limitation of VRAM addressing @@ -756,7 +756,7 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() { _framebuffer.w = DS::getGameWidth(); _framebuffer.h = DS::getGameHeight(); _framebuffer.pitch = DS::getGameWidth(); - _framebuffer.bytesPerPixel = 1; + _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); } else { @@ -781,7 +781,7 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() { _framebuffer.w = width; _framebuffer.h = height; _framebuffer.pitch = width; - _framebuffer.bytesPerPixel = 1; + _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); } diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index 5e179d1337..b745b4dc6e 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -36,6 +36,7 @@ #include "audio/mixer_intern.h" #include "graphics/surface.h" #include "graphics/colormasks.h" +#include "graphics/palette.h" class OSystem_DS : public BaseBackend, public PaletteManager { protected: diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp index fddcd03d85..375ee37378 100644 --- a/backends/platform/gph/gph-backend.cpp +++ b/backends/platform/gph/gph-backend.cpp @@ -40,6 +40,7 @@ #include "common/debug.h" #include "common/events.h" #include "common/file.h" +#include "common/textconsole.h" #include "common/util.h" #include "audio/mixer_intern.h" diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index 25c3c40cf9..79f596632f 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -30,6 +30,7 @@ #include "audio/mixer_intern.h" #include "backends/fs/posix/posix-fs-factory.h" #include "graphics/colormasks.h" +#include "graphics/palette.h" #include <AudioToolbox/AudioQueue.h> diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp index c5e7ab8413..a10efeff40 100644 --- a/backends/platform/iphone/osys_video.cpp +++ b/backends/platform/iphone/osys_video.cpp @@ -334,7 +334,7 @@ Graphics::Surface *OSystem_IPHONE::lockScreen() { _framebuffer.w = _screenWidth; _framebuffer.h = _screenHeight; _framebuffer.pitch = _screenWidth; - _framebuffer.bytesPerPixel = 1; + _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); return &_framebuffer; } diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index 2daa41a9f6..7a84de0449 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -37,6 +37,7 @@ #include "graphics/surface.h" #include "graphics/colormasks.h" +#include "graphics/palette.h" #include "graphics/pixelformat.h" #include "audio/mixer_intern.h" diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index 54eab0fd52..232037899b 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -610,7 +610,7 @@ Graphics::Surface *OSystem_N64::lockScreen() { _framebuffer.w = _gameWidth; _framebuffer.h = _gameHeight; _framebuffer.pitch = _screenWidth; - _framebuffer.bytesPerPixel = 1; + _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); return &_framebuffer; } diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp index a460b919fd..e43ea0f376 100644 --- a/backends/platform/ps2/Gs2dScreen.cpp +++ b/backends/platform/ps2/Gs2dScreen.cpp @@ -398,7 +398,7 @@ Graphics::Surface *Gs2dScreen::lockScreen() { _framebuffer.w = _width; _framebuffer.h = _height; _framebuffer.pitch = _width; // -not- _pitch; ! It's EE mem, not Tex - _framebuffer.bytesPerPixel = 1; + _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); return &_framebuffer; } @@ -441,7 +441,7 @@ void Gs2dScreen::grabPalette(uint8 *pal, uint8 start, uint16 num) { void Gs2dScreen::grabScreen(Graphics::Surface *surf) { assert(surf); WaitSema(g_DmacSema); - surf->create(_width, _height, 1); + surf->create(_width, _height, Graphics::PixelFormat::createFormatCLUT8()); memcpy(surf->pixels, _screenBuf, _width * _height); SignalSema(g_DmacSema); } diff --git a/backends/platform/ps2/Gs2dScreen.h b/backends/platform/ps2/Gs2dScreen.h index 358e717cbe..6e842b3f55 100644 --- a/backends/platform/ps2/Gs2dScreen.h +++ b/backends/platform/ps2/Gs2dScreen.h @@ -46,7 +46,7 @@ enum GsInterlace { namespace Graphics { - struct Surface; +struct Surface; } class Gs2dScreen { diff --git a/backends/platform/ps2/ps2input.h b/backends/platform/ps2/ps2input.h index 266f408809..eca5950113 100644 --- a/backends/platform/ps2/ps2input.h +++ b/backends/platform/ps2/ps2input.h @@ -32,6 +32,10 @@ class OSystem_PS2; class Ps2Pad; +namespace Common { +struct Event; +} + class Ps2Input { public: Ps2Input(OSystem_PS2 *system, bool mouseLoaded, bool kbdLoaded); diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index 77de74eb5b..e95a026d01 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -727,7 +727,7 @@ void OSystem_PS2::msgPrintf(int millis, const char *format, ...) { int maxWidth = 0; Graphics::Surface surf; - surf.create(300, 200, 1); + surf.create(300, 200, Graphics::PixelFormat::createFormatCLUT8()); char *lnSta = resStr; while (*lnSta && (posY < 180)) { diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h index 37575f399f..54e6f05798 100644 --- a/backends/platform/ps2/systemps2.h +++ b/backends/platform/ps2/systemps2.h @@ -28,6 +28,7 @@ #include "common/system.h" #include "backends/base-backend.h" +#include "graphics/palette.h" class DefaultTimerManager; class DefaultSaveFileManager; @@ -47,11 +48,11 @@ struct Ps2Mutex { }; namespace Common { - class TimerManager; +class TimerManager; }; namespace Audio { - class MixerImpl; +class MixerImpl; }; class OSystem_PS2 : public BaseBackend, public PaletteManager { diff --git a/backends/platform/psp/README.PSP b/backends/platform/psp/README.PSP index b520022033..dcfa30898c 100644 --- a/backends/platform/psp/README.PSP +++ b/backends/platform/psp/README.PSP @@ -1,4 +1,4 @@ -ScummVM-PSP 1.3.0git README +ScummVM-PSP 1.4.0git README ============================================================================== Installation diff --git a/backends/platform/psp/cursor.cpp b/backends/platform/psp/cursor.cpp index cf879e095a..420b0398c3 100644 --- a/backends/platform/psp/cursor.cpp +++ b/backends/platform/psp/cursor.cpp @@ -327,8 +327,20 @@ inline void Cursor::setRendererModePalettized(bool palettized) { _renderer.setAlphaReverse(false); _renderer.setColorTest(false); } else { // 16 bits, no palette + // Color test is an easy way for the hardware to make our keycolor + // transparent. + _renderer.setColorTest(true); + + // Alpha blending is not strictly required, but makes the cursor look + // much better _renderer.setAlphaBlending(true); - _renderer.setAlphaReverse(true); // We can't change all alpha values, so just reverse - _renderer.setColorTest(true); // Color test to make our key color transparent + + // Pixel formats without alpha (5650) are considered to have their alpha set. + // Since pixel formats with alpha don't have their alpha bits set, we reverse + // the alpha format for them so that 0 alpha is 1. + if (_buffer.getPixelFormat() != PSPPixelFormat::Type_5650) + _renderer.setAlphaReverse(true); + else + _renderer.setAlphaReverse(false); } } diff --git a/backends/platform/psp/default_display_client.cpp b/backends/platform/psp/default_display_client.cpp index bb42406c3e..34b1a70711 100644 --- a/backends/platform/psp/default_display_client.cpp +++ b/backends/platform/psp/default_display_client.cpp @@ -199,7 +199,7 @@ Graphics::Surface *Screen::lockAndGetForEditing() { _frameBuffer.w = _buffer.getSourceWidth(); _frameBuffer.h = _buffer.getSourceHeight(); _frameBuffer.pitch = _buffer.getBytesPerPixel() * _buffer.getWidth(); - _frameBuffer.bytesPerPixel = _buffer.getBytesPerPixel(); + _frameBuffer.format = _pixelFormat; // We'll set to dirty once we unlock the screen return &_frameBuffer; diff --git a/backends/platform/psp/mp3.cpp b/backends/platform/psp/mp3.cpp index 54476dabfd..0faeacb2f2 100644 --- a/backends/platform/psp/mp3.cpp +++ b/backends/platform/psp/mp3.cpp @@ -29,6 +29,7 @@ #include "common/util.h" #include "common/singleton.h" #include "common/mutex.h" +#include "common/textconsole.h" #include "audio/audiostream.h" diff --git a/backends/platform/psp/mp3.h b/backends/platform/psp/mp3.h index 1d2fe5ec2f..95491d5788 100644 --- a/backends/platform/psp/mp3.h +++ b/backends/platform/psp/mp3.h @@ -30,7 +30,7 @@ #include "common/scummsys.h" namespace Common { - class SeekableReadStream; +class SeekableReadStream; } namespace Audio { diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index 051449d4a0..1e4aea70d3 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -29,6 +29,7 @@ #include "common/scummsys.h" #include "graphics/surface.h" #include "graphics/colormasks.h" +#include "graphics/palette.h" #include "audio/mixer_intern.h" #include "backends/base-backend.h" #include "backends/fs/psp/psp-fs-factory.h" diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index 71a88265a0..889bc5cd5e 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -23,6 +23,8 @@ * */ +#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir + #include "common/scummsys.h" #ifdef UNIX @@ -34,6 +36,7 @@ #include <errno.h> #include <sys/stat.h> + OSystem_POSIX::OSystem_POSIX(Common::String baseConfigName) : _baseConfigName(baseConfigName) { diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 2c0c45907f..bc27f8e954 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -23,6 +23,9 @@ * */ +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + + #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <windows.h> @@ -32,6 +35,7 @@ #include "backends/platform/sdl/sdl.h" #include "common/config-manager.h" #include "common/EventRecorder.h" +#include "common/textconsole.h" #include "backends/saves/default/default-saves.h" #include "backends/audiocd/sdl/sdl-audiocd.h" diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 9459263ae2..fffc3a2a75 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -27,6 +27,8 @@ #define FORBIDDEN_SYMBOL_ALLOW_ALL #include "common/scummsys.h" +#include "common/error.h" +#include "common/textconsole.h" #ifdef WIN32 diff --git a/backends/platform/webos/webos.mk b/backends/platform/webos/webos.mk index 22df5622ee..2b145b00c9 100644 --- a/backends/platform/webos/webos.mk +++ b/backends/platform/webos/webos.mk @@ -1,15 +1,27 @@ # WebOS specific build targets # ============================================================================ # -# Run "make webosrelease" to create a release package to be uploaded to the -# Palm app catalog. +# Build instructions: # -# Run "make webosbeta" to create a beta package to be uploaded to the Palm -# Beta app catalog. +# 1. Install the WebOS SDK and PDK and setup the environment variables +# WEBOS_SDK and WEBOS_PDK accordingly. # -# Before calling these targets the ScummVM source must be configured for a -# WebOS build. See -# http://wiki.scummvm.org/index.php/Compiling_ScummVM/WebOS for details. +# 2. Cross-compile zlib, flac, mad and tremor and install it into the PDK. +# +# 3. Prepare the ScummVM source for a webOS build: +# $ ./configure --host=webos --enable-plugins --default-dynamic \ +# --enable-release +# +# 4. Create the package: +# $ make package +# +# The package is now in the "portdist" folder. +# +# See http://wiki.scummvm.org/index.php/Compiling_ScummVM/WebOS for +# more detailed build instructions. +# +# +# Palm App catalog instructions: # # VER_PACKAGE must be set to a number which is higher than the currently # used package version in the app catalog. So when creating an updated @@ -25,46 +37,55 @@ # to use a user-specific app name when submitting the created package to the # Palm app catalog. Use "ScummVM (<username>)" instead of "ScummVM" and # "ScummVM Beta (<username>)" instead of "ScummVM Beta". +# +# The app id is automatically parsed from the installation prefix. So add a +# configure parameter like this to prepare a build of a package for the Palm +# App Catalog: +# +# --prefix=/media/cryptofs/apps/usr/palm/applications/com.github.kayahr.scummvm +# +# To build a package for the Palm Beta App Catalog add "-beta" to the prefix: +# +# --prefix=/media/cryptofs/apps/usr/palm/applications/com.github.kayahr.scummvm-beta +# ============================================================================ + +# Increment this number when the packaging of the app has been changed while +# ScummVM itself has the same version as before. The number can be reset to +# 1 when the ScummVM version is increased. +VER_PACKAGE = 5 PATH_DIST = $(srcdir)/dists/webos PATH_MOJO = $(PATH_DIST)/mojo -BASE_APP_ID = org.scummvm -APP_ID = $(BASE_APP_ID).scummvm -BETA_APP_ID = $(APP_ID)-beta +APP_ID = $(shell basename $(prefix)) APP_VERSION = $(shell printf "%d.%d.%02d%02d" $(VER_MAJOR) $(VER_MINOR) $(VER_PATCH) $(VER_PACKAGE)) -STAGING_DIR=STAGING/$(APP_ID) - -webosprepare: all - $(QUIET)if [ "$(VER_PACKAGE)" = "" ]; \ - then \ - echo "ERROR: VER_PACKAGE is not set"; \ - echo "Example: export VER_PACKAGE=1"; \ - exit 1; \ - fi - $(QUIET)$(RM_REC) $(STAGING_DIR) - $(QUIET)$(MKDIR) $(STAGING_DIR) - $(QUIET)$(MKDIR) $(STAGING_DIR)/bin - $(QUIET)$(MKDIR) $(STAGING_DIR)/lib - $(QUIET)$(MKDIR) $(STAGING_DIR)/share/scummvm - $(QUIET)$(CP) $(PATH_MOJO)/* $(STAGING_DIR) - $(QUIET)$(CP) gui/themes/translations.dat $(STAGING_DIR)/share/scummvm - $(QUIET)$(CP) gui/themes/scummmodern.zip $(STAGING_DIR)/share/scummvm - $(QUIET)$(CP) scummvm $(STAGING_DIR)/bin - $(QUIET)$(STRIP) $(STAGING_DIR)/bin/scummvm - $(QUIET)sed -i s/'APP_VERSION'/'$(APP_VERSION)'/ $(STAGING_DIR)/appinfo.json +DESTDIR ?= portdist -webosrelease: webosprepare - $(QUIET)$(RM) $(APP_ID)_*.ipk - $(QUIET)sed -i s/'APP_ID'/'$(APP_ID)'/ $(STAGING_DIR)/appinfo.json - $(QUIET)sed -i s/'APP_TITLE'/'ScummVM'/ $(STAGING_DIR)/appinfo.json - $(QUIET)$(WEBOS_SDK)/bin/palm-package --use-v1-format $(STAGING_DIR) - $(QUIET)$(RM_REC) STAGING +install: all + $(QUIET)$(INSTALL) -d "$(DESTDIR)$(prefix)" + $(QUIET)$(INSTALL) -m 0644 -t "$(DESTDIR)$(prefix)/" "$(PATH_MOJO)/"* + $(QUIET)$(INSTALL) -m 0755 "$(PATH_MOJO)/start" "$(DESTDIR)$(prefix)/" + $(QUIET)$(INSTALL) -d "$(DESTDIR)$(bindir)" + $(QUIET)$(INSTALL) -c -m 755 "./$(EXECUTABLE)" "$(DESTDIR)$(bindir)/$(EXECUTABLE)" + $(QUIET)$(STRIP) "$(DESTDIR)$(bindir)/$(EXECUTABLE)" + $(QUIET)$(INSTALL) -d "$(DESTDIR)$(docdir)" + $(QUIET)$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) "$(DESTDIR)$(docdir)" + $(QUIET)$(INSTALL) -d "$(DESTDIR)$(datadir)" + $(QUIET)$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) "$(DESTDIR)$(datadir)/" +ifdef DYNAMIC_MODULES + $(QUIET)$(INSTALL) -d "$(DESTDIR)$(libdir)/" + $(QUIET)$(INSTALL) -c -m 644 $(PLUGINS) "$(DESTDIR)$(libdir)/" + $(QUIET)$(STRIP) "$(DESTDIR)$(libdir)/"* +endif + $(QUIET)sed -i s/'APP_VERSION'/'$(APP_VERSION)'/ "$(DESTDIR)$(prefix)/appinfo.json" + $(QUIET)sed -i s/'APP_ID'/'$(APP_ID)'/ "$(DESTDIR)$(prefix)/appinfo.json" +ifneq (,$(findstring -beta,$(APP_ID))) + $(QUIET)sed -i s/'APP_TITLE'/'ScummVM Beta'/ "$(DESTDIR)$(prefix)/appinfo.json" +else + $(QUIET)sed -i s/'APP_TITLE'/'ScummVM'/ "$(DESTDIR)$(prefix)/appinfo.json" +endif -webosbeta: webosprepare - $(QUIET)$(RM) $(BETA_APP_ID)_*.ipk - $(QUIET)sed -i s/'APP_ID'/'$(BETA_APP_ID)'/ $(STAGING_DIR)/appinfo.json - $(QUIET)sed -i s/'APP_TITLE'/'ScummVM Beta'/ $(STAGING_DIR)/appinfo.json - $(QUIET)$(WEBOS_SDK)/bin/palm-package --use-v1-format $(STAGING_DIR) - $(QUIET)$(RM_REC) STAGING +uninstall: + $(QUIET)$(RM_REC) "$(DESTDIR)$(prefix)" -.PHONY: webosrelease webosbeta +package: install + $(QUIET)$(WEBOS_SDK)/bin/palm-package --use-v1-format "$(DESTDIR)$(prefix)" -o "$(DESTDIR)" diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp index 2aefe48f0c..54da27126c 100644 --- a/backends/platform/wii/osystem.cpp +++ b/backends/platform/wii/osystem.cpp @@ -26,6 +26,7 @@ #include <ogc/lwp_watchdog.h> #include "common/config-manager.h" +#include "common/textconsole.h" #include "backends/fs/wii/wii-fs-factory.h" #include "osystem.h" diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h index 3c992b8bdc..d1ea8e07ae 100644 --- a/backends/platform/wii/osystem.h +++ b/backends/platform/wii/osystem.h @@ -36,6 +36,7 @@ #include "backends/saves/default/default-saves.h" #include "backends/timer/default/default-timer.h" #include "graphics/colormasks.h" +#include "graphics/palette.h" #include "graphics/surface.h" #include "audio/mixer_intern.h" diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index cb9a8c72e9..c2be608999 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -537,10 +537,10 @@ Graphics::Surface *OSystem_Wii::lockScreen() { _surface.h = _gameHeight; #ifdef USE_RGB_COLOR _surface.pitch = _gameWidth * _pfGame.bytesPerPixel; - _surface.bytesPerPixel = _pfGame.bytesPerPixel; + _surface.format = _pfGame; #else _surface.pitch = _gameWidth; - _surface.bytesPerPixel = 1; + _surface.format = Graphics::PixelFormat::createFormatCLUT8(); #endif return &_surface; diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index b829686cb0..b54aebe6bd 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -33,6 +33,7 @@ #include "common/debug.h" #include "common/events.h" #include "common/util.h" +#include "common/textconsole.h" #include "common/timer.h" #include "common/translation.h" diff --git a/backends/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h index 32d411656c..775e887105 100644 --- a/backends/plugins/dynamic-plugin.h +++ b/backends/plugins/dynamic-plugin.h @@ -27,6 +27,7 @@ #define BACKENDS_PLUGINS_DYNAMICPLUGIN_H #include "base/plugins.h" +#include "common/textconsole.h" class DynamicPlugin : public Plugin { diff --git a/backends/plugins/elf/memory-manager.cpp b/backends/plugins/elf/memory-manager.cpp index b2ac497771..d32ac2da28 100644 --- a/backends/plugins/elf/memory-manager.cpp +++ b/backends/plugins/elf/memory-manager.cpp @@ -28,6 +28,7 @@ #if defined(DYNAMIC_MODULES) && defined(USE_ELF_LOADER) #include "backends/plugins/elf/memory-manager.h" +#include "common/debug.h" #include "common/util.h" #include <malloc.h> diff --git a/backends/saves/posix/posix-saves.cpp b/backends/saves/posix/posix-saves.cpp index 866cd912e5..37db208223 100644 --- a/backends/saves/posix/posix-saves.cpp +++ b/backends/saves/posix/posix-saves.cpp @@ -23,6 +23,10 @@ * */ + +// Enable mkdir +#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir + #include "common/scummsys.h" #if defined(UNIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER) @@ -31,6 +35,7 @@ #include "common/config-manager.h" #include "common/savefile.h" +#include "common/textconsole.h" #include <stdio.h> #include <string.h> diff --git a/backends/saves/savefile.cpp b/backends/saves/savefile.cpp index 7b7d6b0c0c..9888146049 100644 --- a/backends/saves/savefile.cpp +++ b/backends/saves/savefile.cpp @@ -25,9 +25,7 @@ #include "common/util.h" #include "common/savefile.h" - -#include <stdio.h> -#include <string.h> +#include "common/str.h" namespace Common { diff --git a/backends/timer/default/default-timer.h b/backends/timer/default/default-timer.h index a4c7385ef9..9a353f58c3 100644 --- a/backends/timer/default/default-timer.h +++ b/backends/timer/default/default-timer.h @@ -28,8 +28,6 @@ #include "common/timer.h" #include "common/mutex.h" -class OSystem; - struct TimerSlot; class DefaultTimerManager : public Common::TimerManager { diff --git a/backends/timer/sdl/sdl-timer.cpp b/backends/timer/sdl/sdl-timer.cpp index 0a4cd428de..647ddba2d3 100644 --- a/backends/timer/sdl/sdl-timer.cpp +++ b/backends/timer/sdl/sdl-timer.cpp @@ -30,6 +30,8 @@ #include "backends/timer/sdl/sdl-timer.h" +#include "common/textconsole.h" + static Uint32 timer_handler(Uint32 interval, void *param) { ((DefaultTimerManager *)param)->handler(); return interval; diff --git a/backends/vkeybd/image-map.cpp b/backends/vkeybd/image-map.cpp index b0a77b5220..f4b4541d7e 100644 --- a/backends/vkeybd/image-map.cpp +++ b/backends/vkeybd/image-map.cpp @@ -27,6 +27,8 @@ #ifdef ENABLE_VKEYBD +#include "common/textconsole.h" + #include "backends/vkeybd/image-map.h" #include "backends/vkeybd/polygon.h" diff --git a/backends/vkeybd/virtual-keyboard-gui.cpp b/backends/vkeybd/virtual-keyboard-gui.cpp index 050ab5c5a2..9ffda6e3a7 100644 --- a/backends/vkeybd/virtual-keyboard-gui.cpp +++ b/backends/vkeybd/virtual-keyboard-gui.cpp @@ -36,7 +36,7 @@ namespace Common { static void blit(Graphics::Surface *surf_dst, Graphics::Surface *surf_src, int16 x, int16 y, OverlayColor transparent) { - if (surf_dst->bytesPerPixel != sizeof(OverlayColor) || surf_src->bytesPerPixel != sizeof(OverlayColor)) + if (surf_dst->format.bytesPerPixel != sizeof(OverlayColor) || surf_src->format.bytesPerPixel != sizeof(OverlayColor)) return; const OverlayColor *src = (const OverlayColor *)surf_src->pixels; @@ -133,7 +133,7 @@ void VirtualKeyboardGUI::setupDisplayArea(Rect& r, OverlayColor forecolor) { _dispI = 0; _dispForeColor = forecolor; _dispBackColor = _dispForeColor + 0xFF; - _dispSurface.create(r.width(), _dispFont->getFontHeight(), sizeof(OverlayColor)); + _dispSurface.create(r.width(), _dispFont->getFontHeight(), _system->getOverlayFormat()); _dispSurface.fillRect(Rect(_dispSurface.w, _dispSurface.h), _dispBackColor); _displayEnabled = true; } @@ -163,7 +163,7 @@ void VirtualKeyboardGUI::run() { _system->showOverlay(); _system->clearOverlay(); } - _overlayBackup.create(_screenW, _screenH, sizeof(OverlayColor)); + _overlayBackup.create(_screenW, _screenH, _system->getOverlayFormat()); _system->grabOverlay((OverlayColor*)_overlayBackup.pixels, _overlayBackup.w); setupCursor(); @@ -265,7 +265,7 @@ void VirtualKeyboardGUI::screenChanged() { _screenW = newScreenW; _screenH = newScreenH; - _overlayBackup.create(_screenW, _screenH, sizeof(OverlayColor)); + _overlayBackup.create(_screenW, _screenH, _system->getOverlayFormat()); _system->grabOverlay((OverlayColor*)_overlayBackup.pixels, _overlayBackup.w); if (!_kbd->checkModeResolutions()) { @@ -358,7 +358,7 @@ void VirtualKeyboardGUI::redraw() { if (w <= 0 || h <= 0) return; Graphics::Surface surf; - surf.create(w, h, sizeof(OverlayColor)); + surf.create(w, h, _system->getOverlayFormat()); OverlayColor *dst = (OverlayColor *)surf.pixels; const OverlayColor *src = (OverlayColor *) _overlayBackup.getBasePtr(_dirtyRect.left, _dirtyRect.top); diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp index 5add387717..2971c8d528 100644 --- a/backends/vkeybd/virtual-keyboard.cpp +++ b/backends/vkeybd/virtual-keyboard.cpp @@ -33,6 +33,7 @@ #include "backends/vkeybd/virtual-keyboard-parser.h" #include "backends/vkeybd/keycode-descriptions.h" #include "common/config-manager.h" +#include "common/textconsole.h" #include "common/unzip.h" #define KEY_START_CHAR ('[') |
