Browse Source

Removed many unused files

Thomas Buck 10 years ago
parent
commit
86b41adeae
11 changed files with 36 additions and 828 deletions
  1. 7
    3
      ChangeLog
  2. 15
    18
      Makefile
  3. 0
    2
      src/World.h
  4. 0
    81
      src/hel/BoundingVolume.cpp
  5. 8
    30
      src/hel/BoundingVolume.h
  6. 0
    79
      src/hel/Entity.cpp
  7. 6
    28
      src/hel/Entity.h
  8. 0
    117
      src/hel/Mass.cpp
  9. 0
    151
      src/hel/Mass.h
  10. 0
    121
      src/hel/ParticleMass.h
  11. 0
    198
      src/mstl/Stack.h

+ 7
- 3
ChangeLog View File

@@ -6,9 +6,13 @@
6 6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
7 7
 
8 8
 	[ 20140107 ]
9
-	* Removed even more unused files (mstl/Vector.cpp)
10
-	* Removed hel/Simulation, as it depends on missing files
11
-	  (hel/CollisionObject)
9
+	* Removed hel/Mass. There was an object of this class in World,
10
+	  but it was never used!
11
+	* Removed even more unused files (mstl/Vector.cpp,
12
+	  hel/BoundingVolume.cpp, hel/Entity.cpp, hel/ParticleMass.h,
13
+	  mstl/Stack.h)
14
+	* Completely removed hel/Simulation, as it depends on missing
15
+	  files (hel/CollisionObject)
12 16
 	* Improved Makefile portability
13 17
 
14 18
 	[ 20140106 ]

+ 15
- 18
Makefile View File

@@ -177,35 +177,32 @@ depend:
177 177
 
178 178
 # Later hel will become a seperate library once it matures
179 179
 HEL_OBJ = \
180
-	$(BUILDDIR)/Mass.o \
181
-	$(BUILDDIR)/Vector3d.o \
180
+	$(BUILDDIR)/math.o \
182 181
 	$(BUILDDIR)/Matrix.o \
183
-	$(BUILDDIR)/ViewVolume.o \
184
-	$(BUILDDIR)/BoundingVolume.o \
185 182
 	$(BUILDDIR)/Quaternion.o \
186
-	$(BUILDDIR)/math.o \
187
-	$(BUILDDIR)/Entity.o
183
+	$(BUILDDIR)/Vector3d.o \
184
+	$(BUILDDIR)/ViewVolume.o
188 185
 
189 186
 OBJS = \
190 187
 	$(DEBUG_OBJ) \
191 188
 	$(HEL_OBJ) \
192
-	$(BUILDDIR)/mtk_tga.o \
193
-	$(BUILDDIR)/System.o \
194
-	$(BUILDDIR)/SDLSystem.o \
195
-	$(BUILDDIR)/OpenRaider.o \
196
-	$(BUILDDIR)/World.o \
197
-	$(BUILDDIR)/TombRaider.o \
198
-	$(BUILDDIR)/GLString.o \
199 189
 	$(BUILDDIR)/Camera.o \
190
+	$(BUILDDIR)/Emitter.o \
191
+	$(BUILDDIR)/GLString.o \
192
+	$(BUILDDIR)/Light.o \
193
+	$(BUILDDIR)/mtk_tga.o \
194
+	$(BUILDDIR)/Network.o \
200 195
 	$(BUILDDIR)/OpenGLMesh.o \
196
+	$(BUILDDIR)/OpenRaider.o \
197
+	$(BUILDDIR)/Particle.o \
201 198
 	$(BUILDDIR)/Render.o \
199
+	$(BUILDDIR)/SDLSystem.o \
200
+	$(BUILDDIR)/SkeletalModel.o \
202 201
 	$(BUILDDIR)/Sound.o \
203
-	$(BUILDDIR)/Network.o \
202
+	$(BUILDDIR)/System.o \
204 203
 	$(BUILDDIR)/Texture.o \
