class SShieldPatch
{
public:

	DSpace* DS;
	SShield* Shield;
	SShieldPatch *Prev, *Next;

	float Flash;
	D3DXMATRIX XF;
	DTexture *Tex1, *Tex2;
	D3DXCOLOR Color;
	int Frame0;
	float Dur, Time, AniTime;

	static SShieldPatch* Create(SShield* S, int layer, float flash = 0.0f, const D3DXVECTOR3* rot = NULL);
	void Release();

	bool Init(SShield* S, int layer, float flash, const D3DXVECTOR3* rot);
	void Destroy() { ZERO(*this); }

	void Move(float dt);
	void Render();
};

CLASS_HEAP(SShieldPatchHeap, SShieldPatch, Next);
CLASS_BDLIST(SShieldPatchList, SShieldPatch, Prev, Next);

SShieldPatch* SShieldPatch::Create(SShield* S, int layer, float flash, const D3DXVECTOR3* rot)
{
	SShieldPatch* P = S->PatchHeap->Alloc();
	if (!P->Init(S, layer, flash, rot))
	{
		if (P->Shield) S->Patches->Remove(P);
		S->PatchHeap->Free(P);
		return NULL;
	}
	return P;
}
