integrated console
This was SVN commit r369.
This commit is contained in:
parent
b82d4dd4b3
commit
62b8deb03d
@ -12,11 +12,13 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "lib.h"
|
#include "lib.h"
|
||||||
#include "posix.h"
|
|
||||||
#include "res/res.h"
|
#include "res/res.h"
|
||||||
#ifdef _M_IX86
|
#ifdef _M_IX86
|
||||||
#include "sysdep/ia32.h"
|
#include "sysdep/ia32.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "ps/CConsole.h"
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "MapReader.h"
|
#include "MapReader.h"
|
||||||
#include "Terrain.h"
|
#include "Terrain.h"
|
||||||
@ -38,6 +40,9 @@
|
|||||||
#include "gui/GUI.h"
|
#include "gui/GUI.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
CConsole* g_Console = 0;
|
||||||
|
extern bool conInputHandler(const SDL_Event& ev);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
u32 game_ticks;
|
u32 game_ticks;
|
||||||
@ -78,6 +83,15 @@ extern int dir_add_watch(const char* const dir, bool watch_subdirs);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Testing (void)
|
||||||
|
{
|
||||||
|
g_Console->InsertMessage("Testing Function Registration");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int write_sys_info()
|
static int write_sys_info()
|
||||||
{
|
{
|
||||||
get_gfx_info();
|
get_gfx_info();
|
||||||
@ -183,6 +197,7 @@ static bool handler(const SDL_Event& ev)
|
|||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
c = ev.key.keysym.sym;
|
c = ev.key.keysym.sym;
|
||||||
keys[c] = true;
|
keys[c] = true;
|
||||||
|
|
||||||
switch(c)
|
switch(c)
|
||||||
{
|
{
|
||||||
case SDLK_ESCAPE:
|
case SDLK_ESCAPE:
|
||||||
@ -349,6 +364,7 @@ static void Render()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
g_Console->Render();
|
||||||
|
|
||||||
// restore
|
// restore
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@ -527,6 +543,8 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
font = font_load("fonts/verdana.fnt");
|
font = font_load("fonts/verdana.fnt");
|
||||||
|
|
||||||
|
g_Console = new CConsole;
|
||||||
|
|
||||||
// create renderer
|
// create renderer
|
||||||
new CRenderer;
|
new CRenderer;
|
||||||
|
|
||||||
@ -587,9 +605,13 @@ if(!g_MapFile)
|
|||||||
in_add_handler(handler);
|
in_add_handler(handler);
|
||||||
in_add_handler(terr_handler);
|
in_add_handler(terr_handler);
|
||||||
|
|
||||||
|
in_add_handler(conInputHandler);
|
||||||
|
|
||||||
// render everything to a blank frame to force renderer to load everything
|
// render everything to a blank frame to force renderer to load everything
|
||||||
RenderNoCull();
|
RenderNoCull();
|
||||||
|
|
||||||
|
g_Console->RegisterFunc(Testing, "Testing");
|
||||||
|
|
||||||
|
|
||||||
// fixed timestep main loop
|
// fixed timestep main loop
|
||||||
const double TICK_TIME = 30e-3; // [s]
|
const double TICK_TIME = 30e-3; // [s]
|
||||||
|
Loading…
Reference in New Issue
Block a user