Decreased the dithering LUT's depth to 5 bit per color component.

The results still good and generating it is fast enough to do at each start (so we don't need to save it anymore)

svn-id: r40195
This commit is contained in:
Sven Hesse 2009-04-29 10:24:00 +00:00
parent a8cccd0ced
commit eaf22dc66c
3 changed files with 5 additions and 67 deletions

View File

@ -110,7 +110,7 @@ Video::Video(GobEngine *vm) : _vm(vm) {
_dirtyAll = false;
_palLUT = new Graphics::PaletteLUT(6, Graphics::PaletteLUT::kPaletteYUV);
_palLUT = new Graphics::PaletteLUT(5, Graphics::PaletteLUT::kPaletteYUV);
}
char Video::initDriver(int16 vidMode) {

View File

@ -240,8 +240,6 @@ public:
private:
static const byte _ditherPalette[768];
bool loadPalLUT(const char *target);
bool savePalLUT(const char *target);
void buildPalLUT();
void shadeRect(SurfaceDesc *dest,

View File

@ -61,66 +61,7 @@ void Video_v6::setPrePalette() {
void Video_v6::init(const char *target) {
initOSD();
if (loadPalLUT(target))
return;
buildPalLUT();
savePalLUT(target);
}
bool Video_v6::loadPalLUT(const char *target) {
if (target[0] == '\0')
return false;
char *pltSave = new char[strlen(target) + 5];
strcpy(pltSave, target);
strcat(pltSave, ".plt");
Common::InSaveFile *saveFile;
Common::SaveFileManager *saveMan = g_system->getSavefileManager();
if (!(saveFile = saveMan->openForLoading(pltSave))) {
delete[] pltSave;
return false;
}
drawOSDText("Loading palette table");
bool loaded = _palLUT->load(*saveFile);
delete[] pltSave;
delete saveFile;
return loaded;
}
bool Video_v6::savePalLUT(const char *target) {
if (target[0] == '\0')
return false;
char *pltSave = new char[strlen(target) + 5];
strcpy(pltSave, target);
strcat(pltSave, ".plt");
Common::OutSaveFile *saveFile;
Common::SaveFileManager *saveMan = g_system->getSavefileManager();
if (!(saveFile = saveMan->openForSaving(pltSave))) {
delete[] pltSave;
return false;
}
drawOSDText("Saving palette table");
_palLUT->save(*saveFile);
delete[] pltSave;
delete saveFile;
return true;
}
void Video_v6::buildPalLUT() {
@ -128,12 +69,11 @@ void Video_v6::buildPalLUT() {
_palLUT->setPalette(_ditherPalette, Graphics::PaletteLUT::kPaletteYUV, 8, 0);
for (int i = 0; (i < 64) && !_vm->shouldQuit(); i++) {
sprintf(text, "Building palette table: %02d/63", i);
drawOSDText(text);
sprintf(text, "Building palette table");
drawOSDText(text);
for (int i = 0; (i < 32) && !_vm->shouldQuit(); i++)
_palLUT->buildNext();
_vm->_util->processInput();
}
}
char Video_v6::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,