File: esm.h

package info (click to toggle)
openssn 1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,340 kB
  • sloc: cpp: 10,973; makefile: 80
file content (105 lines) | stat: -rw-r--r-- 2,938 bytes parent folder | download | duplicates (3)
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
/***************************************************************************
                          esm.h  -  description
                             -------------------
    begin                : Sat Mar 16 2002
    copyright            : (C) 2002 by Michael Bridak
    email                : michael.bridak@verizon.net
$Id: esm.h,v 1.5 2003/04/14 05:51:03 mbridak Exp $
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License.     *
 *    .                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef ESM_H
#define ESM_H


/**
  *@author Michael Bridak
  */

class Esm {
public: 

	Submarine *Subs;	
	SDL_Rect src, dest;

	SDL_Surface *esmscreen;
	SDL_Surface *tempscreen;
	SDL_Surface *blip;
	SDL_Surface *sweep1;
	SDL_Surface *ClearEsm;
	SDL_Surface *ClearEsm2;

	Esm(Submarine *temp);
	~Esm();
	
	void RaiseMast(); // Raise esm mast
	void LowerMast(); // Lower esm mast
	void ToggleMast(); //Toggle Mast Status

	// Set functions
	void setRangeScale(int);  // How far do we want to look!
	void setRangeRing(int);   // Used on the display panel


	// Get functions
	bool getMastStatus() const;  // Get the current mast position
	int getAntennaHeight(int, int) const; // Get current mast height
	int getBearing(int, int, int, int);  // Get the Esm bearing
	int getSignalStrength(Submarine *, int, int, int, bool, int); // Get the Esm signal strength
	int getEsmHorizon(int, int, int);  // Get the Esm Horizon

	bool isTargetVisible(Submarine *, int TargetRange, int ObserverDepth,
			  int TargetHeight, bool TargetRadar, int SeaState);

	void ClearScreen();

	void LoadWidgets();

	void DisplayWidgets();

	void DisplayContacts();
	void InitGraphics(SDL_Surface *temp, SDL_Surface *tempradarscreen);
	void DLine(SDL_Surface *screen, int X1, int Y1, int X2, int Y2, Uint32 Color);
	void DPixel(SDL_Surface *screen, int x, int y, Uint32 color);


	private:
	SDL_Rect destination_rectangle;
	SDL_Rect source_rectangle;
	SDL_Surface *screen;

	SDL_Surface *mastdownoff;
	SDL_Surface *mastdownon;

	SDL_Surface *mastupoff;
	SDL_Surface *mastupon;

	SDL_Surface *styllus;


	bool Mast;
	int MastHeight;
	int CurrentAntennaHeight;
	int EsmHorizon;
	int bearing;
	int SignalStrength;
	int DetectProb;
	int x;
	int y;
	Uint32 orange, black;

	static char text[120];
	DFont largeFont(const char*, const char *);
	DFont fnt(const char*, const char *);
	DFont fnt2(const char*, const char *);
};

#endif