DuckReconMajor Posted April 1, 2010 I was looking through r_segs.c in the source code and noticed something odd. Take a close look, especially at third 'if' block.// two sided line if (toptexture) { // top wall mid = pixhigh>>HEIGHTBITS; pixhigh += pixhighstep; if (mid >= floorclip[rw_x]) mid = floorclip[rw_x]-1; if (mid >= yl) { dc_yl = yl; dc_yh = mid; dc_texturemid = rw_toptexturemid; dc_source = R_GetColumn(toptexture,texturecolumn); colfunc (); ceilingclip[rw_x] = mid; } else ceilingclip[rw_x] = yl-1; } else { // no top wall if (markceiling) ceilingclip[rw_x] = yl-1; } if (bottomtexture) { // bottom wall mid = (pixlow+HEIGHTUNIT-1)>>HEIGHTBITS; pixlow += pixlowstep; That way of rendering always boggled my mind, but I never noticed they'd stumbled upon something way ahead of their time. Carmack truly was (and of course still is) a genius. But it seems even he wasn't aware how smart he was! Still don't see it? Here's a hint. 0 Share this post Link to post
DuckReconMajor Posted April 1, 2010 No, that's just when this part of the source was written in '93. 0 Share this post Link to post
andrewj Posted April 2, 2010 By golly who'd ever knew that source code could be the object of such a wondrously funny jape. Damn good show I say! 0 Share this post Link to post
Guest Posted April 2, 2010 Posting in this thread for no good reason. Also... Headcrabs. 0 Share this post Link to post
baronofheck82 Posted April 2, 2010 Reading source code for me is like reading Latin. Looks cool, but makes no sense :P 0 Share this post Link to post
Quasar Posted April 2, 2010 baronofheck82 said:Reading source code for me is like reading Latin. Looks cool, but makes no sense :P My current favorite chunk:for(shift = 28; shift >= 0; shift -= 4) *c++ = "0123456789abcdef"[(hash->digest[i] >> shift) & 0x0F]; 0 Share this post Link to post
Scet Posted April 2, 2010 Quasar said:for(shift = 28; shift >= 0; shift -= 4) *c++ = "0123456789abcdef"[(hash->digest[i] >> shift) & 0x0F]; Is that from Doom? It looks like some kind of integer to hex string conversion. baronofheck82 said:Reading source code for me is like reading Latin. I'd say reading other peoples source code is like reading Latin. 0 Share this post Link to post
Mechadon Posted April 2, 2010 I guess you have to be smart to get it. Welp :( 0 Share this post Link to post
Gez Posted April 2, 2010 Scet said:Is that from Doom? It looks like some kind of integer to hex string conversion. It's from EE, of course. Recent revisions have been on a branch where many arrays are being converted to hashes. There aren't many hashes in vanilla Doom... 0 Share this post Link to post