From: <mag...@us...> - 2010-09-17 12:00:34
|
Revision: 131 http://thezombieengine.svn.sourceforge.net/thezombieengine/?rev=131&view=rev Author: magarcias Date: 2010-09-17 12:00:27 +0000 (Fri, 17 Sep 2010) Log Message: ----------- Code cleanup Modified Paths: -------------- branches/demos/inc/shootem/nshootemstate.h branches/demos/src/shootem/nshootemstate.cc branches/demos/src/shootem/nshootemstate_player.cc Modified: branches/demos/inc/shootem/nshootemstate.h =================================================================== --- branches/demos/inc/shootem/nshootemstate.h 2010-09-17 11:48:19 UTC (rev 130) +++ branches/demos/inc/shootem/nshootemstate.h 2010-09-17 12:00:27 UTC (rev 131) @@ -75,7 +75,7 @@ //player path void InitPlayerPath(); void DrawPlayerPath(); - void SnapToPath(vector3& pos, vector3& rot); + void SnapToPath(vector3& pos); nArray<vector3> playerPath; int currentWaypoint; float fMaxDistanceToPath; Modified: branches/demos/src/shootem/nshootemstate.cc =================================================================== --- branches/demos/src/shootem/nshootemstate.cc 2010-09-17 11:48:19 UTC (rev 130) +++ branches/demos/src/shootem/nshootemstate.cc 2010-09-17 12:00:27 UTC (rev 131) @@ -117,6 +117,9 @@ //find the player path this->InitPlayerPath(); + //hide the cursor + nGfxServer2::Instance()->SetCursorVisibility( nGfxServer2::None ); + //common behavior nCommonState::OnStateEnter(prevState); } @@ -128,6 +131,9 @@ void nShootemState::OnStateLeave( const nString & nextState ) { + //show the cursor + nGfxServer2::Instance()->SetCursorVisibility( nGfxServer2::System ); + this->refViewport->SetVisible(false); nCommonState::OnStateLeave( nextState ); @@ -181,6 +187,11 @@ this->refViewport->SetTime(this->app->GetTime()); this->refViewport->Trigger(); + //move the cursor back + const nDisplayMode2 & mode = nGfxServer2::Instance()->GetDisplayMode(); + nGfxServer2::Instance()->SetCursorPosition( + mode.GetXPos() + ( mode.GetWidth() >> 1 ) , mode.GetYPos() + ( mode.GetHeight() >> 1 ) ); + nCommonState::OnFrame(); } Modified: branches/demos/src/shootem/nshootemstate_player.cc =================================================================== --- branches/demos/src/shootem/nshootemstate_player.cc 2010-09-17 11:48:19 UTC (rev 130) +++ branches/demos/src/shootem/nshootemstate_player.cc 2010-09-17 12:00:27 UTC (rev 131) @@ -138,7 +138,7 @@ //adjust to path vector3 cameraRot; - this->SnapToPath( this->playerPos, cameraRot ); + this->SnapToPath( this->playerPos ); float diffAngle = playerRot.y - this->playerRot.y; float angle = n_clamp(diffAngle, -angleSpace, angleSpace); this->playerRot.y += angle; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |