Archvile
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom General > Doom source code oddity.
 
Author
All times are GMT. The time now is 20:26. Post New Thread    Post A Reply
DuckReconMajor
Forum Spammer


Posts: 3835
Registered: 01-09


I was looking through r_segs.c in the source code and noticed something odd. Take a close look, especially at third 'if' block.
code:
// 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.

Old Post 04-01-10 11:52 #
DuckReconMajor is online now Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Clonehunter
Senior Member


Posts: 1802
Registered: 03-10


Its April already?

Old Post 04-01-10 13:12 #
Clonehunter is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
DuckReconMajor
Forum Spammer


Posts: 3835
Registered: 01-09


No, that's just when this part of the source was written in '93.

Old Post 04-01-10 13:15 #
DuckReconMajor is online now Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
andrewj
Senior Member


Posts: 1379
Registered: 04-02


By golly who'd ever knew that source code could be the object of such a wondrously funny jape. Damn good show I say!

Old Post 04-02-10 04:12 #
andrewj is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Kyka
Loser


Posts: 1846
Registered: 06-08


Posting in this thread for no good reason.





Also... Headcrabs.

Old Post 04-02-10 07:51 #
Kyka is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
esselfortium
Cumulonimbus Antagonistic Posting


Posts: 5268
Registered: 01-02


idgi

Old Post 04-02-10 08:41 #
esselfortium is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
baronofheck82
Junior Member


Posts: 122
Registered: 02-10


Reading source code for me is like reading Latin. Looks cool, but makes no sense :P

Old Post 04-02-10 15:58 #
baronofheck82 is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 4614
Registered: 08-00



baronofheck82 said:
Reading source code for me is like reading Latin. Looks cool, but makes no sense :P

My current favorite chunk:
code:
for(shift = 28; shift >= 0; shift -= 4) *c++ = "0123456789abcdef"[(hash->digest[i] >> shift) & 0x0F];

Old Post 04-02-10 19:40 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Scet
Member


Posts: 456
Registered: 05-06



Quasar said:
code:
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.

Old Post 04-02-10 20:23 #
Scet is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Mechadon
Senior Member


Posts: 1787
Registered: 12-06


I guess you have to be smart to get it.

Welp :(

Old Post 04-02-10 20:33 #
Mechadon is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 7040
Registered: 07-07



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...

Old Post 04-02-10 21:00 #
Gez is online now Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 20:26. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom General > Doom source code oddity.

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory