瀏覽代碼

Silenced more warnings!

Thomas Buck 10 年之前
父節點
當前提交
499e161678
共有 5 個文件被更改,包括 225 次插入222 次删除
  1. 2
    2
      src/Emitter.cpp
  2. 45
    45
      src/Emitter.h
  3. 169
    169
      src/OpenRaider.cpp
  4. 6
    3
      src/System.cpp
  5. 3
    3
      src/System.h

+ 2
- 2
src/Emitter.cpp 查看文件

68
 }
68
 }
69
 
69
 
70
 
70
 
71
-Emitter::Emitter(char *name, int n)
71
+Emitter::Emitter(const char *name, int n)
72
 {
72
 {
73
 	_name = NULL;
73
 	_name = NULL;
74
 	_flags = 0;
74
 	_flags = 0;
172
 }
172
 }
173
 
173
 
174
 
174
 
175
-void Emitter::Name(char *name)
175
+void Emitter::Name(const char *name)
176
 {
176
 {
177
 	int l;
177
 	int l;
178
 
178
 

+ 45
- 45
src/Emitter.h 查看文件

1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
 /*================================================================
2
 /*================================================================
3
- * 
3
+ *
4
  * Project : Freyja
4
  * Project : Freyja
5
  * Author  : Terry 'Mongoose' Hendrix II
5
  * Author  : Terry 'Mongoose' Hendrix II
6
  * Website : http://www.westga.edu/~stu7440/
6
  * Website : http://www.westga.edu/~stu7440/
10
  * Comments: Particle emitter for freyja
10
  * Comments: Particle emitter for freyja
11
  *
11
  *
12
  *
12
  *
13
- *           This file was generated using Mongoose's C++ 
13
+ *           This file was generated using Mongoose's C++
14
  *           template generator script.  <stu7440@westga.edu>
14
  *           template generator script.  <stu7440@westga.edu>
15
- * 
16
- *-- History ------------------------------------------------ 
15
+ *
16
+ *-- History ------------------------------------------------
17
  *
17
  *
18
  * 2001.08.13:
18
  * 2001.08.13:
19
  * Mongoose - Now using new Particle class!
19
  * Mongoose - Now using new Particle class!
33
 {
33
 {
34
  public:
34
  public:
35
 
35
 
36
-	typedef enum 
36
+	typedef enum
37
 	{
37
 	{
38
 		fUseFrustumCulling = 1,
38
 		fUseFrustumCulling = 1,
39
 		fUseDepthSorting = 2
39
 		fUseDepthSorting = 2
40
 	} EmitterFlags;
40
 	} EmitterFlags;
41
 
41
 
42
 
42
 
43
-  Emitter(char *name, int n);
43
+  Emitter(const char *name, int n);
44
   /*------------------------------------------------------
44
   /*------------------------------------------------------
45
    * Pre  : name is a valid C string
45
    * Pre  : name is a valid C string
46
 	*        n is a number greater than 0
46
 	*        n is a number greater than 0
49
    *
49
    *
50
    *-- History ------------------------------------------
50
    *-- History ------------------------------------------
51
    *
51
    *
52
-   * 2001.06.30: 
52
+   * 2001.06.30:
53
    * Mongoose - Created
53
    * Mongoose - Created
54
    ------------------------------------------------------*/
54
    ------------------------------------------------------*/
55
 
55
 
60
    *
60
    *
61
    *-- History ------------------------------------------
61
    *-- History ------------------------------------------
62
    *
62
    *
63
-   * 2001.06.30: 
63
+   * 2001.06.30:
64
    * Mongoose - Created
64
    * Mongoose - Created
65
    ------------------------------------------------------*/
65
    ------------------------------------------------------*/
66
 
66
 
67
    Particle *Particles();
67
    Particle *Particles();
68
   /*------------------------------------------------------
68
   /*------------------------------------------------------
69
-   * Pre  : 
69
+   * Pre  :
70
    * Post : Returns particle array
70
    * Post : Returns particle array
71
    *
71
    *
72
    *-- History ------------------------------------------
72
    *-- History ------------------------------------------
73
    *
73
    *
74
-   * 2001.08.14: 
74
+   * 2001.08.14:
75
    * Mongoose - Created
75
    * Mongoose - Created
76
    ------------------------------------------------------*/
76
    ------------------------------------------------------*/
77
 
77
 
78
   int Count();
78
   int Count();
79
   /*------------------------------------------------------
79
   /*------------------------------------------------------
80
-   * Pre  : 
80
+   * Pre  :
81
    * Post : Returns number of particles emitted
81
    * Post : Returns number of particles emitted
82
    *
82
    *
83
    *-- History ------------------------------------------
83
    *-- History ------------------------------------------
84
    *
84
    *
85
-   * 2001.08.14: 
85
+   * 2001.08.14:
86
    * Mongoose - Created
86
    * Mongoose - Created
87
    ------------------------------------------------------*/
87
    ------------------------------------------------------*/
88
 
88
 
93
    *
93
    *
94
    *-- History ------------------------------------------
94
    *-- History ------------------------------------------
95
    *
95
    *
96
-   * 2001.08.13: 
96
+   * 2001.08.13:
97
    * Mongoose - Created
97
    * Mongoose - Created
98
    ------------------------------------------------------*/
98
    ------------------------------------------------------*/
99
 
99
 
104
    *
104
    *
105
    *-- History ------------------------------------------
105
    *-- History ------------------------------------------
106
    *
106
    *
107
-   * 2001.08.13: 
107
+   * 2001.08.13:
108
    * Mongoose - Created
108
    * Mongoose - Created
109
    ------------------------------------------------------*/
109
    ------------------------------------------------------*/
110
 
110
 
115
    *
115
    *
116
    *-- History ------------------------------------------
116
    *-- History ------------------------------------------
117
    *
117
    *
118
-   * 2001.08.13: 
118
+   * 2001.08.13:
119
    * Mongoose - Created
119
    * Mongoose - Created
120
    ------------------------------------------------------*/
120
    ------------------------------------------------------*/
121
 
121
 
126
    *
126
    *
127
    *-- History ------------------------------------------
127
    *-- History ------------------------------------------
128
    *
128
    *
129
-   * 2001.08.13: 
129
+   * 2001.08.13:
130
    * Mongoose - Created
130
    * Mongoose - Created
131
    ------------------------------------------------------*/
131
    ------------------------------------------------------*/
132
 
132
 
133
   unsigned int Flags();
133
   unsigned int Flags();
134
   /*------------------------------------------------------
134
   /*------------------------------------------------------
135
-   * Pre  : 
135
+   * Pre  :
136
    * Post : Returns emitter flags
136
    * Post : Returns emitter flags
137
    *
137
    *
138
    *-- History ------------------------------------------
138
    *-- History ------------------------------------------
139
    *
139
    *
140
-   * 2001.08.14: 
140
+   * 2001.08.14:
141
    * Mongoose - Created
141
    * Mongoose - Created
142
    ------------------------------------------------------*/
142
    ------------------------------------------------------*/
143
 
143
 
144
 
144
 
145
   void Flags(unsigned int flag, bool op);
145
   void Flags(unsigned int flag, bool op);
146
   /*------------------------------------------------------
146
   /*------------------------------------------------------
147
-   * Pre  : 
148
-   * Post : Set and Unset flag with op 
147
+   * Pre  :
148
+   * Post : Set and Unset flag with op
149
 	*
149
 	*
150
 	*          true - set
150
 	*          true - set
151
 	*          flase - unset
151
 	*          flase - unset
152
    *
152
    *
153
    *-- History ------------------------------------------
153
    *-- History ------------------------------------------
154
    *
154
    *
155
-   * 2001.08.14: 
155
+   * 2001.08.14:
156
    * Mongoose - Created
156
    * Mongoose - Created
157
    ------------------------------------------------------*/
157
    ------------------------------------------------------*/
158
 
158
 
162
    * Post : Allocates the particle array and sets the count.
162
    * Post : Allocates the particle array and sets the count.
163
 	*        If the array has been allocated previously, then
163
 	*        If the array has been allocated previously, then
164
 	*        the array is deallocated and a new one made.
164
 	*        the array is deallocated and a new one made.
165
-	*         
165
+	*
166
    *
166
    *
167
    *-- History ------------------------------------------
167
    *-- History ------------------------------------------
168
    *
168
    *
169
-   * 2001.08.13: 
169
+   * 2001.08.13:
170
    * Mongoose - Created
170
    * Mongoose - Created
171
    ------------------------------------------------------*/
171
    ------------------------------------------------------*/
172
 
172
 
173
   void Draw();
173
   void Draw();
174
   /*------------------------------------------------------
174
   /*------------------------------------------------------
175
-   * Pre  : 
175
+   * Pre  :
176
    * Post : Renders particles
176
    * Post : Renders particles
177
    *
177
    *
178
    *-- History ------------------------------------------
178
    *-- History ------------------------------------------
179
    *
179
    *
180
-   * 2001.06.30: 
180
+   * 2001.06.30:
181
    * Mongoose - Created
181
    * Mongoose - Created
182
    ------------------------------------------------------*/
182
    ------------------------------------------------------*/
183
 
183
 
184
-  void Name(char *name);
184
+  void Name(const char *name);
185
   /*------------------------------------------------------
185
   /*------------------------------------------------------
186
    * Pre  : name is a valid C string
186
    * Pre  : name is a valid C string
187
    * Post : Sets the emitters name
187
    * Post : Sets the emitters name
188
    *
188
    *
189
    *-- History ------------------------------------------
189
    *-- History ------------------------------------------
190
    *
190
    *
191
-   * 2001.08.13: 
191
+   * 2001.08.13:
192
    * Mongoose - Created
192
    * Mongoose - Created
193
    ------------------------------------------------------*/
193
    ------------------------------------------------------*/
194
 
194
 
195
   void SetTextureId(int id);
195
   void SetTextureId(int id);
196
   /*------------------------------------------------------
196
   /*------------------------------------------------------
197
-   * Pre  : 
197
+   * Pre  :
198
    * Post : Resets all particle texture ids
198
    * Post : Resets all particle texture ids
199
    *
199
    *
200
    *-- History ------------------------------------------
200
    *-- History ------------------------------------------
201
    *
201
    *
202
-   * 2001.08.13: 
202
+   * 2001.08.13:
203
    * Mongoose - Created
203
    * Mongoose - Created
204
    ------------------------------------------------------*/
204
    ------------------------------------------------------*/
205
 
205
 
206
-  void TextureId(unsigned int particle_start, unsigned int particle_end, 
206
+  void TextureId(unsigned int particle_start, unsigned int particle_end,
207
 					  int id);
207
 					  int id);
208
   /*------------------------------------------------------
208
   /*------------------------------------------------------
209
-   * Pre  : particle_start and particle_end are a valid 
209
+   * Pre  : particle_start and particle_end are a valid
210
 	*        range of particles in the array
210
 	*        range of particles in the array
211
 	*
211
 	*
212
 	*        id is a valid texture id
212
 	*        id is a valid texture id
213
 	*
213
 	*
214
-   * Post : 
214
+   * Post :
215
    *
215
    *
216
    *-- History ------------------------------------------
216
    *-- History ------------------------------------------
217
    *
217
    *
218
-   * 2001.08.14: 
218
+   * 2001.08.14:
219
    * Mongoose - Created
219
    * Mongoose - Created
220
    ------------------------------------------------------*/
220
    ------------------------------------------------------*/
221
 
221
 
222
-  void Color(unsigned int particle_start, unsigned int particle_end, 
222
+  void Color(unsigned int particle_start, unsigned int particle_end,
223
 				 float r, float g, float b);
223
 				 float r, float g, float b);
224
   /*------------------------------------------------------
224
   /*------------------------------------------------------
225
-   * Pre  : particle_start and particle_end are a valid 
225
+   * Pre  : particle_start and particle_end are a valid
226
 	*        range of particles in the array
226
 	*        range of particles in the array
227
 	*
227
 	*
228
 	*        r,g,b are colors 0.0 to 1.0
228
 	*        r,g,b are colors 0.0 to 1.0
229
 	*
229
 	*
230
-   * Post : 
230
+   * Post :
231
    *
231
    *
232
    *-- History ------------------------------------------
232
    *-- History ------------------------------------------
233
    *
233
    *
234
-   * 2001.08.14: 
234
+   * 2001.08.14:
235
    * Mongoose - Created
235
    * Mongoose - Created
236
    ------------------------------------------------------*/
236
    ------------------------------------------------------*/
237
 
237
 
238
-  void Speed(unsigned int particle_start, unsigned int particle_end, 
238
+  void Speed(unsigned int particle_start, unsigned int particle_end,
239
 				 float x, float y, float z);
239
 				 float x, float y, float z);
240
   /*------------------------------------------------------
240
   /*------------------------------------------------------
241
-   * Pre  : particle_start and particle_end are a valid 
241
+   * Pre  : particle_start and particle_end are a valid
242
 	*        range of particles in the array
242
 	*        range of particles in the array
243
 	*
243
 	*
244
 	*        take note speed inits at 2000, lower is faster
244
 	*        take note speed inits at 2000, lower is faster
245
 	*
245
 	*
246
-   * Post : 
246
+   * Post :
247
    *
247
    *
248
    *-- History ------------------------------------------
248
    *-- History ------------------------------------------
249
    *
249
    *
250
-   * 2001.08.14: 
250
+   * 2001.08.14:
251
    * Mongoose - Created
251
    * Mongoose - Created
252
    ------------------------------------------------------*/
252
    ------------------------------------------------------*/
253
 
253
 
254
-  void Force(unsigned int particle_start, unsigned int particle_end, 
254
+  void Force(unsigned int particle_start, unsigned int particle_end,
255
 				 float x, float y, float z);
255
 				 float x, float y, float z);
256
   /*------------------------------------------------------
256
   /*------------------------------------------------------
257
-   * Pre  : particle_start and particle_end are a valid 
257
+   * Pre  : particle_start and particle_end are a valid
258
 	*        range of particles in the array
258
 	*        range of particles in the array
259
 	*
259
 	*
260
 	*        Force/Gravity acting on particles
260
 	*        Force/Gravity acting on particles
261
 	*
261
 	*
262
-   * Post : 
262
+   * Post :
263
    *
263
    *
264
    *-- History ------------------------------------------
264
    *-- History ------------------------------------------
265
    *
265
    *
266
-   * 2001.08.14: 
266
+   * 2001.08.14:
267
    * Mongoose - Created
267
    * Mongoose - Created
268
    ------------------------------------------------------*/
268
    ------------------------------------------------------*/
269
 
269
 

+ 169
- 169
src/OpenRaider.cpp
文件差異過大導致無法顯示
查看文件


+ 6
- 3
src/System.cpp 查看文件

332
 // Public Mutators
332
 // Public Mutators
333
 ////////////////////////////////////////////////////////////
333
 ////////////////////////////////////////////////////////////
334
 
334
 
335
-unsigned int System::addCommandMode(char *command)
335
+unsigned int System::addCommandMode(const char *command)
336
 {
336
 {
337
 	if (command && command[0] == '[')
337
 	if (command && command[0] == '[')
338
 	{
338
 	{
353
 }
353
 }
354
 
354
 
355
 
355
 
356
-void System::command(char *cmd)
356
+void System::command(const char *cmd)
357
 {
357
 {
358
 	bool modeFound = false;
358
 	bool modeFound = false;
359
+    char *cmdbuf;
359
 
360
 
360
 
361
 
361
 	if (!cmd || !cmd[0]) // Null command string
362
 	if (!cmd || !cmd[0]) // Null command string
380
 	}
381
 	}
381
 	else // Execute a command in current mode, eg "stat fps"
382
 	else // Execute a command in current mode, eg "stat fps"
382
 	{
383
 	{
383
-		handleCommand(cmd, mCommandMode);
384
+        cmdbuf = new char[strlen(cmd) + 1];
385
+        strncpy(cmdbuf, cmd, strlen(cmd) + 1);
386
+		handleCommand(cmdbuf, mCommandMode);
384
 	}
387
 	}
385
 }
388
 }
386
 
389
 

+ 3
- 3
src/System.h 查看文件

197
 	// Public Mutators
197
 	// Public Mutators
198
 	////////////////////////////////////////////////////////////
198
 	////////////////////////////////////////////////////////////
199
 
199
 
200
-	virtual unsigned int addCommandMode(char *command);
200
+	virtual unsigned int addCommandMode(const char *command);
201
 	/*------------------------------------------------------
201
 	/*------------------------------------------------------
202
 	 * Pre  : <Command> is valid command mode for the
202
 	 * Pre  : <Command> is valid command mode for the
203
 	 *        resource file, eg "[Engine.OpenGL.Driver]"
203
 	 *        resource file, eg "[Engine.OpenGL.Driver]"
224
 	 * Mongoose - Created
224
 	 * Mongoose - Created
225
 	 ------------------------------------------------------*/
225
 	 ------------------------------------------------------*/
226
 
226
 
227
-	virtual void command(char *cmd);
227
+	virtual void command(const char *cmd);
228
 	/*------------------------------------------------------
228
 	/*------------------------------------------------------
229
 	 * Pre  : cmd is a valid command string
229
 	 * Pre  : cmd is a valid command string
230
 	 * Post : cmd sets it's var
230
 	 * Post : cmd sets it's var
488
 
488
 
489
 	bool mConsoleMode;         /* Using text (console) event handler? */
489
 	bool mConsoleMode;         /* Using text (console) event handler? */
490
 
490
 
491
-	Vector<char *> mCmdModes;	/* Dynamic resource command collection */
491
+	Vector<const char *> mCmdModes;	/* Dynamic resource command collection */
492
 
492
 
493
 	unsigned int mCommandMode;	/* Current resource command mode */
493
 	unsigned int mCommandMode;	/* Current resource command mode */
494
 
494
 

Loading…
取消
儲存