Game Development Reference
In-Depth Information
if (strcmp(buf,”FLAG”)==0){
//Found flag
ReadShort(fp,srf->flag);
continue;
}
if (strcmp(buf,”TFP0”)==0){
//Found algorithmic texture parameter 0
if (srf->tex) ReadFloat(fp,srf->tex->widthwrap);
continue;
}
if (strcmp(buf,”TFP1”)==0){
//Found algorithmic texture parameter 1
if (srf->tex) ReadFloat(fp,srf->tex->heightwrap);
continue;
}
if (strcmp(buf,”CTEX”)==0){
if (srf->tex==NULL) srf->tex=new TEXTURE;
if (!srf->tex) return FALSE;
srf->tex->texID=0;//Default
srf->tex->tiling=(2<<16)+2;//Default
srf->tex->centre.x=0.0;
srf->tex->centre.y=0.0;
srf->tex->centre.z=0.0;
srf->tex->size.x=1.0;
srf->tex->size.y=1.0;
srf->tex->size.z=1.0;
fread(nm,s,1,fp); nm[s]=0;
if (strcmp(nm,”Planar Image Map”)==0)
srf->tex->type=TEX_PLANAR;
if (strcmp(nm,”Cylindrical Image Map”)==0)
srf->tex->type=TEX_CYLINDRICAL;
if (strcmp(nm,”Spherical Image Map”)==0)
srf->tex->type=TEX_SPHERICAL;
continue;
}
if (strcmp(buf,”TIMG”)==0){
//Read name
fread(srf->tex->name,s,1,fp);
continue;
}
if (strcmp(buf,”TWRP”)==0){
ReadInt(fp,srf->tex->tiling);
Search Nedrilad ::




Custom Search