205
-	$(BUILDDIR)/Emitter.o \
206
-	$(BUILDDIR)/Particle.o \
207
-	$(BUILDDIR)/SkeletalModel.o \
208
-	$(BUILDDIR)/Light.o
204
+	$(BUILDDIR)/TombRaider.o \
205
+	$(BUILDDIR)/World.o
209 206
 
210 207
 
211 208
 $(BUILDDIR)/$(NAME) : $(OBJS)

+ 0
- 2
src/World.h View File

@@ -36,7 +36,6 @@
36 36
 #include "mstl/List.h"
37 37
 #include "mstl/Vector.h"
38 38
 #include "hel/math.h"
39
-#include "hel/Mass.h"
40 39
 
41 40
 
42 41
 // Mirrors TombRaider class' room flags really
@@ -161,7 +160,6 @@ typedef struct entity_s
161 160
 	void *tmpHook;
162 161
 	bool animate;
163 162
 
164
-	Mass mass;
165 163
 	/*
166 164
 	  float time, lastTime;
167 165
 	  int state, lastState;

+ 0
- 81
src/hel/BoundingVolume.cpp View File

@@ -1,81 +0,0 @@
1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
-/*================================================================
3
- * 
4
- * Project : libHel
5
- * Author  : Terry 'Mongoose' Hendrix II
6
- * Website : http://www.westga.edu/~stu7440/
7
- * Email   : stu7440@westga.edu
8
- * Object  : BoundingVolume
9
- * License : No use w/o permission (C) 2002 Mongoose
10
- * Comments: Bounding volume class for world/vis 
11
- *           culling/clipping/collision stuff
12
- *
13
- *
14
- *           This file was generated using Mongoose's C++ 
15
- *           template generator script.  <stu7440@westga.edu>
16
- * 
17
- *-- History ------------------------------------------------- 
18
- *
19
- * 2002.11.27:
20
- * Mongoose - Created
21
- =================================================================*/
22
-
23
-#include "BoundingVolume.h"
24
-
25
-
26
-////////////////////////////////////////////////////////////
27
-// Constructors
28
-////////////////////////////////////////////////////////////
29
-
30
-BoundingVolume::BoundingVolume()
31
-{
32
-}
33
-
34
-
35
-BoundingVolume::~BoundingVolume()
36
-{
37
-}
38
-
39
-
40
-////////////////////////////////////////////////////////////
41
-// Public Accessors
42
-////////////////////////////////////////////////////////////
43
-
44
-
45
-////////////////////////////////////////////////////////////
46
-// Public Mutators
47
-////////////////////////////////////////////////////////////
48
-
49
-
50
-////////////////////////////////////////////////////////////
51
-// Private Accessors
52
-////////////////////////////////////////////////////////////
53
-
54
-
55
-////////////////////////////////////////////////////////////
56
-// Private Mutators
57
-////////////////////////////////////////////////////////////
58
-
59
-
60
-////////////////////////////////////////////////////////////
61
-// Unit Test code
62
-////////////////////////////////////////////////////////////
63
-
64
-#ifdef UNIT_TEST_BOUNDINGVOLUME
65
-int runBoundingVolumeUnitTest()
66
-{
67
-	BoundingVolume vol;
68
-
69
-	return 0;
70
-}
71
-
72
-
73
-int main(int argc, char *argv[])
74
-{
75
-	printf("[BoundingVolume class test]\n");
76
-
77
-	runBoundingVolumeUnitTest();
78
-
79
-	return 0;
80
-}
81
-#endif

+ 8
- 30
src/hel/BoundingVolume.h View File

