aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Battaglia2010-01-21 09:01:00 +0000
committerFabio Battaglia2010-01-21 09:01:00 +0000
commitd5dfb7ef0a9132ce4041f10c30883a2fb0584963 (patch)
treef0c57b10b6c7aab1fbc4d6ef89d39b5d1e51b040
parent2b929ed96e66647cbad4b07e385afd2b971ea9da (diff)
downloadscummvm-rg350-d5dfb7ef0a9132ce4041f10c30883a2fb0584963.tar.gz
scummvm-rg350-d5dfb7ef0a9132ce4041f10c30883a2fb0584963.tar.bz2
scummvm-rg350-d5dfb7ef0a9132ce4041f10c30883a2fb0584963.zip
N64: optimizations to cursor handling code
svn-id: r47415
-rw-r--r--backends/platform/n64/osys_n64_base.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index 2784bfc235..f2b1603c1f 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -385,7 +385,10 @@ void OSystem_N64::rebuildOffscreenMouseBuffer(void) {
for (height = 0; height < _cursorHeight; height++) {
for (width = 0; width < _cursorWidth; width++) {
- _cursor_hic[(_cursorWidth * height) + width] = _pal_src[_cursor_pal[(_cursorWidth * height) + width]];
+ uint8 pix = _cursor_pal[(_cursorWidth * height) + width];
+
+ // Enable alpha bit in cursor buffer if pixel should be invisible
+ _cursor_hic[(_cursorWidth * height) + width] = (pix != _cursorKeycolor) ? _pal_src[pix] : 0x0001;
}
}
}
@@ -568,9 +571,8 @@ void OSystem_N64::updateScreen() {
// Draw pixel
if (((mY + h) >= 0) && ((mY + h) < _mouseMaxY) && ((mX + w) >= 0) && ((mX + w) < _mouseMaxX)) {
uint16 cursor_pixel_hic = _cursor_hic[(h * _cursorWidth) + w];
- uint8 cursor_pixel_pal = _cursor_pal[(h * _cursorWidth) + w];
- if (cursor_pixel_pal != _cursorKeycolor)
+ if (!(cursor_pixel_hic & 0x00001))
mouse_framebuffer[((mY + h) * _frameBufferWidth) + ((mX + w) + _offscrPixels + horiz_pix_skip)] = cursor_pixel_hic;
}
}