/[projet1]/public/oric/games/Space 1999/Sources/game source/NOISE/noise.h
Defence Force logotype

Contents of /public/oric/games/Space 1999/Sources/game source/NOISE/noise.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 76 - (show annotations)
Tue May 26 07:45:25 2009 UTC (10 years, 6 months ago) by Chema
File MIME type: text/plain
File size: 3259 byte(s)


1 /* This is NOISE (Novel Oric ISometric Engine)
2 Version 0.1
3 José María Enguita
4 2005
5 */
6
7 #ifndef _NOISE_H_
8 #define _NOISE_H_
9
10
11 #include "noise_defs.h"
12
13 extern char sizes_i[];
14 extern char sizes_j[];
15 extern char sizes_k[]; //This should be doubled for pixel precision. Height has double granularity.
16
17
18
19 typedef struct t_cliprgn{
20 unsigned char x_clip; /* in pixel */
21 unsigned char y_clip;
22 unsigned char width_clip; /* in scans */
23 unsigned char height_clip;
24 }cliprgn_t;
25
26 extern cliprgn_t clip_rgn;
27
28 extern char orig_i;
29 extern char orig_j;
30
31 /* Definitions for graphics and sprites */
32
33 typedef struct t_sprite {
34 unsigned char lines;
35 unsigned char scans;
36 unsigned char * image;
37 unsigned char * mask;
38 }sprite_t;
39
40
41 typedef struct t_moving_object {
42 unsigned char fine_coord_i; // Fine coordinate on isometric view i
43 unsigned char fine_coord_j; // Fine coordinate on isometric view j
44 unsigned char fine_coord_k; // Fine coordinate on isometric view k (height)
45 unsigned char type; // Type code bit 7: special, bit 6: invert picture, bits 5-0 size code
46 }moving_object_t;
47
48
49
50 /* Objects that might move in the game */
51
52 extern moving_object_t characters[]; // Index 0 is the PLAYER. Up to 32 in memory.
53 extern sprite_t char_pics[]; // Sprites for characters (6bytesx32=192)
54 extern unsigned char num_chars; // Number of characters in screen (up to MAX_CHARS)
55 extern char chars_in_room[]; // Codes of characters in room
56 extern char_tiles_i[MAX_CHARS]; // i coordinate of tile in which lower-left corner of a character is in.
57 extern char_tiles_j[MAX_CHARS]; // j coordinate of tile in which lower-left corner of a character is in.
58 extern char_tiles_k[MAX_CHARS]; // k layer in which a character is in.
59
60 /* Room data */
61 extern sprite_t bkg_graphs[];
62 extern void * layers[];
63
64
65 typedef struct t_collision_data{
66 unsigned char id; // ID of object collided with.
67 unsigned char i; // These are fine coords if collided with a free object
68 unsigned char j; // and tile coords if collided with background.
69 unsigned char k;
70 } collision_data_t;
71
72 extern collision_data_t bkg_collision_list[];
73 extern char num_bkg_collisions;
74
75 extern collision_data_t obj_collision_list[];
76 extern char num_obj_collisions;
77
78 extern char init_when_setting; // if !=0 indicates that blocks in room should be init after calling set_tile
79
80 /* Declare the assembly code functions */
81 char * pixel_address(unsigned char x_pos,unsigned char y_pos,unsigned char *bit);
82 void put_sprite(unsigned char x_pos, unsigned char y_pos, sprite_t * sprite, char invert);
83 void put_sprite2(unsigned char x_pos, unsigned char y_pos, sprite_t * sprite, char invert);
84 void clear_clip_rgn();
85 void ij2xy(unsigned char i, unsigned char j, unsigned char *x, unsigned char * y);
86 char dodiv6(char op);
87 void set_doublebuff(char onoff);
88 void clear_buff();
89 void paint_buff();
90 void draw_room();
91 char get_tile(char i, char j, char k);
92 void set_tile(char i, char j, char k, char tilecode);
93 void recalc_clip(char who);
94 int collision_test(char who, char dir_mov);
95 void move_sprite(char who, char dir_mov);
96 void init_room();
97
98 #endif //_NOISE_H_

  ViewVC Help
Powered by ViewVC 1.1.26