]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Objects/Weapons.cpp
Removed unused defines, changed method names case
[lugaru.git] / Source / Objects / Weapons.cpp
index 5ef40e6ff08e47d17a8963419f2eed0e32c659f9..1cd4cea3f93c21ed6f77eac182afbc06b9354226 100644 (file)
@@ -97,7 +97,44 @@ void Weapon::setType(int t)
     }
 }
 
-void Weapon::DoStuff(int i)
+/* 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;
     static XYZ start, end, colpoint, normalrot, footvel, footpoint;
@@ -920,11 +957,11 @@ void Weapons::DoStuff()
     //Move
     int i = 0;
     for (std::vector<Weapon>::iterator weapon = begin(); weapon != end(); ++weapon) {
-        weapon->DoStuff(i++);
+        weapon->doStuff(i++);
     }
 }
 
-void Weapon::Draw()
+void Weapon::draw()
 {
     static XYZ terrainlight;
     static GLfloat M[16];
@@ -1103,7 +1140,7 @@ int Weapons::Draw()
     glDepthMask(1);
 
     for (std::vector<Weapon>::iterator weapon = begin(); weapon != end(); ++weapon) {
-        weapon->Draw();
+        weapon->draw();
     }
     return 0;
 }