mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Created creature_backgrounds.json from cr_bgs.txt.
This commit is contained in:
parent
6826826e87
commit
21f72c61b1
@ -9,7 +9,7 @@
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/assign/std/vector.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include "../CThreadHelper.h"
|
||||
#include "CGameInfo.h"
|
||||
#include "../lib/CLodHandler.h"
|
||||
@ -323,15 +323,11 @@ Graphics::Graphics()
|
||||
tasks += GET_DEF_ESS(spellscr,"SPELLSCR.DEF");
|
||||
tasks += GET_DEF_ESS(heroMoveArrows,"ADAG.DEF");
|
||||
|
||||
std::ifstream ifs(DATA_DIR "/config/cr_bgs.txt");
|
||||
int id;
|
||||
std::string name;
|
||||
while(!ifs.eof())
|
||||
{
|
||||
ifs >> id >> name;
|
||||
tasks += GET_SURFACE(backgrounds[id],name);
|
||||
name.replace(0,5,"TPCAS");
|
||||
tasks += GET_SURFACE(backgroundsm[id],name);
|
||||
const JsonNode config(DATA_DIR "/config/creature_backgrounds.json");
|
||||
BOOST_FOREACH(const JsonNode &b, config["backgrounds"].Vector()) {
|
||||
const int id = b["id"].Float();
|
||||
tasks += GET_SURFACE(backgrounds[id], b["bg130"].String());
|
||||
tasks += GET_SURFACE(backgroundsm[id], b["bg120"].String());
|
||||
}
|
||||
|
||||
CThreadHelper th(&tasks,std::max((unsigned int)1,boost::thread::hardware_concurrency()));
|
||||
|
@ -1,10 +0,0 @@
|
||||
0 CRBKGCAS.bmp
|
||||
5 CRBKGDUN.bmp
|
||||
8 CRBKGELE.bmp
|
||||
1 CRBKGRAM.bmp
|
||||
2 CRBKGTOW.bmp
|
||||
3 CRBKGINF.bmp
|
||||
4 CRBKGNEC.bmp
|
||||
6 CRBKGSTR.bmp
|
||||
7 CRBKGFOR.bmp
|
||||
-1 CRBKGNEU.bmp
|
19
config/creature_backgrounds.json
Normal file
19
config/creature_backgrounds.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
// Backgrounds for creatures.
|
||||
// id: town ID (0 to 8, -1 is neutral)
|
||||
// bg120: 100x120 background creature image
|
||||
// bg130: 100x130 background creature image
|
||||
|
||||
"backgrounds": [
|
||||
{ "id": -1, "bg120": "TPCASNEU.bmp", "bg130": "CRBKGNEU.bmp" },
|
||||
{ "id": 0, "bg120": "TPCASCAS.bmp", "bg130": "CRBKGCAS.bmp" },
|
||||
{ "id": 1, "bg120": "TPCASRAM.bmp", "bg130": "CRBKGRAM.bmp" },
|
||||
{ "id": 2, "bg120": "TPCASTOW.bmp", "bg130": "CRBKGTOW.bmp" },
|
||||
{ "id": 3, "bg120": "TPCASINF.bmp", "bg130": "CRBKGINF.bmp" },
|
||||
{ "id": 4, "bg120": "TPCASNEC.bmp", "bg130": "CRBKGNEC.bmp" },
|
||||
{ "id": 5, "bg120": "TPCASDUN.bmp", "bg130": "CRBKGDUN.bmp" },
|
||||
{ "id": 6, "bg120": "TPCASSTR.bmp", "bg130": "CRBKGSTR.bmp" },
|
||||
{ "id": 7, "bg120": "TPCASFOR.bmp", "bg130": "CRBKGFOR.bmp" },
|
||||
{ "id": 8, "bg120": "TPCASELE.bmp", "bg130": "CRBKGELE.bmp" }
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user