Ejemplo n.º 1
0
	virtual LWError	Load (const lwpp::LoadState &ls)
	{
		LWError err = 0;
		while(LWID id = ls.Find(idcomp))
		{
			switch( id )
			{
				case IO_MODE: Mode = (BlendingMode)ls.readInt(); break;

				case IO_OPAC: ls.read(*Opacity); break;

				default: break;
			}
			ls.End();
		}
		return err;
	}
Ejemplo n.º 2
0
LWError	MaterialMixer::Load (const lwpp::LoadState &ls)
{
	LWError err = 0;
	while(LWID id = ls.Find(idroot))
	{
		switch( id )
		{
			case IO_CDIF: ls.read(Diffuse); break;

	    case IO_CSPC: ls.read(Specular); break;

	    case IO_CRFL: ls.read(Reflection); break;

	    case IO_CRFR: ls.read(Refraction); break;

			case IO_CTRN: ls.read(Transparency); break;

			default: break;
		}
		ls.End();
	}
	return err;
}
Ejemplo n.º 3
0
/* ======================================================================
LoadSettings()
====================================================================== */
LWError hotdm::LoadSettings(const lwpp::LoadState &ls, bool is_preset)
{
LWError err = NULL;

	//! Settings to read:
	while(LWID id = ls.Find(idroot)) 
	{
		switch( id ) 
		{
			case IO_RESO: 
				resolution = ls.readInt();
				break;

			case IO_GLSC: 
				globalScale->Load(ls);
				break;

			case IO_WAVH: 
				waveHeight->Load(ls);
				break;

			case IO_SWAV: 
				shortestWave->Load(ls);
				break;

			case IO_DCHP: 
				doChop = ls.readBool();
				break;

			case IO_CHOP: 
				choppiness->Load(ls);
				break;

			case IO_WSPD: 
				windSpeed->Load(ls);
				break;

			case IO_WDIR: 
				windDirection->Load(ls);
				break;

			case IO_WALG: 
				windAlign->Load(ls);
				break;

			case IO_DREF: 
				dampReflections->Load(ls);
				break;

			case IO_ODEP: 
				oceanDepth->Load(ls);
				break;

			case IO_SEED: 
				seed = ls.readInt();
				break;

			case IO_INTP: 
				interpolation = ls.readBool();
				break;
			
			/* This DOESNT work for displacement plugins, But left the code to see how other controls can be done */
			/*case IO_NORM: 
				normals = ls.readBool();
				break;

			case IO_JACB: 
				jacobian = ls.readBool();
				break;*/

			// This avoid a LW error, that will overwrite the values of the plugin if there
			// is more than ONE instance of the plugin applied to the object.
			case IO_STOP: return err;

			default:
			break;
		}

	ls.End();
	}

	return err;
}