mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 05:31:00 +00:00
- uncouple console's cursor blinking from the game ticker.
This is now done in real time by the drawer.
This commit is contained in:
parent
31fbff85f4
commit
756a743974
4 changed files with 11 additions and 12 deletions
|
@ -65,6 +65,7 @@
|
|||
#include "vm.h"
|
||||
#include "utf8.h"
|
||||
#include "s_music.h"
|
||||
#include "i_time.h"
|
||||
|
||||
|
||||
#include "gi.h"
|
||||
|
@ -108,7 +109,7 @@ int ConWidth;
|
|||
bool vidactive = false;
|
||||
bool cursoron = false;
|
||||
int ConBottom, ConScroll, RowAdjust;
|
||||
int CursorTicker;
|
||||
uint64_t CursorTicker;
|
||||
constate_e ConsoleState = c_up;
|
||||
|
||||
|
||||
|
@ -1036,12 +1037,6 @@ void C_Ticker()
|
|||
}
|
||||
}
|
||||
|
||||
if (--CursorTicker <= 0)
|
||||
{
|
||||
cursoron ^= 1;
|
||||
CursorTicker = C_BLINKRATE;
|
||||
}
|
||||
|
||||
lasttic = consoletic;
|
||||
NotifyStrings.Tick();
|
||||
}
|
||||
|
@ -1239,6 +1234,12 @@ void C_DrawConsole ()
|
|||
{
|
||||
if (gamestate != GS_STARTUP)
|
||||
{
|
||||
auto now = I_msTime();
|
||||
if (now > CursorTicker)
|
||||
{
|
||||
CursorTicker = now + 500;
|
||||
cursoron = !cursoron;
|
||||
}
|
||||
CmdLine.Draw(left, bottomline, textScale, cursoron);
|
||||
}
|
||||
if (RowAdjust && ConBottom >= CurrentConsoleFont->GetHeight()*7/2)
|
||||
|
@ -1712,7 +1713,7 @@ static bool C_HandleKey (event_t *ev, FCommandBuffer &buffer)
|
|||
buffer.AppendToYankBuffer = keepappending;
|
||||
|
||||
// Ensure that the cursor is always visible while typing
|
||||
CursorTicker = C_BLINKRATE;
|
||||
CursorTicker = I_msTime() + 500;
|
||||
cursoron = 1;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -39,8 +39,6 @@
|
|||
|
||||
struct event_t;
|
||||
|
||||
#define C_BLINKRATE (TICRATE/2)
|
||||
|
||||
typedef enum cstate_t
|
||||
{
|
||||
c_up=0, c_down=1, c_falling=2, c_rising=3
|
||||
|
|
|
@ -171,6 +171,7 @@ static FConsoleCommand *ScanChainForName (FConsoleCommand *start, const char *na
|
|||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
bool ParsingKeyConf, UnsafeExecutionContext;
|
||||
FString StoredWarp;
|
||||
|
||||
FConsoleCommand* Commands[FConsoleCommand::HASH_SIZE];
|
||||
|
||||
|
@ -1087,7 +1088,7 @@ bool C_ExecFile (const char *file)
|
|||
exec->ExecCommands();
|
||||
if (exec->Pullins.Size() > 0)
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "Notice: Pullin files were ignored.\n");
|
||||
Printf(TEXTCOLOR_BOLD "Notice: Pullin files were ignored.\n");
|
||||
}
|
||||
delete exec;
|
||||
}
|
||||
|
|
|
@ -252,7 +252,6 @@ int NoWipe; // [RH] Allow wipe? (Needs to be set each time)
|
|||
bool singletics = false; // debug flag to cancel adaptiveness
|
||||
FString startmap;
|
||||
bool autostart;
|
||||
FString StoredWarp;
|
||||
bool advancedemo;
|
||||
FILE *debugfile;
|
||||
FILE *hashfile;
|
||||
|
|
Loading…
Reference in a new issue