Browse Source

Removed unused code

Thomas Buck 10 years ago
parent
commit
85535e169d
8 changed files with 9 additions and 60 deletions
  1. 2
    2
      README.md
  2. 0
    16
      include/Render.h
  3. 2
    2
      include/utils/math.h
  4. 2
    4
      include/utils/tga.h
  5. 0
    6
      src/OpenRaider.cpp
  6. 0
    4
      src/Render.cpp
  7. 2
    26
      src/utils/math.cpp
  8. 1
    0
      src/utils/tga.cpp

+ 2
- 2
README.md View File

@@ -11,7 +11,7 @@ It seems as if OpenRaider will currently only work on Little-Endian platforms. T
11 11
 ## Configuration
12 12
 
13 13
 OpenRaider needs some configuration files, and level data and assets from custom levels or the Tomb Raider games.
14
-These are stored in `~/.OpenRaider`. Running the included `setup.sh` will create/copy the necessary files and directories.
14
+These are stored in `~/.OpenRaider`. Running `make setup` will create/copy the necessary files and directories.
15 15
 
16 16
 You still need to add level files in `~/.OpenRaider/paks/` and add them to `~/.OpenRaider/OpenRaider.init`.
17 17
 Dust off your old Tomb Raider CDs or grab some [custom levels](http://www.aspidetr.com/levels/yvel-woods-v1-5/) from the interwebs.
@@ -79,7 +79,7 @@ A Doxygen API documentation can be created with `make doc`.
79 79
 ### Configuration file
80 80
 
81 81
 OpenRaider will try to load `~/.OpenRaider/OpenRaider.init` or, if it doesn't exist, `OpenRaider.init` from the current directory.
82
-Running `make setup` or the `cmake/setup.sh` script will create a minimal configuration in your home directory.
82
+Running `make setup` will create a minimal configuration in your home directory.
83 83
 
84 84
 The configuration file format is very simple:
85 85
 * Anything following a `#` up to the next `\n` will be ignored.

+ 0
- 16
include/Render.h View File

@@ -37,11 +37,6 @@ public:
37 37
         typeDirectional = 3  //!< Directional light
38 38
     } LightType;
39 39
 
40
-    // These aren't used anywhere? -- xythobuz
41
-    //float mAmbient[4]; //! Ambient color
42
-    //float mDiffuse[4]; //! Diffuse color
43
-    //float mSpecular[4]; //! Specular color
44
-
45 40
     vec4_t mPos; //! Light position in 3 space
46 41
     vec3_t mDir; //! Light direction
47 42
     float mAtt;
@@ -62,7 +57,6 @@ public:
62 57
     RenderRoom() {
63 58
         room = 0x0;
64 59
         dist = 0.0f;
65
-        center[0] = center[1] = center[2] = 0.0f;
66 60
     }
67 61
 
68 62
     /*!
@@ -73,17 +67,7 @@ public:
73 67
         //lights.erase();
74 68
     }
75 69
 
76
-    /*!
77
-     * \brief Computes central point of room.
78
-     * Result is stored in center member variable.
79
-     */
80
-    void computeCenter() {
81
-        if (room)
82
-            helMidpoint3v(room->bbox_min, room->bbox_max, center);
83
-    }
84
-
85 70
     vec_t dist;             //!< Distance to near plane, move to room?
86
-    vec3_t center;          //!< Center of bbox, move to room?
87 71
     Vector<Light *> lights; //!< List of lights in this room
88 72
     Mesh mesh;              //!< OpenGL mesh that represents this room
89 73
 

+ 2
- 2
include/utils/math.h View File

@@ -8,8 +8,8 @@
8 8
 
9 9
 #include <math.h>
10 10
 
11
-#ifndef _MATMATH_H
12
-#define _MATMATH_H
11
+#ifndef _UTILS_MATH_H
12
+#define _UTILS_MATH_H
13 13
 
14 14
 #define HEL_PI           ((float)M_PI) //!< pi
15 15
 #define HEL_2_PI         (HEL_PI * 2.0f) //!< pi*2

+ 2
- 4
include/utils/tga.h View File

@@ -5,10 +5,8 @@
5 5
  * \author Mongoose
6 6
  * \author xythobuz
7 7
  */
8
-#ifndef _TGA_H
9
-#define _TGA_H
10
-
11
-#include <stdio.h>
8
+#ifndef _UTILS_TGA_H
9
+#define _UTILS_TGA_H
12 10
 
