[Scummvm-cvs-logs] SF.net SVN: scummvm:[44034] scummvm/trunk/engines/kyra

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Fri Sep 11 19:38:37 CEST 2009


Revision: 44034
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44034&view=rev
Author:   athrxx
Date:     2009-09-11 17:38:36 +0000 (Fri, 11 Sep 2009)

Log Message:
-----------
LOL/Floppy: fixed gfx tables generation

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/lol.cpp
    scummvm/trunk/engines/kyra/lol.h
    scummvm/trunk/engines/kyra/scene_lol.cpp
    scummvm/trunk/engines/kyra/screen_lol.cpp
    scummvm/trunk/engines/kyra/screen_lol.h

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-09-11 12:58:08 UTC (rev 44033)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-09-11 17:38:36 UTC (rev 44034)
@@ -2676,7 +2676,7 @@
 }
 
 int LoLEngine::processMagicSwarm(int charNum, int damage) {
-	loadFxTables();
+	createGfxTables();
 
 	int cp = _screen->setCurPage(2);
 	_screen->copyPage(0, 12);
@@ -2878,7 +2878,7 @@
 }
 
 void LoLEngine::drinkBezelCup(int numUses, int charNum) {
-	loadFxTables();
+	createGfxTables();
 
 	int cp = _screen->setCurPage(2);
 	snd_playSoundEffect(73, -1);

Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h	2009-09-11 12:58:08 UTC (rev 44033)
+++ scummvm/trunk/engines/kyra/lol.h	2009-09-11 17:38:36 UTC (rev 44034)
@@ -983,7 +983,7 @@
 	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();

Modified: scummvm/trunk/engines/kyra/scene_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lol.cpp	2009-09-11 12:58:08 UTC (rev 44033)
+++ scummvm/trunk/engines/kyra/scene_lol.cpp	2009-09-11 17:38:36 UTC (rev 44034)
@@ -385,10 +385,6 @@
 	}
 
 	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 @@
 		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;
 }

Modified: scummvm/trunk/engines/kyra/screen_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.cpp	2009-09-11 12:58:08 UTC (rev 44033)
+++ scummvm/trunk/engines/kyra/screen_lol.cpp	2009-09-11 17:38:36 UTC (rev 44034)
@@ -216,14 +216,14 @@
 	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 @@
 			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];

Modified: scummvm/trunk/engines/kyra/screen_lol.h
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.h	2009-09-11 12:58:08 UTC (rev 44033)
+++ scummvm/trunk/engines/kyra/screen_lol.h	2009-09-11 17:38:36 UTC (rev 44034)
@@ -80,7 +80,7 @@
 	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);


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