(svn r127) New feature: ingame console. (sign_de)
Press tab to open the console, more info in docs/console.txt
This commit is contained in:
28
ttd.c
28
ttd.c
@@ -20,7 +20,8 @@
|
||||
#include "hal.h"
|
||||
#include "airport.h"
|
||||
#include "saveload.h"
|
||||
#include "ai.h"
|
||||
#include "ai.h"
|
||||
#include "console.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -74,8 +75,8 @@ void CDECL debug(const char *s, ...)
|
||||
va_start(va, s);
|
||||
vsprintf(buf, s, va);
|
||||
va_end(va);
|
||||
|
||||
fprintf(stderr, "dbg: %s\n", buf);
|
||||
fprintf(stderr, "dbg: %s\n", buf);
|
||||
IConsoleDebug((byte *) &buf);
|
||||
}
|
||||
|
||||
void CDECL ShowInfoF(const char *str, ...)
|
||||
@@ -570,7 +571,7 @@ int ttd_main(int argc, char* argv[])
|
||||
MxInitialize(11025, "sample.cat");
|
||||
|
||||
// This must be done early, since functions use the InvalidateWindow* calls
|
||||
InitWindowSystem();
|
||||
InitWindowSystem();
|
||||
|
||||
GfxLoadSprites();
|
||||
LoadStringWidthTable();
|
||||
@@ -596,8 +597,13 @@ int ttd_main(int argc, char* argv[])
|
||||
NetworkCoreConnectGame("auto",_network_server_port);
|
||||
}
|
||||
}
|
||||
|
||||
// initialize the ingame console
|
||||
IConsoleInit();
|
||||
|
||||
while (_video_driver->main_loop() == ML_SWITCHDRIVER) {}
|
||||
|
||||
IConsoleFree();
|
||||
|
||||
if (_network_available) {
|
||||
// shutdown network-core
|
||||
@@ -636,7 +642,8 @@ void LoadIntroGame()
|
||||
_opt_mod_ptr = &_new_opt;
|
||||
GfxLoadSprites();
|
||||
LoadStringWidthTable();
|
||||
// Setup main window
|
||||
// Setup main window
|
||||
IConsoleClose();
|
||||
InitWindowSystem();
|
||||
SetupColorsAndInitialWindow();
|
||||
|
||||
@@ -665,7 +672,8 @@ void MakeNewGame()
|
||||
|
||||
GfxLoadSprites();
|
||||
|
||||
// Reinitialize windows
|
||||
// Reinitialize windows
|
||||
IConsoleClose();
|
||||
InitWindowSystem();
|
||||
LoadStringWidthTable();
|
||||
|
||||
@@ -692,7 +700,8 @@ void MakeNewEditorWorld()
|
||||
|
||||
GfxLoadSprites();
|
||||
|
||||
// Re-init the windowing system
|
||||
// Re-init the windowing system
|
||||
IConsoleClose();
|
||||
InitWindowSystem();
|
||||
|
||||
// Create toolbars
|
||||
@@ -726,7 +735,8 @@ void StartScenario()
|
||||
|
||||
GfxLoadSprites();
|
||||
|
||||
// Reinitialize windows
|
||||
// Reinitialize windows
|
||||
IConsoleClose();
|
||||
InitWindowSystem();
|
||||
LoadStringWidthTable();
|
||||
|
||||
@@ -775,7 +785,7 @@ bool SafeSaveOrLoad(const char *filename, int mode, int newgm)
|
||||
|
||||
static void SwitchMode(int new_mode)
|
||||
{
|
||||
_in_state_game_loop = true;
|
||||
_in_state_game_loop = true;
|
||||
|
||||
switch(new_mode) {
|
||||
case SM_EDITOR: // Switch to scenario editor
|
||||
|
||||
Reference in New Issue
Block a user