Fix console animation with scr_conspeed <= 0

This commit is contained in:
Andrei Drexler 2023-03-12 11:50:33 +02:00 committed by Ozkan Sezer
parent 64b9818ec3
commit e0469ae4b4

View file

@ -667,7 +667,7 @@ void SCR_SetUpToDrawConsole (void)
{
//johnfitz -- let's hack away the problem of slow console when host_timescale is <0
extern cvar_t host_timescale;
float timescale;
float timescale, conspeed;
//johnfitz
Con_CheckResize ();
@ -689,18 +689,19 @@ void SCR_SetUpToDrawConsole (void)
scr_conlines = 0; //none visible
timescale = (host_timescale.value > 0) ? host_timescale.value : 1; //johnfitz -- timescale
conspeed = (scr_conspeed.value > 0) ? scr_conspeed.value : 1e6f;
if (scr_conlines < scr_con_current)
{
// ericw -- (glheight/600.0) factor makes conspeed resolution independent, using 800x600 as a baseline
scr_con_current -= scr_conspeed.value*(glheight/600.0)*host_frametime/timescale; //johnfitz -- timescale
scr_con_current -= conspeed*(glheight/600.0)*host_frametime/timescale; //johnfitz -- timescale
if (scr_conlines > scr_con_current)
scr_con_current = scr_conlines;
}
else if (scr_conlines > scr_con_current)
{
// ericw -- (glheight/600.0)
scr_con_current += scr_conspeed.value*(glheight/600.0)*host_frametime/timescale; //johnfitz -- timescale
scr_con_current += conspeed*(glheight/600.0)*host_frametime/timescale; //johnfitz -- timescale
if (scr_conlines < scr_con_current)
scr_con_current = scr_conlines;
}