@@ -1,24 +1,24 @@
1 1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2 2
 /*================================================================
3
- * 
3
+ *
4 4
  * Project : libHel
5 5
  * Author  : Terry 'Mongoose' Hendrix II
6 6
  * Website : http://www.westga.edu/~stu7440/
7 7
  * Email   : stu7440@westga.edu
8 8
  * Object  : BoundingVolume
9 9
  * License : No use w/o permission (C) 2002 Mongoose
10
- * Comments: Bounding volume class for world/vis 
10
+ * Comments: Bounding volume class for world/vis
11 11
  *           culling/clipping/collision stuff
12 12
  *
13 13
  *
14
- *           This file was generated using Mongoose's C++ 
14
+ *           This file was generated using Mongoose's C++
15 15
  *           template generator script.  <stu7440@westga.edu>
16
- * 
16
+ *
17 17
  *-- Test Defines -----------------------------------------------
18
- *           
19
- * UNIT_TEST_BOUNDINGVOLUME - Builds BoundingVolume class unit test 
20 18
  *
21
- *-- History ------------------------------------------------ 
19
+ * UNIT_TEST_BOUNDINGVOLUME - Builds BoundingVolume class unit test
20
+ *
21
+ *-- History ------------------------------------------------
22 22
  *
23 23
  * 2002.11.27:
24 24
  * Mongoose - Created
@@ -36,7 +36,7 @@ class BoundingSphere
36 36
 public:
37 37
 	vec3_t mCenter;            /* Center of bounding sphere */
38 38
 
39
-	vec_t mRadius;             /* Raduis of bounding sphere */	
39
+	vec_t mRadius;             /* Raduis of bounding sphere */
40 40
 };
41 41
 
42 42
 
@@ -57,28 +57,6 @@ class BoundingVolume
57 57
 	// Constructors
58 58
 	////////////////////////////////////////////////////////////
59 59
 
60
-	BoundingVolume();
61
-	/*------------------------------------------------------
62
-	 * Pre  : 
63
-	 * Post : Constructs an object of BoundingVolume
64
-	 *
65
-	 *-- History ------------------------------------------
66
-	 *
67
-	 * 2002.11.27: 
68
-	 * Mongoose - Created
69
-	 ------------------------------------------------------*/
70
-
71
-	~BoundingVolume();
72
-	/*------------------------------------------------------
73
-	 * Pre  : BoundingVolume object is allocated
74
-	 * Post : Deconstructs an object of BoundingVolume
75
-	 *
76
-	 *-- History ------------------------------------------
77
-	 *
78
-	 * 2002.11.27: 
79
-	 * Mongoose - Created
80
-	 ------------------------------------------------------*/
81
-
82 60
 
83 61
 	////////////////////////////////////////////////////////////
84 62
 	// Public Accessors

+ 0
- 79
src/hel/Entity.cpp View File

@@ -1,79 +0,0 @@
1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
-/*================================================================
3
- * 
4
- * Project : libHel
5
- * Author  : Terry 'Mongoose' Hendrix II
6
- * Website : http://www.westga.edu/~stu7440/
7
- * Email   : stu7440@westga.edu
8
- * Object  : Entity
9
- * License : No use w/o permission (C) 2002 Mongoose
10
- * Comments: This is the base thing class
11
- *
12
- *
13
- *           This file was generated using Mongoose's C++ 
14
- *           template generator script.  <stu7440@westga.edu>
15
- * 
16
- *-- History ------------------------------------------------- 
17
- *
18
- * 2002.11.09:
19
- * Mongoose - Created
20
- =================================================================*/
21
-
22
-#include "Entity.h"
23
-
24
-
25
-////////////////////////////////////////////////////////////
26
-// Constructors
27
-////////////////////////////////////////////////////////////
28
-
29
-Entity::Entity()
30
-{
31
-}
32
-
33
-
34
-Entity::~Entity()
35
-{
36
-}
37
-
38
-
39
-////////////////////////////////////////////////////////////
40
-// Public Accessors
41
-////////////////////////////////////////////////////////////
42
-
43
-
44
-////////////////////////////////////////////////////////////
45
-// Public Mutators
46
-////////////////////////////////////////////////////////////
47
-
48
-
49
-////////////////////////////////////////////////////////////
50
-// Private Accessors
51
-////////////////////////////////////////////////////////////
52
-
53
-
54
-////////////////////////////////////////////////////////////
55
-// Private Mutators
56
-////////////////////////////////////////////////////////////
57
-
58
-
59
-////////////////////////////////////////////////////////////
60
-// Unit Test code
61
-////////////////////////////////////////////////////////////
62
-
63
-#ifdef UNIT_TEST_ENTITY
64
-int runEntityUnitTest(int argc, char *argv[])
65
-{
66
-	return 0;
67
-}
68
-
69
-
70
-int main(int argc, char *argv[])
71
-{
72
-	Entity test;
73
-
74
-
75
-	printf("[Entity class test]\n");
76
-
77
-	return runEntityUnitTest(argc, argv);
78
-}
79
-#endif

+ 6
- 28
src/hel/Entity.h View File

@@ -1,6 +1,6 @@
1 1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2 2
 /*================================================================
3
- * 
3
+ *
4 4
  * Project : Hel
5 5
  * Author  : Terry 'Mongoose' Hendrix II
6 6
  * Website : http://www.westga.edu/~stu7440/
@@ -10,14 +10,14 @@
10 10
  * Comments: This is the base thing class
11 11
  *
12 12
  *
13
- *           This file was generated using Mongoose's C++ 
13
+ *           This file was generated using Mongoose's C++
14 14
  *           template generator script.  <stu7440@westga.edu>
15
- * 
15
+ *
16 16
  *-- Test Defines -----------------------------------------------
17
- *           
18
- * UNIT_TEST_ENTITY - Builds Entity class as a console unit test 
19 17
  *
20
- *-- History ------------------------------------------------ 
18
+ * UNIT_TEST_ENTITY - Builds Entity class as a console unit test
19
+ *
20
+ *-- History ------------------------------------------------
21 21
  *
22 22
  * 2002.11.09:
23 23
  * Mongoose - Created
@@ -52,28 +52,6 @@ class Entity
52 52
 	// Constructors
53 53
 	////////////////////////////////////////////////////////////
54 54
 
55
-	Entity();
56
-	/*------------------------------------------------------
57
-	 * Pre  : 
58
-	 * Post : Constructs an object of Entity
59
-	 *
60
-	 *-- History ------------------------------------------
61
-	 *
62
-	 * 2002.11.09: 
63
-	 * Mongoose - Created
64
-	 ------------------------------------------------------*/
65
-
66
-	~Entity();
67
-	/*------------------------------------------------------
68
-	 * Pre  : Entity object is allocated
69
-	 * Post : Deconstructs an object of Entity
70
-	 *
71
-	 *-- History ------------------------------------------
72
-	 *
73
-	 * 2002.11.09: 
74
-	 * Mongoose - Created
75
-	 ------------------------------------------------------*/
76
-
77 55
 
78 56
 	////////////////////////////////////////////////////////////
79 57
 	// Public Accessors

+ 0
- 117
src/hel/Mass.cpp View File

