[AE Engine logo] Public API Reference
Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

txtldr.h

00001 /*
00002  *  AE Engine
00003  *
00004  *  Copyright (C) 2003 Riku "Rakkis" Nurminen
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef __AEPLUGIN_AETXTLDR_TXTLDR_H__
00023 #define __AEPLUGIN_AETXTLDR_TXTLDR_H__
00024 
00025 #define ONLY_INCLUDE_STD
00026 #include <aedefs.h>
00027 #undef ONLY_INCLUDE_STD
00028 #include <aegfx/texture.h>
00029 #include <aeplugin/plugin.h>
00030 #include <aereg/registry.h>
00031 
00037 
00038 enum TGATypes {
00040         TGA_RGB = 2,
00042         TGA_GREY = 3,
00044         TGA_RLERGB = 10,
00046         TGA_RLEGREY = 11
00047 };
00048 
00050 enum aeTextureType {
00052         AE_TEXTURE_BMP,
00054         AE_TEXTURE_PCX,
00056         AE_TEXTURE_TGA,
00058         AE_TEXTURE_UNKNOWN
00059 };
00060 
00064 typedef struct {
00065         uint16 bfType;
00066         uint32 bfSize;
00067         uint16 bfReserved1;
00068         uint16 bfReserved2;
00069         uint32 bfOffBits;
00070 } bmpFileHeader;
00071 
00075 typedef struct {
00076         uint32 biSize;
00077         uint32 biWidth;
00078         uint32 biHeight;
00079         uint16 biPlanes;
00080         uint16 biBitCount;
00081         uint32 biCompression;
00082         uint32 biSizeImage;
00083         uint32 biXPelsPerMeter;
00084         uint32 biYPelsPerMeter;
00085         uint32 biClrUsed;
00086         uint32 biClrImportant;
00087 } bmpHeader;
00088 
00092 typedef struct {
00093         unsigned char manufacturer;
00094         unsigned char version;
00095         unsigned char encoding;
00096         unsigned char bits;
00097         unsigned char xMin;
00098         unsigned char yMin;
00099         unsigned char xMax;
00100         unsigned char yMax;
00101         unsigned char *palette;
00102 } pcxHeader;
00103 
00107 typedef struct {
00108         uint8 imageIDLength;
00109         uint8 colorMapType;
00110         uint8 imageTypeCode;
00111         sint8 colorMapOrigin;
00112         sint16 colorMapLength;
00113         sint16 colorMapEntrySize;
00114         sint16 imageXOrigin;
00115         sint16 imageYOrigin;
00116         sint16 imageWidth;
00117         sint16 imageHeight;
00118         uint8 bitCount;
00119         uint8 imageDescriptor;
00120 } tgaHeader;
00121 
00127 class aeTextureLoader: public aePlugin {
00128         AECF_CNDEF
00129 
00130  private:
00131         aeRegistry *aereg;
00132 
00133         aeTextureType getImageType(char *);
00134         aeTexture *loadBMP(char *, char *);
00135         aeTexture *loadPCX(char *, char *);
00136         aeTexture *loadTGA(char *, char *);
00137 
00138  public:
00139         aeTextureLoader(aeRegistry *aeReg);
00140         ~aeTextureLoader();
00141 
00150         virtual aeTexture *loadTexture(char *, char *);
00151 };
00152 
00153 #endif // __AEPLUGIN_AETXTLDR_TXTLDR_H__

AE Engine Public API Reference
Generated on Wed Apr 9 09:43:40 2003 by Doxygen.