-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscc_roobj.h
183 lines (140 loc) · 4.65 KB
/
scc_roobj.h
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/* ScummC
* Copyright (C) 2004-2006 Alban Bedel
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
/**
* @file scc_roobj.h
* @ingroup scc
* @brief ScummC object files
*/
typedef struct scc_roobj_res_st scc_roobj_res_t;
typedef struct scc_roobj_cycl_st scc_roobj_cycl_t;
typedef struct scc_roobj_state_st scc_roobj_state_t;
typedef struct scc_roobj_obj_st scc_roobj_obj_t;
typedef struct scc_roobj_st scc_roobj_t;
/// Generic data ressources like music.
struct scc_roobj_res_st {
scc_roobj_res_t* next;
unsigned type;
scc_symbol_t* sym;
uint8_t* data;
unsigned data_len;
};
/// Palette cycle definition
struct scc_roobj_cycl_st {
scc_roobj_cycl_t* next;
scc_symbol_t* sym;
int freq,flags;
int start,end;
};
/// Object state definition
struct scc_roobj_state_st {
scc_roobj_state_t* next;
/// hotspot
int hs_x,hs_y;
scc_img_t* img;
scc_img_t* zp[SCC_MAX_IM_PLANES];
};
/// Object data
struct scc_roobj_obj_st {
scc_roobj_obj_t* next;
/// Symbol for this object
scc_symbol_t* sym;
/// Hotspot list for each state
int hotspots[SCC_MAX_IM_PLANES+1];
int x,y,w,h;
/// Parent object
scc_symbol_t* parent;
/// Parent state wich enable this object
int parent_state;
/// Index (in the room) of the parent object
int parent_id;
/// Direction the actors should use when facing the object
int dir;
/// Default state
int state;
/// Name of the object in game
char* name;
/// Transparent color if >= 0
int trans;
/// hotspot used if no extra state is defined
int hs_x,hs_y;
/// state have image, zplanes and hotspot
scc_roobj_state_t* states;
/// verbs
scc_script_t* verb;
/// generated imnn
scc_imnn_t* im;
/// Initial owner of the object
scc_symbol_t* owner;
/// Classes the object belong to
scc_symbol_t* class[SCC_MAX_CLASS];
};
/// Room data
struct scc_roobj_st {
/// Chain when we have several room
scc_roobj_t* next;
/// Targeted VM version
scc_target_t* target;
/// Symbol of this romm
scc_symbol_t* sym;
/// Global scripts
scc_script_t* scr;
/// Local scripts
scc_script_t* lscr;
/// Object list
scc_roobj_obj_t* obj,*last_obj;
/// the defined ressources.
scc_roobj_res_t *res;
/// Palette cycles
scc_roobj_cycl_t* cycl;
/// Transparent color
int trans;
/// Background image
scc_img_t* image;
/// Z-Planes for masking actors
scc_img_t* zplane[SCC_MAX_IM_PLANES];
/// Box list
scc_boxd_t* boxd;
/// Box matrix
scc_data_t* boxm;
/// Scaling slots
scc_data_t* scal;
};
scc_roobj_t* scc_roobj_new(scc_target_t* t, scc_symbol_t* sym);
void scc_roobj_free(scc_roobj_t* ro);
scc_roobj_res_t* scc_roobj_get_res(scc_roobj_t* ro,scc_symbol_t* sym);
scc_script_t* scc_roobj_get_scr(scc_roobj_t* ro, scc_symbol_t* sym);
int scc_roobj_add_scr(scc_roobj_t* ro,scc_script_t* scr);
scc_roobj_obj_t* scc_roobj_get_obj(scc_roobj_t* ro,scc_symbol_t* sym);
int scc_roobj_add_obj(scc_roobj_t* ro,scc_roobj_obj_t* obj);
scc_roobj_res_t* scc_roobj_add_res(scc_roobj_t* ro,scc_symbol_t* sym,
char* val);
int scc_roobj_set_param(scc_roobj_t* ro,scc_ns_t* ns,char* p, char* val);
int scc_roobj_set_zplane(scc_roobj_t* ro, int idx,char* file);
int scc_roobj_add_voice(scc_roobj_t* ro, scc_symbol_t* sym, char* file,
int nsync, int* sync);
int scc_roobj_add_cycl(scc_roobj_t* ro, scc_symbol_t* sym,
int delay, int flags, int start, int end);
int scc_roobj_write(scc_roobj_t* ro,scc_ns_t* ns, scc_fd_t* fd);
scc_roobj_obj_t* scc_roobj_obj_new(scc_symbol_t* sym);
void scc_roobj_obj_free(scc_roobj_obj_t* obj);
int scc_roobj_obj_add_state(scc_roobj_obj_t* obj,int x, int y,
char *img_path,char** zp_paths);
scc_script_t* scc_roobj_obj_get_verb(scc_roobj_obj_t* obj,scc_symbol_t* sym);
int scc_roobj_obj_add_verb(scc_roobj_obj_t* obj,scc_script_t* scr);
int scc_roobj_obj_set_param(scc_roobj_obj_t* obj,char* sym,char* val);
int scc_roobj_obj_set_int_param(scc_roobj_obj_t* obj,char* sym,int val);
int scc_roobj_obj_set_class(scc_roobj_obj_t* obj, scc_symbol_t* sym);