[comp.sys.amiga] Layer IQ Stuff

ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (08/05/87)

In article <2430@ames.arpa> mike@ames.UUCP (Mike Smithwick) writes:
>Also, sometime ago, I asked how one goes around dynamically changing
>a window from SMART to SIMPLE refresh and back again. I got 3 email
>responses, one which said "post your replies, heck, we'd all be interested!"
> [ ... ]
>My other reply from the Guy in the Cape, said "look in your RKM dummy, under
>Layers. . . Try the LAYERSMART/LAYERSIMPLE bit. "
>
>Wellll, HOT DANG, if this didn't work. Thanks Leoooo.
>
	Something you should remember before you go off on a wild spree with
this info.

	Assuming I've divined Dale's thought processes correctly, layers
work on the principle that, whenever a layer is completely visible (SIMPLE
or SMART), there is no extra memory allocated *anywhere* for backup bitmaps.
This, then, is the layer in its purest state.

#define	STUPID		SIMPLE

	Therefore, when changing a layer from SMART to STUPID and back
again, you should bring it to the front (using UpfrontLayer()).  If the
layer was SMART to begin with, this will deallocate any backup bitmaps.

	The theory I'm basing this on is this:  Say a STUPID layer is
partially obscured.  If you twiddle its IQ to SMART, suddnely the
layers.library will expect all these backup bitmaps to be hanging around.
If you then rearrange the layers, exposing parts of our twiddled layer, I'm
certain that the layers.library would get hopelessly confused when it tries
to restore all these backup bitmaps that aren't there.

	Conversely, if you change an obscured layer from SMART to STUPID,
when you expose parts of that layer, I believe the layers.library will
ignore any backup bitmaps that may be there, and you'll lose that chip RAM.

	So.  Bring any layers whose intelligence you wish to change to the
front before operating on them.  This *should* keep everything happy.  Note
that if your system cries "RAPE!" because of this, I've never heard of
USENET :-).

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	ihnp4!ptsfa -\
 \_ -_	 Bike shrunk by popular demand,	      dual ---> !{well,unicom}!ewhac
O----^o	 But it's still the only way to fly.  hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor