File: lsys.h

package info (click to toggle)
xfractint 20.4.10-2.1
  • links: PTS
  • area: non-free
  • in suites: bullseye
  • size: 4,720 kB
  • sloc: ansic: 77,316; asm: 430; cpp: 425; makefile: 379; sh: 38
file content (89 lines) | stat: -rw-r--r-- 2,824 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* lsys.h
 *      Header file for L-system code.
 *      Nicholas Wilt, 6/26/93.
 */

#ifndef LSYS_H
#define LSYS_H


#define size    ssize
/* Needed for use of asm -- helps decide which pointer to function
 * to put into the struct lsys_cmds.
 */

/* Macro to take an FP number and turn it into a
 * 16/16-bit fixed-point number.
 */
#define FIXEDMUL        524288L
#define FIXEDPT(x)      ((long) (FIXEDMUL * (x)))

/* The number by which to multiply sines, cosines and other
 * values with magnitudes less than or equal to 1.
 * sins and coss are a 3/29 bit fixed-point scheme (so the
 * range is +/- 2, with good accuracy.  The range is to
 * avoid overflowing when the aspect ratio is taken into
 * account.
 */
#define FIXEDLT1        536870912.0

#define ANGLE2DOUBLE    (2.0*PI / 4294967296.0)

#define MAXRULES 27 /* this limits rules to 25 */
#define MAX_LSYS_LINE_LEN 255 /* this limits line length to 255 */

struct lsys_turtlestatei {
    char counter, angle, reverse, stackoflow;
    /* dmaxangle is maxangle - 1 */
    char maxangle, dmaxangle, curcolor, dummy;  /* dummy ensures longword alignment */
    long size;
    long realangle;
    long xpos, ypos; /* xpos and ypos are long, not fixed point */
    long xmin, ymin, xmax, ymax; /* as are these */
    long aspect; /* aspect ratio of each pixel, ysize/xsize */
    long num;
};

struct lsys_turtlestatef {
    char counter, angle, reverse, stackoflow;
    /* dmaxangle is maxangle - 1 */
    char maxangle, dmaxangle, curcolor, dummy;  /* dummy ensures longword alignment */
    LDBL size;
    LDBL realangle;
    LDBL xpos, ypos;
    LDBL xmin, ymin, xmax, ymax;
    LDBL aspect; /* aspect ratio of each pixel, ysize/xsize */
    union {
        long n;
        LDBL nf;
    } parm;
};

extern char maxangle;

/* routines in lsysa.asm */

#ifdef XFRACT
#define lsysi_doat_386 lsys_doat
#define lsysi_dosizegf_386 lsys_dosizegf
#define lsysi_dodrawg_386 lsys_dodrawg
#else
extern void lsysi_doat_386(struct lsys_turtlestatei *cmd);
extern void lsysi_dosizegf_386(struct lsys_turtlestatei *cmd);
extern void lsysi_dodrawg_386(struct lsys_turtlestatei *cmd);
#endif

/* routines in lsysaf.asm */

extern void lsys_prepfpu(struct lsys_turtlestatef *);
extern void lsys_donefpu(struct lsys_turtlestatef *);

/* routines in lsysf.c */

extern struct lsys_cmd far * _fastcall drawLSysF(struct lsys_cmd far *command,struct lsys_turtlestatef *ts, struct lsys_cmd far **rules,int depth);
extern int _fastcall lsysf_findscale(struct lsys_cmd far *command, struct lsys_turtlestatef *ts, struct lsys_cmd far **rules, int depth);
extern struct lsys_cmd far *LSysFSizeTransform(char far *s, struct lsys_turtlestatef *ts);
extern struct lsys_cmd far *LSysFDrawTransform(char far *s, struct lsys_turtlestatef *ts);
extern void _fastcall lsysf_dosincos(void);

#endif