QUAT - A 3D-Fractal-Generator
Version 0.92
Copyright (C) 1997,98 Dirk Meyer

Additional information to the source code

1. Legal aspects

1.1 Copyright
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed with the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Portions of the code (the color selection tool of the X version, which is in
the directory "contrib_kde") is taken from KDE (K Desktop Environment),
which is also under GNU license.

1.2 Improvement of the source code
If you program some improvements of the source code, I would be glad if you 
contact me, because I could include the them in future versions. (Of course 
I will mention you as the author of these improvements!)
I think of the great example "Fractint", and perhaps there are in this case 
also some enthusiasts out there like me!

1.3 Contact
My email adress is: dirk.meyer@studbox.uni-stuttgart.de
My usual adress:
Dirk Meyer
Marbacher Weg 29
D-71334 Waiblingen
New versions of QUAT are available at:
http://wwwcip.rus.uni-stuttgart.de/~phy11733

As mentioned above, if you find some bugs or program an improved version, 
included the compilation (on which system/compiler did it work, on which not
[and why]?), I would enjoy hearing from you!


2. Compilation of QUAT

To write PNG files QUAT uses a library called "zlib". It is neccessary
to compile the code. (Note: The library "libpng" is _not_ required)
The zlib library serves some general data compression purposes and has
nothing to do with QUAT, QUAT only utilizes it to write PNG files.
It was programmed by Jean-loup Gailly and Mark Adler and isn't included
in the source code of QUAT. If you want to compile QUAT yourself, you 
have to look for the library in the net.
The zlib homepage can be found at: http://www.cdrom.com/pub/infozip/zlib
I used version 1.1.3, but I think other versions will also work.

QUAT can be compiled in many versions. Among others there is a text only 
version which does not show any graphic output. It should compile on any 
system supporting ANSI-C.

An overview over the source tree:
<QuatDir>/src/quatlib
             /gui
                /qtarch
             /contrib_kde
             /util
- The "quatlib" directory contains the main part of the code and the Windows
  version parts. You need files in this directory for _every_ version you
  compile. Files in this directory are C files.
- The "gui" directory (with subdirectory) contains the User Interface for
  X Windows. You need it _only_ if you want to compile the X version.
  Files in this directory are C++.
- The "contrib_kde" directory contains the color selection tool of the X 
  version. (This is the dialog that appears if you click "Sel" in the
  Color Editor of the X version). Files here are C++ and were taken from
  the KDE project (K Desktop Environment), and slightly modified, because
  they are taken out of their context. You _only_ need these files if you
  want to compile the X version of Quat.
- The "util" directory contains the title image compiler. It is used
  to convert a 24bit-true-color png image into a C file which defines an
  array that contains the raw image data as a zlib-compressed stream.
  If you don't want to have a title image, simply rename the file "title.png"
  in the "quatlib"-directory. This may be also necessary if you don't have
  enough memory to compile title.c, which is the file generated by the title
  image compiler.

Under DOS you should note that QUAT uses relatively much memory (compared 
to what is offered by DOS [640k]) and because of this fact it probably can 
not be compiled using real mode compilers - and will not run in real mode 
either. (I don't know, I didn't try).
I recommend "DJGPP", the DOS port of the Unix-GNU-C-Compiler "GCC".
It works in protected mode and I do not expect it to have problems
with memory.

In general you have to compile the zlib library before compiling QUAT.
Instructions on this are included in the library.

If you use the unix makefile ("makefile"), the path of the zlib library and 
its headers has to be given in the makefile.

2.1 Compiling the text only version
After extracting the source code into a directory (best: new one) you have 
to adjust the makefile to your system's requirements (especially the path 
to the zlib library). Thereafter, enter the source root directory (/Quat/src 
for example) and type: 
make textver
This works for unix.
An own project file / makefile has to be created for other compilers.

2.2 Windows version
I used "mingw32" (which is a port of the Unix GCC compiler to Windows)
to compile the Windows version. Its free and you can get it at
http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32
If you also use this compiler, go to the "quatlib" directory and edit the
Makefile to meet you requirements:
1. Adjust path to zlib library
2. remove -lm from linking options. It seems as if mingw32 has included
   the math library in the standard C library...
A problem is the compilation of the resource file quat.rc to quat.res. 
I had to use the resource compiler that comes with MSSDK header files 
(available at Microsofts ftp-server, in a file called "IBLDENV.EXE", if 
I remember it correctly...) To make it easier, a compiled resource file 
"quat.res" comes with Quats source. As long as you dont change 
resources, youll have no problem I hope...
If you want to use MSVC (>=2.0) to compile Quat, create a project file
and add following source files to it: calculat.c, colors.c, files.c, iter.c,
png.c, qmath.c, quat.c, quat.rc, win2.c and winver.c
You have to define the preprocessor symbol "GUI" for that "quat.c" compiles
to a version which uses a GUI.
You also have to specify the path to zlib library and headers.
Note: MSVC 1.0 wont work, as it is 16 bit and Quat is 32 bit code.

2.3 X Window version
(The X Window System is a graphical user interface running under Unix / Linux)
This version needs a library called "Qt". It comes with modern Linux 
distributions, if you dont have it you can get it at
http://www.troll.no
The X Window version of this library is available for free.
Of course, you also need the zlib library as for every other version
of Quat.
You need to compile both C and C++ files to get the X version compiled.
Go to the source root directory (/home/dirk/quat/src for example),
adjust the Makefile (path to "moc", path to "zlib", path to "Qt")
and type
make x11ver
Dialogs have been created with "QtArchitekt", if you want to change
them, use the *.dlg files in the "gui/qtarch" directory.
You wont need QtArchitekt to compile Quat! You should find a link
to QtArchitekt on Troll Techs Homepage at http://www.troll.no

2.4 The DOS version
I used DJGPP 2.02 to compile the DOS version. DOS version is the same
as the text version, with the only difference that you can interrupt
calculation by pressing a key.
Enter the "quatlib" directory, adjust the Makefile and type
make dosver
