/********************************************************************
*
* File: gfCRotateCutterComponent.h
*
* Purpose: Cutter to create rotate minigame tiles
*
*********************************************************************/
#ifndef gfCRotateCutterComponenthdr
#define gfCRotateCutterComponenthdr
#include "../gfISimpleCutterComponent.h"
class gfCRotateCutterComponent : public gfISimpleCutterComponent
{
friend class fsCComponentFactory;
public:
static const fsCUniqueId mTypeId;
static const fsStr mEntityPrefix;
void minigameEntitiesCreate(const fsCVariableTable& pStyle, const fsStr& pLevelName, fsCEntity* pParent,
const fsStr& pAutoMiniGameSourceArt, gfIMinigameLogic* pMingameLogic) override;
void stencilsCreate() override;
protected:
fsStr minigamePieceNameGet() const override;
void doCut(fsCEntity* pEnt, gfIStencil* pStencil, fsBool pFirstTime) override;
gfIStencil* const stencilRestore() override;
void doSetup(const fsCVariableTable& pStyle, const fsStr& pLevelName) override;
static fsIComponent* create(fsCEntity* pParent);
gfCRotateCutterComponent(fsCEntity* pParent);
virtual ~gfCRotateCutterComponent();<--- Destructor in derived class
private:
void entityCreate(fsS32 pCol, fsS32 pRow, const fsCVariableTable& pStyle);
void stencilRestore(fsS32 pCol, fsS32 pRow, fsS32 pWidth, fsS32 pHeight);
void tessellatedStencilCreate(fsS32 pCol, fsS32 pRow, fsS32 pDivisions);
fsBool tessellatedTileIndexGet(fsS32 pCol, fsS32 pRow) const;
void tessellatedEntityCreate(fsS32 pCol, fsS32 pRow, fsS32 pDivisions, const fsCVariableTable& pStyle);
void tessellatedIndicesStore(const fsCVariableTable& pStyle);
void randomTesselatedIndicesAdd();
std::shared_ptr<fsCBrush> mTessellatedStencilTexture;
std::vector<fsS32> mTessellatedIndices;
};
#endif