usbloadergx/source/GUI/gui_diskcover.cpp
dimok321 72d8c9dc2e *Created an automatic resource list generation script which is executed when files are added/removed
*Created an own class for the homebrew prompt
*Created scrollbar class which is now used on every browser
*Created a checkbox browser list class
*Changed the category prompts to the new list mode
*Improved B-Button scrolling
*Fixed horizontal text scrolling
*Fixed possible crash on long text display
*Many internal gui changes and navigation changes
*Fixed booting games by argument (headless id) (Issue 1930)
*Fixed SD Reload button to really reload the SD after it was ejected (Issue 1923)
*Added booting with arguements from meta.xml for homebrews (Issue 1926)
*Added some arguments acception from meta.xml to our app. "-ios=xxx" and "-usbport=x" or "--ios=xxx" and "--usbport=x" can be used. -usbport is for Hermes cIOS to decide which usb port to use on startup. The ios is the boot IOS on startup, it always overrides the compiled boot IOS into the application.
2011-06-14 17:53:19 +00:00

106 lines
2.5 KiB
C++

#include "gui_diskcover.h"
#include "settings/CSettings.h"
GuiDiskCover::GuiDiskCover()
{
PosZ = 50;
Distance = 55;
OldDegBeta = 0.0;
deg_beta = 0.0;
eff_step = 0;
// spin_angle = 0;
spin_speedup = 1.0;
spin_up = false;
}
GuiDiskCover::GuiDiskCover(GuiImageData *Disk) :
GuiImage(Disk)
{
PosZ = 50;
Distance = 55;
OldDegBeta = 0.0;
deg_beta = 0.0;
eff_step = 0;
// spin_angle = 0;
spin_speedup = 1.0;
spin_up = false;
}
GuiDiskCover::~GuiDiskCover()
{
}
void GuiDiskCover::SetBeta(f32 beta)
{
deg_beta = beta;
}
void GuiDiskCover::SetBetaRotateEffect(f32 beta, u16 step)
{
eff_beta = beta / (f32) step;
eff_step = step;
}
bool GuiDiskCover::GetBetaRotateEffect()
{
return eff_step != 0;
}
void GuiDiskCover::SetSpin(bool Up)
{
spin_up = Up;
}
void GuiDiskCover::SetState(int s, int c)
{
if(state == STATE_DEFAULT && s == STATE_DISABLED)
{
PosZ = 0;
Distance = 0;
OldDegBeta = deg_beta;
deg_beta = 0.0f;
}
else if(state == STATE_DISABLED && s == STATE_DEFAULT)
{
PosZ = 50;
Distance = 55;
deg_beta = OldDegBeta;
}
GuiImage::SetState(s, c);
}
void Menu_DrawDiskCover(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16 distance, u8 data[], f32 deg_alpha,
f32 deg_beta, f32 scaleX, f32 scaleY, u8 alpha, bool shadow);
void Menu_DrawDiskCoverShadow(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16 distance, u8 data[],
f32 deg_alpha, f32 deg_beta, f32 scaleX, f32 scaleY, u8 alpha, bool shadow);
void GuiDiskCover::Draw()
{
LOCK( this );
if (!image || !this->IsVisible()) return;
float currScale = this->GetScale();
Menu_DrawDiskCover(this->GetLeft(), this->GetTop(), PosZ, width, height, Distance, image, imageangle, deg_beta,
widescreen ? currScale * Settings.WSFactor : currScale, currScale, 64, true);
Menu_DrawDiskCover(this->GetLeft(), this->GetTop(), PosZ, width, height, Distance, image, imageangle, deg_beta,
widescreen ? currScale * Settings.WSFactor : currScale, currScale, this->GetAlpha(), false);
if (eff_step)
{
deg_beta += eff_beta;
eff_step--;
}
GuiImage::imageangle += spin_speedup;
while (GuiImage::imageangle >= 360.0)
GuiImage::imageangle -= 360.0;
if (spin_up)
{
if (spin_speedup < 11) // speed up
spin_speedup += 0.20;
}
else
{
if (spin_speedup > 1) spin_speedup -= 0.05; //slow down
}
this->UpdateEffects();
}