forked from iscle/SpaceCadetPinball
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathTGate.cpp
41 lines (36 loc) · 887 Bytes
/
TGate.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
#include "pch.h"
#include "TGate.h"
#include "control.h"
#include "loader.h"
#include "render.h"
TGate::TGate(TPinballTable* table, int groupIndex) : TCollisionComponent(table, groupIndex, true)
{
visualStruct visual{};
loader::query_visual(groupIndex, 0, &visual);
SoundIndex4 = visual.SoundIndex4;
SoundIndex3 = visual.SoundIndex3;
ActiveFlag = 1;
render::sprite_set_bitmap(RenderSprite, ListBitmap->at(0));
control::handler(1024, this);
}
int TGate::Message(int code, float value)
{
if (code != 1020)
{
if (code == 53)
{
ActiveFlag = 0;
render::sprite_set_bitmap(RenderSprite, nullptr);
loader::play_sound(SoundIndex3);
}
else if (code == 54 || code == 1024)
{
ActiveFlag = 1;
render::sprite_set_bitmap(RenderSprite, ListBitmap->at(0));
if (code == 54)
loader::play_sound(SoundIndex4);
}
control::handler(code, this);
}
return 0;
}