home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 145.lha / TableCloth / tablecloth.doc < prev    next >
Encoding:
Text File  |  1986-11-21  |  6.1 KB  |  146 lines

  1.  
  2. TABLECLOTH - load a picture into the Workbench screen
  3. ----------
  4. (you may wish to abbreviate it as "TC")
  5.  
  6. Usage: tablecloth [-b] [-0 hhh] [-1 hhh] <filename>
  7.  
  8. hhh = 3 digit hex number representing RGB value
  9.  
  10. b : change Workbench background colour to that from file
  11. 0 : use this colour instead of that from file as background
  12. 1 : use this colour instead of that from file as pen #1
  13.  
  14. Thus you can choose a monochrome image and select your favourite foreground
  15. & background colours with it. Note that you should try to keep a good
  16. contrast with the 4 primary Workbench colours.
  17.  
  18. The Story of TableCloth
  19. -----------------------
  20.  
  21.     For many months now I've heard of how the Mac could load a picture into
  22. its main screen to serve as a background. There has been quite a bit of
  23. discussion about how to do this on the Amiga, and 2 programs (Bkdrop and
  24. DropCloth) which purported to do something similar. Both were unsatisfactory
  25. to me -- either they would crash, or they would only work with Workbench
  26. loaded, or else they wouldn't work with icons moving around.
  27.  
  28.     About 2 months ago I was cleaning out an account I had forgotten about,
  29. one which I had used to store Amiga programs before downloading them from
  30. the university system. These were OLD programs, I mean like Fish disk #1
  31. vintage. But some of them looked interesting, and many I had never actually
  32. compiled and run because they were over my head at the time I got them. One
  33. such was called "DualPF.c" by Jim Macraz. When I compiled and ran it, presto
  34. there was an image on my Workbench screen in a new colour!
  35.  
  36.     The discussions continued; Mac owners continued to snicker. Amiga owners
  37. everywhere suffered with bland Workbench screens.
  38.  
  39.     I decided to write my own screen-overlay program. The outline I came up
  40. with in 5 minutes is almost exactly the same as the finished program you
  41. now have. But when I went looking for just a simple IFF reader routine...
  42. "thousands and thousands of lines" later, I was not pleased. Nothing that
  43. I could pick up and put down inside my own program, not one blessed example!
  44. My program was going to deal with different size depth pictures in a way
  45. other than a fatal error message - was I alone in my quest? This program got
  46. put to the very back of the burner.
  47.  
  48.     Then a new version of DropCloth came out (by Eric Lavitzky and Perry
  49. Kivolowitz). I thought it might render my own program idea redundant, but
  50. sadly it suffered from what I considered the same limitations as the earlier
  51. programs, except it didn't crash. Also it consumed 100K of memory and didn't
  52. work with different sized pictures. When I saw it, a gleam came into my eye.
  53. No way were the Mac owners going to laugh behind their hands any longer! I
  54. was going to write this program if it killed me!
  55.  
  56.     The outline was already conceived; all that remained was a decent IFF
  57. read routine, so I had to make one fast. Seizing the nearest code example
  58. (from Leo Schwab's IFF reader), working from memory on all the rest, I set
  59. to work. All day, odd sounds emanated from the laboratory:
  60.  
  61. chunk... chunk... chunk... BOING! BOING! chunk... *BOING! BOING!*
  62.  
  63.     In the grand naming tradition of SunMouse -> MoonMouse -> HeliosMouse,
  64.     I've named it after DropCloth... "TableCloth" ;-) !
  65.  
  66.     Now here it is. It has been tested with what I had around:
  67.     - all sizes and depths of pictures; 640X200, 640X400, overscan, 320X200,
  68.       etc.
  69.     - with DropShadow which uses a similar technique (adds more colours
  70.       to the WB screen)
  71.     - not with morerows
  72.  
  73.     It uses 50K for a 4-colour picture on a 640X200 WB. Memory use varies
  74.     as you would expect with different pictures/options, such as a 1-plane
  75.     image.
  76.  
  77.     Mucho debugging info is included in the source. Ctrl-c is supported
  78.     during debugging so you can abort picture load if things start to go
  79.     awry. If "debug(x)" is defined as "puts(x)" in the header file you will
  80.     see the trace messages when the program runs.
  81.  
  82.  
  83. John Russell    12/31/87    (Completed 01/02/87)
  84.  
  85. Options Implemented
  86. -------------------
  87.  
  88. - load 1 or 2 bitplane image with true colours, deeper images with
  89.   bitplanes truncated to 2
  90. - free second bitplane if it isn't needed
  91. - change Workbench background colour to pic background colour or not
  92. - specify colour for background and/or pen #1 via command line
  93.  
  94. Credits
  95. -------
  96.  
  97. IFF read routines adapted from a program by Leo Schwab
  98. GetOpt ported from Unix by Adam Levin
  99. Dual-playfield code from an example by Jim Mackraz
  100.  
  101. /*------------------------------------------------------------------------*/
  102.  
  103. This program is © (Copyright) 1987 John Russell
  104.  
  105. Freely redistributable, donation of $15 or so appreciated if you find this
  106. program really neat and use it a lot; any money received will go not to
  107. Iran or Central America, but towards some extra memory :-).
  108.  
  109. Also if you send me a disk with rare or hard to find programs, utilities
  110. that haven't received wide distribution (maybe some you've written yourself)
  111. I will reciprocate with my favourite little-known gems.
  112.  
  113. John Russell
  114. 5 Alderdice Place
  115. St. John's, Newfoundland
  116. Canada    A1B 2P8
  117. (709) 726-7847
  118.  
  119. E-mail: john13@garfield.uucp
  120.     john13@garfield.mun.cdn
  121.  
  122. /*------------------------------------------------------------------------*/
  123.  
  124. Misc
  125. ----
  126.  
  127. Copyright symbols in the source have the eighth bit set, so to preserve them
  128. don't use any filters which only accept straight ASCII (Unix vi and mail will
  129. change the symbol to a single bracket).
  130.  
  131. No warranty either express or implied. I'm sure you can cause the program
  132. to crash if you try, however I haven't crashed it during testing or gotten
  133. any gurus / software errors while writing it.
  134.  
  135. I've compiled it with Aztec C, 32 bit option. It should be convertible to
  136. 16 bits with minor adjustments (left as an exercise :-). Compile all modules
  137. with 32 bits, all standard symbols (eg gfx, intuition) included via a
  138. precompiled include file, and link as TableCloth.
  139.  
  140. Windows whose background pen is 0 will be "transparent". If the image is
  141. distracting to you, select a different pen for the background (if the
  142. program supports it). I'm thinking of looking into doing this with any window,
  143. since it would be helpful for CON: windows and others that don't give you
  144. the option of choosing your pens.
  145.  
  146.