@@ -1,117 +0,0 @@
1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
-/*================================================================
3
- * 
4
- * Project : Hel
5
- * Author  : Terry 'Mongoose' Hendrix II
6
- * Website : http://www.westga.edu/~stu7440/
7
- * Email   : stu7440@westga.edu
8
- * Object  : Mass
9
- * License : No use w/o permission (C) 2003 Mongoose
10
- * Comments: This is the class that has the mass - oh yass
11
- *
12
- *
13
- *           This file was generated using Mongoose's C++ 
14
- *           template generator script.  <stu7440@westga.edu>
15
- * 
16
- *-- History ------------------------------------------------- 
17
- *
18
- * 2003.06.02:
19
- * Mongoose - Created, based on algorithms from Erkin Tunca
20
- =================================================================*/
21
-
22
-#include "Mass.h"
23
-
24
-
25
-////////////////////////////////////////////////////////////
26
-// Constructors
27
-////////////////////////////////////////////////////////////
28
-
29
-Mass::Mass()
30
-{
31
-	mMass = 0.0;
32
-}
33
-
34
-
35
-Mass::Mass(vec_t mass)
36
-{
37
-	mMass = mass;
38
-}
39
-
40
-
41
-Mass::Mass(vec_t mass, const Vector3d &position, const Vector3d &velocity)
42
-{
43
-	mMass = mass;
44
-	mPos = position;
45
-	mVelocity = velocity;
46
-}
47
-
48
-
49
-Mass::~Mass()
50
-{
51
-}
52
-
53
-
54
-////////////////////////////////////////////////////////////
55
-// Public Accessors
56
-////////////////////////////////////////////////////////////
57
-
58
-
59
-////////////////////////////////////////////////////////////
60
-// Public Mutators
61
-////////////////////////////////////////////////////////////
62
-
63
-void Mass::applyForce(Vector3d force)
64
-{
65
-	mForce += force;
66
-}
67
-
68
-
69
-void Mass::rest()
70
-{
71
-	mForce = Vector3d(0, 0, 0);
72
-}
73
-
74
-
75
-void Mass::simulate(vec_t timeDelta)
76
-{
77
-	// The Euler Method, hhmmm... for now
78
-
79
-	// Update velocity
80
-	mVelocity += (mForce / mMass) * timeDelta;
81
-
82
-	// Update position, position = velocity * time delta
83
-	mPos += mVelocity * timeDelta;
84
-}
85
-
86
-
87
-////////////////////////////////////////////////////////////
88
-// Private Accessors
89
-////////////////////////////////////////////////////////////
90
-
91
-
92
-////////////////////////////////////////////////////////////
93
-// Private Mutators
94
-////////////////////////////////////////////////////////////
95
-
96
-
97
-////////////////////////////////////////////////////////////
98
-// Unit Test code
99
-////////////////////////////////////////////////////////////
100
-
101
-#ifdef UNIT_TEST_MASS
102
-int runMassUnitTest(int argc, char *argv[])
103
-{
104
-	Mass test;
105
-
106
-	return 0;
107
-}
108
-
109
-
110
-int main(int argc, char *argv[])
111
-{
112
-	printf("[Mass class test]\n");
113
-	runMassUnitTest(argc, argv);
114
-
115
-	return 0;
116
-}
117
-#endif

+ 0
- 151
src/hel/Mass.h View File

