File: fishmon.h

package info (click to toggle)
bfm 0.6.4-7.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 464 kB
  • sloc: ansic: 5,239; makefile: 106
file content (70 lines) | stat: -rw-r--r-- 2,023 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef _FISHMON_H_
#define _FISHMON_H_

#include <gdk/gdk.h>
#include <gdk/gdkx.h>

#define POWER2 12
#define REALY(y) ((y) >> POWER2)
#define MAKEY(y) ((y) << POWER2)

/* we are going to try and make this independent from 56x56 problem,
 * so that someone interested can zoom this to say 256x256 */

/* perform clipping outside this range, also this is the size of the
 * drawing area */
#define XMAX 56
#define YMAX 56
/* this is the max size of the RGB buffer: 56 * 56 * 3
 * used for memcpy, memset, etc operations */
#define RGBSIZE (XMAX * YMAX * 3)
/* size of the colormap based image */
#define CMAPSIZE (XMAX * YMAX)
/* where WEED is located */
#define WEEDY (YMAX - 12)

/* width of sprite header, sprite cmap alias, sprite master block alias */
#define HWIDTH width
#define THE_CMAP header_data_cmap
#define THE_DATA header_data

/* how many fishes? */
#define NRFISH 6
#define MAXBUBBLE 32

/* main structure holding all sprites used in this dockapp */
typedef struct {
    int w;			/* sprite width */
    int h;			/* sprite height */
    int srcx;			/* sprite start in sprites.h */
    int srcy;			/* sprite start in sprites.h */
    unsigned char *data;	/* pointer to sprite image */
} Sprite;

/* structure describing each fish */
typedef struct {
    int speed;			/* amount of pixels to add for next move */
    int tx;			/* current x position */
    int y;			/* current y position */
    int travel;			/* how far to move beyond the screen */
    int rev;			/* going left or right? */
    int frame;			/* current animation frame */
    int delay;			/* how quick we swap frames */
    int turn;			/* in "turn" mode */
} Fish;

/* structure describing weed */
typedef struct {
    int where;			/* x position */
    int frame;			/* which frame are we on now */
    int delay;			/* delay for each weed */
} Weed;

typedef struct {
    int x;			/* x position */
    int y;			/* y position */
    int dy;			/* vertical velocity */
    int frame;			/* current frame type */
} Bubble;

#endif				/* _FISHMON_H_ */