mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-01 08:23:15 +00:00
LOL: - cleanup
svn-id: r45852
This commit is contained in:
parent
13a2b24ab5
commit
e36594dbe9
@ -1758,12 +1758,17 @@ void LoLEngine::createTransparencyTables() {
|
||||
if (_flags.isTalkie || _loadSuppFilesFlag)
|
||||
return;
|
||||
|
||||
Palette tpal(256);
|
||||
if (_flags.use16ColorMode) {
|
||||
static const uint8 colTbl[] = { 0x00, 0x00, 0x11, 0x00, 0x22, 0x00, 0x33, 0x00, 0x44, 0x00, 0x55, 0x00, 0x66, 0x00, 0x77, 0x00, 0x88, 0x00, 0x99, 0x00, 0xAA, 0x00, 0xBB, 0x00, 0xCC, 0x00, 0xDD, 0x00, 0xEE, 0x00, 0xFF, 0x00 };
|
||||
memset(tpal.getData(), 0xff, 768);
|
||||
uint8 *tpal = new uint8[768];
|
||||
|
||||
if (_flags.use16ColorMode) {
|
||||
static const uint8 colTbl[] = {
|
||||
0x00, 0x00, 0x11, 0x00, 0x22, 0x00, 0x33, 0x00, 0x44, 0x00, 0x55, 0x00, 0x66, 0x00, 0x77, 0x00,
|
||||
0x88, 0x00, 0x99, 0x00, 0xAA, 0x00, 0xBB, 0x00, 0xCC, 0x00, 0xDD, 0x00, 0xEE, 0x00, 0xFF, 0x00
|
||||
};
|
||||
|
||||
memset(tpal, 0xff, 768);
|
||||
_res->loadFileToBuf("LOL.NOL", tpal, 48);
|
||||
|
||||
_res->loadFileToBuf("LOL.NOL", tpal.getData(), 48);
|
||||
for (int i = 15; i > -1; i--) {
|
||||
int s = colTbl[i << 1] * 3;
|
||||
tpal[s] = tpal[i * 3];
|
||||
@ -1773,14 +1778,16 @@ void LoLEngine::createTransparencyTables() {
|
||||
}
|
||||
|
||||
_screen->createTransparencyTablesIntern(colTbl, 16, tpal, tpal, _transparencyTable1, _transparencyTable2, 80);
|
||||
|
||||
} else {
|
||||
_screen->loadPalette("fxpal.col", tpal);
|
||||
_res->loadFileToBuf("fxpal.col", tpal, 768);
|
||||
_screen->loadBitmap("fxpal.shp", 3, 3, 0);
|
||||
const uint8 *shpPal = _screen->getPtrToShape(_screen->getCPagePtr(2), 0) + 11;
|
||||
|
||||
_screen->createTransparencyTablesIntern(shpPal, 20, tpal, _screen->getPalette(1), _transparencyTable1, _transparencyTable2, 70);
|
||||
_screen->createTransparencyTablesIntern(shpPal, 20, tpal, _screen->getPalette(1).getData(), _transparencyTable1, _transparencyTable2, 70);
|
||||
}
|
||||
|
||||
delete[] tpal;
|
||||
_loadSuppFilesFlag = 1;
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,10 @@ uint8 *Screen_LoL::generateLevelOverlay(const Palette &srcPal, uint8 *ovl, int o
|
||||
return ovl;
|
||||
}
|
||||
|
||||
void Screen_LoL::createTransparencyTablesIntern(const uint8 *ovl, int a, const Palette &fxPal, const Palette &screenPal, uint8 *outTable1, uint8 *outTable2, int b) {
|
||||
void Screen_LoL::createTransparencyTablesIntern(const uint8 *ovl, int a, const uint8 *fxPal1, const uint8 *fxPal2, uint8 *outTable1, uint8 *outTable2, int b) {
|
||||
Palette screenPal(256);
|
||||
screenPal.copy(fxPal2, 0, 256);
|
||||
|
||||
memset(outTable1, 0xff, 256);
|
||||
|
||||
for (int i = 0; i < a; i++)
|
||||
@ -261,9 +264,9 @@ void Screen_LoL::createTransparencyTablesIntern(const uint8 *ovl, int a, const P
|
||||
uint16 t2 = 64 - t1;
|
||||
|
||||
uint8 c = ovl[i];
|
||||
fcol[0] = fxPal[3 * c];
|
||||
fcol[1] = fxPal[3 * c + 1];
|
||||
fcol[2] = fxPal[3 * c + 2];
|
||||
fcol[0] = fxPal1[3 * c];
|
||||
fcol[1] = fxPal1[3 * c + 1];
|
||||
fcol[2] = fxPal1[3 * c + 2];
|
||||
|
||||
uint8 *o = &outTable2[i << 8];
|
||||
|
||||
|
@ -82,7 +82,7 @@ public:
|
||||
uint8 *generateLevelOverlay(const Palette &Pal, uint8 *ovl, int opColor, int weight);
|
||||
uint8 *getLevelOverlay(int index) { return _levelOverlays[index]; }
|
||||
|
||||
void createTransparencyTablesIntern(const uint8 *ovl, int a, const Palette &fxPal, const Palette &screenPal, uint8 *outTable1, uint8 *outTable2, int b);
|
||||
void createTransparencyTablesIntern(const uint8 *ovl, int a, const uint8 *fxPal1, const uint8 *fxPal2, uint8 *outTable1, uint8 *outTable2, int b);
|
||||
|
||||
void copyBlockAndApplyOverlay(int page1, int x1, int y1, int page2, int x2, int y2, int w, int h, int dim, uint8 *ovl);
|
||||
void applyOverlaySpecial(int page1, int x1, int y1, int page2, int x2, int y2, int w, int h, int dim, int flag, uint8 *ovl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user