Talk:Developer mode

From DoomWiki.org

Revision as of 20:34, 19 September 2007 by 71.58.109.233 (talk) (New page: Source for formula is from linuxdoom-1.10. i_video.c:365 <code><pre> i = I_GetTime(); tics = i - lasttic; lasttic = i; if (tics > 20) tics = 20; for (i=0 ; i<tics*2 ; i+=2) screens[0]...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Source for formula is from linuxdoom-1.10.

i_video.c:365

i = I_GetTime();
tics = i - lasttic;
lasttic = i;
if (tics > 20) tics = 20;

for (i=0 ; i<tics*2 ; i+=2)
  screens[0][ (SCREENHEIGHT-1)*SCREENWIDTH + i] = 0xff;
for ( ; i<20*2 ; i+=2)
  screens[0][ (SCREENHEIGHT-1)*SCREENWIDTH + i] = 0x0;

I_GetTime returns time elapsed from an arbitrary starting point in units of 1/TICRATE seconds, with TICRATE = 35 (don't believe i_system.c:87). So i gets assigned the number of tics that have occured since the last time a frame update finished, and then the code prints exactly i pink dots. If it takes i * 1/TICRATE seconds to make each frame, then the number of frames per second is TICRATE / i (factor label; just flip). 71.58.109.233 02:34, 20 September 2007 (UTC)