Ejemplo n.º 1
0
void cPlayer::LoadImages(cD2DRenderer& renderer, HWND hWnd)
{
	Adol = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/Player/Adol.png");
	PlayerHpBar = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/Player/HpBar.png");
	PlayerEffect = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/Player/PlayerEffect.png");
	::InvalidateRect(hWnd, NULL, TRUE);
}
Ejemplo n.º 2
0
void cMonster::LoadImages(cD2DRenderer& renderer, HWND hWnd)
{
	Monster = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/Monster/Monster.png");
	MonsterHpBar = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/Monster/HpBar.png");
	EmptyHpBar = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/Monster/EmptyHpBar.png");
	MonsterEffect = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/Monster/MonsterEffect.png");
}
Ejemplo n.º 3
0
void cPlayer::PlayerHpRender(cD2DRenderer& renderer)
{

	WCHAR str[128];
	wsprintf(str, L"0,1,2,3 = %d, %d, %d, %d", CrushOn, State[0], State[1],NPCState[0]);
	UINT32 cTextLength_c = (UINT32)wcslen(str);

	D2D1_RECT_F layoutRectc = D2D1::RectF(830, 150, 1130, 250);

	renderer.GetRenderTarget()->DrawTextW(
		str,
		cTextLength_c,
		renderer.GetTextFormat(),
		layoutRectc,
		renderer.GetBrush());


	if (PlayerHpBar != nullptr);
	{
		::D2D1_RECT_F dxArea = ::D2D1::RectF(
			239,
			507,
			239 + (3.73*PlayerHp),
			523);
		::D2D1_RECT_F srcArea = ::D2D1::RectF(0, 0, 135, 12);
		renderer.GetRenderTarget()->DrawBitmap(PlayerHpBar, dxArea, 1.0f,
			D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
			srcArea);
	}
}
Ejemplo n.º 4
0
void cChatting::Render(cD2DRenderer& renderer)
{
	for (int i = 0; i < m_vecChatList.size(); ++i)
	{

		if (m_vecChatList.size() > 0)
		{
			UINT32 cTextLength_c = (UINT32)wcslen(m_vecChatList[i].c_str());

			D2D1_RECT_F layoutRect = D2D1::RectF(
				100,
				50 + i * 20, 
				700,
				300 + i * 20
				);

			renderer.GetRenderTarget()->DrawTextW(
				m_vecChatList[i].c_str(),
				cTextLength_c,
				renderer.GetTextFormat(),
				layoutRect,
				renderer.GetBrush());
		}

	}

}
Ejemplo n.º 5
0
void cMonster::MonsterHpRender(cD2DRenderer& renderer)
{
	if (SightX && SightY)
	{
		if (MonsterHp > 0)
		{
			if (Dis < 200)
			{
				if (MonsterHpBar != nullptr);
				{
					D2D1_SIZE_U size = renderer.GetRenderTargetSize();
					::D2D1_RECT_F dxArea = ::D2D1::RectF(
						239,
						537,
						239 + (3.73*MonsterHp),
						553);
					::D2D1_RECT_F srcArea = ::D2D1::RectF(0, 0, 135, 12);
					renderer.GetRenderTarget()->DrawBitmap(MonsterHpBar, dxArea, 1.0f,
						D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
						srcArea);
				}
			}
		}
	}
}
Ejemplo n.º 6
0
void cInterFace::Render(cD2DRenderer& renderer)
{
	if (Edge != nullptr);
	{
		D2D1_SIZE_U size = renderer.GetRenderTargetSize();
		::D2D1_RECT_F dxArea = ::D2D1::RectF(0, 0, 800, 600);
		::D2D1_RECT_F srcArea = ::D2D1::RectF(0, 0, 800, 600);
		renderer.GetRenderTarget()->DrawBitmap(Edge, dxArea, 1.0f,
			D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
			srcArea);
	}
}
Ejemplo n.º 7
0
void cChatting::ChatBoardRender(cD2DRenderer& renderer)
{
	if (ChatBoard != nullptr);
	{
		D2D1_SIZE_U size = renderer.GetRenderTargetSize();
		::D2D1_RECT_F dxArea = ::D2D1::RectF(0, 0, Resolution.x, Resolution.y);
		::D2D1_RECT_F srcArea = ::D2D1::RectF(0, 0, 800.0f, 600.0f);
		renderer.GetRenderTarget()->DrawBitmap(ChatBoard, dxArea, 1.0f,
			D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
			srcArea);
	}
}
Ejemplo n.º 8
0
void cInterFace::LoadImages(cD2DRenderer& renderer, HWND hWnd)
{
	Edge = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/InterFace/Edge.png");
	MenuBarMain = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/InterFace/MenuBar.png");
	MenuBar_Load = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/InterFace/MenuBar_LoadOn.png");
	MenuBar_Save = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/InterFace/MenuBar_SaveOn.png");
	MenuBar_Equip = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/InterFace/MenuBar_EquipOn.png");
	MenuBar_Inven = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/InterFace/MenuBar_InvenOn.png");
	MenuBar_Status = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/InterFace/MenuBar_StatusOn.png");
	MenuBar_Option = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/InterFace/MenuBar_OptionOn.png");
	//MenuBar_Option = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/InterFace/EmptyHpBar.png");
	::InvalidateRect(hWnd, NULL, TRUE);
}
Ejemplo n.º 9
0
//
//   함수: InitInstance(HINSTANCE, int)
//
//   목적: 인스턴스 핸들을 저장하고 주 창을 만듭니다.
//
//   설명:
//
//        이 함수를 통해 인스턴스 핸들을 전역 변수에 저장하고
//        주 프로그램 창을 만든 다음 표시합니다.
//
BOOL cGameApplication::InitInstance(HINSTANCE hInstance, int nCmdShow)
{
	HWND hWnd;	

	_hInst = hInstance; // 인스턴스 핸들을 멤버 변수에 저장합니다.

	// Window Size내의 Client를 정확하게 원하는 사이즈로 만든다.
	//::AdjustWindowRect(&_wndRect, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, NULL);

	::AdjustWindowRect(&_wndRect, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU, NULL);
	hWnd = CreateWindow(_szWindowClass, _szTitle,
		WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU,
		//| WS_THICKFRAME,
		CW_USEDEFAULT, 0, 
		_wndRect.right - _wndRect.left, 
		_wndRect.bottom - _wndRect.top, 
		/*1028,
		_wndRect.bottom - _wndRect.top,*/
		NULL, NULL, hInstance, NULL);


	if (!hWnd)
	{
		return FALSE;
	}

	_hwnd = hWnd;
	_hw = hWnd;
	GetClientRect(_hwnd, &_wndRect);

	d2dRender.InitializeD2D();
	d2dRender.Setup(hWnd);

	m_pResourceMng = new cResourceManager;
	m_pSoundMng = new cSoundManager;
	m_pSoundMng->init();
	m_pGFX = new mGFX;

	g_pGameMgr->OnInit();
	g_pChatMgr->OnInit();
	//oninit
	m_pNetCharMng;

	ShowWindow(hWnd, nCmdShow);
	UpdateWindow(hWnd);

	return TRUE;
}
Ejemplo n.º 10
0
void cGameApplication::Render()
{
	d2dRender.BeginRender(_hwnd);
	HRESULT hr = E_FAIL;
	d2dRender.GetRenderTarget()->BeginDraw();
	d2dRender.GetRenderTarget()->SetTransform(::D2D1::Matrix3x2F::Identity());
	d2dRender.GetRenderTarget()->Clear(::D2D1::ColorF(::D2D1::ColorF::White));

	if (g_pGameMgr != nullptr)
		g_pGameMgr->Render();
	if (g_pChatMgr != nullptr)
		g_pChatMgr->Render();
	//if (m_pNetCharMng != nullptr)
	//	m_pNetCharMng->render();

	hr = d2dRender.GetRenderTarget()->EndDraw();
	assert(hr == S_OK);

	d2dRender.EndRender();
}
Ejemplo n.º 11
0
void cMonster::Render(cD2DRenderer& renderer)
{
	if (SightX && SightY)
	{
		if (MonsterHp > 0)
		{
			if (Monster != nullptr);
			{
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + MonsterPos.x - 16,
					Screen.y + MonsterPos.y - 52,
					Screen.x + MonsterPos.x + 16,
					Screen.y + MonsterPos.y);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(310, 103, 375, 198);
				renderer.GetRenderTarget()->DrawBitmap(Monster, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		//else Monster = nullptr;
	}


	WCHAR str[128];
	wsprintf(str, L"MonsterCrushOn = %d, %d", MonsterCrushOn, Delta_E);
	UINT32 cTextLength_c = (UINT32)wcslen(str);

	D2D1_RECT_F layoutRectc = D2D1::RectF(830, 200, 1130, 250);

	renderer.GetRenderTarget()->DrawTextW(
		str,
		cTextLength_c,
		renderer.GetTextFormat(),
		layoutRectc,
		renderer.GetBrush());

}
Ejemplo n.º 12
0
void cPlayer::Render(cD2DRenderer& renderer)
{
	D2D1_RECT_F Pivot_p;
	Pivot_p = { PlayerPos.x - 15, PlayerPos.y - 50, PlayerPos.x + 15, PlayerPos.y };

	Screen = { 0 - g_Camera.x, 0 - g_Camera.y };

	if (Adol != nullptr)
	{
		if (bLeft == 0 && bRight == 0 && bUp == 0 && bDown == 0)
		{
			D2D1_SIZE_U size = renderer.GetRenderTargetSize();
			::D2D1_RECT_F dxArea = ::D2D1::RectF(
				Screen.x + Pivot_p.left,
				Screen.y + Pivot_p.top,
				Screen.x + Pivot_p.right,
				Screen.y + Pivot_p.bottom);
			//::D2D1_RECT_F srcArea = ::D2D1::RectF(1.0f, 1.0f, 32.0f, 52.0f);
			::D2D1_RECT_F srcArea;
			if (PlayerWay == 0) srcArea = WayBottom;
			if (PlayerWay == 1) srcArea = WayLeft;
			if (PlayerWay == 2) srcArea = WayRight;
			if (PlayerWay == 3) srcArea = WayTop;
			if (PlayerWay == 4) srcArea = WayBottom;
			/*if (PlayerWay == 5) srcArea = Way7;
			if (PlayerWay == 6) srcArea = Way1;
			if (PlayerWay == 7) srcArea = Way9;
			if (PlayerWay == 8) srcArea = Way3;*/


			renderer.GetRenderTarget()->DrawBitmap(Adol, dxArea, 1.0f,
				D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
				srcArea);
		}
		if (bLeft && bUp)
		{
			Focus7.left = Focus7.left + AdolRatio.x*PlayerFocus.left;
			Focus7.right = Focus7.right + AdolRatio.x*PlayerFocus.left;

			D2D1_SIZE_U size = renderer.GetRenderTargetSize();
			::D2D1_RECT_F dxArea = ::D2D1::RectF(
				Screen.x + Pivot_p.left,
				Screen.y + Pivot_p.top,
				Screen.x + Pivot_p.right,
				Screen.y + Pivot_p.bottom);
			::D2D1_RECT_F srcArea = Focus7;

			renderer.GetRenderTarget()->DrawBitmap(Adol, dxArea, 1.0f,
				D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
				srcArea);

			Focus7 = { 1, 584, 32, 635 };
		}
		else if (bRight && bUp)
		{
			Focus9.left = Focus9.left + AdolRatio.x*PlayerFocus.right;
			Focus9.right = Focus9.right + AdolRatio.x*PlayerFocus.right;
			D2D1_SIZE_U size = renderer.GetRenderTargetSize();
			::D2D1_RECT_F dxArea = ::D2D1::RectF(
				Screen.x + Pivot_p.left,
				Screen.y + Pivot_p.top,
				Screen.x + Pivot_p.right,
				Screen.y + Pivot_p.bottom);
			::D2D1_RECT_F srcArea = Focus9;

			renderer.GetRenderTarget()->DrawBitmap(Adol, dxArea, 1.0f,
				D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
				srcArea);

			Focus9 = { 1, 478, 32, 529 };
		}
		else if(bLeft && bDown)
		{
			Focus1.left = Focus1.left + AdolRatio.x*PlayerFocus.left;
			Focus1.right = Focus1.right + AdolRatio.x*PlayerFocus.left;

			D2D1_SIZE_U size = renderer.GetRenderTargetSize();
			::D2D1_RECT_F dxArea = ::D2D1::RectF(
				Screen.x + Pivot_p.left,
				Screen.y + Pivot_p.top,
				Screen.x + Pivot_p.right,
				Screen.y + Pivot_p.bottom);
			::D2D1_RECT_F srcArea = Focus1;

			renderer.GetRenderTarget()->DrawBitmap(Adol, dxArea, 1.0f,
				D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
				srcArea);

			Focus1 = { 1, 690, 32, 741 };
		}
		else if(bRight && bDown)
		{
			Focus3.left = Focus3.left + AdolRatio.x*PlayerFocus.right;
			Focus3.right = Focus3.right + AdolRatio.x*PlayerFocus.right;
			D2D1_SIZE_U size = renderer.GetRenderTargetSize();
			::D2D1_RECT_F dxArea = ::D2D1::RectF(
				Screen.x + Pivot_p.left,
				Screen.y + Pivot_p.top,
				Screen.x + Pivot_p.right,
				Screen.y + Pivot_p.bottom);
			::D2D1_RECT_F srcArea = Focus3;

			renderer.GetRenderTarget()->DrawBitmap(Adol, dxArea, 1.0f,
				D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
				srcArea);

			Focus3 = { 1, 796, 32, 847 };
		}

		else if(bLeft)
		{
			FocusLeft.left = FocusLeft.left + AdolRatio.x*PlayerFocus.left;
			FocusLeft.right = FocusLeft.right + AdolRatio.x*PlayerFocus.left;

			D2D1_SIZE_U size = renderer.GetRenderTargetSize();
			::D2D1_RECT_F dxArea = ::D2D1::RectF(
				Screen.x + Pivot_p.left,
				Screen.y + Pivot_p.top,
				Screen.x + Pivot_p.right,
				Screen.y + Pivot_p.bottom);
			::D2D1_RECT_F srcArea = FocusLeft;

			renderer.GetRenderTarget()->DrawBitmap(Adol, dxArea, 1.0f,
				D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
				srcArea);

			FocusLeft = { 1, 637, 32, 688 };
		}
		else if (bRight)
		{
			FocusRight.left = FocusRight.left + AdolRatio.x*PlayerFocus.right;
			FocusRight.right = FocusRight.right + AdolRatio.x*PlayerFocus.right;
			D2D1_SIZE_U size = renderer.GetRenderTargetSize();
			::D2D1_RECT_F dxArea = ::D2D1::RectF(
				Screen.x + Pivot_p.left,
				Screen.y + Pivot_p.top,
				Screen.x + Pivot_p.right,
				Screen.y + Pivot_p.bottom);
			::D2D1_RECT_F srcArea = FocusRight;

			renderer.GetRenderTarget()->DrawBitmap(Adol, dxArea, 1.0f,
				D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
				srcArea);

			FocusRight = { 1, 425, 32, 476 };
		}
		else if (bUp)
		{
			FocusTop.left = FocusTop.left + AdolRatio.x*PlayerFocus.top;
			FocusTop.right = FocusTop.right + AdolRatio.x*PlayerFocus.top;

			D2D1_SIZE_U size = renderer.GetRenderTargetSize();
			::D2D1_RECT_F dxArea = ::D2D1::RectF(
				Screen.x + Pivot_p.left,
				Screen.y + Pivot_p.top,
				Screen.x + Pivot_p.right,
				Screen.y + Pivot_p.bottom);
			::D2D1_RECT_F srcArea = FocusTop;

			renderer.GetRenderTarget()->DrawBitmap(Adol, dxArea, 1.0f,
				D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
				srcArea);

			FocusTop = { 1, 531, 32, 582 };
		}
		else if (bDown)
		{
			FocusBottom.left = FocusBottom.left + AdolRatio.x*PlayerFocus.bottom;
			FocusBottom.right = FocusBottom.right + AdolRatio.x*PlayerFocus.bottom;

			D2D1_SIZE_U size = renderer.GetRenderTargetSize();
			::D2D1_RECT_F dxArea = ::D2D1::RectF(
				Screen.x + Pivot_p.left,
				Screen.y + Pivot_p.top,
				Screen.x + Pivot_p.right,
				Screen.y + Pivot_p.bottom);
			::D2D1_RECT_F srcArea = FocusBottom;

			renderer.GetRenderTarget()->DrawBitmap(Adol, dxArea, 1.0f,
				D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
				srcArea);

			FocusBottom = { 1, 743, 32, 794 };
		}

	}
}
Ejemplo n.º 13
0
void cPlayer::EffectRender(cD2DRenderer& renderer)
{

	D2D1_RECT_F EffectPivot_p;
	EffectPivot_p = { PlayerPos.x - 30, PlayerPos.y - 50, PlayerPos.x + 30, PlayerPos.y };

	if (CrushOn == 2)
	{
		if (delta == 0)
		{
			if (PlayerEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_p.left,
					Screen.y + EffectPivot_p.top,
					Screen.x + EffectPivot_p.right,
					Screen.y + EffectPivot_p.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					PlayerEffect1.left,
					PlayerEffect1.top,
					PlayerEffect1.right,
					PlayerEffect1.bottom);
				renderer.GetRenderTarget()->DrawBitmap(PlayerEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (delta == 1)
		{
			if (PlayerEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_p.left,
					Screen.y + EffectPivot_p.top,
					Screen.x + EffectPivot_p.right,
					Screen.y + EffectPivot_p.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					PlayerEffect2.left,
					PlayerEffect2.top,
					PlayerEffect2.right,
					PlayerEffect2.bottom);
				renderer.GetRenderTarget()->DrawBitmap(PlayerEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (delta == 2)
		{
			if (PlayerEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_p.left,
					Screen.y + EffectPivot_p.top,
					Screen.x + EffectPivot_p.right,
					Screen.y + EffectPivot_p.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					PlayerEffect3.left,
					PlayerEffect3.top,
					PlayerEffect3.right,
					PlayerEffect3.bottom);
				renderer.GetRenderTarget()->DrawBitmap(PlayerEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (delta == 3)
		{
			if (PlayerEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_p.left,
					Screen.y + EffectPivot_p.top,
					Screen.x + EffectPivot_p.right,
					Screen.y + EffectPivot_p.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					PlayerEffect4.left,
					PlayerEffect4.top,
					PlayerEffect4.right,
					PlayerEffect4.bottom);
				renderer.GetRenderTarget()->DrawBitmap(PlayerEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (delta == 4)
		{
			if (PlayerEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_p.left,
					Screen.y + EffectPivot_p.top,
					Screen.x + EffectPivot_p.right,
					Screen.y + EffectPivot_p.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					PlayerEffect5.left,
					PlayerEffect5.top,
					PlayerEffect5.right,
					PlayerEffect5.bottom);
				renderer.GetRenderTarget()->DrawBitmap(PlayerEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (delta == 5)
		{
			if (PlayerEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_p.left,
					Screen.y + EffectPivot_p.top,
					Screen.x + EffectPivot_p.right,
					Screen.y + EffectPivot_p.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					PlayerEffect6.left,
					PlayerEffect6.top,
					PlayerEffect6.right,
					PlayerEffect6.bottom);
				renderer.GetRenderTarget()->DrawBitmap(PlayerEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (delta == 6)
		{
			if (PlayerEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_p.left,
					Screen.y + EffectPivot_p.top,
					Screen.x + EffectPivot_p.right,
					Screen.y + EffectPivot_p.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					PlayerEffect7.left,
					PlayerEffect7.top,
					PlayerEffect7.right,
					PlayerEffect7.bottom);
				renderer.GetRenderTarget()->DrawBitmap(PlayerEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}

	}

}
Ejemplo n.º 14
0
void cMonster::EffectRender(cD2DRenderer& renderer)
{
	EffectPivot_m;
	EffectPivot_m = { MonsterPos.x - 30, MonsterPos.y - 50, MonsterPos.x + 30, MonsterPos.y };
	if (MonsterCrushOn == 1)
	{
		if (Delta_E == 0)
		{
			if (MonsterEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_m.left,
					Screen.y + EffectPivot_m.top,
					Screen.x + EffectPivot_m.right,
					Screen.y + EffectPivot_m.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					MonsterEffect1.left,
					MonsterEffect1.top,
					MonsterEffect1.right,
					MonsterEffect1.bottom);
				renderer.GetRenderTarget()->DrawBitmap(MonsterEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (Delta_E == 1)
		{
			if (MonsterEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_m.left,
					Screen.y + EffectPivot_m.top,
					Screen.x + EffectPivot_m.right,
					Screen.y + EffectPivot_m.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					MonsterEffect2.left,
					MonsterEffect2.top,
					MonsterEffect2.right,
					MonsterEffect2.bottom);
				renderer.GetRenderTarget()->DrawBitmap(MonsterEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (Delta_E == 2)
		{
			if (MonsterEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_m.left,
					Screen.y + EffectPivot_m.top,
					Screen.x + EffectPivot_m.right,
					Screen.y + EffectPivot_m.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					MonsterEffect3.left,
					MonsterEffect3.top,
					MonsterEffect3.right,
					MonsterEffect3.bottom);
				renderer.GetRenderTarget()->DrawBitmap(MonsterEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (Delta_E == 3)
		{
			if (MonsterEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_m.left,
					Screen.y + EffectPivot_m.top,
					Screen.x + EffectPivot_m.right,
					Screen.y + EffectPivot_m.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					MonsterEffect4.left,
					MonsterEffect4.top,
					MonsterEffect4.right,
					MonsterEffect4.bottom);
				renderer.GetRenderTarget()->DrawBitmap(MonsterEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (Delta_E == 4)
		{
			if (MonsterEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_m.left,
					Screen.y + EffectPivot_m.top,
					Screen.x + EffectPivot_m.right,
					Screen.y + EffectPivot_m.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					MonsterEffect5.left,
					MonsterEffect5.top,
					MonsterEffect5.right,
					MonsterEffect5.bottom);
				renderer.GetRenderTarget()->DrawBitmap(MonsterEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (Delta_E == 5)
		{
			if (MonsterEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_m.left,
					Screen.y + EffectPivot_m.top,
					Screen.x + EffectPivot_m.right,
					Screen.y + EffectPivot_m.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					MonsterEffect6.left,
					MonsterEffect6.top,
					MonsterEffect6.right,
					MonsterEffect6.bottom);
				renderer.GetRenderTarget()->DrawBitmap(MonsterEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (Delta_E == 6)
		{
			if (MonsterEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_m.left,
					Screen.y + EffectPivot_m.top,
					Screen.x + EffectPivot_m.right,
					Screen.y + EffectPivot_m.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					MonsterEffect7.left,
					MonsterEffect7.top,
					MonsterEffect7.right,
					MonsterEffect7.bottom);
				renderer.GetRenderTarget()->DrawBitmap(MonsterEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (Delta_E == 7)
		{
			if (MonsterEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_m.left,
					Screen.y + EffectPivot_m.top,
					Screen.x + EffectPivot_m.right,
					Screen.y + EffectPivot_m.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					MonsterEffect8.left,
					MonsterEffect8.top,
					MonsterEffect8.right,
					MonsterEffect8.bottom);
				renderer.GetRenderTarget()->DrawBitmap(MonsterEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (Delta_E == 8)
		{
			if (MonsterEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_m.left,
					Screen.y + EffectPivot_m.top,
					Screen.x + EffectPivot_m.right,
					Screen.y + EffectPivot_m.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					MonsterEffect9.left,
					MonsterEffect9.top,
					MonsterEffect9.right,
					MonsterEffect9.bottom);
				renderer.GetRenderTarget()->DrawBitmap(MonsterEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		if (Delta_E == 9)
		{
			if (MonsterEffect != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = ::D2D1::RectF(
					Screen.x + EffectPivot_m.left,
					Screen.y + EffectPivot_m.top,
					Screen.x + EffectPivot_m.right,
					Screen.y + EffectPivot_m.bottom);
				::D2D1_RECT_F srcArea = ::D2D1::RectF(
					MonsterEffect10.left,
					MonsterEffect10.top,
					MonsterEffect10.right,
					MonsterEffect10.bottom);
				renderer.GetRenderTarget()->DrawBitmap(MonsterEffect, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
	}


}
Ejemplo n.º 15
0
void cInterFace::MenuBarRender(cD2DRenderer& renderer)
{
	if (delta == 10)
	{
		if (MenuBar == 1)
		{
			if (MenuBar_Load != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = MenuBar7;
				::D2D1_RECT_F srcArea = MenuBar0;
				renderer.GetRenderTarget()->DrawBitmap(MenuBar_Load, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		else if (MenuBar == 2)
		{
			if (MenuBar_Save != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = MenuBar7;
				::D2D1_RECT_F srcArea = MenuBar0;
				renderer.GetRenderTarget()->DrawBitmap(MenuBar_Save, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		else if (MenuBar == 3)
		{
			if (MenuBar_Equip != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = MenuBar7;
				::D2D1_RECT_F srcArea = MenuBar0;
				renderer.GetRenderTarget()->DrawBitmap(MenuBar_Equip, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		else if (MenuBar == 4)
		{
			if (MenuBar_Inven != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = MenuBar7;
				::D2D1_RECT_F srcArea = MenuBar0;
				renderer.GetRenderTarget()->DrawBitmap(MenuBar_Inven, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		else if (MenuBar == 5)
		{
			if (MenuBar_Status != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = MenuBar7;
				::D2D1_RECT_F srcArea = MenuBar0;
				renderer.GetRenderTarget()->DrawBitmap(MenuBar_Status, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		else if (MenuBar == 6)
		{
			if (MenuBar_Option != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = MenuBar7;
				::D2D1_RECT_F srcArea = MenuBar0;
				renderer.GetRenderTarget()->DrawBitmap(MenuBar_Option, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
		else if (MenuBar == 0)
		{
			if (MenuBarMain != nullptr);
			{
				D2D1_SIZE_U size = renderer.GetRenderTargetSize();
				::D2D1_RECT_F dxArea = MenuBar7;
				::D2D1_RECT_F srcArea = MenuBar0;
				renderer.GetRenderTarget()->DrawBitmap(MenuBarMain, dxArea, 1.0f,
					D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
					srcArea);
			}
		}
	}

	else if (delta)
	{
		if (MenuBarMain != nullptr);
		{
			D2D1_SIZE_U size = renderer.GetRenderTargetSize();
			::D2D1_RECT_F dxArea = { 147, 596 - delta * 5.7, 651, 596 };
			::D2D1_RECT_F srcArea = { 0, 0, 403, delta*4.3 };
			renderer.GetRenderTarget()->DrawBitmap(MenuBarMain, dxArea, 1.0f,
				D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
				srcArea);
		}
	}

}
Ejemplo n.º 16
0
void cChatting::LoadImages(cD2DRenderer& renderer, HWND hWnd)
{
	ChatBoard = renderer.CreateD2DBitmapFromFile(hWnd, L"Images/Chat/ChatBoard.png");
}