🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.games.duke3d
Article #78621

Re: QUERY: programming duke graphics help...woes :S

#78621
From: Tom Breton
Date: Fri, 10 Feb 2006 00:37
29 lines
1873 bytes
In article <1138972342.009774.60130@g44g2000cwa.googlegroups.com>,
KevinGPO <kevingpo@hotmail.com> wrote:
>I just programming Duke Nukem 3D source code and trying to understand
>the drawing graphics routines. In the (game folder) game.c: main()

Haven't looked at them carefully enough to answer you.

[...]
>Other queries:
>1. What is significant with show2dsector[i>>3]&(1<<(i&7)) ? I see this
>pattern all over the place to test/decide whether to show a map object
>or not. However I do not understand why bit-shift to the right 3
>places, and bitmask AND on 7, then bit-shift to left by 1 place?

I'm answering on the fly, so please excuse any misformatting.

He's using the lower 3 bits of "i" to select a bit in the rest of i.  

>
>2. What is significant with calling the sintable[(spr->ang)&2047] with
>2047 all the time?
>

It masks out unwanted bits that are too high, thus it prevents the table from being accessed with too-large indexes by accident.  


HTH.

Tom, the calm-eyed visionary
Technical Details
Message-ID: <dsgn7f$dal$1@reader2.panix.com>
Path: mbox-mo1.pugleaf.net!number1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.maxwell.syr.edu!panix!not-for-mail
References: <1138972342.009774.60130@g44g2000cwa.googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!number1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.maxwell.syr.edu!panix!not-for-mail
From: tehom@panix.com (Tom Breton)
Newsgroups: alt.games.duke3d.editing,alt.games.duke3d
Subject: Re: QUERY: programming duke graphics help...woes :S
Date: Fri, 10 Feb 2006 00:37:03 +0000 (UTC)
Organization: Public Access Networks Corp.
Lines: 32
Message-ID: <dsgn7f$dal$1@reader2.panix.com>
References: <1138972342.009774.60130@g44g2000cwa.googlegroups.com>
NNTP-Posting-Host: panix2.panix.com
X-Trace: reader2.panix.com 1139531823 13653 166.84.1.2 (10 Feb 2006 00:37:03 GMT)
X-Complaints-To: abuse@panix.com
NNTP-Posting-Date: Fri, 10 Feb 2006 00:37:03 +0000 (UTC)
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit