Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# chunk.h

Go to the documentation of this file.

    00001 /* -*- c -*- */
    00002 #ifndef INCLUDED_LIB3DS_CHUNK_H
    00003 #define INCLUDED_LIB3DS_CHUNK_H
    00004 /*
    00005  * The 3D Studio File Format Library
    00006  * Copyright (C) 1996-2001 by J.E. Hoffmann <je-h@gmx.net>
    00007  * All rights reserved.
    00008  *
    00009  * This program is  free  software;  you can redistribute it and/or modify it
    00010  * under the terms of the  GNU Lesser General Public License  as published by
    00011  * the  Free Software Foundation;  either version 2.1 of the License,  or (at
    00012  * your option) any later version.
    00013  *
    00014  * This  program  is  distributed in  the  hope that it will  be useful,  but
    00015  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    00016  * or  FITNESS FOR A  PARTICULAR PURPOSE.  See the  GNU Lesser General Public
    00017  * License for more details.
    00018  *
    00019  * You should  have received  a copy of the GNU Lesser General Public License
    00020  * along with  this program;  if not, write to the  Free Software Foundation,
    00021  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00022  *
    00023  * $Id: chunk.h,v 1.1 2005/03/07 11:16:25 Assassin Exp $
    00024  */
    00025
    00026 #ifndef INCLUDED_LIB3DS_TYPES_H
    00027 #include <lib3ds/types.h>
    00028 #endif
    00029
    00030 #ifdef __cplusplus
    00031 extern "C" {
    00032 #endif
    00033
    00034 typedef enum _Lib3dsChunks {
    00035   LIB3DS_NULL_CHUNK             =0x0000,
    00036   LIB3DS_M3DMAGIC               =0x4D4D,    /*3DS file*/
    00037   LIB3DS_SMAGIC                 =0x2D2D,
    00038   LIB3DS_LMAGIC                 =0x2D3D,
    00039   LIB3DS_MLIBMAGIC              =0x3DAA,    /*MLI file*/
    00040   LIB3DS_MATMAGIC               =0x3DFF,
    00041   LIB3DS_CMAGIC                 =0xC23D,    /*PRJ file*/
    00042   LIB3DS_M3D_VERSION            =0x0002,
    00043   LIB3DS_M3D_KFVERSION          =0x0005,
    00044
    00045   LIB3DS_COLOR_F                =0x0010,
    00046   LIB3DS_COLOR_24               =0x0011,
    00047   LIB3DS_LIN_COLOR_24           =0x0012,
    00048   LIB3DS_LIN_COLOR_F            =0x0013,
    00049   LIB3DS_INT_PERCENTAGE         =0x0030,
    00050   LIB3DS_FLOAT_PERCENTAGE       =0x0031,
    00051
    00052   LIB3DS_MDATA                  =0x3D3D,
    00053   LIB3DS_MESH_VERSION           =0x3D3E,
    00054   LIB3DS_MASTER_SCALE           =0x0100,
    00055   LIB3DS_LO_SHADOW_BIAS         =0x1400,
    00056   LIB3DS_HI_SHADOW_BIAS         =0x1410,
    00057   LIB3DS_SHADOW_MAP_SIZE        =0x1420,
    00058   LIB3DS_SHADOW_SAMPLES         =0x1430,
    00059   LIB3DS_SHADOW_RANGE           =0x1440,
    00060   LIB3DS_SHADOW_FILTER          =0x1450,
    00061   LIB3DS_RAY_BIAS               =0x1460,
    00062   LIB3DS_O_CONSTS               =0x1500,
    00063   LIB3DS_AMBIENT_LIGHT          =0x2100,
    00064   LIB3DS_BIT_MAP                =0x1100,
    00065   LIB3DS_SOLID_BGND             =0x1200,
    00066   LIB3DS_V_GRADIENT             =0x1300,
    00067   LIB3DS_USE_BIT_MAP            =0x1101,
    00068   LIB3DS_USE_SOLID_BGND         =0x1201,
    00069   LIB3DS_USE_V_GRADIENT         =0x1301,
    00070   LIB3DS_FOG                    =0x2200,
    00071   LIB3DS_FOG_BGND               =0x2210,
    00072   LIB3DS_LAYER_FOG              =0x2302,
    00073   LIB3DS_DISTANCE_CUE           =0x2300,
    00074   LIB3DS_DCUE_BGND              =0x2310,
    00075   LIB3DS_USE_FOG                =0x2201,
    00076   LIB3DS_USE_LAYER_FOG          =0x2303,
    00077   LIB3DS_USE_DISTANCE_CUE       =0x2301,
    00078
    00079   LIB3DS_MAT_ENTRY              =0xAFFF,
    00080   LIB3DS_MAT_NAME               =0xA000,
    00081   LIB3DS_MAT_AMBIENT            =0xA010,
    00082   LIB3DS_MAT_DIFFUSE            =0xA020,
    00083   LIB3DS_MAT_SPECULAR           =0xA030,
    00084   LIB3DS_MAT_SHININESS          =0xA040,
    00085   LIB3DS_MAT_SHIN2PCT           =0xA041,
    00086   LIB3DS_MAT_TRANSPARENCY       =0xA050,
    00087   LIB3DS_MAT_XPFALL             =0xA052,
    00088   LIB3DS_MAT_USE_XPFALL         =0xA240,
    00089   LIB3DS_MAT_REFBLUR            =0xA053,
    00090   LIB3DS_MAT_SHADING            =0xA100,
    00091   LIB3DS_MAT_USE_REFBLUR        =0xA250,
    00092   LIB3DS_MAT_SELF_ILLUM         =0xA080,
    00093   LIB3DS_MAT_TWO_SIDE           =0xA081,
    00094   LIB3DS_MAT_DECAL              =0xA082,
    00095   LIB3DS_MAT_ADDITIVE           =0xA083,
    00096   LIB3DS_MAT_WIRE               =0xA085,
    00097   LIB3DS_MAT_FACEMAP            =0xA088,
    00098   LIB3DS_MAT_PHONGSOFT          =0xA08C,
    00099   LIB3DS_MAT_WIREABS            =0xA08E,
    00100   LIB3DS_MAT_WIRE_SIZE          =0xA087,
    00101   LIB3DS_MAT_TEXMAP             =0xA200,
    00102   LIB3DS_MAT_SXP_TEXT_DATA      =0xA320,
    00103   LIB3DS_MAT_TEXMASK            =0xA33E,
    00104   LIB3DS_MAT_SXP_TEXTMASK_DATA  =0xA32A,
    00105   LIB3DS_MAT_TEX2MAP            =0xA33A,
    00106   LIB3DS_MAT_SXP_TEXT2_DATA     =0xA321,
    00107   LIB3DS_MAT_TEX2MASK           =0xA340,
    00108   LIB3DS_MAT_SXP_TEXT2MASK_DATA =0xA32C,
    00109   LIB3DS_MAT_OPACMAP            =0xA210,
    00110   LIB3DS_MAT_SXP_OPAC_DATA      =0xA322,
    00111   LIB3DS_MAT_OPACMASK           =0xA342,
    00112   LIB3DS_MAT_SXP_OPACMASK_DATA  =0xA32E,
    00113   LIB3DS_MAT_BUMPMAP            =0xA230,
    00114   LIB3DS_MAT_SXP_BUMP_DATA      =0xA324,
    00115   LIB3DS_MAT_BUMPMASK           =0xA344,
    00116   LIB3DS_MAT_SXP_BUMPMASK_DATA  =0xA330,
    00117   LIB3DS_MAT_SPECMAP            =0xA204,
    00118   LIB3DS_MAT_SXP_SPEC_DATA      =0xA325,
    00119   LIB3DS_MAT_SPECMASK           =0xA348,
    00120   LIB3DS_MAT_SXP_SPECMASK_DATA  =0xA332,
    00121   LIB3DS_MAT_SHINMAP            =0xA33C,
    00122   LIB3DS_MAT_SXP_SHIN_DATA      =0xA326,
    00123   LIB3DS_MAT_SHINMASK           =0xA346,
    00124   LIB3DS_MAT_SXP_SHINMASK_DATA  =0xA334,
    00125   LIB3DS_MAT_SELFIMAP           =0xA33D,
    00126   LIB3DS_MAT_SXP_SELFI_DATA     =0xA328,
    00127   LIB3DS_MAT_SELFIMASK          =0xA34A,
    00128   LIB3DS_MAT_SXP_SELFIMASK_DATA =0xA336,
    00129   LIB3DS_MAT_REFLMAP            =0xA220,
    00130   LIB3DS_MAT_REFLMASK           =0xA34C,
    00131   LIB3DS_MAT_SXP_REFLMASK_DATA  =0xA338,
    00132   LIB3DS_MAT_ACUBIC             =0xA310,
    00133   LIB3DS_MAT_MAPNAME            =0xA300,
    00134   LIB3DS_MAT_MAP_TILING         =0xA351,
    00135   LIB3DS_MAT_MAP_TEXBLUR        =0xA353,
    00136   LIB3DS_MAT_MAP_USCALE         =0xA354,
    00137   LIB3DS_MAT_MAP_VSCALE         =0xA356,
    00138   LIB3DS_MAT_MAP_UOFFSET        =0xA358,
    00139   LIB3DS_MAT_MAP_VOFFSET        =0xA35A,
    00140   LIB3DS_MAT_MAP_ANG            =0xA35C,
    00141   LIB3DS_MAT_MAP_COL1           =0xA360,
    00142   LIB3DS_MAT_MAP_COL2           =0xA362,
    00143   LIB3DS_MAT_MAP_RCOL           =0xA364,
    00144   LIB3DS_MAT_MAP_GCOL           =0xA366,
    00145   LIB3DS_MAT_MAP_BCOL           =0xA368,
    00146
    00147   LIB3DS_NAMED_OBJECT           =0x4000,
    00148   LIB3DS_N_DIRECT_LIGHT         =0x4600,
    00149   LIB3DS_DL_OFF                 =0x4620,
    00150   LIB3DS_DL_OUTER_RANGE         =0x465A,
    00151   LIB3DS_DL_INNER_RANGE         =0x4659,
    00152   LIB3DS_DL_MULTIPLIER          =0x465B,
    00153   LIB3DS_DL_EXCLUDE             =0x4654,
    00154   LIB3DS_DL_ATTENUATE           =0x4625,
    00155   LIB3DS_DL_SPOTLIGHT           =0x4610,
    00156   LIB3DS_DL_SPOT_ROLL           =0x4656,
    00157   LIB3DS_DL_SHADOWED            =0x4630,
    00158   LIB3DS_DL_LOCAL_SHADOW2       =0x4641,
    00159   LIB3DS_DL_SEE_CONE            =0x4650,
    00160   LIB3DS_DL_SPOT_RECTANGULAR    =0x4651,
    00161   LIB3DS_DL_SPOT_ASPECT         =0x4657,
    00162   LIB3DS_DL_SPOT_PROJECTOR      =0x4653,
    00163   LIB3DS_DL_SPOT_OVERSHOOT      =0x4652,
    00164   LIB3DS_DL_RAY_BIAS            =0x4658,
    00165   LIB3DS_DL_RAYSHAD             =0x4627,
    00166   LIB3DS_N_CAMERA               =0x4700,
    00167   LIB3DS_CAM_SEE_CONE           =0x4710,
    00168   LIB3DS_CAM_RANGES             =0x4720,
    00169   LIB3DS_OBJ_HIDDEN             =0x4010,
    00170   LIB3DS_OBJ_VIS_LOFTER         =0x4011,
    00171   LIB3DS_OBJ_DOESNT_CAST        =0x4012,
    00172   LIB3DS_OBJ_DONT_RECVSHADOW    =0x4017,
    00173   LIB3DS_OBJ_MATTE              =0x4013,
    00174   LIB3DS_OBJ_FAST               =0x4014,
    00175   LIB3DS_OBJ_PROCEDURAL         =0x4015,
    00176   LIB3DS_OBJ_FROZEN             =0x4016,
    00177   LIB3DS_N_TRI_OBJECT           =0x4100,
    00178   LIB3DS_POINT_ARRAY            =0x4110,
    00179   LIB3DS_POINT_FLAG_ARRAY       =0x4111,
    00180   LIB3DS_FACE_ARRAY             =0x4120,
    00181   LIB3DS_MSH_MAT_GROUP          =0x4130,
    00182   LIB3DS_SMOOTH_GROUP           =0x4150,
    00183   LIB3DS_MSH_BOXMAP             =0x4190,
    00184   LIB3DS_TEX_VERTS              =0x4140,
    00185   LIB3DS_MESH_MATRIX            =0x4160,
    00186   LIB3DS_MESH_COLOR             =0x4165,
    00187   LIB3DS_MESH_TEXTURE_INFO      =0x4170,
    00188
    00189   LIB3DS_KFDATA                 =0xB000,
    00190   LIB3DS_KFHDR                  =0xB00A,
    00191   LIB3DS_KFSEG                  =0xB008,
    00192   LIB3DS_KFCURTIME              =0xB009,
    00193   LIB3DS_AMBIENT_NODE_TAG       =0xB001,
    00194   LIB3DS_OBJECT_NODE_TAG        =0xB002,
    00195   LIB3DS_CAMERA_NODE_TAG        =0xB003,
    00196   LIB3DS_TARGET_NODE_TAG        =0xB004,
    00197   LIB3DS_LIGHT_NODE_TAG         =0xB005,
    00198   LIB3DS_L_TARGET_NODE_TAG      =0xB006,
    00199   LIB3DS_SPOTLIGHT_NODE_TAG     =0xB007,
    00200   LIB3DS_NODE_ID                =0xB030,
    00201   LIB3DS_NODE_HDR               =0xB010,
    00202   LIB3DS_PIVOT                  =0xB013,
    00203   LIB3DS_INSTANCE_NAME          =0xB011,
    00204   LIB3DS_MORPH_SMOOTH           =0xB015,
    00205   LIB3DS_BOUNDBOX               =0xB014,
    00206   LIB3DS_POS_TRACK_TAG          =0xB020,
    00207   LIB3DS_COL_TRACK_TAG          =0xB025,
    00208   LIB3DS_ROT_TRACK_TAG          =0xB021,
    00209   LIB3DS_SCL_TRACK_TAG          =0xB022,
    00210   LIB3DS_MORPH_TRACK_TAG        =0xB026,
    00211   LIB3DS_FOV_TRACK_TAG          =0xB023,
    00212   LIB3DS_ROLL_TRACK_TAG         =0xB024,
    00213   LIB3DS_HOT_TRACK_TAG          =0xB027,
    00214   LIB3DS_FALL_TRACK_TAG         =0xB028,
    00215   LIB3DS_HIDE_TRACK_TAG         =0xB029,
    00216
    00217   LIB3DS_POLY_2D                = 0x5000,
    00218   LIB3DS_SHAPE_OK               = 0x5010,
    00219   LIB3DS_SHAPE_NOT_OK           = 0x5011,
    00220   LIB3DS_SHAPE_HOOK             = 0x5020,
    00221   LIB3DS_PATH_3D                = 0x6000,
    00222   LIB3DS_PATH_MATRIX            = 0x6005,
    00223   LIB3DS_SHAPE_2D               = 0x6010,
    00224   LIB3DS_M_SCALE                = 0x6020,
    00225   LIB3DS_M_TWIST                = 0x6030,
    00226   LIB3DS_M_TEETER               = 0x6040,
    00227   LIB3DS_M_FIT                  = 0x6050,
    00228   LIB3DS_M_BEVEL                = 0x6060,
    00229   LIB3DS_XZ_CURVE               = 0x6070,
    00230   LIB3DS_YZ_CURVE               = 0x6080,
    00231   LIB3DS_INTERPCT               = 0x6090,
    00232   LIB3DS_DEFORM_LIMIT           = 0x60A0,
    00233
    00234   LIB3DS_USE_CONTOUR            = 0x6100,
    00235   LIB3DS_USE_TWEEN              = 0x6110,
    00236   LIB3DS_USE_SCALE              = 0x6120,
    00237   LIB3DS_USE_TWIST              = 0x6130,
    00238   LIB3DS_USE_TEETER             = 0x6140,
    00239   LIB3DS_USE_FIT                = 0x6150,
    00240   LIB3DS_USE_BEVEL              = 0x6160,
    00241
    00242   LIB3DS_DEFAULT_VIEW           = 0x3000,
    00243   LIB3DS_VIEW_TOP               = 0x3010,
    00244   LIB3DS_VIEW_BOTTOM            = 0x3020,
    00245   LIB3DS_VIEW_LEFT              = 0x3030,
    00246   LIB3DS_VIEW_RIGHT             = 0x3040,
    00247   LIB3DS_VIEW_FRONT             = 0x3050,
    00248   LIB3DS_VIEW_BACK              = 0x3060,
    00249   LIB3DS_VIEW_USER              = 0x3070,
    00250   LIB3DS_VIEW_CAMERA            = 0x3080,
    00251   LIB3DS_VIEW_WINDOW            = 0x3090,
    00252
    00253   LIB3DS_VIEWPORT_LAYOUT_OLD    = 0x7000,
    00254   LIB3DS_VIEWPORT_DATA_OLD      = 0x7010,
    00255   LIB3DS_VIEWPORT_LAYOUT        = 0x7001,
    00256   LIB3DS_VIEWPORT_DATA          = 0x7011,
    00257   LIB3DS_VIEWPORT_DATA_3        = 0x7012,
    00258   LIB3DS_VIEWPORT_SIZE          = 0x7020,
    00259   LIB3DS_NETWORK_VIEW           = 0x7030
    00260 } Lib3dsChunks;
    00261
    00262 typedef struct _Lib3dsChunk {
    00263     Lib3dsWord chunk;
    00264     Lib3dsDword size;
    00265     Lib3dsDword end;
    00266     Lib3dsDword cur;
    00267 } Lib3dsChunk;
    00268
    00269 extern LIB3DSAPI void lib3ds_chunk_enable_dump(Lib3dsBool enable, Lib3dsBool unknown);
    00270 extern LIB3DSAPI Lib3dsBool lib3ds_chunk_read(Lib3dsChunk *c, Lib3dsIo *io);
    00271 extern LIB3DSAPI Lib3dsBool lib3ds_chunk_read_start(Lib3dsChunk *c, Lib3dsWord chunk, Lib3dsIo *io);
    00272 extern LIB3DSAPI void lib3ds_chunk_read_tell(Lib3dsChunk *c, Lib3dsIo *io);
    00273 extern LIB3DSAPI Lib3dsWord lib3ds_chunk_read_next(Lib3dsChunk *c, Lib3dsIo *io);
    00274 extern LIB3DSAPI void lib3ds_chunk_read_reset(Lib3dsChunk *c, Lib3dsIo *io);
    00275 extern LIB3DSAPI void lib3ds_chunk_read_end(Lib3dsChunk *c, Lib3dsIo *io);
    00276 extern LIB3DSAPI Lib3dsBool lib3ds_chunk_write(Lib3dsChunk *c, Lib3dsIo *io);
    00277 extern LIB3DSAPI Lib3dsBool lib3ds_chunk_write_start(Lib3dsChunk *c, Lib3dsIo *io);
    00278 extern LIB3DSAPI Lib3dsBool lib3ds_chunk_write_end(Lib3dsChunk *c, Lib3dsIo *io);
    00279 extern LIB3DSAPI const char* lib3ds_chunk_name(Lib3dsWord chunk);
    00280 extern LIB3DSAPI void lib3ds_chunk_unknown(Lib3dsWord chunk);
    00281 extern LIB3DSAPI void lib3ds_chunk_dump_info(const char *format, ...);
    00282
    00283 #ifdef __cplusplus
    00284 };
    00285 #endif
    00286 #endif
    00287
    00288