瀏覽代碼

Fixed indent [skip ci]

Thomas Buck 9 年之前
父節點
當前提交
741083b757
共有 8 個文件被更改,包括 50 次插入48 次删除
  1. 2
    2
      include/Mesh.h
  2. 4
    4
      include/Render.h
  3. 8
    8
      src/Mesh.cpp
  4. 5
    5
      src/Render.cpp
  5. 2
    2
      src/TextureManager.cpp
  6. 20
    19
      src/UI.cpp
  7. 8
    7
      src/loader/LoaderTR2.cpp
  8. 1
    1
      src/utils/binary.cpp

+ 2
- 2
include/Mesh.h 查看文件

@@ -32,9 +32,9 @@ class Mesh {
32 32
     // Warning: texture is not the GL texture id,
33 33
     // it is an index into the object texture list!
34 34
     void addTexturedRectangle(struct vertex_t a, struct vertex_t b,
35
-            struct vertex_t c, struct vertex_t d, uint16_t texture);
35
+                              struct vertex_t c, struct vertex_t d, uint16_t texture);
36 36
     void addTexturedTriangle(struct vertex_t a, struct vertex_t b,
37
-            struct vertex_t c, uint16_t texture);
37
+                             struct vertex_t c, uint16_t texture);
38 38
 
39 39
     std::vector<struct rectangle_t> texturedRectangles;
40 40
     std::vector<struct rectangle_t> coloredRectangles;

+ 4
- 4
include/Render.h 查看文件

@@ -117,16 +117,16 @@ class Render {
117 117
     float getDistToSphereFromNear(float x, float y, float z, float radius);
118 118
 
119 119
     void debugDisplayTexture(int texture = -1,
120
-            TextureManager::TextureStorage s = TextureManager::TextureStorage::GAME,
121
-            float x = 0.0f, float y = 0.0f, float w = 256.0f, float h = 256.0f);
120
+                             TextureManager::TextureStorage s = TextureManager::TextureStorage::GAME,
121
+                             float x = 0.0f, float y = 0.0f, float w = 256.0f, float h = 256.0f);
122 122
 
123 123
     void debugDisplayTextile(int texture = -1,
124
-            float x = 0.0f, float y = 0.0f, float w = 64.0f, float h = 64.0f);
124
+                             float x = 0.0f, float y = 0.0f, float w = 64.0f, float h = 64.0f);
125 125
 
126 126
   private:
127 127
 
128 128
     void drawTexture(float x, float y, float w, float h,
129
-            unsigned int texture, TextureManager::TextureStorage s);
129
+                     unsigned int texture, TextureManager::TextureStorage s);
130 130
 
131 131
     void drawTextile(float x, float y, float w, float h, unsigned int textile);
132 132
 

+ 8
- 8
src/Mesh.cpp 查看文件

@@ -12,7 +12,7 @@
12 12
 #include "Mesh.h"
13 13
 
