home *** CD-ROM | disk | FTP | other *** search
- /* Functionsprototypen, Makros, Structuren und Globalvariablen für
- * Grafikfunktionen in Turtle.
- */
-
- /* Nur einmal einfügen */
- #ifndef TURTLE_H
- #define TURTLE_H
-
- /* Initialisieren und Vorgaben einrichten */
- short InitTurtle( struct videoconfig *vc );
- short Home();
-
- /* Stift und Farben steuern */
- int StiftStatus( int status );
- short AusFuellung( short status );
- short StiftFarbe( short atrib );
- short RandFarbe( short rand );
-
- /* Winkel bestimmen */
- short Schwenken( short winkel );
- short Richtung( short winkel );
-
- /* Turtle-Bewegung */
- short Bewege( double entfernung );
- short GeheZu( double x, double y );
- short Poly( int nummer, double seite );
-
- /* Farbindex oder -wert weiterdrehen */
- short FarbIndexWeiter( short fiGgw );
- void FarbWertWeiter( int fAktion );
-
- /* Zeichnet Kreis mit Radius <r> an gegenwärtiger Position. */
- #define Kreis( r ) _ellipse_w( tc.fFuell, tc.xGgw-(r), tc.yGgw-(r), \
- tc.xGgw+(r), tc.yGgw+(r) )
-
- /* Zeichnet Ellipse der Breite <b> und Höhe <h> an gegenwärtiger Position. */
- #define Ellipse( b, h ) _ellipse_w( tc.fFuell, \
- tc.xGgw-((b)/2), tc.yGgw-((h)/2), \
- tc.xGgw+((b)/2), tc.yGgw+((h)/2) )
-
- /* Legt die Mitte eines Rechtecks der Breite <b> und Höhe <h>
- * zu gegenwärtigen Position.
- */
- #define Rechteck( b, h ) _rectangle_w( tc.fFuell, \
- tc.xGgw-((b)/2), tc.yGgw-((h)/2), \
- tc.xGgw+((b)/2), tc.yGgw+((h)/2) )
-
- /* Holt Größe eines Bildes der Breite <b> und Höhe <h>, wobei die linke
- * obere Ecke an gegenwärtiger Position liegt. Ergibt Abbildgröße.
- */
- #define BildGroesse( b, h ) _imagesize_w( tc.xGgw, tc.yGgw, \
- tc.xGgw+(b), tc.yGgw+(h) )
-
- /* Holt ein Bild der Breite <b> und Höhe <h>, wobei die linke obere
- * Ecke an gegenwärtiger Position liegt. Ergibt Bild-Zwischenspeicher.
- */
- #define BildHolen( b,h,buf) _getimage_w( tc.xGgw, tc.yGgw, \
- tc.xGgw+(b), tc.yGgw+(h), buf )
-
- /* Legt mittels angegebenem Vorgang (_GPSET, _GPRESET, _GAND, _GOR, _GXOR)
- * die linke obere Ecke eines bestimmten Bildes zur gegenwärtigen Position.
- */
- #define BildPos( buf, act ) _putimage_w( tc.xGgw, tc.yGgw, buf, act )
-
- /* Auffüllen von gegenwärtiger Position an bis zum Rand. */
- #define Fuellen() _floodfill_w( tc.xGgw, tc.yGgw, tc.fiRand )
-
- /* Ergibt Wert ungleich Null, wenn gegenwärtige Position auf Bildschirm ist. */
- #define AufBildsch() (!((tc.xGgw < -tc.xMax) || (tc.xGgw > tc.xMax) || \
- (tc.yGgw < -tc.yMax) || (tc.yGgw > tc.yMax)))
-
- /* Ergibt long int aus Rot-, Grün und Blau-Bytes. */
- #define RGB( r,g,b) (((long)((b) << 8 | (g)) << 8) | (r))
-
- /* Konstanten */
- #define CIRCUMFERENCE 360
- #define HALFCIRCUMFERENCE 180
-
- #define VORGABE -1
- #define GRENZE 0
- #define WAHR 1
- #define FALSCH 0
- #define WEISS (tc.afi - 1)
-
- /* Strukturen für Konfiguration und andere Daten */
- typedef struct _TURTLE
- {
- double yxSeitenvh; /* Seitenverhältnis Y - X */
- double xMax, yMax; /* Maximum x und y */
- double yEinheit; /* Größe eines Bildpunkte */
- double xGgw, yGgw; /* Gegenwärtige Position */
- short afi; /* Anzahl der Farbindizes */
- short afw; /* Anzahl der Farbwerte */
- short fiGgw; /* Gegenwärtiger Farbindex */
- short fiRand; /* Gegenwärtiger Rand-Farbindex */
- short wklGgw; /* Gegenwärtiger Winkel */
- int fStiftStatus; /* Stift-Status */
- int fFuell; /* Füll-Status */
- int fPalette; /* Verfügbare Paletten */
- short xsLinks, xsRechts; /* Absolute Eckwerte des Fensters */
- short ysOben, ysUnten;
- } TURTLE;
-
- extern TURTLE tc;
-
- #endif /* TURTLE_H */
-