Kaynağa Gözat

Documented Particle

Thomas Buck 11 yıl önce
ebeveyn
işleme
d2e544ed08
5 değiştirilmiş dosya ile 325 ekleme ve 231 silme
  1. 2
    2
      Doxyfile
  2. 195
    0
      DoxygenLayout.xml
  3. 13
    28
      src/Particle.cpp
  4. 114
    200
      src/Particle.h
  5. 1
    1
      src/TombRaider.cpp

+ 2
- 2
Doxyfile Dosyayı Görüntüle

@@ -218,7 +218,7 @@ TAB_SIZE               = 4
218 218
 # "Side Effects:". You can put \n's in the value part of an alias to insert
219 219
 # newlines.
220 220
 
221
-ALIASES                = 
221
+ALIASES                = "fixme=\xrefitem fixme \"FIXME\" \"Fix Me\""
222 222
 
223 223
 # This tag can be used to specify a number of word-keyword mappings (TCL only).
224 224
 # A mapping has the form "name=value". For example adding "class=itcl::class"
@@ -651,7 +651,7 @@ FILE_VERSION_FILTER    =
651 651
 # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
652 652
 # tag is left empty.
653 653
 
654
-LAYOUT_FILE            = 
654
+LAYOUT_FILE            = DoxygenLayout.xml
655 655
 
656 656
 # The CITE_BIB_FILES tag can be used to specify one or more bib files containing
657 657
 # the reference definitions. This must be a list of .bib files. The .bib

+ 195
- 0
DoxygenLayout.xml Dosyayı Görüntüle

