[Add] 'i' to toggle debug info.

[Change] esc to close instead of 'q'
This commit is contained in:
Rtch90 2018-01-20 18:28:37 +00:00
parent 00d8b4fdf7
commit 41050278e8
4 changed files with 8 additions and 5 deletions

4
README
View File

@ -42,7 +42,7 @@ External View:
Special: Special:
~~~~~~~~ ~~~~~~~~
q - quit. ESC - quit.
i - show some ugly debug info. i - show some ugly debug info.

View File

@ -73,6 +73,7 @@ public:
static View* GetView(void) { return currentView; } static View* GetView(void) { return currentView; }
static StarSystem* GetSelectedSystem(void); static StarSystem* GetSelectedSystem(void);
static bool showDebugInfo;
static int playerLocSecX; static int playerLocSecX;
static int playerLocSecY; static int playerLocSecY;
static int playerLocSysIdx; static int playerLocSysIdx;

View File

@ -51,6 +51,7 @@ GLUquadric* L3D::gluQuadric;
int L3D::playerLocSecX; int L3D::playerLocSecX;
int L3D::playerLocSecY; int L3D::playerLocSecY;
int L3D::playerLocSysIdx; int L3D::playerLocSysIdx;
bool L3D::showDebugInfo;
void L3D::Init(IniConfig& config) { void L3D::Init(IniConfig& config) {
int width = config.Int("ScrWidth"); int width = config.Int("ScrWidth");
@ -156,7 +157,8 @@ void L3D::HandleEvents(void) {
Gui::HandleSDLEvent(&event); Gui::HandleSDLEvent(&event);
switch(event.type) { switch(event.type) {
case SDL_KEYDOWN: case SDL_KEYDOWN:
if(event.key.keysym.sym == SDLK_q) L3D::Quit(); if(event.key.keysym.sym == SDLK_ESCAPE) L3D::Quit();
if(event.key.keysym.sym == SDLK_i) L3D::showDebugInfo = !L3D::showDebugInfo;
#ifdef DEBUG #ifdef DEBUG
if(event.key.keysym.sym == SDLK_F12) { if(event.key.keysym.sym == SDLK_F12) {
/* Add test object. */ /* Add test object. */
@ -284,7 +286,7 @@ void L3D::MainLoop(void) {
Gui::Draw(); Gui::Draw();
#ifdef DEBUG #ifdef DEBUG
{ if(L3D::showDebugInfo) {
Gui::Screen::EnterOrtho(); Gui::Screen::EnterOrtho();
glColor3f(1, 1, 1); glColor3f(1, 1, 1);
glTranslatef(0, Gui::Screen::GetHeight()-20, 0); glTranslatef(0, Gui::Screen::GetHeight()-20, 0);

View File

@ -234,7 +234,7 @@ void Player::DrawHUD(const Frame* cam_frame) {
glEnd(); glEnd();
} }
{ if(L3D::showDebugInfo) {
char buf[1024]; char buf[1024];
glPushMatrix(); glPushMatrix();
glTranslatef(0, 440, 0); glTranslatef(0, 440, 0);