]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Weapons.h
License: Update GPLv2+ header to match current FSF recommendation
[lugaru.git] / Source / Weapons.h
index bebf6eecfc770e85f39eee260ab6c6500d819f31..d92429c043f9019ccb4f4e2d4c137f9b19bed199 100644 (file)
@@ -1,3 +1,22 @@
+/*
+Copyright (C) 2003, 2010 - Wolfire Games
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+Lugaru is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
 #ifndef _WEAPONS_H_
 #define _WEAPONS_H_
 
 
 #include "gamegl.h"
 #include "Quaternions.h"
-#include "fmod.h"
 #include "Skeleton.h"
 #include "Models.h"
-#include "Constants.h"
 #include "Terrain.h"
-#include "Sprites.h"
+#include "Sprite.h"
 #include "Person.h"
+#include "Texture.h"
 #include <cmath>
 
 #define max_weapons 30
 #define sword 2
 #define staff 3
 
-class Weapons
+class Weapon
+{
+public:
+    Weapon(int type, int owner);
+
+    static Model throwingknifemodel;
+    static Texture knifetextureptr;
+    static Texture lightbloodknifetextureptr;
+    static Texture bloodknifetextureptr;
+
+    static Model swordmodel;
+    static Texture swordtextureptr;
+    static Texture lightbloodswordtextureptr;
+    static Texture bloodswordtextureptr;
+
+    static Model staffmodel;
+    static Texture stafftextureptr;
+
+    void Draw();
+    void DoStuff(int);
+
+    int getType() {
+        return type;
+    }
+    void setType(int);
+
+    int owner;
+    XYZ position;
+    XYZ tippoint;
+    XYZ velocity;
+    XYZ tipvelocity;
+    bool missed;
+    bool hitsomething;
+    float freetime;
+    bool firstfree;
+    bool physics;
+
+    float damage;
+    int bloody;
+    float blooddrip;
+    float blooddripdelay;
+
+    float rotation1;
+    float rotation2;
+    float rotation3;
+    float bigrotation;
+    float bigtilt;
+    float bigtilt2;
+    float smallrotation;
+    float smallrotation2;
+private:
+    int type;
+
+    XYZ oldtippoint;
+    float lastmult;
+    XYZ oldposition;
+    int oldowner;
+    bool onfire;
+    float flamedelay;
+    float mass;
+    float tipmass;
+    float length;
+    float drawhowmany;
+
+    XYZ lastdrawnposition;
+    XYZ lastdrawntippoint;
+    float lastdrawnrotation1;
+    float lastdrawnrotation2;
+    float lastdrawnrotation3;
+    float lastdrawnbigrotation;
+    float lastdrawnbigtilt;
+    float lastdrawnbigtilt2;
+    float lastdrawnsmallrotation;
+    float lastdrawnsmallrotation2;
+    int lastdrawnanim;
+};
+
+class Weapons : public std::vector<Weapon>
 {
 public:
+    Weapons();
+    ~Weapons();
 
-       std::vector<float> rotation1,rotation2,rotation3;
-       std::vector<float> bigrotation;
-       std::vector<float> bigtilt;
-       std::vector<float> bigtilt2;
-       std::vector<float> smallrotation;
-       std::vector<float> smallrotation2;
-
-       int numweapons;
-       std::vector<float> damage;
-       std::vector<XYZ> tippoint;
-       std::vector<XYZ> oldtippoint;
-       std::vector<XYZ> position;
-       std::vector<float> lastmult;
-       std::vector<XYZ> oldposition;
-       std::vector<XYZ> velocity;
-       std::vector<XYZ> tipvelocity;
-       std::vector<int> type;
-       std::vector<int> oldowner;
-       std::vector<int> owner;
-       std::vector<int> bloody;
-       std::vector<float> blooddrip;
-       std::vector<float> blooddripdelay;
-       std::vector<bool> onfire;
-       std::vector<float> flamedelay;
-       std::vector<bool> missed;
-       std::vector<float> mass;
-       std::vector<float> tipmass;
-       std::vector<float> length;
-       std::vector<float> freetime;
-       std::vector<bool> firstfree;
-       std::vector<bool> physics;
-       std::vector<float> drawhowmany;
-       std::vector<bool> hitsomething;
-
-       std::vector<XYZ> lastdrawnposition;
-       std::vector<XYZ> lastdrawntippoint;
-       std::vector<float> lastdrawnrotation1,lastdrawnrotation2,lastdrawnrotation3;
-       std::vector<float> lastdrawnbigrotation;
-       std::vector<float> lastdrawnbigtilt;
-       std::vector<float> lastdrawnbigtilt2;
-       std::vector<float> lastdrawnsmallrotation;
-       std::vector<float> lastdrawnsmallrotation2;
-       std::vector<int> lastdrawnanim;
-
-       Model throwingknifemodel;
-       GLuint knifetextureptr;
-       GLuint lightbloodknifetextureptr;
-       GLuint bloodknifetextureptr;
-
-       Model swordmodel;
-       GLuint swordtextureptr;
-       GLuint lightbloodswordtextureptr;
-       GLuint bloodswordtextureptr;
-
-       Model staffmodel;
-       GLuint stafftextureptr;
-
-       int Draw();
-       void DoStuff();
-
-       Weapons();
-
-       ~Weapons();
+    int Draw();
+    void DoStuff();
 };
 
+extern Weapons weapons;
 #endif