Kaynağa Gözat

Fixes for Linux compilation

Thomas Buck 9 yıl önce
ebeveyn
işleme
f420cc3872
5 değiştirilmiş dosya ile 11 ekleme ve 13 silme
  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 Dosyayı Görüntüle

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

+ 0
- 9
include/global.h Dosyayı Görüntüle

@@ -70,15 +70,6 @@ typedef enum {
70 70
 #ifdef __APPLE__
71 71
 #include <OpenGL/gl3.h>
72 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 73
 #endif // __APPLE__
83 74
 
84 75
 /*! \fixme Is there a better way to handle this?

+ 7
- 2
src/Log.cpp Dosyayı Görüntüle

@@ -8,12 +8,17 @@
8 8
 #include "global.h"
9 9
 #include "Log.h"
10 10
 
11
-LogLevel Log::logs[LOG_COUNT] = { 0, 1, 2, 3, 4 };
11
+std::vector<LogLevel> Log::logs;
12 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 19
 LogLevel& Log::get(int level) {
15 20
     assertGreaterThanEqual(level, 0);
16 21
     assertLessThan(level, LOG_COUNT);
17
-    return logs[level];
22
+    return logs.at(level);
18 23
 }
19 24
 

+ 1
- 0
src/main.cpp Dosyayı Görüntüle

@@ -44,6 +44,7 @@ int main(int argc, char* argv[]) {
44 44
     command_free(&cmd);
45 45
 
46 46
     // RunTime is required by other constructors
47
+    Log::initialize();
47 48
     RunTime::initialize();
48 49
 
49 50
     gWorld.reset(new World());

+ 1
- 0
src/utils/Folder.cpp Dosyayı Görüntüle

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

Loading…
İptal
Kaydet