-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCStage_Start.cpp
112 lines (85 loc) · 2.27 KB
/
CStage_Start.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include "pch.h"
#include "CStage_Start.h"
#include "CCore.h"
#include "CStageMgr.h"
#include "CKeyMgr.h"
#include "CEventMgr.h"
#include "CResMgr.h"
#include "CSound.h"
#include "CTexture.h"
#include "CUI_Dialog.h"
CStage_Start::CStage_Start()
{
SetStageName(L"Start");
m_pDailog = new CUI_Dialog(L"intro");
m_pDailog->SetCurStage(this);
AddObject(m_pDailog, EOBJ_TYPE::DIALOG);
}
CStage_Start::~CStage_Start()
{
}
void CStage_Start::Init()
{
}
void CStage_Start::Update()
{
CStage::Update();
}
void CStage_Start::Render(HDC _dc)
{
Vec resolution = CCore::GetInst()->GetResolution();
CStage::Render(_dc);
CTexture* pTex;
if (m_pDailog->GetCurPage() == 5)
{
pTex = CResMgr::GetInst()->LoadTexture(L"cutscene_1", L"texture\\ui\\dialog\\dialog_cutscene\\cutscene_1.bmp");
BitBlt(_dc, resolution.x/2 - pTex->Width()/2, 30, pTex->Width(), pTex->Height(),pTex->GetDC(), 0, 0, SRCCOPY);
pTex = nullptr;
return;
}
if (m_pDailog->GetCurPage() == 6)
{
pTex = CResMgr::GetInst()->LoadTexture(L"cutscene_2", L"texture\\ui\\dialog\\dialog_cutscene\\cutscene_2.bmp");
BitBlt(_dc, resolution.x/2 - pTex->Width()/2, 30, pTex->Width(), pTex->Height(),pTex->GetDC(), 0, 0, SRCCOPY);
pTex = nullptr;
return;
}
if (m_pDailog->GetCurPage() == 7)
{
pTex = CResMgr::GetInst()->LoadTexture(L"cutscene_3", L"texture\\ui\\dialog\\dialog_cutscene\\cutscene_3.bmp");
BitBlt(_dc, resolution.x/2 - pTex->Width()/2, 30, pTex->Width(), pTex->Height(),pTex->GetDC(), 0, 0, SRCCOPY);
pTex = nullptr;
return;
}
}
void CStage_Start::Enter()
{
m_pStartBGM = CResMgr::GetInst()->LoadSound(L"Apropos", L"sound\\Apropos.wav");
m_pStartBGM->SetVolume(100);
m_pStartBGM->PlayToBGM(true);
}
void CStage_Start::Exit()
{
m_pStartBGM->Stop();
CStage::Clear();
}
void CStage_Start::FirstOptionSelected()
{
m_pDailog->SetCurPage(m_pDailog->GetCurPage()+1);
}
void CStage_Start::SecondOptionSelected()
{
if (L"intro" == m_pDailog->GetID())
{
HWND hWnd = CCore::GetInst()->GetMainWndHWND();
if (hWnd) SendMessage(hWnd, WM_CLOSE, 0, 0);
}
}
void CStage_Start::DialogTermination()
{
tEventInfo eventInfo;
eventInfo.eType = EEVENT_TYPE::STAGE_CHANGE;
eventInfo.lParam = (DWORD)ESTAGE_TYPE::PUZZLE;
eventInfo.wParam = (DWORD)ECHAPTER::CHAP_1;
CEventMgr::GetInst()->AddEvent(eventInfo);
}