summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/GameScreen.h
blob: 2424917c05ac6dd04437f46bcef4cea86c24c55e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/*  Starshatter: The Open Source Project
    Copyright (c) 2021-2024, Starshatter: The Open Source Project Contributors
    Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors
    Copyright (c) 1997-2006, Destroyer Studios LLC.

    AUTHOR:       John DiCamillo

*/

#ifndef GameScreen_h
#define GameScreen_h

#include "Types.h"
#include "Bitmap.h"
#include "Screen.h"
#include "BaseScreen.h"

// +--------------------------------------------------------------------+

class Screen;
class Sim;
class Window;
class Font;

class NavDlg;
class EngDlg;
class FltDlg;
class CtlDlg;
class JoyDlg;
class KeyDlg;
class ModDlg;
class ModInfoDlg;

class CameraDirector;
class DisplayView;
class HUDView;
class WepView;
class QuantumView;
class QuitView;
class RadioView;
class TacticalView;
class CameraView;
class PolyRender;
class Bitmap;
class DataLoader;
class Video;
class VideoFactory;

// +--------------------------------------------------------------------+

class GameScreen : public BaseScreen
{
public:
    GameScreen();
    virtual ~GameScreen();

    virtual void         Setup(Screen* screen);
    virtual void         TearDown();
    virtual bool         CloseTopmost();

    virtual bool         IsShown()         const { return isShown; }
    virtual void         Show();
    virtual void         Hide();

    virtual bool         IsFormShown()     const;
    virtual void         ShowExternal();

    virtual void         ShowNavDlg();
    virtual void         HideNavDlg();
    virtual bool         IsNavShown();
    virtual NavDlg*      GetNavDlg()             { return navdlg; }

    virtual void         ShowEngDlg();
    virtual void         HideEngDlg();
    virtual bool         IsEngShown();
    virtual EngDlg*      GetEngDlg()             { return engdlg; }

    virtual void         ShowFltDlg();
    virtual void         HideFltDlg();
    virtual bool         IsFltShown();
    virtual FltDlg*      GetFltDlg()             { return fltdlg; }

    virtual void         ShowCtlDlg();
    virtual void         HideCtlDlg();
    virtual bool         IsCtlShown();

    virtual void         ShowJoyDlg();
    virtual bool         IsJoyShown();

    virtual void         ShowKeyDlg();
    virtual bool         IsKeyShown();


    virtual AudDlg*      GetAudDlg() const { return auddlg; }
    virtual VidDlg*      GetVidDlg() const { return viddlg; }
    virtual OptDlg*      GetOptDlg() const { return optdlg; }
    virtual CtlDlg*      GetCtlDlg() const { return ctldlg; }
    virtual JoyDlg*      GetJoyDlg() const { return joydlg; }
    virtual KeyDlg*      GetKeyDlg() const { return keydlg; }
    virtual ModDlg*      GetModDlg() const { return moddlg; }
    virtual ModInfoDlg*  GetModInfoDlg() const { return modInfoDlg; }

    virtual void         ShowAudDlg();
    virtual void         HideAudDlg();
    virtual bool         IsAudShown();

    virtual void         ShowVidDlg();
    virtual void         HideVidDlg();
    virtual bool         IsVidShown();

    virtual void         ShowOptDlg();
    virtual void         HideOptDlg();
    virtual bool         IsOptShown();

    virtual void         ShowModDlg();
    virtual void         HideModDlg();
    virtual bool         IsModShown();

    virtual void         ShowModInfoDlg();
    virtual void         HideModInfoDlg();
    virtual bool         IsModInfoShown();

    virtual void         ApplyOptions();
    virtual void         CancelOptions();

    virtual void         ShowWeaponsOverlay();
    virtual void         HideWeaponsOverlay();

    void                 SetFieldOfView(double fov);
    double               GetFieldOfView() const;
    void                 CycleMFDMode(int mfd);
    void                 CycleHUDMode();
    void                 CycleHUDColor();
    void                 CycleHUDWarn();
    void                 FrameRate(double f);
    void                 ExecFrame();

    static GameScreen*   GetInstance()           { return game_screen; }
    CameraView*          GetCameraView()   const { return cam_view; }
    Bitmap*              GetLensFlare(int index);

private:
    void                 HideAll();

    Sim*                 sim;
    Screen*              screen;

    Window*              gamewin;
    NavDlg*              navdlg;
    EngDlg*              engdlg;
    FltDlg*              fltdlg;
    CtlDlg*              ctldlg;
    KeyDlg*              keydlg;
    JoyDlg*              joydlg;
    AudDlg*              auddlg;
    VidDlg*              viddlg;
    OptDlg*              optdlg;
    ModDlg*              moddlg;
    ModInfoDlg*          modInfoDlg;

    Font*                HUDfont;
    Font*                GUIfont;
    Font*                GUI_small_font;
    Font*                title_font;

    Bitmap*              flare1;
    Bitmap*              flare2;
    Bitmap*              flare3;
    Bitmap*              flare4;

    CameraDirector*      cam_dir;
    DisplayView*         disp_view;
    HUDView*             hud_view;
    WepView*             wep_view;
    QuantumView*         quantum_view;
    QuitView*            quit_view;
    TacticalView*        tac_view;
    RadioView*           radio_view;
    CameraView*          cam_view;
    DataLoader*          loader;

    double               frame_rate;
    bool                 isShown;

    static GameScreen*   game_screen;
};

// +--------------------------------------------------------------------+

#endif  // GameScreen_h