Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 117 lines (105 sloc) 3.187 kB
96342f3 initial import
tompox authored
1 #ifndef _PI_H
2 #define _PI_H
3
4 #include "libs.h"
5 #include "Gui.h"
6 #include "View.h"
7 #include "mtrand.h"
a6ab914 landing on ground-based space stations. uses same geom flag 1 thing t…
tompox authored
8 #include "gameconsts.h"
96342f3 initial import
tompox authored
9 #include <map>
10 #include <string>
11
12 class Player;
13 class SectorView;
14 class SystemView;
15 class WorldView;
342b1d6 gas giant stuff. clean up Body a little
tompox authored
16 class ObjectViewerView;
96342f3 initial import
tompox authored
17 class SystemInfoView;
18 class ShipCpanel;
19 class StarSystem;
20 class SpaceStationView;
40f1abf a little more ship stats. ship info screen. make the ship angular vel…
tompox authored
21 class InfoView;
768eb7b allow precise selection of hyperspace destination (by planet not system)
tompox authored
22 class SBodyPath;
96342f3 initial import
tompox authored
23
24 class IniConfig: private std::map<std::string, std::string> {
25 public:
26 IniConfig(const char *filename);
27 int Int(const char *key) {
28 return atoi((*this)[key].c_str());
29 }
30 float Float(const char *key) {
31 float val;
32 if (sscanf((*this)[key].c_str(), "%f", &val)==1) return val;
33 else return 0;
34 }
35 std::string String(const char *key) {
36 return (*this)[key];
37 }
38 };
39
e3d4287 initial rotating frames work
tompox authored
40 class Frame;
96342f3 initial import
tompox authored
41 /*
42 * Implementation is in main.cpp, just to confuse you.
43 */
44 class Pi {
45 public:
46 static void Init(IniConfig &config);
d1c11e7 intro screen and starting points. more crud relating to starport gene…
tompox authored
47 static void Start();
96342f3 initial import
tompox authored
48 static void MainLoop();
e1c4843 ships take damage and die. player tombstone.
tompox authored
49 static void TombStoneLoop();
96342f3 initial import
tompox authored
50 static void Quit();
5825356 a lot of savegame preliminary work
tompox authored
51 static void Serialize();
52 static void Unserialize();
96342f3 initial import
tompox authored
53 static float GetFrameTime() { return frameTime; }
54 static double GetGameTime() { return gameTime; }
a1a3dd1 force wheels down on docking. allow ship rotation controls at high ti…
tompox authored
55 static void SetTimeAccel(float s);
d3785a7 bunch of work on collisions. still doesn't work right. john - see how…
tompox authored
56 static float GetTimeAccel() { return timeAccel; }
e2d7e30 fixed step physics
tompox authored
57 static float GetTimeStep() { return timeAccel*(1.0/62.5); }
96342f3 initial import
tompox authored
58 static int GetScrWidth() { return scrWidth; }
59 static int GetScrHeight() { return scrHeight; }
60 static float GetScrAspect() { return scrAspect; }
61 static int KeyState(SDLKey k) { return keyState[k]; }
62 static int MouseButtonState(int button) { return mouseButton[button]; }
63 static void GetMouseMotion(int motion[2]) {
64 memcpy(motion, mouseMotion, sizeof(int)*2);
65 }
66
67 static sigc::signal<void, SDL_keysym*> onKeyPress;
68 static sigc::signal<void, SDL_keysym*> onKeyRelease;
69 static sigc::signal<void, int, int, int> onMouseButtonUp;
70 static sigc::signal<void, int, int, int> onMouseButtonDown;
768eb7b allow precise selection of hyperspace destination (by planet not system)
tompox authored
71 static sigc::signal<void> onPlayerChangeHyperspaceTarget;
329666a spawn pirates on entry to system. not determining strength by system …
tompox authored
72 static sigc::signal<void> onPlayerHyperspaceToNewSystem;
96342f3 initial import
tompox authored
73
74 static MTRand rng;
5aa4f99 add some titillating stats
tompox authored
75 static int statSceneTris;
96342f3 initial import
tompox authored
76
768eb7b allow precise selection of hyperspace destination (by planet not system)
tompox authored
77 static void HyperspaceTo(const SBodyPath *path);
96342f3 initial import
tompox authored
78 enum MapView { MAP_NOMAP, MAP_SECTOR, MAP_SYSTEM };
79 static void SetMapView(enum MapView);
f28cbf3 some renaming to conform to NAMING CONVENTION
tompox authored
80 static enum MapView GetMapView() { return mapView; }
96342f3 initial import
tompox authored
81 static void SetView(View *v);
f28cbf3 some renaming to conform to NAMING CONVENTION
tompox authored
82 static View *GetView() { return currentView; }
96342f3 initial import
tompox authored
83 static StarSystem *GetSelectedSystem();
84
fef6df0 add i key to toggle debug messages
tompox authored
85 static bool showDebugInfo;
96342f3 initial import
tompox authored
86 static Player *player;
f28cbf3 some renaming to conform to NAMING CONVENTION
tompox authored
87 static SectorView *sectorView;
88 static SystemInfoView *systemInfoView;
89 static WorldView *worldView;
342b1d6 gas giant stuff. clean up Body a little
tompox authored
90 static ObjectViewerView *objectViewerView;
96342f3 initial import
tompox authored
91 static SpaceStationView *spaceStationView;
40f1abf a little more ship stats. ship info screen. make the ship angular vel…
tompox authored
92 static InfoView *infoView;
96342f3 initial import
tompox authored
93 static ShipCpanel *cpan;
e906e54 single GLUQuadric object. fix ship laser drawing
tompox authored
94 static GLUquadric *gluQuadric;
f28cbf3 some renaming to conform to NAMING CONVENTION
tompox authored
95 static StarSystem *currentSystem;
96342f3 initial import
tompox authored
96 private:
97 static void InitOpenGL();
98 static void HandleEvents();
99
f28cbf3 some renaming to conform to NAMING CONVENTION
tompox authored
100 static View *currentView;
101 static SystemView *systemView;
96342f3 initial import
tompox authored
102
103 static double gameTime;
f28cbf3 some renaming to conform to NAMING CONVENTION
tompox authored
104 static StarSystem *selectedSystem;
105 static enum MapView mapView;
d3785a7 bunch of work on collisions. still doesn't work right. john - see how…
tompox authored
106 static float timeAccel;
96342f3 initial import
tompox authored
107 static float frameTime;
108 static int scrWidth, scrHeight;
109 static float scrAspect;
110 static SDL_Surface *scrSurface;
111 static char keyState[SDLK_LAST];
112 static char mouseButton[5];
113 static int mouseMotion[2];
114 };
115
116 #endif /* _PI_H */
Something went wrong with that request. Please try again.