#pragma once

#include "SprScr.h"

// CSprView

class CSprView : public CScrollView
{
		DECLARE_DYNAMIC(CSprView)

		BYTE *m_pBuffer;
		size_t m_nBufSize;
		CSprScr *m_pScreen;
		int m_cx, m_cy; //ðàçìåðû viewportà
		int m_scale;

	public:
		CSprView(BYTE *buffer, size_t size);
		virtual ~CSprView();
		void SetScale(int scale);

		inline void SetPalette(int palette)
		{
			m_pScreen->SetPalette(palette);
		}

		inline const int GetPalette()
		{
			return m_pScreen->GetPalette();
		}

		inline void SetAdaptMode(BOOL bFlag)
		{
			m_pScreen->SetAdaptMode(bFlag);
		}

		inline const BOOL IsAdaptMode()
		{
			return m_pScreen->IsAdaptMode();
		}

		inline void SetColorMode(BOOL bColorMode = TRUE)
		{
			m_pScreen->SetColorMode(bColorMode);
		}

		inline const BOOL IsColorMode()
		{
			return m_pScreen->IsColorMode();
		}

	protected:
		virtual void OnDraw(CDC *pDC);
		virtual BOOL PreCreateWindow(CREATESTRUCT &cs);
		afx_msg void OnSize(UINT nType, int cx, int cy);
		afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
		afx_msg void OnDestroy();
		DECLARE_MESSAGE_MAP()
};
