Browse Source

No longer segfaults!

It seems as if it's trying to load levels :D
Thomas Buck 11 years ago
parent
commit
a722a8a065
4 changed files with 28 additions and 26 deletions
  1. 1
    1
      src/GLString.cpp
  2. 22
    22
      src/GLString.h
  3. 4
    2
      src/System.cpp
  4. 1
    1
      src/System.h

+ 1
- 1
src/GLString.cpp View File

264
 }
264
 }
265
 
265
 
266
 
266
 
267
-int GLString::glPrintf(int x, int y, int font, char *string, ...)
267
+int GLString::glPrintf(int x, int y, int font, const char *string, ...)
268
 {
268
 {
269
 	int sz = 60;
269
 	int sz = 60;
270
 	int n;
270
 	int n;

+ 22
- 22
src/GLString.h View File

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 : Mtk
4
  * Project : Mtk
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: Open GL rendering font/string class
10
  * Comments: Open GL rendering font/string class
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
  * 2002.01.01:
18
  * 2002.01.01:
19
  * Mongoose - Created
19
  * Mongoose - Created
42
 
42
 
43
 	GLString();
43
 	GLString();
44
 	/*------------------------------------------------------
44
 	/*------------------------------------------------------
45
-	 * Pre  : 
45
+	 * Pre  :
46
 	 * Post : Constructs an object of GLString
46
 	 * Post : Constructs an object of GLString
47
 	 *
47
 	 *
48
 	 *-- History ------------------------------------------
48
 	 *-- History ------------------------------------------
49
 	 *
49
 	 *
50
-	 * 2002.01.01: 
50
+	 * 2002.01.01:
51
 	 * Mongoose - Created
51
 	 * Mongoose - Created
52
 	 ------------------------------------------------------*/
52
 	 ------------------------------------------------------*/
53
 
53
 
58
 	 *
58
 	 *
59
 	 *-- History ------------------------------------------
59
 	 *-- History ------------------------------------------
60
 	 *
60
 	 *
61
-	 * 2002.01.01: 
61
+	 * 2002.01.01:
62
 	 * Mongoose - Created
62
 	 * Mongoose - Created
63
 	 ------------------------------------------------------*/
63
 	 ------------------------------------------------------*/
64
 
64
 
70
 	 *        and it's size should be 'max_fonts' since
70
 	 *        and it's size should be 'max_fonts' since
71
 	 *        you need a texture per font  =)
71
 	 *        you need a texture per font  =)
72
 	 *
72
 	 *
73
-    * Post : 
73
+    * Post :
74
     *
74
     *
75
     *-- History ------------------------------------------
75
     *-- History ------------------------------------------
76
     *
76
     *
77
-    * 2002.01.01: 
77
+    * 2002.01.01:
78
     * Mongoose - Created
78
     * Mongoose - Created
79
     ------------------------------------------------------*/
79
     ------------------------------------------------------*/
80
 
80
 
88
     *
88
     *
89
     *-- History ------------------------------------------
89
     *-- History ------------------------------------------
90
     *
90
     *
91
-    * 2002.03.30: 
91
+    * 2002.03.30:
92
     * Mongoose - Created
92
     * Mongoose - Created
93
     ------------------------------------------------------*/
93
     ------------------------------------------------------*/
94
 
94
 
100
     *
100
     *
101
     *-- History ------------------------------------------
101
     *-- History ------------------------------------------
102
     *
102
     *
103
-    * 2002.03.30: 
103
+    * 2002.03.30:
104
     * Mongoose - Created
104
     * Mongoose - Created
105
     ------------------------------------------------------*/
105
     ------------------------------------------------------*/
106
 
106
 
112
     *
112
     *
113
     *-- History ------------------------------------------
113
     *-- History ------------------------------------------
114
     *
114
     *
115
-    * 2002.03.30: 
115
+    * 2002.03.30:
116
     * Mongoose - Created
116
     * Mongoose - Created
117
     ------------------------------------------------------*/
117
     ------------------------------------------------------*/
118
 
118
 
129
     *
129
     *
130
     *-- History ------------------------------------------
130
     *-- History ------------------------------------------
131
     *
131
     *
132
-    * 2002.03.30: 
132
+    * 2002.03.30:
133
     * Mongoose - Created
133
     * Mongoose - Created
134
     ------------------------------------------------------*/
134
     ------------------------------------------------------*/
135
 
135
 
140
     *
140
     *
141
     *-- History ------------------------------------------
141
     *-- History ------------------------------------------
142
     *
142
     *
143
-    * 2002.01.03: 
143
+    * 2002.01.03:
144
     * Mongoose - Created
144
     * Mongoose - Created
145
     ------------------------------------------------------*/
145
     ------------------------------------------------------*/
146
 
146
 
154
     *
154
     *
155
     *-- History ------------------------------------------
155
     *-- History ------------------------------------------
156
     *
156
     *
157
-    * 2002.01.01: 
157
+    * 2002.01.01:
158
     * Mongoose - Created
