[Add] 'i' to toggle debug info.
[Change] esc to close instead of 'q'
This commit is contained in:
parent
00d8b4fdf7
commit
41050278e8
4
README
4
README
@ -42,7 +42,7 @@ External View:
|
|||||||
Special:
|
Special:
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
q - quit.
|
ESC - quit.
|
||||||
i - show some ugly debug info.
|
i - show some ugly debug info.
|
||||||
|
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user