// Save(): void SelectOMatic_Item::Save( const LWSaveState *saver ) { char cvalue; char buffer[20]; // Item Base LWSAVE_BEGIN( saver, &selectomatic_item_io_item[ SOMITEMIOID_ITEM ], 0 ); // Item ID LWSAVE_BEGIN( saver, &selectomatic_item_io_root[ SOMITEMIOID_ITID ], 1 ); sprintf( buffer, "%x", id ); LWSAVE_STR( saver, buffer ); LWSAVE_END( saver ); if( id == SOM_GROUP ) { // Fold State LWSAVE_BEGIN( saver, &selectomatic_item_io_root[ SOMITEMIOID_FOLD ], 1 ); cvalue = is_folded ? 1 : 0; LWSAVE_I1( saver, &cvalue, 1 ); LWSAVE_END( saver ); // Group Name LWSAVE_BEGIN( saver, &selectomatic_item_io_root[ SOMITEMIOID_NAME ], 1 ); LWSAVE_STR( saver, ((name == NULL) ? "" : name) ); LWSAVE_END( saver ); // Children if( children.NumElements() > 0 ) { LWSAVE_BEGIN( saver, &selectomatic_item_io_root[ SOMITEMIOID_CHLD ], 0 ); for( unsigned long i=0; i < children.NumElements(); i++ ) children[i]->Save( saver ); LWSAVE_END( saver ); } } LWSAVE_END( saver ); // End item }
Save( AtmosphereData *dat, const LWSaveState *sState ) { int version = VERSION_NB, txtr; float fp[ 3 ]; LWSAVE_I4( sState, &version, 1 ); fp[ 0 ] = ( float ) dat->hi; LWSAVE_FP( sState, fp, 1 ); fp[ 0 ] = ( float ) dat->lo; LWSAVE_FP( sState, fp, 1 ); fp[ 0 ] = ( float ) dat->fa; LWSAVE_FP( sState, fp, 1 ); fp[ 0 ] = ( float ) dat->lum; LWSAVE_FP( sState, fp, 1 ); fp[ 0 ] = ( float ) dat->opa; LWSAVE_FP( sState, fp, 1 ); fp[ 0 ] = ( float ) dat->den; LWSAVE_FP( sState, fp, 1 ); fp[ 0 ] = ( float ) dat->col[ 0 ]; fp[ 1 ] = ( float ) dat->col[ 1 ]; fp[ 2 ] = ( float ) dat->col[ 2 ]; LWSAVE_FP( sState, fp, 3 ); LWSAVE_I4( sState, &dat->res, 1 ); LWSAVE_I4( sState, &dat->useTxtr, 1 ); LWSAVE_I4( sState, &dat->march, 1 ); LWSAVE_I4( sState, &dat->bck, 1 ); if ( dat->txtr ) { txtr = 1; LWSAVE_I4( sState, &txtr, 1 ); LWSAVE_BEGIN( sState, &headerBlks[ 0 ], 0 ); txtrf->save( dat->txtr, sState ); LWSAVE_END( sState ); } else { txtr = 0; LWSAVE_I4( sState, &txtr, 1 ); } return NULL; }
// Save(): const char * IllumiSurf_Instance::Save( const LWSaveState *saver ) { char cvalue; // Version LWSAVE_BEGIN( saver, &illumisurf_io_isfv[0], 0 ); cvalue = 1; LWSAVE_I1( saver, &cvalue, 1 ); // Blending Mode LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_BLND ], 1 ); cvalue = GetBlendMode(); LWSAVE_I1( saver, &cvalue, 1 ); LWSAVE_END( saver ); // Base Intensity LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_BINT ], 1 ); vparam_funcs->save( GetBaseIntensity(), saver ); LWSAVE_END( saver ); // Alternate Intensity LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_AINT ], 1 ); vparam_funcs->save( GetAltIntensity(), saver ); LWSAVE_END( saver ); // Color LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_COLR ], 1 ); cvalue = GetUseColor() ? 1 : 0; LWSAVE_I1( saver, &cvalue, 1 ); vparam_funcs->save( GetColor(), saver ); LWSAVE_END( saver ); // Luminosity LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_LUMI ], 1 ); cvalue = GetUseLuminosity() ? 1 : 0; LWSAVE_I1( saver, &cvalue, 1 ); vparam_funcs->save( GetLuminosity(), saver ); LWSAVE_END( saver ); // Diffusion LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_DIFF ], 1 ); cvalue = GetUseDiffusion() ? 1 : 0; LWSAVE_I1( saver, &cvalue, 1 ); vparam_funcs->save( GetDiffusion(), saver ); LWSAVE_END( saver ); // Specular LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_SPEC ], 1 ); cvalue = GetUseSpecular() ? 1 : 0; LWSAVE_I1( saver, &cvalue, 1 ); vparam_funcs->save( GetSpecular(), saver ); LWSAVE_END( saver ); // Glossiness LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_GLOS ], 1 ); cvalue = GetUseGlossiness() ? 1 : 0; LWSAVE_I1( saver, &cvalue, 1 ); vparam_funcs->save( GetGlossiness(), saver ); LWSAVE_END( saver ); // Reflection LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_REFL ], 1 ); cvalue = GetUseReflection() ? 1 : 0; LWSAVE_I1( saver, &cvalue, 1 ); vparam_funcs->save( GetReflection(), saver ); LWSAVE_END( saver ); // Transparency LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_TRNP ], 1 ); cvalue = GetUseTransparency() ? 1 : 0; LWSAVE_I1( saver, &cvalue, 1 ); vparam_funcs->save( GetTransparency(), saver ); LWSAVE_END( saver ); // Refraction LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_REFR ], 1 ); cvalue = GetUseRefraction() ? 1 : 0; LWSAVE_I1( saver, &cvalue, 1 ); vparam_funcs->save( GetRefraction(), saver ); LWSAVE_END( saver ); // Translucency LWSAVE_BEGIN( saver, &illumisurf_io_root[ ISIOID_TRNC ], 1 ); cvalue = GetUseTranslucency() ? 1 : 0; LWSAVE_I1( saver, &cvalue, 1 ); vparam_funcs->save( GetTranslucency(), saver ); LWSAVE_END( saver ); LWSAVE_END( saver ); return NULL; }