Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vdu.h
Go to the documentation of this file.
1 #ifndef _GFX_VDU_H_
2 #define _GFX_VDU_H_
3 
4 #include "cockpit_generic.h"
5 #include "cmd/unit_generic.h"
6 #include "sprite.h"
7 #include <string>
8 #include <vector>
9 
10 class Unit;
11 class TextPlane;
12 
13 void DrawObjectivesTextPlane( TextPlane *tp, int scrolloffset, Unit *parent );
14 
20 class GameCockpit;
21 class VDU : public VSSprite
22 {
23 private:
24  class Animation*comm_ani;
25  UnitContainer communicating;
26  class Animation*webcam;
27  VIEWSTYLE viewStyle;
28  float *StartArmor;
29  float *maxhull;
31  TextPlane *tp;
33  unsigned int posmodes;
35  std::vector< unsigned int >thismode;
37  short rows, cols;
38  bool got_target_info;
39 //We received a packet with taret data by network : we update then the concerned UNIT
40 //DrawVDUObjective is outdated
41 //int DrawVDUObjective (void * obj, int offset);//obj is of type Mission::Objective
42  bool SetWebcamAnimation();
43  void DrawWebcam( Unit *parent );
45  void DrawVDUObjectives( Unit *parent );
47  void DrawVDUShield( Unit *parent );
49  void DrawTarget( GameCockpit *parentcp, Unit *parent, Unit *target );
51  void DrawManifest( Unit *parent, Unit *target );
53  void DrawMessages( GameCockpit *parentcp, Unit *target );
54  void DrawScanningMessage();
56  void DrawNav( GameCockpit *parentcp, Unit *parent, Unit *target, const Vector &navPoint );
58  void DrawComm();
60  void DrawSanningMessage();
62  void DrawDamage( Unit *parent );
64  void DrawWeapon( Unit *parent );
66  void DrawTargetSpr( VSSprite *s, float percent, float &x, float &y, float &w, float &h );
68  void DrawStarSystemAgain( float x, float y, float w, float h, VIEWSTYLE viewStyle, Unit *parent, Unit *target );
69 public:
71  {
72  got_target_info = true;
73  }
74  bool staticable() const;
75  unsigned int getMode() const
76  {
77  return thismode.back();
78  }
81  enum VDU_MODE
82  {
83  TARGET=0x1, NAV=0x2, OBJECTIVES=0x4, COMM=0x8, WEAPON=0x10, DAMAGE=0x20, SHIELD=0x40, MANIFEST=0x80,
84  TARGETMANIFEST=0x100, VIEW=0x200, MSG=0x400, SCANNING=0x800, NETWORK=0x1000, WEBCAM=0x2000
85  };
86  VDU( const char *file, TextPlane *textp, unsigned short modes, short rows, short cols, float *MaxArmor, float *maxhull );
88  void Draw( GameCockpit *parentcp, Unit *parent, const GFXColor &c );
90  void SwitchMode( Unit *parent );
91  void SetViewingStyle( VIEWSTYLE vm );
92  void Scroll( int howmuch );
93  bool SetCommAnimation( Animation *ani, Unit *unit, bool force );
95  bool CheckCommAnimation( Unit *un ) const; //returns true if unit is talkin or uninterruptable going on
96 };
97 
98 int parse_vdu_type( const char *s );
99 
100 GFXColor colLerp( GFXColor a, GFXColor b, float bweight );
101 GFXColor MountColor( Mount *mnt );
102 #endif
103