Explorar el Código

Reverted r2382; add zvs to the game data (linux); simplified BitmapHandler::loadBitmap().

Frank Zago hace 14 años
padre
commit
0cfb2deeaf
Se han modificado 3 ficheros con 13 adiciones y 14 borrados
  1. 5 3
      build_data.sh
  2. 7 10
      client/CBitmapHandler.cpp
  3. 1 1
      lib/CCreatureSet.cpp

+ 5 - 3
build_data.sh

@@ -19,7 +19,7 @@
 #   data1.cab and data1.hdr from the original 1st CDROM
 #   Heroes3.snd from the original 2nd CDROM
 #   the WoG release v3.58f: allinone_358f.zip
-#   the VCMI distribution: vcmi_085b.rar
+#   the VCMI distribution: vcmi_086.rar
 
 # Usage: put this script and the 4 data files into the same directory
 # and run the script.
@@ -85,6 +85,9 @@ unrar x -o+ ../main4.wog
 #unrar x -o+ ../main8_optional.wog
 #unrar x -o+ ../main9_optional.wog
 
+mkdir -p $DESTDIR/Data/zvs/
+mv data/zvs/Lib1.res $DESTDIR/Data/zvs/
+
 rm -rf picsall Documentation Data data update
 rm -f action.txt h3bitmap.txt H3sprite.txt InstMult.txt
 rm -f ACTION.TXT H3BITMAP.TXT H3SPRITE.TXT INSTMULT.TXT
@@ -109,8 +112,7 @@ rm -rf temp
 mkdir temp
 cd temp
 
-#unzip ../vcmi_085.zip
-unrar ../vcmi_085b.rar
+unzip ../vcmi_086.zip
 
 find . -name "*.dll" | xargs rm -f
 find . -name "*.DLL" | xargs rm -f

+ 7 - 10
client/CBitmapHandler.cpp

@@ -203,15 +203,12 @@ SDL_Surface * BitmapHandler::loadBitmapFromLod(CLodHandler *lod, std::string fna
 
 SDL_Surface * BitmapHandler::loadBitmap(std::string fname, bool setKey)
 {
-	if (bitmaph->haveFile(fname, FILE_GRAPHICS))
-		return loadBitmapFromLod(bitmaph, fname, setKey);
+	SDL_Surface *bitmap;
 
-	if (bitmaph_ab->haveFile(fname, FILE_GRAPHICS))
-		return loadBitmapFromLod(bitmaph_ab, fname, setKey);
+	if (!(bitmap = loadBitmapFromLod(bitmaph, fname, setKey)) &&
+		!(bitmap = loadBitmapFromLod(bitmaph_ab, fname, setKey)) &&
+		!(bitmap = loadBitmapFromLod(spriteh, fname, setKey)))
+		tlog1<<"Failed to find file "<<fname<<"\n";
 
-	if (spriteh->haveFile(fname, FILE_GRAPHICS))
-		return loadBitmapFromLod(spriteh, fname, setKey);
-	
-	tlog1<<"Failed to find file "<<fname<<"\n";
-	return NULL;
-}
+	return bitmap;
+}

+ 1 - 1
lib/CCreatureSet.cpp

@@ -856,7 +856,7 @@ std::string CStackInstance::bonusToGraphics(Bonus *bonus) const
 			fileName = "E_UNIC.bmp"; break;
 	}
 	if(!fileName.empty())
-		fileName = "Data/zvs/Lib1.res/" + fileName;
+		fileName = "zvs/Lib1.res/" + fileName;
 	return fileName;
 }