mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-25 15:05:06 -04:00
a6e76c0841
* some wii OS fixes * remove old dol2asm comments * remove dol2asm.h * remove function address comments * normalize ATTRIBUTE_ALIGN usage * DECL_WEAK macro * fix gcc attribute weak macro * wrap more mwcc specific things in ifdefs * fixes * fix revo sdk version flags * fixes
62 lines
1.6 KiB
C++
62 lines
1.6 KiB
C++
#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, 'kan_m_n', 2, NULL);
|
|
|
|
mpGauge = new CPaneMgr(scrn, '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() {}
|