home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d159
/
starchart
/
source
/
spritedef.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-10-02
|
5KB
|
170 lines
/*=========================================================================
SpriteDef.c - This routine installs the custom intuition pointer,
it was generated using SpriteMaker.
Copyright (c) 1986 by Ray R. Larson
This program may be freely distributed and copied, but may not be sold
without the permission of the author. If you modify or enhance it,
please include the above credits (and please send me a copy!).
Ray R. Larson
6425 Central Ave. #304
El Cerrito, CA 94530
BitNet LARSON@UCBCMSA
=========================================================================*/
/*------------Header file for all of the standard stuff----*/
/*-------------plus definitions of global structures-------*/
#include "star.h"
/* defines for the sprite */
#define STARSPRITE_WIDTH 16L
#define STARSPRITE_HEIGHT 9L
#define STARSPRITE_HOTX -4L
#define STARSPRITE_HOTY -4L
/***************************************************************/
/* The following array contains the sprite colors */
/***************************************************************/
UWORD StarSprite_col[] =
{ 0xf2f, 0x000, 0xd00 };
/***************************************************************/
/* The following data structure contains the sprite image */
/***************************************************************/
USHORT StarSprite_dat[]= {
/*plane1 plane0 */
0x0000, 0x0000,
0x0800, 0x0800,
0x4900, 0x0800,
0x2a00, 0x0800,
0x0800, 0x1c00,
0xf780, 0xf780,
0x0800, 0x1c00,
0x2a00, 0x0800,
0x4900, 0x0800,
0x0800, 0x0800,
0x0000, 0x0000
};
/***************************************************************/
/* The following routine will install the sprite as the */
/* Intuition pointer. A pointer to your current window is */
/* needed as a parameter to this routine. */
/***************************************************************/
do_StarSprite(window)
struct Window *window;
{
SHORT i;
UWORD red,green,blue;
struct ViewPort *vport, *ViewPortAddress();
/* Get the window's viewport address */
vport = ViewPortAddress(window);
/* Set the colors for the sprite */
for (i=0;i<3;i++)
{
red = (StarSprite_col[i] & 0xf00) >> 8;
green = (StarSprite_col[i] & 0x0f0) >> 4;
blue = (StarSprite_col[i] & 0x00f) ;
SetRGB4(vport,(LONG)17+i,(LONG)red,(LONG)green,(LONG)blue);
}
/* get rid of the previous pointer */
ClearPointer(window);
/* and install the new one */
SetPointer(window,
&StarSprite_dat,
STARSPRITE_HEIGHT,
STARSPRITE_WIDTH,
STARSPRITE_HOTX,
STARSPRITE_HOTY);
}
/* defines for the sprite */
#define SNOOZE_WIDTH 16L
#define SNOOZE_HEIGHT 27L
#define SNOOZE_HOTX 0L
#define SNOOZE_HOTY 0L
/***************************************************************/
/* The following array contains the sprite colors */
/***************************************************************/
UWORD Snooze_col[] =
{ 0xfff, 0x000, 0xe30 };
/***************************************************************/
/* The following data structure contains the sprite image */
/***************************************************************/
USHORT Snooze_dat[]= {
/*plane1 plane0 */
0x0000, 0x0000,
0x03f0, 0x0000,
0x0ffc, 0x0000,
0x0c3e, 0x03c0,
0x07bc, 0x0040,
0x3f7e, 0x0080,
0x7eff, 0x0100,
0xfdff, 0x0200,
0xfc3f, 0x03c0,
0xffff, 0x0000,
0x7f0e, 0x00f0,
0x3fee, 0x0010,
0x3fd8, 0x0020,
0x1fbc, 0x0040,
0x037c, 0x0080,
0x0108, 0x00f0,
0x07f0, 0x0000,
0x0ff0, 0x0000,
0x0ff8, 0x0000,
0x1ff8, 0x0000,
0x1fe0, 0x0000,
0x0fc0, 0x0000,
0x0700, 0x0000,
0x0400, 0x0000,
0x0e00, 0x0000,
0x1f00, 0x0000,
0x0e00, 0x0000,
0x0400, 0x0000,
0x0000, 0x0000
};
/***************************************************************/
/* The following routine will install the sprite as the */
/* Intuition pointer. A pointer to your current window is */
/* needed as a parameter to this routine. */
/***************************************************************/
do_Snooze(window)
struct Window *window;
{
SHORT i;
UWORD red,green,blue;
struct ViewPort *vport;
/* Get the window's viewport address */
vport = ViewPortAddress(window);
/* Set the colors for the sprite */
for (i=0;i<3;i++)
{
red = (Snooze_col[i] & 0xf00) >> 8;
green = (Snooze_col[i] & 0x0f0) >> 4;
blue = (Snooze_col[i] & 0x00f) ;
SetRGB4(vport,(LONG)(17+i),(LONG)red,(LONG)green,(LONG)blue);
}
/* get rid of the previous pointer */
ClearPointer(window);
/* and install the new one */
SetPointer(window,
&Snooze_dat,
SNOOZE_HEIGHT,
SNOOZE_WIDTH,
SNOOZE_HOTX,
SNOOZE_HOTY);
}