extern int whichlevel;
+float tintr = 1, tintg = 1, tintb = 1;
+
/* Helpers used in console commands */
/* Return true if PFX is a prefix of STR (case-insensitive). */
char buf[64];
snprintf(buf, 63, ":Data:Textures:%s.png", args);
- if (!Person::players[pnum]->addClothes(buf))
+ int id = Person::players[pnum]->numclothes;
+ strcpy(Person::players[pnum]->clothes[id], buf);
+ Person::players[pnum]->clothestintr[id] = tintr;
+ Person::players[pnum]->clothestintg[id] = tintg;
+ Person::players[pnum]->clothestintb[id] = tintb;
+ Person::players[pnum]->numclothes++;
+
+ if (!Person::players[pnum]->addClothes(id))
return;
Person::players[pnum]->DoMipmaps();
- strcpy(Person::players[pnum]->clothes[Person::players[pnum]->numclothes], buf);
- Person::players[pnum]->clothestintr[Person::players[pnum]->numclothes] = tintr;
- Person::players[pnum]->clothestintg[Person::players[pnum]->numclothes] = tintg;
- Person::players[pnum]->clothestintb[Person::players[pnum]->numclothes] = tintb;
- Person::players[pnum]->numclothes++;
}
/* Console commands themselves */
extern int directing;
extern float dialoguetime;
extern int dialoguegonethrough[20];
-extern float tintr, tintg, tintb;
enum maptypes {
mapkilleveryone, mapgosomewhere,
extern int whichjointstartarray[26];
extern int whichjointendarray[26];
extern int difficulty;
-extern float tintr, tintg, tintb;
extern float slomospeed;
extern bool gamestarted;
accountactive = Account::loadFile(":Data:Users");
- tintr = 1;
- tintg = 1;
- tintb = 1;
-
whichjointstartarray[0] = righthip;
whichjointendarray[0] = rightfoot;
Person::players[i]->skeleton.drawmodel.textureptr.load(creatureskin[Person::players[i]->creature][Person::players[i]->whichskin], 1, &Person::players[i]->skeleton.skinText[0], &Person::players[i]->skeleton.skinsize);
- if (Person::players[i]->numclothes) {
- for (int j = 0; j < Person::players[i]->numclothes; j++) {
- tintr = Person::players[i]->clothestintr[j];
- tintg = Person::players[i]->clothestintg[j];
- tintb = Person::players[i]->clothestintb[j];
- Person::players[i]->addClothes(j);
- }
- Person::players[i]->DoMipmaps();
- }
+ Person::players[i]->addClothes();
Person::players[i]->animCurrent = bounceidleanim;
Person::players[i]->animTarget = bounceidleanim;
&Person::players[closest]->skeleton.skinText[0], &Person::players[closest]->skeleton.skinsize);
}
- if (Person::players[closest]->numclothes) {
- for (int i = 0; i < Person::players[closest]->numclothes; i++) {
- tintr = Person::players[closest]->clothestintr[i];
- tintg = Person::players[closest]->clothestintg[i];
- tintb = Person::players[closest]->clothestintb[i];
- Person::players[closest]->addClothes(i);
- }
- Person::players[closest]->DoMipmaps();
- }
+ Person::players[closest]->addClothes();
}
if (Input::isKeyPressed(SDL_SCANCODE_O) && Input::isKeyDown(SDL_SCANCODE_LSHIFT)) {
Person::players.back()->immobile = Person::players[0]->immobile;
Person::players.back()->numclothes = Person::players[0]->numclothes;
- if (Person::players.back()->numclothes)
- for (int i = 0; i < Person::players.back()->numclothes; i++) {
- strcpy(Person::players.back()->clothes[i], Person::players[0]->clothes[i]);
- Person::players.back()->clothestintr[i] = Person::players[0]->clothestintr[i];
- Person::players.back()->clothestintg[i] = Person::players[0]->clothestintg[i];
- Person::players.back()->clothestintb[i] = Person::players[0]->clothestintb[i];
- tintr = Person::players.back()->clothestintr[i];
- tintg = Person::players.back()->clothestintg[i];
- tintb = Person::players.back()->clothestintb[i];
- Person::players.back()->addClothes(i);
- }
- if (Person::players.back()->numclothes) {
- Person::players.back()->DoMipmaps();
+ for (int i = 0; i < Person::players.back()->numclothes; i++) {
+ strcpy(Person::players.back()->clothes[i], Person::players[0]->clothes[i]);
+ Person::players.back()->clothestintr[i] = Person::players[0]->clothestintr[i];
+ Person::players.back()->clothestintg[i] = Person::players[0]->clothestintg[i];
+ Person::players.back()->clothestintb[i] = Person::players[0]->clothestintb[i];
}
+ Person::players.back()->addClothes();
Person::players.back()->power = Person::players[0]->power;
Person::players.back()->speedmult = Person::players[0]->speedmult;
float precipdelay = 0;
float gamespeed = 0;
float oldgamespeed = 0;
-float tintr = 0, tintg = 0, tintb = 0;
int difficulty = 0;
float multiplier = 0;
float realmultiplier = 0;
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];
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;
void takeWeapon (int weaponId);
bool addClothes(const int& clothesId);
- bool addClothes(const char* fileName);
+ void addClothes();
};
const int maxplayers = 10;