Jump to content

Streamline for Ai Pose Removing ShapeBase


Steve_Yorkshire

Recommended Posts

Whilst browsing through the current dev branch I noticed my old AiPoses resource which I had asked someone to pull. I also noticed that originally I'd use ShapeBase to store the mAiPose var, and thought that it could probably be streamlined to be removed from ShapeBase.cpp/h and incorporated into Player.cpp/h.


ShapeBase.h

//...
   //S32 mAiPose;                     ///< Current pose.//REMOVED LINE 892
   F32 mEnergy;                     ///< Current enery level.
F32 mRechargeRate; ///< Energy recharge rate (in units/tick).
//...

 

ShapeBase.cpp

//...
ShapeBase::ShapeBase()
 : mDataBlock( NULL ),
   mIsAiControlled( false ),
   mControllingObject( NULL ),
   //mAiPose( 0 ),//REMOVED LINE 989
mMoveMotion( false ),
//...

 

And move them over to Player.


Player.h

//...
   void allowProne(bool state) { mAllowProne = state; }
   void allowSwimming(bool state) { mAllowSwimming = state; }
   S32 mAiPose; //ADDED ~LINE 733
   bool canJump();                                         ///< Can the player jump?
   bool canJetJump(); ///< Can the player jet?
//...

 

Player.cpp

//...
   dMemset( mSplashEmitter, 0, sizeof( mSplashEmitter ) );
 
   mUseHeadZCalc = true;
   mAiPose = 0; //ADDED ~LINE 1623
   allowAllPoses();
 
mImpactSound = 0;
//...

 

And all seems to work as before using Player/AiPlayer.cpp/h but no longer using ShapeBase.cpp/h.


There is no real extra benefit - beyond freeing up an already crowded shapeBase - to doing things this way ... except autism and OCD, but hey :roll:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...