mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Created battles_graphics.json from battleBack.txt and battleHeroes.txt.
This commit is contained in:
parent
0a58d1f2cf
commit
68090a4ec6
@ -212,27 +212,33 @@ void Graphics::loadPaletteAndColors()
|
|||||||
|
|
||||||
void Graphics::initializeBattleGraphics()
|
void Graphics::initializeBattleGraphics()
|
||||||
{
|
{
|
||||||
std::ifstream bback(DATA_DIR "/config/battleBack.txt");
|
const JsonNode config(DATA_DIR "/config/battles_graphics.json");
|
||||||
battleBacks.resize(26);
|
|
||||||
for(int i=1; i<26; ++i) //25 - number of terrains battle can be fought on
|
// Reserve enough space for the terrains
|
||||||
{
|
// TODO: there should be a method to count the number of elements
|
||||||
int am;
|
int idx = 0;
|
||||||
bback>>am;
|
BOOST_FOREACH(const JsonNode &t, config["backgrounds"].Vector()) {
|
||||||
battleBacks[i].resize(am);
|
idx++;
|
||||||
for(int f=0; f<am; ++f)
|
}
|
||||||
{
|
battleBacks.resize(idx);
|
||||||
bback>>battleBacks[i][f];
|
|
||||||
}
|
idx = 0;
|
||||||
|
BOOST_FOREACH(const JsonNode &t, config["backgrounds"].Vector()) {
|
||||||
|
battleBacks[idx].push_back(t.String());
|
||||||
|
idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//initializing battle hero animation
|
//initializing battle hero animation
|
||||||
std::ifstream bher(DATA_DIR "/config/battleHeroes.txt");
|
idx = 0;
|
||||||
int numberofh;
|
BOOST_FOREACH(const JsonNode &h, config["heroes"].Vector()) {
|
||||||
bher>>numberofh;
|
idx++;
|
||||||
battleHeroes.resize(numberofh);
|
}
|
||||||
for(int i=0; i<numberofh; ++i) //9 - number of terrains battle can be fought on
|
battleHeroes.resize(idx);
|
||||||
{
|
|
||||||
bher>>battleHeroes[i];
|
idx = 0;
|
||||||
|
BOOST_FOREACH(const JsonNode &h, config["heroes"].Vector()) {
|
||||||
|
battleHeroes[idx] = h.String();
|
||||||
|
idx ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//initialization of AC->def name mapping
|
//initialization of AC->def name mapping
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
1 CMBKBCH.BMP
|
|
||||||
1 CMBKDES.BMP
|
|
||||||
1 CMBKDRTR.BMP
|
|
||||||
1 CMBKDRMT.BMP
|
|
||||||
1 CMBKDRDD.BMP
|
|
||||||
1 CMBKGRMT.BMP
|
|
||||||
1 CMBKGRTR.BMP
|
|
||||||
1 CMBKLAVA.BMP
|
|
||||||
1 CMBKMAG.BMP
|
|
||||||
1 CMBKSNMT.BMP
|
|
||||||
1 CMBKSNTR.BMP
|
|
||||||
1 CMBKSUB.BMP
|
|
||||||
1 CMBKSWMP.BMP
|
|
||||||
1 CMBKFF.BMP
|
|
||||||
1 CMBKRK.BMP
|
|
||||||
1 CMBKMC.BMP
|
|
||||||
1 CMBKLP.BMP
|
|
||||||
1 CMBKHG.BMP
|
|
||||||
1 CMBKCF.BMP
|
|
||||||
1 CMBKEF.BMP
|
|
||||||
1 CMBKFW.BMP
|
|
||||||
1 CMBKCUR.BMP
|
|
||||||
1 CMBKRGH.BMP
|
|
||||||
1 CMBKBOAT.BMP
|
|
||||||
1 CMBKDECK.BMP
|
|
@ -1,21 +0,0 @@
|
|||||||
18
|
|
||||||
CH00.DEF
|
|
||||||
CH01.DEF
|
|
||||||
CH02.DEF
|
|
||||||
CH03.DEF
|
|
||||||
CH05.DEF
|
|
||||||
CH04.DEF
|
|
||||||
CH06.DEF
|
|
||||||
CH07.DEF
|
|
||||||
CH08.DEF
|
|
||||||
CH09.DEF
|
|
||||||
CH010.DEF
|
|
||||||
CH11.DEF
|
|
||||||
CH013.DEF
|
|
||||||
CH012.DEF
|
|
||||||
CH014.DEF
|
|
||||||
CH015.DEF
|
|
||||||
CH16.DEF
|
|
||||||
CH17.DEF
|
|
||||||
|
|
||||||
hero animation used in battles, each 2 def represent male and female heroes for each race
|
|
53
config/battles_graphics.json
Normal file
53
config/battles_graphics.json
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
// backgrounds of terrains battles can be fought on
|
||||||
|
"backgrounds": [
|
||||||
|
"CMBKBCH.BMP",
|
||||||
|
"CMBKDES.BMP",
|
||||||
|
"CMBKDRTR.BMP",
|
||||||
|
"CMBKDRMT.BMP",
|
||||||
|
"CMBKDRDD.BMP",
|
||||||
|
"CMBKGRMT.BMP",
|
||||||
|
"CMBKGRTR.BMP",
|
||||||
|
"CMBKLAVA.BMP",
|
||||||
|
"CMBKMAG.BMP",
|
||||||
|
"CMBKSNMT.BMP",
|
||||||
|
"CMBKSNTR.BMP",
|
||||||
|
"CMBKSUB.BMP",
|
||||||
|
"CMBKSWMP.BMP",
|
||||||
|
"CMBKFF.BMP",
|
||||||
|
"CMBKRK.BMP",
|
||||||
|
"CMBKMC.BMP",
|
||||||
|
"CMBKLP.BMP",
|
||||||
|
"CMBKHG.BMP",
|
||||||
|
"CMBKCF.BMP",
|
||||||
|
"CMBKEF.BMP",
|
||||||
|
"CMBKFW.BMP",
|
||||||
|
"CMBKCUR.BMP",
|
||||||
|
"CMBKRGH.BMP",
|
||||||
|
"CMBKBOAT.BMP",
|
||||||
|
"CMBKDECK.BMP"
|
||||||
|
]
|
||||||
|
|
||||||
|
// Hero animation used in battles.
|
||||||
|
// Each 2 def represent male and female heroes for each race
|
||||||
|
"heroes": [
|
||||||
|
"CH00.DEF",
|
||||||
|
"CH01.DEF",
|
||||||
|
"CH02.DEF",
|
||||||
|
"CH03.DEF",
|
||||||
|
"CH05.DEF",
|
||||||
|
"CH04.DEF",
|
||||||
|
"CH06.DEF",
|
||||||
|
"CH07.DEF",
|
||||||
|
"CH08.DEF",
|
||||||
|
"CH09.DEF",
|
||||||
|
"CH010.DEF",
|
||||||
|
"CH11.DEF",
|
||||||
|
"CH013.DEF",
|
||||||
|
"CH012.DEF",
|
||||||
|
"CH014.DEF",
|
||||||
|
"CH015.DEF",
|
||||||
|
"CH16.DEF",
|
||||||
|
"CH17.DEF"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user