소스 검색

Misc cleaning

Eiyeron Fulmincendii 9 년 전
부모
커밋
988aa69f7f
6개의 변경된 파일10개의 추가작업 그리고 24개의 파일을 삭제
  1. 2 2
      platform/3ds/Graphics.cpp
  2. 0 12
      platform/nspire/Texure.cpp
  3. 4 4
      src/map/StateMap.cpp
  4. 1 2
      src/piaf/Archive.cpp
  5. 1 2
      src/render/Font.cpp
  6. 2 2
      src/textbox/Textbox.cpp

+ 2 - 2
platform/3ds/Graphics.cpp

@@ -91,7 +91,7 @@ void Graphics::fill(const Pixel &color)
 void Graphics::put_pixel(uint16_t x, uint16_t y, const Pixel &color)
 {
     // Why both of them at +1? If only I knew...
-    sf2d_draw_line(x, y, x+1, y+1, 1, pixel2u32(color));
+    sf2d_draw_line(x, y, x + 1, y + 1, 1, pixel2u32(color));
 }
 
 void Graphics::put_horizontal_line(uint16_t x, uint16_t x2, uint16_t y,
@@ -143,7 +143,7 @@ void Graphics::put_line(uint16_t x, uint16_t y, uint16_t x2, uint16_t y2,
     int dy = abs(y - y2), sy = y < y2 ? 1 : -1;
     int err = (dx > dy ? dx : -dy) / 2, e2;
 
-    while(true)
+    while (true)
     {
         put_pixel(x + OFFSET_X, y + OFFSET_Y, color);
         if (x == x2 && y == y2)

+ 0 - 12
platform/nspire/Texure.cpp

@@ -11,18 +11,6 @@ using WalrusRPG::Graphics::Texture;
 using WalrusRPG::PIAF::File;
 using WalrusRPG::Utils::Rect;
 
-namespace
-{
-    /*
-    texture_data_t loadPNG(char *data)
-    {
-        // TODO : stuff
-        UNUSED(data);
-        return nullptr;
-    }
-    */
-}
-
 Texture::Texture(File entry)
 {
     unsigned char *pic;

+ 4 - 4
src/map/StateMap.cpp

@@ -60,14 +60,14 @@ void StateMap::update(unsigned dt)
     unsigned t = dt * (key_down(K_B) ? 16 : 1);
     if (key_pressed(K_A))
     {
-        if(!started && box.state != Done)
-           started = true;
-        else if(box.state == Done)
+        if (!started && box.state != Done)
+            started = true;
+        else if (box.state == Done)
         {
             started = false;
         }
     }
-    if(started)
+    if (started)
         box.update(t);
     camera.update(t);
 }

+ 1 - 2
src/piaf/Archive.cpp

@@ -121,7 +121,7 @@ Archive::Archive(const char *filepath)
 #ifdef WRPG_EXCEPTIONS
         throw PIAF::PIAFException("%s: Errorneous header : %s", __FILE__, filepath);
 #endif
-  }
+    }
     // Check if the magic cookie is the same.
     // It's a first way to detect if the file is correctly an archive.
     if (strncmp(header_container, "WRPGPIAF", 8) != 0)
@@ -143,7 +143,6 @@ Archive::Archive(const char *filepath)
 #endif
     }
 
-    // TODO : version checking
     version = read_big_endian_value<uint32_t>(&header_container[16]);
     if (version != ARCHIVE_VERSION)
     {

+ 1 - 2
src/render/Font.cpp

@@ -14,7 +14,6 @@ Font::Font(Texture &font_tex, WalrusRPG::PIAF::File font_config)
     : baseline(0), space_width(1), font_tex(font_tex)
 {
     const uint8_t *ptr = font_config.get();
-    // TODO : parse file
     // TODO : forgot to put the version and the font type
     if (strncmp((const char *) ptr, "WFONT", 4) != 0)
     {
@@ -121,4 +120,4 @@ void Font::draw_format(uint16_t x, uint16_t y, const Pixel &col, const char *for
     if (size < 0)
         return;
     draw(x, y, buffer, col);
-}
+}

+ 2 - 2
src/textbox/Textbox.cpp

@@ -65,7 +65,7 @@ void Textbox::set_text(char *new_text)
 
     buffer.clear();
     // Parsing the passed string into a token list.
-    // TODO?: Convert the vector into a dynamically allocated array?
+    // TODO : Convert the vector into a dynamically allocated array?
     for (signed i = 0; i < strlen_tokens(new_text); ++i)
     {
         TextboxChar t;
@@ -267,4 +267,4 @@ void Textbox::render(unsigned dt)
         put_rectangle({dimensions.x + static_cast<signed>(dimensions.width) - 3,
                        dimensions.y + static_cast<signed>(dimensions.height) - 3, 3, 3},
                       indicator_color);
-}
+}