#include "precompiled.h" #include "0ad_warning_disable.h" # include "sr_model.h" //# define SR_USE_TRACE1 // keyword tracking # include "sr_trace.h" static void wcolor ( SrColor c, SrOutput& o ) { float f[4]; c.get(f); o << f[0] << srspc << f[1] << srspc << f[2]; } bool SrModel::export_iv ( const char* file ) { int i; SrOutput o ( fopen(file,"wt") ); if ( !o.valid() ) return false; // ===== Header ================================= o << "#VRML V1.0 ascii\n\n"; o << "Separator {\n\n"; o << " Info { string \"Produced by SR Toolkit exporter v0.5, M. Kallmann 2003\" }\n\n"; // ===== Hints ================================== o << " ShapeHints {\n"; if ( culling ) o << " shapeType SOLID\n"; o << " vertexOrdering COUNTERCLOCKWISE\n"; o << " faceType CONVEX\n"; o << " }\n\n"; //===== Materials =============================== if ( M.size()==1 ) { o << " Material {\n"; o << " diffuseColor "; wcolor(M[0].diffuse,o); o<1 ) { o << " Material {\n"; o << " diffuseColor [\n"; for ( i=0; i1 ) { o << " materialIndex [\n"; for ( i=0; i