[Add] 'i' to toggle debug info.
[Change] esc to close instead of 'q'
This commit is contained in:
parent
1663ac1590
commit
47ed4bed2e
4
README
4
README
@ -42,7 +42,7 @@ External View:
|
||||
Special:
|
||||
~~~~~~~~
|
||||
|
||||
q - quit.
|
||||
i - show some ugly debug info.
|
||||
ESC - quit.
|
||||
i - show some ugly debug info.
|
||||
|
||||
|
||||
|
@ -73,6 +73,7 @@ public:
|
||||
static View* GetView(void) { return currentView; }
|
||||
static StarSystem* GetSelectedSystem(void);
|
||||
|
||||
static bool showDebugInfo;
|
||||
static int playerLocSecX;
|
||||
static int playerLocSecY;
|
||||
static int playerLocSysIdx;
|
||||
|
@ -51,6 +51,7 @@ GLUquadric* L3D::gluQuadric;
|
||||
int L3D::playerLocSecX;
|
||||
int L3D::playerLocSecY;
|
||||
int L3D::playerLocSysIdx;
|
||||
bool L3D::showDebugInfo;
|
||||
|
||||
void L3D::Init(IniConfig& config) {
|
||||
int width = config.Int("ScrWidth");
|
||||
@ -156,7 +157,8 @@ void L3D::HandleEvents(void) {
|
||||
Gui::HandleSDLEvent(&event);
|
||||
switch(event.type) {
|
||||
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
|
||||
if(event.key.keysym.sym == SDLK_F12) {
|
||||
/* Add test object. */
|
||||
@ -284,7 +286,7 @@ void L3D::MainLoop(void) {
|
||||
|
||||
Gui::Draw();
|
||||
#ifdef DEBUG
|
||||
{
|
||||
if(L3D::showDebugInfo) {
|
||||
Gui::Screen::EnterOrtho();
|
||||
glColor3f(1, 1, 1);
|
||||
glTranslatef(0, Gui::Screen::GetHeight()-20, 0);
|
||||
|
@ -234,7 +234,7 @@ void Player::DrawHUD(const Frame* cam_frame) {
|
||||
glEnd();
|
||||
}
|
||||
|
||||
{
|
||||
if(L3D::showDebugInfo) {
|
||||
char buf[1024];
|
||||
glPushMatrix();
|
||||
glTranslatef(0, 440, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user