Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Mfd.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: MFD.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Class for all Multi Function Displays
13
*/
14
15
#ifndef MFD_h
16
#define MFD_h
17
18
#include "
Types.h
"
19
#include "
Geometry.h
"
20
#include "
Color.h
"
21
#include "
HUDView.h
"
22
23
// +--------------------------------------------------------------------+
24
25
class
Contact
;
26
class
Ship
;
27
class
Sprite
;
28
class
Window
;
29
30
// +--------------------------------------------------------------------+
31
32
class
MFD
33
{
34
public
:
35
enum
Modes
{
MFD_MODE_OFF
,
MFD_MODE_GAME
,
MFD_MODE_SHIP
,
36
MFD_MODE_FOV
,
/*MFD_MODE_FWD, MFD_MODE_MAP,*/
37
MFD_MODE_HSD
,
MFD_MODE_3D
38
};
39
40
MFD
(
Window
* c,
int
index
);
41
virtual
~MFD
();
42
43
int
operator ==
(
const
MFD
& that)
const
{
return
this
== &that; }
44
45
static
void
Initialize
();
46
static
void
Close
();
47
static
void
SetColor
(
Color
c);
48
49
// Operations:
50
virtual
void
Draw
();
51
virtual
void
DrawGameMFD
();
52
virtual
void
DrawStatusMFD
();
53
virtual
void
DrawSensorMFD
();
54
virtual
void
DrawHSD
();
55
virtual
void
Draw3D
();
56
virtual
void
DrawSensorLabels
(
const
char
* mfd_mode);
57
virtual
void
DrawMap
();
58
virtual
void
DrawGauge
(
int
x,
int
y,
int
percent);
59
virtual
void
SetStatusColor
(
int
status);
60
61
virtual
void
SetWindow
(
Window
* w) {
window
= w; }
62
virtual
Window
*
GetWindow
() {
return
window
; }
63
virtual
void
SetRect
(
const
Rect
& r);
64
virtual
const
Rect
&
GetRect
()
const
{
return
rect
; }
65
virtual
void
SetMode
(
int
m);
66
virtual
int
GetMode
()
const
{
return
mode
; }
67
virtual
Sprite
*
GetSprite
() {
return
sprite
; }
68
69
virtual
void
SetShip
(
Ship
* s) {
ship
= s; }
70
virtual
Ship
*
GetShip
() {
return
ship
; }
71
72
virtual
void
Show
();
73
virtual
void
Hide
();
74
75
virtual
void
UseCameraView
(
CameraView
* v);
76
void
DrawMFDText
(
int
index
,
const
char
* txt,
Rect
& r,
int
align,
int
status=-1);
77
void
HideMFDText
(
int
index
);
78
void
SetText3DColor
(
Color
c);
79
void
SetCockpitHUDTexture
(
Bitmap
* bmp) {
cockpit_hud_texture
= bmp; }
80
81
bool
IsMouseLatched
()
const
;
82
83
protected
:
84
85
enum
{
TXT_LAST
=20 };
86
87
Window
*
window
;
88
Rect
rect
;
89
int
index
;
90
int
mode
;
91
int
lines
;
92
Sprite
*
sprite
;
93
bool
hidden
;
94
Ship
*
ship
;
95
HUDText
mfd_text
[
TXT_LAST
];
96
CameraView
*
camview
;
97
Bitmap
*
cockpit_hud_texture
;
98
99
int
mouse_latch
;
100
bool
mouse_in
;
101
};
102
103
#endif MFD_h
104
Stars45
Mfd.h
Generated on Tue Jun 5 2012 20:46:57 for Starshatter_Open by
1.8.1