Fixed missing fprintf argument.
[AROS.git] / rom / graphics / initmasks.c
blobe87a4dba1ce364441c6f0dac691bc02a13298b0a
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function InitMasks()
6 Lang: english
7 */
8 #include <graphics/gels.h>
9 #include <graphics/rastport.h>
10 #include "graphics_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/graphics.h>
17 AROS_LH1(void, InitMasks,
19 /* SYNOPSIS */
20 AROS_LHA(struct VSprite *, vs, A0),
22 /* LOCATION */
23 struct GfxBase *, GfxBase, 21, Graphics)
25 /* FUNCTION
26 Creates the standard BorderLine and CollMask masks of the VSprite.
27 VSprites and Bobs are treated accordingly.
29 INPUTS
30 vs = pointer to VSprite structure
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 InitGels() InitGMasks() graphics/gels.h
43 INTERNALS
45 HISTORY
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
50 AROS_LIBBASE_EXT_DECL(struct GfxBase *,GfxBase)
52 long depth, WordsPerPlane, WordsPerLine, count;
53 /* is this a Bob or a VSprite? */
54 if (0 != (vs -> Flags & VSPRITE))
56 /* assumption: vs -> Widtht = 16 (or 32 on a better chipset??)*/
57 WordsPerLine = vs -> Width >> 4; /* Width:16 */
58 depth = 2; /* standard */
60 else
62 WordsPerLine = vs -> Width;
63 depth = vs -> Depth;
65 WordsPerPlane = (vs -> Height) * WordsPerLine;
68 /* create the standard collision mask by or'ing all bitplanes */
69 for (count = 0; count < WordsPerPlane; count++)
71 WORD * PlaneData = vs -> ImageData;
72 WORD Data = PlaneData[count];
73 long z;
74 for (z = 1; z < depth; z++)
75 Data |= PlaneData[count + z*WordsPerPlane];
76 (vs -> CollMask)[count] = Data;
79 /* create the standard BorderLine from the collision mask by or'ing all
80 lines */
81 for (count = 0 ; count < WordsPerLine; count++)
83 WORD * CollMask = vs -> CollMask;
84 WORD Data = CollMask[count];
85 long z;
86 for (z = 1; z < vs-> Height; z++)
87 Data |= CollMask[count + z*WordsPerLine];
88 (vs -> BorderLine)[count] = Data;
91 AROS_LIBFUNC_EXIT
92 } /* InitMasks */