]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Person.cpp
Moved clothes loop to Person, got rid of globals tintr,tintg,tintb
[lugaru.git] / Source / Person.cpp
index 64876000e106b9879a446549b3a038b7490dc8b4..330dd40fb9f0e415bd9fe9f58defb676b6ffeb82 100644 (file)
@@ -6533,14 +6533,20 @@ void Person::takeWeapon(int weaponId)
     weaponids[0] = weaponId;
 }
 
-bool Person::addClothes(const int& clothesId)
+void Person::addClothes()
 {
-    return addClothes(clothes[clothesId]);
+    if (numclothes > 0) {
+        for (int i = 0; i < numclothes; i++) {
+            addClothes(i);
+        }
+        DoMipmaps();
+    }
 }
 
-bool Person::addClothes(const char* fileName)
+bool Person::addClothes(const int& clothesId)
 {
     LOGFUNC;
+    const char* fileName = clothes[clothesId];
 
     GLubyte* array = &skeleton.skinText[0];
 
@@ -6551,6 +6557,10 @@ bool Person::addClothes(const char* fileName)
     float alphanum;
     //Is it valid?
     if (opened) {
+        float tintr = clothestintr[clothesId];
+        float tintg = clothestintg[clothesId];
+        float tintb = clothestintb[clothesId];
+
         if (tintr > 1) tintr = 1;
         if (tintg > 1) tintg = 1;
         if (tintb > 1) tintb = 1;