mirror of
https://github.com/echojc/osu-ds.git
synced 2025-06-18 17:05:36 -04:00

Removed the arm7 section Changed the makefile to only use the arm9 stuff Epicpkmn: Fix source/Graphics/GraphicsManager.cpp Co-Authored-By: Pk11 <epicpkmn11@outlook.com> Co-Authored-By: Kaisaan <34224128+Kaisaan@users.noreply.github.com>
54 lines
879 B
C++
54 lines
879 B
C++
#include "Transformation.h"
|
|
|
|
Transformation::Transformation(TransformType type, s32 starttime, s32 endtime, s32 startvalue, s32 endvalue)
|
|
{
|
|
this->type = type;
|
|
|
|
this->starttime = starttime;
|
|
this->endtime = endtime;
|
|
|
|
this->startvalue = startvalue;
|
|
this->endvalue = endvalue;
|
|
|
|
totaltime = endtime-starttime;
|
|
totalvalue = endvalue-startvalue;
|
|
|
|
currentvalue = startvalue;
|
|
|
|
active = false;
|
|
lastactive = false;
|
|
}
|
|
|
|
void Transformation::Update()
|
|
{
|
|
s32 time = GameClock::Clock().Time();
|
|
|
|
if (!active)
|
|
{
|
|
if (time > starttime)
|
|
active = true;
|
|
else
|
|
return;
|
|
}
|
|
|
|
if (time > endtime)
|
|
{
|
|
active = false;
|
|
currentvalue = endvalue;
|
|
lastactive = true;
|
|
return;
|
|
}
|
|
|
|
currentvalue = (s32)(((time-starttime)/(float)totaltime)*totalvalue + startvalue);
|
|
}
|
|
|
|
bool Transformation::Active()
|
|
{
|
|
if (lastactive)
|
|
{
|
|
lastactive = false;
|
|
return true;
|
|
}
|
|
return active;
|
|
}
|