/
Splash.cpp
52 lines (47 loc) · 966 Bytes
/
Splash.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
#include "StdAfx.h"
#include "Splash.h"
CSplash::CSplash(void)
{
CModule::CModule();
animatingButtons= 200;
animatingFrom= true;
animatingTo = true;
}
CSplash::~CSplash(void)
{
}
void CSplash::Update() {
if (animatingTo) {
AnimateTo();
return;
}
if (shared->input->mouseToggle) {
animatingTo = true;
}
Render();
}
void CSplash::Render(int alpha) {
shared->images->splash->Render();
shared->images->crescent->Render(210,93,255);
if (shared->TRANSITION != shared->gamestate) {
} else {
animatingFrom= true;
}
}
void CSplash::AnimateFrom() {
}
void CSplash::AnimateTo() {
shared->images->splash->Render();
float alpha = 255*((150-(animatingButtons-50))/150.0);
if (animatingButtons > 50)
shared->images->crescent->Render(210,93,int(alpha));
else
shared->images->crescent->Render(210,93,255);
if (animatingButtons > 0) {
animatingButtons--;
} else {
animatingButtons = 200;
shared->nextstate = 1;
animatingTo = false;
}
}