From b26b97d7285212744d7697024435c7078e8c4a31 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 21 Oct 2019 21:15:30 +0200 Subject: [PATCH] Removed the test method. --- texture_packer.cpp | 36 ------------------------------------ texture_packer.h | 2 -- 2 files changed, 38 deletions(-) diff --git a/texture_packer.cpp b/texture_packer.cpp index c995755..0ae275c 100644 --- a/texture_packer.cpp +++ b/texture_packer.cpp @@ -143,40 +143,6 @@ void TexturePacker::merge() { } } -String TexturePacker::test() { - String res = ""; - - const int RECTS = 200; - const bool ALLOW_FLIP = false; - - rect_xywhf rects[RECTS], *ptr_rects[RECTS]; - - for (int i = 0; i < RECTS; ++i) { - rects[i] = rect_xywhf(0, 0, 7 + rand() % 50, 7 + rand() % 50); - ptr_rects[i] = rects + i; - } - - std::vector bins; - - if (pack(ptr_rects, RECTS, 400, ALLOW_FLIP, bins)) { - res += "bins: " + String::num(bins.size()) + "\n"; - - for (int i = 0; i < bins.size(); ++i) { - res += "bin: " + String::num(i) + ", rects: " + String::num(bins[i].size.w) + " " + String::num(bins[i].size.h) + " " + String::num(bins[i].rects.size()) + "\n"; - - for (int r = 0; r < bins[i].rects.size(); ++r) { - rect_xywhf *rect = bins[i].rects[r]; - - res += "rect " + String::num(r) + ": x: " + String::num(rect->x) + ", y: " + String::num(rect->y) + ", w: " + String::num(rect->w) + ", h: " + String::num(rect->h) + ", was flipped: " + (rect->flipped ? "yes" : " no") + "\n"; - } - } - } else { - res += "failed: there's a rectangle with width/height bigger than max_size!\n"; - } - - return res; -} - TexturePacker::TexturePacker() { } @@ -197,8 +163,6 @@ TexturePacker::~TexturePacker() { } void TexturePacker::_bind_methods() { - ClassDB::bind_method(D_METHOD("test"), &TexturePacker::test); - ClassDB::bind_method(D_METHOD("add_texture", "texture"), &TexturePacker::add_texture); ClassDB::bind_method(D_METHOD("get_texture", "index"), &TexturePacker::get_texture); ClassDB::bind_method(D_METHOD("get_original_texture", "index"), &TexturePacker::get_original_texture); diff --git a/texture_packer.h b/texture_packer.h index d60fdfa..e3f728f 100644 --- a/texture_packer.h +++ b/texture_packer.h @@ -27,8 +27,6 @@ public: void merge(); - String test(); - TexturePacker(); ~TexturePacker();