home *** CD-ROM | disk | FTP | other *** search
-
- TABLECLOTH - load a picture into the Workbench screen
- ----------
- (you may wish to abbreviate it as "TC")
-
- Usage: tablecloth [-b] [-0 hhh] [-1 hhh] <filename>
-
- hhh = 3 digit hex number representing RGB value
-
- b : change Workbench background colour to that from file
- 0 : use this colour instead of that from file as background
- 1 : use this colour instead of that from file as pen #1
-
- Thus you can choose a monochrome image and select your favourite foreground
- & background colours with it. Note that you should try to keep a good
- contrast with the 4 primary Workbench colours.
-
- The Story of TableCloth
- -----------------------
-
- For many months now I've heard of how the Mac could load a picture into
- its main screen to serve as a background. There has been quite a bit of
- discussion about how to do this on the Amiga, and 2 programs (Bkdrop and
- DropCloth) which purported to do something similar. Both were unsatisfactory
- to me -- either they would crash, or they would only work with Workbench
- loaded, or else they wouldn't work with icons moving around.
-
- About 2 months ago I was cleaning out an account I had forgotten about,
- one which I had used to store Amiga programs before downloading them from
- the university system. These were OLD programs, I mean like Fish disk #1
- vintage. But some of them looked interesting, and many I had never actually
- compiled and run because they were over my head at the time I got them. One
- such was called "DualPF.c" by Jim Macraz. When I compiled and ran it, presto
- there was an image on my Workbench screen in a new colour!
-
- The discussions continued; Mac owners continued to snicker. Amiga owners
- everywhere suffered with bland Workbench screens.
-
- I decided to write my own screen-overlay program. The outline I came up
- with in 5 minutes is almost exactly the same as the finished program you
- now have. But when I went looking for just a simple IFF reader routine...
- "thousands and thousands of lines" later, I was not pleased. Nothing that
- I could pick up and put down inside my own program, not one blessed example!
- My program was going to deal with different size depth pictures in a way
- other than a fatal error message - was I alone in my quest? This program got
- put to the very back of the burner.
-
- Then a new version of DropCloth came out (by Eric Lavitzky and Perry
- Kivolowitz). I thought it might render my own program idea redundant, but
- sadly it suffered from what I considered the same limitations as the earlier
- programs, except it didn't crash. Also it consumed 100K of memory and didn't
- work with different sized pictures. When I saw it, a gleam came into my eye.
- No way were the Mac owners going to laugh behind their hands any longer! I
- was going to write this program if it killed me!
-
- The outline was already conceived; all that remained was a decent IFF
- read routine, so I had to make one fast. Seizing the nearest code example
- (from Leo Schwab's IFF reader), working from memory on all the rest, I set
- to work. All day, odd sounds emanated from the laboratory:
-
- chunk... chunk... chunk... BOING! BOING! chunk... *BOING! BOING!*
-
- In the grand naming tradition of SunMouse -> MoonMouse -> HeliosMouse,
- I've named it after DropCloth... "TableCloth" ;-) !
-
- Now here it is. It has been tested with what I had around:
- - all sizes and depths of pictures; 640X200, 640X400, overscan, 320X200,
- etc.
- - with DropShadow which uses a similar technique (adds more colours
- to the WB screen)
- - not with morerows
-
- It uses 50K for a 4-colour picture on a 640X200 WB. Memory use varies
- as you would expect with different pictures/options, such as a 1-plane
- image.
-
- Mucho debugging info is included in the source. Ctrl-c is supported
- during debugging so you can abort picture load if things start to go
- awry. If "debug(x)" is defined as "puts(x)" in the header file you will
- see the trace messages when the program runs.
-
-
- John Russell 12/31/87 (Completed 01/02/87)
-
- Options Implemented
- -------------------
-
- - load 1 or 2 bitplane image with true colours, deeper images with
- bitplanes truncated to 2
- - free second bitplane if it isn't needed
- - change Workbench background colour to pic background colour or not
- - specify colour for background and/or pen #1 via command line
-
- Credits
- -------
-
- IFF read routines adapted from a program by Leo Schwab
- GetOpt ported from Unix by Adam Levin
- Dual-playfield code from an example by Jim Mackraz
-
- /*------------------------------------------------------------------------*/
-
- This program is © (Copyright) 1987 John Russell
-
- Freely redistributable, donation of $15 or so appreciated if you find this
- program really neat and use it a lot; any money received will go not to
- Iran or Central America, but towards some extra memory :-).
-
- Also if you send me a disk with rare or hard to find programs, utilities
- that haven't received wide distribution (maybe some you've written yourself)
- I will reciprocate with my favourite little-known gems.
-
- John Russell
- 5 Alderdice Place
- St. John's, Newfoundland
- Canada A1B 2P8
- (709) 726-7847
-
- E-mail: john13@garfield.uucp
- john13@garfield.mun.cdn
-
- /*------------------------------------------------------------------------*/
-
- Misc
- ----
-
- Copyright symbols in the source have the eighth bit set, so to preserve them
- don't use any filters which only accept straight ASCII (Unix vi and mail will
- change the symbol to a single bracket).
-
- No warranty either express or implied. I'm sure you can cause the program
- to crash if you try, however I haven't crashed it during testing or gotten
- any gurus / software errors while writing it.
-
- I've compiled it with Aztec C, 32 bit option. It should be convertible to
- 16 bits with minor adjustments (left as an exercise :-). Compile all modules
- with 32 bits, all standard symbols (eg gfx, intuition) included via a
- precompiled include file, and link as TableCloth.
-
- Windows whose background pen is 0 will be "transparent". If the image is
- distracting to you, select a different pen for the background (if the
- program supports it). I'm thinking of looking into doing this with any window,
- since it would be helpful for CON: windows and others that don't give you
- the option of choosing your pens.
-
-