Browse Source

Created town_pictures.json from townPics.txt.

Frank Zago 14 years ago
parent
commit
0a58d1f2cf
3 changed files with 23 additions and 22 deletions
  1. 6 12
      client/Graphics.cpp
  2. 0 10
      config/townPics.txt
  3. 17 0
      config/town_pictures.json

+ 6 - 12
client/Graphics.cpp

@@ -201,19 +201,13 @@ void Graphics::loadPaletteAndColors()
 		playerColors[i].unused = 0;
 		playerColors[i].unused = 0;
 	}
 	}
 	neutralColor->r = 0x84; neutralColor->g = 0x84; neutralColor->b = 0x84; neutralColor->unused = 0x0;//gray
 	neutralColor->r = 0x84; neutralColor->g = 0x84; neutralColor->b = 0x84; neutralColor->unused = 0x0;//gray
+	const JsonNode config(DATA_DIR "/config/town_pictures.json");
+	BOOST_FOREACH(const JsonNode &p, config["town_pictures"].Vector()) {
 
 
-	std::ifstream tpics(DATA_DIR "/config/townPics.txt");
-	assert(tpics.is_open());
-	while(!tpics.eof())
-	{
-		tpics >> pals;
-		townBgs.push_back(pals);
-		tpics >> pals;
-		guildBgs.push_back(pals);
-		tpics >> pals;
-		buildingPics.push_back(pals);
-	}
-	tpics.close();
+		townBgs.push_back(p["town_background"].String());
+		guildBgs.push_back(p["guild_background"].String());
+		buildingPics.push_back(p["building_picture"].String());
+	}
 }
 }
 
 
 void Graphics::initializeBattleGraphics()
 void Graphics::initializeBattleGraphics()

+ 0 - 10
config/townPics.txt

@@ -1,10 +0,0 @@
-TBCSBACK.bmp	TPMAGECS.bmp	HALLCSTL.DEF
-TBRMBACK.bmp	TPMAGERM.bmp	HALLRAMP.DEF
-TBTWBACK.bmp	TPMAGETW.bmp	HALLTOWR.DEF
-TBINBACK.bmp	TPMAGEIN.bmp	HALLINFR.DEF
-TBNCBACK.bmp	TPMAGENC.bmp	HALLNECR.DEF
-TBDNBACK.bmp	TPMAGEDN.bmp	HALLDUNG.DEF
-TBSTBACK.bmp	TPMAGEST.bmp	HALLSTRN.DEF
-TBFRBACK.bmp	TPMAGEFR.bmp	HALLFORT.DEF	
-TBELBACK.bmp	TPMAGEEL.bmp	HALLELEM.DEF
-

+ 17 - 0
config/town_pictures.json

@@ -0,0 +1,17 @@
+{
+	// Some town pictures, ordered by the town number (0 to 8)
+	//   town_background: background inside the town
+	//   guild_background: background inside the mage guild
+	//   building_picture: picture inside the city hall
+	"town_pictures": [
+		{ "town_background": "TBCSBACK.bmp", "guild_background": "TPMAGECS.bmp", "building_picture": "HALLCSTL.DEF" },
+		{ "town_background": "TBRMBACK.bmp", "guild_background": "TPMAGERM.bmp", "building_picture": "HALLRAMP.DEF" },
+		{ "town_background": "TBTWBACK.bmp", "guild_background": "TPMAGETW.bmp", "building_picture": "HALLTOWR.DEF" },
+		{ "town_background": "TBINBACK.bmp", "guild_background": "TPMAGEIN.bmp", "building_picture": "HALLINFR.DEF" },
+		{ "town_background": "TBNCBACK.bmp", "guild_background": "TPMAGENC.bmp", "building_picture": "HALLNECR.DEF" },
+		{ "town_background": "TBDNBACK.bmp", "guild_background": "TPMAGEDN.bmp", "building_picture": "HALLDUNG.DEF" },
+		{ "town_background": "TBSTBACK.bmp", "guild_background": "TPMAGEST.bmp", "building_picture": "HALLSTRN.DEF" },
+		{ "town_background": "TBFRBACK.bmp", "guild_background": "TPMAGEFR.bmp", "building_picture": "HALLFORT.DEF" },
+		{ "town_background": "TBELBACK.bmp", "guild_background": "TPMAGEEL.bmp", "building_picture": "HALLELEM.DEF" }
+	]
+}