X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FAnimation%2FSkeleton.cpp;h=b665625ad414262b1f64656fd5cca86b38bac46e;hb=8b6e8f3ad7390309795eb35c0959264cb7924402;hp=31f98860c8528fc05f82caad26144bda85a3e9e3;hpb=7d2f9d40d94d14a61ecdaaa2c41f964029815bc2;p=lugaru.git diff --git a/Source/Animation/Skeleton.cpp b/Source/Animation/Skeleton.cpp index 31f9886..b665625 100644 --- a/Source/Animation/Skeleton.cpp +++ b/Source/Animation/Skeleton.cpp @@ -23,6 +23,7 @@ along with Lugaru. If not, see . #include "Animation/Animation.hpp" #include "Audio/openal_wrapper.hpp" #include "Game.hpp" +#include "Tutorial.hpp" #include "Utils/Folders.hpp" extern float multiplier; @@ -32,27 +33,24 @@ extern int environment; extern float camerashake; extern bool freeze; extern int detail; -extern int tutoriallevel; extern int whichjointstartarray[26]; extern int whichjointendarray[26]; -extern bool visibleloading; - -Skeleton::Skeleton() : - selected(0), - id(0), - num_models(0), - clothes(false), - spinny(false), - skinsize(0), - checkdelay(0), - longdead(0), - broken(false), - free(0), - oldfree(0), - freetime(0), - freefall(false) +Skeleton::Skeleton() + : selected(0) + , id(0) + , num_models(0) + , clothes(false) + , spinny(false) + , skinsize(0) + , checkdelay(0) + , longdead(0) + , broken(false) + , free(0) + , oldfree(0) + , freetime(0) + , freefall(false) { memset(forwardjoints, 0, sizeof(forwardjoints)); memset(lowforwardjoints, 0, sizeof(lowforwardjoints)); @@ -107,14 +105,12 @@ void Skeleton::FindForwards() * Person/Person::DoStuff * Person/IKHelper */ -float Skeleton::DoConstraints(XYZ *coords, float *scale) +float Skeleton::DoConstraints(XYZ* coords, float* scale) { - float friction = 1.5; const float elasticity = .3; XYZ bounceness; const int numrepeats = 3; float groundlevel = .15; - int k, m; unsigned i; XYZ temp; XYZ terrainnormal; @@ -140,20 +136,20 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) joints[i].position = joints[i].position + joints[i].velocity * multiplier; switch (joints[i].label) { - case head: - groundlevel = .8; - break; - case righthand: - case rightwrist: - case rightelbow: - case lefthand: - case leftwrist: - case leftelbow: - groundlevel = .2; - break; - default: - groundlevel = .15; - break; + case head: + groundlevel = .8; + break; + case righthand: + case rightwrist: + case rightelbow: + case lefthand: + case leftwrist: + case leftelbow: + groundlevel = .2; + break; + default: + groundlevel = .15; + break; } joints[i].position.y -= groundlevel; @@ -232,6 +228,7 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) muscles[i].DoConstraint(spinny); } + float friction; for (i = 0; i < joints.size(); i++) { //Length constraints //Ground constraint @@ -242,7 +239,7 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) if (joints[i].label == groin && !joints[i].locked && joints[i].delay <= 0) { joints[i].locked = 1; joints[i].delay = 1; - if (tutoriallevel != 1 || id == 0) { + if (!Tutorial::active || id == 0) { emit_sound_at(landsound1, joints[i].position * (*scale) + *coords, 128.); } breaking = true; @@ -251,7 +248,7 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) if (joints[i].label == head && !joints[i].locked && joints[i].delay <= 0) { joints[i].locked = 1; joints[i].delay = 1; - if (tutoriallevel != 1 || id == 0) { + if (!Tutorial::active || id == 0) { emit_sound_at(landsound2, joints[i].position * (*scale) + *coords, 128.); } } @@ -270,7 +267,7 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) else joints[i].velocity = 0; - if (tutoriallevel != 1 || id == 0) + if (!Tutorial::active || id == 0) if (findLengthfast(&bounceness) > 8000 && breaking) { // FIXME: this crashes because k is not initialized! // to reproduce, type 'wolfie' in console and play a while @@ -297,7 +294,6 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) joints[i].velocity = joints[i].oldvelocity; } - if (joints[i].locked == 0) if (findLengthfast(&joints[i].velocity) < 1) joints[i].locked = 1; @@ -318,133 +314,129 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) } else if (findLengthfast(&bounceness) > 500) Sprite::MakeSprite(cloudsprite, joints[i].position * (*scale) + *coords, joints[i].velocity * .06, terrainlight.x, terrainlight.y, terrainlight.z, .5, .2); - joints[i].position.y = (terrain.getHeight(joints[i].position.x * (*scale) + coords->x, joints[i].position.z * (*scale) + coords->z) + groundlevel - coords->y) / (*scale); if (longdead > 100) broken = 1; } - if (terrain.patchobjectnum[whichpatchx][whichpatchz]) - for (m = 0; m < terrain.patchobjectnum[whichpatchx][whichpatchz]; m++) { - k = terrain.patchobjects[whichpatchx][whichpatchz][m]; - if (k < Object::objects.size() && k >= 0) - if (Object::objects[k]->possible) { - friction = Object::objects[k]->friction; - XYZ start = joints[i].realoldposition; - XYZ end = joints[i].position * (*scale) + *coords; - whichhit = Object::objects[k]->model.LineCheckPossible(&start, &end, &temp, &Object::objects[k]->position, &Object::objects[k]->yaw); - if (whichhit != -1) { - if (joints[i].label == groin && !joints[i].locked && joints[i].delay <= 0) { - joints[i].locked = 1; - joints[i].delay = 1; - if (tutoriallevel != 1 || id == 0) { - emit_sound_at(landsound1, joints[i].position * (*scale) + *coords, 128.); - } - breaking = true; + for (unsigned int m = 0; m < terrain.patchobjects[whichpatchx][whichpatchz].size(); m++) { + unsigned int k = terrain.patchobjects[whichpatchx][whichpatchz][m]; + if (k < Object::objects.size()) { + if (Object::objects[k]->possible) { + friction = Object::objects[k]->friction; + XYZ start = joints[i].realoldposition; + XYZ end = joints[i].position * (*scale) + *coords; + whichhit = Object::objects[k]->model.LineCheckPossible(&start, &end, &temp, &Object::objects[k]->position, &Object::objects[k]->yaw); + if (whichhit != -1) { + if (joints[i].label == groin && !joints[i].locked && joints[i].delay <= 0) { + joints[i].locked = 1; + joints[i].delay = 1; + if (!Tutorial::active || id == 0) { + emit_sound_at(landsound1, joints[i].position * (*scale) + *coords, 128.); } + breaking = true; + } - if (joints[i].label == head && !joints[i].locked && joints[i].delay <= 0) { - joints[i].locked = 1; - joints[i].delay = 1; - if (tutoriallevel != 1 || id == 0) { - emit_sound_at(landsound2, joints[i].position * (*scale) + *coords, 128.); - } + if (joints[i].label == head && !joints[i].locked && joints[i].delay <= 0) { + joints[i].locked = 1; + joints[i].delay = 1; + if (!Tutorial::active || id == 0) { + emit_sound_at(landsound2, joints[i].position * (*scale) + *coords, 128.); } + } - terrainnormal = DoRotation(Object::objects[k]->model.facenormals[whichhit], 0, Object::objects[k]->yaw, 0) * -1; - if (terrainnormal.y > .8) - freefall = 0; - bounceness = terrainnormal * findLength(&joints[i].velocity) * (abs(normaldotproduct(joints[i].velocity, terrainnormal))); - if (findLengthfast(&joints[i].velocity) > findLengthfast(&joints[i].oldvelocity)) { - bounceness = 0; - joints[i].velocity = joints[i].oldvelocity; - } - if (tutoriallevel != 1 || id == 0) - if (findLengthfast(&bounceness) > 4000 && breaking) { - Object::objects[k]->model.MakeDecal(breakdecal, DoRotation(temp - Object::objects[k]->position, 0, -Object::objects[k]->yaw, 0), .4, .5, Random() % 360); - Sprite::MakeSprite(cloudsprite, joints[i].position * (*scale) + *coords, joints[i].velocity * .06, 1, 1, 1, 4, .2); - breaking = false; - camerashake += .6; - - emit_sound_at(breaksound2, joints[i].position * (*scale) + *coords); - - addEnvSound(*coords, 64); - } - if (Object::objects[k]->type == treetrunktype) { - Object::objects[k]->rotx += joints[i].velocity.x * multiplier * .4; - Object::objects[k]->roty += joints[i].velocity.z * multiplier * .4; - Object::objects[k + 1]->rotx += joints[i].velocity.x * multiplier * .4; - Object::objects[k + 1]->roty += joints[i].velocity.z * multiplier * .4; - } - if (!joints[i].locked) - damage += findLengthfast(&bounceness) / 2500; - ReflectVector(&joints[i].velocity, &terrainnormal); - frictionness = abs(normaldotproduct(joints[i].velocity, terrainnormal)); - joints[i].velocity -= bounceness; - if (1 - friction * frictionness > 0) - joints[i].velocity *= 1 - friction * frictionness; - else - joints[i].velocity = 0; - if (findLengthfast(&bounceness) > 2500) { - Normalise(&bounceness); - bounceness = bounceness * 50; + terrainnormal = DoRotation(Object::objects[k]->model.Triangles[whichhit].facenormal, 0, Object::objects[k]->yaw, 0) * -1; + if (terrainnormal.y > .8) + freefall = 0; + bounceness = terrainnormal * findLength(&joints[i].velocity) * (abs(normaldotproduct(joints[i].velocity, terrainnormal))); + if (findLengthfast(&joints[i].velocity) > findLengthfast(&joints[i].oldvelocity)) { + bounceness = 0; + joints[i].velocity = joints[i].oldvelocity; + } + if (!Tutorial::active || id == 0) + if (findLengthfast(&bounceness) > 4000 && breaking) { + Object::objects[k]->model.MakeDecal(breakdecal, DoRotation(temp - Object::objects[k]->position, 0, -Object::objects[k]->yaw, 0), .4, .5, Random() % 360); + Sprite::MakeSprite(cloudsprite, joints[i].position * (*scale) + *coords, joints[i].velocity * .06, 1, 1, 1, 4, .2); + breaking = false; + camerashake += .6; + + emit_sound_at(breaksound2, joints[i].position * (*scale) + *coords); + + addEnvSound(*coords, 64); } - joints[i].velocity += bounceness * elasticity; - - - if (!joints[i].locked) - if (findLengthfast(&joints[i].velocity) < 1) { - joints[i].locked = 1; - } - if (findLengthfast(&bounceness) > 500) - Sprite::MakeSprite(cloudsprite, joints[i].position * (*scale) + *coords, joints[i].velocity * .06, 1, 1, 1, .5, .2); - joints[i].position = (temp - *coords) / (*scale) + terrainnormal * .005; - if (longdead > 100) - broken = 1; + if (Object::objects[k]->type == treetrunktype) { + Object::objects[k]->rotx += joints[i].velocity.x * multiplier * .4; + Object::objects[k]->roty += joints[i].velocity.z * multiplier * .4; + Object::objects[k + 1]->rotx += joints[i].velocity.x * multiplier * .4; + Object::objects[k + 1]->roty += joints[i].velocity.z * multiplier * .4; } + if (!joints[i].locked) + damage += findLengthfast(&bounceness) / 2500; + ReflectVector(&joints[i].velocity, &terrainnormal); + frictionness = abs(normaldotproduct(joints[i].velocity, terrainnormal)); + joints[i].velocity -= bounceness; + if (1 - friction * frictionness > 0) + joints[i].velocity *= 1 - friction * frictionness; + else + joints[i].velocity = 0; + if (findLengthfast(&bounceness) > 2500) { + Normalise(&bounceness); + bounceness = bounceness * 50; + } + joints[i].velocity += bounceness * elasticity; + + if (!joints[i].locked) + if (findLengthfast(&joints[i].velocity) < 1) { + joints[i].locked = 1; + } + if (findLengthfast(&bounceness) > 500) + Sprite::MakeSprite(cloudsprite, joints[i].position * (*scale) + *coords, joints[i].velocity * .06, 1, 1, 1, .5, .2); + joints[i].position = (temp - *coords) / (*scale) + terrainnormal * .005; + if (longdead > 100) + broken = 1; } + } } + } joints[i].realoldposition = joints[i].position * (*scale) + *coords; } } multiplier = tempmult; - - if (terrain.patchobjectnum[whichpatchx][whichpatchz]) - for (m = 0; m < terrain.patchobjectnum[whichpatchx][whichpatchz]; m++) { - k = terrain.patchobjects[whichpatchx][whichpatchz][m]; - if (Object::objects[k]->possible) { - for (i = 0; i < 26; i++) { - //Make this less stupid - XYZ start = joints[jointlabels[whichjointstartarray[i]]].position * (*scale) + *coords; - XYZ end = joints[jointlabels[whichjointendarray[i]]].position * (*scale) + *coords; - whichhit = Object::objects[k]->model.LineCheckSlidePossible(&start, &end, &temp, &Object::objects[k]->position, &Object::objects[k]->yaw); - if (whichhit != -1) { - joints[jointlabels[whichjointendarray[i]]].position = (end - *coords) / (*scale); - for (unsigned j = 0; j < muscles.size(); j++) { - if ((muscles[j].parent1->label == whichjointstartarray[i] && muscles[j].parent2->label == whichjointendarray[i]) || (muscles[j].parent2->label == whichjointstartarray[i] && muscles[j].parent1->label == whichjointendarray[i])) - muscles[j].DoConstraint(spinny); - } + for (unsigned int m = 0; m < terrain.patchobjects[whichpatchx][whichpatchz].size(); m++) { + unsigned int k = terrain.patchobjects[whichpatchx][whichpatchz][m]; + if (Object::objects[k]->possible) { + for (i = 0; i < 26; i++) { + //Make this less stupid + XYZ start = joints[jointlabels[whichjointstartarray[i]]].position * (*scale) + *coords; + XYZ end = joints[jointlabels[whichjointendarray[i]]].position * (*scale) + *coords; + whichhit = Object::objects[k]->model.LineCheckSlidePossible(&start, &end, &Object::objects[k]->position, &Object::objects[k]->yaw); + if (whichhit != -1) { + joints[jointlabels[whichjointendarray[i]]].position = (end - *coords) / (*scale); + for (unsigned j = 0; j < muscles.size(); j++) { + if ((muscles[j].parent1->label == whichjointstartarray[i] && muscles[j].parent2->label == whichjointendarray[i]) || (muscles[j].parent2->label == whichjointstartarray[i] && muscles[j].parent1->label == whichjointendarray[i])) + muscles[j].DoConstraint(spinny); } } } } + } for (i = 0; i < joints.size(); i++) { switch (joints[i].label) { - case head: - groundlevel = .8; - break; - case righthand: - case rightwrist: - case rightelbow: - case lefthand: - case leftwrist: - case leftelbow: - groundlevel = .2; - break; - default: - groundlevel = .15; - break; + case head: + groundlevel = .8; + break; + case righthand: + case rightwrist: + case rightelbow: + case lefthand: + case leftwrist: + case leftelbow: + groundlevel = .2; + break; + default: + groundlevel = .15; + break; } joints[i].position.y += groundlevel; joints[i].mass = 1; @@ -474,19 +466,16 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale) * USES: * Person/Person::DoStuff */ -void Skeleton::DoGravity(float *scale) +void Skeleton::DoGravity(float* scale) { for (unsigned i = 0; i < joints.size(); i++) { if ( - ( - ((joints[i].label != leftknee) && (joints[i].label != rightknee)) || - (lowforward.y > -.1) || - (joints[i].mass < 5) - ) && ( - ((joints[i].label != leftelbow) && (joints[i].label != rightelbow)) || - (forward.y < .3) - ) - ) { + ( + ((joints[i].label != leftknee) && (joints[i].label != rightknee)) || + (lowforward.y > -.1) || + (joints[i].mass < 5)) && + (((joints[i].label != leftelbow) && (joints[i].label != rightelbow)) || + (forward.y < .3))) { joints[i].velocity.y += gravity * multiplier / (*scale); } } @@ -531,39 +520,39 @@ void Skeleton::FindRotationMuscle(int which, int animation) const int label1 = muscles[which].parent1->label; const int label2 = muscles[which].parent2->label; switch (label1) { - case head: - fwd = specialforward[0]; - break; - case rightshoulder: - case rightelbow: - case rightwrist: - case righthand: - fwd = specialforward[1]; - break; - case leftshoulder: - case leftelbow: - case leftwrist: - case lefthand: - fwd = specialforward[2]; - break; - case righthip: - case rightknee: - case rightankle: - case rightfoot: - fwd = specialforward[3]; - break; - case lefthip: - case leftknee: - case leftankle: - case leftfoot: - fwd = specialforward[4]; - break; - default: - if (muscles[which].parent1->lower) - fwd = lowforward; - else - fwd = forward; - break; + case head: + fwd = specialforward[0]; + break; + case rightshoulder: + case rightelbow: + case rightwrist: + case righthand: + fwd = specialforward[1]; + break; + case leftshoulder: + case leftelbow: + case leftwrist: + case lefthand: + fwd = specialforward[2]; + break; + case righthip: + case rightknee: + case rightankle: + case rightfoot: + fwd = specialforward[3]; + break; + case lefthip: + case leftknee: + case leftankle: + case leftfoot: + fwd = specialforward[4]; + break; + default: + if (muscles[which].parent1->lower) + fwd = lowforward; + else + fwd = forward; + break; } if (animation == hanganim) { @@ -605,15 +594,15 @@ void Skeleton::FindRotationMuscle(int which, int animation) * load skeleton * takes filenames for three skeleton files and various models */ -void Skeleton::Load(const std::string& filename, const std::string& lowfilename, const std::string& clothesfilename, - const std::string& modelfilename, const std::string& model2filename, +void Skeleton::Load(const std::string& filename, const std::string& lowfilename, const std::string& clothesfilename, + const std::string& modelfilename, const std::string& model2filename, const std::string& model3filename, const std::string& model4filename, const std::string& model5filename, const std::string& model6filename, const std::string& model7filename, const std::string& modellowfilename, const std::string& modelclothesfilename, bool clothes) { GLfloat M[16]; - FILE *tfile; + FILE* tfile; float lSize; int j, num_joints, num_muscles; @@ -638,11 +627,11 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil model[i].CalculateNormals(0); } - drawmodel.load(modelfilename, 0); + drawmodel.load(modelfilename); drawmodel.Rotate(180, 0, 0); drawmodel.Scale(.04, .04, .04); drawmodel.FlipTexCoords(); - if ((tutoriallevel == 1) && (id != 0)) { + if ((Tutorial::active) && (id != 0)) { drawmodel.UniformTexCoords(); drawmodel.ScaleTexCoords(0.1); } @@ -653,13 +642,13 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil modellow.Scale(.04, .04, .04); modellow.CalculateNormals(0); - drawmodellow.load(modellowfilename, 0); + drawmodellow.load(modellowfilename); drawmodellow.Rotate(180, 0, 0); drawmodellow.Scale(.04, .04, .04); drawmodellow.FlipTexCoords(); - if (tutoriallevel == 1 && id != 0) + if (Tutorial::active && id != 0) drawmodellow.UniformTexCoords(); - if (tutoriallevel == 1 && id != 0) + if (Tutorial::active && id != 0) drawmodellow.ScaleTexCoords(0.1); drawmodellow.CalculateNormals(0); @@ -669,7 +658,7 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil modelclothes.Scale(.041, .04, .041); modelclothes.CalculateNormals(0); - drawmodelclothes.load(modelclothesfilename, 0); + drawmodelclothes.load(modelclothesfilename); drawmodelclothes.Rotate(180, 0, 0); drawmodelclothes.Scale(.04, .04, .04); drawmodelclothes.FlipTexCoords(); @@ -681,7 +670,7 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil // load skeleton - tfile = Folders::openMandatoryFile( Folders::getResourcePath(filename), "rb" ); + tfile = Folders::openMandatoryFile(Folders::getResourcePath(filename), "rb"); // read num_joints funpackf(tfile, "Bi", &num_joints); @@ -752,24 +741,18 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil // load ??? - tfile = Folders::openMandatoryFile( Folders::getResourcePath(lowfilename), "rb" ); + tfile = Folders::openMandatoryFile(Folders::getResourcePath(lowfilename), "rb"); // skip joints section fseek(tfile, sizeof(num_joints), SEEK_CUR); for (int i = 0; i < num_joints; i++) { // skip joint info - lSize = sizeof(XYZ) - + sizeof(float) - + sizeof(float) - + 1 //sizeof(bool) - + 1 //sizeof(bool) - + sizeof(int) - + 1 //sizeof(bool) - + 1 //sizeof(bool) - + sizeof(int) - + sizeof(int) - + 1 //sizeof(bool) + lSize = sizeof(XYZ) + sizeof(float) + sizeof(float) + 1 //sizeof(bool) + + 1 //sizeof(bool) + + sizeof(int) + 1 //sizeof(bool) + + 1 //sizeof(bool) + + sizeof(int) + sizeof(int) + 1 //sizeof(bool) + sizeof(int); fseek(tfile, lSize, SEEK_CUR); } @@ -779,22 +762,17 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil for (int i = 0; i < num_muscles; i++) { // skip muscle info - lSize = sizeof(float) - + sizeof(float) - + sizeof(float) - + sizeof(float) - + sizeof(float) - + sizeof(int); + lSize = sizeof(float) + sizeof(float) + sizeof(float) + sizeof(float) + sizeof(float) + sizeof(int); fseek(tfile, lSize, SEEK_CUR); muscles[i].loadVerticesLow(tfile, modellow.vertexNum); // skip more stuff lSize = 1; //sizeof(bool); - fseek ( tfile, lSize, SEEK_CUR); + fseek(tfile, lSize, SEEK_CUR); lSize = sizeof(int); - fseek ( tfile, lSize, SEEK_CUR); - fseek ( tfile, lSize, SEEK_CUR); + fseek(tfile, lSize, SEEK_CUR); + fseek(tfile, lSize, SEEK_CUR); } for (j = 0; j < num_muscles; j++) { @@ -827,24 +805,18 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil // load clothes if (clothes) { - tfile = Folders::openMandatoryFile( Folders::getResourcePath(clothesfilename), "rb" ); + tfile = Folders::openMandatoryFile(Folders::getResourcePath(clothesfilename), "rb"); // skip num_joints fseek(tfile, sizeof(num_joints), SEEK_CUR); for (int i = 0; i < num_joints; i++) { // skip joint info - lSize = sizeof(XYZ) - + sizeof(float) - + sizeof(float) - + 1 //sizeof(bool) - + 1 //sizeof(bool) - + sizeof(int) - + 1 //sizeof(bool) - + 1 //sizeof(bool) - + sizeof(int) - + sizeof(int) - + 1 //sizeof(bool) + lSize = sizeof(XYZ) + sizeof(float) + sizeof(float) + 1 //sizeof(bool) + + 1 //sizeof(bool) + + sizeof(int) + 1 //sizeof(bool) + + 1 //sizeof(bool) + + sizeof(int) + sizeof(int) + 1 //sizeof(bool) + sizeof(int); fseek(tfile, lSize, SEEK_CUR); } @@ -854,22 +826,17 @@ void Skeleton::Load(const std::string& filename, const std::string& lowfil for (int i = 0; i < num_muscles; i++) { // skip muscle info - lSize = sizeof(float) - + sizeof(float) - + sizeof(float) - + sizeof(float) - + sizeof(float) - + sizeof(int); + lSize = sizeof(float) + sizeof(float) + sizeof(float) + sizeof(float) + sizeof(float) + sizeof(int); fseek(tfile, lSize, SEEK_CUR); muscles[i].loadVerticesClothes(tfile, modelclothes.vertexNum); // skip more stuff lSize = 1; //sizeof(bool); - fseek ( tfile, lSize, SEEK_CUR); + fseek(tfile, lSize, SEEK_CUR); lSize = sizeof(int); - fseek ( tfile, lSize, SEEK_CUR); - fseek ( tfile, lSize, SEEK_CUR); + fseek(tfile, lSize, SEEK_CUR); + fseek(tfile, lSize, SEEK_CUR); } // ???