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
|
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_kantera_icon_meter.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "d/d_com_inf_game.h"
#include "d/d_meter_HIO.h"
#include "d/d_pane_class.h"
dKantera_icon_c::dKantera_icon_c() {
initiate();
}
dKantera_icon_c::~dKantera_icon_c() {
delete mpKanteraIcon->getScreen();
delete mpKanteraIcon;
mpKanteraIcon = NULL;
delete mpParent;
mpParent = NULL;
delete mpGauge;
mpGauge = NULL;
}
void dKantera_icon_c::initiate() {
mpKanteraIcon = new dDlst_KanteraIcon_c();
J2DScreen* scrn = new J2DScreen();
scrn->setPriority("zelda_kantera_icon_mater.blo", 0x20000, dComIfGp_getMain2DArchive());
dPaneClass_showNullPane(scrn);
mpKanteraIcon->setScreen(scrn);
mpParent = new CPaneMgr(scrn, MULTI_CHAR('kan_m_n'), 2, NULL);
mpGauge = new CPaneMgr(scrn, MULTI_CHAR('yellow_m'), 0, NULL);
}
void dKantera_icon_c::setAlphaRate(f32 alphaRate) {
mpParent->setAlphaRate(alphaRate);
}
void dKantera_icon_c::setPos(f32 x, f32 y) {
mpParent->translate(x + g_drawHIO.mLanternIconMeterPosX, y + g_drawHIO.mLanternIconMeterPosY);
}
void dKantera_icon_c::setScale(f32 h, f32 v) {
mpParent->scale(h * g_drawHIO.mLanternIconMeterSize, v * g_drawHIO.mLanternIconMeterSize);
}
void dKantera_icon_c::setNowGauge(u16 h, u16 v) {
mpGauge->scale((f32)v / (f32)h, 1.0f);
}
void dDlst_KanteraIcon_c::draw() {
J2DGrafContext* curGraf = dComIfGp_getCurrentGrafPort();
curGraf->setup2D();
mp_scrn->draw(0.0f, 0.0f, curGraf);
}
dDlst_KanteraIcon_c::~dDlst_KanteraIcon_c() {}
|