@@ -1,151 +0,0 @@
1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
-/*================================================================
3
- * 
4
- * Project : Hel
5
- * Author  : Terry 'Mongoose' Hendrix II
6
- * Website : http://www.westga.edu/~stu7440/
7
- * Email   : stu7440@westga.edu
8
- * Object  : Mass
9
- * License : No use w/o permission (C) 2003 Mongoose
10
- * Comments: This is the class that has the mass - oh yass
11
- *
12
- *
13
- *           This file was generated using Mongoose's C++ 
14
- *           template generator script.  <stu7440@westga.edu>
15
- * 
16
- *-- Test Defines -----------------------------------------------
17
- *           
18
- * UNIT_TEST_MASS - Builds Mass class as a console unit test 
19
- *
20
- *-- History ------------------------------------------------ 
21
- *
22
- * 2003.06.02:
23
- * Mongoose - Created, based on algorithms from Erkin Tunca
24
- ================================================================*/
25
-
26
-
27
-#ifndef GUARD__HEL_MONGOOSE_MASS_H_
28
-#define GUARD__HEL_MONGOOSE_MASS_H_
29
-
30
-#include <hel/math.h>
31
-#include <hel/Vector3d.h>
32
-
33
-class Mass
34
-{
35
- public:
36
-
37
-	////////////////////////////////////////////////////////////
38
-	// Constructors
39
-	////////////////////////////////////////////////////////////
40
-
41
-	Mass();
42
-	/*------------------------------------------------------
43
-	 * Pre  : 
44
-	 * Post : Constructs an object of Mass
45
-	 *
46
-	 *-- History ------------------------------------------
47
-	 *
48
-	 * 2003.06.02: 
49
-	 * Mongoose - Created
50
-	 ------------------------------------------------------*/
51
-
52
-	Mass(vec_t mass);
53
-	/*------------------------------------------------------
54
-	 * Pre  : 
55
-	 * Post : Constructs an object of Mass
56
-	 *
57
-	 *-- History ------------------------------------------
58
-	 *
59
-	 * 2003.06.02: 
60
-	 * Mongoose - Created
61
-	 ------------------------------------------------------*/
62
-
63
-	Mass(vec_t mass, const Vector3d &position, const Vector3d &velocity);
64
-	/*------------------------------------------------------
65
-	 * Pre  : 
66
-	 * Post : Constructs an object of Mass
67
-	 *
68
-	 *-- History ------------------------------------------
69
-	 *
70
-	 * 2003.06.02: 
71
-	 * Mongoose - Created
72
-	 ------------------------------------------------------*/
73
-
74
-	virtual ~Mass();
75
-	/*------------------------------------------------------
76
-	 * Pre  : Mass object is allocated
77
-	 * Post : Deconstructs an object of Mass
78
-	 *
79
-	 *-- History ------------------------------------------
80
-	 *
81
-	 * 2003.06.02: 
82
-	 * Mongoose - Created
83
-	 ------------------------------------------------------*/
84
-
85
-
86
-	////////////////////////////////////////////////////////////
87
-	// Public Accessors
88
-	////////////////////////////////////////////////////////////
89
-
90
-
91
-
92
-	////////////////////////////////////////////////////////////
93
-	// Public Mutators
94
-	////////////////////////////////////////////////////////////
95
-
96
-	virtual void applyForce(Vector3d force);
97
-	/*------------------------------------------------------
98
-	 * Pre  : 
99
-	 * Post : External force acts on... the mass
100
-	 *
101
-	 *-- History ------------------------------------------
102
-	 *
103
-	 * 2003.06.02:
104
-	 * Mongoose - Created
105
-	 ------------------------------------------------------*/
106
-
107
-	virtual void rest();
108
-	/*------------------------------------------------------
109
-	 * Pre  : 
110
-	 * Post : Reset forces acting on this mass
111
-	 *
112
-	 *-- History ------------------------------------------
113
-	 *
114
-	 * 2003.06.02:
115
-	 * Mongoose - Created
116
-	 ------------------------------------------------------*/
117
-
118
-	virtual void simulate(vec_t timeDelta);
119
-	/*------------------------------------------------------
120
-	 * Pre  : Given change in time
121
-	 * Post : Adjust velocity and position with respect to dt
122
-	 *
123
-	 *-- History ------------------------------------------
124
-	 *
125
-	 * 2003.06.02:
126
-	 * Mongoose - Created
127
-	 ------------------------------------------------------*/
128
-
129
-	vec_t mMass;          /* The value of the mass */
130
-
131
-	Vector3d mPos;        /* Location in 3 space of... the mass */
132
-
133
-	Vector3d mVelocity;   /* Velocity of... the mass */
134
-
135
-	Vector3d mForce;      /* Force acting on the mass */
136
-
137
-
138
- private:
139
-
140
-	////////////////////////////////////////////////////////////
141
-	// Private Accessors
142
-	////////////////////////////////////////////////////////////
143
-
144
-
145
-	////////////////////////////////////////////////////////////
146
-	// Private Mutators
147
-	////////////////////////////////////////////////////////////
148
-
149
-};
150
-
151
-#endif

+ 0
- 121
src/hel/ParticleMass.h View File

