/* =================== idSaveGame::WriteTrace =================== */ void idSaveGame::WriteTrace( const trace_t& trace ) { WriteFloat( trace.fraction ); WriteVec3( trace.endpos ); WriteMat3( trace.endAxis ); WriteContactInfo( trace.c ); }
/* ================ idSaveGame::WriteRenderLight ================ */ void idSaveGame::WriteRenderLight( const renderLight_t &renderLight ) { int i; WriteMat3( renderLight.axis ); WriteVec3( renderLight.origin ); WriteInt( renderLight.suppressLightInViewID ); WriteInt( renderLight.allowLightInViewID ); WriteBool( renderLight.noShadows ); WriteBool( renderLight.noSpecular ); WriteBool( renderLight.pointLight ); WriteBool( renderLight.parallel ); WriteVec3( renderLight.lightRadius ); WriteVec3( renderLight.lightCenter ); WriteVec3( renderLight.target ); WriteVec3( renderLight.right ); WriteVec3( renderLight.up ); WriteVec3( renderLight.start ); WriteVec3( renderLight.end ); // only idLight has a prelightModel and it's always based on the entityname, so we'll restore it there // WriteModel( renderLight.prelightModel ); WriteInt( renderLight.lightId ); WriteMaterial( renderLight.shader ); for( i = 0; i < MAX_ENTITY_SHADER_PARMS; i++ ) { WriteFloat( renderLight.shaderParms[ i ] ); } if( renderLight.referenceSound != NULL ) { WriteInt( renderLight.referenceSound->Index() ); } else { WriteInt( 0 ); } }
/* ================ idSaveGame::WriteRenderEntity ================ */ void idSaveGame::WriteRenderEntity( const renderEntity_t &renderEntity ) { int i; WriteModel( renderEntity.hModel ); WriteInt( renderEntity.entityNum ); WriteInt( renderEntity.bodyId ); WriteBounds( renderEntity.bounds ); // callback is set by class's Restore function WriteInt( renderEntity.suppressSurfaceInViewID ); WriteInt( renderEntity.suppressShadowInViewID ); WriteInt( renderEntity.suppressShadowInLightID ); WriteInt( renderEntity.allowSurfaceInViewID ); WriteVec3( renderEntity.origin ); WriteMat3( renderEntity.axis ); WriteMaterial( renderEntity.customShader ); WriteMaterial( renderEntity.referenceShader ); WriteSkin( renderEntity.customSkin ); if( renderEntity.referenceSound != NULL ) { WriteInt( renderEntity.referenceSound->Index() ); } else { WriteInt( 0 ); } for( i = 0; i < MAX_ENTITY_SHADER_PARMS; i++ ) { WriteFloat( renderEntity.shaderParms[ i ] ); } for( i = 0; i < MAX_RENDERENTITY_GUI; i++ ) { WriteUserInterface( renderEntity.gui[ i ], renderEntity.gui[ i ] ? renderEntity.gui[ i ]->IsUniqued() : false ); } WriteFloat( renderEntity.modelDepthHack ); WriteBool( renderEntity.noSelfShadow ); WriteBool( renderEntity.noShadow ); WriteBool( renderEntity.noDynamicInteractions ); WriteBool( renderEntity.weaponDepthHack ); WriteInt( renderEntity.forceUpdate ); }
/* ================ idSaveGame::WriteRenderView ================ */ void idSaveGame::WriteRenderView( const renderView_t &view ) { int i; WriteInt( view.viewID ); WriteInt( view.x ); WriteInt( view.y ); WriteInt( view.width ); WriteInt( view.height ); WriteFloat( view.fov_x ); WriteFloat( view.fov_y ); WriteVec3( view.vieworg ); WriteMat3( view.viewaxis ); WriteBool( view.cramZNear ); WriteInt( view.time ); for( i = 0; i < MAX_GLOBAL_SHADER_PARMS; i++ ) { WriteFloat( view.shaderParms[ i ] ); } }
void ezJSONWriter::WriteVariant(const ezVariant& value) { switch (value.GetType()) { case ezVariant::Type::Invalid: //EZ_REPORT_FAILURE("Variant of Type 'Invalid' cannot be written as JSON."); WriteNULL(); return; case ezVariant::Type::Bool: WriteBool(value.Get<bool>()); return; case ezVariant::Type::Int8: WriteInt32(value.Get<ezInt8>()); return; case ezVariant::Type::UInt8: WriteUInt32(value.Get<ezUInt8>()); return; case ezVariant::Type::Int16: WriteInt32(value.Get<ezInt16>()); return; case ezVariant::Type::UInt16: WriteUInt32(value.Get<ezUInt16>()); return; case ezVariant::Type::Int32: WriteInt32(value.Get<ezInt32>()); return; case ezVariant::Type::UInt32: WriteUInt32(value.Get<ezUInt32>()); return; case ezVariant::Type::Int64: WriteInt64(value.Get<ezInt64>()); return; case ezVariant::Type::UInt64: WriteUInt64(value.Get<ezUInt64>()); return; case ezVariant::Type::Float: WriteFloat(value.Get<float>()); return; case ezVariant::Type::Double: WriteDouble(value.Get<double>()); return; case ezVariant::Type::Color: WriteColor(value.Get<ezColor>()); return; case ezVariant::Type::Vector2: WriteVec2(value.Get<ezVec2>()); return; case ezVariant::Type::Vector3: WriteVec3(value.Get<ezVec3>()); return; case ezVariant::Type::Vector4: WriteVec4(value.Get<ezVec4>()); return; case ezVariant::Type::Quaternion: WriteQuat(value.Get<ezQuat>()); return; case ezVariant::Type::Matrix3: WriteMat3(value.Get<ezMat3>()); return; case ezVariant::Type::Matrix4: WriteMat4(value.Get<ezMat4>()); return; case ezVariant::Type::String: WriteString(value.Get<ezString>().GetData()); return; case ezVariant::Type::Time: WriteTime(value.Get<ezTime>()); return; case ezVariant::Type::Uuid: WriteUuid(value.Get<ezUuid>()); return; default: break; } EZ_REPORT_FAILURE("The Variant Type %i is not supported by ezJSONWriter::WriteVariant.", value.GetType()); }
void ezJSONWriter::AddVariableMat3(const char* szName, const ezMat3& value) { BeginVariable(szName); WriteMat3(value); EndVariable(); }
void idSaveGame::WriteBox( const idBox &box ) { WriteVec3( box.GetCenter() ); WriteVec3( box.GetExtents() ); WriteMat3( box.GetAxis() ); }