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 CINE_OBJECT_H
23 #define CINE_OBJECT_H
24 
25 #include "script.h"
26 
27 namespace Cine {
28 
29 struct ObjectStruct {
30  int16 x;
31  int16 y;
32  uint16 mask;
33  int16 frame;
34  int16 costume;
35  char name[20];
36  uint16 part;
37 
39  void clear() {
40  this->x = 0;
41  this->y = 0;
42  this->mask = 0;
43  this->frame = 0;
44  this->costume = 0;
45  memset(this->name, 0, sizeof(this->name));
46  this->part = 0;
47  }
48 };
49 
50 struct overlay {
51  uint16 objIdx;
52  uint16 type;
53  int16 x;
54  int16 y;
55  int16 width;
56  int16 color;
57 };
58 
59 #define NUM_MAX_OBJECT 255
60 #define NUM_MAX_VAR 255
61 
62 void resetObjectTable();
63 int16 loadObject(char *pObjectName);
64 void setupObject(byte objIdx, uint16 param1, uint16 param2, uint16 param3, uint16 param4);
65 void modifyObjectParam(byte objIdx, byte paramIdx, int16 newValue);
66 
67 void addOverlay(uint16 objIdx, uint16 type);
68 int removeOverlay(uint16 objIdx, uint16 param);
69 void addGfxElement(int16 objIdx, int16 param, int16 type);
70 void removeGfxElement(int16 objIdx, int16 param, int16 type);
71 
72 int16 getObjectParam(uint16 objIdx, uint16 paramIdx);
73 
74 void addObjectParam(byte objIdx, byte paramIdx, int16 newValue);
75 void subObjectParam(byte objIdx, byte paramIdx, int16 newValue);
76 bool compareRanges(uint16 aStart, uint16 aEnd, uint16 bStart, uint16 bEnd);
77 uint16 compareObjectParamRanges(uint16 objIdx1, uint16 xAdd1, uint16 yAdd1, uint16 maskAdd1, uint16 objIdx2, uint16 xAdd2, uint16 yAdd2, uint16 maskAdd2);
78 uint16 compareObjectParam(byte objIdx, byte param1, int16 param2);
79 
80 } // End of namespace Cine
81 
82 #endif
Definition: anim.h:29
Definition: object.h:29
void clear()
Definition: object.h:39
Definition: object.h:50