ScummVM API documentation
object.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SWORD1_OBJECT_H
23 #define SWORD1_OBJECT_H
24 
25 #include "common/scummsys.h"
26 
27 namespace Sword1 {
28 
29 #define O_TOTAL_EVENTS 5
30 #define O_WALKANIM_SIZE 600 //max number of nodes in router output
31 #define O_GRID_SIZE 200
32 #define EXTRA_GRID_SIZE 20
33 
34 #include "common/pack-start.h" // START STRUCT PACKING
35 
36 struct OEventSlot { //receiving event list in the compact -
37  int32 o_event; //array of these with O_TOTAL_EVENTS elements
38  int32 o_event_script;
39 } PACKED_STRUCT; // size = 2*int32 = 8 bytes
40 
41 #define TOTAL_script_levels 5
42 
43 struct ScriptTree { //this is a logic tree, used by OBJECTs
44  int32 o_script_level; //logic level
45  int32 o_script_id[TOTAL_script_levels]; //script id's (are unique to each level)
46  int32 o_script_pc[TOTAL_script_levels]; //pc of script for each (if script_manager)
47 } PACKED_STRUCT; // size = 11*int32 = 44 bytes
48 
49 struct TalkOffset {
50  int32 x;
51  int32 y;
52 } PACKED_STRUCT; // size = 2*int32 = 8 bytes
53 
54 struct WalkData {
55  int32 frame;
56  int32 x;
57  int32 y;
58  int32 step;
59  int32 dir;
60 } PACKED_STRUCT; // size = 5*int32 = 20 bytes
61 
62 struct Object {
63  int32 o_type; // 0 broad description of type - object, floor, etc.
64  int32 o_status; // 4 bit flags for logic, graphics, mouse, etc.
65  int32 o_logic; // 8 logic type
66  int32 o_place; // 12 where is the mega character
67  int32 o_down_flag; // 16 pass back down with this - with C possibly both are unnecessary?
68  int32 o_target; // 20 target object for the GTM *these are linked to script
69  int32 o_screen; // 24 physical screen/section
70  int32 o_frame; // 28 frame number &
71  int32 o_resource; // 32 id of spr file it comes from
72  int32 o_sync; // 36 receive sync here
73  int32 o_pause; // 40 logic_engine() pauses these cycles
74  int32 o_xcoord; // 44
75  int32 o_ycoord; // 48
76  int32 o_mouse_x1; // 52 top-left of mouse area is (x1,y1)
77  int32 o_mouse_y1; // 56
78  int32 o_mouse_x2; // 60 bottom-right of area is (x2,y2) (these coords are inclusive)
79  int32 o_mouse_y2; // 64
80  int32 o_priority; // 68
81  int32 o_mouse_on; // 72
82  int32 o_mouse_off; // 76
83  int32 o_mouse_click; // 80
84  int32 o_interact; // 84
85  int32 o_get_to_script; // 88
86  int32 o_scale_a; // 92 used by floors
87  int32 o_scale_b; // 96
88  int32 o_anim_x; // 100
89  int32 o_anim_y; // 104
90 
91  ScriptTree o_tree; // 108 size = 44 bytes
92  ScriptTree o_bookmark; // 152 size = 44 bytes
93 
94  int32 o_dir; // 196
95  int32 o_speech_pen; // 200
96  int32 o_speech_width; // 204
97  int32 o_speech_time; // 208
98  int32 o_text_id; // 212 working back from o_ins1
99  int32 o_tag; // 216
100  int32 o_anim_pc; // 220 position within an animation structure
101  int32 o_anim_resource; // 224 cdt or anim table
102 
103  int32 o_walk_pc; // 228
104 
105  TalkOffset talk_table[6]; // 232 size = 6*8 bytes = 48
106 
107  OEventSlot o_event_list[O_TOTAL_EVENTS]; // 280 size = 5*8 bytes = 40
108 
109  int32 o_ins1; // 320
110  int32 o_ins2; // 324
111  int32 o_ins3; // 328
112 
113  int32 o_mega_resource; // 332
114  int32 o_walk_resource; // 336
115 
116  WalkData o_route[O_WALKANIM_SIZE]; // 340 size = 600*20 bytes = 12000
117  // mega size = 12340 bytes (+ 8 byte offset table + 20 byte header = 12368)
118 } PACKED_STRUCT;
119 
120 #include "common/pack-end.h" // END STRUCT PACKING
121 
122 } // End of namespace Sword1
123 
124 #endif //BSOBJECT_H
Definition: object.h:43
Definition: object.h:62
Definition: object.h:49
Definition: object.h:54
Definition: animation.h:38
Definition: object.h:36