00001 /******************************************************************************/ 00002 // xcubtxtr.h - Dungeon Keeper Tools. 00003 /******************************************************************************/ 00004 // Author: Tomasz Lis 00005 // Created: 19 Apr 2008 00006 00007 // Purpose: 00008 // Header file. Defines exported routines from xcubtxtr.h 00009 00010 // Comment: 00011 // None. 00012 00013 //Copying and copyrights: 00014 // This program is free software; you can redistribute it and/or modify 00015 // it under the terms of the GNU General Public License as published by 00016 // the Free Software Foundation; either version 2 of the License, or 00017 // (at your option) any later version. 00018 /******************************************************************************/ 00019 00020 #ifndef BULL_XCUBTXTR_H 00021 #define BULL_XCUBTXTR_H 00022 00023 #include "globals.h" 00024 00025 // No error condition need to be same as in read_file (MFILE_OK) 00026 // There should be no more than 32 errors (up to -31) 00027 // values to 23 are reserved by read_file and RNC library 00028 #define XCUTX_FILE_BADDATA 1 00029 #define XCUTX_CANT_OPEN 2 00030 #define XCUTX_MALLOC_ERR 3 00031 #define XCUTX_INTERNAL 4 00032 00033 #define SIZEOF_DK_CUBE_REC 18 00034 #define SIZEOF_DK_CUBE_HEADER 4 00035 00036 #define TEXTURE_SIZE_X 32 00037 #define TEXTURE_SIZE_Y 32 00038 #define TEXTURE_COUNT_X 8 00039 #define TEXTURE_COUNT_Y 68 00040 00041 //Animated texture - indices of textures which are swiching 00042 struct CUBE_TXTRANIM { 00043 unsigned int data[8]; 00044 }; 00045 00046 //Texture indices for every side of a cube 00047 struct CUBE_TEXTURES { 00048 //north 00049 unsigned int n; 00050 //south 00051 unsigned int s; 00052 //west 00053 unsigned int w; 00054 //east 00055 unsigned int e; 00056 //top 00057 unsigned int t; 00058 //bottom 00059 unsigned int b; 00060 //unknown (unused?) 00061 unsigned int u[3]; 00062 }; 00063 00064 struct CUBES_DATA { 00065 struct CUBE_TEXTURES *data; 00066 int count; 00067 struct CUBE_TXTRANIM *anitx; 00068 int anitxcount; 00069 }; 00070 00071 DLLIMPORT short alloc_cubedata(struct CUBES_DATA *cubes,long count); 00072 DLLIMPORT short free_cubedata(struct CUBES_DATA *cubes); 00073 00074 DLLIMPORT short load_cubedata(struct CUBES_DATA *cubes,const char *fname); 00075 DLLIMPORT short write_cubedata(struct CUBES_DATA *cubes,const char *fname); 00076 00077 DLLIMPORT short switch_cubedata_entries(struct CUBES_DATA *cubes,unsigned long idx1,unsigned long idx2); 00078 00079 DLLIMPORT short load_textureanim(struct CUBES_DATA *cubes,const char *fname); 00080 DLLIMPORT short load_texture(unsigned char **texture,const char *fname); 00081 00082 #endif