diff options
author | Willem Jan Palenstijn | 2013-04-18 23:55:01 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:47:44 +0200 |
commit | 102299630901d08a44ef3aec367fcbcae065b9fe (patch) | |
tree | 98db4bbe0c54176c0a43e2f5076f8b3d63b8065c /backends/platform/n64/osys_n64_base.cpp | |
parent | 583f9abaf98f64895546b75573e9442ca47426e3 (diff) | |
parent | 78ba3210a57094086d44b25d5a8507c33ce9bef3 (diff) | |
download | scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.tar.gz scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.tar.bz2 scummvm-rg350-102299630901d08a44ef3aec367fcbcae065b9fe.zip |
Merge branch 'master'
Diffstat (limited to 'backends/platform/n64/osys_n64_base.cpp')
-rw-r--r-- | backends/platform/n64/osys_n64_base.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index 7d6f8f0b5c..1e2aca9e51 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -100,8 +100,8 @@ OSystem_N64::OSystem_N64() { _cursor_pal = NULL; _cursor_hic = NULL; - _cursorWidth = -1; - _cursorHeight = -1; + _cursorWidth = 0; + _cursorHeight = 0; _cursorKeycolor = -1; _mouseHotspotX = _mouseHotspotY = -1; @@ -575,19 +575,20 @@ void OSystem_N64::updateScreen() { horiz_pix_skip = skip_pixels; } - int mX = _mouseX - _mouseHotspotX; - int mY = _mouseY - _mouseHotspotY; + for (uint h = 0; h < _cursorHeight; h++) { + for (uint w = 0; w < _cursorWidth; w++) { + int posX = (_mouseX - _mouseHotspotX) + w; + int posY = (_mouseY - _mouseHotspotY) + h; - for (int h = 0; h < _cursorHeight; h++) - for (int w = 0; w < _cursorWidth; w++) { // Draw pixel - if (((mY + h) >= 0) && ((mY + h) < _mouseMaxY) && ((mX + w) >= 0) && ((mX + w) < _mouseMaxX)) { + if ((posY >= 0) && (posY < _mouseMaxY) && (posX >= 0) && (posX < _mouseMaxX)) { uint16 cursor_pixel_hic = _cursor_hic[(h * _cursorWidth) + w]; if (!(cursor_pixel_hic & 0x00001)) - mouse_framebuffer[((mY + h) * _frameBufferWidth) + ((mX + w) + _offscrPixels + horiz_pix_skip)] = cursor_pixel_hic; + mouse_framebuffer[(posY * _frameBufferWidth) + (posX + _offscrPixels + horiz_pix_skip)] = cursor_pixel_hic; } } + } } #ifndef _ENABLE_DEBUG_ @@ -724,7 +725,7 @@ void OSystem_N64::copyRectToOverlay(const void *buf, int pitch, int x, int y, in uint16 *dst = _overlayBuffer + (y * _overlayWidth + x); - if (_overlayWidth == w && pitch == _overlayWidth * sizeof(uint16)) { + if (_overlayWidth == (uint16)w && (uint16)pitch == _overlayWidth * sizeof(uint16)) { memcpy(dst, src, h * pitch); } else { do { |