@@ -0,0 +1,195 @@
1
+<doxygenlayout version="1.0">
2
+  <!-- Generated by doxygen 1.8.5 -->
3
+  <!-- Navigation index tabs for HTML output -->
4
+  <navindex>
5
+    <tab type="mainpage" visible="yes" title=""/>
6
+    <tab type="pages" visible="yes" title="" intro=""/>
7
+    <tab type="modules" visible="yes" title="" intro=""/>
8
+    <tab type="namespaces" visible="yes" title="">
9
+      <tab type="namespacelist" visible="yes" title="" intro=""/>
10
+      <tab type="namespacemembers" visible="yes" title="" intro=""/>
11
+    </tab>
12
+    <tab type="classes" visible="yes" title="">
13
+      <tab type="classlist" visible="yes" title="" intro=""/>
14
+      <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
15
+      <tab type="hierarchy" visible="yes" title="" intro=""/>
16
+      <tab type="classmembers" visible="yes" title="" intro=""/>
17
+    </tab>
18
+    <tab type="files" visible="yes" title="">
19
+      <tab type="filelist" visible="yes" title="" intro=""/>
20
+      <tab type="globals" visible="yes" title="" intro=""/>
21
+    </tab>
22
+    <tab type="examples" visible="yes" title="" intro=""/>
23
+    <tab type="user" url="https://github.com/xythobuz/OpenRaider/wiki/_pages" title="Documentation"/>
24
+  </navindex>
25
+
26
+  <!-- Layout definition for a class page -->
27
+  <class>
28
+    <briefdescription visible="yes"/>
29
+    <includes visible="$SHOW_INCLUDE_FILES"/>
30
+    <inheritancegraph visible="$CLASS_GRAPH"/>
31
+    <collaborationgraph visible="$COLLABORATION_GRAPH"/>
32
+    <memberdecl>
33
+      <nestedclasses visible="yes" title=""/>
34
+      <publictypes title=""/>
35
+      <services title=""/>
36
+      <interfaces title=""/>
37
+      <publicslots title=""/>
38
+      <signals title=""/>
39
+      <publicmethods title=""/>
40
+      <publicstaticmethods title=""/>
41
+      <publicattributes title=""/>
42
+      <publicstaticattributes title=""/>
43
+      <protectedtypes title=""/>
44
+      <protectedslots title=""/>
45
+      <protectedmethods title=""/>
46
+      <protectedstaticmethods title=""/>
47
+      <protectedattributes title=""/>
48
+      <protectedstaticattributes title=""/>
49
+      <packagetypes title=""/>
50
+      <packagemethods title=""/>
51
+      <packagestaticmethods title=""/>
52
+      <packageattributes title=""/>
53
+      <packagestaticattributes title=""/>
54
+      <properties title=""/>
55
+      <events title=""/>
56
+      <privatetypes title=""/>
57
+      <privateslots title=""/>
58
+      <privatemethods title=""/>
59
+      <privatestaticmethods title=""/>
60
+      <privateattributes title=""/>
61
+      <privatestaticattributes title=""/>
62
+      <friends title=""/>
63
+      <related title="" subtitle=""/>
64
+      <membergroups visible="yes"/>
65
+    </memberdecl>
66
+    <detaileddescription title=""/>
67
+    <memberdef>
68
+      <inlineclasses title=""/>
69
+      <typedefs title=""/>
70
+      <enums title=""/>
71
+      <services title=""/>
72
+      <interfaces title=""/>
73
+      <constructors title=""/>
74
+      <functions title=""/>
75
+      <related title=""/>
76
+      <variables title=""/>
77
+      <properties title=""/>
78
+      <events title=""/>
79
+    </memberdef>
80
+    <allmemberslink visible="yes"/>
81
+    <usedfiles visible="$SHOW_USED_FILES"/>
82
+    <authorsection visible="yes"/>
83
+  </class>
84
+
85
+  <!-- Layout definition for a namespace page -->
86
+  <namespace>
87
+    <briefdescription visible="yes"/>
88
+    <memberdecl>
89
+      <nestednamespaces visible="yes" title=""/>
90
+      <constantgroups visible="yes" title=""/>
91
+      <classes visible="yes" title=""/>
92
+      <typedefs title=""/>
93
+      <enums title=""/>
94
+      <functions title=""/>
95
+      <variables title=""/>
96
+      <membergroups visible="yes"/>
97
+    </memberdecl>
98
+    <detaileddescription title=""/>
99
+    <memberdef>
100
+      <inlineclasses title=""/>
101
+      <typedefs title=""/>
102
+      <enums title=""/>
103
+      <functions title=""/>
104
+      <variables title=""/>
105
+    </memberdef>
106
+    <authorsection visible="yes"/>
107
+  </namespace>
108
+
109
+  <!-- Layout definition for a file page -->
110
+  <file>
111
+    <briefdescription visible="yes"/>
112
+    <includes visible="$SHOW_INCLUDE_FILES"/>
113
+    <includegraph visible="$INCLUDE_GRAPH"/>
114
+    <includedbygraph visible="$INCLUDED_BY_GRAPH"/>
115
+    <sourcelink visible="yes"/>
116
+    <memberdecl>
117
+      <classes visible="yes" title=""/>
118
+      <namespaces visible="yes" title=""/>
119
+      <constantgroups visible="yes" title=""/>
120
+      <defines title=""/>
121
+      <typedefs title=""/>
122
+      <enums title=""/>
123
+      <functions title=""/>
124
+      <variables title=""/>
125
+      <membergroups visible="yes"/>
126
+    </memberdecl>
127
+    <detaileddescription title=""/>
128
+    <memberdef>
129
+      <inlineclasses title=""/>
130
+      <defines title=""/>
131
+      <typedefs title=""/>
132
+      <enums title=""/>
133
+      <functions title=""/>
134
+      <variables title=""/>
135
+    </memberdef>
136
+    <authorsection/>
137
+  </file>
138
+
139
+  <!-- Layout definition for a group page -->
140
+  <group>
141
+    <briefdescription visible="yes"/>
142
+    <groupgraph visible="$GROUP_GRAPHS"/>
143
+    <memberdecl>
144
+      <nestedgroups visible="yes" title=""/>
145
+      <dirs visible="yes" title=""/>
146
+      <files visible="yes" title=""/>
147
+      <namespaces visible="yes" title=""/>
148
+      <classes visible="yes" title=""/>
149
+      <defines title=""/>
150
+      <typedefs title=""/>
151
+      <enums title=""/>
152
+      <enumvalues title=""/>
153
+      <functions title=""/>
154
+      <variables title=""/>
155
+      <signals title=""/>
156
+      <publicslots title=""/>
157
+      <protectedslots title=""/>
158
+      <privateslots title=""/>
159
+      <events title=""/>
160
+      <properties title=""/>
161
+      <friends title=""/>
162
+      <membergroups visible="yes"/>
163
+    </memberdecl>
164
+    <detaileddescription title=""/>
165
+    <memberdef>
166
+      <pagedocs/>
167
+      <inlineclasses title=""/>
168
+      <defines title=""/>
169
+      <typedefs title=""/>
170
+      <enums title=""/>
171
+      <enumvalues title=""/>
172
+      <functions title=""/>
173
+      <variables title=""/>
174
+      <signals title=""/>
175
+      <publicslots title=""/>
176
+      <protectedslots title=""/>
177
+      <privateslots title=""/>
178
+      <events title=""/>
179
+      <properties title=""/>
180
+      <friends title=""/>
181
+    </memberdef>
182
+    <authorsection visible="yes"/>
183
+  </group>
184
+
185
+  <!-- Layout definition for a directory page -->
186
+  <directory>
187
+    <briefdescription visible="yes"/>
188
+    <directorygraph visible="yes"/>
189
+    <memberdecl>
190
+      <dirs visible="yes"/>
191
+      <files visible="yes"/>
192
+    </memberdecl>
193
+    <detaileddescription title=""/>
194
+  </directory>
195
+</doxygenlayout>

