Browse Source

Removed cmake windows.h detection

Thomas Buck 10 years ago
parent
commit
d8e3f8df9e
9 changed files with 14 additions and 35 deletions
  1. 2
    1
      TODO.md
  2. 0
    6
      include/TombRaider.h
  3. 0
    5
      include/config.h.in
  4. 1
    1
      include/global.h
  5. 0
    6
      src/CMakeLists.txt
  6. 1
    0
      src/Command.cpp
  7. 1
    1
      src/Menu.cpp
  8. 9
    9
      src/TombRaider.cpp
  9. 0
    6
      src/WindowSDL.cpp

+ 2
- 1
TODO.md View File

@@ -4,6 +4,7 @@
4 4
 
5 5
 * Endian dependence ugly, shouldn't dereference to different types?
6 6
     * TombRaider.h/cpp structs aren't aligned... unportable to some big endian & other archs?!
7
+    * Maybe replace loader with [VT](http://icculus.org/vt/), also used by OpenTomb.
7 8
 * Use more asserts
8 9
 * Don't use C-Style code, try to replace with C++ lib
9 10
     * Use std::strings
@@ -24,6 +25,6 @@
24 25
 ## Future Features
25 26
 
26 27
 * Cut TGA image reader, currently only used for menu background?!
27
-    * Abstract image reading/writing, like Font Engine selection
28
+    * Need useful, always available image writer alternative for screenshots then
28 29
 * When cutscene rendering is working, use TR4/5 style menu?
29 30
 

+ 0
- 6
include/TombRaider.h View File

@@ -12,12 +12,6 @@
12 12
 #include <cstdint>
13 13
 #include <cstdio>
14 14
 
15
-#ifdef WIN32
16
-typedef uint8_t u_int8_t;
17
-typedef uint16_t u_int16_t;
18
-typedef uint32_t u_int32_t;
19
-#endif
20
-
21 15
 #include "TombRaiderData.h"
22 16
 
23 17
 /*!

+ 0
- 5
include/config.h.in View File

@@ -24,10 +24,5 @@
24 24
 #cmakedefine HAVE_CLOSEDIR
25 25
 #cmakedefine HAVE_DT_DIR
26 26
 
27
-#cmakedefine HAVE_WINDOWS_H
28
-#cmakedefine HAVE_FINDFIRSTFILE
29
-#cmakedefine HAVE_FINDNEXTFILE
30
-#cmakedefine HAVE_FINDCLOSE
31
-
32 27
 #endif
33 28
 

+ 1
- 1
include/global.h View File

@@ -98,7 +98,7 @@ KeyboardButton stringToKeyboardButton(const char *key);
98 98
 #ifdef __APPLE__
99 99
 #include <OpenGL/gl.h>
100 100
 #else
101
-#ifdef HAVE_WINDOWS_H
101
+#ifdef _WIN32
102 102
 #include <windows.h>
103 103
 #endif
104 104
 #include <GL/gl.h>

+ 0
- 6
src/CMakeLists.txt View File

@@ -120,12 +120,6 @@ check_function_exists (readdir_r HAVE_READDIR_R)
120 120
 check_function_exists (closedir HAVE_CLOSEDIR)
121 121
 check_symbol_exists (DT_DIR "dirent.h" HAVE_DT_DIR)
122 122
 
123
-# recursive folder traversal for Windows
124
-check_include_files (windows.h HAVE_WINDOWS_H)
125
-check_function_exists (FindFirstFile HAVE_FINDFIRSTFILE)
126
-check_function_exists (FindNextFile HAVE_FINDNEXTFILE)
127
-check_function_exists (FindClose HAVE_FINDCLOSE)
128
-
129 123
 #################################################################
130 124
 
131 125
 # Configuration Header file

+ 1
- 0
src/Command.cpp View File

@@ -439,6 +439,7 @@ int OpenRaider::help(std::string &cmd) {
439 439
         getConsole().print("  crouch");
440 440
         getConsole().print("  use");
441 441
         getConsole().print("  holster");
442
+        getConsole().print("  walk");
442 443
         getConsole().print("Key-Format:");
443 444
         getConsole().print("  'a' or '1'    for character/number keys");
444 445
         getConsole().print("  \"leftctrl\"  for symbols and special keys");

+ 1
- 1
src/Menu.cpp View File

@@ -18,7 +18,7 @@
18 18
 #if defined(HAVE_DIRENT_H) && defined(HAVE_OPENDIR) && defined(HAVE_READDIR_R) && defined(HAVE_CLOSEDIR) && defined(HAVE_DT_DIR)
19 19
 #include <dirent.h>
20 20
 #define USE_DIRENT
21
-#elif (defined(HAVE_WINDOWS_H) && defined(HAVE_FINDFIRSTFILE) && defined(HAVE_FINDNEXTFILE) && defined(HAVE_FINDCLOSE)) || defined (_WIN32)
21
+#elif defined (_WIN32)
22 22
 #include <windows.h>
23 23
 #define USE_FINDFILE
24 24
 #else

+ 9
- 9
src/TombRaider.cpp View File

@@ -1782,7 +1782,7 @@ int TombRaider::Load(char *filename)
1782 1782
             mFreadMode = TR_FREAD_NORMAL;
1783 1783
             // 0x46464952
1784 1784
 
1785
-            //! \fixme (Endian) Read bitu32 / u_int32_t
1785
+            //! \fixme (Endian) Read bitu32 / uint32_t
1786 1786
             Fread(&mNumTR4Samples, 4, 1, f);
1787 1787
             printDebug("Load", "mNumTR4Samples = %i", mNumTR4Samples);
1788 1788
 
@@ -4931,11 +4931,11 @@ int TombRaider::loadTR5(FILE *f)
4931 4931
     unsigned int level_data_sz, riffOffset, seperator0;
4932 4932
     unsigned int portalOffset, nextRoomOffset, thisRoomOffset;
4933 4933
     int i, j, k;
4934
-    u_int16_t us;
4934
+    uint16_t us;
4935 4935
 
4936
-    u_int32_t numMeshData, numMeshPointers, u;
4937
-    u_int32_t *meshPointers;
4938
-    u_int8_t *meshData;
4936
+    uint32_t numMeshData, numMeshPointers, u;
4937
+    uint32_t *meshPointers;
4938
+    uint8_t *meshData;
4939 4939
     char check[32];
4940 4940
 
4941 4941
     printDebug("Load", "mEngineVersion = 0x%x", mPakVersion);
@@ -5107,7 +5107,7 @@ int TombRaider::loadTR5(FILE *f)
5107 5107
 
5108 5108
     // Mongoose 2002.01.08, Michiel has discovered the
5109 5109
     //   first 4 bytes here are 2 bitu16 flags for Lara type and weather
5110
-    u_int16_t laraType, weather;
5110
+    uint16_t laraType, weather;
5111 5111
 
5112 5112
     Fread(&laraType, 2, 1, f);
5113 5113
     printDebug("LoadTR5", "laraType = 0x%x", laraType);
@@ -5850,7 +5850,7 @@ int TombRaider::loadTR5(FILE *f)
5850 5850
     // Use pointers array to index in meshData array for tr5_mesh_t's
5851 5851
     Fread(&numMeshPointers, 4, 1, f);
5852 5852
     printDebug("LoadTR5", "numMeshPointers = %u", numMeshPointers);
5853
-    meshPointers = new u_int32_t[numMeshPointers];
5853
+    meshPointers = new uint32_t[numMeshPointers];
5854 5854
     Fread(meshPointers, 4, numMeshPointers, f);
5855 5855
 
5856 5856
     Fread(&numAnimationsTR5, 4, 1, f);
@@ -5885,7 +5885,7 @@ int TombRaider::loadTR5(FILE *f)
5885 5885
     Fread(&u, 4, 1, f);
5886 5886
     _num_frames = u;
5887 5887
     printDebug("LoadTR5", "_num_frames = %u", _num_frames);
5888
-    _frames = new u_int16_t[_num_frames];
5888
+    _frames = new uint16_t[_num_frames];
5889 5889
     Fread(_frames, 2, _num_frames, f);
5890 5890
 
5891 5891
     Fread(&numMoveablesTR5, 4, 1, f);
@@ -6068,7 +6068,7 @@ int TombRaider::loadTR5(FILE *f)
6068 6068
         fseek(f, u, SEEK_SET);
6069 6069
     }
6070 6070
 
6071
-    //! \fixme (Endian) Read bitu32 / u_int32_t
6071
+    //! \fixme (Endian) Read bitu32 / uint32_t
6072 6072
     Fread(&mNumTR4Samples, 4, 1, f);
6073 6073
     printDebug("Load", "mNumTR4Samples = %i", mNumTR4Samples);
6074 6074
 

+ 0
- 6
src/WindowSDL.cpp View File

@@ -24,12 +24,6 @@ WindowSDL::WindowSDL() {
24 24
     mTextInput = false;
25 25
     mWindow = NULL;
26 26
     mGLContext = NULL;
27
-
28
-#ifdef _WIN32
29
-    setDriver("libGL32.dll");
30
-#elif !defined(__APPLE__)
31
-    setDriver("/usr/lib/libGL.so.1");
32
-#endif
33 27
 }
34 28
 
35 29
 WindowSDL::~WindowSDL() {

Loading…
Cancel
Save