#if !defined(AFX_OVERVIEWWINDOW1_H__E61E44A5_CD65_11D2_8457_00105A17BC83__INCLUDED_)
#define AFX_OVERVIEWWINDOW1_H__E61E44A5_CD65_11D2_8457_00105A17BC83__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// OverviewWindow1.h : header file
//

#include "EditorChildWnd.h"
#include <Adept\AdeptHeaders.hpp>
#include <ImageLib\Image.h>


/////////////////////////////////////////////////////////////////////////////
// COverviewWindow frame

class COverviewWindow : public CEditorChildWnd
{
	DECLARE_DYNCREATE(COverviewWindow)
protected:

	CPoint	cameraClientCoords;
	Image	MapImage,HField,SlopeMap;
	CBitmap BackBuffer;

  //	float	cameraRotation;				// in radians
	Stuff::YawPitchRoll cameraRotation;
  float	xScale;
	float	yScale;

// Attributes
public:
	enum ViewMode {VM_TEXTURE,VM_HFIELD,VM_SLOPEMAP};
	
	bool ImgReady,BBufReady;
	int		mapWidth;
	int		mapHeight;
	ViewMode CurrentVMode;
// Operations
public:
	COverviewWindow();           // protected constructor used by dynamic creation
	virtual ~COverviewWindow();

	int LoadImageFromMissionInstance(const char* game_name);
	void InvalidateCamera();

	void BuildBackBuffer();
	void SetCameraPos();
	void SetCameraPos(CPoint point);
	void SetCameraRot();
	void SetCameraRot(CPoint point);
	void UpdateCamera();
	void DrawWindow();
	CPoint Flip(CPoint pnt);
	CRect  Flip(CRect  rct);
	void PaintCircle(CDC* pDC, CPoint point, int extent, COLORREF clr, bool fill = false);
	void PaintSquare(CDC* pDC, CPoint point, int extent, COLORREF clr);
	void PaintTriangle(CDC* pDC, CPoint point, int extent, COLORREF clr, bool fill = false);
	void PaintX(CDC* pDC, CPoint point, COLORREF clr);
	void PaintPlus(CDC* pDC, CPoint point, COLORREF clr);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(COverviewWindow)
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(COverviewWindow)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnPaint();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

	void PaintCameraPos(CDC* pDC);

};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_OVERVIEWWINDOW1_H__E61E44A5_CD65_11D2_8457_00105A17BC83__INCLUDED_)
