00001 #ifndef TEXTURE_H
00002 #define TEXTURE_H
00003
00004
00005
00006 #define MAX_MIPMAPS 2
00007 #define MAX_TPAGE_FILENAME 32
00008 #define MAX_TEXTURE_TEST 1024
00009
00010 #define TPAGE_WORLD_NUM 10
00011 #define TPAGE_SCALE_NUM 4
00012 #define TPAGE_FIXED_NUM 5
00013
00014 enum {
00015 TPAGE_WORLD_START,
00016 TPAGE_CAR_START = TPAGE_WORLD_NUM,
00017 TPAGE_FONT = TPAGE_WORLD_NUM + MAX_NUM_PLAYERS,
00018 TPAGE_BIGFONT,
00019 TPAGE_ENVSTILL,
00020 TPAGE_ENVROLL,
00021 TPAGE_SHADOW,
00022 TPAGE_FX1,
00023 TPAGE_FX2,
00024 TPAGE_FX3,
00025 TPAGE_MISC1,
00026
00027 TPAGE_NUM
00028 };
00029
00030 typedef struct {
00031 long Active;
00032 long Width;
00033 long Height;
00034 long Stage;
00035 long MipCount;
00036 char File[MAX_TPAGE_FILENAME];
00037
00038 IDirect3DTexture2 *Texture;
00039 IDirectDrawSurface4 *Surface;
00040 IDirectDrawPalette *Palette;
00041 } TEXINFO;
00042
00043
00044
00045 extern bool CreateTPages(int nPages);
00046 extern void DestroyTPages();
00047 extern void GetTextureFormat(long bpp);
00048 extern void PickTextureSets(long playernum);
00049 extern long MipSize(long size, long set, long count, long mip);
00050 extern HRESULT CALLBACK FindTextureCallback(DDPIXELFORMAT *ddpf, void *lParam);
00051 extern long CountTexturePixels(long needed, long width, long height);
00052 extern long CountMipTexturePixels(long needed, long width, long height);
00053 extern bool LoadTextureClever(char *tex, char tpage, long width, long height, long stage, long set, long mip);
00054 extern bool LoadTexture(char *tex, char tpage, long width, long height, long stage);
00055 extern bool LoadMipTexture(char *tex, char tpage, long width, long height, long stage, long mipcount);
00056 extern void InitTextures(void);
00057 extern void FreeTextures(void);
00058 extern void FreeOneTexture(char tp);
00059
00060
00061
00062 extern DDPIXELFORMAT TexFormat;
00063 extern char TexturesEnabled, TexturesSquareOnly, TexturesAGP;
00064 extern TEXINFO *TexInfo;
00065 extern int TEX_NTPages;
00066 extern long TexturePixels, WorldTextureSet, CarTextureSet, FxTextureSet;
00067 extern DWORD TextureMinWidth, TextureMaxWidth, TextureMinHeight, TextureMaxHeight;
00068
00069 #endif