X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FObjects%2FWeapons.cpp;h=31ea8c16f4f76edcb3c8bb2948183ed14cb23baa;hp=5ef40e6ff08e47d17a8963419f2eed0e32c659f9;hb=188b251d145503cab17680a22cbabf58b24358d5;hpb=8b8230c564e1f0063b381e77bf6222af9f2e678d diff --git a/Source/Objects/Weapons.cpp b/Source/Objects/Weapons.cpp index 5ef40e6..31ea8c1 100644 --- a/Source/Objects/Weapons.cpp +++ b/Source/Objects/Weapons.cpp @@ -97,6 +97,43 @@ void Weapon::setType(int t) } } +/* Load weapons models and textures */ +void Weapon::Load() +{ + LOG("Loading weapon data..."); + + knifetextureptr.load("Textures/Knife.png", 0); + bloodknifetextureptr.load("Textures/BloodKnife.png", 0); + lightbloodknifetextureptr.load("Textures/BloodKnifeLight.png", 0); + swordtextureptr.load("Textures/Sword.jpg", 1); + bloodswordtextureptr.load("Textures/SwordBlood.jpg", 1); + lightbloodswordtextureptr.load("Textures/SwordBloodLight.jpg", 1); + stafftextureptr.load("Textures/Staff.jpg", 1); + + throwingknifemodel.load("Models/ThrowingKnife.solid"); + throwingknifemodel.Scale(.001, .001, .001); + throwingknifemodel.Rotate(90, 0, 0); + throwingknifemodel.Rotate(0, 90, 0); + throwingknifemodel.flat = 0; + throwingknifemodel.CalculateNormals(1); + + swordmodel.load("Models/Sword.solid"); + swordmodel.Scale(.001, .001, .001); + swordmodel.Rotate(90, 0, 0); + swordmodel.Rotate(0, 90, 0); + swordmodel.Rotate(0, 0, 90); + swordmodel.flat = 1; + swordmodel.CalculateNormals(1); + + staffmodel.load("Models/Staff.solid"); + staffmodel.Scale(.005, .005, .005); + staffmodel.Rotate(90, 0, 0); + staffmodel.Rotate(0, 90, 0); + staffmodel.Rotate(0, 0, 90); + staffmodel.flat = 1; + staffmodel.CalculateNormals(1); +} + void Weapon::DoStuff(int i) { static int whichpatchx, whichpatchz, whichhit;