mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r137) Fix: console sometime didn't open (sign_de)
This commit is contained in:
parent
5505a10b80
commit
7701b0a241
11
console.c
11
console.c
@ -16,7 +16,7 @@ static byte* _iconsole_buffer[80];
|
|||||||
static byte _iconsole_cbuffer[80];
|
static byte _iconsole_cbuffer[80];
|
||||||
static byte _iconsole_cmdline[255];
|
static byte _iconsole_cmdline[255];
|
||||||
static byte _iconsole_cmdpos;
|
static byte _iconsole_cmdpos;
|
||||||
static byte _iconsole_mode;
|
static byte _iconsole_mode = ICONSOLE_CLOSED;
|
||||||
static byte _iconsole_color_default = 1;
|
static byte _iconsole_color_default = 1;
|
||||||
static byte _iconsole_color_error = 3;
|
static byte _iconsole_color_error = 3;
|
||||||
static byte _iconsole_color_debug = 5;
|
static byte _iconsole_color_debug = 5;
|
||||||
@ -67,6 +67,7 @@ static void IConsoleWndProc(Window *w, WindowEvent *e)
|
|||||||
switch(e->event) {
|
switch(e->event) {
|
||||||
|
|
||||||
case WE_PAINT:
|
case WE_PAINT:
|
||||||
|
|
||||||
GfxFillRect(w->left,w->top,w->width,w->height-1,0);
|
GfxFillRect(w->left,w->top,w->width,w->height-1,0);
|
||||||
{
|
{
|
||||||
int i=_iconsole_scroll;
|
int i=_iconsole_scroll;
|
||||||
@ -82,10 +83,6 @@ static void IConsoleWndProc(Window *w, WindowEvent *e)
|
|||||||
|
|
||||||
case WE_TICK:
|
case WE_TICK:
|
||||||
|
|
||||||
if (_iconsole_mode==ICONSOLE_OPENING) {
|
|
||||||
_iconsole_mode=ICONSOLE_OPENED;
|
|
||||||
}
|
|
||||||
|
|
||||||
_icursor_counter++;
|
_icursor_counter++;
|
||||||
if (_icursor_counter>_icursor_rate) {
|
if (_icursor_counter>_icursor_rate) {
|
||||||
_icursor_state=!_icursor_state;
|
_icursor_state=!_icursor_state;
|
||||||
@ -223,7 +220,7 @@ void IConsoleSwitch()
|
|||||||
_iconsole_win = AllocateWindowDesc(&_iconsole_window_desc);
|
_iconsole_win = AllocateWindowDesc(&_iconsole_window_desc);
|
||||||
_iconsole_win->height = _screen.height / 3;
|
_iconsole_win->height = _screen.height / 3;
|
||||||
_iconsole_win->width= _screen.width;
|
_iconsole_win->width= _screen.width;
|
||||||
_iconsole_mode=ICONSOLE_OPENING;
|
_iconsole_mode=ICONSOLE_OPENED;
|
||||||
} else
|
} else
|
||||||
if (_iconsole_mode==ICONSOLE_OPENED) {
|
if (_iconsole_mode==ICONSOLE_OPENED) {
|
||||||
DeleteWindow(_iconsole_win);
|
DeleteWindow(_iconsole_win);
|
||||||
@ -237,6 +234,7 @@ void IConsoleSwitch()
|
|||||||
|
|
||||||
void IConsoleClose() {
|
void IConsoleClose() {
|
||||||
if (_iconsole_mode==ICONSOLE_OPENED) IConsoleSwitch();
|
if (_iconsole_mode==ICONSOLE_OPENED) IConsoleSwitch();
|
||||||
|
_iconsole_mode=ICONSOLE_CLOSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IConsoleOpen() {
|
void IConsoleOpen() {
|
||||||
@ -1188,7 +1186,6 @@ static void IConsoleStdLibRegister() {
|
|||||||
var = IConsoleVarAlloc(ICONSOLE_VAR_UINT32);
|
var = IConsoleVarAlloc(ICONSOLE_VAR_UINT32);
|
||||||
IConsoleVarInsert(var,"temp_uint32");
|
IConsoleVarInsert(var,"temp_uint32");
|
||||||
|
|
||||||
|
|
||||||
var = IConsoleVarAlloc(ICONSOLE_VAR_STRING);
|
var = IConsoleVarAlloc(ICONSOLE_VAR_STRING);
|
||||||
IConsoleVarInsert(var,"temp_string");
|
IConsoleVarInsert(var,"temp_string");
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
enum {
|
enum {
|
||||||
ICONSOLE_OPENED=0,
|
ICONSOLE_OPENED=0,
|
||||||
ICONSOLE_CLOSED,
|
ICONSOLE_CLOSED,
|
||||||
ICONSOLE_OPENING,
|
|
||||||
ICONSOLE_CLOSING,
|
|
||||||
} _iconsole_modes;
|
} _iconsole_modes;
|
||||||
|
|
||||||
// ** console parser ** //
|
// ** console parser ** //
|
||||||
|
5
ttd.c
5
ttd.c
@ -642,8 +642,8 @@ void LoadIntroGame()
|
|||||||
_opt_mod_ptr = &_new_opt;
|
_opt_mod_ptr = &_new_opt;
|
||||||
GfxLoadSprites();
|
GfxLoadSprites();
|
||||||
LoadStringWidthTable();
|
LoadStringWidthTable();
|
||||||
|
|
||||||
// Setup main window
|
// Setup main window
|
||||||
IConsoleClose();
|
|
||||||
InitWindowSystem();
|
InitWindowSystem();
|
||||||
SetupColorsAndInitialWindow();
|
SetupColorsAndInitialWindow();
|
||||||
|
|
||||||
@ -673,7 +673,6 @@ void MakeNewGame()
|
|||||||
GfxLoadSprites();
|
GfxLoadSprites();
|
||||||
|
|
||||||
// Reinitialize windows
|
// Reinitialize windows
|
||||||
IConsoleClose();
|
|
||||||
InitWindowSystem();
|
InitWindowSystem();
|
||||||
LoadStringWidthTable();
|
LoadStringWidthTable();
|
||||||
|
|
||||||
@ -701,7 +700,6 @@ void MakeNewEditorWorld()
|
|||||||
GfxLoadSprites();
|
GfxLoadSprites();
|
||||||
|
|
||||||
// Re-init the windowing system
|
// Re-init the windowing system
|
||||||
IConsoleClose();
|
|
||||||
InitWindowSystem();
|
InitWindowSystem();
|
||||||
|
|
||||||
// Create toolbars
|
// Create toolbars
|
||||||
@ -736,7 +734,6 @@ void StartScenario()
|
|||||||
GfxLoadSprites();
|
GfxLoadSprites();
|
||||||
|
|
||||||
// Reinitialize windows
|
// Reinitialize windows
|
||||||
IConsoleClose();
|
|
||||||
InitWindowSystem();
|
InitWindowSystem();
|
||||||
LoadStringWidthTable();
|
LoadStringWidthTable();
|
||||||
|
|
||||||
|
1
window.c
1
window.c
@ -575,6 +575,7 @@ Window *FindWindowFromPt(int x, int y)
|
|||||||
|
|
||||||
void InitWindowSystem()
|
void InitWindowSystem()
|
||||||
{
|
{
|
||||||
|
IConsoleClose();
|
||||||
memset(&_windows, 0, sizeof(_windows));
|
memset(&_windows, 0, sizeof(_windows));
|
||||||
_last_window = _windows;
|
_last_window = _windows;
|
||||||
memset(_viewports, 0, sizeof(_viewports));
|
memset(_viewports, 0, sizeof(_viewports));
|
||||||
|
Loading…
Reference in New Issue
Block a user