Debian Codegraph @

src/control.cpp

raw symbols SCIP
1 /***************************************************************************
2 control.cpp - description
3 -------------------
4 begin : Tue June 11 2002
5 copyright : (C) 2002 by Rick McDaniel
6 email : [email protected]
7 $Id: control.cpp,v 1.3 2003/04/20 19:30:29 anoncvs_pygsl Exp $
8 ***************************************************************************/
9
10 /***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License. *
15 * . *
16 * *
17 ***************************************************************************/
18 #include <string>
19 #include "SDL/SDL.h"
20 #include "SDL/SDL_image.h"
21 #include "SDL/SDL_thread.h"
22 #include "SDL/SDL_gfxPrimitives.h" //rdm 9/11
23 #include "dfont.h"cxx . . $ `<file>/src/dfont.h`/
24 #include "submarine.h"cxx . . $ `<file>/src/submarine.h`/
25 #include "files.h"cxx . . $ `<file>/src/files.h`/
26
27 #include "control.h"cxx . . $ `<file>/src/control.h`/
28 #include "dstack.h"cxx . . $ `<file>/src/dstack.h`/
29 #include <cmath>
30 #include <cstdlib>
31
32 #include <iostream>
33 using namespace std;
34
35 // Use these for the display
36 DStackcxx . . $ DStack# HeadingStackcxx . . $ HeadingStack., SpeedStackcxx . . $ SpeedStack., DepthStackcxx . . $ DepthStack.;
37
38 // Used to remember last ordered heading, to clear display.
39 float old_headingcxx . . $ old_heading.;
40
41
42 Controlcxx . . $ Control#::Controlcxx . . $ Control#Control(a9ab5cc9dc811b12).(Submarinecxx . . $ Submarine# *temp): Subscxx . . $ Control#Subs.(temp)
43 {
44 // Default Values
45 BEMERcxx . . $ Control#BEMER. = false;
46 BSTDcxx . . $ Control#BSTD. = false;
47 B23cxx . . $ Control#B23. = false;
48 B13cxx . . $ Control#B13. = false;
49 ASTOPcxx . . $ Control#ASTOP. = false;
50 A13cxx . . $ Control#A13. = true;
51 A23cxx . . $ Control#A23. = false;
52 ASTDcxx . . $ Control#ASTD. = false;
53 AFULLcxx . . $ Control#AFULL. = false;
54 AFLKcxx . . $ Control#AFLK. = false;
55 depthupcxx . . $ Control#depthup. = false;
56 depthdowncxx . . $ Control#depthdown. = false;
57 }
58
59 Controlcxx . . $ Control#::~cxx . . $ Control#`~Control`(ced63f7c635d850d).Controlcxx . . $ Control#(){
60 }
61
62 void Controlcxx . . $ Control#::InitGraphicscxx . . $ Control#InitGraphics(fac4f6e207c3be86).(SDL_Surface *temp, SDL_Surface *tempcontrolscreen)
63 {
64 screencxx . . $ Control#screen.=temp;
65 controlscreencxx . . $ Control#controlscreen.=tempcontrolscreen;
66
67 temp = SDL_CreateRGBSurface(SDL_SWSURFACEcxx . . $ `<external>/3508485105195885937/SDL_video.h:229:9`!, 420, 490, 16,
68 screencxx . . $ Control#screen.->format->Rmask,
69 screencxx . . $ Control#screen.->format->Gmask,
70 screencxx . . $ Control#screen.->format->Bmask,
71 screencxx . . $ Control#screen.->format->Amask);
72 tempscreencxx . . $ Control#tempscreen.=SDL_DisplayFormat(temp);
73 SDL_FreeSurface(temp);
74
75 LoadWidgetscxx . . $ Control#LoadWidgets(49f6e7a06ebc5aa8).();
76 DisplayWidgetscxx . . $ Control#DisplayWidgets(49f6e7a06ebc5aa8).();
77
78 // orange = SDL_MapRGB(screen->format, 238, 118, 0); //rdm 9/11 not needed
79 // green = SDL_MapRGB(screen->format, 0, 128, 0);
80 // black = SDL_MapRGB(screen->format, 0, 0, 0);
81
82 }
83
84 void Controlcxx . . $ Control#::LoadWidgetscxx . . $ Control#LoadWidgets(49f6e7a06ebc5aa8).(){
85 SDL_Surface *temp;
86
87 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/STOPoff.png");
88 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) STOPoffcxx . . $ Control#STOPoff. = SDL_DisplayFormat(temp);
89 if ( STOPoffcxx . . $ Control#STOPoff. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
90 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
91 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
92 SDL_Quit();
93 exitcxx . . $ exit(44ed87f96534fad7).(0);
94 }
95 SDL_FreeSurface(temp);
96
97 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/STOPon.png");
98 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) STOPoncxx . . $ Control#STOPon. = SDL_DisplayFormat(temp);
99 if ( STOPoncxx . . $ Control#STOPon. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
100 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
101 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
102 SDL_Quit();
103 exitcxx . . $ exit(44ed87f96534fad7).(0);
104 }
105 SDL_FreeSurface(temp);
106
107 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/A13off.png");
108 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) A13offcxx . . $ Control#A13off. = SDL_DisplayFormat(temp);
109 if ( A13offcxx . . $ Control#A13off. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
110 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
111 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
112 SDL_Quit();
113 exitcxx . . $ exit(44ed87f96534fad7).(0);
114 }
115 SDL_FreeSurface(temp);
116
117 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/A13on.png");
118 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) A13oncxx . . $ Control#A13on. = SDL_DisplayFormat(temp);
119 if ( A13oncxx . . $ Control#A13on. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
120 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
121 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
122 SDL_Quit();
123 exitcxx . . $ exit(44ed87f96534fad7).(0);
124 }
125 SDL_FreeSurface(temp);
126
127 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/A23off.png");
128 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) A23offcxx . . $ Control#A23off. = SDL_DisplayFormat(temp);
129 if ( A23offcxx . . $ Control#A23off. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
130 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
131 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
132 SDL_Quit();
133 exitcxx . . $ exit(44ed87f96534fad7).(0);
134 }
135 SDL_FreeSurface(temp);
136
137 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/A23on.png");
138 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) A23oncxx . . $ Control#A23on. = SDL_DisplayFormat(temp);
139 if ( A23oncxx . . $ Control#A23on. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
140 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
141 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
142 SDL_Quit();
143 exitcxx . . $ exit(44ed87f96534fad7).(0);
144 }
145 SDL_FreeSurface(temp);
146
147 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/ASTDoff.png");
148 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) ASTDoffcxx . . $ Control#ASTDoff. = SDL_DisplayFormat(temp);
149 if ( ASTDoffcxx . . $ Control#ASTDoff. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
150 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
151 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
152 SDL_Quit();
153 exitcxx . . $ exit(44ed87f96534fad7).(0);
154 }
155 SDL_FreeSurface(temp);
156
157 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/ASTDon.png");
158 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) ASTDoncxx . . $ Control#ASTDon. = SDL_DisplayFormat(temp);
159 if ( ASTDoncxx . . $ Control#ASTDon. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
160 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
161 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
162 SDL_Quit();
163 exitcxx . . $ exit(44ed87f96534fad7).(0);
164 }
165 SDL_FreeSurface(temp);
166
167 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/AFULLoff.png");
168 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) AFULLoffcxx . . $ Control#AFULLoff. = SDL_DisplayFormat(temp);
169 if ( AFULLoffcxx . . $ Control#AFULLoff. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
170 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
171 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
172 SDL_Quit();
173 exitcxx . . $ exit(44ed87f96534fad7).(0);
174 }
175 SDL_FreeSurface(temp);
176
177 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/AFULLon.png");
178 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) AFULLoncxx . . $ Control#AFULLon. = SDL_DisplayFormat(temp);
179 if ( AFULLoncxx . . $ Control#AFULLon. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
180 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
181 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
182 SDL_Quit();
183 exitcxx . . $ exit(44ed87f96534fad7).(0);
184 }
185 SDL_FreeSurface(temp);
186
187 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/AFLKoff.png");
188 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) AFLKoffcxx . . $ Control#AFLKoff. = SDL_DisplayFormat(temp);
189 if ( AFLKoffcxx . . $ Control#AFLKoff. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
190 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
191 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
192 SDL_Quit();
193 exitcxx . . $ exit(44ed87f96534fad7).(0);
194 }
195 SDL_FreeSurface(temp);
196
197 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/AFLKon.png");
198 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) AFLKoncxx . . $ Control#AFLKon. = SDL_DisplayFormat(temp);
199 if ( AFLKoncxx . . $ Control#AFLKon. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
200 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
201 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
202 SDL_Quit();
203 exitcxx . . $ exit(44ed87f96534fad7).(0);
204 }
205 SDL_FreeSurface(temp);
206
207 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/depthupoff.png");
208 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) depthupoffcxx . . $ Control#depthupoff. = SDL_DisplayFormat(temp);
209 if ( depthupoffcxx . . $ Control#depthupoff. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
210 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
211 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
212 SDL_Quit();
213 exitcxx . . $ exit(44ed87f96534fad7).(0);
214 }
215 SDL_FreeSurface(temp);
216
217 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/depthupon.png");
218 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) depthuponcxx . . $ Control#depthupon. = SDL_DisplayFormat(temp);
219 if ( depthuponcxx . . $ Control#depthupon. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
220 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
221 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
222 SDL_Quit();
223 exitcxx . . $ exit(44ed87f96534fad7).(0);
224 }
225 SDL_FreeSurface(temp);
226
227 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/depthdownoff.png");
228 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) depthdownoffcxx . . $ Control#depthdownoff. = SDL_DisplayFormat(temp);
229 if ( depthdownoffcxx . . $ Control#depthdownoff. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
230 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
231 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
232 SDL_Quit();
233 exitcxx . . $ exit(44ed87f96534fad7).(0);
234 }
235 SDL_FreeSurface(temp);
236
237 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/depthdownon.png");
238 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) depthdownoncxx . . $ Control#depthdownon. = SDL_DisplayFormat(temp);
239 if ( depthdownoncxx . . $ Control#depthdownon. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
240 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
241 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
242 SDL_Quit();
243 exitcxx . . $ exit(44ed87f96534fad7).(0);
244 }
245 SDL_FreeSurface(temp);
246
247 }
248
249 void Controlcxx . . $ Control#::DisplayWidgetscxx . . $ Control#DisplayWidgets(49f6e7a06ebc5aa8).(){
250 if(ASTOPcxx . . $ Control#ASTOP.)
251 {
252 destcxx . . $ Control#dest..x = 231;
253 destcxx . . $ Control#dest..y = 582;
254 destcxx . . $ Control#dest..h = STOPoncxx . . $ Control#STOPon.->h;
255 destcxx . . $ Control#dest..w = STOPoncxx . . $ Control#STOPon.->w;
256 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(STOPoncxx . . $ Control#STOPon., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
257 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
258 }
259 else
260 {
261 destcxx . . $ Control#dest..x = 231;
262 destcxx . . $ Control#dest..y = 582;
263 destcxx . . $ Control#dest..h = STOPoffcxx . . $ Control#STOPoff.->h;
264 destcxx . . $ Control#dest..w = STOPoffcxx . . $ Control#STOPoff.->w;
265 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(STOPoffcxx . . $ Control#STOPoff., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
266 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
267 }
268
269 if(A13cxx . . $ Control#A13.)
270 {
271 destcxx . . $ Control#dest..x = 264;
272 destcxx . . $ Control#dest..y = 582;
273 destcxx . . $ Control#dest..h = A13oncxx . . $ Control#A13on.->h;
274 destcxx . . $ Control#dest..w = A13oncxx . . $ Control#A13on.->w;
275 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(A13oncxx . . $ Control#A13on., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
276 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
277 }
278 else
279 {
280 destcxx . . $ Control#dest..x = 264;
281 destcxx . . $ Control#dest..y = 582;
282 destcxx . . $ Control#dest..h = A13offcxx . . $ Control#A13off.->h;
283 destcxx . . $ Control#dest..w = A13offcxx . . $ Control#A13off.->w;
284 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(A13offcxx . . $ Control#A13off., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
285 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
286 }
287
288 if(A23cxx . . $ Control#A23.)
289 {
290 destcxx . . $ Control#dest..x = 297;
291 destcxx . . $ Control#dest..y = 581;
292 destcxx . . $ Control#dest..h = A23oncxx . . $ Control#A23on.->h;
293 destcxx . . $ Control#dest..w = A23oncxx . . $ Control#A23on.->w;
294 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(A23oncxx . . $ Control#A23on., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
295 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
296 }
297 else
298 {
299 destcxx . . $ Control#dest..x = 297;
300 destcxx . . $ Control#dest..y = 581;
301 destcxx . . $ Control#dest..h = A23offcxx . . $ Control#A23off.->h;
302 destcxx . . $ Control#dest..w = A23offcxx . . $ Control#A23off.->w;
303 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(A23offcxx . . $ Control#A23off., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
304 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
305 }
306
307 if(ASTDcxx . . $ Control#ASTD.)
308 {
309 destcxx . . $ Control#dest..x = 330;
310 destcxx . . $ Control#dest..y = 581;
311 destcxx . . $ Control#dest..h = ASTDoncxx . . $ Control#ASTDon.->h;
312 destcxx . . $ Control#dest..w = ASTDoncxx . . $ Control#ASTDon.->w;
313 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(ASTDoncxx . . $ Control#ASTDon., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
314 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
315 }
316 else
317 {
318 destcxx . . $ Control#dest..x = 330;
319 destcxx . . $ Control#dest..y = 581;
320 destcxx . . $ Control#dest..h = ASTDoffcxx . . $ Control#ASTDoff.->h;
321 destcxx . . $ Control#dest..w = ASTDoffcxx . . $ Control#ASTDoff.->w;
322 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(ASTDoffcxx . . $ Control#ASTDoff., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
323 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
324 }
325
326 if(AFULLcxx . . $ Control#AFULL.)
327 {
328 destcxx . . $ Control#dest..x = 363;
329 destcxx . . $ Control#dest..y = 581;
330 destcxx . . $ Control#dest..h = AFULLoncxx . . $ Control#AFULLon.->h;
331 destcxx . . $ Control#dest..w = AFULLoncxx . . $ Control#AFULLon.->w;
332 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(AFULLoncxx . . $ Control#AFULLon., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
333 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
334 }
335 else
336 {
337 destcxx . . $ Control#dest..x = 363;
338 destcxx . . $ Control#dest..y = 581;
339 destcxx . . $ Control#dest..h = AFULLoffcxx . . $ Control#AFULLoff.->h;
340 destcxx . . $ Control#dest..w = AFULLoffcxx . . $ Control#AFULLoff.->w;
341 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(AFULLoffcxx . . $ Control#AFULLoff., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
342 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
343 }
344
345 if(AFLKcxx . . $ Control#AFLK.)
346 {
347 destcxx . . $ Control#dest..x = 396;
348 destcxx . . $ Control#dest..y = 581;
349 destcxx . . $ Control#dest..h = AFLKoncxx . . $ Control#AFLKon.->h;
350 destcxx . . $ Control#dest..w = AFLKoncxx . . $ Control#AFLKon.->w;
351 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(AFLKoncxx . . $ Control#AFLKon., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
352 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
353 }
354 else
355 {
356 destcxx . . $ Control#dest..x = 396;
357 destcxx . . $ Control#dest..y = 581;
358 destcxx . . $ Control#dest..h = AFLKoffcxx . . $ Control#AFLKoff.->h;
359 destcxx . . $ Control#dest..w = AFLKoffcxx . . $ Control#AFLKoff.->w;
360 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(AFLKoffcxx . . $ Control#AFLKoff., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
361 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
362 }
363
364 if(B13cxx . . $ Control#B13.)
365 {
366 destcxx . . $ Control#dest..x = 198;
367 destcxx . . $ Control#dest..y = 582;
368 destcxx . . $ Control#dest..h = A13oncxx . . $ Control#A13on.->h;
369 destcxx . . $ Control#dest..w = A13oncxx . . $ Control#A13on.->w;
370 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(A13oncxx . . $ Control#A13on., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
371 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
372 }
373 else
374 {
375 destcxx . . $ Control#dest..x = 198;
376 destcxx . . $ Control#dest..y = 582;
377 destcxx . . $ Control#dest..h = A13offcxx . . $ Control#A13off.->h;
378 destcxx . . $ Control#dest..w = A13offcxx . . $ Control#A13off.->w;
379 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(A13offcxx . . $ Control#A13off., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
380 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
381 }
382 if(B23cxx . . $ Control#B23.)
383 {
384 destcxx . . $ Control#dest..x = 165;
385 destcxx . . $ Control#dest..y = 581;
386 destcxx . . $ Control#dest..h = A23oncxx . . $ Control#A23on.->h;
387 destcxx . . $ Control#dest..w = A23oncxx . . $ Control#A23on.->w;
388 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(A23oncxx . . $ Control#A23on., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
389 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
390 }
391 else
392 {
393 destcxx . . $ Control#dest..x = 165;
394 destcxx . . $ Control#dest..y = 581;
395 destcxx . . $ Control#dest..h = A23offcxx . . $ Control#A23off.->h;
396 destcxx . . $ Control#dest..w = A23offcxx . . $ Control#A23off.->w;
397 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(A23offcxx . . $ Control#A23off., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
398 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
399 }
400 if(BSTDcxx . . $ Control#BSTD.)
401 {
402 destcxx . . $ Control#dest..x = 132;
403 destcxx . . $ Control#dest..y = 581;
404 destcxx . . $ Control#dest..h = ASTDoncxx . . $ Control#ASTDon.->h;
405 destcxx . . $ Control#dest..w = ASTDoncxx . . $ Control#ASTDon.->w;
406 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(ASTDoncxx . . $ Control#ASTDon., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
407 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
408 }
409 else
410 {
411 destcxx . . $ Control#dest..x = 132;
412 destcxx . . $ Control#dest..y = 581;
413 destcxx . . $ Control#dest..h = ASTDoffcxx . . $ Control#ASTDoff.->h;
414 destcxx . . $ Control#dest..w = ASTDoffcxx . . $ Control#ASTDoff.->w;
415 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(ASTDoffcxx . . $ Control#ASTDoff., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
416 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
417 }
418
419 if(BEMERcxx . . $ Control#BEMER.)
420 {
421 destcxx . . $ Control#dest..x = 99;
422 destcxx . . $ Control#dest..y = 581;
423 destcxx . . $ Control#dest..h = AFLKoncxx . . $ Control#AFLKon.->h;
424 destcxx . . $ Control#dest..w = AFLKoncxx . . $ Control#AFLKon.->w;
425 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(AFLKoncxx . . $ Control#AFLKon., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
426 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
427 }
428 else
429 {
430 destcxx . . $ Control#dest..x = 99;
431 destcxx . . $ Control#dest..y = 581;
432 destcxx . . $ Control#dest..h = AFLKoffcxx . . $ Control#AFLKoff.->h;
433 destcxx . . $ Control#dest..w = AFLKoffcxx . . $ Control#AFLKoff.->w;
434 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(AFLKoffcxx . . $ Control#AFLKoff., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
435 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
436 }
437
438 if(depthdowncxx . . $ Control#depthdown.)
439 {
440 destcxx . . $ Control#dest..x = 111;
441 destcxx . . $ Control#dest..y = 253;
442 destcxx . . $ Control#dest..h = depthdownoncxx . . $ Control#depthdownon.->h;
443 destcxx . . $ Control#dest..w = depthdownoncxx . . $ Control#depthdownon.->w;
444 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(depthdownoncxx . . $ Control#depthdownon., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
445 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
446 }
447 else
448 {
449 destcxx . . $ Control#dest..x = 111;
450 destcxx . . $ Control#dest..y = 253;
451 destcxx . . $ Control#dest..h = depthdownoffcxx . . $ Control#depthdownoff.->h;
452 destcxx . . $ Control#dest..w = depthdownoffcxx . . $ Control#depthdownoff.->w;
453 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(depthdownoffcxx . . $ Control#depthdownoff., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
454 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
455 }
456 if(depthupcxx . . $ Control#depthup.)
457 {
458 destcxx . . $ Control#dest..x = 384;
459 destcxx . . $ Control#dest..y = 256;
460 destcxx . . $ Control#dest..h = depthuponcxx . . $ Control#depthupon.->h;
461 destcxx . . $ Control#dest..w = depthuponcxx . . $ Control#depthupon.->w;
462 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(depthuponcxx . . $ Control#depthupon., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
463 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
464 }
465 else
466 {
467 destcxx . . $ Control#dest..x = 384;
468 destcxx . . $ Control#dest..y = 256;
469 destcxx . . $ Control#dest..h = depthupoffcxx . . $ Control#depthupoff.->h;
470 destcxx . . $ Control#dest..w = depthupoffcxx . . $ Control#depthupoff.->w;
471 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(depthupoffcxx . . $ Control#depthupoff., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.);
472 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.);
473 }
474 }
475
476 void Controlcxx . . $ Control#::ClearHeadingcxx . . $ Control#ClearHeading(49f6e7a06ebc5aa8).(){
477
478 // Clear the screen
479 SDL_Surface *temp;
480 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/ClearControl.png");
481 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) ClearControlcxx . . $ Control#ClearControl. = SDL_DisplayFormat(temp);
482 if ( ClearControlcxx . . $ Control#ClearControl. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
483 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
484 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
485 SDL_Quit();
486 exitcxx . . $ exit(44ed87f96534fad7).(0);
487 }
488
489 SDL_FreeSurface(temp);
490
491 srccxx . . $ Control#src..x = 0;
492 srccxx . . $ Control#src..y = 0;
493 srccxx . . $ Control#src..w = ClearControlcxx . . $ Control#ClearControl.->w;
494 srccxx . . $ Control#src..h = ClearControlcxx . . $ Control#ClearControl.->h;
495
496 destcxx . . $ Control#dest..x = 107; // Blit destination x&y to the upper left
497 destcxx . . $ Control#dest..y = 140;
498 destcxx . . $ Control#dest..w = ClearControlcxx . . $ Control#ClearControl.->w; // Height and width equal to the
499 destcxx . . $ Control#dest..h = ClearControlcxx . . $ Control#ClearControl.->h; // source images....
500 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(ClearControlcxx . . $ Control#ClearControl., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.); // Do the actual Blit
501
502 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.); //Show the screen.
503 SDL_FreeSurface(ClearControlcxx . . $ Control#ClearControl.); //Free up the surface memory.
504 }
505
506 void Controlcxx . . $ Control#::ClearOrdHeadingcxx . . $ Control#ClearOrdHeading(49f6e7a06ebc5aa8).(){
507 int x, y;
508 double x1, y1, x2, y2;//rdm 9/11
509
510 // Clear Last Ordered Heading Compass //rdm 9/11
511 x = int(251.0 + 58.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-old_headingcxx . . $ old_heading.*3.14/180.0));
512 y = int(344.0 - 58.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-old_headingcxx . . $ old_heading.*3.14/180.0));
513 // filledTrigonRGBA(screen, 251, 341, 251, 347, x, y, 0, 0, 0, 255); //rdm 9/11
514
515 x1 = int(251.0 + 4.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-old_headingcxx . . $ old_heading.*3.14/180.0));
516 y1 = int(344.0 + 4.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-old_headingcxx . . $ old_heading.*3.14/180.0));
517 x2 = int(251.0 - 4.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-old_headingcxx . . $ old_heading.*3.14/180.0));
518 y2 = int(344.0 - 4.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-old_headingcxx . . $ old_heading.*3.14/180.0));
519
520 filledTrigonRGBA(screencxx . . $ Control#screen., x1, y1, x2, y2, x, y, 0, 0, 0, 255);
521
522 // Clear the screen
523 SDL_Surface *temp;
524 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/ClearControl.png");
525 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) ClearControlcxx . . $ Control#ClearControl. = SDL_DisplayFormat(temp);
526 if ( ClearControlcxx . . $ Control#ClearControl. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
527 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
528 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
529 SDL_Quit();
530 exitcxx . . $ exit(44ed87f96534fad7).(0);
531 }
532
533 SDL_FreeSurface(temp);
534
535 srccxx . . $ Control#src..x = 0;
536 srccxx . . $ Control#src..y = 0;
537 srccxx . . $ Control#src..w = ClearControlcxx . . $ Control#ClearControl.->w;
538 srccxx . . $ Control#src..h = ClearControlcxx . . $ Control#ClearControl.->h;
539
540 destcxx . . $ Control#dest..x = 107; // Blit destination x&y to the upper left
541 destcxx . . $ Control#dest..y = 195;
542 destcxx . . $ Control#dest..w = ClearControlcxx . . $ Control#ClearControl.->w; // Height and width equal to the
543 destcxx . . $ Control#dest..h = ClearControlcxx . . $ Control#ClearControl.->h; // source images....
544 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(ClearControlcxx . . $ Control#ClearControl., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.); // Do the actual Blit
545
546 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.); //Show the screen.
547 SDL_FreeSurface(ClearControlcxx . . $ Control#ClearControl.); //Free up the surface memory.
548 DisplayWidgetscxx . . $ Control#DisplayWidgets(49f6e7a06ebc5aa8).();
549
550 }
551
552 void Controlcxx . . $ Control#::ClearDepthcxx . . $ Control#ClearDepth(49f6e7a06ebc5aa8).(){
553
554 // Clear the screen
555 SDL_Surface *temp;
556 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/ClearControl.png");
557 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) ClearControlcxx . . $ Control#ClearControl. = SDL_DisplayFormat(temp);
558 if ( ClearControlcxx . . $ Control#ClearControl. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
559 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
560 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
561 SDL_Quit();
562 exitcxx . . $ exit(44ed87f96534fad7).(0);
563 }
564
565 SDL_FreeSurface(temp);
566
567 srccxx . . $ Control#src..x = 0;
568 srccxx . . $ Control#src..y = 0;
569 srccxx . . $ Control#src..w = ClearControlcxx . . $ Control#ClearControl.->w;
570 srccxx . . $ Control#src..h = ClearControlcxx . . $ Control#ClearControl.->h;
571
572 destcxx . . $ Control#dest..x = 211; // Blit destination x&y to the upper left
573 destcxx . . $ Control#dest..y = 140;
574 destcxx . . $ Control#dest..w = ClearControlcxx . . $ Control#ClearControl.->w; // Height and width equal to the
575 destcxx . . $ Control#dest..h = ClearControlcxx . . $ Control#ClearControl.->h; // source images....
576 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(ClearControlcxx . . $ Control#ClearControl., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.); // Do the actual Blit
577
578 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.); //Show the screen.
579 SDL_FreeSurface(ClearControlcxx . . $ Control#ClearControl.); //Free up the surface memory.
580 }
581
582 void Controlcxx . . $ Control#::ClearOrdDepthcxx . . $ Control#ClearOrdDepth(49f6e7a06ebc5aa8).(){
583
584 // Clear the screen
585 SDL_Surface *temp;
586 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/ClearControl.png");
587 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) ClearControlcxx . . $ Control#ClearControl. = SDL_DisplayFormat(temp);
588 if ( ClearControlcxx . . $ Control#ClearControl. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
589 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
590 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
591 SDL_Quit();
592 exitcxx . . $ exit(44ed87f96534fad7).(0);
593 }
594
595 SDL_FreeSurface(temp);
596
597 srccxx . . $ Control#src..x = 0;
598 srccxx . . $ Control#src..y = 0;
599 srccxx . . $ Control#src..w = ClearControlcxx . . $ Control#ClearControl.->w;
600 srccxx . . $ Control#src..h = ClearControlcxx . . $ Control#ClearControl.->h;
601
602 destcxx . . $ Control#dest..x = 211; // Blit destination x&y to the upper left
603 destcxx . . $ Control#dest..y = 195;
604 destcxx . . $ Control#dest..w = ClearControlcxx . . $ Control#ClearControl.->w; // Height and width equal to the
605 destcxx . . $ Control#dest..h = ClearControlcxx . . $ Control#ClearControl.->h; // source images....
606 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(ClearControlcxx . . $ Control#ClearControl., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.); // Do the actual Blit
607
608
609 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.); //Show the screen.
610 SDL_FreeSurface(ClearControlcxx . . $ Control#ClearControl.); //Free up the surface memory.
611 DisplayWidgetscxx . . $ Control#DisplayWidgets(49f6e7a06ebc5aa8).();
612 }
613
614 void Controlcxx . . $ Control#::ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).(){
615 BEMERcxx . . $ Control#BEMER. = false;
616 BSTDcxx . . $ Control#BSTD. = false;
617 B23cxx . . $ Control#B23. = false;
618 B13cxx . . $ Control#B13. = false;
619 ASTOPcxx . . $ Control#ASTOP. = false;
620 A13cxx . . $ Control#A13. = false;
621 A23cxx . . $ Control#A23. = false;
622 ASTDcxx . . $ Control#ASTD. = false;
623 AFULLcxx . . $ Control#AFULL. = false;
624 AFLKcxx . . $ Control#AFLK. = false;
625
626 // Clear the screen
627 SDL_Surface *temp;
628 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/ClearControl.png");
629 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) ClearControlcxx . . $ Control#ClearControl. = SDL_DisplayFormat(temp);
630 if ( ClearControlcxx . . $ Control#ClearControl. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
631 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
632 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
633 SDL_Quit();
634 exitcxx . . $ exit(44ed87f96534fad7).(0);
635 }
636
637 SDL_FreeSurface(temp);
638
639 srccxx . . $ Control#src..x = 0;
640 srccxx . . $ Control#src..y = 0;
641 srccxx . . $ Control#src..w = ClearControlcxx . . $ Control#ClearControl.->w;
642 srccxx . . $ Control#src..h = ClearControlcxx . . $ Control#ClearControl.->h;
643
644 destcxx . . $ Control#dest..x = 317; // Blit destination x&y to the upper left
645 destcxx . . $ Control#dest..y = 194;
646 destcxx . . $ Control#dest..w = ClearControlcxx . . $ Control#ClearControl.->w; // Height and width equal to the
647 destcxx . . $ Control#dest..h = ClearControlcxx . . $ Control#ClearControl.->h; // source images....
648 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(ClearControlcxx . . $ Control#ClearControl., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.); // Do the actual Blit
649
650
651 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.); //Show the screen.
652 SDL_FreeSurface(ClearControlcxx . . $ Control#ClearControl.); //Free up the surface memory.
653 DisplayWidgetscxx . . $ Control#DisplayWidgets(49f6e7a06ebc5aa8).();
654 }
655
656 void Controlcxx . . $ Control#::ClearSpeedcxx . . $ Control#ClearSpeed(49f6e7a06ebc5aa8).(){
657 // Clear the screen
658 SDL_Surface *temp;
659 temp = Load_Imagecxx . . $ Load_Image(ad2755de9658a3fe).("images/ClearControl.png");
660 if(temp != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) ClearControlcxx . . $ Control#ClearControl. = SDL_DisplayFormat(temp);
661 if ( ClearControlcxx . . $ Control#ClearControl. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) {
662 cerrcxx . . $ cerr.<<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7)."Function LoadWidgets()" <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).
663 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SDL_GetError() <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9).;
664 SDL_Quit();
665 exitcxx . . $ exit(44ed87f96534fad7).(0);
666 }
667
668 SDL_FreeSurface(temp);
669
670 srccxx . . $ Control#src..x = 0;
671 srccxx . . $ Control#src..y = 0;
672 srccxx . . $ Control#src..w = ClearControlcxx . . $ Control#ClearControl.->w;
673 srccxx . . $ Control#src..h = ClearControlcxx . . $ Control#ClearControl.->h;
674
675 destcxx . . $ Control#dest..x = 317; // Blit destination x&y to the upper left
676 destcxx . . $ Control#dest..y = 139;
677 destcxx . . $ Control#dest..w = ClearControlcxx . . $ Control#ClearControl.->w; // Height and width equal to the
678 destcxx . . $ Control#dest..h = ClearControlcxx . . $ Control#ClearControl.->h; // source images....
679 SDL_BlitSurfacecxx . . $ `<external>/3508485105195885937/SDL_video.h:262:9`!(ClearControlcxx . . $ Control#ClearControl., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, screencxx . . $ Control#screen., &destcxx . . $ Control#dest.); // Do the actual Blit
680
681 SDL_UpdateRects(screencxx . . $ Control#screen., 1, &destcxx . . $ Control#dest.); //Show the screen.
682 SDL_FreeSurface(ClearControlcxx . . $ Control#ClearControl.); //Free up the surface memory.
683 }
684
685 void Controlcxx . . $ Control#::ToggleBEMERcxx . . $ Control#ToggleBEMER(49f6e7a06ebc5aa8).(){
686 ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).();
687 BEMERcxx . . $ Control#BEMER. = !BEMERcxx . . $ Control#BEMER.;
688 Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed. = -16;
689 }
690 void Controlcxx . . $ Control#::ToggleBSTDcxx . . $ Control#ToggleBSTD(49f6e7a06ebc5aa8).(){
691 ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).();
692 BSTDcxx . . $ Control#BSTD. = !BSTDcxx . . $ Control#BSTD.;
693 Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed. = -12;
694 }
695 void Controlcxx . . $ Control#::ToggleB23cxx . . $ Control#ToggleB23(49f6e7a06ebc5aa8).(){
696 ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).();
697 B23cxx . . $ Control#B23. = !B23cxx . . $ Control#B23.;
698 Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed. = -8;
699 }
700 void Controlcxx . . $ Control#::ToggleB13cxx . . $ Control#ToggleB13(49f6e7a06ebc5aa8).(){
701 ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).();
702 B13cxx . . $ Control#B13. = !B13cxx . . $ Control#B13.;
703 Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed. = -4;
704 }
705 void Controlcxx . . $ Control#::ToggleASTOPcxx . . $ Control#ToggleASTOP(49f6e7a06ebc5aa8).(){
706 ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).();
707 ASTOPcxx . . $ Control#ASTOP. = !ASTOPcxx . . $ Control#ASTOP.;
708 Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed. = 0;
709 }
710 void Controlcxx . . $ Control#::ToggleA13cxx . . $ Control#ToggleA13(49f6e7a06ebc5aa8).(){
711 ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).();
712 A13cxx . . $ Control#A13. = !A13cxx . . $ Control#A13.;
713 Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed. = 5;
714 }
715 void Controlcxx . . $ Control#::ToggleA23cxx . . $ Control#ToggleA23(49f6e7a06ebc5aa8).(){
716 ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).();
717 A23cxx . . $ Control#A23. = !A23cxx . . $ Control#A23.;
718 Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed. = 10;
719 }
720 void Controlcxx . . $ Control#::ToggleASTDcxx . . $ Control#ToggleASTD(49f6e7a06ebc5aa8).(){
721 ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).();
722 ASTDcxx . . $ Control#ASTD. = !ASTDcxx . . $ Control#ASTD.;
723 Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed. = 15;
724 }
725 void Controlcxx . . $ Control#::ToggleAFULLcxx . . $ Control#ToggleAFULL(49f6e7a06ebc5aa8).(){
726 ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).();
727 AFULLcxx . . $ Control#AFULL. = !AFULLcxx . . $ Control#AFULL.;
728 Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed. = 20;
729 }
730 void Controlcxx . . $ Control#::ToggleAFLKcxx . . $ Control#ToggleAFLK(49f6e7a06ebc5aa8).(){
731 ClearOrdSpeedcxx . . $ Control#ClearOrdSpeed(49f6e7a06ebc5aa8).();
732 AFLKcxx . . $ Control#AFLK. = !AFLKcxx . . $ Control#AFLK.;
733 Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed. = 32;
734 }
735
736 void Controlcxx . . $ Control#::Displaycxx . . $ Control#Display(49f6e7a06ebc5aa8).(){
737 static char text[120];
738 char file1[] = "images/font.png";
739 char file2[] = "data/font.dat";
740 DFontcxx . . $ DFont# fntcxx . . $ DFont#DFont(d0489a02ea06dfc6).(file1, file2);
741 float radians, previous_radians;
742 float previous_speed, previous_depth;
743 double x1, y1, x2, y2;
744
745
746 if (depthupcxx . . $ Control#depthup.) Subscxx . . $ Control#Subs.->DesiredDepthcxx . . $ Submarine#DesiredDepth.--; // Take her up!!
747 if (depthdowncxx . . $ Control#depthdown.) Subscxx . . $ Control#Subs.->DesiredDepthcxx . . $ Submarine#DesiredDepth.++; // Take her down!!
748
749 // Heading Screen
750 srccxx . . $ Control#src..x=110;
751 srccxx . . $ Control#src..y=142; //define a rectangle on the screen and make it black
752 srccxx . . $ Control#src..h=15;
753 srccxx . . $ Control#src..w=75;
754
755 sprintf(text, "%i",(int)Subscxx . . $ Control#Subs.[0].Headingcxx . . $ Coord#Heading.);
756 fnt.PutStringcxx . . $ DFont#PutString(dae77c54ebf0dad5).(screencxx . . $ Control#screen., 145, 144, text);
757
758 // Ordered Heading Screen
759 srccxx . . $ Control#src..x=110;
760 srccxx . . $ Control#src..y=196; //define a rectangle on the screen and make it black
761 srccxx . . $ Control#src..h=15;
762 srccxx . . $ Control#src..w=75;
763
764 sprintf(text, "%i",(int)Subscxx . . $ Control#Subs.[0].DesiredHeadingcxx . . $ Submarine#DesiredHeading.);
765 fnt.PutStringcxx . . $ DFont#PutString(dae77c54ebf0dad5).(screencxx . . $ Control#screen., 145, 198, text);
766
767 //Replot desired heading compass if we left control screen before turn completed //rdm 9/11
768 if (Subscxx . . $ Control#Subs.->DesiredHeadingcxx . . $ Submarine#DesiredHeading. != Subscxx . . $ Control#Subs.->Headingcxx . . $ Coord#Heading. )
769 {
770 // Draw a green filled triangle with vertices (x1, y1), (x2, y2), (x3, y3) and RGBA color (r, g, b, a)
771 xcxx . . $ Control#x. = int(251.0 + 58.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-Subscxx . . $ Control#Subs.[0].DesiredHeadingcxx . . $ Submarine#DesiredHeading.*3.14/180.0));
772 ycxx . . $ Control#y. = int(344.0 - 58.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-Subscxx . . $ Control#Subs.[0].DesiredHeadingcxx . . $ Submarine#DesiredHeading.*3.14/180.0));
773
774 x1 = int(251.0 + 4.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-Subscxx . . $ Control#Subs.[0].DesiredHeadingcxx . . $ Submarine#DesiredHeading.*3.14/180.0));
775 y1 = int(344.0 + 4.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-Subscxx . . $ Control#Subs.[0].DesiredHeadingcxx . . $ Submarine#DesiredHeading.*3.14/180.0));
776 x2 = int(251.0 - 4.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-Subscxx . . $ Control#Subs.[0].DesiredHeadingcxx . . $ Submarine#DesiredHeading.*3.14/180.0));
777 y2 = int(344.0 - 4.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-Subscxx . . $ Control#Subs.[0].DesiredHeadingcxx . . $ Submarine#DesiredHeading.*3.14/180.0));
778
779 filledTrigonRGBA(screencxx . . $ Control#screen., x1, y1, x2, y2, xcxx . . $ Control#x., ycxx . . $ Control#y., 0, 128, 0, 255);
780 }
781
782 // Depth Screen
783 srccxx . . $ Control#src..x=212;
784 srccxx . . $ Control#src..y=142;
785 srccxx . . $ Control#src..h=15;
786 srccxx . . $ Control#src..w=75;
787
788 sprintf(text, "%i", (int)Subscxx . . $ Control#Subs.[0].Depthcxx . . $ Submarine#Depth.);
789 fnt.PutStringcxx . . $ DFont#PutString(dae77c54ebf0dad5).(screencxx . . $ Control#screen., 247, 144, text);
790
791 // Desired Depth Screen
792 srccxx . . $ Control#src..x=212;
793 srccxx . . $ Control#src..y=197;
794 srccxx . . $ Control#src..h=15;
795 srccxx . . $ Control#src..w=75;
796
797 sprintf(text, "%i", (int)Subscxx . . $ Control#Subs.[0].DesiredDepthcxx . . $ Submarine#DesiredDepth.);
798 fnt.PutStringcxx . . $ DFont#PutString(dae77c54ebf0dad5).(screencxx . . $ Control#screen., 247, 199, text);
799
800 // Clear the Ordered Depth Boxes if needed.
801 if(Subscxx . . $ Control#Subs.->DesiredDepthcxx . . $ Submarine#DesiredDepth. == 100.0) ClearOrdDepthcxx . . $ Control#ClearOrdDepth(49f6e7a06ebc5aa8).();
802 if(Subscxx . . $ Control#Subs.->DesiredDepthcxx . . $ Submarine#DesiredDepth. == 1000.0) ClearOrdDepthcxx . . $ Control#ClearOrdDepth(49f6e7a06ebc5aa8).();
803
804
805 // Speed Screen
806 srccxx . . $ Control#src..x=320;
807 srccxx . . $ Control#src..y=142;
808 srccxx . . $ Control#src..h=15;
809 srccxx . . $ Control#src..w=75;
810
811 sprintf(text, "%d", int(Subscxx . . $ Control#Subs.->Speedcxx . . $ Coord#Speed.));
812 fnt.PutStringcxx . . $ DFont#PutString(dae77c54ebf0dad5).(screencxx . . $ Control#screen., 355, 144, text);
813
814 // Desired Speed Screen
815 srccxx . . $ Control#src..x=320;
816 srccxx . . $ Control#src..y=197;
817 srccxx . . $ Control#src..h=15;
818 srccxx . . $ Control#src..w=75;
819
820 sprintf(text, "%i", (int)Subscxx . . $ Control#Subs.->DesiredSpeedcxx . . $ Submarine#DesiredSpeed.);
821 fnt.PutStringcxx . . $ DFont#PutString(dae77c54ebf0dad5).(screencxx . . $ Control#screen., 355, 199, text);
822
823 radians = Subscxx . . $ Control#Subs.->Headingcxx . . $ Coord#Heading. *(3.14/180.0); // degrees to radians
824
825 if (!HeadingStackcxx . . $ HeadingStack..emptycxx . . $ DStack#empty(b126dc7c1de90089).()) // Is there is data on the stack?
826 {
827 previous_radians = HeadingStackcxx . . $ HeadingStack..popcxx . . $ DStack#pop(9b8c9e39889c762c).();
828 previous_speed = SpeedStackcxx . . $ SpeedStack..popcxx . . $ DStack#pop(9b8c9e39889c762c).();
829 previous_depth = DepthStackcxx . . $ DepthStack..popcxx . . $ DStack#pop(9b8c9e39889c762c).();
830
831 // Next lines clear the display as nec to prevent garbage on screen
832 if(Subscxx . . $ Control#Subs.->Headingcxx . . $ Coord#Heading. <= 10.0 && previous_radians*(180.0/3.14) > 10.0) ClearHeadingcxx . . $ Control#ClearHeading(49f6e7a06ebc5aa8).();
833 if(Subscxx . . $ Control#Subs.->Headingcxx . . $ Coord#Heading. <= 100.0 && previous_radians*(180.0/3.14) > 100.0) ClearHeadingcxx . . $ Control#ClearHeading(49f6e7a06ebc5aa8).();
834 if(Subscxx . . $ Control#Subs.->Speedcxx . . $ Coord#Speed. <= 10.0 && previous_speed > 10.0) ClearSpeedcxx . . $ Control#ClearSpeed(49f6e7a06ebc5aa8).();
835 if(Subscxx . . $ Control#Subs.->Speedcxx . . $ Coord#Speed. >= -10.0 && previous_speed < -10.0) ClearSpeedcxx . . $ Control#ClearSpeed(49f6e7a06ebc5aa8).();
836 if(Subscxx . . $ Control#Subs.->Speedcxx . . $ Coord#Speed. >= 0.0 && previous_speed < 0.0) ClearSpeedcxx . . $ Control#ClearSpeed(49f6e7a06ebc5aa8).();
837
838 if(Subscxx . . $ Control#Subs.->Depthcxx . . $ Submarine#Depth. <= 100.0 && previous_depth > 100.0) ClearDepthcxx . . $ Control#ClearDepth(49f6e7a06ebc5aa8).();
839 if(Subscxx . . $ Control#Subs.->Depthcxx . . $ Submarine#Depth. <= 1000.0 && previous_depth > 1000.0) ClearDepthcxx . . $ Control#ClearDepth(49f6e7a06ebc5aa8).();
840
841
842 // Clear Old Data from Heading Compass //rdm 9/11
843 // Draw a orange filled triangle with vertices (x1, y1), (x2, y2), (x3, y3) and RGBA color (r, g, b, a)
844 xcxx . . $ Control#x. = int(251.0 + 58.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-previous_radians));
845 ycxx . . $ Control#y. = int(344.0 - 58.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-previous_radians));
846
847 x1 = int(251.0 + 4.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-previous_radians));
848 y1 = int(344.0 + 4.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-previous_radians));
849 x2 = int(251.0 - 4.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-previous_radians));
850 y2 = int(344.0 - 4.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-previous_radians));
851
852 filledTrigonRGBA(screencxx . . $ Control#screen., x1, y1, x2, y2, xcxx . . $ Control#x., ycxx . . $ Control#y., 0, 0, 0, 255);
853
854 }
855
856 // Draw Desired Heading Compass //rdm 9/11
857 // Draw a orange filled triangle with vertices (x1, y1), (x2, y2), (x3, y3) and RGBA color (r, g, b, a)
858 xcxx . . $ Control#x. = int(251.0 + 58.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-radians));
859 ycxx . . $ Control#y. = int(344.0 - 58.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-radians));
860
861 x1 = int(251.0 + 4.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-radians));
862 y1 = int(344.0 + 4.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-radians));
863 x2 = int(251.0 - 4.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-radians));
864 y2 = int(344.0 - 4.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-radians));
865
866 filledTrigonRGBA(screencxx . . $ Control#screen., x1, y1, x2, y2, xcxx . . $ Control#x., ycxx . . $ Control#y., 238, 118, 0, 255);
867
868 // Push the data on the stack
869 HeadingStackcxx . . $ HeadingStack..pushcxx . . $ DStack#push(1bb0578f3efdc255).(radians);
870 SpeedStackcxx . . $ SpeedStack..pushcxx . . $ DStack#push(1bb0578f3efdc255).(Subscxx . . $ Control#Subs.->Speedcxx . . $ Coord#Speed.);
871 DepthStackcxx . . $ DepthStack..pushcxx . . $ DStack#push(1bb0578f3efdc255).(Subscxx . . $ Control#Subs.->Depthcxx . . $ Submarine#Depth.);
872
873 SDL_UpdateRect(screencxx . . $ Control#screen.,0, 0, 0, 0);
874
875 }
876
877 void Controlcxx . . $ Control#::AdjustHeadingcxx . . $ Control#AdjustHeading(3e454b8ccf442868).(int x, int y){
878
879 double c1, c3, c5, c6;
880 double x1, y1, x2, y2;
881 int heading;
882
883 c1 = double(251);
884 c3 = double(344);
885
886 // c5 = 60.0*(double(y)-c3);
887 // c6 = 60.0*(double(x)-c1);
888
889 c5 = 58.0*(double(y)-c3);
890 c6 = 58.0*(double(x)-c1);
891
892
893 ClearOrdHeadingcxx . . $ Control#ClearOrdHeading(49f6e7a06ebc5aa8).();
894
895 if(x >= 251)
896 {
897 heading = int(90.0 + (180/3.14)*atancxx . . $ atan(fee4f1d22bc8e617).(c5/c6));
898 }
899 else
900 {
901 heading = int(270.0 + (180/3.14)*atancxx . . $ atan(fee4f1d22bc8e617).(c5/c6));
902 }
903
904 Subscxx . . $ Control#Subs.->DesiredHeadingcxx . . $ Submarine#DesiredHeading. = heading;
905 old_headingcxx . . $ old_heading. = heading;
906
907 // Draw Desired Heading Compass//rdm 9/11
908 // Draw a green filled triangle with vertices (x1, y1), (x2, y2), (x3, y3) and RGBA color (r, g, b, a)
909 x = int(251.0 + 58.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-heading*3.14/180.0));
910 y = int(344.0 - 58.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-heading*3.14/180.0));
911 // filledTrigonRGBA(screen, 251, 341, 251, 347, x, y, 0, 128, 0, 255); //rdm 9/11
912
913 x1 = int(251.0 + 4.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-heading*3.14/180.0));
914 y1 = int(344.0 + 4.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-heading*3.14/180.0));
915 x2 = int(251.0 - 4.0*sincxx . . $ sin(fee4f1d22bc8e617).(1.57-heading*3.14/180.0));
916 y2 = int(344.0 - 4.0*coscxx . . $ cos(fee4f1d22bc8e617).(1.57-heading*3.14/180.0));
917
918 filledTrigonRGBA(screencxx . . $ Control#screen., x1, y1, x2, y2, x, y, 0, 128, 0, 255);
919 return;
920
921 }
922
923 void Controlcxx . . $ Control#::AdjustDepthcxx . . $ Control#AdjustDepth(d4f767463ce0a6b3).(int x){
924
925 ClearOrdDepthcxx . . $ Control#ClearOrdDepth(49f6e7a06ebc5aa8).();
926 if(x > 112 && x < 126)
927 {
928 if(depthupcxx . . $ Control#depthup.)
929 {
930 depthupcxx . . $ Control#depthup. = false;
931 }
932 else
933 {
934 depthdowncxx . . $ Control#depthdown. = true;
935 depthupcxx . . $ Control#depthup. = false;
936 }
937 }
938
939 if(x > 385 && x < 401)
940 {
941 if(depthdowncxx . . $ Control#depthdown.)
942 {
943 depthdowncxx . . $ Control#depthdown. = false;
944 }
945 else
946 {
947 depthdowncxx . . $ Control#depthdown. = false;
948 depthupcxx . . $ Control#depthup. = true;
949 }
950 }
951 DisplayWidgetscxx . . $ Control#DisplayWidgets(49f6e7a06ebc5aa8).();
952 return;
953 }
954
955 //Not needed if use SDL_gfx rdm 9/11
956
957 /*
958 void Control::DLine(SDL_Surface *screen, int X1, int Y1, int X2, int Y2, Uint32 Color)
959 {
960
961 int dx,dy,sdx,sdy,py,px,x,y;
962 dx = X2 - X1;
963 dy = Y2 - Y1;
964 if (dx < 0) sdx = -1;
965 else sdx = 1;
966 if (dy < 0) sdy = -1;
967 else sdy = 1;
968 dx = sdx * dx + 1;
969 dy = sdy * dy + 1;
970 x = 0;
971 y = 0;
972 px = X1;
973 py = Y1;
974 if (dx >= dy){
975 for (int x = 0; x < dx; x++){
976 DPixel(screen, px, py, Color);
977 y = y + dy;
978 if (y >= dx){
979 y = y - dx;
980 py = py + sdy;
981 }
982 px = px + sdx;
983 }
984 }else{
985 for (int y = 0; y < dy; y++){
986 DPixel(screen, px, py, Color);
987 x = x + dx;
988 if (x >= dy){
989 x = x - dy;
990 px = px + sdx;
991 }
992 py = py + sdy;
993 }
994 }
995 }
996
997 void Control::DPixel(SDL_Surface *screen, int x, int y, Uint32 color)
998 {
999 //this only works for 16bpp screens
1000 //are we outside the screen?????
1001 //If we are bail out now before it's too late!
1002
1003 //cerr << ".";
1004 if (x > 1023 || x < 0 || y > 759 || y < 0) {
1005 return;
1006 }
1007
1008 //place the pixel on the screen
1009 Uint16 *pixel_location;
1010 pixel_location = (Uint16 *)screen->pixels + y*screen->pitch/2 + x;
1011 *pixel_location = color;
1012 }
1013 */