diff --git a/source/game/game.cpp b/source/game/game.cpp index 29fb24d2b..127d91039 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -107,8 +107,6 @@ SpriteBank *CGameScene::s_GlobalSpritebank; CLayerCollision *CGameScene::s_GlobalCollision; CHealthManager *CGameScene::m_HealthManager; -MATRIX CGameScene::CamMtx; - /*****************************************************************************/ CGameScene::ACTOR_TYPE CGameScene::actorType[40] = { @@ -186,9 +184,11 @@ CGameScene GameScene; void CGameScene::init() { // Setup Constant Camera Matrix - SetIdentTrans(&CamMtx,0,0,RenderZ); - SetGeomScreen(RenderZ); - SetTransMatrix(&CamMtx); +// SetIdentTrans(&CamMtx,0,0,RenderZ); +// SetGeomScreen(RenderZ); +// SetTransMatrix(&CamMtx); + + setCameraMtx(); s_genericFont=new ("CGameScene::Init") FontBank(); s_genericFont->initialise( &standardFont ); @@ -336,10 +336,11 @@ void CGameScene::render_playing() CConversation::render(); CThingManager::renderAllThings(); - SetIdentTrans(&CamMtx,0,0,RenderZ); - SetGeomScreen(RenderZ); - SetRotMatrix(&CamMtx); - SetTransMatrix(&CamMtx); + setCameraMtx(); +// SetIdentTrans(&CamMtx,0,0,RenderZ); +// SetGeomScreen(RenderZ); +// SetRotMatrix(&CamMtx); +// SetTransMatrix(&CamMtx); Level.render(); m_HealthManager->render(); @@ -765,3 +766,14 @@ void CGameScene::thinkCameraShake(int _frames) } } + +/*****************************************************************************/ +void CGameScene::setCameraMtx() +{ +MATRIX CamMtx; + SetIdentTrans(&CamMtx,0,0,RenderZ); + SetGeomScreen(RenderZ); + SetRotMatrix(&CamMtx); + SetTransMatrix(&CamMtx); + +} diff --git a/source/game/game.h b/source/game/game.h index 891083343..2a4955480 100644 --- a/source/game/game.h +++ b/source/game/game.h @@ -57,8 +57,6 @@ static void restartlevel() {s_restartLevel=true;} CLevel &GetLevel() {return(Level);} - -// static MATRIX &GetCamMtx() {return(CamMtx);} static ACTOR_TYPE getActorType( int actorNum ) {return actorType[actorNum];} static void setBossHasBeenKilled() {s_bossHasBeenKilled=true;} @@ -70,6 +68,8 @@ static void dropHealth(DVECTOR &Pos,int Amount,int Vel); static void setCameraShake(s16 X,s16 Y); static void shakeCamera(DVECTOR &CamPos); void thinkCameraShake(int _frames); + +static void setCameraMtx(); private: typedef enum { @@ -109,7 +109,6 @@ class CPlayer *m_player; static CHealthManager *m_HealthManager; static FontBank *s_genericFont; class ScalableFontBank *m_scalableFont; -static MATRIX CamMtx; static int s_restartLevel; static int s_readyToExit;