14 14
 void Mesh::addTexturedRectangle(struct vertex_t a, struct vertex_t b,
15
-        struct vertex_t c, struct vertex_t d, uint16_t texture) {
15
+                                struct vertex_t c, struct vertex_t d, uint16_t texture) {
16 16
     struct rectangle_t r;
17 17
     r.a = a;
18 18
     r.b = b;
@@ -23,7 +23,7 @@ void Mesh::addTexturedRectangle(struct vertex_t a, struct vertex_t b,
23 23
 }
24 24
 
25 25
 void Mesh::addTexturedTriangle(struct vertex_t a, struct vertex_t b,
26
-        struct vertex_t c, uint16_t texture) {
26
+                               struct vertex_t c, uint16_t texture) {
27 27
     struct rectangle_t r;
28 28
     r.a = a;
29 29
     r.b = b;
@@ -34,9 +34,9 @@ void Mesh::addTexturedTriangle(struct vertex_t a, struct vertex_t b,
34 34
 
35 35
 void Mesh::drawAlpha() {
36 36
     if ((texturedRectangles.size() == 0)
37
-            && (texturedTriangles.size() == 0)
38
-            && (coloredRectangles.size() == 0)
39
-            && (coloredTriangles.size() == 0)) {
37
+        && (texturedTriangles.size() == 0)
38
+        && (coloredRectangles.size() == 0)
39
+        && (coloredTriangles.size() == 0)) {
40 40
         drawAlphaOld();
41 41
         return;
42 42
     }
@@ -46,9 +46,9 @@ void Mesh::drawAlpha() {
46 46
 
47 47
 void Mesh::drawSolid() {
48 48
     if ((texturedRectangles.size() == 0)
49
-            && (texturedTriangles.size() == 0)
50
-            && (coloredRectangles.size() == 0)
51
-            && (coloredTriangles.size() == 0)) {
49
+        && (texturedTriangles.size() == 0)
50
+        && (coloredRectangles.size() == 0)
51
+        && (coloredTriangles.size() == 0)) {
52 52
         drawSolidOld();
53 53
         return;
54 54
     }

+ 5
- 5
src/Render.cpp 查看文件

@@ -175,7 +175,7 @@ void Render::setMode(int n) {
175 175
         case Render::modeSolid:
176 176
         case Render::modeWireframe:
177 177
             glClearColor(PURPLE[0] / 256.0f, PURPLE[1] / 256.0f,
178
-                    PURPLE[2] / 256.0f, PURPLE[3] / 256.0f);
178
+                         PURPLE[2] / 256.0f, PURPLE[3] / 256.0f);
179 179
             glDisable(GL_TEXTURE_2D);
180 180
             break;
181 181
         default:
@@ -186,7 +186,7 @@ void Render::setMode(int n) {
186 186
             }
187 187
 
188 188
             glClearColor(BLACK[0] / 256.0f, BLACK[1] / 256.0f,
189
-                    BLACK[2] / 256.0f, BLACK[3] / 256.0f);
189
+                         BLACK[2] / 256.0f, BLACK[3] / 256.0f);
190 190
 
191 191
             glEnable(GL_TEXTURE_2D);
192 192
     }
@@ -355,7 +355,7 @@ void Render::drawLoadScreen() {
355 355
     getWindow().glEnter2D();
356 356
 
357 357
     drawTexture(0.0f, 0.0f, getWindow().getWidth(), getWindow().getHeight(),
358
-            TEXTURE_SPLASH, TextureManager::TextureStorage::SYSTEM);
358
+                TEXTURE_SPLASH, TextureManager::TextureStorage::SYSTEM);
359 359
 
360 360
     if (debugTexture >= 0)
361 361
         drawTexture(debugX, debugY, debugW, debugH, debugTexture, debugTextureStorage);
@@ -486,7 +486,7 @@ float Render::getDistToSphereFromNear(float x, float y, float z, float radius) {
486 486
 }
487 487
 
488 488
 void Render::debugDisplayTexture(int texture, TextureManager::TextureStorage s,
489
-        float x, float y, float w, float h) {
489
+                                 float x, float y, float w, float h) {
490 490
     debugTexture = texture;
491 491
     debugTextureStorage = s;
492 492
     debugX = x;
@@ -497,7 +497,7 @@ void Render::debugDisplayTexture(int texture, TextureManager::TextureStorage s,
497 497
 }
498 498
 
499 499
 void Render::drawTexture(float x, float y, float w, float h,
500
-        unsigned int texture, TextureManager::TextureStorage s) {
500
+                         unsigned int texture, TextureManager::TextureStorage s) {
501 501
     float z = 0.0f;
502 502
 
503 503
     glColor3ubv(WHITE);

+ 2
- 2
src/TextureManager.cpp 查看文件

@@ -25,7 +25,7 @@
25 25
 #endif
26 26
 
27 27
 TextureTileVertex::TextureTileVertex(uint8_t xc, uint8_t xp, uint8_t yc, uint8_t yp)
28
-        : xCoordinate(xc), xPixel(xp), yCoordinate(yc), yPixel(yp) { }
28
+    : xCoordinate(xc), xPixel(xp), yCoordinate(yc), yPixel(yp) { }
29 29
 
30 30
 // ----------------------------------------------------------------------------
31 31
 
@@ -110,7 +110,7 @@ void TextureTile::displayTriangle(float x, float y, float w, float h, float z) {
110 110
     glBegin(GL_TRIANGLE_STRIP);
111 111
     for (int i = 0; i < 3; i++) {
112 112
         glTexCoord2f(vertices.at(i)->xPixel / 256.0f,
113
-                vertices.at(i)->yPixel / 256.0f);
113
+                     vertices.at(i)->yPixel / 256.0f);
114 114
 
115 115
         if (vertices.at(i)->xCoordinate == 255) {
116 116
             if (vertices.at(i)->yCoordinate == 255) {

+ 20
- 19
src/UI.cpp 查看文件

@@ -197,11 +197,11 @@ void UI::display() {
197 197
                     if (offset > 10)
198 198
                         offset = 10;
199 199
                     ImGui::PlotLines("FPS", &getRunTime().getHistoryFPS()[1],
200
-                            getRunTime().getHistoryFPS().size() - 1,
201
-                            getRunTime().getHistoryFPS().size() - offset - 1);
200
+                                     getRunTime().getHistoryFPS().size() - 1,
201
+                                     getRunTime().getHistoryFPS().size() - offset - 1);
202 202
                 } else {
203 203
                     ImGui::PlotLines("FPS", &getRunTime().getHistoryFPS()[1],
204
-                            getRunTime().getHistoryFPS().size() - 1);
204
+                                     getRunTime().getHistoryFPS().size() - 1);
205 205
                 }
206 206
                 ImGui::SameLine();
207 207
                 ImGui::Checkbox("Scroll##fpsscroll", &scroll);
@@ -230,7 +230,8 @@ void UI::display() {
230 230
             }
231 231
 
232 232
             float vol = getSound().getVolume();
233
-            if (ImGui::InputFloat("Volume##runtime", &vol, 0.0f, 0.0f, 3, ImGuiInputTextFlags_EnterReturnsTrue)) {
233
+            if (ImGui::InputFloat("Volume##runtime", &vol, 0.0f, 0.0f, 3,
234
+                                  ImGuiInputTextFlags_EnterReturnsTrue)) {
234 235
                 if (vol < 0.0f)
235 236
                     vol = 0.0f;
236 237
                 if (vol > 1.0f)
@@ -312,14 +313,14 @@ void UI::display() {
312 313
             static int index = 0;
313 314
             ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5f);
314 315
             ImGui::SliderInt("##texslide", &index, 0, getTextureManager().numTextures(
315
-                        game ? TextureManager::TextureStorage::GAME
316
-                        : TextureManager::TextureStorage::SYSTEM) - 1);
316
+                                 game ? TextureManager::TextureStorage::GAME
317
+                                 : TextureManager::TextureStorage::SYSTEM) - 1);
317 318
             ImGui::PopItemWidth();
318 319
             ImGui::SameLine();
319 320
             if (ImGui::Button("+##texplus", ImVec2(0, 0), true)) {
320 321
                 if (index < (getTextureManager().numTextures(
321
-                                game ? TextureManager::TextureStorage::GAME
322
-                                : TextureManager::TextureStorage::SYSTEM) - 1))
322
+                                 game ? TextureManager::TextureStorage::GAME
323
+                                 : TextureManager::TextureStorage::SYSTEM) - 1))
323 324
                     index++;
324 325
                 else
325 326
                     index = 0;
@@ -352,11 +353,11 @@ void UI::display() {
352 353
             }
353 354
             if (visibleTex) {
354 355
                 getRender().debugDisplayTexture(index,
355
-                        game ? TextureManager::TextureStorage::GAME
356
-                        : TextureManager::TextureStorage::SYSTEM,
357
-                        ImGui::GetWindowPos().x - ImGui::GetWindowWidth(),
358
-                        ImGui::GetWindowPos().y,
359
-                        ImGui::GetWindowWidth(), ImGui::GetWindowWidth());
356
+                                                game ? TextureManager::TextureStorage::GAME
357
+                                                : TextureManager::TextureStorage::SYSTEM,
358
+                                                ImGui::GetWindowPos().x - ImGui::GetWindowWidth(),
359
+                                                ImGui::GetWindowPos().y,
360
+                                                ImGui::GetWindowWidth(), ImGui::GetWindowWidth());
360 361
             }
361 362
         }
362 363
 
@@ -396,9 +397,9 @@ void UI::display() {
396 397
                 }
397 398
                 if (visibleTile) {
398 399
                     getRender().debugDisplayTextile(index,
399
-                            ImGui::GetWindowPos().x - (ImGui::GetWindowWidth() / 2),
400
-                            ImGui::GetWindowPos().y,
401
-                            (ImGui::GetWindowWidth() / 2), (ImGui::GetWindowWidth() / 2));
400
+                                                    ImGui::GetWindowPos().x - (ImGui::GetWindowWidth() / 2),
401
+                                                    ImGui::GetWindowPos().y,
402
+                                                    (ImGui::GetWindowWidth() / 2), (ImGui::GetWindowWidth() / 2));
402 403
                 }
403 404
             } else {
404 405
                 ImGui::Text("Please load a level using the new loader!");
@@ -447,9 +448,9 @@ void UI::display() {
447 448
                         fr--;
448 449
                     } else {
449 450
                         getRender().debugDisplayTextile(tile,
450
-                                ImGui::GetWindowPos().x - (ImGui::GetWindowWidth() / 2),
451
-                                ImGui::GetWindowPos().y,
452
-                                (ImGui::GetWindowWidth() / 2), (ImGui::GetWindowWidth() / 2));
451
+                                                        ImGui::GetWindowPos().x - (ImGui::GetWindowWidth() / 2),
452
+                                                        ImGui::GetWindowPos().y,
453
+                                                        (ImGui::GetWindowWidth() / 2), (ImGui::GetWindowWidth() / 2));
453 454
                         fr = getRunTime().getFPS() / 2;
454 455
                         tile = getTextureManager().getNextTileAnimation(tile);
455 456
                     }

+ 8
- 7
src/loader/LoaderTR2.cpp 查看文件

@@ -90,7 +90,7 @@ void LoaderTR2::loadPaletteTextiles() {
90 90
         // Convert 16bit textile to 32bit textile
91 91
         unsigned char* img = argb16to32(&arr[0], 256, 256);
92 92
         int r = getTextureManager().loadBufferSlot(img, 256, 256, ARGB, 32,
93
-                    TextureManager::TextureStorage::GAME, i);
93
+                TextureManager::TextureStorage::GAME, i);
94 94
         assert(r >= 0); //! \fixme properly handle error when texture could not be loaded!
95 95
         delete [] img;
96 96
     }
