Browse Source

Added main.h, removed rc_ methods.

Thomas Buck 11 years ago
parent
commit
3fe7ac2ece

+ 2
- 1
include/Sound.h View File

2
  * \file include/Sound.h
2
  * \file include/Sound.h
3
  * \brief This is the audio manager Header
3
  * \brief This is the audio manager Header
4
  *
4
  *
5
- * \author xythobuz
6
  * \author Mongoose
5
  * \author Mongoose
6
+ * \author xythobuz
7
  */
7
  */
8
 
8
 
9
 #ifndef _SOUND_H_
9
 #ifndef _SOUND_H_
109
 };
109
 };
110
 
110
 
111
 #endif
111
 #endif
112
+

+ 24
- 0
include/main.h View File

1
+/*!
2
+ * \file include/main.h
3
+ * \brief Where main() is
4
+ *
5
+ * \author xythobuz
6
+ */
7
+#ifndef _MAIN_H_
8
+#define _MAIN_H_
9
+
10
+/*!
11
+ * \brief atexit() handler
12
+ */
13
+void cleanupHandler(void);
14
+
15
+/*!
16
+ * \brief Program entry point
17
+ * \param argc number of arguments
18
+ * \param argv array with argc strings
19
+ * \returns 0 on success
20
+ */
21
+int main(int argc, char *argv[]);
22
+
23
+#endif
24
+

+ 1
- 0
include/math/Matrix.h View File

199
 };
199
 };
200
 
200
 
201
 #endif
201
 #endif
202
+

+ 1
- 0
include/math/Quaternion.h View File

199
 };
199
 };
200
 
200
 
201
 #endif
201
 #endif
202
+

+ 1
- 0
include/math/Vector3d.h View File

158
 };
158
 };
159
 
159
 
160
 #endif
160
 #endif
161
+

+ 1
- 0
include/math/math.h View File

69
 vec_t helRandomNum(vec_t from, vec_t to);
69
 vec_t helRandomNum(vec_t from, vec_t to);
70
 
70
 
71
 #endif
71
 #endif
72
+

+ 1
- 17
include/utils/strings.h View File

41
  */
41
  */
42
 char *fullPath(const char *path, char end);
42
 char *fullPath(const char *path, char end);
43
 
43
 
44
-/*!
45
- * \brief Checks if Command matches Symbol.
46
- * Returns the rest of the argument list back in command buffer, if any
47
- * \param symbol command string
48
- * \param command with arguments
49
- * \returns true if command matches symbol
50
- */
51
-bool rc_command(const char *symbol, char *command);
52
-
53
-/*!
54
- * \brief Interpret a string as a bool
55
- * \param buffer "true" or "false"
56
- * \param val is set to boolean interpretation of buffer
57
- * \returns -1 for null string, -2 if string is not "true" or "false"
58
- */
59
-int rc_get_bool(const char *buffer, bool *val);
60
-
61
 #endif
44
 #endif
45
+

+ 1
- 0
include/utils/tga.h View File

87
     __attribute__((format(printf, 5, 6)));
87
     __attribute__((format(printf, 5, 6)));
88
 
88
 
89
 #endif
89
 #endif
90
+

+ 1
- 0
include/utils/time.h View File

30
 void systemTimerReset();
30
 void systemTimerReset();
31
 
31
 
32
 #endif
32
 #endif
33
+

+ 2
- 3
src/Sound.cpp View File

2
  * \file src/Sound.cpp
2
  * \file src/Sound.cpp
3
  * \brief This is the audio manager Implementation
3
  * \brief This is the audio manager Implementation
4
  *
4
  *
5
- * \author xythobuz
6
  * \author Mongoose
5
  * \author Mongoose
6
+ * \author xythobuz
7
  */
7
  */
8
 
8
 
9
 #ifdef __APPLE__
9
 #ifdef __APPLE__
122
 }
122
 }
123
 
123
 
124
 //! \fixme Seperate sourcing and buffering, Mongoose 2002.01.04
124
 //! \fixme Seperate sourcing and buffering, Mongoose 2002.01.04