@@ -1,121 +0,0 @@
1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
-/*================================================================
3
- * 
4
- * Project : Hel
5
- * Author  : Terry 'Mongoose' Hendrix II
6
- * Website : http://www.westga.edu/~stu7440/
7
- * Email   : stu7440@westga.edu
8
- * Object  : Particle
9
- * License : No use w/o permission (C) 2001-2003 Mongoose
10
- * Comments: Partcle system's atomic base
11
- *
12
- *
13
- *           This file was generated using Mongoose's C++ 
14
- *           template generator script.  <stu7440@westga.edu>
15
- * 
16
- *-- History ------------------------------------------------ 
17
- *
18
- * 2003.06.02: 
19
- * Mongoose - Now using Hel mass system
20
- *
21
- * 2001.08.13:
22
- * Mongoose - Created
23
- ================================================================*/
24
-
25
-
26
-#ifndef __HEL_MONGOOSE_PARTICLEMASS_H_
27
-#define __HEL_MONGOOSE_PARTICLEMASS_H_
28
-
29
-#include <hel/Mass.h>
30
-
31
-
32
-class ParticleMass
33
-{
34
-public:
35
-
36
-	////////////////////////////////////////////////////////////
37
-	// Constructors
38
-	////////////////////////////////////////////////////////////
39
-
40
-	ParticleMass();
41
-	/*------------------------------------------------------
42
-	 * Pre  : 
43
-	 * Post : Constructs an object of Particle
44
-	 *
45
-	 *-- History ------------------------------------------
46
-	 *
47
-	 * 2001.08.13: 
48
-	 * Mongoose - Created
49
-	 ------------------------------------------------------*/
50
-
51
-	~ParticleMass();
52
-	/*------------------------------------------------------
53
-	 * Pre  : Particle object is allocated
54
-	 * Post : Deconstructs an object of Particle
55
-	 *
56
-	 *-- History ------------------------------------------
57
-	 *
58
-	 * 2001.08.13: 
59
-	 * Mongoose - Created
60
-	 ------------------------------------------------------*/
61
-
62
-	void simulate(vec_t timeDelta)
63
-	{
64
-	/*------------------------------------------------------
65
-	 * Pre  : 
66
-	 * Post : Ajusts for particle life cycle
67
-	 *
68
-	 *-- History ------------------------------------------
69
-	 *
70
-	 * 2001.08.13: 
71
-	 * Mongoose - Created
72
-	 ------------------------------------------------------*/
73
-
74
-		mLife -= mBlend * timeDelta;
75
-		
76
-		// Reset 'dead' OR fully blended particles
77
-		if (mLife < 0.0)
78
-		{
79
-			mLife = 1.0;
80
-		}
81
-
82
-		mMass->simulate(timeDelta);
83
-	}
84
-
85
-
86
-	////////////////////////////////////////////////////////////
87
-	// Public Accessors
88
-	////////////////////////////////////////////////////////////
89
-
90
-
91
-
92
-	////////////////////////////////////////////////////////////
93
-	// Public Mutators
94
-	////////////////////////////////////////////////////////////
95
-
96
-	Mass *mMass;				/* Particle mass */
97
-
98
-	bool mActive;           /* Is this particle in use? */
99
-	
100
-	int mTextureId;         /* Texture Id to use on polygon */	
101
-	
102
-	vec_t mLife;            /* Life of particle  */
103
-	
104
-	vec_t mBlend;           /* Blend amount or fade per sec */
105
-
106
-	vec3_t mColor;          /* Current color */
107
-
108
-private:
109
-
110
-	////////////////////////////////////////////////////////////
111
-	// Private Accessors
112
-	////////////////////////////////////////////////////////////
113
-
114
-
115
-	////////////////////////////////////////////////////////////
116
-	// Private Mutators
117
-	////////////////////////////////////////////////////////////
118
-
119
-};
120
-
121
-#endif

+ 0
- 198
src/mstl/Stack.h View File

