1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
2
// This file is part of the "Irrlicht Engine".
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
5
#ifndef __C_IMAGE_LOADER_TGA_H_INCLUDED__
6
#define __C_IMAGE_LOADER_TGA_H_INCLUDED__
8
#include "IrrCompileConfig.h"
10
#include "IImageLoader.h"
18
#if defined(_IRR_COMPILE_WITH_TGA_LOADER_) || defined(_IRR_COMPILE_WITH_TGA_WRITER_)
20
// byte-align structures
21
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
22
# pragma pack( push, packing )
25
#elif defined( __GNUC__ )
26
# define PACK_STRUCT __attribute__((packed))
31
// these structs are also used in the TGA writer
36
u8 FirstEntryIndex[2];
55
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
56
# pragma pack( pop, packing )
61
#endif // compiled with loader or reader
63
#ifdef _IRR_COMPILE_WITH_TGA_LOADER_
66
Surface Loader for targa images
68
class CImageLoaderTGA : public IImageLoader
72
//! returns true if the file maybe is able to be loaded by this class
73
//! based on the file extension (e.g. ".tga")
74
virtual bool isALoadableFileExtension(const io::path& filename) const;
76
//! returns true if the file maybe is able to be loaded by this class
77
virtual bool isALoadableFileFormat(io::IReadFile* file) const;
79
//! creates a surface from the file
80
virtual IImage* loadImage(io::IReadFile* file) const;
84
//! loads a compressed tga. Was written and sent in by Jon Pry, thank you very much!
85
u8* loadCompressedImage(io::IReadFile *file, const STGAHeader& header) const;
88
#endif // compiled with loader
90
} // end namespace video
91
} // end namespace irr