@@ -146,7 +146,7 @@ void LoaderTR2::loadAnimatedTextures() {
146 146
         int count = animatedTextures.at(pos) + 1;
147 147
         if ((pos + count) >= numWords) {
148 148
             getLog() << "LoaderTR2: Invalid AnimatedTextures ("
149
-                << pos + count << " >= " << numWords << ")!" << Log::endl;
149
+                     << pos + count << " >= " << numWords << ")!" << Log::endl;
150 150
             return;
151 151
         }
152 152
 
@@ -215,7 +215,7 @@ void LoaderTR2::loadRooms() {
215 215
             uint16_t texture = file.readU16();
216 216
 
217 217
             room->getMesh().addTexturedRectangle(vertices.at(vertex1), vertices.at(vertex2),
218
-                    vertices.at(vertex3), vertices.at(vertex4), texture);
218
+                                                 vertices.at(vertex3), vertices.at(vertex4), texture);
219 219
         }
220 220
 
221 221
         uint16_t numTriangles = file.readU16();
@@ -229,7 +229,7 @@ void LoaderTR2::loadRooms() {
229 229
             uint16_t texture = file.readU16();
230 230
 
231 231
             room->getMesh().addTexturedTriangle(vertices.at(vertex1), vertices.at(vertex2),
232
-                    vertices.at(vertex3), texture);
232
+                                                vertices.at(vertex3), texture);
233 233
         }