+ 13
- 28
src/Particle.cpp Dosyayı Görüntüle

@@ -1,23 +1,9 @@
1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
-/*================================================================
3
- * 
4
- * Project : Freyja
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)2001Mongoose
10
- * Comments: Partcle system's atomic base
1
+/*!
2
+ * \file Particle.cpp
3
+ * \brief Particle system base implementation
11 4
  *
12
- *
13
- *           This file was generated using Mongoose's C++ 
14
- *           template generator script.  <stu7440@westga.edu>
15
- * 
16
- *-- History ------------------------------------------------- 
17
- *
18
- * 2001.08.13:
19
- * Mongoose - Created
20
- =================================================================*/
5
+ * \author Mongoose
6
+ */
21 7
 
22 8
 #include <stdlib.h>
23 9
 #include <stdio.h>
@@ -28,7 +14,6 @@
28 14
 #endif
29 15
 
30 16
 
31
-
32 17
 Particle::Particle()
33 18
 {
34 19
 	setActive(true);
@@ -91,20 +76,20 @@ void Particle::Reset()
91 76
 	_blend = (float)(rand() % 100) / 1000.0 + 0.003;
92 77
 
93 78
 	_pos[0] = _pos[1] = _pos[2] = 0.0;
94
-	
79
+
95 80
 	_dir[0] = (float)((rand() % 50) - 26.0) * 10.0;
96 81
 	_dir[1] = (float)((rand() % 50) - 25.0) * 10.0;
97 82
 	_dir[2] = _dir[1];
98
-	
83
+
99 84
 	_force[0] = 0.0;
100 85
 	_force[1] = -0.8;
101 86
 	_force[2] = 0.0;
102 87
 #else
103
-	// FIXME: _blend prob should have nonstatic range
88
+	//! \fixme _blend prob should have nonstatic range
104 89
 	_blend = (float)(0.003 + (0.1 * rand() / (RAND_MAX + 1.0))); // high order
105
-	//_blend = (float)(rand() % 100) / 1000.0 + 0.003; 
90
+	//_blend = (float)(rand() % 100) / 1000.0 + 0.003;
106 91
 
107
-	// FIXME: Reset these using some nonstatic functions and values later
92
+	//! \fixme Reset these using some nonstatic functions and values later
108 93
 	_life = 1.0;
109 94
 
110 95
 	_pos[0] = _pos[1] = _pos[2] = 0.0;
@@ -148,7 +133,7 @@ void Particle::Update()
148 133
 	_pos[0] += _dir[0] / _speed[0];
149 134
 	_pos[1] += _dir[1] / _speed[1];
150 135
 	_pos[2] += _dir[2] / _speed[2];
151
-	
136
+
152 137
 	// Adjust particle direction
153 138
 	_dir[0] += _force[0];
154 139
 	_dir[1] += _force[1];
@@ -156,7 +141,7 @@ void Particle::Update()
156 141
 
157 142
 	// Adjust particle blending/life
158 143
 	_life -= _blend;
159
-	
144
+
160 145
 	// Reset 'dead' OR fully blended particles
161 146
 	if (_life < 0.0)
162 147
 	{
@@ -172,6 +157,6 @@ int Particle::Texture()
172 157
 
173 158
 
174 159
 bool Particle::isActive()
175
-{ 
160
+{
176 161
 	return _active;
177 162
 }

+ 114
- 200
src/Particle.h Dosyayı Görüntüle

@@ -1,210 +1,124 @@
1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
-/*================================================================
1
+/*!
2
+ * \file Particle.h
3
+ * \brief Particle system base header
3 4
  *
4
- * Project : Freyja
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)2001Mongoose
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
- * 2001.08.13:
19
- * Mongoose - Created
20
- ================================================================*/
21
-
5
+ * \author Mongoose
6
+ */
22 7
 
23 8
 #ifndef __FREYJA_MONGOOSE_PARTICLE_H_
24 9
 #define __FREYJA_MONGOOSE_PARTICLE_H_
25 10
 
26 11
 #include "hel/math.h"
27 12
 
28
-class Particle
29
-{
30
- public:
31
-
32
-  Particle();
33
-  /*------------------------------------------------------
34
-   * Pre  :
35
-   * Post : Constructs an object of Particle
36
-   *
37
-   *-- History ------------------------------------------
38
-   *
39
-   * 2001.08.13:
40
-   * Mongoose - Created
41
-   ------------------------------------------------------*/
42
-
43
-  ~Particle();
44
-  /*------------------------------------------------------
45
-   * Pre  : Particle object is allocated
46
-   * Post : Deconstructs an object of Particle
47
-   *
48
-   *-- History ------------------------------------------
49
-   *
50
-   * 2001.08.13:
51
-   * Mongoose - Created
52
-   ------------------------------------------------------*/
53
-
54
-	void setActive(bool active);
55
-  /*------------------------------------------------------
56
-   * Pre  :
57
-   * Post : Toggles active state of particle
58
-   *
59
-   *-- History ------------------------------------------
60
-   *
61
-   * 2001.08.13:
62
-   * Mongoose - Created
63
-   ------------------------------------------------------*/
64
-
65
-  void Force(float x, float y, float z);
66
-  /*------------------------------------------------------
67
-   * Pre  :
68
-   * Post : Sets gravity/force acting on particle
69
-   *
70
-   *-- History ------------------------------------------
71
-   *
72
-   * 2001.08.13:
73
-   * Mongoose - Created
74
-   ------------------------------------------------------*/
75
-
76
-  void Reset();
77
-  /*------------------------------------------------------
78
-   * Pre  :
79
-   * Post : Resets particle to defaults
80
-   *
81
-   *-- History ------------------------------------------
82
-   *
83
-   * 2001.08.13:
84
-   * Mongoose - Created
85
-   ------------------------------------------------------*/
86
-
87
-  void Speed(float x, float y, float z);
88
-  /*------------------------------------------------------
89
-   * Pre  : note speed inits at 2000, lower is faster
90
-   * Post : Sets particle speed
91
-   *
92
-   *-- History ------------------------------------------
93
-   *
94
-   * 2001.08.14:
95
-   * Mongoose - Created
96
-   ------------------------------------------------------*/
97
-
98
-  void Color(float r, float g, float b);
99
-  /*------------------------------------------------------
100
-   * Pre  : r,g,b are colors 0.0 to 1.0
101
-   * Post : Sets new particle coloring
102
-	*
103
-	* NOTE : White {1.0, 1.0, 1.0} is the init color
104
-   *
105
-   *-- History ------------------------------------------
106
-   *
107
-   * 2001.08.14:
108
-   * Mongoose - Created
109
-   ------------------------------------------------------*/
110
-
111
-  void Pos(float *x, float *y, float *z);
112
-  /*------------------------------------------------------
113
-   * Pre  : x,y,z exist
114
-   * Post : Returns position of particle in 3 space
115
-   *
116
-   *-- History ------------------------------------------
117
-   *
118
-   * 2001.08.13:
119
-   * Mongoose - Created
120
-   ------------------------------------------------------*/
121
-
122
-  void Color(float *r, float *g, float *b);
123
-  /*------------------------------------------------------
124
-   * Pre  : r,g,b exist
125
-   * Post : Returns current color of particle
126
-   *
127
-   *-- History ------------------------------------------
128
-   *
129
-   * 2001.08.13:
130
-   * Mongoose - Created
131
-   ------------------------------------------------------*/
132
-
133
-  float Life();
134
-  /*------------------------------------------------------
135
-   * Pre  :
136
-   * Post : Returns current life ( blend ) of particle
137
-   *
138
-   *-- History ------------------------------------------
139
-   *
140
-   * 2001.08.13:
141
-   * Mongoose - Created
142
-   ------------------------------------------------------*/
143
-
144
-  void Update();
145
-  /*------------------------------------------------------
146
-   * Pre  :
147
-   * Post : Ajusts for particle life cycle
148
-   *
149
-   *-- History ------------------------------------------
150
-   *
151
-   * 2001.08.13:
152
-   * Mongoose - Created
153
-   ------------------------------------------------------*/
154
-
155
-  int Texture();
156
-  /*------------------------------------------------------
157
-   * Pre  :
158
-   * Post : Returens texture binding for this particle
159
-   *
160
-   *-- History ------------------------------------------
161
-   *
162
-   * 2001.08.13:
163
-   * Mongoose - Created
164
-   ------------------------------------------------------*/
165
-
166
-  bool isActive();
167
-  /*------------------------------------------------------
168
-   * Pre  :
169
-   * Post : Returns active value
170
-   *
171
-   *-- History ------------------------------------------
172
-   *
173
-   * 2001.08.13:
174
-   * Mongoose - Created
175
-   ------------------------------------------------------*/
176
-
177
-  void TextureId(int t);
178
-  /*------------------------------------------------------
179
-   * Pre  :
180
-   * Post :
181
-   *
182
-   *-- History ------------------------------------------
183
-   *
184
-   * 2001.08.13:
185
-   * Mongoose - Created
186
-   ------------------------------------------------------*/
187
-
188
-
189
- private:
190
-
191
-	bool _active;           /* Is this particle in use? */
192
-
193
-	float _life;            /* Life of particle  */
194
-
195
-	float _blend;           /* Blend amount or fade */
196
-
197
-	int _texture;           /* Texture polygon to use */
198
-
199
-	vec3_t _pos;            /* Current position in 3 space */
200
-
201
-	vec3_t _color;          /* Current color */
202
-
203
-	vec3_t _dir;            /* Current direction */
204
-
205
-	vec3_t _force;          /* Current force or 'gravity' */
206
-
207
-	vec3_t _speed;          /* Speed of particle movement */
13
+/*!
14
+ * \brief Partcle systems atomic base
15
+ */
16
+class Particle {
17
+public:
18
+
19
+    /*!
20
+     * \brief Constructs an object of Sound
21
+     */
22
+    Particle();
23
+
24
+    /*!
25
+     * \brief Deconstructs an object of Sound
26
+     */
27
+    ~Particle();
28
+
29
+    /*!
30
+     * \brief Toggles active state of particle
31
+     * \param active new state
32
+     */
33
+    void setActive(bool active);
34
+
35
+    /*!
36
+     * \brief Sets gravity/force acting on particle
37
+     * \param x X part of force vector
38
+     * \param y Y part
39
+     * \param z Z part
40
+     */
41
+    void Force(float x, float y, float z);
42
+
43
+    /*!
44
+     * \brief Resets particle to defaults
45
+     */
46
+    void Reset();
47
+
48
+    /*!
49
+     * \brief Sets gravity/force acting on particle
50
+     * \note speed inits at 2000, lower is faster
51
+     * \param x X part of speed vector
52
+     * \param y Y part
53
+     * \param z Z part
54
+     */
55
+    void Speed(float x, float y, float z);
56
+
57
+    /*!
58
+     * \brief Sets new particle coloring
59
+     * \note White {1.0, 1.0, 1.0} is the init color
60
+     * \param r Red part, from 0.0 to 1.0
61
+     * \param g Green part, from 0.0 to 1.0
62
+     * \param b Blue part, from 0.0 to 1.0
63
+     */
64
+    void Color(float r, float g, float b);
65
+
66
+    /*!
67
+     * \brief Returns position of particle in 3 space
68
+     * \param x not NULL!
69
+     * \param y not NULL!
70
+     * \param z not NULL!
71
+     */
72
+    void Pos(float *x, float *y, float *z);
73
+
74
+    /*!
75
+     * \brief Returns current color of particle
76
+     * \param r not NULL!
77
+     * \param g not NULL!
78
+     * \param b not NULL!
79
+     */
80
+    void Color(float *r, float *g, float *b);
81
+
82
+    /*!
83
+     * \brief Returns current life (blend) of particle
84
+     * \returns fade of particle
85
+     */
86
+    float Life();
87
+
88
+    /*!
89
+     * \brief Adjusts for particle life cycle
90
+     */
91
+    void Update();
92
+
93
+    /*!
94
+     * \brief Returns texture binding for this particle
95
+     * \returns texture id
96
+     */
97
+    int Texture();
98
+
99
+    /*!
100
+     * \brief Returns active value
101
+     * \returns state
102
+     */
103
+    bool isActive();
104
+
105
+    /*!
106
+     * \brief Set the texture for this particle
107
+     * \param t new texture id
108
+     */
109
+    void TextureId(int t);
110
+
111
+
112
+private:
113
+    bool _active;  //!< Is this particle in use?
114
+    float _life;   //!< Life of particle
115
+    float _blend;  //!< Blend amount or fade
116
+    int _texture;  //!< Texture polygon to use
117
+    vec3_t _pos;   //!< Current position in 3 space
118
+    vec3_t _color; //!< Current color
119
+    vec3_t _dir;   //!< Current direction
120
+    vec3_t _force; //!< Current force or 'gravity'
121
+    vec3_t _speed; //!< Speed of particle movement
208 122
 };
209 123
 
210 124
 #endif

+ 1
- 1
src/TombRaider.cpp Dosyayı Görüntüle

@@ -4075,7 +4075,7 @@ int TombRaider::loadSFX(char *filename)
4075 4075
 
4076 4076
 	if (!f)
4077 4077
 	{
4078
-		perror("Couldn't load file: ");
4078
+		perror("Couldn't load SFX file");
4079 4079
 		return -1;
4080 4080
 	}
4081 4081
 

Loading…
İptal
Kaydet