[Opentnl-cvs] tnl/zap UIGame.cpp,1.23,1.24 ship.cpp,1.27,1.28 ship.h,1.16,1.17 winJoystick.cpp,1.9,1
Brought to you by:
mark_frohnmayer,
s_alanet
From: Ben G. <s_a...@us...> - 2004-05-12 21:08:42
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12876/zap Modified Files: UIGame.cpp ship.cpp ship.h winJoystick.cpp Log Message: Fixed trail emission issues. Relative mouse control turns off mouse locking. Index: ship.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ship.h 11 May 2004 18:26:25 -0000 1.16 --- ship.h 12 May 2004 21:08:25 -0000 1.17 *************** *** 78,81 **** --- 78,82 ---- SFXHandle mTurboNoise; + U32 mSparkElapsed; S32 mLastTrailPoint[TrailCount]; fxTrail mTrail[TrailCount]; *************** *** 97,101 **** void burnEnergy(U32 dT); ! void emitMovementSparks(); void emitShipExplosion(Point pos); --- 98,102 ---- void burnEnergy(U32 dT); ! void emitMovementSparks(U32 deltaT); void emitShipExplosion(Point pos); Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** UIGame.cpp 9 May 2004 20:41:05 -0000 1.23 --- UIGame.cpp 12 May 2004 21:08:25 -0000 1.24 *************** *** 136,146 **** #ifdef TNL_OS_WIN32 ! F32 len = mMousePoint.len(); ! checkMousePos(windowWidth * 100 / canvasWidth, ! windowHeight * 100 / canvasHeight); ! ! if(len > 100) ! realMousePoint *= 100 / len; #endif --- 136,148 ---- #ifdef TNL_OS_WIN32 + if(!OptionsMenuUserInterface::controlsRelative) + { + F32 len = mMousePoint.len(); + checkMousePos(windowWidth * 100 / canvasWidth, + windowHeight * 100 / canvasHeight); ! if(len > 100) ! realMousePoint *= 100 / len; ! } #endif Index: winJoystick.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/winJoystick.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** winJoystick.cpp 12 May 2004 01:56:42 -0000 1.9 --- winJoystick.cpp 12 May 2004 21:08:25 -0000 1.10 *************** *** 33,36 **** --- 33,37 ---- #include "point.h" #include "UI.h" + #include "UIMenus.h" #include "tnlJournal.h" *************** *** 43,46 **** --- 44,50 ---- void checkMousePos(S32 maxdx, S32 maxdy) { + if(OptionsMenuUserInterface::controlsRelative) + return; + char windowName[256]; Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ship.cpp 12 May 2004 19:35:12 -0000 1.27 --- ship.cpp 12 May 2004 21:08:25 -0000 1.28 *************** *** 254,263 **** return; - //mMoveState[RenderState] = mMoveState[ActualState]; updateInterpolation(theMove->time); lastMove = *theMove; // Emit some particles ! emitMovementSparks(); for(U32 i=0; i<TrailCount; i++) --- 254,262 ---- return; updateInterpolation(theMove->time); lastMove = *theMove; // Emit some particles ! emitMovementSparks(theMove->time); for(U32 i=0; i<TrailCount; i++) *************** *** 276,280 **** updateInterpolation(deltaT); // Emit some particles ! emitMovementSparks(); for(U32 i=0; i<TrailCount; i++) --- 275,279 ---- updateInterpolation(deltaT); // Emit some particles ! emitMovementSparks(deltaT); for(U32 i=0; i<TrailCount; i++) *************** *** 642,651 **** } ! void Ship::emitMovementSparks() { ! // Do nothing if we're under 0.001 vel if(hasExploded || mMoveState[ActualState].vel.len() < 0.1) return; Point corners[3]; Point shipDirs[3]; --- 641,655 ---- } ! void Ship::emitMovementSparks(U32 deltaT) { ! // Do nothing if we're under 0.1 vel if(hasExploded || mMoveState[ActualState].vel.len() < 0.1) return; + mSparkElapsed += deltaT; + + if(mSparkElapsed <= 32) + return; + Point corners[3]; Point shipDirs[3]; *************** *** 751,755 **** { // shoot some sparks... ! if(th >= 1*TNL::Random::readF() * velDir.len()) { Point chaos(TNL::Random::readF(),TNL::Random::readF()); --- 755,759 ---- { // shoot some sparks... ! if(th >= 0.2*velDir.len()) { Point chaos(TNL::Random::readF(),TNL::Random::readF()); *************** *** 758,762 **** //interp give us some nice enginey colors... Color dim(1, 0, 0); ! Color light(1, 1, 0); Color thrust; --- 762,766 ---- //interp give us some nice enginey colors... Color dim(1, 0, 0); ! Color light(1, 1, mTurbo ? 1.f : 0.f); Color thrust; |