2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2006-02-22 22:40:53 +00:00
|
|
|
*
|
2007-05-30 21:56:52 +00:00
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2006-02-22 22:40:53 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "cine/cine.h"
|
2006-02-25 01:18:01 +00:00
|
|
|
#include "cine/various.h"
|
2009-03-11 21:03:09 +00:00
|
|
|
#include "cine/pal.h"
|
2009-03-27 19:11:00 +00:00
|
|
|
#include "common/system.h" // For g_system->setPalette
|
2006-02-22 22:40:53 +00:00
|
|
|
|
2006-02-25 00:26:14 +00:00
|
|
|
namespace Cine {
|
|
|
|
|
2008-08-11 21:45:47 +00:00
|
|
|
Common::Array<PalEntry> palArray;
|
2007-12-14 19:21:19 +00:00
|
|
|
static byte paletteBuffer1[16];
|
|
|
|
static byte paletteBuffer2[16];
|
2006-02-22 22:40:53 +00:00
|
|
|
|
|
|
|
void loadPal(const char *fileName) {
|
|
|
|
char buffer[20];
|
|
|
|
|
|
|
|
removeExtention(buffer, fileName);
|
|
|
|
|
|
|
|
strcat(buffer, ".PAL");
|
2008-08-11 21:45:47 +00:00
|
|
|
palArray.clear();
|
2006-02-22 22:40:53 +00:00
|
|
|
|
2007-05-30 18:43:28 +00:00
|
|
|
Common::File palFileHandle;
|
|
|
|
if (!palFileHandle.open(buffer))
|
|
|
|
error("loadPal(): Cannot open file %s", fileName);
|
2006-02-22 22:40:53 +00:00
|
|
|
|
2009-01-01 15:06:43 +00:00
|
|
|
uint16 palEntriesCount = palFileHandle.readUint16LE();
|
2006-02-27 21:25:59 +00:00
|
|
|
palFileHandle.readUint16LE(); // entry size
|
2007-12-14 19:21:19 +00:00
|
|
|
|
2008-08-11 21:45:47 +00:00
|
|
|
palArray.resize(palEntriesCount);
|
|
|
|
for (uint i = 0; i < palArray.size(); ++i) {
|
|
|
|
palFileHandle.read(palArray[i].name, 10);
|
|
|
|
palFileHandle.read(palArray[i].pal1, 16);
|
|
|
|
palFileHandle.read(palArray[i].pal2, 16);
|
2006-02-27 21:25:59 +00:00
|
|
|
}
|
2007-05-30 18:43:28 +00:00
|
|
|
palFileHandle.close();
|
2006-02-22 22:40:53 +00:00
|
|
|
}
|
|
|
|
|
2006-02-23 09:12:21 +00:00
|
|
|
int16 findPaletteFromName(const char *fileName) {
|
2006-02-22 22:40:53 +00:00
|
|
|
char buffer[10];
|
2006-02-23 09:12:21 +00:00
|
|
|
uint16 position = 0;
|
|
|
|
uint16 i;
|
2006-02-22 22:40:53 +00:00
|
|
|
|
|
|
|
strcpy(buffer, fileName);
|
|
|
|
|
|
|
|
while (position < strlen(fileName)) {
|
|
|
|
if (buffer[position] > 'a' && buffer[position] < 'z') {
|
2006-02-27 21:25:59 +00:00
|
|
|
buffer[position] += 'A' - 'a';
|
2006-02-22 22:40:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
position++;
|
|
|
|
}
|
|
|
|
|
2008-08-11 21:45:47 +00:00
|
|
|
for (i = 0; i < palArray.size(); i++) {
|
|
|
|
if (!strcmp(buffer, palArray[i].name)) {
|
2006-02-22 22:40:53 +00:00
|
|
|
return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void loadRelatedPalette(const char *fileName) {
|
|
|
|
char localName[16];
|
2006-03-23 03:45:52 +00:00
|
|
|
byte i;
|
2006-02-23 09:12:21 +00:00
|
|
|
int16 paletteIndex;
|
2006-02-22 22:40:53 +00:00
|
|
|
|
|
|
|
removeExtention(localName, fileName);
|
|
|
|
|
|
|
|
paletteIndex = findPaletteFromName(localName);
|
|
|
|
|
|
|
|
if (paletteIndex == -1) {
|
2006-02-23 18:47:28 +00:00
|
|
|
for (i = 0; i < 16; i++) { // generate default palette
|
2006-02-22 22:40:53 +00:00
|
|
|
paletteBuffer1[i] = paletteBuffer2[i] = (i << 4) + i;
|
|
|
|
}
|
|
|
|
} else {
|
2008-08-11 21:45:47 +00:00
|
|
|
assert(paletteIndex < (int32)palArray.size());
|
|
|
|
memcpy(paletteBuffer1, palArray[paletteIndex].pal1, 16);
|
|
|
|
memcpy(paletteBuffer2, palArray[paletteIndex].pal2, 16);
|
2006-02-22 22:40:53 +00:00
|
|
|
}
|
|
|
|
}
|
2006-02-25 00:26:14 +00:00
|
|
|
|
2009-09-20 22:59:30 +00:00
|
|
|
namespace {
|
2010-04-21 21:22:43 +00:00
|
|
|
/** Is given endian type big endian? (Handles native endian type too, otherwise this would be trivial). */
|
2009-03-16 21:30:15 +00:00
|
|
|
bool isBigEndian(const EndianType endian) {
|
|
|
|
assert(endian == CINE_NATIVE_ENDIAN || endian == CINE_LITTLE_ENDIAN || endian == CINE_BIG_ENDIAN);
|
2009-03-16 20:24:28 +00:00
|
|
|
|
|
|
|
// Handle explicit little and big endian types here
|
2009-03-16 21:30:15 +00:00
|
|
|
if (endian != CINE_NATIVE_ENDIAN) {
|
|
|
|
return (endian == CINE_BIG_ENDIAN);
|
2009-03-16 20:24:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Handle native endian type here
|
|
|
|
#if defined(SCUMM_BIG_ENDIAN)
|
|
|
|
return true;
|
|
|
|
#elif defined(SCUMM_LITTLE_ENDIAN)
|
|
|
|
return false;
|
|
|
|
#else
|
|
|
|
#error No endianness defined
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2010-04-21 21:22:43 +00:00
|
|
|
/** Calculate byte position of given bit position in a multibyte variable using defined endianness. */
|
2009-03-16 20:24:28 +00:00
|
|
|
int bytePos(const int bitPos, const int numBytes, const bool bigEndian) {
|
|
|
|
if (bigEndian)
|
|
|
|
return (numBytes - 1) - (bitPos / 8);
|
|
|
|
else // little endian
|
|
|
|
return bitPos / 8;
|
|
|
|
}
|
|
|
|
|
2010-04-21 21:22:43 +00:00
|
|
|
/** Calculate the value of "base" to the power of "power". */
|
2009-09-20 22:59:30 +00:00
|
|
|
int power(int base, int power) {
|
|
|
|
int result = 1;
|
|
|
|
while (power--)
|
|
|
|
result *= base;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
} // end of anonymous namespace
|
|
|
|
|
2008-11-20 22:16:18 +00:00
|
|
|
// a.k.a. palRotate
|
2009-06-08 20:46:21 +00:00
|
|
|
Palette &Palette::rotateRight(byte firstIndex, byte lastIndex, signed rotationAmount) {
|
|
|
|
assert(rotationAmount == 0 || rotationAmount == 1);
|
|
|
|
|
|
|
|
if (rotationAmount == 1) {
|
|
|
|
const Color lastColor = _colors[lastIndex];
|
2008-11-20 22:16:18 +00:00
|
|
|
|
2009-06-08 20:46:21 +00:00
|
|
|
for (int i = lastIndex; i > firstIndex; i--)
|
|
|
|
_colors[i] = _colors[i - 1];
|
2008-11-20 22:16:18 +00:00
|
|
|
|
2009-06-08 20:46:21 +00:00
|
|
|
_colors[firstIndex] = lastColor;
|
|
|
|
}
|
2008-11-20 22:16:18 +00:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2009-03-28 16:07:56 +00:00
|
|
|
bool Palette::empty() const {
|
|
|
|
return _colors.empty();
|
|
|
|
}
|
|
|
|
|
2009-03-10 20:37:54 +00:00
|
|
|
uint Palette::colorCount() const {
|
|
|
|
return _colors.size();
|
2008-11-20 22:16:18 +00:00
|
|
|
}
|
|
|
|
|
2009-03-24 21:45:35 +00:00
|
|
|
Palette &Palette::fillWithBlack() {
|
|
|
|
for (uint i = 0; i < _colors.size(); i++) {
|
|
|
|
_colors[i].r = 0;
|
|
|
|
_colors[i].g = 0;
|
|
|
|
_colors[i].b = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2009-03-28 16:07:56 +00:00
|
|
|
// TODO: Add better heuristic for checking whether the color format is valid
|
|
|
|
bool Palette::isValid() const {
|
|
|
|
// Check that the color format has been actually set and not just default constructed.
|
|
|
|
// Also check that the alpha channel is discarded.
|
|
|
|
return _format != Graphics::PixelFormat() && _format.aLoss == 8;
|
|
|
|
}
|
|
|
|
|
2009-04-04 17:57:00 +00:00
|
|
|
const Graphics::PixelFormat &Palette::colorFormat() const {
|
2009-03-11 21:03:09 +00:00
|
|
|
return _format;
|
|
|
|
}
|
|
|
|
|
2009-03-27 19:11:00 +00:00
|
|
|
void Palette::setGlobalOSystemPalette() const {
|
|
|
|
byte buf[256 * 4]; // Allocate space for the largest possible palette
|
2010-04-28 22:24:11 +00:00
|
|
|
// The color format used by OSystem's setPalette-function:
|
|
|
|
static const Graphics::PixelFormat kSystemPalFormat(4, 8, 8, 8, 0, 0, 8, 16, 0);
|
|
|
|
save(buf, sizeof(buf), kSystemPalFormat, CINE_LITTLE_ENDIAN);
|
2009-09-20 23:00:08 +00:00
|
|
|
|
|
|
|
if (g_cine->getPlatform() == Common::kPlatformAmiga && colorCount() == 16) {
|
|
|
|
// The Amiga version of Future Wars does use the upper 16 colors for a darkened
|
|
|
|
// game palette to allow transparent dialog boxes. To support that in our code
|
|
|
|
// we do calculate that palette over here and append it to the screen palette.
|
|
|
|
for (uint i = 0; i < 16 * 4; ++i)
|
|
|
|
buf[16 * 4 + i] = buf[i] >> 1;
|
|
|
|
|
|
|
|
g_system->setPalette(buf, 0, colorCount() * 2);
|
|
|
|
} else {
|
|
|
|
g_system->setPalette(buf, 0, colorCount());
|
|
|
|
}
|
2009-03-27 19:11:00 +00:00
|
|
|
}
|
|
|
|
|
2009-05-24 01:36:25 +00:00
|
|
|
Cine::Palette::Color Palette::getColor(byte index) const {
|
|
|
|
return _colors[index];
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8 Palette::getR(byte index) const {
|
|
|
|
return _colors[index].r;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8 Palette::getG(byte index) const {
|
|
|
|
return _colors[index].g;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8 Palette::getB(byte index) const {
|
|
|
|
return _colors[index].b;
|
|
|
|
}
|
|
|
|
|
2009-03-11 21:11:52 +00:00
|
|
|
void Palette::setColorFormat(const Graphics::PixelFormat format) {
|
|
|
|
_format = format;
|
|
|
|
}
|
|
|
|
|
2008-11-20 22:16:18 +00:00
|
|
|
// a.k.a. transformPaletteRange
|
2010-01-31 18:24:49 +00:00
|
|
|
Palette &Palette::saturatedAddColor(Palette &output, byte firstIndex, byte lastIndex, signed r, signed g, signed b) const {
|
2009-03-10 20:37:54 +00:00
|
|
|
assert(firstIndex < colorCount() && lastIndex < colorCount());
|
2009-03-16 21:10:15 +00:00
|
|
|
assert(firstIndex < output.colorCount() && lastIndex < output.colorCount());
|
|
|
|
assert(output.colorFormat() == colorFormat());
|
2009-03-10 20:37:54 +00:00
|
|
|
|
2010-02-08 20:29:19 +00:00
|
|
|
for (uint i = firstIndex; i <= lastIndex; i++)
|
|
|
|
saturatedAddColor(output._colors[i], _colors[i], r, g, b);
|
2009-03-11 21:05:21 +00:00
|
|
|
|
2009-03-16 21:10:15 +00:00
|
|
|
return output;
|
2008-11-20 22:16:18 +00:00
|
|
|
}
|
|
|
|
|
2010-01-31 18:24:49 +00:00
|
|
|
Palette &Palette::saturatedAddColor(Palette &output, byte firstIndex, byte lastIndex, signed rSource, signed gSource, signed bSource, const Graphics::PixelFormat &sourceFormat) const {
|
2009-04-04 17:57:00 +00:00
|
|
|
// Convert the source color to the internal color format ensuring that no divide by zero will happen
|
2009-06-08 20:46:21 +00:00
|
|
|
const signed r = ((signed) _format.rMax()) * rSource / MAX<int>(sourceFormat.rMax(), 1);
|
|
|
|
const signed g = ((signed) _format.gMax()) * gSource / MAX<int>(sourceFormat.gMax(), 1);
|
|
|
|
const signed b = ((signed) _format.bMax()) * bSource / MAX<int>(sourceFormat.bMax(), 1);
|
2009-04-01 20:55:24 +00:00
|
|
|
|
|
|
|
return saturatedAddColor(output, firstIndex, lastIndex, r, g, b);
|
|
|
|
}
|
|
|
|
|
2010-01-31 18:24:49 +00:00
|
|
|
Palette &Palette::saturatedAddNormalizedGray(Palette &output, byte firstIndex, byte lastIndex, int grayDividend, int grayDenominator) const {
|
2009-03-25 19:52:08 +00:00
|
|
|
assert(grayDenominator != 0);
|
2009-06-08 20:46:21 +00:00
|
|
|
const signed r = ((signed) _format.rMax()) * grayDividend / grayDenominator;
|
|
|
|
const signed g = ((signed) _format.gMax()) * grayDividend / grayDenominator;
|
|
|
|
const signed b = ((signed) _format.bMax()) * grayDividend / grayDenominator;
|
2009-03-24 21:45:35 +00:00
|
|
|
|
|
|
|
return saturatedAddColor(output, firstIndex, lastIndex, r, g, b);
|
|
|
|
}
|
|
|
|
|
2008-11-20 22:16:18 +00:00
|
|
|
// a.k.a. transformColor
|
2010-02-08 20:29:19 +00:00
|
|
|
void Palette::saturatedAddColor(Color &result, const Color &baseColor, signed r, signed g, signed b) const {
|
2009-03-27 20:59:46 +00:00
|
|
|
result.r = CLIP<int>(baseColor.r + r, 0, _format.rMax());
|
|
|
|
result.g = CLIP<int>(baseColor.g + g, 0, _format.gMax());
|
|
|
|
result.b = CLIP<int>(baseColor.b + b, 0, _format.bMax());
|
2009-03-10 20:37:54 +00:00
|
|
|
}
|
2008-11-20 22:16:18 +00:00
|
|
|
|
2009-03-27 21:31:03 +00:00
|
|
|
Palette::Palette(const Graphics::PixelFormat format, const uint numColors) : _format(format), _colors() {
|
|
|
|
_colors.resize(numColors);
|
|
|
|
fillWithBlack();
|
|
|
|
}
|
|
|
|
|
|
|
|
Palette &Palette::clear() {
|
|
|
|
_format = Graphics::PixelFormat();
|
|
|
|
_colors.clear();
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2009-03-16 21:30:15 +00:00
|
|
|
Palette &Palette::load(const byte *buf, const uint size, const Graphics::PixelFormat format, const uint numColors, const EndianType endian) {
|
2009-03-14 22:36:05 +00:00
|
|
|
assert(format.bytesPerPixel * numColors <= size); // Make sure there's enough input space
|
|
|
|
assert(format.aLoss == 8); // No alpha
|
2009-03-27 20:59:46 +00:00
|
|
|
assert(format.rShift / 8 == (format.rShift + MAX<int>(0, format.rBits() - 1)) / 8); // R must be inside one byte
|
|
|
|
assert(format.gShift / 8 == (format.gShift + MAX<int>(0, format.gBits() - 1)) / 8); // G must be inside one byte
|
|
|
|
assert(format.bShift / 8 == (format.bShift + MAX<int>(0, format.bBits() - 1)) / 8); // B must be inside one byte
|
2009-03-10 20:37:54 +00:00
|
|
|
|
2009-03-11 21:11:52 +00:00
|
|
|
setColorFormat(format);
|
2009-03-10 20:37:54 +00:00
|
|
|
|
|
|
|
_colors.clear();
|
2009-03-10 22:09:10 +00:00
|
|
|
_colors.resize(numColors);
|
2009-03-16 20:24:28 +00:00
|
|
|
|
2009-03-16 21:30:15 +00:00
|
|
|
const int rBytePos = bytePos(format.rShift, format.bytesPerPixel, isBigEndian(endian));
|
|
|
|
const int gBytePos = bytePos(format.gShift, format.bytesPerPixel, isBigEndian(endian));
|
|
|
|
const int bBytePos = bytePos(format.bShift, format.bytesPerPixel, isBigEndian(endian));
|
2009-05-24 15:17:42 +00:00
|
|
|
|
2009-03-10 22:09:10 +00:00
|
|
|
for (uint i = 0; i < numColors; i++) {
|
2009-03-27 20:59:46 +00:00
|
|
|
// format.rMax(), format.gMax(), format.bMax() are also used as masks here
|
|
|
|
_colors[i].r = (buf[i * format.bytesPerPixel + rBytePos] >> (format.rShift % 8)) & format.rMax();
|
|
|
|
_colors[i].g = (buf[i * format.bytesPerPixel + gBytePos] >> (format.gShift % 8)) & format.gMax();
|
|
|
|
_colors[i].b = (buf[i * format.bytesPerPixel + bBytePos] >> (format.bShift % 8)) & format.bMax();
|
2008-11-20 22:16:18 +00:00
|
|
|
}
|
|
|
|
|
2009-03-10 20:37:54 +00:00
|
|
|
return *this;
|
2008-11-20 22:22:47 +00:00
|
|
|
}
|
|
|
|
|
2009-03-16 21:30:15 +00:00
|
|
|
byte *Palette::save(byte *buf, const uint size, const EndianType endian) const {
|
|
|
|
return save(buf, size, colorFormat(), colorCount(), endian);
|
2009-03-14 22:36:05 +00:00
|
|
|
}
|
|
|
|
|
2009-03-16 21:30:15 +00:00
|
|
|
byte *Palette::save(byte *buf, const uint size, const Graphics::PixelFormat format, const EndianType endian) const {
|
|
|
|
return save(buf, size, format, colorCount(), endian);
|
2009-03-14 22:36:05 +00:00
|
|
|
}
|
|
|
|
|
2009-03-16 21:30:15 +00:00
|
|
|
byte *Palette::save(byte *buf, const uint size, const Graphics::PixelFormat format, const uint numColors, const EndianType endian, const byte firstIndex) const {
|
2009-03-14 22:36:05 +00:00
|
|
|
assert(format.bytesPerPixel * numColors <= size); // Make sure there's enough output space
|
|
|
|
assert(format.aLoss == 8); // No alpha
|
2009-03-27 20:59:46 +00:00
|
|
|
assert(format.rShift / 8 == (format.rShift + MAX<int>(0, format.rBits() - 1)) / 8); // R must be inside one byte
|
|
|
|
assert(format.gShift / 8 == (format.gShift + MAX<int>(0, format.gBits() - 1)) / 8); // G must be inside one byte
|
|
|
|
assert(format.bShift / 8 == (format.bShift + MAX<int>(0, format.bBits() - 1)) / 8); // B must be inside one byte
|
2009-03-11 20:44:16 +00:00
|
|
|
|
|
|
|
// Clear the part of the output palette we're going to be writing to with all black
|
2009-03-14 22:36:05 +00:00
|
|
|
memset(buf, 0, format.bytesPerPixel * numColors);
|
|
|
|
|
2009-09-20 22:59:30 +00:00
|
|
|
// Calculate original R/G/B max values
|
|
|
|
const int rOrigMax = power(2, 8 - colorFormat().rLoss) - 1;
|
|
|
|
const int gOrigMax = power(2, 8 - colorFormat().gLoss) - 1;
|
|
|
|
const int bOrigMax = power(2, 8 - colorFormat().bLoss) - 1;
|
2009-03-14 22:36:05 +00:00
|
|
|
|
2009-09-20 22:59:30 +00:00
|
|
|
// Calculate new R/G/B max values
|
|
|
|
const int rNewMax = power(2, 8 - format.rLoss) - 1;
|
|
|
|
const int gNewMax = power(2, 8 - format.gLoss) - 1;
|
|
|
|
const int bNewMax = power(2, 8 - format.bLoss) - 1;
|
2009-03-11 20:44:16 +00:00
|
|
|
|
2009-09-20 22:59:30 +00:00
|
|
|
// Calculate the byte position
|
2009-03-16 21:30:15 +00:00
|
|
|
const int rBytePos = bytePos(format.rShift, format.bytesPerPixel, isBigEndian(endian));
|
|
|
|
const int gBytePos = bytePos(format.gShift, format.bytesPerPixel, isBigEndian(endian));
|
|
|
|
const int bBytePos = bytePos(format.bShift, format.bytesPerPixel, isBigEndian(endian));
|
2009-03-16 20:24:28 +00:00
|
|
|
|
2009-03-11 20:44:16 +00:00
|
|
|
// Save the palette to the output in the specified format
|
2009-03-14 22:36:05 +00:00
|
|
|
for (uint i = firstIndex; i < firstIndex + numColors; i++) {
|
2009-09-20 22:59:30 +00:00
|
|
|
const uint r = (_colors[i].r * rNewMax) / rOrigMax;
|
|
|
|
const uint g = (_colors[i].g * gNewMax) / gOrigMax;
|
|
|
|
const uint b = (_colors[i].b * bNewMax) / bOrigMax;
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-09-20 22:59:30 +00:00
|
|
|
buf[i * format.bytesPerPixel + rBytePos] |= r << (format.rShift % 8);
|
|
|
|
buf[i * format.bytesPerPixel + gBytePos] |= g << (format.gShift % 8);
|
|
|
|
buf[i * format.bytesPerPixel + bBytePos] |= b << (format.bShift % 8);
|
2009-03-11 20:44:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Return the pointer to the output palette
|
2009-03-14 22:36:05 +00:00
|
|
|
return buf;
|
2009-03-11 21:03:09 +00:00
|
|
|
}
|
|
|
|
|
2006-02-25 00:26:14 +00:00
|
|
|
} // End of namespace Cine
|