/*
* EmitterInfoReader.cs
* Authors: Brian Murphy
* Copyright (c) 2007-2008 Cornell University
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Graphics;
namespace TACParticleEngine.FileProcessing
{
///
/// Custom content reader for EmitterInfo
///
class EmitterInfoReader : ContentTypeReader
{
protected override EmitterInfo Read(ContentReader input, EmitterInfo existingInstance)
{
EmitterInfo ret = new EmitterInfo();
ret.TextureName = input.ReadString();
ret.BlendEffect = input.ReadObject();
ret.Positions = input.ReadObject>();
ret.MinVel = input.ReadVector3();
ret.MaxVel = input.ReadVector3();
ret.EmitLifetime = input.ReadSingle();
ret.ParticlePersSec = input.ReadInt32();
ret.ParticleAmount = input.ReadInt16();
ret.ParticleLifetime = input.ReadSingle();
ret.MinStartSpeed = input.ReadSingle();
ret.MaxStartSpeed = input.ReadSingle();
ret.MinEndSpeed = input.ReadSingle();
ret.MaxEndSpeed = input.ReadSingle();
ret.MinStartSize = input.ReadVector2();
ret.MaxStartSize = input.ReadVector2();
ret.MinEndSize = input.ReadVector2();
ret.MaxEndSize = input.ReadVector2();
ret.MinStartColor = input.ReadVector4();
ret.MaxStartColor = input.ReadVector4();
ret.MinEndColor = input.ReadVector4();
ret.MaxEndColor = input.ReadVector4();
return ret;
}
}
}