From d6aa1e6c85b3e552ff19c570720fcec0bfe5f6c6 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 6 Jan 2007 09:50:02 +0000 Subject: [PATCH] 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 --- polymer/build/src/osd.c | 35 +++++++++++++++++++++++------------ polymer/build/src/polymost.c | 5 +++-- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/polymer/build/src/osd.c b/polymer/build/src/osd.c index 390790e25..1edfb0ecb 100644 --- a/polymer/build/src/osd.c +++ b/polymer/build/src/osd.c @@ -730,21 +730,32 @@ void OSD_Draw(void) osdscroll = 0; else { -/* - int i = getticks(); + + int i = getticks(), j; - if (!osdscrtime) osdscrtime = i; -*/ 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) - osdrowscur -= 1;//(i-osdscrtime)>>3; -/* - if (osdrowscur > osdrows) osdrowscur = osdrows; - if (osdrowscur < -1) osdrowscur = -1; - OSD_Printf("%ld\n",(i-osdscrtime)>>3); - osdscrtime = i; -*/ + { + j = (i-osdscrtime); + while (j > -1) + { + osdrowscur--; + j -= 10; + if (osdrowscur < 1) + break; + } + } + osdscrtime = getticks(); } if (!osdvisible || !osdrowscur) return; diff --git a/polymer/build/src/polymost.c b/polymer/build/src/polymost.c index 416cab1cb..70f9c03ea 100644 --- a/polymer/build/src/polymost.c +++ b/polymer/build/src/polymost.c @@ -149,7 +149,7 @@ GLuint *peels; // peels identifiers GLuint *peelfbos; // peels FBOs identifiers GLuint peelprogram; // ARBfp peeling fragment program -float fogresult; +float fogresult, ofogresult; 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 bglFogf(GL_FOG_DENSITY,0.0f); // no fog globalshade = -128; // fullbright + ofogresult = fogresult; drawpoly(dpx, dpy, n_, method_); // draw them afterwards, then. :) + fogresult = ofogresult; globalshade = shadeforfullbrightpass; - fogcalc(&globalshade, &globalvisibility); bglFogf(GL_FOG_DENSITY, fogresult); fullbrightdrawingpass = 0; }