-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameLoadState.cpp
51 lines (39 loc) · 1.11 KB
/
GameLoadState.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
#include "GameLoadState.h"
GameLoadState::GameLoadState()
{
stateName = "GameLoad";
}
GameLoadState::~GameLoadState()
{
resManager = nullptr;
}
void GameLoadState::Enter()
{
stateManager = this->GetStateManager();
resManager = stateManager->GetResourceManager();
}
void GameLoadState::Exit()
{
resManager = nullptr;
stateManager = nullptr;
}
GotoState GameLoadState::Update()
{
// TODO: Should be async to get smooth moving loading screen with UI response.
//
// Load resources
//
// Font
fontSharedBig = resManager->GetSharedFontResourceIdByName("Data\\Fonts\\OpenSans-Regular-64.fnt");
// Image
std::vector<std::string> vLoadImage;
vLoadImage.push_back("Data\\__General__\\spr_body_0.png");
vLoadImage.push_back("Data\\__General__\\bg_grass.png");
vLoadImage.push_back("Data\\TinyHouse\\spr_tinyhouse_floor_0.png");
vLoadImage.push_back("Data\\TinyHouse\\tinyhouseOutWest.png");
// Load images onto the GPU
for(int i = 0; i < vLoadImage.size(); i++)
resManager->AddGpuImageResource(vLoadImage[i]);
vLoadImage.clear();
return ToState::GamePlay;
}