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