1 |
greg |
1.1 |
#ifndef lint |
2 |
greg |
2.9 |
static const char RCSid[] = "$Id$"; |
3 |
greg |
1.1 |
#endif |
4 |
|
|
/* |
5 |
|
|
* Initialize ofun[] list for renderers |
6 |
|
|
*/ |
7 |
|
|
|
8 |
greg |
2.9 |
#include "copyright.h" |
9 |
greg |
2.7 |
|
10 |
greg |
1.1 |
#include "standard.h" |
11 |
|
|
|
12 |
|
|
#include "otypes.h" |
13 |
|
|
|
14 |
greg |
1.2 |
#include "otspecial.h" |
15 |
|
|
|
16 |
greg |
1.1 |
extern int o_sphere(); |
17 |
|
|
extern int o_face(); |
18 |
|
|
extern int o_cone(); |
19 |
|
|
extern int o_instance(); |
20 |
greg |
2.9 |
extern int o_mesh(); |
21 |
greg |
1.1 |
extern int m_light(); |
22 |
|
|
extern int m_normal(); |
23 |
greg |
2.2 |
extern int m_aniso(); |
24 |
greg |
1.1 |
extern int m_dielectric(); |
25 |
greg |
2.4 |
extern int m_mist(); |
26 |
greg |
1.1 |
extern int m_glass(); |
27 |
|
|
extern int m_clip(); |
28 |
greg |
1.5 |
extern int m_mirror(); |
29 |
greg |
1.6 |
extern int m_direct(); |
30 |
greg |
1.1 |
extern int m_brdf(); |
31 |
greg |
2.3 |
extern int m_brdf2(); |
32 |
greg |
1.1 |
extern int t_func(), t_data(); |
33 |
|
|
extern int p_cfunc(), p_bfunc(); |
34 |
|
|
extern int p_pdata(), p_cdata(), p_bdata(); |
35 |
gwlarson |
2.6 |
extern int mx_func(), mx_data(), mx_pdata(); |
36 |
greg |
2.5 |
extern int do_text(); |
37 |
greg |
1.1 |
|
38 |
|
|
FUN ofun[NUMOTYPE] = INIT_OTYPE; |
39 |
|
|
|
40 |
|
|
|
41 |
|
|
initotypes() /* initialize ofun array */ |
42 |
|
|
{ |
43 |
|
|
ofun[OBJ_SPHERE].funp = |
44 |
|
|
ofun[OBJ_BUBBLE].funp = o_sphere; |
45 |
|
|
ofun[OBJ_FACE].funp = o_face; |
46 |
|
|
ofun[OBJ_CONE].funp = |
47 |
|
|
ofun[OBJ_CUP].funp = |
48 |
|
|
ofun[OBJ_CYLINDER].funp = |
49 |
|
|
ofun[OBJ_TUBE].funp = |
50 |
|
|
ofun[OBJ_RING].funp = o_cone; |
51 |
|
|
ofun[OBJ_INSTANCE].funp = o_instance; |
52 |
greg |
2.9 |
ofun[OBJ_MESH].funp = o_mesh; |
53 |
greg |
1.1 |
ofun[MAT_LIGHT].funp = |
54 |
|
|
ofun[MAT_ILLUM].funp = |
55 |
|
|
ofun[MAT_GLOW].funp = |
56 |
|
|
ofun[MAT_SPOT].funp = m_light; |
57 |
|
|
ofun[MAT_PLASTIC].funp = |
58 |
|
|
ofun[MAT_METAL].funp = |
59 |
|
|
ofun[MAT_TRANS].funp = m_normal; |
60 |
greg |
1.2 |
ofun[MAT_TRANS].flags |= T_IRR_IGN; |
61 |
greg |
2.2 |
ofun[MAT_PLASTIC2].funp = |
62 |
|
|
ofun[MAT_METAL2].funp = |
63 |
|
|
ofun[MAT_TRANS2].funp = m_aniso; |
64 |
|
|
ofun[MAT_TRANS2].flags |= T_IRR_IGN; |
65 |
greg |
1.1 |
ofun[MAT_DIELECTRIC].funp = |
66 |
|
|
ofun[MAT_INTERFACE].funp = m_dielectric; |
67 |
greg |
1.2 |
ofun[MAT_DIELECTRIC].flags |= T_IRR_IGN; |
68 |
|
|
ofun[MAT_INTERFACE].flags |= T_IRR_IGN; |
69 |
greg |
2.4 |
ofun[MAT_MIST].funp = m_mist; |
70 |
|
|
ofun[MAT_MIST].flags |= T_IRR_IGN; |
71 |
greg |
1.1 |
ofun[MAT_GLASS].funp = m_glass; |
72 |
greg |
1.2 |
ofun[MAT_GLASS].flags |= T_IRR_IGN; |
73 |
greg |
1.5 |
ofun[MAT_MIRROR].funp = m_mirror; |
74 |
greg |
1.6 |
ofun[MAT_DIRECT1].funp = |
75 |
|
|
ofun[MAT_DIRECT2].funp = m_direct; |
76 |
greg |
1.1 |
ofun[MAT_CLIP].funp = m_clip; |
77 |
greg |
2.3 |
ofun[MAT_BRTDF].funp = m_brdf; |
78 |
greg |
1.1 |
ofun[MAT_PFUNC].funp = |
79 |
|
|
ofun[MAT_MFUNC].funp = |
80 |
|
|
ofun[MAT_PDATA].funp = |
81 |
greg |
1.4 |
ofun[MAT_MDATA].funp = |
82 |
|
|
ofun[MAT_TFUNC].funp = |
83 |
greg |
2.3 |
ofun[MAT_TDATA].funp = m_brdf2; |
84 |
greg |
1.1 |
ofun[TEX_FUNC].funp = t_func; |
85 |
|
|
ofun[TEX_DATA].funp = t_data; |
86 |
|
|
ofun[PAT_CFUNC].funp = p_cfunc; |
87 |
|
|
ofun[PAT_BFUNC].funp = p_bfunc; |
88 |
|
|
ofun[PAT_CPICT].funp = p_pdata; |
89 |
|
|
ofun[PAT_CDATA].funp = p_cdata; |
90 |
|
|
ofun[PAT_BDATA].funp = p_bdata; |
91 |
|
|
ofun[PAT_CTEXT].funp = |
92 |
|
|
ofun[PAT_BTEXT].funp = |
93 |
greg |
2.5 |
ofun[MIX_TEXT].funp = do_text; |
94 |
greg |
1.1 |
ofun[MIX_FUNC].funp = mx_func; |
95 |
|
|
ofun[MIX_DATA].funp = mx_data; |
96 |
gwlarson |
2.6 |
ofun[MIX_PICT].funp = mx_pdata; |
97 |
greg |
1.1 |
} |
98 |
|
|
|
99 |
|
|
|
100 |
|
|
o_default() /* default action is error */ |
101 |
|
|
{ |
102 |
|
|
error(INTERNAL, "unexpected object call"); |
103 |
greg |
2.7 |
/* call to pull in freeobjmem.o */ |
104 |
|
|
free_objs(0, 0); |
105 |
greg |
1.1 |
} |