File: control.h

package info (click to toggle)
openssn 1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 7,340 kB
  • sloc: cpp: 10,973; makefile: 80
file content (115 lines) | stat: -rw-r--r-- 2,859 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
106
107
108
109
110
111
112
113
114
115
/***************************************************************************
                          control.h  -  description
                             -------------------
    begin                : Tue June 11 2002
    copyright            : (C) 2002 by Rick McDaniel
    email                : rickeym@swbell.net
$Id: control.h,v 1.3 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 CONTROL_H
#define CONTROL_H


/**
  *@author Rick McDaniel
  */

class Control {
 public: 
  Submarine *Subs;	
  
  SDL_Rect src, dest;
  
  SDL_Surface *controlscreen;
  SDL_Surface *tempscreen;

  SDL_Surface *ClearControl;
  
  Control(Submarine *temp);
  ~Control();
  
  bool A13, A23, ASTD, AFULL, AFLK;
  bool ASTOP, B13, B23, BSTD, BEMER;
  
  bool depthup, depthdown;

  void  InitGraphics(SDL_Surface *temp, SDL_Surface *tempcontrolscreen);
  
  void ClearHeading();
  void ClearOrdHeading();


  void ClearSpeed();
  void ClearOrdSpeed();
  
  void ClearDepth();
  void ClearOrdDepth();

  void LoadWidgets();
  
  void DisplayWidgets();
  
  void ToggleBEMER();
  void ToggleBSTD();
  void ToggleB23();
  void ToggleB13();
  void ToggleASTOP();
  void ToggleA13();
  void ToggleA23();
  void ToggleASTD();
  void ToggleAFULL();
  void ToggleAFLK();
  
  void Display();

  void AdjustHeading(int x, int y);

  void AdjustDepth(int x);
  
 // void DPixel(SDL_Surface *screen, int x, int y, Uint32 color);  //rdm not needed
  
 // void DLine(SDL_Surface *screen, int X1, int Y1, int X2, int Y2, Uint32 Color);  //rdm not needed
  
 private:
  
  SDL_Surface *screen;
  SDL_Surface *STOPoff;
  SDL_Surface *STOPon;
  SDL_Surface *A13off;
  SDL_Surface *A13on;
  SDL_Surface *A23off;
  SDL_Surface *A23on;
  SDL_Surface *ASTDoff;
  SDL_Surface *ASTDon;
  SDL_Surface *AFULLoff;
  SDL_Surface *AFULLon;
  SDL_Surface *AFLKoff;
  SDL_Surface *AFLKon;
  SDL_Surface *depthupoff;
  SDL_Surface *depthupon;
  SDL_Surface *depthdownoff;
  SDL_Surface *depthdownon;

  
  int x;
  int y;
  // Uint32 orange, green, black; //rdm 9/11 not needed
  
  static char text[120];
  DFont largeFont(const char*, const char *);
  DFont fnt(const char*, const char *);
  DFont fnt2(const char*, const char *);
  
};

#endif