convert line ends
[canaan.git] / prj / cam / src / render / fxspan.h
blob124d4c2158a84b8b13ba90381b5ac2ffa6717676
1 /*
2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
4 */
6 // $ Header: $
7 #pragma once
9 /* ----- /-/-/-/-/-/-/-/-/ <<< (((((( /\ )))))) >>> \-\-\-\-\-\-\-\-\ ----- *\
10 fxspan.h
12 export for fxspan.c--simple span buffer for special effects
14 \* ----- \-\-\-\-\-\-\-\-\ <<< (((((( \/ )))))) >>> /-/-/-/-/-/-/-/-/ ----- */
17 #ifndef _FXSPAN_H_
18 #define _FXSPAN_H_
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
24 #include <lg.h>
25 #include <fix.h>
27 #include <fxspant.h>
29 // When a span is off the screen, we put this into its "left" field.
30 // No baseball puns, please.
31 #define SPAN_NOT_USED -1
33 // This clips a set of spans against the clipping info for a given
34 // canvas. We return FALSE if all the spans were off the canvas, TRUE
35 // if there's anything left. x and y are the upper-left corner of the
36 // sFXSpanSet within the canvas.
37 extern bool FXSpanClipToCanvas(sFXSpanSet *set, grs_canvas *canvas,
38 fix x, fix y);
40 extern bool FXSpanClipToSet(sFXSpanSet *input_set, sFXSpanSet *clip_set,
41 sFXSpanSet *output_set_1,
42 sFXSpanSet *output_set_2,
43 fix x, fix y);
46 // The bounding width is however far over any used span reaches.
47 extern void FXSpanSetBoundingWidth(sFXSpanSet *set);
49 // The span buffer is expected to be clipped in x and y by the time
50 // this gets it.
51 extern void FXSpanDrawSetFromSnarf(sFXSpanSet *set, sFXSpanSnarf *snarf,
52 grs_canvas *canvas,
53 fix x_in_canvas, fix y_in_canvas,
54 fix x_in_snarf, fix y_in_snarf);
57 extern void FXSpanDrawSetFromCanvas(sFXSpanSet *set, grs_canvas *canvas,
58 fix x_start, fix y_start,
59 fix x_end, fix y_end);
61 // This is mostly for testing.
62 extern void FXSpanDrawFlatColor(sFXSpanSet *set, sFXSpanSnarf *snarf,
63 grs_canvas *canvas,
64 fix x_in_canvas, fix y_in_canvas,
65 fix x_in_snarf, fix y_in_snarf,
66 uchar color);
68 // FXSpanSnarfSetup allocates the necessary memory for snarfing, so you
69 // won't have to!
70 void FXSpanSnarfSetup(sFXSpanSnarf *snarf, int x, int y, grs_canvas *canvas);
72 extern void FXSpanSnarf(sFXSpanSnarf *snarf, sFXSpanSet *set,
73 grs_canvas *canvas, fix x, fix y);
75 // FXUnsnarf deallocates the memory allocated by FXSpanSnarf. snarf
76 // itself is not freed since we don't know whether it's from the free
77 // store.
78 extern void FXSpanUnsnarf(sFXSpanSnarf *snarf);
80 #ifdef __cplusplus
82 #endif
84 #endif // ~_FXSPAN_H_