From a401f0a19e09d7d00a3ee94d928db82e658b7b48 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 3 Jun 2012 02:02:57 +0200 Subject: ALL: Replace cursorTargetScale in OSystem API with a simple "do not scale" logic. All uses of the old target scale API actually wanted to disallow scaling of the mouse cursor. This commit adapts our API to this and thus simplifies backend implementations. Some backends, most notable the Wii and Android, did some implementation of the cursor target scale, which I didn't adapt yet. I added a TODO for the porters there. --- backends/platform/psp/osys_psp.cpp | 6 ++++-- backends/platform/psp/osys_psp.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'backends/platform/psp') diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 5fa5110684..958a3a22c6 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -303,7 +303,7 @@ void OSystem_PSP::warpMouse(int x, int y) { _cursor.setXY(x, y); } -void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) { +void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) { DEBUG_ENTER_FUNC(); _displayManager.waitUntilRenderFinished(); _pendingUpdate = false; @@ -314,7 +314,9 @@ void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, } _cursor.setKeyColor(keycolor); - _cursor.setCursorTargetScale(cursorTargetScale); + // TODO: The old target scale was saved but never used. Should the new + // "do not scale" logic be implemented? + //_cursor.setCursorTargetScale(cursorTargetScale); _cursor.setSizeAndScummvmPixelFormat(w, h, format); _cursor.setHotspot(hotspotX, hotspotY); _cursor.clearKeyColor(); diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index e6b445e232..c72053f52c 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -118,7 +118,7 @@ public: // Mouse related bool showMouse(bool visible); void warpMouse(int x, int y); - void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format); + void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format); // Events and input bool pollEvent(Common::Event &event); -- cgit v1.2.3 From b2f5721e58e94b918c5b7032e315396f4fb6c51d Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sat, 9 Jun 2012 20:20:19 -0400 Subject: COMMON: Add tm_wday to our TimeDate struct Did not adapt bada or ps2 backends as I'm not sure how they should be handled --- backends/platform/psp/osys_psp.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'backends/platform/psp') diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 958a3a22c6..510b4ea112 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -446,6 +446,7 @@ void OSystem_PSP::getTimeAndDate(TimeDate &td) const { td.tm_mday = t.tm_mday; td.tm_mon = t.tm_mon; td.tm_year = t.tm_year; + td.tm_wday = t.tm_wday; } Common::String OSystem_PSP::getDefaultConfigFileName() { -- cgit v1.2.3 From 31880186e1c78023e2e552a7fceaa27c3d2d08b1 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 16 Jun 2012 02:18:01 +0200 Subject: BACKENDS: Let copyRectToScreen take a "const void *" instead of "const byte *" as buffer. This removes the need to convert the parameter to copyRectToScreen to "const byte *", which is commonly used in games, which use Graphics::Surface to store their graphics data. --- backends/platform/psp/osys_psp.cpp | 4 ++-- backends/platform/psp/osys_psp.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'backends/platform/psp') diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 958a3a22c6..46e11b1bf7 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -204,11 +204,11 @@ void OSystem_PSP::setCursorPalette(const byte *colors, uint start, uint num) { _cursor.clearKeyColor(); // Do we need this? } -void OSystem_PSP::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) { +void OSystem_PSP::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) { DEBUG_ENTER_FUNC(); _displayManager.waitUntilRenderFinished(); _pendingUpdate = false; - _screen.copyFromRect(buf, pitch, x, y, w, h); + _screen.copyFromRect((const byte *)buf, pitch, x, y, w, h); } Graphics::Surface *OSystem_PSP::lockScreen() { diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index c72053f52c..af01b6f6c8 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -99,7 +99,7 @@ public: void setCursorPalette(const byte *colors, uint start, uint num); // Screen related - void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); + void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h); Graphics::Surface *lockScreen(); void unlockScreen(); void updateScreen(); -- cgit v1.2.3 From d27d951d0b079a301ea1c6a3731bc1fc83234cff Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 16 Jun 2012 03:10:43 +0200 Subject: BACKENDS: Make OSystem::setMouseCursor take a "const void *" buffer. This is mainly for consistency with OSystem::copyRectToScreen. --- backends/platform/psp/osys_psp.cpp | 4 ++-- backends/platform/psp/osys_psp.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'backends/platform/psp') diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 46e11b1bf7..3fe9a7f9c7 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -303,7 +303,7 @@ void OSystem_PSP::warpMouse(int x, int y) { _cursor.setXY(x, y); } -void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) { +void OSystem_PSP::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) { DEBUG_ENTER_FUNC(); _displayManager.waitUntilRenderFinished(); _pendingUpdate = false; @@ -320,7 +320,7 @@ void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, _cursor.setSizeAndScummvmPixelFormat(w, h, format); _cursor.setHotspot(hotspotX, hotspotY); _cursor.clearKeyColor(); - _cursor.copyFromArray(buf); + _cursor.copyFromArray((const byte *)buf); } bool OSystem_PSP::pollEvent(Common::Event &event) { diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index af01b6f6c8..d167c757ae 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -118,7 +118,7 @@ public: // Mouse related bool showMouse(bool visible); void warpMouse(int x, int y); - void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format); + void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format); // Events and input bool pollEvent(Common::Event &event); -- cgit v1.2.3 From aec9b9e22a9bff54ae3c39bb796bae0f4b4c2d95 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 16 Jun 2012 04:17:14 +0200 Subject: ALL: Let overlay related methods in OSystem take a void * and use a proper pitch values. This is a first step to get rid of OverlayColor, which is a requirement for proper 4Bpp overlay support. --- backends/platform/psp/default_display_client.cpp | 8 ++++---- backends/platform/psp/default_display_client.h | 4 ++-- backends/platform/psp/osys_psp.cpp | 4 ++-- backends/platform/psp/osys_psp.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'backends/platform/psp') diff --git a/backends/platform/psp/default_display_client.cpp b/backends/platform/psp/default_display_client.cpp index 2ee7ff5b74..bc252144fa 100644 --- a/backends/platform/psp/default_display_client.cpp +++ b/backends/platform/psp/default_display_client.cpp @@ -123,15 +123,15 @@ void Overlay::setSize(uint32 width, uint32 height) { _renderer.setDrawWholeBuffer(); // We need to let the renderer know how much to draw } -void Overlay::copyToArray(OverlayColor *buf, int pitch) { +void Overlay::copyToArray(void *buf, int pitch) { DEBUG_ENTER_FUNC(); - _buffer.copyToArray((byte *)buf, pitch * sizeof(OverlayColor)); // Change to bytes + _buffer.copyToArray((byte *)buf, pitch); // Change to bytes } -void Overlay::copyFromRect(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { +void Overlay::copyFromRect(const void *buf, int pitch, int x, int y, int w, int h) { DEBUG_ENTER_FUNC(); - _buffer.copyFromRect((byte *)buf, pitch * sizeof(OverlayColor), x, y, w, h); // Change to bytes + _buffer.copyFromRect((byte *)buf, pitch, x, y, w, h); // Change to bytes // debug //_buffer.print(0xFF); setDirty(); diff --git a/backends/platform/psp/default_display_client.h b/backends/platform/psp/default_display_client.h index 721a7e6fea..95c52e2352 100644 --- a/backends/platform/psp/default_display_client.h +++ b/backends/platform/psp/default_display_client.h @@ -69,8 +69,8 @@ public: bool allocate(); void setBytesPerPixel(uint32 size); void setSize(uint32 width, uint32 height); - void copyToArray(OverlayColor *buf, int pitch); - void copyFromRect(const OverlayColor *buf, int pitch, int x, int y, int w, int h); + void copyToArray(void *buf, int pitch); + void copyFromRect(const void *buf, int pitch, int x, int y, int w, int h); }; /** diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 3fe9a7f9c7..0032fea072 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -260,12 +260,12 @@ void OSystem_PSP::clearOverlay() { _overlay.clearBuffer(); } -void OSystem_PSP::grabOverlay(OverlayColor *buf, int pitch) { +void OSystem_PSP::grabOverlay(void *buf, int pitch) { DEBUG_ENTER_FUNC(); _overlay.copyToArray(buf, pitch); } -void OSystem_PSP::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { +void OSystem_PSP::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) { DEBUG_ENTER_FUNC(); _displayManager.waitUntilRenderFinished(); _pendingUpdate = false; diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index d167c757ae..2afdabd0fc 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -109,8 +109,8 @@ public: void showOverlay(); void hideOverlay(); void clearOverlay(); - void grabOverlay(OverlayColor *buf, int pitch); - void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); + void grabOverlay(void *buf, int pitch); + void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h); int16 getOverlayHeight(); int16 getOverlayWidth(); Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<4444>(); } -- cgit v1.2.3 From 36ac1e8b4780bd217c400b3edab62e484b60e388 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 20 Jun 2012 17:20:00 +0200 Subject: PSP: Replace OverlayColor with uint16. --- backends/platform/psp/display_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/psp') diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp index 10a732b1e3..c2ff84c7f5 100644 --- a/backends/platform/psp/display_manager.cpp +++ b/backends/platform/psp/display_manager.cpp @@ -302,7 +302,7 @@ void DisplayManager::init() { // Init overlay since we never change the size _overlay->deallocate(); - _overlay->setBytesPerPixel(sizeof(OverlayColor)); + _overlay->setBytesPerPixel(sizeof(uint16)); _overlay->setSize(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT); _overlay->allocate(); } -- cgit v1.2.3 From 6387e3bca73dd8b2dacab15a84a4a3b8d6c13c10 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 8 Jul 2012 22:30:05 +0300 Subject: RELEASE: This is 1.6.0git --- backends/platform/psp/README.PSP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/psp') 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 -- cgit v1.2.3