aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/n64
diff options
context:
space:
mode:
authorJohannes Schickel2012-06-20 17:21:05 +0200
committerJohannes Schickel2012-06-20 17:21:05 +0200
commit703be9f87cc46e416475d526ba5c412af3d8c282 (patch)
tree2c6f7cd912582461a74ae7d42e0afef44efd0285 /backends/platform/n64
parent36ac1e8b4780bd217c400b3edab62e484b60e388 (diff)
downloadscummvm-rg350-703be9f87cc46e416475d526ba5c412af3d8c282.tar.gz
scummvm-rg350-703be9f87cc46e416475d526ba5c412af3d8c282.tar.bz2
scummvm-rg350-703be9f87cc46e416475d526ba5c412af3d8c282.zip
N64: Replace OverlayColor with uint16.
Diffstat (limited to 'backends/platform/n64')
-rw-r--r--backends/platform/n64/osys_n64.h2
-rw-r--r--backends/platform/n64/osys_n64_base.cpp18
2 files changed, 10 insertions, 10 deletions
diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h
index 3266180a7b..249f72d8fc 100644
--- a/backends/platform/n64/osys_n64.h
+++ b/backends/platform/n64/osys_n64.h
@@ -81,7 +81,7 @@ protected:
uint16 *_offscreen_hic; // Offscreen converted to 16bit surface
uint8 *_offscreen_pal; // Offscreen with palette indexes
- OverlayColor *_overlayBuffer; // Offscreen for the overlay (16 bit)
+ uint16 *_overlayBuffer; // Offscreen for the overlay (16 bit)
uint16 *_screenPalette; // Array for palette entries (256 colors max)
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index 8f17171338..cf513eb9f1 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -95,7 +95,7 @@ OSystem_N64::OSystem_N64() {
// Allocate memory for offscreen buffers
_offscreen_hic = (uint16 *)memalign(8, _screenWidth * _screenHeight * 2);
_offscreen_pal = (uint8 *)memalign(8, _screenWidth * _screenHeight);
- _overlayBuffer = (uint16 *)memalign(8, _overlayWidth * _overlayHeight * sizeof(OverlayColor));
+ _overlayBuffer = (uint16 *)memalign(8, _overlayWidth * _overlayHeight * sizeof(uint16));
_cursor_pal = NULL;
_cursor_hic = NULL;
@@ -108,7 +108,7 @@ OSystem_N64::OSystem_N64() {
// Clean offscreen buffers
memset(_offscreen_hic, 0, _screenWidth * _screenHeight * 2);
memset(_offscreen_pal, 0, _screenWidth * _screenHeight);
- memset(_overlayBuffer, 0, _overlayWidth * _overlayHeight * sizeof(OverlayColor));
+ memset(_overlayBuffer, 0, _overlayWidth * _overlayHeight * sizeof(uint16));
// Default graphic mode
_graphicMode = OVERS_NTSC_340X240;
@@ -667,7 +667,7 @@ void OSystem_N64::hideOverlay() {
}
void OSystem_N64::clearOverlay() {
- memset(_overlayBuffer, 0, _overlayWidth * _overlayHeight * sizeof(OverlayColor));
+ memset(_overlayBuffer, 0, _overlayWidth * _overlayHeight * sizeof(uint16));
uint8 skip_lines = (_screenHeight - _gameHeight) / 4;
uint8 skip_pixels = (_screenWidth - _gameWidth) / 2; // Center horizontally the image
@@ -685,11 +685,11 @@ void OSystem_N64::clearOverlay() {
void OSystem_N64::grabOverlay(void *buf, int pitch) {
int h = _overlayHeight;
- OverlayColor *src = _overlayBuffer;
+ uint16 *src = _overlayBuffer;
byte *dst = (byte *)buf;
do {
- memcpy(dst, src, _overlayWidth * sizeof(OverlayColor));
+ memcpy(dst, src, _overlayWidth * sizeof(uint16));
src += _overlayWidth;
dst += pitch;
} while (--h);
@@ -700,7 +700,7 @@ void OSystem_N64::copyRectToOverlay(const void *buf, int pitch, int x, int y, in
//Clip the coordinates
if (x < 0) {
w += x;
- src -= x * sizeof(OverlayColor);
+ src -= x * sizeof(uint16);
x = 0;
}
@@ -722,13 +722,13 @@ void OSystem_N64::copyRectToOverlay(const void *buf, int pitch, int x, int y, in
return;
- OverlayColor *dst = _overlayBuffer + (y * _overlayWidth + x);
+ uint16 *dst = _overlayBuffer + (y * _overlayWidth + x);
if (_overlayWidth == pitch && pitch == w) {
- memcpy(dst, src, h * w * sizeof(OverlayColor));
+ memcpy(dst, src, h * w * sizeof(uint16));
} else {
do {
- memcpy(dst, src, w * sizeof(OverlayColor));
+ memcpy(dst, src, w * sizeof(uint16));
src += pitch;
dst += _overlayWidth;
} while (--h);