mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Convert hero portraits config file to json.
This commit is contained in:
parent
233ce7d6e3
commit
81e50c9f2b
@ -23,6 +23,7 @@
|
||||
#include "../lib/CObjectHandler.h"
|
||||
#include "../lib/CDefObjInfoHandler.h"
|
||||
#include "../lib/CGameState.h"
|
||||
#include "../lib/JsonNode.h"
|
||||
|
||||
using namespace boost::assign;
|
||||
using namespace CSDL_Ext;
|
||||
@ -357,29 +358,30 @@ Graphics::Graphics()
|
||||
}
|
||||
void Graphics::loadHeroPortraits()
|
||||
{
|
||||
std::ifstream of(DATA_DIR "/config/portrety.txt");
|
||||
int numberOfPortraits;
|
||||
of>>numberOfPortraits;
|
||||
for (int j=0; j<numberOfPortraits; j++)
|
||||
{
|
||||
int ID;
|
||||
of>>ID;
|
||||
std::string path;
|
||||
of>>path;
|
||||
portraitSmall.push_back(BitmapHandler::loadBitmap(path));
|
||||
for(size_t ff=0; ff<path.size(); ++ff) //size letter is usually third one, but there are exceptions an it should fix the problem
|
||||
const JsonNode config(DATA_DIR "/config/portraits.json");
|
||||
const JsonVector &portraits_vec = config["hero_portrait"].Vector();
|
||||
|
||||
for (JsonVector::const_iterator it = portraits_vec.begin(); it!=portraits_vec.end(); ++it) {
|
||||
const JsonNode &portrait_node = *it;
|
||||
std::string filename = portrait_node["filename"].String();
|
||||
|
||||
/* Small portrait. */
|
||||
portraitSmall.push_back(BitmapHandler::loadBitmap(filename));
|
||||
|
||||
/* Large portrait. Alter the filename. Size letter is usually
|
||||
* third one, but there are exceptions and it should fix the
|
||||
* problem. */
|
||||
for (int ff=0; ff<filename.size(); ++ff)
|
||||
{
|
||||
if(path[ff]=='S')
|
||||
{
|
||||
path[ff]='L';
|
||||
if (filename[ff]=='S') {
|
||||
filename[ff]='L';
|
||||
break;
|
||||
}
|
||||
}
|
||||
portraitLarge.push_back(BitmapHandler::loadBitmap(path));
|
||||
SDL_SetColorKey(portraitLarge[portraitLarge.size()-1],SDL_SRCCOLORKEY,SDL_MapRGB(portraitLarge[portraitLarge.size()-1]->format,0,255,255));
|
||||
portraitLarge.push_back(BitmapHandler::loadBitmap(filename));
|
||||
|
||||
SDL_SetColorKey(portraitLarge[portraitLarge.size()-1],SDL_SRCCOLORKEY,SDL_MapRGB(portraitLarge[portraitLarge.size()-1]->format,0,255,255));
|
||||
}
|
||||
of.close();
|
||||
}
|
||||
|
||||
void Graphics::loadWallPositions()
|
||||
|
169
config/portraits.json
Normal file
169
config/portraits.json
Normal file
@ -0,0 +1,169 @@
|
||||
// Heroes portraits
|
||||
{
|
||||
"hero_portrait" :
|
||||
[
|
||||
{ "id": 0, "filename": "HPS000KN.bmp" },
|
||||
{ "id": 1, "filename": "HPS001KN.bmp" },
|
||||
{ "id": 2, "filename": "HPS002KN.bmp" },
|
||||
{ "id": 3, "filename": "HPS003KN.bmp" },
|
||||
{ "id": 4, "filename": "HPS004KN.bmp" },
|
||||
{ "id": 5, "filename": "HPS005KN.bmp" },
|
||||
{ "id": 6, "filename": "HPS006KN.bmp" },
|
||||
{ "id": 7, "filename": "HPS007KN.bmp" },
|
||||
{ "id": 8, "filename": "HPS008CL.bmp" },
|
||||
{ "id": 9, "filename": "HPS009CL.bmp" },
|
||||
{ "id": 10, "filename": "HPS010CL.bmp" },
|
||||
{ "id": 11, "filename": "HPS011CL.bmp" },
|
||||
{ "id": 12, "filename": "HPS012CL.bmp" },
|
||||
{ "id": 13, "filename": "HPS013CL.bmp" },
|
||||
{ "id": 14, "filename": "HPS014CL.bmp" },
|
||||
{ "id": 15, "filename": "HPS015CL.bmp" },
|
||||
{ "id": 16, "filename": "HPS016RN.bmp" },
|
||||
{ "id": 17, "filename": "HPS017RN.bmp" },
|
||||
{ "id": 18, "filename": "HPS018RN.bmp" },
|
||||
{ "id": 19, "filename": "HPS019RN.bmp" },
|
||||
{ "id": 20, "filename": "HPS020RN.bmp" },
|
||||
{ "id": 21, "filename": "HPS021RN.bmp" },
|
||||
{ "id": 22, "filename": "HPS022RN.bmp" },
|
||||
{ "id": 23, "filename": "HPS023RN.bmp" },
|
||||
{ "id": 24, "filename": "HPS024DR.bmp" },
|
||||
{ "id": 25, "filename": "HPS025DR.bmp" },
|
||||
{ "id": 26, "filename": "HPS026DR.bmp" },
|
||||
{ "id": 27, "filename": "HPS027DR.bmp" },
|
||||
{ "id": 28, "filename": "HPS028DR.bmp" },
|
||||
{ "id": 29, "filename": "HPS029DR.bmp" },
|
||||
{ "id": 30, "filename": "HPS030DR.bmp" },
|
||||
{ "id": 31, "filename": "HPS031DR.bmp" },
|
||||
{ "id": 32, "filename": "HPS032AL.bmp" },
|
||||
{ "id": 33, "filename": "HPS033AL.bmp" },
|
||||
{ "id": 34, "filename": "HPS034AL.bmp" },
|
||||
{ "id": 35, "filename": "HPS035AL.bmp" },
|
||||
{ "id": 36, "filename": "HPS036AL.bmp" },
|
||||
{ "id": 37, "filename": "HPS037AL.bmp" },
|
||||
{ "id": 38, "filename": "HPS038AL.bmp" },
|
||||
{ "id": 39, "filename": "HPS039AL.bmp" },
|
||||
{ "id": 40, "filename": "HPS040WZ.bmp" },
|
||||
{ "id": 41, "filename": "HPS041WZ.bmp" },
|
||||
{ "id": 42, "filename": "HPS042WZ.bmp" },
|
||||
{ "id": 43, "filename": "HPS043WZ.bmp" },
|
||||
{ "id": 44, "filename": "HPS044WZ.bmp" },
|
||||
{ "id": 45, "filename": "HPS045WZ.bmp" },
|
||||
{ "id": 46, "filename": "HPS046WZ.bmp" },
|
||||
{ "id": 47, "filename": "HPS047WZ.bmp" },
|
||||
{ "id": 48, "filename": "HPS048HR.bmp" },
|
||||
{ "id": 49, "filename": "HPS049HR.bmp" },
|
||||
{ "id": 50, "filename": "HPS050HR.bmp" },
|
||||
{ "id": 51, "filename": "HPS051HR.bmp" },
|
||||
{ "id": 52, "filename": "HPS052HR.bmp" },
|
||||
{ "id": 53, "filename": "HPS053HR.bmp" },
|
||||
{ "id": 54, "filename": "HPS054HR.bmp" },
|
||||
{ "id": 55, "filename": "HPS055HR.bmp" },
|
||||
{ "id": 56, "filename": "HPS056DM.bmp" },
|
||||
{ "id": 57, "filename": "HPS057DM.bmp" },
|
||||
{ "id": 58, "filename": "HPS058DM.bmp" },
|
||||
{ "id": 59, "filename": "HPS059DM.bmp" },
|
||||
{ "id": 60, "filename": "HPS060DM.bmp" },
|
||||
{ "id": 61, "filename": "HPS061DM.bmp" },
|
||||
{ "id": 62, "filename": "HPS062DM.bmp" },
|
||||
{ "id": 63, "filename": "HPS063DM.bmp" },
|
||||
{ "id": 64, "filename": "HPS064DK.bmp" },
|
||||
{ "id": 65, "filename": "HPS065DK.bmp" },
|
||||
{ "id": 66, "filename": "HPS066DK.bmp" },
|
||||
{ "id": 67, "filename": "HPS067DK.bmp" },
|
||||
{ "id": 68, "filename": "HPS068DK.bmp" },
|
||||
{ "id": 69, "filename": "HPS069DK.bmp" },
|
||||
{ "id": 70, "filename": "HPS070DK.bmp" },
|
||||
{ "id": 71, "filename": "HPS071DK.bmp" },
|
||||
{ "id": 72, "filename": "HPS072NC.bmp" },
|
||||
{ "id": 73, "filename": "HPS073NC.bmp" },
|
||||
{ "id": 74, "filename": "HPS074NC.bmp" },
|
||||
{ "id": 75, "filename": "HPS075NC.bmp" },
|
||||
{ "id": 76, "filename": "HPS076NC.bmp" },
|
||||
{ "id": 77, "filename": "HPS077NC.bmp" },
|
||||
{ "id": 78, "filename": "HPS078NC.bmp" },
|
||||
{ "id": 79, "filename": "HPS079NC.bmp" },
|
||||
{ "id": 80, "filename": "HPS080OV.bmp" },
|
||||
{ "id": 81, "filename": "HPS081OV.bmp" },
|
||||
{ "id": 82, "filename": "HPS082OV.bmp" },
|
||||
{ "id": 83, "filename": "HPS083OV.bmp" },
|
||||
{ "id": 84, "filename": "HPS084OV.bmp" },
|
||||
{ "id": 85, "filename": "HPS085OV.bmp" },
|
||||
{ "id": 86, "filename": "HPS086OV.bmp" },
|
||||
{ "id": 87, "filename": "HPS087OV.bmp" },
|
||||
{ "id": 88, "filename": "HPS088WL.bmp" },
|
||||
{ "id": 89, "filename": "HPS089WL.bmp" },
|
||||
{ "id": 90, "filename": "HPS090WL.bmp" },
|
||||
{ "id": 91, "filename": "HPS091WL.bmp" },
|
||||
{ "id": 92, "filename": "HPS092WL.bmp" },
|
||||
{ "id": 93, "filename": "HPS093WL.bmp" },
|
||||
{ "id": 94, "filename": "HPS094WL.bmp" },
|
||||
{ "id": 95, "filename": "HPS095WL.bmp" },
|
||||
{ "id": 96, "filename": "HPS096BR.bmp" },
|
||||
{ "id": 97, "filename": "HPS097BR.bmp" },
|
||||
{ "id": 98, "filename": "HPS098BR.bmp" },
|
||||
{ "id": 99, "filename": "HPS099BR.bmp" },
|
||||
{ "id": 100, "filename": "HPS100BR.bmp" },
|
||||
{ "id": 101, "filename": "HPS101BR.bmp" },
|
||||
{ "id": 102, "filename": "HPS102BR.bmp" },
|
||||
{ "id": 103, "filename": "HPS103BR.bmp" },
|
||||
{ "id": 104, "filename": "HPS104BM.bmp" },
|
||||
{ "id": 105, "filename": "HPS105BM.bmp" },
|
||||
{ "id": 106, "filename": "HPS106BM.bmp" },
|
||||
{ "id": 107, "filename": "HPS107BM.bmp" },
|
||||
{ "id": 108, "filename": "HPS108BM.bmp" },
|
||||
{ "id": 109, "filename": "HPS109BM.bmp" },
|
||||
{ "id": 110, "filename": "HPS110BM.bmp" },
|
||||
{ "id": 111, "filename": "HPS111BM.bmp" },
|
||||
{ "id": 112, "filename": "HPS112BS.bmp" },
|
||||
{ "id": 113, "filename": "HPS113BS.bmp" },
|
||||
{ "id": 114, "filename": "HPS114BS.bmp" },
|
||||
{ "id": 115, "filename": "HPS115BS.bmp" },
|
||||
{ "id": 116, "filename": "HPS116BS.bmp" },
|
||||
{ "id": 117, "filename": "HPS117BS.bmp" },
|
||||
{ "id": 118, "filename": "HPS118BS.bmp" },
|
||||
{ "id": 119, "filename": "HPS119BS.bmp" },
|
||||
{ "id": 120, "filename": "HPS120WH.bmp" },
|
||||
{ "id": 121, "filename": "HPS121WH.bmp" },
|
||||
{ "id": 122, "filename": "HPS122WH.bmp" },
|
||||
{ "id": 123, "filename": "HPS123WH.bmp" },
|
||||
{ "id": 124, "filename": "HPS124WH.bmp" },
|
||||
{ "id": 125, "filename": "HPS125WH.bmp" },
|
||||
{ "id": 126, "filename": "HPS126WH.bmp" },
|
||||
{ "id": 127, "filename": "HPS127WH.bmp" },
|
||||
{ "id": 128, "filename": "HPS000PL.bmp" },
|
||||
{ "id": 129, "filename": "HPS001PL.bmp" },
|
||||
{ "id": 130, "filename": "HPS002PL.bmp" },
|
||||
{ "id": 131, "filename": "HPS003PL.bmp" },
|
||||
{ "id": 132, "filename": "HPS004PL.bmp" },
|
||||
{ "id": 133, "filename": "HPS005PL.bmp" },
|
||||
{ "id": 134, "filename": "HPS006PL.bmp" },
|
||||
{ "id": 135, "filename": "HPS007PL.bmp" },
|
||||
{ "id": 136, "filename": "HPS000EL.bmp" },
|
||||
{ "id": 137, "filename": "HPS001EL.bmp" },
|
||||
{ "id": 138, "filename": "HPS002EL.bmp" },
|
||||
{ "id": 139, "filename": "HPS003EL.bmp" },
|
||||
{ "id": 140, "filename": "HPS004EL.bmp" },
|
||||
{ "id": 141, "filename": "HPS005EL.bmp" },
|
||||
{ "id": 142, "filename": "HPS006EL.bmp" },
|
||||
{ "id": 143, "filename": "HPS007EL.bmp" },
|
||||
{ "id": 144, "filename": "HPS130KN.bmp" },
|
||||
{ "id": 145, "filename": "HPS000SH.bmp" },
|
||||
{ "id": 146, "filename": "HPS128QC.bmp" },
|
||||
{ "id": 147, "filename": "HPS003SH.bmp" },
|
||||
{ "id": 148, "filename": "HPS004SH.bmp" },
|
||||
{ "id": 149, "filename": "HPS005SH.bmp" },
|
||||
{ "id": 150, "filename": "HPS006SH.bmp" },
|
||||
{ "id": 151, "filename": "HPS007SH.bmp" },
|
||||
{ "id": 152, "filename": "HPS009SH.bmp" },
|
||||
{ "id": 153, "filename": "HPS008SH.bmp" },
|
||||
{ "id": 154, "filename": "HPS001SH.bmp" },
|
||||
{ "id": 155, "filename": "HPS131DM.bmp" },
|
||||
{ "id": 156, "filename": "HPS129MK.bmp" },
|
||||
{ "id": 157, "filename": "HPS002SH.bmp" },
|
||||
{ "id": 158, "filename": "HPS132Wl.bmp" },
|
||||
{ "id": 159, "filename": "HPS133Nc.bmp" },
|
||||
{ "id": 160, "filename": "HPS134Nc.bmp" },
|
||||
{ "id": 161, "filename": "HPS135Wi.bmp" },
|
||||
{ "id": 162, "filename": "HPS136Wi.bmp" }
|
||||
]
|
||||
}
|
@ -1,164 +0,0 @@
|
||||
163
|
||||
0 HPS000KN.bmp
|
||||
1 HPS001KN.bmp
|
||||
2 HPS002KN.bmp
|
||||
3 HPS003KN.bmp
|
||||
4 HPS004KN.bmp
|
||||
5 HPS005KN.bmp
|
||||
6 HPS006KN.bmp
|
||||
7 HPS007KN.bmp
|
||||
8 HPS008CL.bmp
|
||||
9 HPS009CL.bmp
|
||||
10 HPS010CL.bmp
|
||||
11 HPS011CL.bmp
|
||||
12 HPS012CL.bmp
|
||||
13 HPS013CL.bmp
|
||||
14 HPS014CL.bmp
|
||||
15 HPS015CL.bmp
|
||||
16 HPS016RN.bmp
|
||||
17 HPS017RN.bmp
|
||||
18 HPS018RN.bmp
|
||||
19 HPS019RN.bmp
|
||||
20 HPS020RN.bmp
|
||||
21 HPS021RN.bmp
|
||||
22 HPS022RN.bmp
|
||||
23 HPS023RN.bmp
|
||||
24 HPS024DR.bmp
|
||||
25 HPS025DR.bmp
|
||||
26 HPS026DR.bmp
|
||||
27 HPS027DR.bmp
|
||||
28 HPS028DR.bmp
|
||||
29 HPS029DR.bmp
|
||||
30 HPS030DR.bmp
|
||||
31 HPS031DR.bmp
|
||||
32 HPS032AL.bmp
|
||||
33 HPS033AL.bmp
|
||||
34 HPS034AL.bmp
|
||||
35 HPS035AL.bmp
|
||||
36 HPS036AL.bmp
|
||||
37 HPS037AL.bmp
|
||||
38 HPS038AL.bmp
|
||||
39 HPS039AL.bmp
|
||||
40 HPS040WZ.bmp
|
||||
41 HPS041WZ.bmp
|
||||
42 HPS042WZ.bmp
|
||||
43 HPS043WZ.bmp
|
||||
44 HPS044WZ.bmp
|
||||
45 HPS045WZ.bmp
|
||||
46 HPS046WZ.bmp
|
||||
47 HPS047WZ.bmp
|
||||
48 HPS048HR.bmp
|
||||
49 HPS049HR.bmp
|
||||
50 HPS050HR.bmp
|
||||
51 HPS051HR.bmp
|
||||
52 HPS052HR.bmp
|
||||
53 HPS053HR.bmp
|
||||
54 HPS054HR.bmp
|
||||
55 HPS055HR.bmp
|
||||
56 HPS056DM.bmp
|
||||
57 HPS057DM.bmp
|
||||
58 HPS058DM.bmp
|
||||
59 HPS059DM.bmp
|
||||
60 HPS060DM.bmp
|
||||
61 HPS061DM.bmp
|
||||
62 HPS062DM.bmp
|
||||
63 HPS063DM.bmp
|
||||
64 HPS064DK.bmp
|
||||
65 HPS065DK.bmp
|
||||
66 HPS066DK.bmp
|
||||
67 HPS067DK.bmp
|
||||
68 HPS068DK.bmp
|
||||
69 HPS069DK.bmp
|
||||
70 HPS070DK.bmp
|
||||
71 HPS071DK.bmp
|
||||
72 HPS072NC.bmp
|
||||
73 HPS073NC.bmp
|
||||
74 HPS074NC.bmp
|
||||
75 HPS075NC.bmp
|
||||
76 HPS076NC.bmp
|
||||
77 HPS077NC.bmp
|
||||
78 HPS078NC.bmp
|
||||
79 HPS079NC.bmp
|
||||
80 HPS080OV.bmp
|
||||
81 HPS081OV.bmp
|
||||
82 HPS082OV.bmp
|
||||
83 HPS083OV.bmp
|
||||
84 HPS084OV.bmp
|
||||
85 HPS085OV.bmp
|
||||
86 HPS086OV.bmp
|
||||
87 HPS087OV.bmp
|
||||
88 HPS088WL.bmp
|
||||
89 HPS089WL.bmp
|
||||
90 HPS090WL.bmp
|
||||
91 HPS091WL.bmp
|
||||
92 HPS092WL.bmp
|
||||
93 HPS093WL.bmp
|
||||
94 HPS094WL.bmp
|
||||
95 HPS095WL.bmp
|
||||
96 HPS096BR.bmp
|
||||
97 HPS097BR.bmp
|
||||
98 HPS098BR.bmp
|
||||
99 HPS099BR.bmp
|
||||
100 HPS100BR.bmp
|
||||
101 HPS101BR.bmp
|
||||
102 HPS102BR.bmp
|
||||
103 HPS103BR.bmp
|
||||
104 HPS104BM.bmp
|
||||
105 HPS105BM.bmp
|
||||
106 HPS106BM.bmp
|
||||
107 HPS107BM.bmp
|
||||
108 HPS108BM.bmp
|
||||
109 HPS109BM.bmp
|
||||
110 HPS110BM.bmp
|
||||
111 HPS111BM.bmp
|
||||
112 HPS112BS.bmp
|
||||
113 HPS113BS.bmp
|
||||
114 HPS114BS.bmp
|
||||
115 HPS115BS.bmp
|
||||
116 HPS116BS.bmp
|
||||
117 HPS117BS.bmp
|
||||
118 HPS118BS.bmp
|
||||
119 HPS119BS.bmp
|
||||
120 HPS120WH.bmp
|
||||
121 HPS121WH.bmp
|
||||
122 HPS122WH.bmp
|
||||
123 HPS123WH.bmp
|
||||
124 HPS124WH.bmp
|
||||
125 HPS125WH.bmp
|
||||
126 HPS126WH.bmp
|
||||
127 HPS127WH.bmp
|
||||
128 HPS000PL.bmp
|
||||
129 HPS001PL.bmp
|
||||
130 HPS002PL.bmp
|
||||
131 HPS003PL.bmp
|
||||
132 HPS004PL.bmp
|
||||
133 HPS005PL.bmp
|
||||
134 HPS006PL.bmp
|
||||
135 HPS007PL.bmp
|
||||
136 HPS000EL.bmp
|
||||
137 HPS001EL.bmp
|
||||
138 HPS002EL.bmp
|
||||
139 HPS003EL.bmp
|
||||
140 HPS004EL.bmp
|
||||
141 HPS005EL.bmp
|
||||
142 HPS006EL.bmp
|
||||
143 HPS007EL.bmp
|
||||
144 HPS130KN.bmp
|
||||
145 HPS000SH.bmp
|
||||
146 HPS128QC.bmp
|
||||
147 HPS003SH.bmp
|
||||
148 HPS004SH.bmp
|
||||
149 HPS005SH.bmp
|
||||
150 HPS006SH.bmp
|
||||
151 HPS007SH.bmp
|
||||
152 HPS009SH.bmp
|
||||
153 HPS008SH.bmp
|
||||
154 HPS001SH.bmp
|
||||
155 HPS131DM.bmp
|
||||
156 HPS129MK.bmp
|
||||
157 HPS002SH.bmp
|
||||
158 HPS132Wl.bmp
|
||||
159 HPS133Nc.bmp
|
||||
160 HPS134Nc.bmp
|
||||
161 HPS135Wi.bmp
|
||||
162 HPS136Wi.bmp
|
Loading…
Reference in New Issue
Block a user