From ce14053e72f4d03078e8d5e8b22721feafb0bd20 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Sun, 5 Feb 2017 18:53:30 +0100 Subject: [PATCH] Moved models paths to PersonType --- Source/Objects/Person.cpp | 71 ++++++++++++++++++++++----------------- Source/Objects/Person.hpp | 7 ++++ 2 files changed, 47 insertions(+), 31 deletions(-) diff --git a/Source/Objects/Person.cpp b/Source/Objects/Person.cpp index 8dcc5db..0d4fa9a 100644 --- a/Source/Objects/Person.cpp +++ b/Source/Objects/Person.cpp @@ -101,6 +101,19 @@ void PersonType::Load() types[wolftype].soundsTalk[0] = growlsound; types[wolftype].soundsTalk[1] = growl2sound; + types[wolftype].figureFileName = "Skeleton/BasicFigureWolf"; + types[wolftype].lowFigureFileName = "Skeleton/BasicFigureWolfLow"; + types[wolftype].clothesFileName = "Skeleton/RabbitBelt"; + types[wolftype].modelFileNames[0] = "Models/Wolf.solid"; + types[wolftype].modelFileNames[1] = "Models/Wolf2.solid"; + types[wolftype].modelFileNames[2] = "Models/Wolf3.solid"; + types[wolftype].modelFileNames[3] = "Models/Wolf4.solid"; + types[wolftype].modelFileNames[4] = "Models/Wolf5.solid"; + types[wolftype].modelFileNames[5] = "Models/Wolf6.solid"; + types[wolftype].modelFileNames[6] = "Models/Wolf7.solid"; + types[wolftype].lowModelFileName = "Models/WolfLow.solid"; + types[wolftype].modelClothesFileName = "Models/Belt.solid"; + /* Rabbit */ types[rabbittype].proportions[0] = 1.2; types[rabbittype].proportions[1] = 1.05; @@ -121,6 +134,19 @@ void PersonType::Load() types[rabbittype].soundsAttack[3] = rabbitattack4sound; types[rabbittype].soundsTalk[0] = rabbitchitter; types[rabbittype].soundsTalk[1] = rabbitchitter2; + + types[rabbittype].figureFileName = "Skeleton/BasicFigure"; + types[rabbittype].lowFigureFileName = "Skeleton/BasicFigureLow"; + types[rabbittype].clothesFileName = "Skeleton/RabbitBelt"; + types[rabbittype].modelFileNames[0] = "Models/Body.solid"; + types[rabbittype].modelFileNames[1] = "Models/Body2.solid"; + types[rabbittype].modelFileNames[2] = "Models/Body3.solid"; + types[rabbittype].modelFileNames[3] = "Models/Body4.solid"; + types[rabbittype].modelFileNames[4] = "Models/Body5.solid"; + types[rabbittype].modelFileNames[5] = "Models/Body6.solid"; + types[rabbittype].modelFileNames[6] = "Models/Body7.solid"; + types[rabbittype].lowModelFileName = "Models/BodyLow.solid"; + types[rabbittype].modelClothesFileName = "Models/Belt.solid"; } Person::Person() @@ -500,37 +526,20 @@ Person::Person(FILE* tfile, int mapvers, unsigned i) void Person::skeletonLoad(bool clothes) { skeleton.id = id; - if (creature != wolftype) { - skeleton.Load( - "Skeleton/BasicFigure", - "Skeleton/BasicFigureLow", - "Skeleton/RabbitBelt", - "Models/Body.solid", - "Models/Body2.solid", - "Models/Body3.solid", - "Models/Body4.solid", - "Models/Body5.solid", - "Models/Body6.solid", - "Models/Body7.solid", - "Models/BodyLow.solid", - "Models/Belt.solid", - clothes); - } else { - skeleton.Load( - "Skeleton/BasicFigureWolf", - "Skeleton/BasicFigureWolfLow", - "Skeleton/RabbitBelt", - "Models/Wolf.solid", - "Models/Wolf2.solid", - "Models/Wolf3.solid", - "Models/Wolf4.solid", - "Models/Wolf5.solid", - "Models/Wolf6.solid", - "Models/Wolf7.solid", - "Models/WolfLow.solid", - "Models/Belt.solid", - clothes); - } + skeleton.Load( + PersonType::types[creature].figureFileName, + PersonType::types[creature].lowFigureFileName, + PersonType::types[creature].clothesFileName, + PersonType::types[creature].modelFileNames[0], + PersonType::types[creature].modelFileNames[1], + PersonType::types[creature].modelFileNames[2], + PersonType::types[creature].modelFileNames[3], + PersonType::types[creature].modelFileNames[4], + PersonType::types[creature].modelFileNames[5], + PersonType::types[creature].modelFileNames[6], + PersonType::types[creature].lowModelFileName, + PersonType::types[creature].modelClothesFileName, + clothes); skeleton.drawmodel.textureptr.load(creatureskin[creature][whichskin], 1, &skeleton.skinText[0], &skeleton.skinsize); } diff --git a/Source/Objects/Person.hpp b/Source/Objects/Person.hpp index 856f050..1b9a01c 100644 --- a/Source/Objects/Person.hpp +++ b/Source/Objects/Person.hpp @@ -70,6 +70,13 @@ public: sound_type soundsAttack[4]; sound_type soundsTalk[2]; + std::string figureFileName; + std::string lowFigureFileName; + std::string clothesFileName; + std::string modelFileNames[7]; + std::string lowModelFileName; + std::string modelClothesFileName; + static std::vector types; static void Load(); }; -- 2.39.5