From: Ryan C. Gordon Date: Tue, 3 Nov 2009 17:09:44 +0000 (-0500) Subject: Removed unnecessary std::vectors. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=67882279de8557e5bd2749bc64b1a6e573225ce9;p=lugaru.git Removed unnecessary std::vectors. Static constructors were crashing on Tiger. --- diff --git a/Source/Weapons.cpp b/Source/Weapons.cpp index e948353..e51b07b 100644 --- a/Source/Weapons.cpp +++ b/Source/Weapons.cpp @@ -1270,53 +1270,7 @@ int Weapons::Draw() Weapons::Weapons() { - rotation1.resize(max_weaponinstances); - rotation2.resize(max_weaponinstances); - rotation3.resize(max_weaponinstances); - bigrotation.resize(max_weaponinstances); - bigtilt.resize(max_weaponinstances); - bigtilt2.resize(max_weaponinstances); - smallrotation.resize(max_weaponinstances); - smallrotation2.resize(max_weaponinstances); - damage.resize(max_weaponinstances); - numweapons = 0; - tippoint.resize(max_weaponinstances); - oldtippoint.resize(max_weaponinstances); - position.resize(max_weaponinstances); - lastmult.resize(max_weaponinstances); - oldposition.resize(max_weaponinstances); - velocity.resize(max_weaponinstances); - tipvelocity.resize(max_weaponinstances); - type.resize(max_weaponinstances); - oldowner.resize(max_weaponinstances); - owner.resize(max_weaponinstances); - bloody.resize(max_weaponinstances); - blooddrip.resize(max_weaponinstances); - blooddripdelay.resize(max_weaponinstances); - onfire.resize(max_weaponinstances); - flamedelay.resize(max_weaponinstances); - missed.resize(max_weaponinstances); - mass.resize(max_weaponinstances); - tipmass.resize(max_weaponinstances); - length.resize(max_weaponinstances); - freetime.resize(max_weaponinstances); - firstfree.resize(max_weaponinstances); - physics.resize(max_weaponinstances); - drawhowmany.resize(max_weaponinstances); - hitsomething.resize(max_weaponinstances); - - lastdrawnposition.resize(max_weaponinstances); - lastdrawntippoint.resize(max_weaponinstances); - lastdrawnrotation1.resize(max_weaponinstances); - lastdrawnrotation2.resize(max_weaponinstances); - lastdrawnrotation3.resize(max_weaponinstances); - lastdrawnbigrotation.resize(max_weaponinstances); - lastdrawnbigtilt.resize(max_weaponinstances); - lastdrawnbigtilt2.resize(max_weaponinstances); - lastdrawnsmallrotation.resize(max_weaponinstances); - lastdrawnsmallrotation2.resize(max_weaponinstances); - lastdrawnanim.resize(max_weaponinstances); // Model throwingknifemodel; knifetextureptr = 0; diff --git a/Source/Weapons.h b/Source/Weapons.h index bebf6ee..30fa1bb 100644 --- a/Source/Weapons.h +++ b/Source/Weapons.h @@ -25,49 +25,53 @@ class Weapons { public: - std::vector rotation1,rotation2,rotation3; - std::vector bigrotation; - std::vector bigtilt; - std::vector bigtilt2; - std::vector smallrotation; - std::vector smallrotation2; + float rotation1[max_weaponinstances]; + float rotation2[max_weaponinstances]; + float rotation3[max_weaponinstances]; + float bigrotation[max_weaponinstances]; + float bigtilt[max_weaponinstances]; + float bigtilt2[max_weaponinstances]; + float smallrotation[max_weaponinstances]; + float smallrotation2[max_weaponinstances]; int numweapons; - std::vector damage; - std::vector tippoint; - std::vector oldtippoint; - std::vector position; - std::vector lastmult; - std::vector oldposition; - std::vector velocity; - std::vector tipvelocity; - std::vector type; - std::vector oldowner; - std::vector owner; - std::vector bloody; - std::vector blooddrip; - std::vector blooddripdelay; - std::vector onfire; - std::vector flamedelay; - std::vector missed; - std::vector mass; - std::vector tipmass; - std::vector length; - std::vector freetime; - std::vector firstfree; - std::vector physics; - std::vector drawhowmany; - std::vector hitsomething; + float damage[max_weaponinstances]; + XYZ tippoint[max_weaponinstances]; + XYZ oldtippoint[max_weaponinstances]; + XYZ position[max_weaponinstances]; + float lastmult[max_weaponinstances]; + XYZ oldposition[max_weaponinstances]; + XYZ velocity[max_weaponinstances]; + XYZ tipvelocity[max_weaponinstances]; + int type[max_weaponinstances]; + int oldowner[max_weaponinstances]; + int owner[max_weaponinstances]; + int bloody[max_weaponinstances]; + float blooddrip[max_weaponinstances]; + float blooddripdelay[max_weaponinstances]; + bool onfire[max_weaponinstances]; + float flamedelay[max_weaponinstances]; + bool missed[max_weaponinstances]; + float mass[max_weaponinstances]; + float tipmass[max_weaponinstances]; + float length[max_weaponinstances]; + float freetime[max_weaponinstances]; + bool firstfree[max_weaponinstances]; + bool physics[max_weaponinstances]; + float drawhowmany[max_weaponinstances]; + bool hitsomething[max_weaponinstances]; - std::vector lastdrawnposition; - std::vector lastdrawntippoint; - std::vector lastdrawnrotation1,lastdrawnrotation2,lastdrawnrotation3; - std::vector lastdrawnbigrotation; - std::vector lastdrawnbigtilt; - std::vector lastdrawnbigtilt2; - std::vector lastdrawnsmallrotation; - std::vector lastdrawnsmallrotation2; - std::vector lastdrawnanim; + XYZ lastdrawnposition[max_weaponinstances]; + XYZ lastdrawntippoint[max_weaponinstances]; + float lastdrawnrotation1[max_weaponinstances]; + float lastdrawnrotation2[max_weaponinstances]; + float lastdrawnrotation3[max_weaponinstances]; + float lastdrawnbigrotation[max_weaponinstances]; + float lastdrawnbigtilt[max_weaponinstances]; + float lastdrawnbigtilt2[max_weaponinstances]; + float lastdrawnsmallrotation[max_weaponinstances]; + float lastdrawnsmallrotation2[max_weaponinstances]; + int lastdrawnanim[max_weaponinstances]; Model throwingknifemodel; GLuint knifetextureptr;