home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks96 / FinderFlocks.sit / FinderFlocks / FlockUtils.h < prev    next >
C/C++ Source or Header  |  1996-06-22  |  1KB  |  46 lines

  1. #pragma once
  2.  
  3. #include "FlockTypes.h"
  4.  
  5. /* The flock actually deals with this block, but everybody needs to know about it */
  6. typedef struct  // These all range from 0 to 100, inclusive, like the After Dark sliders
  7. {
  8.     long    fNumBoidsCtl;
  9.     long    fBoidTypeCtl;
  10.     double    fComfyDistCtl;
  11.     double    fAwareDistCtl;
  12.     double    fAvoidMaxCtl;
  13.     double    fMatchMaxCtl;
  14.     double    fCenterMaxCtl;
  15.     double    fMaxEffortCtl;
  16.     double    fMaxAccelCtl;
  17.     double    fMaxVelocityCtl;
  18. }ControlRec;
  19.  
  20. typedef struct  // These all range from 0 to 100, inclusive, like the After Dark sliders
  21. {
  22.     short    fNumBoidsCtl;
  23.     short    fBoidTypeCtl;
  24.     short    fScreenCtl;
  25.     short    fComfyDistCtl;
  26.     short    fAwareDistCtl;
  27.     short    fAvoidMaxCtl;
  28.     short    fMatchMaxCtl;
  29.     short    fCenterMaxCtl;
  30.     short    fMaxEffortCtl;
  31.     short    fMaxAccelCtl;
  32.     short    fMaxVelocityCtl;
  33. }ShortControlRec;  // size = 20 bytes
  34.  
  35. // Prototypes for utility functions
  36. short    abs(short i);
  37. void     TwoVecAvg(FloatPoint *a, FloatPoint *b);
  38. double     VecMagSq(double h, double v);
  39. void    Clamp(FloatPoint *vec, double max);
  40. long     BuildMap(Handle *theMap, Rect *theRect, short theDepth);
  41. long         SizePixMap(PixMapHandle ThePix, Rect *TheRect);
  42. long         SizeBitMap(BitMap *TheMap, Rect *TheRect);
  43. void        FlockControlKey(char key);
  44.  
  45. void        GetNewControls(ControlRec *controls, long type);
  46. void        DrawControlValues(Rect *screenRect);