Procházet zdrojové kódy

No longer segfaults!

It seems as if it's trying to load levels :D
Thomas Buck před 10 roky
rodič
revize
a722a8a065
4 změnil soubory, kde provedl 28 přidání a 26 odebrání
  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 Zobrazit soubor

@@ -264,7 +264,7 @@ int GLString::BuildFontList(int index)
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 269
 	int sz = 60;
270 270
 	int n;

+ 22
- 22
src/GLString.h Zobrazit soubor

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

+ 4
- 2
src/System.cpp Zobrazit soubor

@@ -166,7 +166,7 @@ char *System::fullPath(char *path, char end)
166 166
 
167 167
 	if (path[0] == '~')
168 168
 	{
169
-#ifdef unix
169
+#if defined(unix) || defined(__APPLE__)
170 170
 		env = getenv("HOME");
171 171
 
172 172
 		if (!env || !env[0])
@@ -192,6 +192,8 @@ char *System::fullPath(char *path, char end)
192 192
 				dir[i] = path[1+(i-lenEnv)];
193 193
 			}
194 194
 		}
195
+#else
196
+#error Platform not supported!
195 197
 #endif
196 198
 	}
197 199
 	else
@@ -667,7 +669,7 @@ void System::resizeGL(unsigned int w, unsigned int h)
667 669
 
668 670
 // Mongoose 2002.03.23, Checks command to see if it's same
669 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 674
 	int i, j, lens, lenc;
673 675
 

+ 1
- 1
src/System.h Zobrazit soubor

@@ -509,7 +509,7 @@ public:
509 509
 
510 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 514
 	 * Pre  :
515 515
 	 * Post : Returns true if <Command> matches <Symbol>

Loading…
Zrušit
Uložit