[Scummvm-cvs-logs] SF.net SVN: scummvm:[47286] scummvm/trunk/backends/platform/n64/ osys_n64_base.cpp
Hkz at users.sourceforge.net
Hkz at users.sourceforge.net
Tue Jan 12 22:52:39 CET 2010
Revision: 47286
http://scummvm.svn.sourceforge.net/scummvm/?rev=47286&view=rev
Author: Hkz
Date: 2010-01-12 21:52:38 +0000 (Tue, 12 Jan 2010)
Log Message:
-----------
N64: further commenting/cleanup
Modified Paths:
--------------
scummvm/trunk/backends/platform/n64/osys_n64_base.cpp
Modified: scummvm/trunk/backends/platform/n64/osys_n64_base.cpp
===================================================================
--- scummvm/trunk/backends/platform/n64/osys_n64_base.cpp 2010-01-12 21:49:43 UTC (rev 47285)
+++ scummvm/trunk/backends/platform/n64/osys_n64_base.cpp 2010-01-12 21:52:38 UTC (rev 47286)
@@ -31,7 +31,7 @@
extern uint8 _romfs; // Defined by linker (used to calculate position of romfs image)
-inline uint16 colBGR888toRGB555(byte r, byte g, byte b);
+inline uint16 colRGB888toBGR555(byte r, byte g, byte b);
static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
{ "320x240 (PAL) fix overscan", "340x240 PAL", OVERS_PAL_340X240 },
@@ -343,10 +343,11 @@
void OSystem_N64::setPalette(const byte *colors, uint start, uint num) {
for (int i = 0; i < num; ++i) {
uint8 c[4];
- _screenPalette[start + i] = colBGR888toRGB555(colors[2], colors[1], colors[0]);
+ _screenPalette[start + i] = colRGB888toBGR555(colors[2], colors[1], colors[0]);
colors += 4;
}
+ // If cursor uses the game palette, we need to rebuild the hicolor buffer
if (_cursorPaletteDisabled)
rebuildOffscreenMouseBuffer();
@@ -405,12 +406,13 @@
void OSystem_N64::setCursorPalette(const byte *colors, uint start, uint num) {
for (int i = 0; i < num; ++i) {
- _cursorPalette[start + i] = colBGR888toRGB555(colors[2], colors[1], colors[0]);
+ _cursorPalette[start + i] = colRGB888toBGR555(colors[2], colors[1], colors[0]);
colors += 4;
}
_cursorPaletteDisabled = false;
+ // Rebuild cursor hicolor buffer
rebuildOffscreenMouseBuffer();
_dirtyOffscreen = true;
@@ -419,6 +421,7 @@
void OSystem_N64::disableCursorPalette(bool disable) {
_cursorPaletteDisabled = disable;
+ // Rebuild cursor hicolor buffer
rebuildOffscreenMouseBuffer();
_dirtyOffscreen = true;
@@ -494,6 +497,7 @@
if (_dirtyPalette)
rebuildOffscreenGameBuffer();
+ // Obtain the framebuffer
while (!(_dc = lockDisplay()));
uint16 *overlay_framebuffer = (uint16*)_dc->conf.framebuffer; // Current screen framebuffer
@@ -765,6 +769,7 @@
_cursorKeycolor = keycolor & 0xFF;
+ // Regenerate cursor hicolor buffer
rebuildOffscreenMouseBuffer();
_dirtyOffscreen = true;
@@ -795,6 +800,7 @@
#endif
}
+// As we don't have multi-threading, no need for mutexes
OSystem::MutexRef OSystem_N64::createMutex(void) {
return NULL;
}
@@ -861,7 +867,7 @@
enableAudioPlayback();
}
-inline uint16 colBGR888toRGB555(byte r, byte g, byte b) {
+inline uint16 colRGB888toBGR555(byte r, byte g, byte b) {
return ((r >> 3) << 1) | ((g >> 3) << 6) | ((b >> 3) << 11);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list