158
     * Mongoose - Created
159
     ------------------------------------------------------*/
159
     ------------------------------------------------------*/
160
 
160
 
161
-   int glPrintf(int x, int y, int font, char *string, ...);
161
+   int glPrintf(int x, int y, int font, const char *string, ...);
162
    /*------------------------------------------------------
162
    /*------------------------------------------------------
163
     * Pre  : X, Y are valid screen coor
163
     * Pre  : X, Y are valid screen coor
164
 	 *        Font is valid font index
164
 	 *        Font is valid font index
174
     *
174
     *
175
     *-- History ------------------------------------------
175
     *-- History ------------------------------------------
176
     *
176
     *
177
-    * 2001.12.31: 
177
+    * 2001.12.31:
178
     * Mongoose - Created
178
     * Mongoose - Created
179
     ------------------------------------------------------*/
179
     ------------------------------------------------------*/
180
 
180
 
182
    /*------------------------------------------------------
182
    /*------------------------------------------------------
183
     * Pre  : Width and Height for the GL context
183
     * Pre  : Width and Height for the GL context
184
 	 *        Called after scene is rendered
184
 	 *        Called after scene is rendered
185
-	 *        
185
+	 *
186
 	 *        GL Culling disabled
186
 	 *        GL Culling disabled
187
 	 *
187
 	 *
188
     * Post : Renders strings over GL scene
188
     * Post : Renders strings over GL scene
189
     *
189
     *
190
     *-- History ------------------------------------------
190
     *-- History ------------------------------------------
191
     *
191
     *
192
-    * 2002.01.01: 
192
+    * 2002.01.01:
193
     * Mongoose - Created
193
     * Mongoose - Created
194
     ------------------------------------------------------*/
194
     ------------------------------------------------------*/
195
 
195
 
200
     *
200
     *
201
     *-- History ------------------------------------------
201
     *-- History ------------------------------------------
202
     *
202
     *
203
-    * 2002.01.04: 
203
+    * 2002.01.04:
204
     * Mongoose - Created
204
     * Mongoose - Created
205
     ------------------------------------------------------*/
205
     ------------------------------------------------------*/
206
 
206
 
215
 	 *
215
 	 *
216
 	 *-- History ------------------------------------------
216
 	 *-- History ------------------------------------------
217
 	 *
217
 	 *
218
-	 * 2002.01.01: 
218
+	 * 2002.01.01:
219
 	 * Mongoose - Created
219
 	 * Mongoose - Created
220
 	 ------------------------------------------------------*/
220
 	 ------------------------------------------------------*/
221
 #endif
221
 #endif
235
 
235
 
236
 	int *_font_base;	               /* Font GL list, base index list */
236
 	int *_font_base;	               /* Font GL list, base index list */
237
 
237
 
238
-	gl_string_t *_string;            /* Buffered strings and their 
238
+	gl_string_t *_string;            /* Buffered strings and their
239
 													properities */
239
 													properities */
240
 
240
 
241
 	float _scale;                    /* Default scale factor for new strings */
241
 	float _scale;                    /* Default scale factor for new strings */

+ 4
- 2
src/System.cpp View File

166
 
166
 
167
 	if (path[0] == '~')
167
 	if (path[0] == '~')
168
 	{
168
 	{
169
-#ifdef unix
169
+#if defined(unix) || defined(__APPLE__)
170
 		env = getenv("HOME");
170
 		env = getenv("HOME");
171
 
171
 
172
 		if (!env || !env[0])
172
 		if (!env || !env[0])
192
 				dir[i] = path[1+(i-lenEnv)];
192
 				dir[i] = path[1+(i-lenEnv)];
193
 			}
193
 			}
194
 		}
194
 		}
195
+#else
196
+#error Platform not supported!
195
 #endif
197
 #endif
196
 	}
198
 	}
197
 	else
199
 	else
667
 
669
 
668
 // Mongoose 2002.03.23, Checks command to see if it's same
670
 // Mongoose 2002.03.23, Checks command to see if it's same
669
 //   as symbol, then returns the arg list in command buffer
671
 //   as symbol, then returns the arg list in command buffer
670
-bool rc_command(char *symbol, char *command)
672
+bool rc_command(const char *symbol, char *command)
671
 {
673
 {
672
 	int i, j, lens, lenc;
674
 	int i, j, lens, lenc;
673
 
675
 

+ 1
- 1
src/System.h View File

509
 
509
 
510
 // Could make these static methods later, depends on API evolution
510
 // Could make these static methods later, depends on API evolution
511
 
511
 
512
-	bool rc_command(char *symbol, char *command);
512
+	bool rc_command(const char *symbol, char *command);
513
 	/*------------------------------------------------------
513
 	/*------------------------------------------------------
514
 	 * Pre  :
514
 	 * Pre  :
515
 	 * Post : Returns true if <Command> matches <Symbol>
515
 	 * Post : Returns true if <Command> matches <Symbol>

Loading…
Cancel
Save