-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavigation.h
83 lines (62 loc) · 1.87 KB
/
navigation.h
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
#ifndef NAVIGATION_H
#define NAVIGATION_H
#include "SDL/SDL.h"
#include "submarine.h"
#include "helicopter.h"
#include "widget.h"
#define MAP_FACTOR 20
#define MAX_MAP_SCALE 500
class Navigation
{
public:
Navigation();
~Navigation();
void setShips(Submarine *Subs, Submarine *torpedoes, Helicopter *helicopters);
void setDepthMap(MAP *my_map);
void InitGraphics(SDL_Surface *screen);
void LoadWidgets();
void UnLoadWidgets();
void DisplayWidgets();
void MapIcon(int x, int y, int ShipType, int Friend, Uint32 color);
void DirectionalPointer(int X, int Y, int Heading, int speed, Uint32 Color);
void PlaceShips(Submarine *target = NULL);
void DrawMap(Submarine *current_target);
void Display_Target(Submarine *current_target);
void UpdateDisplay(Submarine *current_target);
void ToggleMapCenter();
void IncreaseMapScale();
void DecreaseMapScale();
void ScrollMapUp(int change_scrolly);
void ScrollMapDown(int change_scrolly);
void ScrollMapLeft(int change_scrollx);
void ScrollMapRight(int change_scrollx);
private:
Submarine *Subs;
Submarine *torpedoes;
Helicopter *helicopters;
// Depth map with thermal layers
MAP *my_map;
int mapcenter;
int mapscale;
int scrolloffsetx; // offset to center map
int scrolloffsety;
SDL_Surface *screen;
Widget mapconsole;
Widget centerbuttonup;
Widget centerbuttondown;
Widget leftbuttonup;
Widget leftbuttondown;
Widget rightbuttonup;
Widget rightbuttondown;
Widget upbuttonup;
Widget upbuttondown;
Widget downbuttonup;
Widget downbuttondown;
Widget plusbuttonup;
Widget plusbuttondown;
Widget minusbuttonup;
Widget minusbuttondown;
Uint32 black, white, red, dark_red, green, dark_green, yellow, brown;
Uint32 grey, dark_grey, mapcolor;
};
#endif // NAVIGATION_H