1 /* this file contains definition for the screen */
3 #include <aros/oldprograms.h>
5 #include <exec/memory.h>
11 #include "gadgetdef.h"
20 void GadgetSetVal(struct Gadget
*);
21 void GadgetUpdate(struct Gadget
*, bool);
24 * definition for image of hourglass
26 static UWORD HourGlassDat
[] = {
27 0x0, 0x0, 0x0, 0xffff,
28 0x7ffe, 0x8001, 0x6006, 0x9ff9,
29 0x2004, 0x5ffa, 0x1c38, 0x2ff4,
30 0xf70, 0x17e8, 0x7e0, 0xbd0,
31 0x2c0, 0x5a0, 0x240, 0x5a0,
32 0x420, 0xbd0, 0x910, 0x17e8,
33 0x1788, 0x2ff4, 0x2fe4, 0x5ffa,
34 0x7ff6, 0x9ff9, 0x7ffe, 0x8001,
38 UWORD
*HourGlass
= NULL
;
44 * actual gadget definitions
51 * start of boolean gadgets
53 #define BOOLGADFLAGS (RELVERIFY|TOPBORDER)
57 static struct IntuiText TextDefLines
= {
58 -1,-1,JAM1
, 0, TxOff
, NULL
,(UBYTE
*) "Lines", NULL
};
60 static struct Gadget G_DefLines
= {
62 BOOLLEFT
, BOOLTOP
, 5*COL
, ROW
, /* loc and size of hit box */
63 GADGHBOX
, /* complemented when pressed */
64 BOOLGADFLAGS
, /* just get gadget up messages */
74 static struct IntuiText TextEditBez
= {
75 -1,-1,JAM1
, 0, TxOff
, NULL
,(UBYTE
*) "Curves", NULL
};
77 static struct Gadget G_EditBez
= {
79 BOOLLEFT
+COL
*6, BOOLTOP
, 6*COL
, ROW
, /* loc and size of hit box */
80 GADGHBOX
, /* complemented when pressed */
81 RELVERIFY
, /* just get gadget up messages */
91 static struct IntuiText TextMap
= {
92 -1,-1,JAM1
, 0, TxOff
, NULL
,(UBYTE
*) "Map", NULL
};
94 static struct Gadget G_Map
= {
96 BOOLLEFT
+24*COL
, BOOLTOP
, 3*COL
, ROW
, /* loc and size of hit box */
97 GADGHBOX
, /* complemented when pressed */
98 RELVERIFY
, /* just get gadget up messages */
108 static struct IntuiText TextWire
= {
109 -1,-1,JAM1
, 0, TxOff
, NULL
,(UBYTE
*) "Wire", NULL
};
111 static struct Gadget G_Wire
= {
113 BOOLLEFT
+13*COL
, BOOLTOP
, 4*COL
, ROW
, /* loc and size of hit box */
114 GADGHBOX
, /* complemented when pressed */
115 RELVERIFY
, /* just get gadget up messages */
124 static struct IntuiText TextShaded
= {
125 -1,-1,JAM1
, 0, TxOff
, NULL
,(UBYTE
*) "Shade", NULL
};
127 static struct Gadget G_Shaded
= {
129 BOOLLEFT
+18*COL
, BOOLTOP
, 5*COL
, ROW
, /* loc and size of hit box */
130 GADGHBOX
, /* complemented when pressed */
131 RELVERIFY
, /* just get gadget up messages */
140 static struct IntuiText TextGoPanel
= {
141 -1,-1,JAM1
, 0, TxOff
, NULL
,(UBYTE
*) "Panel", NULL
};
143 static struct Gadget G_GoPanel
= {
145 BOOLLEFT
+28*COL
, BOOLTOP
, 5*COL
, ROW
, /* loc and size of hit box */
146 GADGHBOX
, /* complemented when pressed */
147 RELVERIFY
, /* just get gadget up messages */
156 static struct IntuiText TextGoSurf
= {
157 1,-1,JAM1
, 0, TxOff
, NULL
,(UBYTE
*) "Display", NULL
};
159 static short S_GoSurf
[] = {
160 -2,-1, -2,ROW
+1, 7*COL
+2,ROW
+1, 7*COL
+2,-1, -2,-1
163 static struct Border B_GoSurf
= { 0, 0, 1, 0, JAM1
, 5, S_GoSurf
, NULL
};
165 static struct Gadget G_GoSurf
= {
167 2*COL
, TOP
, 7*COL
, ROW
, /* loc and size of hit box */
168 GADGHBOX
, /* complemented when pressed */
169 RELVERIFY
, /* just get gadget up messages */
171 (APTR
)&B_GoSurf
, NULL
,
179 * beginning of slider gadgets
181 #define GadFlags (GADGIMAGE | GADGHNONE) /* my gadget flags */
182 #define MyPropType (PROPGADGET)
185 * definitions for the number of Revolution Slices
188 static char DispRevSlices
[] = "Rev Slices=[ ]";
190 static struct IntuiText TextRevSlices
= {
191 1,1,JAM1
, -16*COL
, TxOff
, NULL
,
192 (UBYTE
*)DispRevSlices
, NULL
195 struct GadExtens VRevSlices
= {0.0, 0.0, 0.0, 1, 360, DefRevMeshVal
, false };
197 static struct Gadget G_RevSlices
= {
199 COL
*57 , TOP
+ROW
*2, COL
*15, ROW
, /* loc and size */
204 NULL
, /* high lighted */
213 * definition for the background shade
215 static char DispBackPlane
[] = { "Background = [ ]" };
217 static struct IntuiText TextBackPlane
= {
218 1,1,JAM1
, -17*COL
, TxOff
, NULL
,
219 (UBYTE
*)DispBackPlane
, NULL
222 struct GadExtens VBackPlane
= {0.0, 0.0, 0.0, 0, 31, DefBkPlane
, false};
225 static struct Gadget G_BackPlane
= {
227 COL
*57 , TOP
+ROW
*13, COL
*15, ROW
, /* loc and size */
232 NULL
, /* high lighted */
242 * definitions for the number of Revolution Angles
245 static char DispRevAngle
[] = { "Rev Angle=[ ]" };
247 static struct IntuiText TextRevAngle
= {
248 1,1,JAM1
, -15*COL
, TxOff
, NULL
,
249 (UBYTE
*)DispRevAngle
, NULL
252 struct GadExtens VRevAngle
= { 0.0, 0.0, 0.0, 0, 360, DefRotRange
, false };
255 static struct Gadget G_RevAngle
= {
257 COL
*57 , TOP
+ROW
*3, COL
*15, ROW
, /* loc and size */
262 NULL
, /* high lighted */
270 * definitions for start rotation angle
273 static char DispRevStart
[] = { "Start Angle=[ ]" };
275 static struct IntuiText TextRevStart
= {
276 1,1,JAM1
, -17*COL
, TxOff
, NULL
,
277 (UBYTE
*)DispRevStart
, NULL
280 struct GadExtens VRevStart
= { 0.0, 0.0, 0.0, 0, 360, DefRotStart
, false };
283 static struct Gadget G_RevStart
= {
285 COL
*57 , TOP
+ROW
*4, COL
*15, ROW
, /* loc and size */
290 NULL
, /* high lighted */
299 * definitions for the number of Bezier Slices
302 static char DispBezSlices
[] = { "Bez Slices=[ ]" };
304 static struct IntuiText TextBezSlices
= {
305 1,1,JAM1
, -16*COL
, TxOff
, NULL
,
306 (UBYTE
*)DispBezSlices
, NULL
310 struct GadExtens VBezSlices
= { 0.0, 0.0, 0.0, 1, 100, DefBezMeshVal
, false };
312 static struct Gadget G_BezSlices
= {
314 COL
*20 , TOP
+ROW
*2, COL
*15, ROW
, /* loc and size */
319 NULL
, /* high lighted */
328 * definitions for tilt angle
331 static char DispTiltAng
[] = { "Tilt Angle=[ ]" };
333 static struct IntuiText TextTiltAng
= {
334 1,1,JAM1
, -16*COL
, TxOff
, NULL
,
335 (UBYTE
*)DispTiltAng
, NULL
339 struct GadExtens VTiltAng
= { 0.0, 0.0, 0.0, 0, 360, DefTilt
, false };
341 static struct Gadget G_TiltAng
= {
343 COL
*20 , TOP
+ROW
*3, COL
*15, ROW
, /* loc and size */
348 NULL
, /* high lighted */
358 * definitions for K Specular
361 static char DispKspec
[] = {"Kspecular=[ ] " };
363 static struct IntuiText TextKspec
= {
364 1,1,JAM1
, (WORD
)-sizeof(DispKspec
)*COL
, TxOff
, NULL
,
365 (UBYTE
*)DispKspec
, NULL
369 struct GadExtens VKspec
= { 0.0, 1.0, DefKs
, 0, 0, 0, true };
371 static struct Gadget G_Kspec
= {
373 49*COL
, TOP
+ROW
*9, COL
*15, ROW
, /* loc and size */
378 NULL
, /* high lighted */
387 * definitions for K diffuse
390 static char DispKdiffuse
[] = {"Kdiffuse=[ ] " };
392 static struct IntuiText TextKdiffuse
= {
393 1,1,JAM1
, (WORD
)-sizeof(DispKdiffuse
)*COL
, TxOff
, NULL
,
394 (UBYTE
*)DispKdiffuse
, NULL
398 struct GadExtens VKdiffuse
= { 0.0, 1.0, DefKd
, 0, 0, 0, true };
400 static struct Gadget G_Kdiffuse
= {
402 49*COL
, TOP
+ROW
*10, COL
*15, ROW
, /* loc and size */
407 NULL
, /* high lighted */
418 * definitions for DispPtIntens
422 static struct IntuiText PtProperties
= {
423 1,1,JAM1
, -10*COL
, -ROW
, NULL
,
424 (UBYTE
*)"Properties", NULL
427 static char DispPtIntens
[] = {"Intensity=[ ] " };
429 static struct IntuiText TextPtIntens
= {
430 1,1,JAM1
, (WORD
)-sizeof(DispPtIntens
)*COL
, TxOff
, NULL
,
431 (UBYTE
*)DispPtIntens
, &PtProperties
435 struct GadExtens VPtIntens
= { 0.0, 2.5, DefIntensity
, 0, 0, 0, true };
437 static struct Gadget G_PtIntens
= {
439 49*COL
, TOP
+ROW
*8, COL
*15, ROW
, /* loc and size */
444 NULL
, /* high lighted */
456 * definitions for background intensity
458 static struct IntuiText DispAmbient
= {
459 1,1,JAM1
,- COL
*3, -ROW
, NULL
,
460 (UBYTE
*) "Other", NULL
463 static char DispBkIntens
[] = { "Ambience=[ ] " };
465 static struct IntuiText TextBkIntens
= {
466 1,1,JAM1
, (WORD
)-sizeof(DispBkIntens
)*COL
, TxOff
, NULL
,
467 (UBYTE
*) DispBkIntens
, &DispAmbient
470 struct GadExtens VBkIntens
= { 0.0, 1.0, DefAmbience
, 0, 0, 0, true };
473 static struct Gadget G_BkIntens
= {
475 20*COL
, TOP
+ROW
*13, COL
*15, ROW
, /* loc and size */
480 NULL
, /* high lighted */
492 * Definitions for Surface distance
495 static char DispSurfDist
[] = {"Surf Dist=[ ] " };
497 static struct IntuiText TextSurfDist
= {
498 1,1,JAM1
, (WORD
)-sizeof(DispSurfDist
)*COL
, TxOff
, NULL
,
499 (UBYTE
*) DispSurfDist
, NULL
503 struct GadExtens VSurfDist
= {0.0, 0.0, 0.0, -500, 3000, DefSurfDist
, false};
505 static struct Gadget G_SurfDist
= {
507 20*COL
, TOP
+ROW
*4, COL
*15, ROW
, /* loc and size */
512 NULL
, /* high lighted */
524 * definitions for location.x
526 static struct IntuiText PointLight
= {
527 1,1,JAM1
, 9*COL
, -ROW
*2, NULL
,
528 (UBYTE
*) "Point Light Source", NULL
531 static struct IntuiText TextPtLocXYZ
= {
532 1,1,JAM1
, -4, -ROW
, NULL
,
533 (UBYTE
*) "Location", &PointLight
536 static char DispPtLocX
[] = { "x=[ ] " };
538 static struct IntuiText TextPtLocX
= {
539 1,1,JAM1
, (WORD
)-sizeof(DispPtLocX
)*COL
, TxOff
, NULL
,
540 (UBYTE
*) DispPtLocX
, &TextPtLocXYZ
544 struct GadExtens VPtLocX
= {0.0, 0.0, 0.0, -6000, 6000, DefLightSrcX
, false };
546 static struct Gadget G_PtLocX
= {
548 12*COL
, TOP
+ROW
*8, COL
*15, ROW
, /* loc and size */
553 NULL
, /* high lighted */
564 * definitions for location.x
567 static char DispPtLocY
[] = "y=[ ] ";
569 static struct IntuiText TextPtLocY
= {
570 1,1,JAM1
, (WORD
)-sizeof(DispPtLocY
)*COL
, TxOff
, NULL
,
571 (UBYTE
*) DispPtLocY
, NULL
575 struct GadExtens VPtLocY
= { 0.0, 0.0, 0.0, -6000, 6000, DefLightSrcY
, false };
577 static struct Gadget G_PtLocY
= {
579 12*COL
, TOP
+ROW
*9, COL
*15, ROW
, /* loc and size */
584 NULL
, /* high lighted */
595 * definitions for location.z
598 static char DispPtLocZ
[] = { "z=[ ] " };
600 static struct IntuiText TextPtLocZ
= {
601 1,1,JAM1
, (WORD
)-sizeof(DispPtLocZ
)*COL
, TxOff
, NULL
,
602 (UBYTE
*)DispPtLocZ
, NULL
606 struct GadExtens VPtLocZ
={ 0.0, 0.0, 0.0, -1000, 3000, DefLightSrcZ
, false };
608 static struct Gadget G_PtLocZ
= {
610 12*COL
, TOP
+ROW
*10, COL
*15, ROW
, /* loc and size */
615 NULL
, /* high lighted */
624 * definitions for Map replication in horizontal axis
627 static char DispRepH
[] = { "Map RepH=[ ] " };
629 static struct IntuiText TextRepH
= {
630 1,1,JAM1
, (WORD
)-sizeof(DispRepH
)*COL
, TxOff
, NULL
,
631 (UBYTE
*)DispRepH
, NULL
635 struct GadExtens VRepH
={ 0.0, 0.0, 0.0, 1, 300, DefRepH
, false };
637 static struct Gadget G_RepH
= {
639 20*COL
, TOP
+ROW
*15, COL
*15, ROW
, /* loc and size */
644 NULL
, /* high lighted */
654 * definitions for map replication in vertical axis
657 static char DispRepV
[] = { "Map RepV=[ ] " };
659 static struct IntuiText TextRepV
= {
660 1,1,JAM1
, (WORD
)-sizeof(DispRepV
)*COL
, TxOff
, NULL
,
661 (UBYTE
*)DispRepV
, NULL
665 struct GadExtens VRepV
={ 0.0, 0.0, 0.0, 1, 300, DefRepV
, false };
667 static struct Gadget G_RepV
= {
669 57*COL
, TOP
+ROW
*15, COL
*15, ROW
, /* loc and size */
674 NULL
, /* high lighted */
687 void LoadChipMem( dest
, src
, srcsize
)
694 d
= (UWORD
*)AllocMem( srcsize
, MEMF_CHIP
);
696 OutErr("not enough chip mem");
703 srcsize
-= sizeof( UWORD
);
711 LoadChipMem( &HourGlass
, HourGlassDat
, sizeof(HourGlassDat
));
714 CntrlWinDef
.FirstGadget
= &G_RepV
;
715 GadWinDef
.FirstGadget
= &G_GoPanel
;
717 * fill in numeric fields
719 for( vp
= CntrlWinDef
.FirstGadget
; vp
; vp
= vp
->NextGadget
) {
721 GadgetUpdate(vp
, false );
729 FreeMem(HourGlass
, sizeof(HourGlassDat
));