Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
WepView.h
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: WepView.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  View class for Tactical HUD Overlay
13 */
14 
15 #ifndef WepView_h
16 #define WepView_h
17 
18 #include "Types.h"
19 #include "View.h"
20 #include "Projector.h"
21 #include "Bitmap.h"
22 #include "Font.h"
23 #include "System.h"
24 #include "SimObject.h"
25 
26 // +--------------------------------------------------------------------+
27 
28 class Graphic;
29 class Sprite;
30 class Ship;
31 class Contact;
32 class HUDView;
33 
34 // +--------------------------------------------------------------------+
35 
36 class WepView : public View,
37 public SimObserver
38 {
39 public:
40  WepView(Window* c);
41  virtual ~WepView();
42 
43  // Operations:
44  virtual void Refresh();
45  virtual void OnWindowMove();
46  virtual void ExecFrame();
47  virtual void SetOverlayMode(int mode);
48  virtual int GetOverlayMode() const { return mode; }
49  virtual void CycleOverlayMode();
50 
51  virtual void RestoreOverlay();
52 
53  virtual bool Update(SimObject* obj);
54  virtual const char* GetObserverName() const;
55 
56  static WepView* GetInstance() { return wep_view; }
57  static void SetColor(Color c);
58 
59  static bool IsMouseLatched();
60 
61 protected:
62  void DrawOverlay();
63 
64  void DoMouseFrame();
65  bool CheckButton(int index, int x, int y);
66  void CycleSubTarget(int direction);
67 
68  int mode;
71  int width, height, aw, ah;
72  double xcenter, ycenter;
73 
74  Sim* sim;
78 
79  enum { MAX_WEP = 4, MAX_BTN = 16 };
81 
83 
84  static WepView* wep_view;
85 };
86 
87 #endif WepView_h
88