Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Nov 2001 17:18:40 -0800
From:      Marcus Reid <marcus@blazingdot.com>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        freebsd-chat@FreeBSD.Org
Subject:   Re: simplicity_saver
Message-ID:  <20011105171840.E20245@blazingdot.com>
In-Reply-To: <xzpg07sdbtb.fsf@flood.ping.uio.no>; from des@ofug.org on Tue, Nov 06, 2001 at 12:42:40AM %2B0100
References:  <20011104151840.A13030@blazingdot.com> <xzpg07sdbtb.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 06, 2001 at 12:42:40AM +0100, Dag-Erling Smorgrav wrote:
> Marcus Reid <marcus@blazingdot.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011105171840.E20245>