Browse Source

Adapted to Magnum changes.

pull/34/head
Vladimír Vondruš 14 years ago
parent
commit
92e250b600
  1. 4
      src/Plugins/TgaImporter/Test/TgaImporterTest.cpp
  2. 2
      src/Plugins/TgaImporter/TgaImporter.cpp
  3. 28
      src/Plugins/TgaImporter/TgaImporter.h

4
src/Plugins/TgaImporter/Test/TgaImporterTest.cpp

@ -117,7 +117,7 @@ void TgaImporterTest::bits24() {
#else #else
CORRADE_VERIFY(image->components() == AbstractImage::Components::RGB); CORRADE_VERIFY(image->components() == AbstractImage::Components::RGB);
#endif #endif
CORRADE_COMPARE(image->dimensions(), Math::Vector2<GLsizei>(2, 3)); CORRADE_COMPARE(image->size(), Math::Vector2<GLsizei>(2, 3));
CORRADE_VERIFY(image->type() == TypeTraits<GLubyte>::imageType()); CORRADE_VERIFY(image->type() == TypeTraits<GLubyte>::imageType());
CORRADE_COMPARE(string(static_cast<const char*>(image->data()), 2*3*3), string(pixels, 2*3*3)); CORRADE_COMPARE(string(static_cast<const char*>(image->data()), 2*3*3), string(pixels, 2*3*3));
} }
@ -144,7 +144,7 @@ void TgaImporterTest::bits32() {
#else #else
CORRADE_VERIFY(image->components() == AbstractImage::Components::RGBA); CORRADE_VERIFY(image->components() == AbstractImage::Components::RGBA);
#endif #endif
CORRADE_COMPARE(image->dimensions(), Math::Vector2<GLsizei>(2, 3)); CORRADE_COMPARE(image->size(), Math::Vector2<GLsizei>(2, 3));
CORRADE_VERIFY(image->type() == TypeTraits<GLubyte>::imageType()); CORRADE_VERIFY(image->type() == TypeTraits<GLubyte>::imageType());
CORRADE_COMPARE(string(static_cast<const char*>(image->data()), 2*3*3), string(pixels, 2*3*3)); CORRADE_COMPARE(string(static_cast<const char*>(image->data()), 2*3*3), string(pixels, 2*3*3));
} }

2
src/Plugins/TgaImporter/TgaImporter.cpp

@ -124,7 +124,7 @@ void TgaImporter::close() {
_image = nullptr; _image = nullptr;
} }
ImageData2D* TgaImporter::image2D(unsigned int) { ImageData2D* TgaImporter::image2D(std::uint32_t) {
return _image; return _image;
} }

28
src/Plugins/TgaImporter/TgaImporter.h

@ -64,25 +64,25 @@ class TGAIMPORTER_EXPORT TgaImporter: public AbstractImporter {
void close(); void close();
inline unsigned int image2DCount() const { return _image ? 1 : 0; } inline std::uint32_t image2DCount() const { return _image ? 1 : 0; }
ImageData2D* image2D(unsigned int id); ImageData2D* image2D(std::uint32_t id);
#pragma pack(1) #pragma pack(1)
/** @brief TGA file header */ /** @brief TGA file header */
/** @todoc Enable @c INLINE_SIMPLE_STRUCTS again when unclosed &lt;component&gt; in tagfile is fixed*/ /** @todoc Enable @c INLINE_SIMPLE_STRUCTS again when unclosed &lt;component&gt; in tagfile is fixed*/
struct TGAIMPORTER_LOCAL Header { struct TGAIMPORTER_LOCAL Header {
char identsize; /**< @brief Size of ID field that follows header (0) */ std::uint8_t identsize; /**< @brief Size of ID field that follows header (0) */
char colorMapType; /**< @brief 0 = None, 1 = paletted */ std::uint8_t colorMapType; /**< @brief 0 = None, 1 = paletted */
char imageType; /**< @brief 0 = none, 1 = indexed, 2 = rgb, 3 = grey, +8=rle */ std::uint8_t imageType; /**< @brief 0 = none, 1 = indexed, 2 = rgb, 3 = grey, +8=rle */
unsigned short colorMapStart; /**< @brief First color map entry */ std::uint16_t colorMapStart; /**< @brief First color map entry */
unsigned short colorMapLength; /**< @brief Number of colors */ std::uint16_t colorMapLength; /**< @brief Number of colors */
unsigned char colorMapBpp; /**< @brief Bits per palette entry */ std::uint8_t colorMapBpp; /**< @brief Bits per palette entry */
unsigned short beginX; /**< @brief %Image x origin */ std::uint16_t beginX; /**< @brief %Image x origin */
unsigned short beginY; /**< @brief %Image y origin */ std::uint16_t beginY; /**< @brief %Image y origin */
unsigned short width; /**< @brief %Image width */ std::uint16_t width; /**< @brief %Image width */
unsigned short height; /**< @brief %Image height */ std::uint16_t height; /**< @brief %Image height */
char bpp; /**< @brief Bits per pixel (8, 16, 24, 32) */ std::uint8_t bpp; /**< @brief Bits per pixel (8, 16, 24, 32) */
char descriptor; /**< @brief %Image descriptor */ std::uint8_t descriptor; /**< @brief %Image descriptor */
}; };
#pragma pack(8) #pragma pack(8)

Loading…
Cancel
Save