-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cpp
133 lines (99 loc) · 3.04 KB
/
Main.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#include"Src/BaseIncluder.h"
#include"Src/BaseMecha/BaseMecha.h"
#include"Src/BaseMecha/MechaParts.h"
#include"Src/Frames/GameFrame.h"
#include"Src/Frames/TitleFrame.h"
#include"Src/Frames/SelectFrame.h"
#include"Src/Frames/EditFrame.h"
#include"Src/Frames/StageSelectFrame.h"
#include"Src/Frames/ResultFrame.h"
#include"Src/BaseMecha/Controller/ControllerBase.h"
#include "Src/StageSelectFrame/StageData/StageData.h"
int WINAPI WinMain(
HINSTANCE hInst
, HINSTANCE hPrev
, LPSTR lpszCmdParam
, int nCmdshow)
{
auto&& system = *ChSystem::SysManager().Init<ChSystem::Windows>();
ChWin::WindClassObject windClass;
windClass.RegistClass("ChGame");
auto s_screen = ChWin::GetScreenSize();
{
{
ChWin::WindCreater creater(hInst);
{
ChWin::WindStyle style;
style.AddOverlappedWindow();
style.AddClipChildren();
creater.SetWindStyle(&style);
}
creater.SetInitSize(s_screen);
system.Init(creater,
//"AfterToday_DemoMission",
"MechanizedWar TestProject",
windClass.GetWindClassName(),
hInst,
nCmdshow);
system.SetWinProcedure(WM_DESTROY, [&](HWND _hWnd, UINT _msg, WPARAM _wPalam, LPARAM _lParam)->LRESULT {
system.Release();
return 0;
});
}
ChWin::MsgBox msg;
msg.ClearDisplayButtonType();
msg.AddDisplayButtonType(ChWin::MsgBox::DisplayButtonType::YesNo);
bool fullScreenFlg = msg.Display(system.GethWnd(), "全画面確認", "全画面表示で行いますか?") == ChWin::MsgBox::PushButtonType::Yes;
ChD3D11::D3D11API().Init(system.GethWnd(), fullScreenFlg, GAME_WINDOW_WIDTH_LONG, GAME_WINDOW_HEIGHT_LONG);
ChD3D11::Shader11().Init(ChD3D11::D3D11API(), GAME_WINDOW_WIDTH, GAME_WINDOW_HEIGHT);
ChD3D11::Shader11().SetBackColor(ChVec4(0.0f, 0.0f, 1.0f, 1.0f));
ChD3D::XAudioManager().Init();
ChWin::Mouse().Init(system);
}
ChCpp::FrameList frameList;
auto testData = ChPtr::Make_S<StageDataStructure>();
testData->stageScriptPath = "stage1.chs";
frameList.SetSendData(testData);
auto playerData = ChPtr::Make_S<PlayerData>();
frameList.SaveData(playerData);
ChD3D::WICBitmapCreatorObj().Init();
#if USE_TITLE_FRAME_FLG
frameList.SetFrame<TitleFrame>();
#endif
#if USE_SELECT_FRAME_FLG
frameList.SetFrame<SelectFrame>();
#endif
#if USE_STAGE_SELECT_FRAME_FLG
frameList.SetFrame<StageSelectFrame>();
#endif
#if USE_GAME_FRAME_FLG
frameList.SetFrame<GameFrame>();
#endif
#if USE_EDIT_FRAME_FLG
frameList.SetFrame<EditFrame>();
#endif
#if USE_SETTING_FRAME_FLG
frameList.SetFrame<SettingFrame>();
#endif
#if USE_RESULT_FRAME_FLG
frameList.SetFrame<ResultFrame>();
#endif
// ゲームに関する初期化処理 ---------------------------
while (system.IsUpdate())
{
if (!ChSystem::SysManager().FPSProcess())continue;
if (system.IsPushKeyNoHold(VK_ESCAPE))
{
system.Release();
break;
}
frameList.Update();
ChD3D::XAudioManager().Update();
}
// ゲームに関する終了処理 ---------------------------
frameList.Release();
ChD3D11::Shader11().Release();
ChD3D11::D3D11API().Release();
ChD3D::WICBitmapCreatorObj().Release();
return (int)system.GetReturnMassage()->wParam;
}