public void SetDrawablePmx(ICommonContents common, BackgroundWorker worker) { if (VertexLayout != null) { VertexLayout.Dispose(); } if (VertexBuffer != null) { VertexBuffer.Dispose(); } if (IndexBuffer != null) { IndexBuffer.Dispose(); } if (EffectManager != null) { EffectManager.Dispose(); } Device = common.Effect.Device; SetEffectManager(new EffectManager11(common.Effect), false); initVertexLayout(Device, common.Effect); initVertexBuffer(Device, worker); initIndexBuffer(Device, worker); m_Materials.Clear(); int indexOffset = 0; foreach (var ipxMaterial in Pmx.Material) { var tmpMaterial = new DrawableMaterial(ipxMaterial, indexOffset); tmpMaterial.SetTextures(common); m_Materials.Add(tmpMaterial); indexOffset += ipxMaterial.Faces.Count * 3; } }
public virtual void LoadContent(ICommonContents commonContents) { EffectManager = new EffectManager11(commonContents.Effect); InitCamera(); InitLight(); DrawablePmx = (DrawablePmx)commonContents.CommonDrawables[0]; }
public void SetTextures(ICommonContents common) { Textures[(int)TKind.OBJ] = common.GetTexture(OriginMaterial.Tex); Textures[(int)TKind.TOON] = common.GetTexture(OriginMaterial.Toon); Textures[(int)TKind.SPHERE] = common.GetTexture( (OriginMaterial.SphereMode == SphereType.Add && OriginMaterial.Sphere == MyCommonContents.WhiteTexPath) ? MyCommonContents.BlackTexPath : OriginMaterial.Sphere); }
public void SetCommonContents(ICommonContents commonContents, IPERunArgs args) { m_CommonContents = commonContents; m_CommonContents.SetRunArgsAndPmx(args); }
public override void LoadContent(ICommonContents commonContents) { base.LoadContent(commonContents); sprite = new DrawableSprite(commonContents.Pmx); sprite.SetDrawablePmx(commonContents, null); }