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

		 ******	MisteryEngine Լ ޴ 1.0  ******

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


			***    ̵ ***

//*****  κ *******

ENGINE			eng;

ZeroMemory(&eng, sizeof(eng));

eng.DirectXUse.m_bChangeDisplay		= true;
eng.DirectXUse.m_bDirectDrawUse		= false;
eng.DirectXUse.m_bDirectSoundUse	= true;
eng.DirectXUse.m_bFullScreen		= false;
eng.DirectXUse.m_bKeyBoardUse		= false;
eng.DirectXUse.m_bMouseUse			= false;
eng.DirectXUse.m_byDDMemoryFlags	= DDMF_SYSTEM;
eng.m_byMaxSoundBuf			= 30;
eng.m_iWidth				= 640;
eng.m_iHeight				= 480;
eng.m_iMaxBackSurfaceCount	= 5;
eng.m_iMaxSprite			= 10;
eng.m_byColorBits			= 16;
eng.m_dwColorKey			= 0;

m_pME_Eng = new CMisteryEngine();

if(m_pME_Eng->ME_CreateEngine(&eng)) {
	// ó
}


//***** κ *******

//ؿ ڵκ  ƽð ̷ƮX
// ϰ  ƮĿ 
//ָ ˴ϴ. ׸ ̷Ʈ ο츦 
//Ⱦ Ʈ ̳ ǥҶ
//ڵ   ŵ ˴ϴ.
//(ο ڵ ó)


ENGINE		eng;//    ó

ZeroMemory(&eng, sizeof(eng));//Ʈ ͸ ʱȭ

eng.DirectXUse.m_bChangeDisplay		= true;
/* ÷Ʈ ũž ÷ ÷Ʈ ٸ
	eng.m_byColorBits   ÷Ʈ ÷Ʈ ٲ۴*/

eng.DirectXUse.m_bDirectDrawUse		= false;
//̷Ʈ Ұΰ

eng.DirectXUse.m_bDirectSoundUse	= true;
//̷Ʈ带 Ұΰ

eng.DirectXUse.m_bFullScreen		= false;
//üȭΰ

eng.DirectXUse.m_bKeyBoardUse		= false;
//()

eng.DirectXUse.m_bMouseUse			= false;
//()

eng.DirectXUse.m_byDDMemoryFlags	= DDMF_SYSTEM;
/*DDMF_LOCAL, DDMF_NONLOCAL, DDMF_VIDEO, DDMF_SYSTEM
	̷Ʈο ǥ ޸ ġ, DEFAULT ý۸޸*/

eng.m_byMaxSoundBuf			= 30;
//尡 ÿ µ ִ밹 Ѵ

eng.m_iWidth				= 640;
// ũ,  üȭ϶ 640, 800, 1024, 1152...θ ؾ

eng.m_iHeight				= 480;
// ũ,  üȭ϶ 480, 600, 768, 864...θ ؾ

eng.m_iMaxBackSurfaceCount	= 5;
//鼭ǽ ִ밹 1 - 65535

eng.m_iMaxSprite			= 10;
//Ʈ ִ밹 1 - 65535

eng.m_byColorBits			= 16;
// ÷Ʈ	16Ʈ ȭ Ǿ, 8Ʈϳ 24Ʈ ̻ 

eng.m_dwColorKey			= 0;
//ӿ  ÷Ű

m_pME_Eng = new CMisteryEngine();
// ,  CMisteryEngineŬ͸  μ

if(m_pME_Eng->ME_CreateEngine(&eng)) {// 
	// ó
}






			***	MisteryEngine Լ ̵  ***


**Լ տ ME MisteryEngine ̴ϼԴϴ.


** ME_CreateEngine **

bool	ME_CreateEngine(LPENGINE lpEngineSetting = NULL, HWND hWnd = NULL);

 ---  

ϰ --- ϸ true, ƴϸ false

Ķ--- 1 ĶͰ NULLϰ ⺻ , 2 Ķʹ 
			ڵμ ־ٰ  (ڵ)ó  



** ME_SetUpdateFrame **

void	ME_SetUpdateFrame(bool bUpdate = true);

 --- ȭ Ʈ ÷ ()



** ME_IsCreateEngine **

