#ifndef _PAINTTEXTURECOMMAND_H #define _PAINTTEXTURECOMMAND_H #include #include "res/res.h" #include "Command.h" #include "Array2D.h" struct TextureSet { Handle m_Texture; int m_Priority; }; class CTextureEntry; class CPaintTextureCommand : public CCommand { public: // constructor, destructor CPaintTextureCommand(CTextureEntry* tex,int brushSize,int selectionCentre[2]); ~CPaintTextureCommand(); // return the texture name of this command const char* GetName() const { return "Apply Texture"; } // execute this command void Execute(); // can undo command? bool IsUndoable() const { return true; } // undo void Undo(); // redo void Redo(); private: bool IsValidDataIndex(const CArray2D& array,int x,int y) { if (x<0 || y<0) return 0; int ix=x-m_SelectionOrigin[0]; int iy=y-m_SelectionOrigin[1]; return ix>=0 && ix=0 && iy& data); // texture being painted CTextureEntry* m_Texture; // size of brush int m_BrushSize; // centre of brush int m_SelectionCentre[2]; // origin of data set int m_SelectionOrigin[2]; // input data (textures applied to the selection) CArray2D m_DataIn; // output data (new textures applied to the selection after painting) CArray2D m_DataOut; }; #endif