Bläddra i källkod

Didn't even compile...

Thomas Buck 10 år sedan
förälder
incheckning
dc66df2716
3 ändrade filer med 13 tillägg och 10 borttagningar
  1. 1
    1
      include/Mesh.h
  2. 2
    0
      include/Room.h
  3. 10
    9
      src/loader/LoaderTR2.cpp

+ 1
- 1
include/Mesh.h Visa fil

@@ -21,7 +21,7 @@ class Mesh {
21 21
     struct rectangle_t {
22 22
         struct vertex_t a, b, c, d;
23 23
         uint16_t texture;
24
-    }
24
+    };
25 25
 
26 26
     Mesh();
27 27
     ~Mesh();

+ 2
- 0
include/Room.h Visa fil

@@ -35,6 +35,8 @@ class Room {
35 35
     int getAdjoiningRoom(float x, float y, float z,
36 36
                          float x2, float y2, float z2);
37 37
 
38
+    Mesh& getMesh() { return mesh; }
39
+
38 40
     unsigned int getNumXSectors();
39 41
     unsigned int getNumZSectors();
40 42
     void getPos(float p[3]);

+ 10
- 9
src/loader/LoaderTR2.cpp Visa fil

@@ -12,6 +12,7 @@
12 12
 #include "global.h"
13 13
 #include "Log.h"
14 14
 #include "Mesh.h"
15
+#include "Room.h"
15 16
 #include "TextureManager.h"
16 17
 #include "utils/pixel.h"
17 18
 #include "loader/LoaderTR2.h"
@@ -103,28 +104,28 @@ void LoaderTR2::loadRooms() {
103 104
         uint32_t dataToFollow = file.readU32();
104 105
 
105 106
 
106
-        std::vector<struct vertex> vertices;
107
+        std::vector<struct vertex_t> vertices;
107 108
 
108 109
         uint16_t numVertices = file.readU16();
109 110
         for (unsigned int v = 0; v < numVertices; v++) {
110
-            struct vertex v;
111
+            struct vertex_t vert;
111 112
             // Vertex coordinates, relative to x/zOffset
112
-            v.x = file.read16();
113
-            v.y = file.read16();
114
-            v.z = file.read16();
113
+            vert.x = file.read16();
114
+            vert.y = file.read16();
115
+            vert.z = file.read16();
115 116
 
116
-            v.light1 = file.read16();
117
+            vert.light1 = file.read16();
117 118
 
118 119
             // Set of flags for special rendering effects
119 120
             // 0x8000 - Something to do with water surface?
120 121
             // 0x4000 - Underwater lighting modulation/movement if seen from above
121 122
             // 0x2000 - Water/Quicksand surface movement
122 123
             // 0x0010 - Normal?
123
-            v.attributes = file.readU16();
124
+            vert.attributes = file.readU16();
124 125
 
125
-            v.light2 = file.read16(); // Almost always equal to light1
126
+            vert.light2 = file.read16(); // Almost always equal to light1
126 127
 
127
-            vertices.push_back(v);
128
+            vertices.push_back(vert);
128 129
         }
129 130
 
130 131
         Room* room = new Room();

Laddar…
Avbryt
Spara