1 /* Bumps, Copyright (c) 2001 Shane Smit <CodeWeaver@DigitalLoom.org>
3 * Permission to use, copy, modify, distribute, and sell this software and its
4 * documentation for any purpose is hereby granted without fee, provided that
5 * the above copyright notice appear in all copies and that both that
6 * copyright notice and this permission notice appear in supporting
7 * documentation. No representations are made about the suitability of this
8 * software for any purpose. It is provided "as is" without express or
15 * Header file for module "Bumps.c"
17 * Modification History:
18 * [10/01/99] - Shane Smit: Creation
19 * [10/08/99] - Shane Smit: Port to C. (Ick)
20 * [03/08/02] - Shane Smit: New movement code.
21 * [09/12/02] - Shane Smit: MIT-SHM XImages.
22 * Thanks to Kennett Galbraith <http://www.Alpha-II.com/>
23 * for code optimization.
32 #include "screenhack.h"
34 #ifdef HAVE_XSHM_EXTENSION
36 #endif /* HAVE_XSHM_EXTENSION */
41 #define RANDOM() ((int) (random() & 0X7FFFFFFFL))
43 typedef signed char int8_;
44 typedef unsigned char uint8_;
46 typedef unsigned short uint16_;
48 typedef unsigned long uint32_;
49 typedef unsigned char BOOL;
54 static const char *bumps_defaults [] = {
63 #ifdef __sgi /* really, HAVE_READ_DISPLAY_EXTENSION */
66 #ifdef HAVE_XSHM_EXTENSION
68 #endif /* HAVE_XSHM_EXTENSION */
72 static XrmOptionDescRec bumps_options [] = {
73 { "-color", ".color", XrmoptionSepArg, 0 },
74 { "-colorcount", ".colorcount", XrmoptionSepArg, 0 },
75 { "-duration", ".duration", XrmoptionSepArg, 0 },
76 { "-delay", ".delay", XrmoptionSepArg, 0 },
77 { "-soften", ".soften", XrmoptionSepArg, 0 },
78 { "-invert", ".invert", XrmoptionNoArg, "TRUE" },
79 #ifdef HAVE_XSHM_EXTENSION
80 { "-shm", ".useSHM", XrmoptionNoArg, "True" },
81 { "-no-shm", ".useSHM", XrmoptionNoArg, "False" },
82 #endif /* HAVE_XSHM_EXTENSION */
88 /* This structure handles everything to do with the spotlight, and is designed to be
89 * a member of TBumps. */
93 uint16_ nFalloffDiameter, nFalloffRadius;
94 uint16_ nLightDiameter, nLightRadius;
95 float nAccelX, nAccelY;
97 float nVelocityX, nVelocityY;
102 void CreateTables( SSpotLight * );
105 /* The entire program's operation is contained within this structure. */
108 /* XWindows specific variables. */
117 #ifdef HAVE_XSHM_EXTENSION
118 XShmSegmentInfo XShmInfo;
120 #endif /* HAVE_XSHM_EXTENSION */
122 uint8_ nColorCount; /* Number of colors used. */
123 uint8_ bytesPerPixel;
124 uint16_ iWinWidth, iWinHeight;
125 uint16_ *aBumpMap; /* The actual bump map. */
126 SSpotLight SpotLight;
132 async_load_state *img_loader;
136 #endif /* _BUMPS_H */