aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorFlorian Kagerer2009-09-11 17:38:36 +0000
committerFlorian Kagerer2009-09-11 17:38:36 +0000
commit68ae279affea27085633b0a2c678627d70434bbe (patch)
treecb7b54e8f64b08eeb64acb6889de097a810c9db7 /engines/kyra
parent75aafd9c337684d707b27456cd98a2e8ecc3507d (diff)
downloadscummvm-rg350-68ae279affea27085633b0a2c678627d70434bbe.tar.gz
scummvm-rg350-68ae279affea27085633b0a2c678627d70434bbe.tar.bz2
scummvm-rg350-68ae279affea27085633b0a2c678627d70434bbe.zip
LOL/Floppy: fixed gfx tables generation
svn-id: r44034
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/lol.cpp4
-rw-r--r--engines/kyra/lol.h2
-rw-r--r--engines/kyra/scene_lol.cpp12
-rw-r--r--engines/kyra/screen_lol.cpp8
-rw-r--r--engines/kyra/screen_lol.h2
5 files changed, 12 insertions, 16 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index c2c9e511a3..257e863548 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -2676,7 +2676,7 @@ int LoLEngine::processMagicFog() {
}
int LoLEngine::processMagicSwarm(int charNum, int damage) {
- loadFxTables();
+ createGfxTables();
int cp = _screen->setCurPage(2);
_screen->copyPage(0, 12);
@@ -2878,7 +2878,7 @@ void LoLEngine::callbackProcessMagicLightning(WSAMovie_v2 *mov, int x, int y) {
}
void LoLEngine::drinkBezelCup(int numUses, int charNum) {
- loadFxTables();
+ createGfxTables();
int cp = _screen->setCurPage(2);
snd_playSoundEffect(73, -1);
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index 8b50cb45da..d62ab7d60c 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -983,7 +983,7 @@ private:
void loadCmzFile(const char *file);
void loadLevelShpDat(const char *shpFile, const char *datFile, bool flag);
void loadLevelGraphics(const char *file, int specialColor, int weight, int vcnLen, int vmpLen, const char *palFile);
- void loadFxTables();
+ void createGfxTables();
void resetItems(int flag);
void disableMonsters();
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index 6c3fda3ece..1d76f43f96 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -385,10 +385,6 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
}
v += 384;
- /*uint8 tmpPal = new uint8[384];
- memcpy(tmpPal, _screen->getPalette(0) + 384, 384);
- memset(_screen->getPalette(0) + 384, 0xff, 384);
- memcpy(_screen->getPalette(0) + 384, tmpPal, 384);*/
if (_currentLevel == 11) {
_screen->loadPalette("SWAMPICE.COL", _screen->getPalette(2));
@@ -448,22 +444,22 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
s->read(_trueLightTable2, 5120);
delete s;
} else {
- loadFxTables();
+ createGfxTables();
}
_loadSuppFilesFlag = 1;
}
-void LoLEngine::loadFxTables() {
+void LoLEngine::createGfxTables() {
if (_flags.isTalkie || _loadSuppFilesFlag)
return;
Palette tpal(768);
_screen->loadPalette("fxpal.col", tpal);
_screen->loadBitmap("fxpal.shp", 3, 3, 0);
- const uint8 *v = _screen->getCPagePtr(2) + 11;
+ const uint8 *shpPal = _screen->getPtrToShape(_screen->getCPagePtr(2), 0) + 11;
- _screen->generateTruelightTables(v, 20, tpal, _screen->getPalette(1), _trueLightTable1, _trueLightTable2, 70);
+ _screen->generateTruelightTables(shpPal, 20, tpal, _screen->getPalette(1), _trueLightTable1, _trueLightTable2, 70);
_loadSuppFilesFlag = 1;
}
diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp
index 6e855f7a7f..240ca40480 100644
--- a/engines/kyra/screen_lol.cpp
+++ b/engines/kyra/screen_lol.cpp
@@ -216,14 +216,14 @@ uint8 *Screen_LoL::generateLevelOverlay(const Palette &srcPal, uint8 *ovl, int o
return ovl;
}
-void Screen_LoL::generateTruelightTables(const uint8 *shp, int a, const Palette &fxPal, const Palette &screenPal, uint8 *outTable1, uint8 *outTable2, int b) {
+void Screen_LoL::generateTruelightTables(const uint8 *ovl, int a, const Palette &fxPal, const Palette &screenPal, uint8 *outTable1, uint8 *outTable2, int b) {
memset(outTable1, 0xff, 256);
for (int i = 0; i < a; i++)
- outTable1[shp[i]] = i;
+ outTable1[ovl[i]] = i;
for (int i = 0; i < a; i++) {
- if (shp[i]) {
+ if (ovl[i]) {
uint8 tcol[3];
uint16 fcol[3];
uint16 scol[3];
@@ -231,7 +231,7 @@ void Screen_LoL::generateTruelightTables(const uint8 *shp, int a, const Palette
int t1 = (b << 6) / 100;
int t2 = 64 - t1;
- uint8 c = shp[i];
+ uint8 c = ovl[i];
fcol[0] = fxPal[3 * c];
fcol[1] = fxPal[3 * c + 1];
fcol[2] = fxPal[3 * c + 2];
diff --git a/engines/kyra/screen_lol.h b/engines/kyra/screen_lol.h
index 2c52213b29..0a300ef8d1 100644
--- a/engines/kyra/screen_lol.h
+++ b/engines/kyra/screen_lol.h
@@ -80,7 +80,7 @@ public:
uint8 *generateLevelOverlay(const Palette &Pal, uint8 *ovl, int opColor, int weight);
uint8 *getLevelOverlay(int index) { return _levelOverlays[index]; }
- void generateTruelightTables(const uint8 *shp, int a, const Palette &fxPal, const Palette &screenPal, uint8 *outTable1, uint8 *outTable2, int b);
+ void generateTruelightTables(const uint8 *ovl, int a, const Palette &fxPal, const Palette &screenPal, 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);