home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d170
/
surf.lha
/
Surf
/
src
/
bezpt.h
< prev
next >
Wrap
C/C++ Source or Header
|
1988-11-22
|
2KB
|
60 lines
#include "fasttrig.h"
/*
* structures and such for manipulating bezier curves
*/
#define MaxSegs 50 /* max number of bezier segments */
typedef struct {
int prev2; /* second control point of segment n-1 */
int cur0; /* begin of segment n, end of segment n-1 */
int cur1; /* first control point of segment n */
} BezVal;
typedef struct {
BezVal x, y;
} BezCoord;
#define DefBezMeshVal 10
extern BezCoord Bezpt[MaxSegs+1];
extern void SetBezMesh( /* Panel_item, int, struct input_event */);
extern int BezMesh;
extern float BezStepSize;
extern void InitCalcBez( /* void */ );
extern void CalcBezPt(/* float, float *, float * */);
extern void XdrawAllBezSegs(/* void */);
extern void XdrawBezSeg(/* void */);
extern void InitBezPt( /* int, int */);
extern void EditBezPt( /* int, int */);
extern void ResetCurve( /* void */ );
extern int NumBezPts;
extern int ActSeg;
#define GetNumSegs() (NumBezPts-1)
#define ResetActSeg() { ActSeg = 0; }
#define GetCurSeg() (ActSeg)
#define NextSeg() { ActSeg = (ActSeg +1) %(NumBezPts -1); }
#define StartPtX(XSegNo) Bezpt[XSegNo].x.cur0
#define StartPtY(XSegNo) Bezpt[XSegNo].y.cur0
#define Cntrl1X(XSegNo) Bezpt[XSegNo].x.cur1
#define Cntrl1Y(XSegNo) Bezpt[XSegNo].y.cur1
#define Cntrl2X(XSegNo) Bezpt[XSegNo+1].x.prev2
#define Cntrl2Y(XSegNo) Bezpt[XSegNo+1].y.prev2
#define EndPtX(XSegNo) Bezpt[XSegNo+1].x.cur0
#define EndPtY(XSegNo) Bezpt[XSegNo+1].y.cur0
#define DrawControl0() DrawSqr( Bezpt[ActSeg].x.cur1,\
Bezpt[ActSeg].y.cur1, XOR )
#define DrawControl1() DrawSqr( Bezpt[ActSeg+1].x.prev2,\
Bezpt[ActSeg+1].y.prev2, XOR )