diff options
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.cpp | 22 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.h | 2 | ||||
-rw-r--r-- | backends/platform/iphone/osys_main.h | 2 | ||||
-rw-r--r-- | backends/platform/iphone/osys_video.cpp | 4 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 14 | ||||
-rw-r--r-- | backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in | 4 | ||||
-rw-r--r-- | backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in | 4 | ||||
-rw-r--r-- | backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in | 4 | ||||
-rw-r--r-- | backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in | 4 |
9 files changed, 34 insertions, 26 deletions
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 3ad92b4355..576b70dd2a 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -259,13 +259,13 @@ bool OSystem_DS::grabRawScreen(Graphics::Surface *surf) { return true; } -void OSystem_DS::grabPalette(unsigned char *colours, uint start, uint num) { +void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) { // consolePrintf("Grabpalette"); for (unsigned int r = start; r < start + num; r++) { - *colours++ = (BG_PALETTE[r] & 0x001F) << 3; - *colours++ = (BG_PALETTE[r] & 0x03E0) >> 5 << 3; - *colours++ = (BG_PALETTE[r] & 0x7C00) >> 10 << 3; + *colors++ = (BG_PALETTE[r] & 0x001F) << 3; + *colors++ = (BG_PALETTE[r] & 0x03E0) >> 5 << 3; + *colors++ = (BG_PALETTE[r] & 0x7C00) >> 10 << 3; } } @@ -849,16 +849,16 @@ Common::WriteStream *OSystem_DS::createConfigWriteStream() { return file.createWriteStream(); } -u16 OSystem_DS::applyGamma(u16 colour) { +u16 OSystem_DS::applyGamma(u16 color) { // Attempt to do gamma correction (or something like it) to palette entries // to improve the contrast of the image on the original DS screen. - // Split the colour into it's component channels - int r = colour & 0x001F; - int g = (colour & 0x03E0) >> 5; - int b = (colour & 0x7C00) >> 10; + // Split the color into it's component channels + int r = color & 0x001F; + int g = (color & 0x03E0) >> 5; + int b = (color & 0x7C00) >> 10; - // Caluclate the scaling factor for this colour based on it's brightness + // Caluclate the scaling factor for this color based on it's brightness int scale = ((23 - ((r + g + b) >> 2)) * _gammaValue) >> 3; // Scale the three components by the scaling factor, with clamping @@ -871,7 +871,7 @@ u16 OSystem_DS::applyGamma(u16 colour) { b = b + ((b * scale) >> 4); if (b > 31) b = 31; - // Stick them back together into a 555 colour value + // Stick them back together into a 555 color value return 0x8000 | r | (g << 5) | (b << 10); } diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index 7feed7541f..5e179d1337 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -183,7 +183,7 @@ public: Common::WriteStream *createConfigWriteStream(); Common::SeekableReadStream *createConfigReadStream(); - u16 applyGamma(u16 colour); + u16 applyGamma(u16 color); void setGammaValue(int gamma) { _gammaValue = gamma; } void engineDone(); diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index 5e88510980..25c3c40cf9 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -81,7 +81,7 @@ protected: bool _mouseVisible; byte *_mouseBuf; - byte _mouseKeyColour; + byte _mouseKeyColor; uint _mouseWidth, _mouseHeight; uint _mouseX, _mouseY; int _mouseHotspotX, _mouseHotspotY; diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp index d67d38932a..c5e7ab8413 100644 --- a/backends/platform/iphone/osys_video.cpp +++ b/backends/platform/iphone/osys_video.cpp @@ -312,7 +312,7 @@ void OSystem_IPHONE::drawMouseCursorOnRectUpdate(const Common::Rect& updatedRect uint16 *dst = &_fullscreen[top * _screenWidth + left]; for (int y = displayHeight; y > srcY; y--) { for (int x = displayWidth; x > srcX; x--) { - if (*src != _mouseKeyColour) + if (*src != _mouseKeyColor) *dst = _palette[*src]; dst++; src++; @@ -497,7 +497,7 @@ void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspot _mouseHotspotX = hotspotX; _mouseHotspotY = hotspotY; - _mouseKeyColour = (byte)keycolor; + _mouseKeyColor = (byte)keycolor; memcpy(_mouseBuf, buf, w * h); diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index d6e79248f9..2c0c45907f 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -378,7 +378,11 @@ void OSystem_SDL::setupIcon() { unsigned int rgba[256]; unsigned int *icon; - sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes); + if (sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes) != 4) { + warning("Wrong format of scummvm_icon[0] (%s)", scummvm_icon[0]); + + return; + } if ((w > 512) || (h > 512) || (ncols > 255) || (nbytes > 1)) { warning("Could not load the built-in icon (%d %d %d %d)", w, h, ncols, nbytes); return; @@ -393,13 +397,17 @@ void OSystem_SDL::setupIcon() { unsigned char code; char color[32]; unsigned int col; - sscanf(scummvm_icon[1 + i], "%c c %s", &code, color); + if (sscanf(scummvm_icon[1 + i], "%c c %s", &code, color) != 2) { + warning("Wrong format of scummvm_icon[%d] (%s)", 1 + i, scummvm_icon[1 + i]); + } if (!strcmp(color, "None")) col = 0x00000000; else if (!strcmp(color, "black")) col = 0xFF000000; else if (color[0] == '#') { - sscanf(color + 1, "%06x", &col); + if (sscanf(color + 1, "%06x", &col) != 1) { + warning("Wrong format of color (%s)", color + 1); + } col |= 0xFF000000; } else { warning("Could not load the built-in icon (%d %s - %s) ", code, color, scummvm_icon[1 + i]); diff --git a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in index 12b4cb3610..8e644ae634 100644 --- a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in +++ b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in @@ -63,8 +63,8 @@ START BITMAP ScummVM.mbm TARGETPATH \Resource\Apps SOURCEPATH ..\res // Source Color-depth Source-bitmap-list -// c denotes whether the bitmap is a colour bitmap and the digits represent the -// colour-depth of the bitmap and the bitmap mask respectively +// c denotes whether the bitmap is a color bitmap and the digits represent the +// color-depth of the bitmap and the bitmap mask respectively SOURCE c24 ScummSmall.bmp SOURCE 8 ScummSmallMask.bmp SOURCE c24 ScummLarge.bmp diff --git a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in index 9af6535b22..f3c12c6b19 100644 --- a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in +++ b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in @@ -63,8 +63,8 @@ START BITMAP ScummVM.mbm TARGETPATH \Resource\Apps SOURCEPATH ..\res // Source Color-depth Source-bitmap-list -// c denotes whether the bitmap is a colour bitmap and the digits represent the -// colour-depth of the bitmap and the bitmap mask respectively +// c denotes whether the bitmap is a color bitmap and the digits represent the +// color-depth of the bitmap and the bitmap mask respectively SOURCE c24 ScummSmall.bmp SOURCE 8 ScummSmallMask.bmp SOURCE c24 ScummLarge.bmp diff --git a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in index 3fab5cc2b7..5cf1b1bb11 100644 --- a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in +++ b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in @@ -64,8 +64,8 @@ START BITMAP ScummVM.mbm TARGETPATH \Resource\Apps SOURCEPATH ..\res // Source Color-depth Source-bitmap-list -// c denotes whether the bitmap is a colour bitmap and the digits represent the -// colour-depth of the bitmap and the bitmap mask respectively +// c denotes whether the bitmap is a color bitmap and the digits represent the +// color-depth of the bitmap and the bitmap mask respectively SOURCE c24 ScummSmall.bmp SOURCE 8 ScummSmallMask.bmp SOURCE c24 ScummLarge.bmp diff --git a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in index 31dfc36399..44ec5aaf4a 100644 --- a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in +++ b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in @@ -64,8 +64,8 @@ START BITMAP ScummVM.mbm TARGETPATH \Resource\Apps SOURCEPATH ..\res // Source Color-depth Source-bitmap-list -// c denotes whether the bitmap is a colour bitmap and the digits represent the -// colour-depth of the bitmap and the bitmap mask respectively +// c denotes whether the bitmap is a color bitmap and the digits represent the +// color-depth of the bitmap and the bitmap mask respectively SOURCE c24 ScummSmall.bmp SOURCE 8 ScummSmallMask.bmp SOURCE c24 ScummLarge.bmp |