home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / sonderh1 / graf.erw < prev    next >
Text File  |  1987-04-15  |  3KB  |  66 lines

  1. (**************************************************************)
  2. (* GRAFCONS.PAS muss um folgende zwei Konstanten erweitert    *)
  3. (* werden:
  4.  
  5. (*----------------- Polygon-Konstante: -----------------------*)
  6.  
  7.   PolyMax = 100;            (* max. Anzahl von Eckkoordinaten *)
  8.  
  9. (*----------------- Pattern-Konstante: -----------------------*)
  10. (*         Hier fuer ein Muster von 16 x 16 Pixeln.           *)
  11.  
  12.   PatternSize = 15;
  13.  
  14. (**************************************************************)
  15. (* GRAFTYPE.PAS muss um folgende Typen erweitert werden:      *)
  16.  
  17. (*---------------------- Polygon-Typ: ------------------------*)
  18.  
  19.   PolyPunkt = RECORD       (* Punkt-Koordinaten eines Punktes *)
  20.                 x, y: INTEGER;
  21.               END;
  22.   PolyIndex = 1..PolyMax;      (* Indextyp fuer 'Range-Check' *)
  23.   Polygon   = ARRAY [PolyIndex] OF PolyPunkt;
  24.  
  25. (*---------------------- Pattern-Typ: ------------------------*)
  26.  
  27.   PatternIndex = 0..PatternSize;
  28.   Pattern_     = ARRAY [PatternIndex, PatternIndex] OF BOOLEAN;
  29.   (* der Unterstrich hinter Pattern ist bei Turbo wg. einer
  30.      Prozedur gleichen Namens notwendig!                      *)
  31.  
  32. (***************************************************************************)
  33. (* GRAFSYS.PAS muss um folgende zwei Funktionen erweitert werden:          *)
  34.  
  35. (*-------------------------------------------------------------------------*)
  36. (*   Punkt auf den vom System vorgegebenen Bildschirm-Koordinaten testen:  *)
  37. (*   TRUE, wenn Punkt die akt. Farbe von Pen_Color hat, sonst FALSE!       *)
  38. (*   Hier mua die entsprechende Funktion der verw. Implementation entspr.  *)
  39. (*   gegen die Turbo Pascal-Funktion ausgetauscht werden! Eventuell ist    *)
  40. (*   dabei der Krampf mit 'Pen_Color' und 0 und 1 nicht notwendig...       *)
  41.  
  42. FUNCTION GetPixel_System (x: x_Koord_Sys;
  43.                           y: y_Koord_Sys;
  44.                           Color: Sys_Colors): BOOLEAN;
  45.  
  46. BEGIN
  47.   GetPixel_System := (GetDotColor(x,y) > 0) AND (Color = Pen_Color)
  48. END;
  49.  
  50. (*-------------------------------------------------------------------------*)
  51. (*              Punkt unseres Koordinaten-Systems testen:                  *)
  52.  
  53. FUNCTION GetPixel (x: x_Koord; y: y_Koord; Color: Sys_Colors): BOOLEAN;
  54.  
  55. BEGIN
  56.   IF Origin_is_Top THEN
  57.     GetPixel := GetPixel_System(x + ScreenXmin_Sys,
  58.                                 ScreenYmax - y + ScreenYmin_Sys,
  59.                                 Color)
  60.   ELSE
  61.     GetPixel := GetPixel_System(x + ScreenXmin_Sys,
  62.                                 y + ScreenYmin_Sys,
  63.                                 Color)
  64. END;
  65.  
  66. (*-------------------------------------------------------------------------*)