Explorar el Código

Removed unused stuff [skip ci]

Thomas Buck hace 9 años
padre
commit
917e1b47ed
Se han modificado 8 ficheros con 4 adiciones y 96 borrados
  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 Ver fichero

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

+ 0
- 29
include/RoomData.h Ver fichero

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
 class Sector {
100
 class Sector {
130
   public:
101
   public:
131
     Sector(float f, float c, bool w) : floor(f), ceiling(c), wall(w) { }
102
     Sector(float f, float c, bool w) : floor(f), ceiling(c), wall(w) { }

+ 1
- 1
include/global.h Ver fichero

109
 
109
 
110
 template<typename T, typename U>
110
 template<typename T, typename U>
111
 [[noreturn]] void assertEqualImplementation(const char* exp, T a, U b, const char* file, int line,
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
     const unsigned int maxSize = 128;
113
     const unsigned int maxSize = 128;
114
     void* callstack[maxSize];
114
     void* callstack[maxSize];
115
     int frames = backtrace(callstack, maxSize);
115
     int frames = backtrace(callstack, maxSize);

+ 0
- 2
include/utils/pixel.h Ver fichero

11
 unsigned char* generateColorTexture(const unsigned char* rgba, unsigned int width,
11
 unsigned char* generateColorTexture(const unsigned char* rgba, unsigned int width,
12
                                     unsigned int height, unsigned int bpp);
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
 void argb2rgba32(unsigned char* image, unsigned int w, unsigned int h);
14
 void argb2rgba32(unsigned char* image, unsigned int w, unsigned int h);
17
 
15
 
18
 // Returns newly allocated buffer
16
 // Returns newly allocated buffer

+ 0
- 34
src/RoomData.cpp Ver fichero

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
 float Sector::getFloor() {
98
 float Sector::getFloor() {
133
     return floor;
99
     return floor;
134
 }
100
 }

+ 2
- 1
src/TextureManager.cpp Ver fichero

297
     return colorPalette[index];
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
     unsigned char* img = new unsigned char[width * height];
302
     unsigned char* img = new unsigned char[width * height];
302
     for (unsigned int i = 0; i < (width * height); i++)
303
     for (unsigned int i = 0; i < (width * height); i++)
303
         img[i] = image[i];
304
         img[i] = image[i];

+ 1
- 1
src/system/Shader.cpp Ver fichero

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

+ 0
- 26
src/utils/pixel.cpp Ver fichero

24
     return image;
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
 void argb2rgba32(unsigned char* image, unsigned int w, unsigned int h) {
27
 void argb2rgba32(unsigned char* image, unsigned int w, unsigned int h) {
54
     assert(image != nullptr);
28
     assert(image != nullptr);
55
     assert(w > 0);
29
     assert(w > 0);

Loading…
Cancelar
Guardar