From owner-freebsd-chat Mon Nov 5 17:18:43 2001 Delivered-To: freebsd-chat@freebsd.org Received: from zork.punq.net (punq.net [207.154.84.94]) by hub.freebsd.org (Postfix) with SMTP id EB40237B405 for ; Mon, 5 Nov 2001 17:18:40 -0800 (PST) Received: (qmail 24695 invoked by uid 1000); 6 Nov 2001 01:18:40 -0000 Date: Mon, 5 Nov 2001 17:18:40 -0800 From: Marcus Reid To: Dag-Erling Smorgrav Cc: freebsd-chat@FreeBSD.Org Subject: Re: simplicity_saver Message-ID: <20011105171840.E20245@blazingdot.com> References: <20011104151840.A13030@blazingdot.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from des@ofug.org on Tue, Nov 06, 2001 at 12:42:40AM +0100 Coffee-Level: high Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, Nov 06, 2001 at 12:42:40AM +0100, Dag-Erling Smorgrav wrote: > Marcus Reid writes: > > I thought I'd share this screensaver module that I wrote. I find it > > interesting what the effect is achieved with only a few lines of code, > > yet it looks very complicated. > > Why do you reinitialize the palette to the exact same values for every > frame displayed, instead of initializing it only once at module load > time? That isn't the case. simplicity_initialise() sets blanked = 0; and the palette-setting routine is wrapped in a if (blanked <= 0), and that does a blanked++ at the end. Something calls simplicity_saver() with blank != 0 when the screensaver needs to be displayed, for each frame of animation. The first time through, the palette is set, and each additional time that part is skipped. When finally (someone presses a key or something and) simplicity_saver() is called with blank = 0, blanked is set back to 0 so that the palette and video mode are set next time they're needed. -- Marcus Reid Blazingdot "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin, 1759 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message