1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
From 276ca5b75bd9729ccc69795597dcc54c50a02e0d Mon Sep 17 00:00:00 2001
From: Braden Obrzut <admin@maniacsvault.net>
Date: Wed, 26 Jun 2013 19:01:00 -0400
Subject: [PATCH] - Fixed compilation on non-Windows systems by removing
dependency on src/Linux/platform.h
---
src/gl/models/gl_models_md2.cpp | 4 ++--
src/gl/system/gl_interface.h | 5 +++++
src/gl/system/gl_system.h | 1 -
src/gl/system/gl_wipe.cpp | 13 +++++++++++++
src/gl/textures/gl_hirestex.cpp | 4 ++--
5 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/src/gl/models/gl_models_md2.cpp b/src/gl/models/gl_models_md2.cpp
index 95a344c..1ff9862 100644
--- a/src/gl/models/gl_models_md2.cpp
+++ b/src/gl/models/gl_models_md2.cpp
@@ -176,7 +176,7 @@ bool FDMDModel::Load(const char * path, int, const char * buffer, int length)
// Translate each vertex.
for(k = 0, pVtx = pfr->vertices; k < info.numVertices; k++, pVtx++)
{
- UnpackVector(USHORT(pVtx->normal), frame->normals[k].xyz);
+ UnpackVector((unsigned short)(pVtx->normal), frame->normals[k].xyz);
for(c = 0; c < 3; c++)
{
frame->vertices[k].xyz[axis[c]] =
@@ -208,7 +208,7 @@ bool FDMDModel::Load(const char * path, int, const char * buffer, int length)
for(i = 0; i < info.numLODs; i++)
for(k = 0; k < lodInfo[i].numTriangles; k++)
for(c = 0; c < 3; c++)
- vertexUsage[SHORT(triangles[i][k].vertexIndices[c])] |= 1 << i;
+ vertexUsage[short(triangles[i][k].vertexIndices[c])] |= 1 << i;
loaded=true;
return true;
diff --git a/src/gl/system/gl_interface.h b/src/gl/system/gl_interface.h
index 8766ebc..3d54bf8 100644
--- a/src/gl/system/gl_interface.h
+++ b/src/gl/system/gl_interface.h
@@ -5,6 +5,11 @@
#define APIENTRY
#endif // __APPLE__
+#include "basictypes.h"
+#ifndef _WIN32
+typedef bool BOOL;
+#endif
+
#ifndef PFNGLMULTITEXCOORD2FPROC
typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
#endif
diff --git a/src/gl/system/gl_system.h b/src/gl/system/gl_system.h
index d48b559..5dc6cf5 100644
--- a/src/gl/system/gl_system.h
+++ b/src/gl/system/gl_system.h
@@ -88,7 +88,6 @@ inline T max( T a, T b) { return (((a)>(b)) ? (a) : (b)); }
#define _access(a,b) access(a,b)
#endif
#ifndef _WIN32
-#include "platform.h"
#include <SDL.h>
#endif
#include "gl/system/gl_interface.h"
diff --git a/src/gl/system/gl_wipe.cpp b/src/gl/system/gl_wipe.cpp
index f9f73a4..83f5abd 100644
--- a/src/gl/system/gl_wipe.cpp
+++ b/src/gl/system/gl_wipe.cpp
@@ -56,6 +56,19 @@
#include "gl/textures/gl_material.h"
#include "gl/utility/gl_templates.h"
+#ifndef _WIN32
+struct POINT {
+ SDWORD x;
+ SDWORD y;
+};
+struct RECT {
+ SDWORD left;
+ SDWORD top;
+ SDWORD right;
+ SDWORD bottom;
+};
+#endif
+
EXTERN_CVAR(Bool, gl_vid_compatibility)
//===========================================================================
diff --git a/src/gl/textures/gl_hirestex.cpp b/src/gl/textures/gl_hirestex.cpp
index 423a783..b7824bf 100644
--- a/src/gl/textures/gl_hirestex.cpp
+++ b/src/gl/textures/gl_hirestex.cpp
@@ -56,8 +56,8 @@
#include "d_main.h"
#include "zstring.h"
-#ifdef __GNUC__
-#include "Linux/platform.h" /* Without this it would fail on _access on line 374 (378 now) */
+#ifndef _WIN32
+#define _access(a,b) access(a,b)
#endif
static int Doom2Wad = -1;
--
1.8.3.2
|