소스 검색

Changed a bit the structure, removed redundant members, renamed a member and opened it.

Eiyeron Fulmincendii 10 년 전
부모
커밋
d4ac8f04a6
2개의 변경된 파일7개의 추가작업 그리고 13개의 파일을 삭제
  1. 2 6
      platform/include/Texture.h
  2. 5 7
      platform/nspire/Texure.cpp

+ 2 - 6
platform/include/Texture.h

@@ -19,13 +19,9 @@ namespace WalrusRPG
         class Texture
         {
           private:
-            texture_data_t texture;
-            unsigned width;
-            unsigned height;
-
           public:
-            // The get function is implemented by the child
-            // TextureHolder &get_texture();
+            texture_data_t data;
+
             Texture(char *data);
             ~Texture();
             // Getters

+ 5 - 7
platform/nspire/Texure.cpp

@@ -12,28 +12,26 @@ namespace
 {
     texture_data_t loadPNG(char *data)
     {
-        // stuff
+        // TODO : stuff
         return nullptr;
     }
 }
 
-Texture::Texture(char *data) : texture(loadPNG(data))
+Texture::Texture(char *data) : data(loadPNG(data))
 {
-    width = texture[0];
-    height = texture[1];
 }
 
 Texture::~Texture()
 {
-    delete (texture);
+    delete (data);
 }
 
 Rect Texture::get_dimensions()
 {
-    return Rect(0, 0, width, height);
+    return Rect(0, 0, data[0], data[1]);
 }
 
 const Pixel Texture::get_pixel(unsigned x, unsigned y)
 {
-    return Pixel(texture[2 + width*y + x]);
+    return Pixel(data[2 + data[0] * y + x]);
 }