home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 March / Gamestar_82_2006-03_dvd.iso / DVDStar / Editace / quake4_sdkv10.exe / source / game / PlayerView.h < prev    next >
C/C++ Source or Header  |  2005-11-14  |  4KB  |  147 lines

  1. // RAVEN BEGIN
  2. // bdube: note that this file is no longer merged with Doom3 updates
  3. //
  4. // MERGE_DATE 07/07/2004
  5.  
  6. #ifndef __GAME_PLAYERVIEW_H__
  7. #define __GAME_PLAYERVIEW_H__
  8.  
  9. /*
  10. ===============================================================================
  11.  
  12.   Player view.
  13.  
  14. ===============================================================================
  15. */
  16.  
  17. // screenBlob_t are for the on-screen damage claw marks, etc
  18. typedef struct {
  19.     const idMaterial *    material;
  20.     float                x, y, w, h;
  21.     float                s1, t1, s2, t2;
  22.     int                    finishTime;
  23.     int                    startFadeTime;
  24.     float                driftAmount;
  25. } screenBlob_t;
  26.  
  27. #define    MAX_SCREEN_BLOBS    8
  28.  
  29. class idPlayerView {
  30. public:
  31.                         idPlayerView();
  32.  
  33.     void                Save( idSaveGame *savefile ) const;
  34.     void                Restore( idRestoreGame *savefile );
  35.  
  36.     void                SetPlayerEntity( class idPlayer *playerEnt );
  37.  
  38.     void                ClearEffects( void );
  39.  
  40. // RAVEN BEGIN
  41. // jnewquist: Controller rumble
  42.     void                DamageImpulse( idVec3 localKickDir, const idDict *damageDef, int damage );
  43. // RAVEN END
  44.  
  45.     void                WeaponFireFeedback( const idDict *weaponDef );
  46.  
  47.     idAngles            AngleOffset( void ) const;            // returns the current kick angle
  48.  
  49. // RAVEN BEGIN
  50. // jnewquist: Controller rumble
  51.     float                CalculateShake( idAngles &shakeAngleOffset ) const;
  52. // RAVEN END
  53.  
  54. // RAVEN BEGIN
  55. // jscott: for screen shake
  56.     void                ShakeOffsets( idVec3 &shakeOffset, idAngles &shakeAngleOffset, const idBounds bounds ) const;
  57. // RAVEN END
  58.  
  59.     // adds little entities to the renderer for local blood blobs, etc
  60.  
  61.     // this may involve rendering to a texture and displaying
  62.     // that with a warp model or in double vision mode
  63.     void                RenderPlayerView( idUserInterface *hud );
  64.  
  65.     void                Fade( idVec4 color, int time );
  66.  
  67.     void                Flash( idVec4 color, int time );
  68.  
  69.     void                AddBloodSpray( float duration );
  70.  
  71.     // temp for view testing
  72.     void                EnableBFGVision( bool b ) { bfgVision = b; };
  73.  
  74. // RAVEN BEGIN
  75. // jscott: accessors required for the fx system
  76.     void                SetDoubleVisionParms( float time, float scale ) { dvFinishTime = SEC2MS( time ); dvScale = scale; }
  77.     void                SetShakeParms( float time, float scale ) { shakeFinishTime = SEC2MS( time ); shakeScale = scale; }
  78.     void                SetTunnelParms( float time, float scale ) { tvStartTime = gameLocal.time; tvFinishTime = tvStartTime + time; tvScale = 1.0f / scale; }
  79.  
  80. // jnewquist: implement rumble for consoles
  81.     void                Rumble( int left, int right, int time ) const;
  82. // RAVEN END
  83.  
  84. private:
  85. // RAVEN BEGIN
  86. // AReis: Modified SingleView() signature to include renderFlags variable.
  87.     void                SingleView( idUserInterface *hud, const renderView_t *view, int renderFlags = RF_NORMAL );
  88. // RAVEN END
  89.     void                DoubleVision( idUserInterface *hud, const renderView_t *view, int offset );
  90.     void                BerserkVision( idUserInterface *hud, const renderView_t *view );
  91.     void                InfluenceVision( idUserInterface *hud, const renderView_t *view );
  92.     void                ScreenFade();
  93.  
  94.     screenBlob_t *        GetScreenBlob();
  95.  
  96.     screenBlob_t        screenBlobs[MAX_SCREEN_BLOBS];
  97.  
  98.     int                    dvFinishTime;        // double vision will be stopped at this time
  99.     const idMaterial *    dvMaterial;            // material to take the double vision screen shot
  100. // RAVEN BEGIN
  101. // jscott: to make double vision work with alpha components
  102.     const idMaterial *    dvMaterialBlend;
  103. // jscott: for effects
  104.     float                dvScale;
  105. // RAVEN END
  106.  
  107.     int                    kickFinishTime;        // view kick will be stopped at this time
  108.     idAngles            kickAngles;            
  109.  
  110.     bool                bfgVision;            // 
  111.  
  112.     const idMaterial *    tunnelMaterial;        // health tunnel vision
  113.     const idMaterial *    armorMaterial;        // armor damage view effect
  114. // RAVEN BEGIN
  115. // bdube: not using these
  116. //    const idMaterial *    berserkMaterial;    // berserk effect
  117. //    const idMaterial *    irGogglesMaterial;    // ir effect
  118.     const idMaterial *    bloodSprayMaterial; // blood spray
  119. //    const idMaterial *    bfgMaterial;        // when targeted with BFG
  120. // RAVEN END
  121.     const idMaterial *    lagoMaterial;        // lagometer drawing
  122.  
  123.     float                lastDamageTime;        // accentuate the tunnel effect for a while
  124.  
  125. // RAVEN BEGIN
  126. // jscott: for effects
  127.     float                shakeFinishTime;
  128.     float                shakeScale;
  129.     float                tvScale;
  130.     int                    tvFinishTime;
  131.     int                    tvStartTime;
  132. // RAVEN END
  133.  
  134.     idVec4                fadeColor;            // fade color
  135.     idVec4                fadeToColor;        // color to fade to
  136.     idVec4                fadeFromColor;        // color to fade from
  137.     float                fadeRate;            // fade rate
  138.     int                    fadeTime;            // fade time
  139.  
  140.     idPlayer *            player;
  141.     renderView_t        view;
  142. };
  143.  
  144. #endif /* !__GAME_PLAYERVIEW_H__ */
  145.  
  146. // RAVEN END
  147.