190 lines
4.9 KiB
C++
190 lines
4.9 KiB
C++
|
|
|
|
#pragma once
|
|
|
|
#include "sgame.h"
|
|
|
|
//#include "SGameLobby.h"
|
|
#include "SGameRenewalLobby.h"
|
|
#include "SGameWorld.h"
|
|
|
|
#include "KSeqModel.h"
|
|
#include <toolkit/XBossWorker.h>
|
|
|
|
#include "SGameSceneSeqPlayer.h"
|
|
|
|
#define LOBBY
|
|
|
|
class KSeqModel;
|
|
|
|
class SGameManager;
|
|
class K3DRenderDeviceDX;
|
|
class SSoundManager;
|
|
class KTextureManager;
|
|
class KNX3Manager;
|
|
|
|
class SGameMilesSoundMgr;
|
|
|
|
class SGameThread : public XBossWorker::XWorker
|
|
{
|
|
public:
|
|
SGameThread(SGameManager* pGameMng, int nGameType, K3DRenderDeviceDX *pRenderDevice, SSoundManager *pSoundMng,
|
|
KTextureManager * pTextureMng, KNX3Manager * pNX3Mng, SGameMilesSoundMgr* pMSoundMgr )
|
|
{
|
|
m_pGameMng = pGameMng;
|
|
m_nGameType = nGameType;
|
|
m_pGraphics = pRenderDevice;
|
|
m_pSoundMng = pSoundMng;
|
|
m_pTextureMng = pTextureMng;
|
|
m_pNX3Mng = pNX3Mng;
|
|
|
|
m_pMSoundMgr = pMSoundMgr;
|
|
|
|
m_bFinished = false;
|
|
m_pLoadedGame = NULL;
|
|
|
|
_oprint( "SGameThread %08X\n", this );
|
|
}
|
|
virtual ~SGameThread() { _oprint( "~SGameThread %08X\n", this ); }
|
|
|
|
bool onProcess( int nThreadNum )
|
|
{
|
|
//assert( _CrtCheckMemory() && "Memory Error!!!" );
|
|
|
|
switch( m_nGameType )
|
|
{
|
|
case GAME_TYPE_SELECT: // Avatar Select
|
|
{
|
|
// SGameLogin * pLogin = new SGameLogin( m_pGameMng, m_pGraphics, m_pSoundMng, m_pTextureMng, m_pNX3Mng );
|
|
#ifndef LOBBY
|
|
SGameLobby * pLogin = new SGameLobby( m_pGameMng, m_pGraphics, m_pSoundMng, m_pTextureMng, m_pNX3Mng, m_pMSoundMgr );
|
|
#else
|
|
SGameRenewalLobby * pLogin = new SGameRenewalLobby( m_pGameMng, m_pGraphics, m_pSoundMng, m_pTextureMng, m_pNX3Mng, m_pMSoundMgr );
|
|
#endif
|
|
pLogin->SetAvatarSelectStart();
|
|
m_pLoadedGame = pLogin;
|
|
}
|
|
break;
|
|
|
|
case GAME_TYPE_LOGIN: // Login
|
|
//#ifdef NDEBUG
|
|
// m_pLoadedGame = new SGameLogin( m_pGameMng, m_pGraphics, m_pSoundMng, m_pTextureMng, m_pNX3Mng );
|
|
//#else
|
|
// m_pLoadedGame = new SGameLobby( m_pGameMng, m_pGraphics, m_pSoundMng, m_pTextureMng, m_pNX3Mng, m_pMSoundMgr );
|
|
//#endif
|
|
#ifndef LOBBY
|
|
m_pLoadedGame = new SGameLobby( m_pGameMng, m_pGraphics, m_pSoundMng, m_pTextureMng, m_pNX3Mng, m_pMSoundMgr );
|
|
#else
|
|
m_pLoadedGame = new SGameRenewalLobby( m_pGameMng, m_pGraphics, m_pSoundMng, m_pTextureMng, m_pNX3Mng, m_pMSoundMgr );
|
|
#endif
|
|
break;
|
|
|
|
case GAME_TYPE_WORLD: // Main World
|
|
m_pLoadedGame = new SGameWorld( m_pGameMng, m_nGameType, m_pGraphics, m_pSoundMng, m_pTextureMng, m_pNX3Mng, m_pMSoundMgr );
|
|
break;
|
|
|
|
default:
|
|
m_pLoadedGame = new SGame( m_pGameMng, m_nGameType, m_pGraphics, m_pSoundMng, m_pTextureMng, m_pNX3Mng, m_pMSoundMgr );
|
|
break;
|
|
}
|
|
|
|
//assert( _CrtCheckMemory() && "Memory Error!!!" );
|
|
|
|
m_bFinished = true;
|
|
return true;
|
|
}
|
|
|
|
bool IsFinished() { return m_bFinished; }
|
|
|
|
void onEnd( bool bIsCancel ) { _oprint( "SGameThread OnEnd %08X\n", this ); }
|
|
SGame * GetLoadGame() { return m_pLoadedGame; }
|
|
|
|
private:
|
|
volatile bool m_bFinished;
|
|
SGame * m_pLoadedGame;
|
|
int m_nGameType;
|
|
|
|
SGameManager* m_pGameMng;
|
|
K3DRenderDeviceDX* m_pGraphics;
|
|
SSoundManager* m_pSoundMng;
|
|
KTextureManager* m_pTextureMng;
|
|
KNX3Manager* m_pNX3Mng;
|
|
|
|
SGameMilesSoundMgr* m_pMSoundMgr;
|
|
};
|
|
|
|
class SGameLoad : public SGame
|
|
{
|
|
public:
|
|
SGameLoad(SGameManager* pGameMng, int nGameType, K3DRenderDeviceDX *pRenderDevice, SSoundManager *pSoundMng,
|
|
KTextureManager * pTextureMng, KNX3Manager * pNX3Mng, SGameMilesSoundMgr* pMSoundMgr );
|
|
virtual ~SGameLoad();
|
|
|
|
void LoadGame( int nGameIndex );
|
|
SGame * GetLoadGame() { return m_pLoadGame; }
|
|
void SetLoadGame()
|
|
{
|
|
m_pLoadGame = NULL;
|
|
m_vDelGameThreadList.push_back( m_vGameThreadList[0] );
|
|
m_vGameThreadList.pop_back();
|
|
}
|
|
|
|
bool IsActivated();
|
|
bool IsOffJTVLogo();
|
|
|
|
virtual bool Render( KViewportObject *viewport );
|
|
virtual bool Process( DWORD time, unsigned long uProcessBitVector=0 );
|
|
|
|
virtual void ProcMsgAtStatic( SGameMessage* pGameMsg );
|
|
|
|
void SetResolution( int nWidth, int nHeight );
|
|
|
|
|
|
trf::MetaData& GetNX3MetaData() { return m_pNX3Mng->GetMetaData(); }
|
|
void InitMovie();
|
|
//SGameScene *LoadMovie(const char *filename, const char *bgmname);
|
|
rp::SGameScene *LoadMovie(rp::SGameSceneSeqPlayer* pScenePlayer, const char *scenename, const char *filename, const char *bgmname, const char *drawmode);
|
|
|
|
void SetActGameCount( int nActGameCount ) { m_nActGameCount = nActGameCount; }
|
|
|
|
int GetActGameCount() { return m_nActGameCount; }
|
|
|
|
protected:
|
|
void Init();
|
|
void Destroy();
|
|
|
|
void initLogoModel();
|
|
void destroyLogoModel();
|
|
void initLoadModel();
|
|
void destroyLoadModel();
|
|
void DestroyMovie();
|
|
|
|
XBossWorker m_ThreadManager; ///< 스레드 처리 관리자
|
|
typedef std::vector<SGameThread*> SGAMETHREADLIST;
|
|
SGAMETHREADLIST m_vGameThreadList;
|
|
|
|
SGAMETHREADLIST m_vDelGameThreadList;
|
|
|
|
DWORD m_dwGapTime;
|
|
DWORD m_dwStartTime;
|
|
float m_fVisibiity;
|
|
int m_nStep;
|
|
|
|
KSeqModel * m_pModel1;
|
|
|
|
|
|
SGame * m_pLoadGame;
|
|
|
|
bool m_bFirstLoad;
|
|
|
|
class SGameQJTV* m_pGameQJTV;
|
|
bool m_bStopLogoIntroRender;
|
|
bool m_bIntroStart;
|
|
|
|
rp::SGameSceneManager* m_pSceneMgr;
|
|
rp::SGameSceneIPtr m_ScenePlayer;
|
|
|
|
DWORD m_dwOldTime;
|
|
|
|
int m_nActGameCount;
|
|
}; |