simplify
This commit is contained in:
@@ -14,31 +14,19 @@
|
||||
|
||||
MeterDisplay::MeterDisplay()
|
||||
{
|
||||
|
||||
this->AddChild( &m_sprStream );
|
||||
}
|
||||
|
||||
void MeterDisplay::Load( CString sSteamPath, float fStreamWidth )
|
||||
void MeterDisplay::Load( CString sStreamPath, float fStreamWidth )
|
||||
{
|
||||
m_fStreamWidth = fStreamWidth;
|
||||
|
||||
m_sprStream.Load( sSteamPath );
|
||||
m_sprStream.Load( sStreamPath );
|
||||
m_sprStream.SetZoomX( fStreamWidth / m_sprStream.GetUnzoomedWidth() );
|
||||
|
||||
SetPercent( 0.5f );
|
||||
}
|
||||
|
||||
void MeterDisplay::Update( float fDelta )
|
||||
{
|
||||
m_sprStream.Update( fDelta );
|
||||
|
||||
Actor::Update( fDelta );
|
||||
}
|
||||
|
||||
void MeterDisplay::DrawPrimitives()
|
||||
{
|
||||
m_sprStream.Draw();
|
||||
}
|
||||
|
||||
void MeterDisplay::SetPercent( float fPercent )
|
||||
{
|
||||
ASSERT( fPercent >= 0 && fPercent <= 1 );
|
||||
|
||||
@@ -11,22 +11,20 @@
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "Actor.h"
|
||||
#include "ActorFrame.h"
|
||||
#include "Sprite.h"
|
||||
#include "Quad.h"
|
||||
|
||||
|
||||
class MeterDisplay : public Actor
|
||||
class MeterDisplay : public ActorFrame
|
||||
{
|
||||
public:
|
||||
MeterDisplay();
|
||||
void Load( CString sSteamPath, float fStreamWidth );
|
||||
virtual void Update( float fDelta );
|
||||
virtual void DrawPrimitives();
|
||||
void Load( CString sStreamPath, float fStreamWidth );
|
||||
|
||||
void SetPercent( float fPercent );
|
||||
|
||||
|
||||
private:
|
||||
float m_fStreamWidth;
|
||||
float m_fPercent;
|
||||
Sprite m_sprStream;
|
||||
|
||||
Reference in New Issue
Block a user