bool	ME_IsCreateEngine();

 ---  Ǿ ִ°

ϰ ---  true,  false



** ME_LoadBmp **

LRESULT		ME_LoadBmp(LPSTR lpFileName, bool bDirectDrawUse = false, bool bConvertColorBit = false, BYTE byConvertColorBit = 16, LPIMAGEDATA lpImageData = NULL);

 --- Ʈ ε

ϰ --- Ұ BMP_OK  , Ұ  ϳ 
		 	BMP_MEMORYOUT, BMP_FILEERROR ( ų  .)
				BMP_DATAERROR (BitmapFile  ߸Ǿ ִ.)

Ķ --- lpFileName(̸ ex> "C:\\My Document\\Images\\picture.bmp")
				bDirectDrawUse(̷Ʈ ο ϰ ִ )
				bConvertColorBit(ĮƮ Ʈ Ұΰ)
				byConvertColorBit(Ʈ Ʈ Ұΰ)
				lpImageData(ϵ ̹ Ʈ )



** ME_LoadJpg **

LRESULT		ME_LoadJpg(LPSTR lpFileName, bool bDirectDrawUse = false, bool bConvertColorBit = false, BYTE byConvertColorBit = 16, LPIMAGEDATA lpImageData = NULL);

 --- JPG ε

ϰ --- ϸ JPG_OK  , Ұ  ϳ 
			JPG_MEMORYOUT 0
			JPG_FILEERROR -1	 ų  .
			JPG_DATAERROR -2	File  ߸Ǿ ִ.

Ķ --- lpFileName(̸ ex> "C:\\My Document\\Images\\picture.jpg")
				bDirectDrawUse(̷Ʈ ο ϰ ִ )
				bConvertColorBit(ĮƮ Ʈ Ұΰ)
				byConvertColorBit(Ʈ Ʈ Ұΰ)
				lpImageData(ϵ ̹ Ʈ )



** ME_GetLoadedImageData **

LPIMAGEDATA		ME_GetLoadedImageData();

 ---  ֱ ε ̹ϵ 

ϰ --- Ʈ 

	typedef struct _IMAGEDATA {
		HANDLE				szData;			//޸ ڵ
		LPBITMAPINFO		lpbmpInfo;		//Ʈ
		LPBITMAPINFOHEADER	lpbmpheader;	//Ʈ
		LPRGBQUAD			m_pRGBTable;	//RGB̺
		LPBYTE				m_lpData;		//̹ 
		LPBYTE				m_lpOrgData;	//
		int					m_iW;			//
		int					m_iH;			//
		DWORD				m_dwSize;		//̹ 
	} IMAGEDATA, *LPIMAGEDATA;



** ME_CreateSurface **

LRESULT		ME_CreateSurface(int w, int h, int iCnt, DWORD dwColorKey = 0);

 --- 鼭ǽ 

ϰ --- Ұ SURFACE_OK  , Ұ  ϳ 
			SURFACE_MEMORYOUT	0	//޸ 
			SURFACE_COUNTOUT	-1	//Ҷ ƮĿ  īƮ											 
			SURFACE_FAILED		-2	//

Ķ --- w(), h(), iCnt( 鼭ǽ ȣ), dwColorKey()



** ME_AddBackSurface **

LRESULT		ME_AddBackSurface(int w, int h, DWORD dwColorKey = 0);

 --- 鼭ǽ ߰

ϰ --- Ұ SURFACE_OK  , Ұ  ϳ 
			SURFACE_MEMORYOUT	0	//޸ 
			SURFACE_COUNTOUT	-1	//Ҷ ƮĿ  īƮ											 
			SURFACE_FAILED		-2	//

Ķ --- w(), h(), iCnt( 鼭ǽ ȣ), dwColorKey()



** ME_GetCurrentBackSurface **

int		ME_GetCurrentBackSurface();

 ---  鼭ǽ 

ϰ --- 



** ME_GetFirstSurfaceNULL **

WORD	ME_GetFirstSurfaceNULL();

 --- ù° ִ 鼭ǽȣ 

ϰ --- ù° ִ 鼭ǽȣ 



** ME_IsBackSurface **

bool	ME_IsBackSurface(int iSur);

 --- 鼭ǽ ִ°

ϰ ---  true



