Procházet zdrojové kódy

Fixes for Linux compilation

Thomas Buck před 9 roky
rodič
revize
f420cc3872
5 změnil soubory, kde provedl 11 přidání a 13 odebrání
  1. 2
    2
      include/Log.h
  2. 0
    9
      include/global.h
  3. 7
    2
      src/Log.cpp
  4. 1
    0
      src/main.cpp
  5. 1
    0
      src/utils/Folder.cpp

+ 2
- 2
include/Log.h Zobrazit soubor

34
   public:
34
   public:
35
     const static char endl = '\n';
35
     const static char endl = '\n';
36
 
36
 
37
+    static void initialize();
37
     static LogLevel& get(int level);
38
     static LogLevel& get(int level);
38
     static unsigned long size() { return wholeLog.size(); }
39
     static unsigned long size() { return wholeLog.size(); }
39
     static LogEntry& getEntry(unsigned long i) { return wholeLog.at(i); }
40
     static LogEntry& getEntry(unsigned long i) { return wholeLog.at(i); }
40
 
41
 
41
   private:
42
   private:
42
-    static LogLevel logs[LOG_COUNT];
43
-
43
+    static std::vector<LogLevel> logs;
44
     static std::vector<LogEntry> wholeLog;
44
     static std::vector<LogEntry> wholeLog;
45
     friend class LogLevel;
45
     friend class LogLevel;
46
 };
46
 };

+ 0
- 9
include/global.h Zobrazit soubor

70
 #ifdef __APPLE__
70
 #ifdef __APPLE__
71
 #include <OpenGL/gl3.h>
71
 #include <OpenGL/gl3.h>
72
 #else // __APPLE__
72
 #else // __APPLE__
73
-#ifdef _WIN32
74
-#include <GL/glew.h>
75
-#include <GL/wglew.h>
76
-#pragma comment(lib, "glew32.lib")
77
-#else // _WIN32
78
-//! \fixme gl3 header?
79
-#include <GL/gl.h>
80
-#include <GL/glext.h>
81
-#endif // _WIN32
82
 #endif // __APPLE__
73
 #endif // __APPLE__
83
 
74
 
84
 /*! \fixme Is there a better way to handle this?
75
 /*! \fixme Is there a better way to handle this?

+ 7
- 2
src/Log.cpp Zobrazit soubor

8
 #include "global.h"
8
 #include "global.h"
9
 #include "Log.h"
9
 #include "Log.h"
10
 
10
 
11
-LogLevel Log::logs[LOG_COUNT] = { 0, 1, 2, 3, 4 };
11
+std::vector<LogLevel> Log::logs;
12
 std::vector<LogEntry> Log::wholeLog;
12
 std::vector<LogEntry> Log::wholeLog;
13
 
13
 
14
+void Log::initialize() {
15
+    for (int i = 0; i < LOG_COUNT; i++)
16
+        logs.emplace_back(i);
17
+}
18
+
14
 LogLevel& Log::get(int level) {
19
 LogLevel& Log::get(int level) {
15
     assertGreaterThanEqual(level, 0);
20
     assertGreaterThanEqual(level, 0);
16
     assertLessThan(level, LOG_COUNT);
21
     assertLessThan(level, LOG_COUNT);
17
-    return logs[level];
22
+    return logs.at(level);
18
 }
23
 }
19
 
24
 

+ 1
- 0
src/main.cpp Zobrazit soubor

44
     command_free(&cmd);
44
     command_free(&cmd);
45
 
45
 
46
     // RunTime is required by other constructors
46
     // RunTime is required by other constructors
47
+    Log::initialize();
47
     RunTime::initialize();
48
     RunTime::initialize();
48
 
49
 
49
     gWorld.reset(new World());
50
     gWorld.reset(new World());

+ 1
- 0
src/utils/Folder.cpp Zobrazit soubor

6
  */
6
  */
7
 
7
 
8
 #include <algorithm>
8
 #include <algorithm>
9
+#include <cstring>
9
 #include <iostream>
10
 #include <iostream>
10
 
11
 
11
 #include "global.h"
12
 #include "global.h"

Loading…
Zrušit
Uložit