[Scummvm-cvs-logs] SF.net SVN: scummvm:[39709] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Fri Mar 27 20:11:00 CET 2009


Revision: 39709
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39709&view=rev
Author:   buddha_
Date:     2009-03-27 19:11:00 +0000 (Fri, 27 Mar 2009)

Log Message:
-----------
Cine::Palette: Add setGlobalOSystemPalette-method for setting the global OSystem's palette from the Palette object's internal representation.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/pal.cpp
    scummvm/trunk/engines/cine/pal.h

Modified: scummvm/trunk/engines/cine/pal.cpp
===================================================================
--- scummvm/trunk/engines/cine/pal.cpp	2009-03-27 14:12:42 UTC (rev 39708)
+++ scummvm/trunk/engines/cine/pal.cpp	2009-03-27 19:11:00 UTC (rev 39709)
@@ -26,6 +26,7 @@
 #include "cine/cine.h"
 #include "cine/various.h"
 #include "cine/pal.h"
+#include "common/system.h" // For g_system->setPalette
 
 namespace Cine {
 
@@ -229,6 +230,12 @@
 	return _format;
 }
 
+void Palette::setGlobalOSystemPalette() const {
+	byte buf[256 * 4]; // Allocate space for the largest possible palette
+	save(buf, sizeof(buf), Cine::kSystemPalFormat, CINE_LITTLE_ENDIAN);
+	g_system->setPalette(buf, 0, colorCount());
+}
+
 void Palette::setColorFormat(const Graphics::PixelFormat format) {
 	_format = format;
 

Modified: scummvm/trunk/engines/cine/pal.h
===================================================================
--- scummvm/trunk/engines/cine/pal.h	2009-03-27 14:12:42 UTC (rev 39708)
+++ scummvm/trunk/engines/cine/pal.h	2009-03-27 19:11:00 UTC (rev 39709)
@@ -140,6 +140,9 @@
 	/*! \brief The original color format in which this palette was loaded. */
 	Graphics::PixelFormat colorFormat() const;
 
+	/*! \brief Sets current palette to global OSystem's palette using g_system->setPalette. */
+	void setGlobalOSystemPalette() const;
+
 private:
 	void setColorFormat(const Graphics::PixelFormat format);
 	void setEndianType(const EndianType endian);


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