** ME_SetBackSurfaceSize **

LRESULT		ME_SetBackSurfaceSize(int w, int h, int iSur, DWORD dwColorKey = 0);

 --- 鼭ǽ  

ϰ --- Ұ SURFACE_OK  , Ұ  ϳ 
			SURFACE_MEMORYOUT	0	//޸ 
			SURFACE_COUNTOUT	-1	//Ҷ ƮĿ  īƮ											 
			SURFACE_FAILED		-2	//



** ME_DeleteSurface **

void	ME_DeleteSurface(int iSur);

 --- 鼭ǽ 

Ķ ---   ȣ



** ME_DeleteCurrentSurface **

void	ME_DeleteCurrentSurface();

 ---  ߿ ߰ 鼭ǽ 



** ME_DeleteAllSurface **

void	ME_DeleteAllSurface();// 鼭ǽ 



** ME_GetBackSurfaceSize ** 	NEW!

POINT	ME_GetBackSurfaceSize(int iSur);

 --- 鼭ǽ  

Ķ --- iSur(鼭ǽ ȣ)



** ME_GetSurfacePitch **	NEW!

long	ME_GetSurfacePitch(int iSur);

 --- 鼭ǽ ġ 

Ķ --- iSur(鼭ǽ ȣ)



** ME_AddSprite **

LRESULT		ME_AddSprite(int w, int h, LPBYTE lpData, int *piSpr = NULL, bool bAddCnt = true);

 --- Ʈ ߰

Ķ --- w, h(, ), lpData(̹  ), pISpr(NULL̸ 			 ȣ ű), bAddCnt(Ʈ  īƮ )



** ME_DeleteSprite **

void	ME_DeleteSprite(int iSpr, bool bAddCnt = true);

 --- Ʈ 

Ķ --- iSpr(ȣ), bAddCnt(Ʈ  īƮ ҿ)



** ME_DeleteAllSprite **

void	ME_DeleteAllSprite();

 ---  Ʈ 



** ME_GetSpritePitch **	NEW!

long	ME_GetSpritePitch(int iImg);

 --- Ʈ ġ 

Ķ --- Ʈ ȣ



** ME_GetSpriteBuffer **	NEW!

LPBYTE	ME_GetSpriteBuffer(int iSpr);

 --- Ʈ  

Ķ --- Ʈ ȣ



** ME_GetSpriteRectBuffer **	NEW!

void	ME_GetSpriteRectBuffer(LPBYTE lpDest, RECT rect, int iSpr);

 --- 簢 ŭ ۸ 

Ķ --- lpDest(޸𸮰 Ҵ ̹ ), rect( ),
			iSpr(Ʈ ȣ)



** ME_GetSpriteSize **	NEW!

POINT	ME_GetSpriteSize(int iSpr);

 --- Ʈ 

Ķ --- Ʈ ȣ

ϰ --- 



** ME_GetCurrentSprite **	NEW!

int		ME_GetCurrentSprite();

 ---  ߰ Ʈ  

ϰ ---  ߰ Ʈ 



** ME_GetSpriteCount **	NEW!

int		ME_GetSpriteCount();

 --- Ʈ Ѱ

ϰ --- Ʈ Ѱ



** ME_GetSpriteBufSize **	NEW!

int		ME_GetSpriteBufSize(int iSpr);

 --- Ʈ ̹ 

Ķ --- Ʈ ȣ

ϰ --- ̹ 



** ME_SetSpriteBuffer **	NEW!

void	ME_SetSpriteBuffer(int iSpr, LPBYTE lpBuf)

 --- Ʈ ۹ٲ(̹ ũⰡ ƾ )

Ķ --- iSpr(Ʈ ȣ), lpBuf(Ѱ ̹ )



** ME_SetChangeSprite **	NEW!

void	ME_SetChangeSprite(int iSpr1, int iSpr2)

 --- Ʈ͸   ٲ

Ķ --- iSpr1, iSpr2  ٲ Ʈ ȣ



** ME_EngGethWnd **

HWND	ME_EngGethWnd() { if(this) return m_pEng->EngGethWnd();	else return NULL; };

 ---  Ҷ   ڵ Ѵ.

ϰ ---  ڵ



** ME_ClearSurface **