125
-int Sound::addFile(const char *filename, int *source, unsigned int flags)
126
-{
125
+int Sound::addFile(const char *filename, int *source, unsigned int flags) {
127
     ALsizei size;
126
     ALsizei size;
128
     ALfloat freq;
127
     ALfloat freq;
129
     ALenum format;
128
     ALenum format;

+ 2
- 0
src/main.cpp View File

9
 #include <stdio.h>
9
 #include <stdio.h>
10
 
10
 
11
 #include "config.h"
11
 #include "config.h"
12
+#include "main.h"
12
 
13
 
13
 void cleanupHandler() {
14
 void cleanupHandler() {
14
 
15
 
28
 
29
 
29
     return 0;
30
     return 0;
30
 }
31
 }
32
+

+ 5
- 40
src/utils/strings.cpp View File

74
 
74
 
75
     if (path[0] == '~') {
75
     if (path[0] == '~') {
76
 #if defined(unix) || defined(__APPLE__)
76
 #if defined(unix) || defined(__APPLE__)
77
+
77
 #ifdef __APPLE__
78
 #ifdef __APPLE__
78
         // Workaround for Mac OS X. See:
79
         // Workaround for Mac OS X. See:
79
         // http://stackoverflow.com/questions/20534788/why-does-wordexp-fail-with-wrde-syntax-on-os-x
80
         // http://stackoverflow.com/questions/20534788/why-does-wordexp-fail-with-wrde-syntax-on-os-x
80
         signal(SIGCHLD, SIG_DFL);
81
         signal(SIGCHLD, SIG_DFL);
81
 #endif
82
 #endif
83
+
82
         // Expand string into segments
84
         // Expand string into segments
83
         int res = wordexp(path, &word, 0);
85
         int res = wordexp(path, &word, 0);
86
+
84
 #ifdef __APPLE__
87
 #ifdef __APPLE__
85
         signal(SIGCHLD, SIG_IGN);
88
         signal(SIGCHLD, SIG_IGN);
86
 #endif
89
 #endif
90
+
87
         if (res != 0) {
91
         if (res != 0) {
88
             printf("fullPath> wordexp() failed: %d\n", res);
92
             printf("fullPath> wordexp() failed: %d\n", res);
89
             return NULL;
93
             return NULL;
108
 
112
 
109
         wordfree(&word);
113
         wordfree(&word);
110
 #else
114
 #else
111
-        printf("WARNING: Tilde expansion not supported on this platform!\n");
115
+        printf("WARNING: Tilde expansion not supported on this platform:\n\t%s\n", path);
112
         lenPath = strlen(path);
116
         lenPath = strlen(path);
113
         dir = new char[lenPath + 2]; // space for end char
117
         dir = new char[lenPath + 2]; // space for end char
114
         strncpy(dir, path, lenPath);
118
         strncpy(dir, path, lenPath);
130
     return dir;
134
     return dir;
131
 }
135
 }
132
 
136
 
133
-bool rc_command(const char *symbol, char *command) {
134
-    assert(symbol != NULL);
135
-    assert(symbol[0] != '\0');
136
-    assert(command != NULL);
137
-    assert(command[0] != '\0');
138
-
139
-    int lens = strlen(symbol);
140
-
141
-    if (strncmp(command, symbol, lens) == 0) {
142
-        int lenc = strlen(command);
143
-
144
-        //! \fixme Should ignore whitespace, but only if it is really there...?
145
-        // lens+1 skips '=' or ' '
146
-        for (int i = 0, j = lens+1; j < lenc; ++i, ++j) {
147
-            command[i] = command[j];
148
-            command[i+1] = 0;
149
-        }
150
-
151
-        return true;
152
-    }
153
-
154
-    return false;
155
-}
156
-
157
-int rc_get_bool(const char *buffer, bool *val) {
158
-    assert(buffer != NULL);
159
-    assert(buffer[0] != '\0');
160
-    assert(val != NULL);
161
-
162
-    if ((buffer[0] == '1') || (strncmp(buffer, "true", 4) == 0))
163
-        *val = true;
164
-    else if ((buffer[0] == '0') || (strncmp(buffer, "false", 5) == 0))
165
-        *val = false;
166
-    else
167
-        return -2;
168
-
169
-    return 0;
170
-}
171
-

Loading…
Cancel
Save