More consistent console scroll speed (especially with a low framerate)

This still seems to screw up sometimes.


git-svn-id: https://svn.eduke32.com/eduke32@449 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2007-01-06 09:50:02 +00:00
parent c4868aa2b6
commit d6aa1e6c85
2 changed files with 26 additions and 14 deletions

View file

@ -730,21 +730,32 @@ void OSD_Draw(void)
osdscroll = 0; osdscroll = 0;
else else
{ {
/*
int i = getticks();
if (!osdscrtime) osdscrtime = i; int i = getticks(), j;
*/
if ((osdrowscur < osdrows && osdscroll == 1) || osdrowscur < -1) if ((osdrowscur < osdrows && osdscroll == 1) || osdrowscur < -1)
osdrowscur += 1;//(i-osdscrtime)>>3; {
j = (i-osdscrtime);
while (j > -1)
{
osdrowscur++;
j -= 10;
if (osdrowscur > osdrows-1)
break;
}
}
if ((osdrowscur > -1 && osdscroll == -1) || osdrowscur > osdrows) if ((osdrowscur > -1 && osdscroll == -1) || osdrowscur > osdrows)
osdrowscur -= 1;//(i-osdscrtime)>>3; {
/* j = (i-osdscrtime);
if (osdrowscur > osdrows) osdrowscur = osdrows; while (j > -1)
if (osdrowscur < -1) osdrowscur = -1; {
OSD_Printf("%ld\n",(i-osdscrtime)>>3); osdrowscur--;
osdscrtime = i; j -= 10;
*/ if (osdrowscur < 1)
break;
}
}
osdscrtime = getticks();
} }
if (!osdvisible || !osdrowscur) return; if (!osdvisible || !osdrowscur) return;

View file

@ -149,7 +149,7 @@ GLuint *peels; // peels identifiers
GLuint *peelfbos; // peels FBOs identifiers GLuint *peelfbos; // peels FBOs identifiers
GLuint peelprogram; // ARBfp peeling fragment program GLuint peelprogram; // ARBfp peeling fragment program
float fogresult; float fogresult, ofogresult;
void fogcalc (const signed char *shade, const char *vis) void fogcalc (const signed char *shade, const char *vis)
{ {
@ -1810,9 +1810,10 @@ void drawpoly (double *dpx, double *dpy, long n, long method)
shadeforfullbrightpass = globalshade; // save the current shade shadeforfullbrightpass = globalshade; // save the current shade
bglFogf(GL_FOG_DENSITY,0.0f); // no fog bglFogf(GL_FOG_DENSITY,0.0f); // no fog
globalshade = -128; // fullbright globalshade = -128; // fullbright
ofogresult = fogresult;
drawpoly(dpx, dpy, n_, method_); // draw them afterwards, then. :) drawpoly(dpx, dpy, n_, method_); // draw them afterwards, then. :)
fogresult = ofogresult;
globalshade = shadeforfullbrightpass; globalshade = shadeforfullbrightpass;
fogcalc(&globalshade, &globalvisibility);
bglFogf(GL_FOG_DENSITY, fogresult); bglFogf(GL_FOG_DENSITY, fogresult);
fullbrightdrawingpass = 0; fullbrightdrawingpass = 0;
} }