… | |
… | |
181 | struct oblnk *link; |
181 | struct oblnk *link; |
182 | struct oblinkpt *next; |
182 | struct oblinkpt *next; |
183 | shstr id; /* Used as connected value in buttons/gates */ |
183 | shstr id; /* Used as connected value in buttons/gates */ |
184 | } oblinkpt; |
184 | } oblinkpt; |
185 | |
185 | |
186 | // temporary hack to find the culprit who corrupts face numbers. maybe. hopefully. |
|
|
187 | struct faceidx_debug |
|
|
188 | { |
|
|
189 | faceidx x; |
|
|
190 | |
|
|
191 | operator faceidx () const |
|
|
192 | { |
|
|
193 | return x; |
|
|
194 | } |
|
|
195 | |
|
|
196 | faceidx operator =(faceidx i) |
|
|
197 | { |
|
|
198 | if (ecb_expect_false (i >= faces.size ())) |
|
|
199 | { |
|
|
200 | fork_abort ("illegal faceidx assignment"); |
|
|
201 | i = blank_face; |
|
|
202 | } |
|
|
203 | |
|
|
204 | return x = i; |
|
|
205 | } |
|
|
206 | }; |
|
|
207 | |
|
|
208 | #if CFPERL |
|
|
209 | static inline void sv_to (SV *sv, faceidx_debug &v) { v = SvIV (sv); } |
|
|
210 | #endif |
|
|
211 | |
|
|
212 | INTERFACE_CLASS (object) |
186 | INTERFACE_CLASS (object) |
213 | // these are being copied |
187 | // these are being copied |
214 | struct object_copy : attachable |
188 | struct object_copy : attachable |
215 | { |
189 | { |
216 | sint16 ACC (RW, x), ACC (RW, y); /* Position in the map for this object */ |
190 | sint16 ACC (RW, x), ACC (RW, y); /* Position in the map for this object */ |
… | |
… | |
279 | sint8 ACC (RW, glow_radius); /* indicates the glow radius of the object */ |
253 | sint8 ACC (RW, glow_radius); /* indicates the glow radius of the object */ |
280 | uint8 ACC (RW, weapontype); /* type of weapon */ |
254 | uint8 ACC (RW, weapontype); /* type of weapon */ |
281 | |
255 | |
282 | body_slot slot [NUM_BODY_LOCATIONS]; |
256 | body_slot slot [NUM_BODY_LOCATIONS]; |
283 | |
257 | |
284 | faceidx_debug ACC (RW, face); /* the graphical face */ |
258 | faceidx ACC (RW, face); /* the graphical face */ |
285 | |
259 | |
286 | faceidx ACC (RW, sound); /* the sound face */ |
260 | faceidx ACC (RW, sound); /* the sound face */ |
287 | faceidx ACC (RW, sound_destroy); /* played on destroy */ |
261 | faceidx ACC (RW, sound_destroy); /* played on destroy */ |
288 | |
262 | |
289 | sint32 ACC (RW, weight); /* Attributes of the object */ |
263 | sint32 ACC (RW, weight); /* Attributes of the object */ |
… | |
… | |
830 | * range from 0 through 7. |
804 | * range from 0 through 7. |
831 | */ |
805 | */ |
832 | MTH int anim_frames () const { return anim ().num_animations; } |
806 | MTH int anim_frames () const { return anim ().num_animations; } |
833 | MTH int anim_facings () const { return anim ().facings; } |
807 | MTH int anim_facings () const { return anim ().facings; } |
834 | |
808 | |
|
|
809 | // sets a new animation frame, if the object has animation frames, |
|
|
810 | // and updates the face |
|
|
811 | MTH void update_anim_frame (int frame); |
|
|
812 | |
835 | MTH utf8_string as_string (); |
813 | MTH utf8_string as_string (); |
836 | |
814 | |
837 | // low-level management, statistics, ... |
815 | // low-level management, statistics, ... |
838 | static uint32_t ACC (RW, object_count); |
816 | static uint32_t ACC (RW, object_count); |
839 | static uint32_t ACC (RW, free_count); |
817 | static uint32_t ACC (RW, free_count); |
… | |
… | |
970 | //+GPL |
948 | //+GPL |
971 | |
949 | |
972 | /* Used by update_object to know if the object being passed is |
950 | /* Used by update_object to know if the object being passed is |
973 | * being added or removed. |
951 | * being added or removed. |
974 | */ |
952 | */ |
975 | #define UP_OBJ_INSERT 1 |
953 | #define UP_OBJ_INSERT 1 // object was inserted |
976 | #define UP_OBJ_REMOVE 2 |
954 | #define UP_OBJ_REMOVE 2 // object was removed |
977 | #define UP_OBJ_CHANGE 3 |
955 | #define UP_OBJ_CHANGE 3 // object has changed in some unspecified way |
978 | #define UP_OBJ_FACE 4 /* Only thing that changed was the face */ |
956 | #define UP_OBJ_FACE 4 // only thing that changed was the face |
979 | |
957 | |
980 | /* These are flags passed to insert_ob_in_map and |
958 | /* These are flags passed to insert_ob_in_map and |
981 | * insert_ob_in_ob. Note that all flags may not be meaningful |
959 | * insert_ob_in_ob. Note that all flags may not be meaningful |
982 | * for both functions. |
960 | * for both functions. |
983 | * Most are fairly explanatory: |
961 | * Most are fairly explanatory: |