#pragma once
#include "War3TypesAndConstants.h"
#include "War3StrID.h"
#include "W3ZMapEditSettings.h"
#include <windows.h>
#include <string>
using namespace std;

typedef string CString;
typedef RECT CRect;
typedef POINT CPoint;

class CTilePoint;
class CDoodad;
class CUnit;

class CW3ZMapEditView// : public CScrollView
{
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CW3ZMapEditView)
public:
	virtual void OnDraw(HWND hWnd);  // overridden to draw this view
	//virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();
	//}}AFX_VIRTUAL

// Implementation
public:
	//BOOL IsModeActive(int mode, int x, int y);
	//void DisplayUnit(CUnit unit);
	//CPoint GetScrollPoint(CPoint point);
	//void ChangeBitmapsSize();
	//void RemoveDoodad(CDoodad doodad);
	//void UpdateTilesColors();
	//void InvalidatePlayersBitmap(CRect rect);
	//void InvalidateUnitsBitmap(CRect rect);
	//void InvalidatePathBitmap(CRect rect);
	//void InvalidateShadowsBitmap(CRect rect);
	void InvalidateTilesBitmap(CRect rect);
	int m_nbActiveFilters;
	//void AddPlayersFilter(CRect rect);
	//void AddUnitsFilter(CRect rect);
	//void AddShadowsFilter(CRect rect);
	//void AddPathFilter(CRect rect);
	void InvalidateDoodadsBitmap(CRect rect);
	//double GetZoom();
	//void SetZoom(double zoom);
	void AddDoodadsFilter(CRect rect);
	void AddTilesFilter(CRect rect);
	//void InvalidateBitmapRect(CRect rect);
	void DisplayDoodad(CDoodad doodad);
	int m_iViewMode;
	int m_iViewFlags;
	void DisplayTilePoint(int x, int y, CTilePoint tilepoint);
	void InvalidateBitmap();
	CW3ZMapEditView();
	virtual ~CW3ZMapEditView();
	// tileset bitmap
	unsigned char m_color;
	unsigned char m_backcolor;
	unsigned char * m_pMainBitmap;
	unsigned char * m_pTilesBitmap;
	unsigned char * m_pDoodadsBitmap;
	unsigned char * m_pUnitsBitmap;
	unsigned char * m_pShadowsBitmap;
	unsigned char * m_pPathBitmap;
	unsigned char * m_pImage;
	RGBQUAD * m_pPalette;
	BITMAPV4HEADER * m_pBitmapInfo;
	CIEXYZTRIPLE m_pCiexyzTriple;
	COLORREF GetTileColor(int type);

// Generated message map functions
protected:
	COLORREF m_TilesColors[W3E_MAX_GROUNDTILES];
	float m_afWaterColor[4];
	COLORREF m_tRamp;
	COLORREF m_tBlight;
	COLORREF m_tBoundary;
	float m_fRampAlpha;
	float m_fBlightAlpha;
	float m_fBoundaryAlpha;
	float m_fLevelFactor;
	CW3ZMapEditSettings * m_pAppSettings;
	bool m_MRBtnDown;
	bool m_MLBtnDown;
	double m_dZoom;
};