void	ME_ClearSurface(int iImg = 0);

 --- 鼭ǽ 0 ʱȭ()

Ķ --- 鼭ǽ ȣ



** ME_FillSprite **

void	ME_FillSprite(DWORD dwColor, int iImg = 0);

 --- Ʈ  ä

Ķ --- dwColor(Į), iImg(鼭ǽ ȣ)



** ME_EffectBlt **

void	ME_EffectBlt(POINT pos, int iImg[2], BYTE byLevel, BYTE byEffectFlag = 0);

 --- Ʈ 

Ķ --- pos(ġ), iImg(iImg[0] -> 鼭ǽ ȣ, 
							 iImg[1] -> Ʈ ȣ) 
			, byLevel(ȿܰ 0 - 31, 32ܰ)
			, byEffectFlag = EBF_ALPHA, EBF_FADE



** ME_EffectBltZoomIn **

void	ME_EffectBltZoomIn(POINT pos, int iImg[2], BYTE byLevel, float fZoom, BYTE byEffectFlag = 0);

 ---   



** ME_CopySurface **

void	ME_CopySurface(int iDest, int iSrc);

 --- 鼭ǽ 

Ķ --- iDest( 鼭ǽ ȣ), iSrc(ȣ)



** ME_BltZoomIn **

bool	ME_BltZoomIn(POINT pos, LPRECT lpBltRect, float fZoom, int iSpr, int iSurface = 0);

 --- Ȯ

ϰ --- ϸ true 

Ķ --- pos(׸ġ), lpBltRect(׸  ̹ 簢 , NULL			ϰ ڵ ü̹ )
			, fZoom(ҼԷ , 1 ū Ҽ), iSpr(׸ Ʈȣ			), iSurface(׷ 鼭ǽ)



** ME_CopySurfaceToSprite **

bool	ME_CopySurfaceToSprite(int iSpr, int iSurface = 0);

 --- 鼭ǽ Ʈ ۷ 

ϰ --- ϸ true 

Ķ --- iSpr(Ʈ ȣ), iSurface(鼭ǽ ȣ)



** ME_BltZoomOut **

bool	ME_BltZoomOut(POINT pos, BYTE byZoom, int iSpr, int iSurface = 0);

 ---  ׸

ϰ --- ϸ true 

Ķ --- pos(ġ), byZoom(1 ū ), iSpr(Ʈ ȣ)
			, iSurface(׷ 鼭ǽ ȣ)



** ME_BltZoomOutSurface **

bool	ME_BltZoomOutSurface(POINT pos, BYTE byZoom, int iSrcSurface, int iDestSurface = 0);

 --- 鼭ǽ 

ϰ --- ϸ true 

Ķ --- pos(ġ), byZoom(1 ū ), iSrcSurface( 鼭ǽ ȣ			), iDestSurface(׷  鼭ǽ ȣ)



** ME_Blt **

void	ME_Blt(POINT pos, int iSpr, int iSurface = 0);

 --- ׸

Ķ --- pos(ġ), iSpr(Ʈ ȣ), iSurface(׷ 鼭ǽ ȣ)



** ME_Blt_UnCheckColorKey **

void	ME_Blt_UnCheckColorKey(POINT pos, int iSpr, int iSurface = 0);

 --- ÷Ű  ׸

Ķ --- pos(ġ), iSpr(Ʈ ȣ), iSurface(׷ 鼭ǽ ȣ)



** ME_DDBlt, ME_DDBltFast(̷Ʈ ο츦  ׸ Լ) **

void	ME_DDBlt(POINT pos, int iSpr);

 --- 



** ME_DDBltFast **

void	ME_DDBltFast(POINT pos, int iSpr);

 --- 



** ME_Flip ** 

void	ME_Flip(int x = 0, int y = 0, int iSurface = 0);

 --- 鼭ǽ  ȭ鿡 ǥ

Ķ --- x, y(ġ), iSurface(Ǯ ǥ)



** ME_Flip **

void	ME_Flip(HDC hDC, int x = 0, int y = 0, int iSurface = 0);

 --- 鼭ǽ  ȭ鿡 ǥ

Ķ --- hDC(DC ڵ), x, y(ġ), iSurface(Ǯ ǥ)