13 11
 /*!
14 12
  * \brief Possible TGA image types

+ 0
- 6
src/OpenRaider.cpp View File

@@ -2259,7 +2259,6 @@ void OpenRaider::processRoom(int index)
2259 2259
     room_mesh_t *r_mesh = NULL;
2260 2260
     RenderRoom *rRoom = NULL;
2261 2261
 #ifdef MATRIX_TRANSFORMS
2262
-    //matrix_t transform;
2263 2262
     Matrix transform;
2264 2263
 #endif
2265 2264
 
@@ -2293,12 +2292,8 @@ void OpenRaider::processRoom(int index)
2293 2292
 
2294 2293
     // Mongoose 2002.04.03, Setup 3d transform
2295 2294
 #ifdef MATRIX_TRANSFORMS
2296
-    //mtkMatrixIdentity(transform);
2297
-    //mtkMatrixTranslate(transform,
2298
-    //                       r_mesh->pos[0], r_mesh->pos[1], r_mesh->pos[2]);
2299 2295
     transform.setIdentity();
2300 2296
     transform.translate(r_mesh->pos);
2301
-#else
2302 2297
 #endif
2303 2298
 
2304 2299
     // Setup portals
@@ -2328,7 +2323,6 @@ void OpenRaider::processRoom(int index)
2328 2323
 
2329 2324
             // Relative coors in vis portals
2330 2325
 #ifdef MATRIX_TRANSFORMS
2331
-            //mtkMatrixTransform(transform, portal->vertices[j]);
2332 2326
             transform.multiply3v(portal->vertices[j], portal->vertices[j]);
2333 2327
 #else
2334 2328
             portal->vertices[j][0] += r_mesh->pos[0];

+ 0
- 4
src/Render.cpp View File

@@ -807,10 +807,6 @@ void Render::Display()
807 807
             v[1] = u[1] + (9000.0f * sinf(LARA->angles[2]));
808 808
             v[2] = u[2] + (9000.0f * cosf(LARA->angles[1]));
809 809
 
810
-            //mtkVectorSubtract(u, v, t);
811
-            //mtkVectorSubtract(u, curPos, s);
812
-            //printf("* %f rad\n", LARA->angles[1]);
813
-
814 810
             // Test tracing of aim
815 811
             renderTrace(0, u, v); // v = target
816 812
         }

+ 2
- 26
src/utils/math.cpp View File

@@ -16,7 +16,7 @@
16 16
 
17 17
 bool equalEpsilon(vec_t a, vec_t b) {
18 18
     vec_t epsilon = FLT_EPSILON;
19
-    if (fabs(a - b) <= (((fabs(b) > fabs(a)) ? fabs(b) : fabs(a)) * epsilon))
19
+    if (fabs(a - b) <= (fmax(fabs(a), fabs(b)) * epsilon))
20 20
         return true;
21 21
     return false;
22 22
 }
@@ -41,14 +41,10 @@ int helIntersectionLineAndPolygon(vec3_t intersect,
41 41
     pB = Vector3d(p2);
42 42
 
43 43
     // Find normal
44
-    //mtkVectorSubtract(polygon[1], polygon[0], a);
45 44
     a = Vector3d(polygon[1]) - Vector3d(polygon[0]);
46
-    //mtkVectorSubtract(polygon[2], polygon[0], b);
47 45
     b = Vector3d(polygon[2]) - Vector3d(polygon[0]);
48 46
     normal = Vector3d::cross(a, b);
49
-    //mtkVectorCrossProduct(a, b, normal);
50 47
     normal.normalize();
51
-    //mtkVectorNormalize(normal, normal);
52 48
 
53 49
     // find D
54 50
     //d = (normal[0] * polygon[0][0] -
@@ -59,7 +55,6 @@ int helIntersectionLineAndPolygon(vec3_t intersect,
59 55
             normal.mVec[2] * polygon[0][2]);
60 56
 
61 57
     // line segment parallel to plane?
62
-    //mtkVectorSubtract(p2, p1, a); // cache p2 - p1 => a
63 58
     a = pB - pA;
64 59
 
65 60
     //denominator = (normal[0] * a[0] +
@@ -88,30 +83,11 @@ int helIntersectionLineAndPolygon(vec3_t intersect,
88 83
 
89 84
 
90 85
     // See if the intercept is bound by polygon by winding number
91
-#ifdef WINDING_NUMBERS_TRIANGLE
92
-    mtkVectorSubtract(polygon[0], intersect, a);
93
-    mtkVectorNormalize(a, a);
94
-    mtkVectorSubtract(polygon[1], intersect, b);
95
-    mtkVectorNormalize(b, b);
96
-    mtkVectorSubtract(polygon[2], intersect, c);
97
-    mtkVectorNormalize(c, c);
98
-
99
-    t0 = mtkVectorDotProduct(a, b);
100
-    t1 = mtkVectorDotProduct(b, c);
101
-    t2 = mtkVectorDotProduct(c, a);
102
-
103
-    total = HEL_RAD_TO_DEG(acos(t0) + acos(t1) + acos(t2));
104
-
105
-    if (total - 360 < 0.0)
106
-        return 0;
107
-#else // assume convex polygons here for sure
108
-    //mtkVectorSubtract(intersect, polygon[0], a);
109
-    //theta = mtkVectorDotProduct(a, normal);
86
+    // assume convex polygons here for sure
110 87
     double theta = Vector3d::dot(b - Vector3d(polygon[0]), normal); // b = intersect
111 88
 
112 89
     if (theta >= 90.0) // Yeah I know
113 90
         return 0;
114
-#endif
115 91
 
116 92
     return 1;
117 93
 }

+ 1
- 0
src/utils/tga.cpp View File

@@ -8,6 +8,7 @@
8 8
  * \author xythobuz
9 9
  */
10 10
 
11
+#include <stdio.h>
11 12
 #include <string.h>
12 13
 #include <stdarg.h>
13 14
 

Loading…
Cancel
Save