Преглед на файлове

Removed unused stuff [skip ci]

Thomas Buck преди 9 години
родител
ревизия
917e1b47ed
променени са 8 файла, в които са добавени 4 реда и са изтрити 96 реда
  1. 0
    2
      include/Room.h
  2. 0
    29
      include/RoomData.h
  3. 1
    1
      include/global.h
  4. 0
    2
      include/utils/pixel.h
  5. 0
    34
      src/RoomData.cpp
  6. 2
    1
      src/TextureManager.cpp
  7. 1
    1
      src/system/Shader.cpp
  8. 0
    26
      src/utils/pixel.cpp

+ 0
- 2
include/Room.h Целия файл

@@ -46,7 +46,6 @@ class Room {
46 46
     void addSprite(RoomSprite* s) { sprites.emplace_back(s); }
47 47
     void addModel(StaticModel* s) { models.emplace_back(s); }
48 48
     void addSector(Sector* s) { sectors.emplace_back(s); }
49
-    void addLight(Light* l) { lights.emplace_back(l); }
50 49
 
51 50
     void addPortal(Portal* p) { portals.emplace_back(p); }
52 51
     unsigned long sizePortals() { return portals.size(); }
@@ -80,7 +79,6 @@ class Room {
80 79
     std::vector<std::unique_ptr<StaticModel>> models;
81 80
     std::vector<std::unique_ptr<Portal>> portals;
82 81
     std::vector<std::unique_ptr<Sector>> sectors;
83
-    std::vector<std::unique_ptr<Light>> lights;
84 82
 
85 83
     static bool showBoundingBox;
86 84
     static bool showRoomModels;

+ 0
- 29
include/RoomData.h Целия файл

@@ -97,35 +97,6 @@ class Portal {
97 97
 
98 98
 // --------------------------------------
99 99
 
100
-class Light {
101
-  public:
102
-    /*!
103
-     * \brief Type a light can be of
104
-     */
105
-    typedef enum {
106
-        typePoint       = 1, //!< Point light
107
-        typeSpot        = 2, //!< Spot light
108
-        typeDirectional = 3  //!< Directional light
109
-    } LightType;
110
-
111
-    void getPos(float p[4]);
112
-    void getDir(float d[3]);
113
-    float getAtt();
114
-    void getColor(float c[4]);
115
-    float getCutoff();
116
-    LightType getType();
117
-
118
-  private:
119
-    float pos[4]; //! Light position in 3 space
120
-    float dir[3]; //! Light direction
121
-    float att;
122
-    float color[4]; //! Color of light
123
-    float cutoff; //! Fade out distance
124
-    LightType type; //! Type of light
125
-};
126
-
127
-// --------------------------------------
128
-
129 100
 class Sector {
130 101
   public:
131 102
     Sector(float f, float c, bool w) : floor(f), ceiling(c), wall(w) { }

+ 1
- 1
include/global.h Целия файл

@@ -109,7 +109,7 @@ typedef enum {
109 109
 
110 110
 template<typename T, typename U>
111 111
 [[noreturn]] void assertEqualImplementation(const char* exp, T a, U b, const char* file, int line,
112
-                                            const char* str = nullptr) {
112
+        const char* str = nullptr) {
113 113
     const unsigned int maxSize = 128;
114 114
     void* callstack[maxSize];
115 115
     int frames = backtrace(callstack, maxSize);

+ 0
- 2
include/utils/pixel.h Целия файл

@@ -11,8 +11,6 @@
11 11
 unsigned char* generateColorTexture(const unsigned char* rgba, unsigned int width,
12 12
                                     unsigned int height, unsigned int bpp);
13 13
 
14
-void bgr2rgb24(unsigned char* image, unsigned int w, unsigned int h);
15
-void bgra2rgba32(unsigned char* image, unsigned int w, unsigned int h);
16 14
 void argb2rgba32(unsigned char* image, unsigned int w, unsigned int h);
17 15
 
18 16
 // Returns newly allocated buffer

+ 0
- 34
src/RoomData.cpp Целия файл

@@ -95,40 +95,6 @@ void RoomSprite::display(glm::mat4 VP) {
95 95
 
96 96
 // ----------------------------------------------------------------------------
97 97
 
98
-void Light::getPos(float p[4]) {
99
-    p[0] = pos[0];
100
-    p[1] = pos[1];
101
-    p[2] = pos[2];
102
-    p[3] = pos[3];
103
-}
104
-
105
-void Light::getDir(float d[3]) {
106
-    d[0] = dir[0];
107
-    d[1] = dir[1];
108
-    d[2] = dir[2];
109
-}
110
-
111
-float Light::getAtt() {
112
-    return att;
113
-}
114
-
115
-void Light::getColor(float c[4]) {
116
-    c[0] = color[0];
117
-    c[1] = color[1];
118
-    c[2] = color[2];
119
-    c[3] = color[3];
120
-}
121
-
122
-float Light::getCutoff() {
123
-    return cutoff;
124
-}
125
-
126
-Light::LightType Light::getType() {
127
-    return type;
128
-}
129
-
130
-// ----------------------------------------------------------------------------
131
-
132 98
 float Sector::getFloor() {
133 99
     return floor;
134 100
 }

+ 2
- 1
src/TextureManager.cpp Целия файл

@@ -297,7 +297,8 @@ glm::vec4 TextureManager::getPalette(int index) {
297 297
     return colorPalette[index];
298 298
 }
299 299
 
300
-void TextureManager::addIndexedTexture(unsigned char* image, unsigned int width, unsigned int height) {
300
+void TextureManager::addIndexedTexture(unsigned char* image, unsigned int width,
301
+                                       unsigned int height) {
301 302
     unsigned char* img = new unsigned char[width * height];
302 303
     for (unsigned int i = 0; i < (width * height); i++)
303 304
         img[i] = image[i];

+ 1
- 1
src/system/Shader.cpp Целия файл

@@ -343,7 +343,7 @@ void Shader::drawGL(ShaderBuffer& vertices, ShaderBuffer& uvs, ShaderBuffer& ind
343 343
 
344 344
         unsigned int sz = vertices.getSize();
345 345
         glm::vec3* buffer = new glm::vec3[sz];
346
-    glBindBuffer(GL_ARRAY_BUFFER, vertices.getBuffer());
346
+        glBindBuffer(GL_ARRAY_BUFFER, vertices.getBuffer());
347 347
         glGetBufferSubData(GL_ARRAY_BUFFER, 0, sz * sizeof(glm::vec3), buffer);
348 348
 
349 349
         Log::get(LOG_DEBUG) << "drawGL Vertex dump:" << Log::endl;

+ 0
- 26
src/utils/pixel.cpp Целия файл

@@ -24,32 +24,6 @@ unsigned char* generateColorTexture(const unsigned char* rgba, unsigned int widt
24 24
     return image;
25 25
 }
26 26
 
27
-void bgr2rgb24(unsigned char* image, unsigned int w, unsigned int h) {
28
-    assert(image != nullptr);
29
-    assert(w > 0);
30
-    assert(h > 0);
31
-
32
-    for (unsigned int i = 0; i < (w * h); ++i) {
33
-        /* 24-bit BGR to RGB */
34
-        unsigned char swap = image[(i * 3) + 2];
35
-        image[(i * 3) + 2] = image[i * 3];
36
-        image[i * 3] = swap;
37
-    }
38
-}
39
-
40
-void bgra2rgba32(unsigned char* image, unsigned int w, unsigned int h) {
41
-    assert(image != nullptr);
42
-    assert(w > 0);
43
-    assert(h > 0);
44
-
45
-    for (unsigned int i = 0; i < (w * h); ++i) {
46
-        /* 32-bit BGRA to RGBA */
47
-        unsigned char swap = image[(i * 4) + 2];
48
-        image[(i * 4) + 2] = image[(i * 4)];
49
-        image[i * 4] = swap;
50
-    }
51
-}
52
-
53 27
 void argb2rgba32(unsigned char* image, unsigned int w, unsigned int h) {
54 28
     assert(image != nullptr);
55 29
     assert(w > 0);

Loading…
Отказ
Запис