234 234
 
235 235
         uint16_t numSprites = file.readU16();
@@ -684,7 +684,7 @@ void LoaderTR2::loadExternalSoundFile(std::string f) {
684 684
 
685 685
         if (std::string("RIFF") != std::string(test)) {
686 686
             getLog() << "LoaderTR2: External SFX invalid! (" << riffCount
687
-                << ", \"" << test << "\" != \"RIFF\")" << Log::endl;
687
+                     << ", \"" << test << "\" != \"RIFF\")" << Log::endl;
688 688
             return;
689 689
         }
690 690
 
@@ -743,7 +743,7 @@ void LoaderTR2::loadCinematicFrames() {
743 743
 
744 744
     if (numCinematicFrames > 0)
745 745
         getLog() << "LoaderTR2: Found " << numCinematicFrames
746
-            << " CinematicFrames, not yet implemented!" << Log::endl;
746
+                 << " CinematicFrames, not yet implemented!" << Log::endl;
747 747
 }
748 748
 
749 749
 void LoaderTR2::loadDemoData() {
@@ -753,6 +753,7 @@ void LoaderTR2::loadDemoData() {
753 753
 
754 754
     // TODO store demo data somewhere, find out meaning
755 755
     if (numDemoData > 0)
756
-        getLog() << "LoaderTR2: Found " << numDemoData << " bytes DemoData, not yet implemented!" << Log::endl;
756
+        getLog() << "LoaderTR2: Found " << numDemoData << " bytes DemoData, not yet implemented!" <<
757
+                 Log::endl;
757 758
 }
758 759
 

+ 1
- 1
src/utils/binary.cpp 查看文件

@@ -192,7 +192,7 @@ void BinaryMemory::read(char* d, int c) {
192 192
     if ((offset + c) > max) {
193 193
         std::ostringstream ss;
194 194
         ss << "BinaryMemory read out of bounds ("
195
-            << offset << " + " << c << " > " << max;
195
+           << offset << " + " << c << " > " << max;
196 196
         throw new Exception(ss.str());
197 197
     }
198 198
 

Loading…
取消
儲存