1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/********************************************************************
**
*	File:		gfCJigsawStencil.h
*
*	Purpose:	Stencil class for cutting out jigsaw pieces
*
*				Base tile cut out then tongues / grooves added
*
*				  (T)
*			***************
*			*	  (G)	  *
*			*	     	  *
*		 (T)*(G)	   (G)*(T)
*			*			  *
*			*	  (G)	  *
*			***************
*				  (T)
*
*********************************************************************/

#ifndef gfCJigsawStencilhdr
#define gfCJigsawStencilhdr

#include "../gfIStencil.h"

class gfCJigsawStencilTextures;

class gfCJigsawStencil : public gfIStencil
{
public:

	enum eEDGE
	{
		eSTRAIGHT,
		eTONGUE,
		eGROOVE
	};

	static eEDGE complimentGet(eEDGE pEdge);

	gfCJigsawStencil(gfCJigsawStencilTextures* pStencilTex, fsS32 pWidth, fsS32 pHeight,
	                 eEDGE pTop, eEDGE pRight, eEDGE pBottom, eEDGE pLeft, fsS32 pRow, fsS32 pCol);

	gfCJigsawStencil(gfCJigsawStencilTextures* pStencilTex, fsCEntity* pParent);
	~gfCJigsawStencil();<--- Destructor in derived class


protected:

	void generate() override;

	void doSave(fsCEntity* pParent) override;
	void doLoad(fsCEntity* pParent) override;

private:


	void basicTileCut();

	void modifyDimensionsAndPosBasedOnEdges();

	eEDGE mTop;
	eEDGE mRight;
	eEDGE mBottom;
	eEDGE mLeft;

	gfCJigsawStencilTextures* mStencilTextures;
};

#endif