From f58ccfa1f7115f39df0f84cc06016dcfad10dc0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 17 Sep 2012 03:17:06 +0200 Subject: [PATCH] Adapted to (old) Magnum changes. --- src/Plugins/TgaImporter/Test/TgaImporterTest.cpp | 5 +++++ src/Plugins/TgaImporter/TgaImporter.cpp | 6 +++--- src/Plugins/TgaImporter/TgaImporter.h | 10 +++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp b/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp index 67806a31b..26e7a9809 100644 --- a/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp +++ b/src/Plugins/TgaImporter/Test/TgaImporterTest.cpp @@ -15,9 +15,14 @@ #include "TgaImporterTest.h" +#include +#include +#include + #include "../TgaImporter.h" using namespace std; +using namespace Corrade::Utility; CORRADE_TEST_MAIN(Magnum::Trade::TgaImporter::Test::TgaImporterTest) diff --git a/src/Plugins/TgaImporter/TgaImporter.cpp b/src/Plugins/TgaImporter/TgaImporter.cpp index 0364ec621..c2551f4f4 100644 --- a/src/Plugins/TgaImporter/TgaImporter.cpp +++ b/src/Plugins/TgaImporter/TgaImporter.cpp @@ -19,7 +19,7 @@ #include #include "Math/Vector2.h" -#include "Math/Swizzle.h" +#include #include "Trade/ImageData.h" using namespace std; @@ -106,11 +106,11 @@ bool TgaImporter::open(istream& in, const string& name) { if(components == AbstractImage::Components::RGB) { Math::Vector3* data = reinterpret_cast*>(buffer); std::transform(data, data + dimensions.product(), data, - [](Math::Vector3 pixel) { return Math::swizzle<'b', 'g', 'r'>(pixel); }); + [](Math::Vector3 pixel) { return swizzle<'b', 'g', 'r'>(pixel); }); } else /* RGBA */ { Math::Vector4* data = reinterpret_cast*>(buffer); std::transform(data, data + dimensions.product(), data, - [](Math::Vector4 pixel) { return Math::swizzle<'b', 'g', 'r', 'a'>(pixel); }); + [](Math::Vector4 pixel) { return swizzle<'b', 'g', 'r', 'a'>(pixel); }); } #endif diff --git a/src/Plugins/TgaImporter/TgaImporter.h b/src/Plugins/TgaImporter/TgaImporter.h index 8a61fb70d..27904108c 100644 --- a/src/Plugins/TgaImporter/TgaImporter.h +++ b/src/Plugins/TgaImporter/TgaImporter.h @@ -71,9 +71,9 @@ class TGAIMPORTER_EXPORT TgaImporter: public AbstractImporter { /** @brief TGA file header */ /** @todoc Enable @c INLINE_SIMPLE_STRUCTS again when unclosed <component> in tagfile is fixed*/ struct TGAIMPORTER_LOCAL Header { - GLbyte identsize; /**< @brief Size of ID field that follows header (0) */ - GLbyte colorMapType; /**< @brief 0 = None, 1 = paletted */ - GLbyte imageType; /**< @brief 0 = none, 1 = indexed, 2 = rgb, 3 = grey, +8=rle */ + char identsize; /**< @brief Size of ID field that follows header (0) */ + char colorMapType; /**< @brief 0 = None, 1 = paletted */ + char imageType; /**< @brief 0 = none, 1 = indexed, 2 = rgb, 3 = grey, +8=rle */ unsigned short colorMapStart; /**< @brief First color map entry */ unsigned short colorMapLength; /**< @brief Number of colors */ unsigned char colorMapBpp; /**< @brief Bits per palette entry */ @@ -81,8 +81,8 @@ class TGAIMPORTER_EXPORT TgaImporter: public AbstractImporter { unsigned short beginY; /**< @brief %Image y origin */ unsigned short width; /**< @brief %Image width */ unsigned short height; /**< @brief %Image height */ - GLbyte bpp; /**< @brief Bits per pixel (8, 16, 24, 32) */ - GLbyte descriptor; /**< @brief %Image descriptor */ + char bpp; /**< @brief Bits per pixel (8, 16, 24, 32) */ + char descriptor; /**< @brief %Image descriptor */ }; #pragma pack(8)