@@ -1,198 +0,0 @@
1
-/*===============================================================
2
- * Project: Freyja
3
- * Author : Terry 'Mongoose' Hendrix II
4
- * Website: http://www.westga.edu/~stu7440/
5
- * Email  : stu7440@westga.edu
6
- * Object : Stack
7
- * Comment: 
8
- *
9
- *-- History -----------------------------------------------
10
- *
11
- * 2001-05-12:
12
- * Mongoose - Created
13
- ==============================================================*/
14
-
15
-#ifndef __MONGOOSE_FREYJA_STACK_H
16
-#define __MONGOOSE_FREYJA_STACK_H
17
-
18
-#include <stdio.h>
19
-#include <stdlib.h>
20
-
21
- 
22
-template <class T> class StackNode
23
-{
24
- public:
25
-
26
-  StackNode(T data)
27
-  {
28
-    _data  = data;
29
-    _prev = NULL;
30
-  }
31
-
32
-
33
-  ~StackNode()
34
-  {
35
-  }
36
-
37
-  void Data(T data)
38
-  {
39
-    _data = data;
40
-  }
41
-
42
-  T Data()
43
-  {
44
-    return _data;
45
-  }
46
-
47
-  StackNode<T> *Prev()
48
-  {
49
-    return _prev;
50
-  }
51
-
52
-  void Prev(StackNode<T> *prev)
53
-  {
54
-    _prev = prev;
55
-  }
56
-
57
- private:
58
-
59
-  StackNode<T> *_prev;
60
-
61
-  T _data;
62
-};
63
-
64
-
65
-
66
-template <class T> class Stack
67
-{
68
-public:
69
-
70
-   Stack()
71
-   {
72
-     _num_items = 0;
73
-     _top = NULL;
74
-   }
75
-   /*-----------------------------------------
76
-    * Created  : 990831 by Terry Hendrix II
77
-    * Modified : NA
78
-    * Inputs   : None
79
-    * Returns  : Nothing
80
-    * Pre      : None
81
-    * Post     : Constructs an Stack
82
-    -----------------------------------------*/
83
-
84
-   ~Stack()
85
-   {
86
-     while (_top) //(!Empty())
87
-       pop();
88
-   }
89
-   /*-----------------------------------------
90
-    * Created  : 990831 by Terry Hendrix II
91
-    * Modified : NA
92
-    * Inputs   : None
93
-    * Returns  : Nothing
94
-    * Pre      : None
95
-    * Post     : Deconstructs an Stack
96
-    -----------------------------------------*/
97
-
98
-   T peek()
99
-   {
100
-     if (_top)
101
-     {
102
-       return _top->Data();
103
-     }
104
-     else
105
-     {
106
-       fprintf(stderr, "Stack<T>::Peek> NULL _top!\n");     
107
-       return (T)0;
108
-     }
109
-   }
110
-   /*-----------------------------------------
111
-    * Created  : 990831 by Terry Hendrix II
112
-    * Modified : NA
113
-    * Inputs   : None
114
-    * Returns  : value of top stack element
115
-    * Pre      : stack isn't empty
116
-    * Post     : Returns top of stack's value
117
-    -----------------------------------------*/
118
-
119
-   T pop()
120
-   {
121
-     StackNode<T> *rm;
122
-     T data;
123
-
124
-
125
-     if (_top)
126
-     {
127
-       rm = _top;
128
-
129
-       data = _top->Data();
130
-       _top = _top->Prev();
131
-
132
-       delete rm;
133
-       _num_items--;
134
-
135
-       return data;
136
-     }
137
-     else
138
-     {
139
-       fprintf(stderr, "Stack<T>::Pop> NULL _top!\n");
140
-       return (T)0;
141
-     }
142
-   }
143
-   /*-----------------------------------------
144
-    * Created  : 990831 by Terry Hendrix II
145
-    * Modified : NA
146
-    * Inputs   : None
147
-    * Returns  : value of top stack element
148
-    * Pre      : stack isn't empty
149
-    * Post     : Removes top of stack and 
150
-    *            returns it's value
151
-    -----------------------------------------*/
152
-
153
-   void push(T data)
154
-   {
155
-     StackNode<T> *node;
156
-
157
-
158
-     node = new StackNode<T>(data);
159
-     node->Prev(_top);
160
-
161
-     _top = node;
162
-     _num_items++;
163
-   }
164
-   /*-----------------------------------------
165
-    * Created  : 990831 by Terry Hendrix II
166
-    * Modified : NA
167
-    * Inputs   : Value to push on top of stack
168
-    * Returns  : Nothing
169
-    * Pre      : Stack isn't full
170
-    * Post     : Stack has new top, with value i
171
-    -----------------------------------------*/
172
-
173
-   bool empty()
174
-   {
175
-     return (_num_items && _top);
176
-   }
177
-   /*-----------------------------------------
178
-    * Created  : 990831 by Terry Hendrix II
179
-    * Modified : NA
180
-    * Inputs   : None
181
-    * Returns  : true if stack is empty, else
182
-    *            returns false
183
-    * Pre      : None
184
-    * Post     : No side effect
185
-    -----------------------------------------*/
186
-
187
- private:
188
-
189
-  unsigned int _num_items;
190
-
191
-  StackNode<T> *_top;
192
-};
193
-
194
-#endif
195
-
196
-
197
-
198
-

Loading…
Cancel
Save