From 35622913f9b46bf3cd4b2bb3435c01a8a7ec5010 Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Wed, 31 Aug 2011 23:27:33 +0000 Subject: [PATCH] Convert ERMU_to_picture.txt into ERMU_to_picture.json. --- client/Graphics.cpp | 24 +++++++++---------- config/ERMU_to_picture.json | 48 +++++++++++++++++++++++++++++++++++++ config/ERMU_to_picture.txt | 44 ---------------------------------- 3 files changed, 59 insertions(+), 57 deletions(-) create mode 100644 config/ERMU_to_picture.json delete mode 100644 config/ERMU_to_picture.txt diff --git a/client/Graphics.cpp b/client/Graphics.cpp index 13b18b623..b6f4ddfd9 100644 --- a/client/Graphics.cpp +++ b/client/Graphics.cpp @@ -715,21 +715,19 @@ CDefEssential * Graphics::getDef( const CGDefInfo * info ) void Graphics::loadErmuToPicture() { //loading ERMU to picture - std::ifstream etp(DATA_DIR "/config/ERMU_to_picture.txt"); - - assert(etp.is_open()); - - for(int g=0; g<44; ++g) - { - for (int b=0; b> buf; - ERMUtoPicture[b][g] = buf; + const JsonNode config(DATA_DIR "/config/ERMU_to_picture.json"); + int etp_idx = 0; + BOOST_FOREACH(const JsonNode &etp, config["ERMU_to_picture"].Vector()) { + int idx = 0; + BOOST_FOREACH(const JsonNode &n, etp.Vector()) { + ERMUtoPicture[idx][etp_idx] = n.String(); + idx ++; } - } + assert (idx == ARRAY_COUNT(ERMUtoPicture)); - etp.close(); + etp_idx ++; + } + assert (etp_idx == 44); } Font::Font(unsigned char *Data) diff --git a/config/ERMU_to_picture.json b/config/ERMU_to_picture.json new file mode 100644 index 000000000..1e915085f --- /dev/null +++ b/config/ERMU_to_picture.json @@ -0,0 +1,48 @@ +{ + "ERMU_to_picture": [ + [ "BoCsMag1.pcx", "BoRMag1.pcx", "BoTGld1.pcx", "BoIMag1.pcx", "BoNmage1.pcx", "BoDmage1.pcx", "BoSmage1.pcx", "BoFmage1.pcx", "BoEgld1.pcx" ], + [ "BoCsMag2.pcx", "BoRMag2.pcx", "BoTGld2.pcx", "BoIMag2.pcx", "BoNmage2.pcx", "BoDmage2.pcx", "BoSmage2.pcx", "BoFmage2.pcx", "BoEgld2.pcx" ], + [ "BoCsMag3.pcx", "BoRMag3.pcx", "BoTGld3.pcx", "BoIMag3.pcx", "BoNmage3.pcx", "BoDmage3.pcx", "BoSmage3.pcx", "BoFmage3.pcx", "BoEgld3.pcx" ], + [ "BoCsMag4.pcx", "BoRMag4.pcx", "BoTGld4.pcx", "BoIMag4.pcx", "BoNmage4.pcx", "BoDmage4.pcx", "BoSmage4.pcx", "BoFmage4.pcx", "BoEgld4.pcx" ], + [ "BoCsMag5.pcx", "BoRMag5.pcx", "BoTGld5.pcx", "BoIMag5.pcx", "BoNmage5.pcx", "BoDmage5.pcx", "BoSmage5.pcx", "BoFmage5.pcx", "BoEgld5.pcx" ], + [ "BoCsTav1.pcx", "BoRTav.pcx", "BoTTav.pcx", "BoITav.pcx", "BoNtav.pcx", "BoDtav.pcx", "BoStav1.pcx", "BoFtav.pcx", "BoEtav.pcx" ], + [ "BoCsDock.pcx", "", "", "", "", "", "", "BoFship.pcx", "BoEship.pcx" ], + [ "BoCsCas1.pcx", "BoRCas1.pcx", "BoTCas1.pcx", "BoICas1.pcx", "BoNcast1.pcx", "BoDcas1.pcx", "BoScas1.pcx", "BoFcast1.pcx", "BoEcast1.pcx" ], + [ "BoCsCas2.pcx", "BoRCas2.pcx", "BoTCas2.pcx", "BoICas2.pcx", "BoNcast2.pcx", "BoDcas2.pcx", "BoScas2.pcx", "BoFcast2.pcx", "BoEcast2.pcx" ], + [ "BoCsCas3.pcx", "BoRCas3.pcx", "BoTCas3.pcx", "BoICas3.pcx", "BoNcast3.pcx", "BoDcas3.pcx", "BoScas3.pcx", "BoFcast3.pcx", "BoEcast3.pcx" ], + [ "BoCsHal1.pcx", "BoRHal1.pcx", "BoTHal1.pcx", "BoIHal1.pcx", "BoNhall1.pcx", "BoDhall1.pcx", "BoShall1.pcx", "BoFhall1.pcx", "BoEhall1.pcx" ], + [ "BoCsHal2.pcx", "BoRHal2.pcx", "BoTHal2.pcx", "BoIHal2.pcx", "BoNhall2.pcx", "BoDhall2.pcx", "BoShall2.pcx", "BoFhall2.pcx", "BoEhall2.pcx" ], + [ "BoCsHal3.pcx", "BoRHal3.pcx", "BoTHal3.pcx", "BoIHal3.pcx", "BoNhall3.pcx", "BoDhall3.pcx", "BoShall3.pcx", "BoFhall3.pcx", "BoEhall3.pcx" ], + [ "BoCsHal4.pcx", "BoRHal4.pcx", "BoTHal4.pcx", "BoIHal4.pcx", "BoNhall4.pcx", "BoDhall4.pcx", "BoShall4.pcx", "BoFhall4.pcx", "BoEhall4.pcx" ], + [ "BoCsMrk1.pcx", "BoRMrk1.pcx", "BoTMark.pcx", "BoIMrk1.pcx", "BoNmark1.pcx", "BoDmark1.pcx", "BoSmrk1.pcx", "BoFmark1.pcx", "BoEmark1.pcx" ], + [ "BoCsMrk2.pcx", "BoRMrk2.pcx", "BoTMarkS.pcx", "BoIMrk2.pcx", "BoNmark2.pcx", "BoDmark2.pcx", "BoSmrk2.pcx", "BoFmark2.pcx", "BoEmarkS.pcx" ], + [ "BoCsBlak.pcx", "BoRAid.pcx", "BoTBlack.pcx", "BoIBlak.pcx", "BoNsmith.pcx", "BoDsmith.pcx", "BoSblak1.pcx", "BoFapoth.pcx", "BoEblack.pcx" ], + [ "BoCsLite.pcx", "BoRGar1.pcx", "BoTMarkA.pcx", "", "BoNshrod.pcx", "BoDmarkA.pcx", "BoSescap.pcx", "BoFcage.pcx", "BoEmarkA.pcx" ], + [ "BoCsGr1H.pcx", "BoRDwf1h.pcx", "BoTGa1H.pcx", "BoIImpH.pcx", "BoNskelH.pcx", "BoDtrogH.pcx", "BoSgob1h.pcx", "BoFgno1h.pcx", "BoDhrd1.pcx" ], + [ "BoCsGr2H.pcx", "BoRDwf2h.pcx", "BoTGa2h.pcx", "BoIImp2H.pcx", "", "", "BoSgob2h.pcx", "BoFgno2h.pcx", "BoDhrd2.pcx" ], + [ "", "", "", "", "", "", "", "", "" ], + [ "BoCsCv2S.pcx", "BoRGar2.pcx", "BoTCasW.pcx", "BoICasB.pcx", "BoNnecro.pcx", "BoDvort.pcx", "BoSmrk1c.pcx", "BoFcastD.pcx", "BoEuniv.pcx" ], + [ "BoCsTav2.pcx", "BoRDwf1t.pcx", "BoTGldL.pcx", "BoICasG.pcx", "BoNskelT.pcx", "BoDport.pcx", "BoSblak2.pcx", "BoFcastA.pcx", "" ], + [ "", "", "BoTGldW.pcx", "BoIMagO.pcx", "", "BoDacad.pcx", "BoSvahal.pcx", "", "" ], + [ "", "BoRTre1h.pcx", "", "BoIHndH.pcx", "", "", "", "", "" ], + [ "", "BoRTre2h.pcx", "", "BoIHnd2H.pcx", "", "", "", "", "" ], + [ "BoCsHoly.pcx", "BoRHoly.pcx", "BoTHoly.pcx", "BoIHoly.pcx", "BoNholyG.pcx", "BoDholy.pcx", "BoSholy.pcx", "BoFgrail.pcx", "BoEgrail.pcx" ], + [ "", "", "", "", "", "", "", "", "" ], + [ "", "", "", "", "", "", "", "", "" ], + [ "", "", "", "", "", "", "", "", "" ], + [ "BoCsPik1.pcx", "BoRCen1.pcx", "BoTGrem1.pcx", "BoIImp1.pcx", "BoNskel1.pcx", "BoDtrog1.pcx", "BoSgob1.pcx", "BoFgnol1.pcx", "BoEdn_0.pcx" ], + [ "BoCsCrs1.pcx", "BoRDwf1.pcx", "BoTGar1.pcx", "BoIGog1.pcx", "BoNzomb1.pcx", "BoDharp1.pcx", "BoSwolf1.pcx", "BoFlizr1.pcx", "BoEdn_1.pcx" ], + [ "BoCsGr1.pcx", "BoRElf1.pcx", "BoTGolm1.pcx", "BoIHnd1.pcx", "BoNwigh1.pcx", "BoDbeh1.pcx", "BoSorc1.pcx", "BoFfly1.pcx", "BoEdn_2.pcx" ], + [ "BoCsSwd1.pcx", "BoRPeg1.pcx", "BoTMag1.pcx", "BoIDmn1.pcx", "BoNvamp1.pcx", "BoDmedu1.pcx", "BoSogre1.pcx", "BoFbas1.pcx", "BoEdn_3.pcx" ], + [ "BoCsMon1.pcx", "BoRTre1.pcx", "BoTGen1.pcx", "BoIPit1.pcx", "BoNlich1.pcx", "BoDmino1.pcx", "BoSroc1.pcx", "BoFgorg1.pcx", "BoEdn_4.pcx" ], + [ "BoCsCv1.pcx", "BoRUni1.pcx", "BoTNaga1.pcx", "BoIEfr1.pcx", "BoNbkni1.pcx", "BoDmant1.pcx", "BoScyc1.pcx", "BoFwyvr1.pcx", "BoEdn_5.pcx" ], + [ "BoCsAng1.pcx", "BoRDra1.pcx", "BoTTit1.pcx", "BoIDvl1.pcx", "BoNbone1.pcx", "BoDdrag1.pcx", "BoSbeh1.pcx", "BoFhydr1.pcx", "BoEdn_6.pcx" ], + [ "BoCsPik2.pcx", "BoRCen2.pcx", "BoTGrem2.pcx", "BoIImp2.pcx", "BoNskel2.pcx", "BoDtrog2.pcx", "BoSgob2.pcx", "BoFgnol2.pcx", "BoEup_0.pcx" ], + [ "BoCsCrs2.pcx", "BoRDwf2.pcx", "BoTGar2.pcx", "BoIGog2.pcx", "BoNzomb2.pcx", "BoDharp2.pcx", "BoSwolf2.pcx", "BoFlizr2.pcx", "BoEup_1.pcx" ], + [ "BoCsGr2.pcx", "BoRElf2.pcx", "BoTGolm2.pcx", "BoIHnd2.pcx", "BoNwigh2.pcx", "BoDbeh2.pcx", "BoSorc2.pcx", "BoFfly2.pcx", "BoEup_2.pcx" ], + [ "BoCsSwd2.pcx", "BoRPeg2.pcx", "BoTMag2.pcx", "BoIDmn2.pcx", "BoNvamp2.pcx", "BoDmedu2.pcx", "BoSogre2.pcx", "BoFbas2.pcx", "BoEup_3.pcx" ], + [ "BoCsMon2.pcx", "BoRTre2.pcx", "BoTGen2.pcx", "BoIPit2.pcx", "BoNlich2.pcx", "BoDmino2.pcx", "BoSroc2.pcx", "BoFgorg2.pcx", "BoEup_4.pcx" ], + [ "BoCsCv2.pcx", "BoRUni2.pcx", "BoTNaga2.pcx", "BoIEfr2.pcx", "BoNbkni2.pcx", "BoDmant2.pcx", "BoScyc2.pcx", "BoFwyvr2.pcx", "BoEup_5.pcx" ], + [ "BoCsAng2.pcx", "BoRDra2.pcx", "BoTTit2.pcx", "BoIDvl2.pcx", "BoNbone2.pcx", "BoDdrag2.pcx", "BoSbeh2.pcx", "BoFhydr2.pcx", "BoEup_6.pcx" ] + ] +} diff --git a/config/ERMU_to_picture.txt b/config/ERMU_to_picture.txt deleted file mode 100644 index 019742214..000000000 --- a/config/ERMU_to_picture.txt +++ /dev/null @@ -1,44 +0,0 @@ -BoCsMag1.pcx BoRMag1.pcx BoTGld1.pcx BoIMag1.pcx BoNmage1.pcx BoDmage1.pcx BoSmage1.pcx BoFmage1.pcx BoEgld1.pcx -BoCsMag2.pcx BoRMag2.pcx BoTGld2.pcx BoIMag2.pcx BoNmage2.pcx BoDmage2.pcx BoSmage2.pcx BoFmage2.pcx BoEgld2.pcx -BoCsMag3.pcx BoRMag3.pcx BoTGld3.pcx BoIMag3.pcx BoNmage3.pcx BoDmage3.pcx BoSmage3.pcx BoFmage3.pcx BoEgld3.pcx -BoCsMag4.pcx BoRMag4.pcx BoTGld4.pcx BoIMag4.pcx BoNmage4.pcx BoDmage4.pcx BoSmage4.pcx BoFmage4.pcx BoEgld4.pcx -BoCsMag5.pcx BoRMag5.pcx BoTGld5.pcx BoIMag5.pcx BoNmage5.pcx BoDmage5.pcx BoSmage5.pcx BoFmage5.pcx BoEgld5.pcx -BoCsTav1.pcx BoRTav.pcx BoTTav.pcx BoITav.pcx BoNtav.pcx BoDtav.pcx BoStav1.pcx BoFtav.pcx BoEtav.pcx -BoCsDock.pcx %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% BoFship.pcx BoEship.pcx -BoCsCas1.pcx BoRCas1.pcx BoTCas1.pcx BoICas1.pcx BoNcast1.pcx BoDcas1.pcx BoScas1.pcx BoFcast1.pcx BoEcast1.pcx -BoCsCas2.pcx BoRCas2.pcx BoTCas2.pcx BoICas2.pcx BoNcast2.pcx BoDcas2.pcx BoScas2.pcx BoFcast2.pcx BoEcast2.pcx -BoCsCas3.pcx BoRCas3.pcx BoTCas3.pcx BoICas3.pcx BoNcast3.pcx BoDcas3.pcx BoScas3.pcx BoFcast3.pcx BoEcast3.pcx -BoCsHal1.pcx BoRHal1.pcx BoTHal1.pcx BoIHal1.pcx BoNhall1.pcx BoDhall1.pcx BoShall1.pcx BoFhall1.pcx BoEhall1.pcx -BoCsHal2.pcx BoRHal2.pcx BoTHal2.pcx BoIHal2.pcx BoNhall2.pcx BoDhall2.pcx BoShall2.pcx BoFhall2.pcx BoEhall2.pcx -BoCsHal3.pcx BoRHal3.pcx BoTHal3.pcx BoIHal3.pcx BoNhall3.pcx BoDhall3.pcx BoShall3.pcx BoFhall3.pcx BoEhall3.pcx -BoCsHal4.pcx BoRHal4.pcx BoTHal4.pcx BoIHal4.pcx BoNhall4.pcx BoDhall4.pcx BoShall4.pcx BoFhall4.pcx BoEhall4.pcx -BoCsMrk1.pcx BoRMrk1.pcx BoTMark.pcx BoIMrk1.pcx BoNmark1.pcx BoDmark1.pcx BoSmrk1.pcx BoFmark1.pcx BoEmark1.pcx -BoCsMrk2.pcx BoRMrk2.pcx BoTMarkS.pcx BoIMrk2.pcx BoNmark2.pcx BoDmark2.pcx BoSmrk2.pcx BoFmark2.pcx BoEmarkS.pcx -BoCsBlak.pcx BoRAid.pcx BoTBlack.pcx BoIBlak.pcx BoNsmith.pcx BoDsmith.pcx BoSblak1.pcx BoFapoth.pcx BoEblack.pcx -BoCsLite.pcx BoRGar1.pcx BoTMarkA.pcx %no_pic_here% BoNshrod.pcx BoDmarkA.pcx BoSescap.pcx BoFcage.pcx BoEmarkA.pcx -BoCsGr1H.pcx BoRDwf1h.pcx BoTGa1H.pcx BoIImpH.pcx BoNskelH.pcx BoDtrogH.pcx BoSgob1h.pcx BoFgno1h.pcx BoDhrd1.pcx -BoCsGr2H.pcx BoRDwf2h.pcx BoTGa2h.pcx BoIImp2H.pcx %no_pic_here% %no_pic_here% BoSgob2h.pcx BoFgno2h.pcx BoDhrd2.pcx -%no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% -BoCsCv2S.pcx BoRGar2.pcx BoTCasW.pcx BoICasB.pcx BoNnecro.pcx BoDvort.pcx BoSmrk1c.pcx BoFcastD.pcx BoEuniv.pcx -BoCsTav2.pcx BoRDwf1t.pcx BoTGldL.pcx BoICasG.pcx BoNskelT.pcx BoDport.pcx BoSblak2.pcx BoFcastA.pcx %no_pic_here% -%no_pic_here% %no_pic_here% BoTGldW.pcx BoIMagO.pcx %no_pic_here% BoDacad.pcx BoSvahal.pcx %no_pic_here% %no_pic_here% -%no_pic_here% BoRTre1h.pcx %no_pic_here% BoIHndH.pcx %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% -%no_pic_here% BoRTre2h.pcx %no_pic_here% BoIHnd2H.pcx %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% -BoCsHoly.pcx BoRHoly.pcx BoTHoly.pcx BoIHoly.pcx BoNholyG.pcx BoDholy.pcx BoSholy.pcx BoFgrail.pcx BoEgrail.pcx -%no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% -%no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% -%no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% %no_pic_here% -BoCsPik1.pcx BoRCen1.pcx BoTGrem1.pcx BoIImp1.pcx BoNskel1.pcx BoDtrog1.pcx BoSgob1.pcx BoFgnol1.pcx BoEdn_0.pcx -BoCsCrs1.pcx BoRDwf1.pcx BoTGar1.pcx BoIGog1.pcx BoNzomb1.pcx BoDharp1.pcx BoSwolf1.pcx BoFlizr1.pcx BoEdn_1.pcx -BoCsGr1.pcx BoRElf1.pcx BoTGolm1.pcx BoIHnd1.pcx BoNwigh1.pcx BoDbeh1.pcx BoSorc1.pcx BoFfly1.pcx BoEdn_2.pcx -BoCsSwd1.pcx BoRPeg1.pcx BoTMag1.pcx BoIDmn1.pcx BoNvamp1.pcx BoDmedu1.pcx BoSogre1.pcx BoFbas1.pcx BoEdn_3.pcx -BoCsMon1.pcx BoRTre1.pcx BoTGen1.pcx BoIPit1.pcx BoNlich1.pcx BoDmino1.pcx BoSroc1.pcx BoFgorg1.pcx BoEdn_4.pcx -BoCsCv1.pcx BoRUni1.pcx BoTNaga1.pcx BoIEfr1.pcx BoNbkni1.pcx BoDmant1.pcx BoScyc1.pcx BoFwyvr1.pcx BoEdn_5.pcx -BoCsAng1.pcx BoRDra1.pcx BoTTit1.pcx BoIDvl1.pcx BoNbone1.pcx BoDdrag1.pcx BoSbeh1.pcx BoFhydr1.pcx BoEdn_6.pcx -BoCsPik2.pcx BoRCen2.pcx BoTGrem2.pcx BoIImp2.pcx BoNskel2.pcx BoDtrog2.pcx BoSgob2.pcx BoFgnol2.pcx BoEup_0.pcx -BoCsCrs2.pcx BoRDwf2.pcx BoTGar2.pcx BoIGog2.pcx BoNzomb2.pcx BoDharp2.pcx BoSwolf2.pcx BoFlizr2.pcx BoEup_1.pcx -BoCsGr2.pcx BoRElf2.pcx BoTGolm2.pcx BoIHnd2.pcx BoNwigh2.pcx BoDbeh2.pcx BoSorc2.pcx BoFfly2.pcx BoEup_2.pcx -BoCsSwd2.pcx BoRPeg2.pcx BoTMag2.pcx BoIDmn2.pcx BoNvamp2.pcx BoDmedu2.pcx BoSogre2.pcx BoFbas2.pcx BoEup_3.pcx -BoCsMon2.pcx BoRTre2.pcx BoTGen2.pcx BoIPit2.pcx BoNlich2.pcx BoDmino2.pcx BoSroc2.pcx BoFgorg2.pcx BoEup_4.pcx -BoCsCv2.pcx BoRUni2.pcx BoTNaga2.pcx BoIEfr2.pcx BoNbkni2.pcx BoDmant2.pcx BoScyc2.pcx BoFwyvr2.pcx BoEup_5.pcx -BoCsAng2.pcx BoRDra2.pcx BoTTit2.pcx BoIDvl2.pcx BoNbone2.pcx BoDdrag2.pcx BoSbeh2.pcx BoFhydr2.pcx BoEup_6.pcx \ No newline at end of file