From 97953ff40d1281da7bf3d7fe466db6d317c466d5 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 7 Jan 2014 01:46:28 +0100 Subject: SDL: Fix return value of getDefaultGraphicsMode when scalers are disabled. --- backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends') diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index c946b8e747..9b71a1e3a4 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -267,7 +267,11 @@ const OSystem::GraphicsMode *SurfaceSdlGraphicsManager::getSupportedGraphicsMode } int SurfaceSdlGraphicsManager::getDefaultGraphicsMode() const { +#ifdef USE_SCALERS return GFX_DOUBLESIZE; +#else + return GFX_NORMAL; +#endif } void SurfaceSdlGraphicsManager::resetGraphicsScale() { -- cgit v1.2.3 From 0c7f795c5bfac931436d1089aa97a15906b3f1a7 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 7 Jan 2014 01:47:43 +0100 Subject: SDL: Silence unused variable warning when scalers are disabled. --- backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends') diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index 9b71a1e3a4..0a4dcf3ea3 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -1080,7 +1080,9 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() { for (r = _dirtyRectList; r != lastRect; ++r) { register int dst_y = r->y + _currentShakePos; register int dst_h = 0; +#ifdef USE_SCALERS register int orig_dst_y = 0; +#endif register int rx1 = r->x * scale1; if (dst_y < height) { @@ -1088,7 +1090,9 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() { if (dst_h > height - dst_y) dst_h = height - dst_y; +#ifdef USE_SCALERS orig_dst_y = dst_y; +#endif dst_y = dst_y * scale1; if (_videoMode.aspectRatioCorrection && !_overlayVisible) -- cgit v1.2.3 From 62828f86a14994b1be503abc141f5eb73857530c Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Thu, 9 Jan 2014 23:25:07 +0100 Subject: DC: Workaround for usleep prototype mismatch --- backends/platform/dc/dc-fs.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'backends') diff --git a/backends/platform/dc/dc-fs.cpp b/backends/platform/dc/dc-fs.cpp index 36f5a1465c..f850c9d26f 100644 --- a/backends/platform/dc/dc-fs.cpp +++ b/backends/platform/dc/dc-fs.cpp @@ -27,7 +27,9 @@ #include #include +#define usleep usleep_unistd #include +#undef usleep /** * Implementation of the ScummVM file system API based on Ronin. -- cgit v1.2.3 From 66ad9e76eeda77f2ca4d10db82cfd31dba38d127 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Thu, 9 Jan 2014 23:26:31 +0100 Subject: DC: Silenced some stupid warnings --- backends/platform/dc/dc.h | 2 ++ backends/platform/dc/dcmain.cpp | 6 ++++-- backends/platform/dc/icon.cpp | 4 ++-- backends/platform/dc/input.cpp | 11 ++++++----- backends/platform/dc/softkbd.h | 1 + 5 files changed, 15 insertions(+), 9 deletions(-) (limited to 'backends') diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index d62ced02e1..ba60c7740e 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -43,7 +43,9 @@ class Interactive public: virtual int key(int k, byte &shiftFlags) = 0; virtual void mouse(int x, int y) = 0; + virtual ~Interactive() = 0; }; +inline Interactive::~Interactive() { } #include "softkbd.h" diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index bec1fdae3a..36a22c4b5c 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -79,13 +79,14 @@ static bool find_track(int track, int &first_sec, int &last_sec) if (first < 1 || last > 99 || first > last) return false; for (i=first; i<=last; i++) - if (!(TOC_CTRL(toc->entry[i-1])&4)) + if (!(TOC_CTRL(toc->entry[i-1])&4)) { if (track==1) { first_sec = TOC_LBA(toc->entry[i-1]); last_sec = TOC_LBA(toc->entry[i]); return true; } else --track; + } return false; } @@ -281,7 +282,7 @@ namespace DC_Flash { if((r = syscall_read_flash(info[0] + (bmb++ << 6), bm, 64))<0) return r; } - if(!(bm[(b>>3)&63] & (0x80>>(b&7)))) + if(!(bm[(b>>3)&63] & (0x80>>(b&7)))) { if((r = syscall_read_flash(info[0] + ((b+1) << 6), buf, 64))<0) return r; else if((s=*(unsigned short *)(buf+0)) == sec && @@ -289,6 +290,7 @@ namespace DC_Flash { memcpy(dst+(s-sec)*60, buf+2, 60); got=1; } + } } return got; } diff --git a/backends/platform/dc/icon.cpp b/backends/platform/dc/icon.cpp index cf7afc82e0..28edf27f4f 100644 --- a/backends/platform/dc/icon.cpp +++ b/backends/platform/dc/icon.cpp @@ -47,8 +47,8 @@ void Icon::create_vmicon(void *buffer) void Icon::create_texture() { - static char tt[16] = { 0, 1, 4, 5, 16, 17, 20, 21, - 64, 65, 68, 69, 80, 81, 84, 85 }; + static unsigned char tt[16] = { 0, 1, 4, 5, 16, 17, 20, 21, + 64, 65, 68, 69, 80, 81, 84, 85 }; unsigned short *tex = (unsigned short *)ta_txalloc(512); unsigned short *linebase; unsigned char *src = bitmap+sizeof(bitmap)-17; diff --git a/backends/platform/dc/input.cpp b/backends/platform/dc/input.cpp index 7b21c76efa..5c6adf6c7c 100644 --- a/backends/platform/dc/input.cpp +++ b/backends/platform/dc/input.cpp @@ -50,10 +50,10 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y, else if (!(buttons & 512)) newkey = ' '; else if (!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15]; - if (!(buttons & 128)) if (inter) newkey = 1001; else mouse_x++; - if (!(buttons & 64)) if (inter) newkey = 1002; else mouse_x--; - if (!(buttons & 32)) if (inter) newkey = 1003; else mouse_y++; - if (!(buttons & 16)) if (inter) newkey = 1004; else mouse_y--; + if (!(buttons & 128)) { if (inter) newkey = 1001; else mouse_x++; } + if (!(buttons & 64)) { if (inter) newkey = 1002; else mouse_x--; } + if (!(buttons & 32)) { if (inter) newkey = 1003; else mouse_y++; } + if (!(buttons & 16)) { if (inter) newkey = 1004; else mouse_y--; } mouse_x += ((int)pad->cond.controller.joyx-128)>>4; mouse_y += ((int)pad->cond.controller.joyy-128)>>4; @@ -157,7 +157,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y, return -Common::EVENT_RBUTTONUP; } - if (mouse_wheel != lastwheel) + if (mouse_wheel != lastwheel) { if (((int8)(mouse_wheel - lastwheel)) > 0) { lastwheel++; return -Common::EVENT_WHEELDOWN; @@ -165,6 +165,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y, --lastwheel; return -Common::EVENT_WHEELUP; } + } if (newkey && inter && newkey != lastkey) { int transkey = inter->key(newkey, shiftFlags); diff --git a/backends/platform/dc/softkbd.h b/backends/platform/dc/softkbd.h index 8f87d12baa..27826c2744 100644 --- a/backends/platform/dc/softkbd.h +++ b/backends/platform/dc/softkbd.h @@ -40,6 +40,7 @@ class SoftKeyboard : public Interactive public: SoftKeyboard(const OSystem_Dreamcast *os); + virtual ~SoftKeyboard() {} void draw(float x, float y, int transp = 0); int key(int k, byte &shiftFlags); -- cgit v1.2.3 From dd84867997b515e2e95b383b68ebc27b9cc45b42 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Fri, 10 Jan 2014 20:05:32 +0100 Subject: ANDROID: Set correct blending function Overlays with alpha channel in ScummVM use pre-multiplied alpha. Thus, is it necessary to set the source blend function to ONE, not SOURCE_ALPHA. While there is no firm decision on the texture format to be used to cursors, make sure to set the key color to R=G=B=A=0.0, so that it can be used with either pre-multiplied or non-pre-multiplied blending. --- backends/platform/android/gfx.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'backends') diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 882dcff9a4..0ce95a3cfb 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -233,7 +233,7 @@ void OSystem_Android::initViewport() { GLCALL(glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST)); GLCALL(glEnable(GL_BLEND)); - GLCALL(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); + GLCALL(glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)); GLCALL(glEnableClientState(GL_VERTEX_ARRAY)); GLCALL(glEnableClientState(GL_TEXTURE_COORD_ARRAY)); @@ -726,7 +726,7 @@ void OSystem_Android::setMouseCursor(const void *buf, uint w, uint h, _mouse_keycolor = keycolor; p = _mouse_texture_palette->palette() + _mouse_keycolor * 2; - WRITE_UINT16(p, READ_UINT16(p) & ~1); + WRITE_UINT16(p, 0); } if (w == 0 || h == 0) @@ -779,7 +779,7 @@ void OSystem_Android::setCursorPaletteInternal(const byte *colors, WRITE_UINT16(p, pf.RGBToColor(colors[0], colors[1], colors[2])); p = _mouse_texture_palette->palette() + _mouse_keycolor * 2; - WRITE_UINT16(p, READ_UINT16(p) & ~1); + WRITE_UINT16(p, 0); } void OSystem_Android::setCursorPalette(const byte *colors, @@ -821,7 +821,7 @@ void OSystem_Android::disableCursorPalette() { } byte *p = _mouse_texture_palette->palette() + _mouse_keycolor * 2; - WRITE_UINT16(p, READ_UINT16(p) & ~1); + WRITE_UINT16(p, 0); } } -- cgit v1.2.3