Browse Source

Fix for mac

develop
Pierre-Antoine 'ZHAJOR' Tible 7 years ago
parent
commit
5a3bedbd10

+ 5
- 0
TheGame/TheGame.pro View File

@@ -24,7 +24,12 @@ HEADERS  += mainwindow.h \
24 24
 
25 25
 FORMS    += mainwindow.ui
26 26
 
27
+unix:!macx {
27 28
 LIBS += -lGLU
29
+}
30
+macx:{
31
+LIBS += -framework OpenGL
32
+}
28 33
 
29 34
 win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../UGameEngine/release/ -lUGameEngine
30 35
 else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../UGameEngine/debug/ -lUGameEngine

+ 7
- 2
TheGame/openglrenderdevice.cpp View File

@@ -1,7 +1,12 @@
1 1
 #include "openglrenderdevice.h"
2 2
 #include <QRgb>
3
-#include "GL/gl.h"
4
-#include "GL/glu.h"
3
+#ifdef __APPLE__
4
+#include <OpenGL/gl.h>
5
+#include <OpenGL/glu.h>
6
+#else
7
+#include <GL/gl.h>
8
+#include <GL/glu.h>
9
+#endif
5 10
 
6 11
 OpenGLRenderDevice::OpenGLRenderDevice(QObject *parent)
7 12
     : AbstractRenderDevice(parent)

+ 7
- 1
UGameEngine/UGameEngine.pro View File

@@ -57,7 +57,13 @@ HEADERS += engine/ugameengine.h\
57 57
 
58 58
 # FLEX && BISON
59 59
 
60
-LIBS += -lfl -ly
60
+LIBS += -ly
61
+unix:!macx {
62
+LIBS += -lfl
63
+}
64
+macx:{
65
+LIBS += -ll
66
+}
61 67
 
62 68
 FLEXSOURCES = utils/lexer-wavefront-obj.l \
63 69
     utils/lexer-wavefront-mtl.l

+ 5
- 5
UGameEngine/utils/matrixmxn.hxx View File

@@ -51,7 +51,7 @@ uge_gm_tmpl_mnt bool GenericMatrix<M, N, T>::equal(const T &other) const
51 51
 {
52 52
     for (int i = 0; i < M; ++i) {
53 53
         for (int j = 0; j < N; ++j) {
54
-            if (_scalars[i][j] != other._scalars[i][j]) {
54
+            if (_scalars[i][j] != other.getScalar(i, j)) {
55 55
                 return false;
56 56
             }
57 57
         }
@@ -103,7 +103,7 @@ uge_gm_tmpl_mnt T &GenericMatrix<M, N, T>::add(const T &other)
103 103
 {
104 104
     for (int i = 0; i < M; ++i) {
105 105
         for (int j = 0; j < N; ++j) {
106
-            _scalars[i][j] += other._scalars[i][j];
106
+            _scalars[i][j] += other.getScalar(i, j);
107 107
         }
108 108
     }
109 109
     return *getThis();
@@ -123,7 +123,7 @@ uge_gm_tmpl_mnt T &GenericMatrix<M, N, T>::sub(const T &other)
123 123
 {
124 124
     for (int i = 0; i < M; ++i) {
125 125
         for (int j = 0; j < N; ++j) {
126
-            _scalars[i][j] -= other._scalars[i][j];
126
+            _scalars[i][j] -= other.getScalar(i, j);
127 127
         }
128 128
     }
129 129
     return *getThis();
@@ -148,7 +148,7 @@ uge_gm_tmpl_mnt T &GenericMatrix<M, N, T>::mult(const T &other)
148 148
 {
149 149
     for (int i = 0; i < M; ++i) {
150 150
         for (int j = 0; j < N; ++j) {
151
-            _scalars[i][j] *= other._scalars[i][j];
151
+            _scalars[i][j] *= other.getScalar(i, j);
152 152
         }
153 153
     }
154 154
     return *getThis();
@@ -190,7 +190,7 @@ uge_gm_tmpl_mnt T &GenericMatrix<M, N, T>::div(const T &other)
190 190
 {
191 191
     for (int i = 0; i < M; ++i) {
192 192
         for (int j = 0; j < N; ++j) {
193
-            _scalars[i][j] /= other._scalars[i][j];
193
+            _scalars[i][j] /= other.getScalar(i, j);
194 194
         }
195 195
     }
196 196
     return *getThis();

Loading…
Cancel
Save