StateLoading.cpp
上传用户:jalin138
上传日期:2022-02-12
资源大小:5720k
文件大小:1k
- #include "StateLoading.h"
- #include "StateMenu.h"
- CStateLoading::CStateLoading(void)
- {
- m_pLogo = g_Res->GetSprite( "Logo" );
- m_pGuage = g_Res->GetAnimation( "Guage" );
- m_pGuage->SetMode( HGEANIM_FWD | HGEANIM_LOOP );
- m_pGuage->Play();
- m_fTime = 0.0f;
- }
- CStateLoading::~CStateLoading(void)
- {
- m_pGuage = NULL;
- m_pLogo = NULL;
- }
- // 实现逻辑接口
- bool CStateLoading::Logic(void)
- {
- m_pGuage->Update( 0.017f );
-
- m_fTime += 1.0f;
- if ( m_fTime > 100.0f )
- return true;
- return false;
- }
- // 实现渲染接口
- void CStateLoading::Render(void)
- {
- m_pLogo->RenderEx( 400, 250, 0.0f, 0.4f, 0.4f );
- m_pGuage->RenderEx( 400, 330, 0.0f, 0.8f, 0.4f );
- }
- // 实现改变状态接口
- bool CStateLoading::Handle(CSceneManage *_SceneManage)
- {
- if ( NULL == _SceneManage )
- return false;
- _SceneManage->ChangeState( new CStateMenu() );
- return false;
- }