diff options
author | Matthew Hoops | 2012-08-26 15:49:45 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-08-26 16:12:25 -0400 |
commit | bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a (patch) | |
tree | a434233367725fbb6dc7072776c312f52254d57f /backends | |
parent | 7a49b3669a0e18210a2f5409cb35da735f549b11 (diff) | |
parent | 857b92f8ffececa9c1f990d21a6a8d1630199a62 (diff) | |
download | scummvm-rg350-bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a.tar.gz scummvm-rg350-bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a.tar.bz2 scummvm-rg350-bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a.zip |
Merge remote branch 'upstream/master' into pegasus
Conflicts:
AUTHORS
devtools/credits.pl
gui/credits.h
Diffstat (limited to 'backends')
37 files changed, 300 insertions, 324 deletions
diff --git a/backends/events/gph/gph-events.cpp b/backends/events/gph/gph-events.cpp index b4e106b790..91118d36c1 100644 --- a/backends/events/gph/gph-events.cpp +++ b/backends/events/gph/gph-events.cpp @@ -161,49 +161,6 @@ GPHEventSource::GPHEventSource() : _buttonStateL(false) { } -void GPHEventSource::moveStick() { - bool stickBtn[32]; - - memcpy(stickBtn, _stickBtn, sizeof(stickBtn)); - - if ((stickBtn[0]) || (stickBtn[2]) || (stickBtn[4]) || (stickBtn[6])) - stickBtn[1] = stickBtn[3] = stickBtn[5] = stickBtn[7] = 0; - - if ((stickBtn[1]) || (stickBtn[2]) || (stickBtn[3])) { - if (_km.x_down_count != 2) { - _km.x_vel = -1; - _km.x_down_count = 1; - } else - _km.x_vel = -4; - } else if ((stickBtn[5]) || (stickBtn[6]) || (stickBtn[7])) { - if (_km.x_down_count != 2) { - _km.x_vel = 1; - _km.x_down_count = 1; - } else - _km.x_vel = 4; - } else { - _km.x_vel = 0; - _km.x_down_count = 0; - } - - if ((stickBtn[0]) || (stickBtn[1]) || (stickBtn[7])) { - if (_km.y_down_count != 2) { - _km.y_vel = -1; - _km.y_down_count = 1; - } else - _km.y_vel = -4; - } else if ((stickBtn[3]) || (stickBtn[4]) || (stickBtn[5])) { - if (_km.y_down_count != 2) { - _km.y_vel = 1; - _km.y_down_count = 1; - } else - _km.y_vel = 4; - } else { - _km.y_vel = 0; - _km.y_down_count = 0; - } -} - /* Custom handleMouseButtonDown/handleMouseButtonUp to deal with 'Tap Mode' for the touchscreen */ bool GPHEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) { @@ -268,19 +225,110 @@ bool GPHEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) { bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) { - _stickBtn[ev.jbutton.button] = 1; event.kbd.flags = 0; switch (ev.jbutton.button) { case BUTTON_UP: - case BUTTON_UPLEFT: - case BUTTON_LEFT: - case BUTTON_DOWNLEFT: + if (_km.y_down_count != 2) { + _km.y_vel = -1; + _km.y_down_count = 1; + } else { + _km.y_vel = -4; + } + event.type = Common::EVENT_MOUSEMOVE; + processMouseEvent(event, _km.x, _km.y); + break; case BUTTON_DOWN: - case BUTTON_DOWNRIGHT: + if (_km.y_down_count != 2) { + _km.y_vel = 1; + _km.y_down_count = 1; + } else { + _km.y_vel = 4; + } + event.type = Common::EVENT_MOUSEMOVE; + processMouseEvent(event, _km.x, _km.y); + break; + case BUTTON_LEFT: + if (_km.x_down_count != 2) { + _km.x_vel = -1; + _km.x_down_count = 1; + } else { + _km.x_vel = -4; + } + event.type = Common::EVENT_MOUSEMOVE; + processMouseEvent(event, _km.x, _km.y); + break; case BUTTON_RIGHT: + if (_km.x_down_count != 3) { + _km.x_vel = 1; + _km.x_down_count = 1; + } else { + _km.x_vel = 4; + } + event.type = Common::EVENT_MOUSEMOVE; + processMouseEvent(event, _km.x, _km.y); + break; + case BUTTON_UPLEFT: + if (_km.x_down_count != 2) { + _km.x_vel = -1; + _km.x_down_count = 1; + } else { + _km.x_vel = -4; + } + if (_km.y_down_count != 2) { + _km.y_vel = -1; + _km.y_down_count = 1; + } else { + _km.y_vel = -4; + } + event.type = Common::EVENT_MOUSEMOVE; + processMouseEvent(event, _km.x, _km.y); + break; case BUTTON_UPRIGHT: - moveStick(); + if (_km.x_down_count != 2) { + _km.x_vel = 1; + _km.x_down_count = 1; + } else { + _km.x_vel = 4; + } + if (_km.y_down_count != 2) { + _km.y_vel = -1; + _km.y_down_count = 1; + } else { + _km.y_vel = -4; + } + event.type = Common::EVENT_MOUSEMOVE; + processMouseEvent(event, _km.x, _km.y); + break; + case BUTTON_DOWNLEFT: + if (_km.x_down_count != 2) { + _km.x_vel = -1; + _km.x_down_count = 1; + } else { + _km.x_vel = -4; + } + if (_km.y_down_count != 2) { + _km.y_vel = 1; + _km.y_down_count = 1; + } else { + _km.y_vel = 4; + } + event.type = Common::EVENT_MOUSEMOVE; + processMouseEvent(event, _km.x, _km.y); + break; + case BUTTON_DOWNRIGHT: + if (_km.x_down_count != 2) { + _km.x_vel = 1; + _km.x_down_count = 1; + } else { + _km.x_vel = 4; + } + if (_km.y_down_count != 2) { + _km.y_vel = 1; + _km.y_down_count = 1; + } else { + _km.y_vel = 4; + } event.type = Common::EVENT_MOUSEMOVE; processMouseEvent(event, _km.x, _km.y); break; @@ -391,7 +439,6 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) { bool GPHEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) { - _stickBtn[ev.jbutton.button] = 0; event.kbd.flags = 0; switch (ev.jbutton.button) { @@ -403,7 +450,10 @@ bool GPHEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) { case BUTTON_DOWNRIGHT: case BUTTON_RIGHT: case BUTTON_UPRIGHT: - moveStick(); + _km.y_vel = 0; + _km.y_down_count = 0; + _km.x_vel = 0; + _km.x_down_count = 0; event.type = Common::EVENT_MOUSEMOVE; processMouseEvent(event, _km.x, _km.y); break; diff --git a/backends/events/gph/gph-events.h b/backends/events/gph/gph-events.h index 7672bffed2..3b1e6f090a 100644 --- a/backends/events/gph/gph-events.h +++ b/backends/events/gph/gph-events.h @@ -34,18 +34,11 @@ public: GPHEventSource(); protected: - bool _stickBtn[32]; - /** * Button state for L button modifier */ bool _buttonStateL; - /** - * Handles the stick movement - */ - void moveStick(); - bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event); bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event); bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event); diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index 205dcfdbec..f515343d3c 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -432,7 +432,7 @@ bool DINGUXSdlGraphicsManager::loadGFXMode() { // Forcefully disable aspect ratio correction for games // which starts with a native 240px height resolution. // This fixes games with weird resolutions, like MM Nes (256x240) - if(_videoMode.screenHeight == 240) { + if (_videoMode.screenHeight == 240) { _videoMode.aspectRatioCorrection = false; } diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp index 8521e88eaf..92553564bf 100644 --- a/backends/graphics/gph/gph-graphics.cpp +++ b/backends/graphics/gph/gph-graphics.cpp @@ -486,7 +486,13 @@ bool GPHGraphicsManager::loadGFXMode() { if (_videoMode.aspectRatioCorrection) _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight); } - return SurfaceSdlGraphicsManager::loadGFXMode(); + SurfaceSdlGraphicsManager::loadGFXMode(); + + // The old GP2X hacked SDL needs this after any call to SDL_SetVideoMode + // and it does not hurt other devices. + SDL_ShowCursor(SDL_DISABLE); + + return true; } bool GPHGraphicsManager::hasFeature(OSystem::Feature f) { diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index dce902d894..48e2663d44 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -902,7 +902,7 @@ void OpenGLGraphicsManager::getGLPixelFormat(Graphics::PixelFormat pixelFormat, bpp = 4; intFormat = GL_RGBA; glFormat = GL_RGBA; - gltype = GL_UNSIGNED_BYTE; + gltype = GL_UNSIGNED_INT_8_8_8_8; } else if (pixelFormat == Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0)) { // RGB888 bpp = 3; intFormat = GL_RGB; @@ -918,11 +918,6 @@ void OpenGLGraphicsManager::getGLPixelFormat(Graphics::PixelFormat pixelFormat, intFormat = GL_RGBA; glFormat = GL_RGBA; gltype = GL_UNSIGNED_SHORT_5_5_5_1; - } else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)) { // RGB555 - bpp = 2; - intFormat = GL_RGB; - glFormat = GL_BGRA; - gltype = GL_UNSIGNED_SHORT_1_5_5_5_REV; } else if (pixelFormat == Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0)) { // RGBA4444 bpp = 2; intFormat = GL_RGBA; @@ -936,6 +931,13 @@ void OpenGLGraphicsManager::getGLPixelFormat(Graphics::PixelFormat pixelFormat, glFormat = GL_RGB; gltype = GL_UNSIGNED_BYTE; #ifndef USE_GLES + } else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)) { // RGB555 + // GL_BGRA does not exist in every GLES implementation so should not be configured if + // USE_GLES is set. + bpp = 2; + intFormat = GL_RGB; + glFormat = GL_BGRA; + gltype = GL_UNSIGNED_SHORT_1_5_5_5_REV; } else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24)) { // ARGB8888 bpp = 4; intFormat = GL_RGBA; diff --git a/backends/graphics/openpandora/op-graphics.cpp b/backends/graphics/openpandora/op-graphics.cpp index 5f0301a0c8..f371081fde 100644 --- a/backends/graphics/openpandora/op-graphics.cpp +++ b/backends/graphics/openpandora/op-graphics.cpp @@ -26,28 +26,59 @@ #include "backends/graphics/openpandora/op-graphics.h" #include "backends/events/openpandora/op-events.h" -//#include "backends/platform/openpandora/op-sdl.h" #include "graphics/scaler/aspect.h" #include "common/mutex.h" #include "common/textconsole.h" +static SDL_Cursor *hiddenCursor; + OPGraphicsManager::OPGraphicsManager(SdlEventSource *sdlEventSource) : SurfaceSdlGraphicsManager(sdlEventSource) { } bool OPGraphicsManager::loadGFXMode() { - /* FIXME: For now we just cheat and set the overlay to 640*480 not 800*480 and let SDL - deal with the boarders (it saves cleaning up the overlay when the game screen is - smaller than the overlay ;) + + uint8_t hiddenCursorData = 0; + hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0); + + /* On the OpenPandora we need to work around an SDL assumption that + returns relative mouse coordinates when you get to the screen + edges using the touchscreen. The workaround is to set a blank + SDL cursor and not disable it (Hackish I know). + + The root issues likes in the Windows Manager GRAB code in SDL. + That is why the issue is not seen on framebuffer devices like the + GP2X (there is no X window manager ;)). */ - _videoMode.overlayWidth = 640; - _videoMode.overlayHeight = 480; + SDL_ShowCursor(SDL_ENABLE); + SDL_SetCursor(hiddenCursor); + _videoMode.fullscreen = true; + _videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor; + _videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor; + if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400) _videoMode.aspectRatioCorrection = false; + if (_videoMode.aspectRatioCorrection) + _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight); + + _videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor; + _videoMode.hardwareHeight = effectiveScreenHeight(); + return SurfaceSdlGraphicsManager::loadGFXMode(); } +void OPGraphicsManager::unloadGFXMode() { + + uint8_t hiddenCursorData = 0; + hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0); + + // Free the hidden SDL cursor created in loadGFXMode + SDL_FreeCursor(hiddenCursor); + + SurfaceSdlGraphicsManager::unloadGFXMode(); +} + #endif diff --git a/backends/graphics/openpandora/op-graphics.h b/backends/graphics/openpandora/op-graphics.h index 0b3eeae8ec..2e3d63e3ad 100644 --- a/backends/graphics/openpandora/op-graphics.h +++ b/backends/graphics/openpandora/op-graphics.h @@ -24,7 +24,6 @@ #define BACKENDS_GRAPHICS_OP_H #include "backends/graphics/surfacesdl/surfacesdl-graphics.h" -#include "graphics/scaler/aspect.h" // for aspect2Real #include "graphics/scaler/downscaler.h" enum { @@ -35,28 +34,8 @@ class OPGraphicsManager : public SurfaceSdlGraphicsManager { public: OPGraphicsManager(SdlEventSource *sdlEventSource); -// bool hasFeature(OSystem::Feature f); -// void setFeatureState(OSystem::Feature f, bool enable); -// bool getFeatureState(OSystem::Feature f); -// int getDefaultGraphicsMode() const; - -// void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL); -// const OSystem::GraphicsMode *getSupportedGraphicsModes() const; -// bool setGraphicsMode(const char *name); -// bool setGraphicsMode(int mode); -// void setGraphicsModeIntern(); -// void internUpdateScreen(); -// void showOverlay(); -// void hideOverlay(); bool loadGFXMode(); -// void drawMouse(); -// void undrawMouse(); -// virtual void warpMouse(int x, int y); - -// SurfaceSdlGraphicsManager::MousePos *getMouseCurState(); -// SurfaceSdlGraphicsManager::VideoState *getVideoMode(); - -// virtual void adjustMouseEvent(const Common::Event &event); + void unloadGFXMode(); }; #endif /* BACKENDS_GRAPHICS_OP_H */ diff --git a/backends/platform/android/android.mk b/backends/platform/android/android.mk index 2e8fd62152..9292a16595 100644 --- a/backends/platform/android/android.mk +++ b/backends/platform/android/android.mk @@ -130,7 +130,18 @@ $(PATH_STAGE_PREFIX).%/res/drawable/scummvm.png: $(PATH_RESOURCES)/drawable/scum $(FILE_RESOURCES_MAIN): $(FILE_MANIFEST) $(RESOURCES) $(ANDROID_JAR8) $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(INSTALL) -d $(PATH_BUILD_ASSETS) $(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(PATH_BUILD_ASSETS)/ - $(AAPT) package -f -M $< -S $(PATH_RESOURCES) -A $(PATH_BUILD_ASSETS) -I $(ANDROID_JAR8) -F $@ + work_dir=`pwd`; \ + for i in $(PATH_BUILD_ASSETS)/*.zip; do \ + echo "recompress $$i"; \ + cd $$work_dir; \ + $(RM) -rf $(PATH_BUILD_ASSETS)/tmp; \ + $(MKDIR) $(PATH_BUILD_ASSETS)/tmp; \ + unzip -q $$i -d $(PATH_BUILD_ASSETS)/tmp; \ + cd $(PATH_BUILD_ASSETS)/tmp; \ + zip -r ../`basename $$i` *; \ + done + @$(RM) -rf $(PATH_BUILD_ASSETS)/tmp + $(AAPT) package -f -0 zip -M $< -S $(PATH_RESOURCES) -A $(PATH_BUILD_ASSETS) -I $(ANDROID_JAR8) -F $@ $(PATH_BUILD)/%/$(FILE_RESOURCES): $(PATH_BUILD)/%/AndroidManifest.xml $(PATH_STAGE_PREFIX).%/res/values/strings.xml $(PATH_STAGE_PREFIX).%/res/drawable/scummvm.png plugins/lib%.so $(ANDROID_JAR8) $(AAPT) package -f -M $< -S $(PATH_STAGE_PREFIX).$*/res -I $(ANDROID_JAR8) -F $@ diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index 95c96e0d25..b174e93191 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -52,9 +52,6 @@ // Supported GL extensions static bool npot_supported = false; -#ifdef GL_OES_draw_texture -static bool draw_tex_supported = false; -#endif static inline GLfixed xdiv(int numerator, int denominator) { assert(numerator < (1 << 16)); @@ -85,11 +82,6 @@ void GLESBaseTexture::initGLExtensions() { if (token == "GL_ARB_texture_non_power_of_two") npot_supported = true; - -#ifdef GL_OES_draw_texture - if (token == "GL_OES_draw_texture") - draw_tex_supported = true; -#endif } } @@ -180,45 +172,28 @@ void GLESBaseTexture::allocBuffer(GLuint w, GLuint h) { void GLESBaseTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) { GLCALL(glBindTexture(GL_TEXTURE_2D, _texture_name)); -#ifdef GL_OES_draw_texture - // Great extension, but only works under specific conditions. - // Still a work-in-progress - disabled for now. - if (false && draw_tex_supported && !hasPalette()) { - //GLCALL(glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE)); - const GLint crop[4] = { 0, _surface.h, _surface.w, -_surface.h }; + const GLfixed tex_width = xdiv(_surface.w, _texture_width); + const GLfixed tex_height = xdiv(_surface.h, _texture_height); + const GLfixed texcoords[] = { + 0, 0, + tex_width, 0, + 0, tex_height, + tex_width, tex_height, + }; - GLCALL(glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop)); + GLCALL(glTexCoordPointer(2, GL_FIXED, 0, texcoords)); - // Android GLES bug? - GLCALL(glColor4ub(0xff, 0xff, 0xff, 0xff)); + const GLshort vertices[] = { + x, y, + x + w, y, + x, y + h, + x + w, y + h, + }; - GLCALL(glDrawTexiOES(x, y, 0, w, h)); - } else -#endif - { - const GLfixed tex_width = xdiv(_surface.w, _texture_width); - const GLfixed tex_height = xdiv(_surface.h, _texture_height); - const GLfixed texcoords[] = { - 0, 0, - tex_width, 0, - 0, tex_height, - tex_width, tex_height, - }; - - GLCALL(glTexCoordPointer(2, GL_FIXED, 0, texcoords)); - - const GLshort vertices[] = { - x, y, - x + w, y, - x, y + h, - x + w, y + h, - }; - - GLCALL(glVertexPointer(2, GL_SHORT, 0, vertices)); - - assert(ARRAYSIZE(vertices) == ARRAYSIZE(texcoords)); - GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, ARRAYSIZE(vertices) / 2)); - } + GLCALL(glVertexPointer(2, GL_SHORT, 0, vertices)); + + assert(ARRAYSIZE(vertices) == ARRAYSIZE(texcoords)); + GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, ARRAYSIZE(vertices) / 2)); clearDirty(); } diff --git a/backends/platform/bada/system.cpp b/backends/platform/bada/system.cpp index 816a6755fc..3f862c2571 100644 --- a/backends/platform/bada/system.cpp +++ b/backends/platform/bada/system.cpp @@ -21,6 +21,7 @@ */ #include <FUiCtrlMessageBox.h> +#include <FLocales.h> #include "common/config-manager.h" #include "common/file.h" @@ -42,7 +43,9 @@ using namespace Osp::Base; using namespace Osp::Base::Runtime; +using namespace Osp::Locales; using namespace Osp::Ui::Controls; +using namespace Osp::System; #define DEFAULT_CONFIG_FILE "/Home/scummvm.ini" #define RESOURCE_PATH "/Res" @@ -305,7 +308,7 @@ void BadaSystem::initBackend() { ConfMan.registerDefault("aspect_ratio", false); ConfMan.setBool("confirm_exit", false); - Osp::System::SystemTime::GetTicks(_epoch); + SystemTime::GetTicks(_epoch); if (E_SUCCESS != initModules()) { AppLog("initModules failed"); @@ -372,7 +375,7 @@ bool BadaSystem::pollEvent(Common::Event &event) { uint32 BadaSystem::getMillis() { long long result, ticks = 0; - Osp::System::SystemTime::GetTicks(ticks); + SystemTime::GetTicks(ticks); result = ticks - _epoch; return result; } @@ -392,18 +395,18 @@ void BadaSystem::updateScreen() { void BadaSystem::getTimeAndDate(TimeDate &td) const { DateTime currentTime; - if (E_SUCCESS == Osp::System::SystemTime::GetCurrentTime(currentTime)) { + if (E_SUCCESS == SystemTime::GetCurrentTime(WALL_TIME, currentTime)) { td.tm_sec = currentTime.GetSecond(); td.tm_min = currentTime.GetMinute(); td.tm_hour = currentTime.GetHour(); td.tm_mday = currentTime.GetDay(); td.tm_mon = currentTime.GetMonth(); td.tm_year = currentTime.GetYear(); -#ifdef RELEASE_BUILD - #error getTimeAndDate() is not setting the day of the week -#else - td.tm_wday = 0; // FIXME -#endif + + Calendar *calendar = Calendar::CreateInstanceN(CALENDAR_GREGORIAN); + calendar->SetTime(currentTime); + td.tm_wday = calendar->GetTimeField(TIME_FIELD_DAY_OF_WEEK) - 1; + delete calendar; } } diff --git a/backends/platform/dc/vmsave.cpp b/backends/platform/dc/vmsave.cpp index e06dd7fa43..ba3b787942 100644 --- a/backends/platform/dc/vmsave.cpp +++ b/backends/platform/dc/vmsave.cpp @@ -316,8 +316,9 @@ public: class VMSaveManager : public Common::SaveFileManager { public: - virtual Common::OutSaveFile *openForSaving(const Common::String &filename) { - return Common::wrapCompressedWriteStream(new OutVMSave(filename.c_str())); + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) { + OutVMSave *s = new OutVMSave(filename.c_str()); + return compress ? Common::wrapCompressedWriteStream(s) : s; } virtual Common::InSaveFile *openForLoading(const Common::String &filename) { diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp index 03729c5e6e..3192e2d277 100644 --- a/backends/platform/ds/arm9/source/gbampsave.cpp +++ b/backends/platform/ds/arm9/source/gbampsave.cpp @@ -45,7 +45,7 @@ static Common::String getSavePath() { // GBAMP Save File Manager ////////////////////////// -Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &filename) { +Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &filename, bool compress) { Common::String fileSpec = getSavePath(); if (fileSpec.lastChar() != '/') fileSpec += '/'; diff --git a/backends/platform/ds/arm9/source/gbampsave.h b/backends/platform/ds/arm9/source/gbampsave.h index 492054dc52..0d9d9aca8c 100644 --- a/backends/platform/ds/arm9/source/gbampsave.h +++ b/backends/platform/ds/arm9/source/gbampsave.h @@ -27,7 +27,7 @@ class GBAMPSaveFileManager : public Common::SaveFileManager { public: - virtual Common::OutSaveFile *openForSaving(const Common::String &filename); + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true); virtual Common::InSaveFile *openForLoading(const Common::String &filename); virtual bool removeSavefile(const Common::String &filename); diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp index 49a1edf411..485780b472 100644 --- a/backends/platform/gph/gph-backend.cpp +++ b/backends/platform/gph/gph-backend.cpp @@ -20,6 +20,8 @@ * */ +#if defined(GPH_DEVICE) + // Disable symbol overrides so that we can use system headers. #define FORBIDDEN_SYMBOL_ALLOW_ALL @@ -32,8 +34,6 @@ #include "backends/saves/default/default-saves.h" #include "backends/timer/default/default-timer.h" -#include "base/main.h" - #include "common/archive.h" #include "common/config-manager.h" #include "common/debug.h" @@ -64,23 +64,6 @@ void OSystem_GPH::initBackend() { assert(!_inited); - // Create the events manager - if (_eventSource == 0) - _eventSource = new GPHEventSource(); - - // Create the graphics manager - if (_graphicsManager == 0) { - _graphicsManager = new GPHGraphicsManager(_eventSource); - } - - // Create the mixer manager - if (_mixer == 0) { - _mixerManager = new DoubleBufferSDLMixerManager(); - - // Setup and start mixer - _mixerManager->init(); - } - /* Setup default save path to be workingdir/saves */ char savePath[PATH_MAX+1]; @@ -165,16 +148,42 @@ void OSystem_GPH::initBackend() { /* Make sure that aspect ratio correction is enabled on the 1st run to stop users asking me what the 'wasted space' at the bottom is ;-). */ ConfMan.registerDefault("aspect_ratio", true); + ConfMan.registerDefault("fullscreen", true); /* Make sure SDL knows that we have a joystick we want to use. */ ConfMan.setInt("joystick_num", 0); + // Create the events manager + if (_eventSource == 0) + _eventSource = new GPHEventSource(); + + // Create the graphics manager + if (_graphicsManager == 0) { + _graphicsManager = new GPHGraphicsManager(_eventSource); + } + /* Pass to POSIX method to do the heavy lifting */ OSystem_POSIX::initBackend(); _inited = true; } +void OSystem_GPH::initSDL() { + // Check if SDL has not been initialized + if (!_initedSDL) { + + uint32 sdlFlags = SDL_INIT_EVENTTHREAD; + if (ConfMan.hasKey("disable_sdl_parachute")) + sdlFlags |= SDL_INIT_NOPARACHUTE; + + // Initialize SDL (SDL Subsystems are initiliazed in the corresponding sdl managers) + if (SDL_Init(sdlFlags) == -1) + error("Could not initialize SDL: %s", SDL_GetError()); + + _initedSDL = true; + } +} + void OSystem_GPH::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { /* Setup default extra data paths for engine data files and plugins */ @@ -222,3 +231,5 @@ void OSystem_GPH::quit() { OSystem_POSIX::quit(); } + +#endif diff --git a/backends/platform/gph/gph-main.cpp b/backends/platform/gph/gph-main.cpp index 2c43af151f..876de0f358 100644 --- a/backends/platform/gph/gph-main.cpp +++ b/backends/platform/gph/gph-main.cpp @@ -21,7 +21,7 @@ */ #include "backends/platform/gph/gph.h" -#include "backends/plugins/posix/posix-provider.h" +#include "backends/plugins/sdl/sdl-provider.h" #include "base/main.h" #if defined(GPH_DEVICE) @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) { ((OSystem_GPH *)g_system)->init(); #ifdef DYNAMIC_MODULES - PluginManager::instance().addPluginProvider(new POSIXPluginProvider()); + PluginManager::instance().addPluginProvider(new SDLPluginProvider()); #endif // Invoke the actual ScummVM main entry point: diff --git a/backends/platform/gph/gph.h b/backends/platform/gph/gph.h index 80f43f0bab..90a798154f 100644 --- a/backends/platform/gph/gph.h +++ b/backends/platform/gph/gph.h @@ -26,13 +26,11 @@ #if defined(GPH_DEVICE) #include "backends/base-backend.h" -#include "backends/platform/sdl/sdl.h" +#include "backends/platform/sdl/sdl-sys.h" #include "backends/platform/sdl/posix/posix.h" #include "backends/events/gph/gph-events.h" #include "backends/graphics/gph/gph-graphics.h" -#define __GP2XWIZ__ - #ifndef PATH_MAX #define PATH_MAX 255 #endif @@ -45,6 +43,11 @@ public: void addSysArchivesToSearchSet(Common::SearchSet &s, int priority); void initBackend(); void quit(); + +protected: + bool _inited; + bool _initedSDL; + virtual void initSDL(); }; #endif diff --git a/backends/platform/maemo/debian/changelog b/backends/platform/maemo/debian/changelog index 8a9d8ee3c3..ea44574e96 100644 --- a/backends/platform/maemo/debian/changelog +++ b/backends/platform/maemo/debian/changelog @@ -1,8 +1,20 @@ -scummvm (1.5.0~git) unstable; urgency=low +scummvm (1.6.0~git) unstable; urgency=low * Development snapshot - -- Tarek Soliman <tsoliman@scummvm.org> Tue, 15 Nov 2011 14:56:57 -0600 + -- Tarek Soliman <tsoliman@scummvm.org> Tue, 10 Jul 2012 23:02:00 -0500 + +scummvm (1.5.0) unstable; urgency=low + + * 1.5.0 release + + -- Tarek Soliman <tsoliman@scummvm.org> Fri, 20 Jul 2012 14:48:44 -0500 + +scummvm (1.4.1) unstable; urgency=low + + * 1.4.1 release + + -- Tarek Soliman <tsoliman@scummvm.org> Wed, 11 Jan 2012 17:17:26 -0600 scummvm (1.4.0) unstable; urgency=low diff --git a/backends/platform/maemo/debian/control b/backends/platform/maemo/debian/control index 6e1dfe2fd4..bdaccd2359 100644 --- a/backends/platform/maemo/debian/control +++ b/backends/platform/maemo/debian/control @@ -2,7 +2,7 @@ Source: scummvm Section: user/games Priority: optional Maintainer: Tarek Soliman <tsoliman@scummvm.org> -Build-Depends: debhelper (>> 4.0.0), libsdl1.2-dev, libmad0-dev, libasound2-dev, libvorbisidec-dev, libmpeg2-4-dev, libflac-dev (>= 1.1.2), libz-dev, quilt +Build-Depends: debhelper (>> 4.0.0), libsdl1.2-dev, libmad0-dev, libasound2-dev, libvorbisidec-dev, libmpeg2-4-dev, libflac-dev (>= 1.1.2), libfreetype6-dev, libz-dev, quilt Standards-Version: 3.6.1.1 Package: scummvm diff --git a/backends/platform/maemo/debian/rules b/backends/platform/maemo/debian/rules index 64add08de8..43a34399a3 100755 --- a/backends/platform/maemo/debian/rules +++ b/backends/platform/maemo/debian/rules @@ -50,7 +50,7 @@ install: build install -m0644 dists/engine-data/drascula.dat dists/engine-data/hugo.dat dists/engine-data/kyra.dat dists/engine-data/lure.dat dists/engine-data/queen.tbl dists/engine-data/sky.cpt dists/engine-data/teenagent.dat dists/engine-data/toon.dat debian/scummvm/opt/scummvm/share install -m0644 -d debian/scummvm/usr/share/doc/scummvm - install -m0644 NEWS README COPYRIGHT debian/scummvm/usr/share/doc/scummvm + install -m0644 AUTHORS COPYING COPYING.BSD COPYING.FREEFONT COPYING.LGPL COPYRIGHT NEWS README debian/scummvm/usr/share/doc/scummvm binary: binary-arch binary-arch: build install diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp index e296d4787c..6bd229177b 100644 --- a/backends/platform/maemo/maemo.cpp +++ b/backends/platform/maemo/maemo.cpp @@ -43,6 +43,7 @@ namespace Maemo { OSystem_SDL_Maemo::OSystem_SDL_Maemo() : + _eventObserver(0), OSystem_POSIX() { } @@ -84,6 +85,9 @@ static void registerDefaultKeyBindings(Common::KeymapperDefaultBindings *_keymap #endif void OSystem_SDL_Maemo::initBackend() { + ConfMan.registerDefault("fullscreen", true); + ConfMan.registerDefault("aspect_ratio", true); + // Create the events manager if (_eventSource == 0) _eventSource = new MaemoSdlEventSource(); @@ -180,6 +184,7 @@ void OSystem_SDL_Maemo::setupIcon() { // http://bugzilla.libsdl.org/show_bug.cgi?id=586 } +#ifdef ENABLE_KEYMAPPER static const Common::KeyTableEntry maemoKeys[] = { // Function keys {"MENU", Common::KEYCODE_F11, 0, "Menu", false}, @@ -191,7 +196,6 @@ static const Common::KeyTableEntry maemoKeys[] = { {0, Common::KEYCODE_INVALID, 0, 0, false} }; -#ifdef ENABLE_KEYMAPPER Common::HardwareInputSet *OSystem_SDL_Maemo::getHardwareInputSet() { return new Common::HardwareInputSet(true, maemoKeys); } diff --git a/backends/platform/n64/framfs_save_manager.h b/backends/platform/n64/framfs_save_manager.h index da553e423a..0a88c8666b 100644 --- a/backends/platform/n64/framfs_save_manager.h +++ b/backends/platform/n64/framfs_save_manager.h @@ -100,10 +100,10 @@ public: class FRAMSaveManager : public Common::SaveFileManager { public: - virtual Common::OutSaveFile *openForSaving(const Common::String &filename) { + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) { OutFRAMSave *s = new OutFRAMSave(filename.c_str()); if (!s->err()) { - return Common::wrapCompressedWriteStream(s); + return compress ? Common::wrapCompressedWriteStream(s) : s; } else { delete s; return 0; diff --git a/backends/platform/n64/pakfs_save_manager.h b/backends/platform/n64/pakfs_save_manager.h index e0fcbc1e2d..6e67fb0f5f 100644 --- a/backends/platform/n64/pakfs_save_manager.h +++ b/backends/platform/n64/pakfs_save_manager.h @@ -101,10 +101,10 @@ public: class PAKSaveManager : public Common::SaveFileManager { public: - virtual Common::OutSaveFile *openForSaving(const Common::String &filename) { + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) { OutPAKSave *s = new OutPAKSave(filename.c_str()); if (!s->err()) { - return Common::wrapCompressedWriteStream(s); + return compress ? Common::wrapCompressedWriteStream(s) : s; } else { delete s; return NULL; diff --git a/backends/platform/openpandora/op-backend.cpp b/backends/platform/openpandora/op-backend.cpp index dcec387f97..354aa24b24 100644 --- a/backends/platform/openpandora/op-backend.cpp +++ b/backends/platform/openpandora/op-backend.cpp @@ -54,53 +54,15 @@ /* Dump console info to files. */ #define DUMP_STDOUT -static SDL_Cursor *hiddenCursor; - OSystem_OP::OSystem_OP() : OSystem_POSIX() { } -//static Uint32 timer_handler(Uint32 interval, void *param) { -// ((DefaultTimerManager *)param)->handler(); -// return interval; -//} - void OSystem_OP::initBackend() { assert(!_inited); - // Create the events manager - if (_eventSource == 0) - _eventSource = new OPEventSource(); - - // Create the graphics manager - if (_graphicsManager == 0) { - _graphicsManager = new OPGraphicsManager(_eventSource); - } - -// int joystick_num = ConfMan.getInt("joystick_num"); -// uint32 sdlFlags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER; -// -// if (ConfMan.hasKey("disable_sdl_parachute")) -// sdlFlags |= SDL_INIT_NOPARACHUTE; -// -// if (joystick_num > -1) -// sdlFlags |= SDL_INIT_JOYSTICK; -// -// if (SDL_Init(sdlFlags) == -1) { -// error("Could not initialize SDL: %s", SDL_GetError()); -// } -// - - // Create the mixer manager -// if (_mixer == 0) { -// _mixerManager = new DoubleBufferSDLMixerManager(); - - // Setup and start mixer -// _mixerManager->init(); -// } - /* Setup default save path to be workingdir/saves */ char savePath[PATH_MAX+1]; @@ -179,7 +141,14 @@ void OSystem_OP::initBackend() { /* Make sure SDL knows that we have a joystick we want to use. */ ConfMan.setInt("joystick_num", 0); -// _graphicsMutex = createMutex(); + // Create the events manager + if (_eventSource == 0) + _eventSource = new OPEventSource(); + + // Create the graphics manager + if (_graphicsManager == 0) { + _graphicsManager = new OPGraphicsManager(_eventSource); + } /* Pass to POSIX method to do the heavy lifting */ OSystem_POSIX::initBackend(); @@ -187,24 +156,6 @@ void OSystem_OP::initBackend() { _inited = true; } -// enable joystick -// if (joystick_num > -1 && SDL_NumJoysticks() > 0) { -// printf("Using joystick: %s\n", SDL_JoystickName(0)); -// _joystick = SDL_JoystickOpen(joystick_num); -// } -// -// setupMixer(); - -// Note: We could implement a custom SDLTimerManager by using -// SDL_AddTimer. That might yield better timer resolution, but it would -// also change the semantics of a timer: Right now, ScummVM timers -// *never* run in parallel, due to the way they are implemented. If we -// switched to SDL_AddTimer, each timer might run in a separate thread. -// However, not all our code is prepared for that, so we can't just -// switch. Still, it's a potential future change to keep in mind. -// _timer = new DefaultTimerManager(); -// _timerID = SDL_AddTimer(10, &timer_handler, _timer); - void OSystem_OP::initSDL() { // Check if SDL has not been initialized if (!_initedSDL) { @@ -217,38 +168,7 @@ void OSystem_OP::initSDL() { if (SDL_Init(sdlFlags) == -1) error("Could not initialize SDL: %s", SDL_GetError()); - uint8_t hiddenCursorData = 0; - - hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0); - - /* On the OpenPandora we need to work around an SDL assumption that - returns relative mouse coordinates when you get to the screen - edges using the touchscreen. The workaround is to set a blank - SDL cursor and not disable it (Hackish I know). - - The root issues likes in the Windows Manager GRAB code in SDL. - That is why the issue is not seen on framebuffer devices like the - GP2X (there is no X window manager ;)). - */ - SDL_ShowCursor(SDL_ENABLE); - SDL_SetCursor(hiddenCursor); - SDL_EnableUNICODE(1); - -// memset(&_oldVideoMode, 0, sizeof(_oldVideoMode)); -// memset(&_videoMode, 0, sizeof(_videoMode)); -// memset(&_transactionDetails, 0, sizeof(_transactionDetails)); - -// _videoMode.mode = GFX_DOUBLESIZE; -// _videoMode.scaleFactor = 2; -// _videoMode.aspectRatioCorrection = ConfMan.getBool("aspect_ratio"); -// _scalerProc = Normal2x; -// _scalerType = 0; - -// _videoMode.fullscreen = true; - _initedSDL = true; - -// OSystem_POSIX::initSDL(); } } @@ -275,8 +195,6 @@ void OSystem_OP::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { void OSystem_OP::quit() { - SDL_FreeCursor(hiddenCursor); - #ifdef DUMP_STDOUT printf("%s\n", "Debug: STDOUT and STDERR text files closed."); fclose(stdout); diff --git a/backends/platform/openpandora/op-sdl.h b/backends/platform/openpandora/op-sdl.h index 8cccbb5f86..1eddad5c4a 100644 --- a/backends/platform/openpandora/op-sdl.h +++ b/backends/platform/openpandora/op-sdl.h @@ -31,8 +31,6 @@ #include "backends/events/openpandora/op-events.h" #include "backends/graphics/openpandora/op-graphics.h" -//#define MIXER_DOUBLE_BUFFERING 1 - #ifndef PATH_MAX #define PATH_MAX 255 #endif diff --git a/backends/platform/ps2/savefilemgr.cpp b/backends/platform/ps2/savefilemgr.cpp index 421edc3e2e..46af42e193 100644 --- a/backends/platform/ps2/savefilemgr.cpp +++ b/backends/platform/ps2/savefilemgr.cpp @@ -145,7 +145,7 @@ Common::InSaveFile *Ps2SaveFileManager::openForLoading(const Common::String &fil return Common::wrapCompressedReadStream(sf); } -Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &filename) { +Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &filename, bool compress) { Common::FSNode savePath(ConfMan.get("savepath")); // TODO: is this fast? Common::WriteStream *sf; @@ -193,7 +193,7 @@ Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &fil } _screen->wantAnim(false); - return Common::wrapCompressedWriteStream(sf); + return compress ? Common::wrapCompressedWriteStream(sf) : sf; } bool Ps2SaveFileManager::removeSavefile(const Common::String &filename) { diff --git a/backends/platform/ps2/savefilemgr.h b/backends/platform/ps2/savefilemgr.h index a25fb063ae..163706eace 100644 --- a/backends/platform/ps2/savefilemgr.h +++ b/backends/platform/ps2/savefilemgr.h @@ -35,7 +35,7 @@ public: virtual ~Ps2SaveFileManager(); virtual Common::InSaveFile *openForLoading(const Common::String &filename); - virtual Common::OutSaveFile *openForSaving(const Common::String &filename); + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true); virtual Common::StringArray listSavefiles(const Common::String &pattern); virtual bool removeSavefile(const Common::String &filename); diff --git a/backends/platform/psp/README.PSP b/backends/platform/psp/README.PSP index bc0bd35a6e..969459dc5b 100644 --- a/backends/platform/psp/README.PSP +++ b/backends/platform/psp/README.PSP @@ -1,4 +1,4 @@ -ScummVM-PSP 1.5.0git README +ScummVM-PSP 1.6.0git README ============================================================================== Installation diff --git a/backends/platform/webos/webos.cpp b/backends/platform/webos/webos.cpp index 4ec153a7e9..fc18628235 100644 --- a/backends/platform/webos/webos.cpp +++ b/backends/platform/webos/webos.cpp @@ -45,24 +45,4 @@ void OSystem_SDL_WebOS::initBackend() { OSystem_SDL::initBackend(); } -/** - * Gets the original SDL hardware key set, adds WebOS specific keys and - * returns the new key set. - * - * @return The hardware key set with added webOS specific keys. - */ -#ifdef ENABLE_KEYMAPPER -HardwareInputSet *OSystem_SDL_WebOS::getHardwareInputSet() { - // Get the original SDL hardware key set - HardwareInputSet *inputSet = OSystem_SDL::getHardwareInputSet(); - - // Add WebOS specific keys - inputSet->addHardwareInput(new HardwareInput("FORWARD", - KeyState((KeyCode) 229, 229, 0), "Forward")); - - // Return the modified hardware key set - return inputSet; -} -#endif - #endif diff --git a/backends/platform/webos/webos.h b/backends/platform/webos/webos.h index 8dfa43239c..dda56a70da 100644 --- a/backends/platform/webos/webos.h +++ b/backends/platform/webos/webos.h @@ -31,9 +31,6 @@ public: OSystem_SDL_WebOS(); virtual void initBackend(); -#ifdef ENABLE_KEYMAPPER - virtual Common::HardwareInputSet *getHardwareInputSet(); -#endif }; #endif diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp index 681675529a..22a6495f8f 100644 --- a/backends/platform/wii/osystem.cpp +++ b/backends/platform/wii/osystem.cpp @@ -39,7 +39,7 @@ OSystem_Wii::OSystem_Wii() : _startup_time(0), - _cursorScale(1), + _cursorDontScale(true), _cursorPaletteDisabled(true), _cursorPalette(NULL), _cursorPaletteDirty(false), diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h index abafa7f642..5d6998d0b6 100644 --- a/backends/platform/wii/osystem.h +++ b/backends/platform/wii/osystem.h @@ -56,7 +56,7 @@ class OSystem_Wii : public EventsBaseBackend, public PaletteManager { private: s64 _startup_time; - int _cursorScale; + bool _cursorDontScale; bool _cursorPaletteDisabled; u16 *_cursorPalette; bool _cursorPaletteDirty; diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index 90e4d98c6b..fc0802dd4c 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -451,7 +451,7 @@ bool OSystem_Wii::needsScreenUpdate() { void OSystem_Wii::updateScreen() { static f32 ar; static gfx_screen_coords_t cc; - static int cs; + static f32 csx, csy; u32 now = getMillis(); if (now - _lastScreenUpdate < 1000 / MAX_FPS) @@ -466,7 +466,6 @@ void OSystem_Wii::updateScreen() { wii_memstats(); #endif - cs = _cursorScale; _lastScreenUpdate = now; if (_overlayVisible || _consoleVisible) @@ -488,12 +487,6 @@ void OSystem_Wii::updateScreen() { if (_gameRunning) ar = gfx_set_ar(4.0 / 3.0); - // ugly, but the modern theme sets a factor of 3, only god knows why - if (cs > 2) - cs = 1; - else - cs *= 2; - if (_overlayDirty) { gfx_tex_convert(&_texOverlay, _overlayPixels); _overlayDirty = false; @@ -503,10 +496,18 @@ void OSystem_Wii::updateScreen() { } if (_mouseVisible) { - cc.x = f32(_mouseX - cs * _mouseHotspotX) * _currentXScale; - cc.y = f32(_mouseY - cs * _mouseHotspotY) * _currentYScale; - cc.w = f32(_texMouse.width) * _currentXScale * cs; - cc.h = f32(_texMouse.height) * _currentYScale * cs; + if (_cursorDontScale) { + csx = 1.0f / _currentXScale; + csy = 1.0f / _currentYScale; + } else { + csx = 1.0f; + csy = 1.0f; + } + + cc.x = f32(_mouseX - csx * _mouseHotspotX) * _currentXScale; + cc.y = f32(_mouseY - csy * _mouseHotspotY) * _currentYScale; + cc.w = f32(_texMouse.width) * _currentXScale * csx; + cc.h = f32(_texMouse.height) * _currentYScale * csy; if (_texMouse.palette && _cursorPaletteDirty) { _texMouse.palette[_mouseKeyColor] = 0; @@ -745,8 +746,7 @@ void OSystem_Wii::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, _mouseHotspotX = hotspotX; _mouseHotspotY = hotspotY; - // TODO: Adapt to new dontScale logic! - _cursorScale = 1; + _cursorDontScale = dontScale; if ((_texMouse.palette) && (oldKeycolor != _mouseKeyColor)) _cursorPaletteDirty = true; diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index 237c50a1ba..64e7e778b6 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -97,7 +97,7 @@ Common::InSaveFile *DefaultSaveFileManager::openForLoading(const Common::String return Common::wrapCompressedReadStream(sf); } -Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String &filename) { +Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String &filename, bool compress) { // Ensure that the savepath is valid. If not, generate an appropriate error. Common::String savePathName = getSavePath(); checkPath(Common::FSNode(savePathName)); @@ -112,7 +112,7 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String // Open the file for saving Common::WriteStream *sf = file.createWriteStream(); - return Common::wrapCompressedWriteStream(sf); + return compress ? Common::wrapCompressedWriteStream(sf) : sf; } bool DefaultSaveFileManager::removeSavefile(const Common::String &filename) { diff --git a/backends/saves/default/default-saves.h b/backends/saves/default/default-saves.h index 1ea87efc67..c7fca279bc 100644 --- a/backends/saves/default/default-saves.h +++ b/backends/saves/default/default-saves.h @@ -38,7 +38,7 @@ public: virtual Common::StringArray listSavefiles(const Common::String &pattern); virtual Common::InSaveFile *openForLoading(const Common::String &filename); - virtual Common::OutSaveFile *openForSaving(const Common::String &filename); + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true); virtual bool removeSavefile(const Common::String &filename); protected: diff --git a/backends/saves/windows/windows-saves.cpp b/backends/saves/windows/windows-saves.cpp index 87348c3416..d520632394 100644 --- a/backends/saves/windows/windows-saves.cpp +++ b/backends/saves/windows/windows-saves.cpp @@ -26,8 +26,12 @@ #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER) +#if defined(ARRAYSIZE) +#undef ARRAYSIZE +#endif #define WIN32_LEAN_AND_MEAN #include <windows.h> +#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one... #include "common/config-manager.h" #include "common/savefile.h" diff --git a/backends/timer/default/default-timer.cpp b/backends/timer/default/default-timer.cpp index 8681102cd0..9cd803f148 100644 --- a/backends/timer/default/default-timer.cpp +++ b/backends/timer/default/default-timer.cpp @@ -59,7 +59,6 @@ void insertPrioQueue(TimerSlot *head, TimerSlot *newSlot) { DefaultTimerManager::DefaultTimerManager() : - _timerHandler(0), _head(0) { _head = new TimerSlot(); diff --git a/backends/timer/default/default-timer.h b/backends/timer/default/default-timer.h index e5a9dada79..5884979da0 100644 --- a/backends/timer/default/default-timer.h +++ b/backends/timer/default/default-timer.h @@ -34,7 +34,6 @@ private: typedef Common::HashMap<Common::String, TimerProc, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> TimerSlotMap; Common::Mutex _mutex; - void *_timerHandler; TimerSlot *_head; TimerSlotMap _callbacks; |