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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 //=============================================================================
24 //
25 //
26 // [IKM] 2012-06-25: This bugs me that type is called 'Object'; in modern
27 // world of programming 'object' is usually a base class; should not we
28 // rename this to RoomObject one day?
29 //=============================================================================
30 
31 #ifndef AGS_ENGINE_AC_OBJECT_H
32 #define AGS_ENGINE_AC_OBJECT_H
33 
34 #include "ags/shared/ac/common_defines.h"
35 #include "ags/engine/ac/dynobj/script_object.h"
36 
37 namespace AGS3 {
38 
39 namespace AGS {
40 namespace Shared {
41 class Bitmap;
42 } // namespace Shared
43 } // namespace AGS
44 
45 using namespace AGS; // FIXME later
46 
47 extern AGS_INLINE int is_valid_object(int obtest);
48 int     Object_IsCollidingWithObject(ScriptObject *objj, ScriptObject *obj2);
49 ScriptObject *GetObjectAtScreen(int xx, int yy);
50 ScriptObject *GetObjectAtRoom(int x, int y);
51 void    Object_Tint(ScriptObject *objj, int red, int green, int blue, int saturation, int luminance);
52 void    Object_RemoveTint(ScriptObject *objj);
53 void    Object_SetView(ScriptObject *objj, int view, int loop, int frame);
54 void    Object_SetTransparency(ScriptObject *objj, int trans);
55 int     Object_GetTransparency(ScriptObject *objj);
56 void    Object_SetBaseline(ScriptObject *objj, int basel);
57 int     Object_GetBaseline(ScriptObject *objj);
58 void    Object_Animate(ScriptObject *objj, int loop, int delay, int repeat, int blocking, int direction);
59 void    Object_StopAnimating(ScriptObject *objj);
60 void    Object_MergeIntoBackground(ScriptObject *objj);
61 void    Object_StopMoving(ScriptObject *objj);
62 void    Object_SetVisible(ScriptObject *objj, int onoroff);
63 int     Object_GetView(ScriptObject *objj);
64 int     Object_GetLoop(ScriptObject *objj);
65 int     Object_GetFrame(ScriptObject *objj);
66 int     Object_GetVisible(ScriptObject *objj);
67 void    Object_SetGraphic(ScriptObject *objj, int slott);
68 int     Object_GetGraphic(ScriptObject *objj);
69 int     Object_GetX(ScriptObject *objj);
70 int     Object_GetY(ScriptObject *objj);
71 int     Object_GetAnimating(ScriptObject *objj);
72 int     Object_GetMoving(ScriptObject *objj);
73 void    Object_SetPosition(ScriptObject *objj, int xx, int yy);
74 void    Object_SetX(ScriptObject *objj, int xx);
75 void    Object_SetY(ScriptObject *objj, int yy);
76 void    Object_GetName(ScriptObject *objj, char *buffer);
77 const char *Object_GetName_New(ScriptObject *objj);
78 bool    Object_IsInteractionAvailable(ScriptObject *oobj, int mood);
79 void    Object_Move(ScriptObject *objj, int x, int y, int speed, int blocking, int direct);
80 void    Object_SetClickable(ScriptObject *objj, int clik);
81 int     Object_GetClickable(ScriptObject *objj);
82 void    Object_SetIgnoreScaling(ScriptObject *objj, int newval);
83 int     Object_GetIgnoreScaling(ScriptObject *objj);
84 void    Object_SetSolid(ScriptObject *objj, int solid);
85 int     Object_GetSolid(ScriptObject *objj);
86 void    Object_SetBlockingWidth(ScriptObject *objj, int bwid);
87 int     Object_GetBlockingWidth(ScriptObject *objj);
88 void    Object_SetBlockingHeight(ScriptObject *objj, int bhit);
89 int     Object_GetBlockingHeight(ScriptObject *objj);
90 int     Object_GetID(ScriptObject *objj);
91 void    Object_SetIgnoreWalkbehinds(ScriptObject *chaa, int clik);
92 int     Object_GetIgnoreWalkbehinds(ScriptObject *chaa);
93 void    Object_RunInteraction(ScriptObject *objj, int mode);
94 
95 int     Object_GetProperty(ScriptObject *objj, const char *property);
96 void    Object_GetPropertyText(ScriptObject *objj, const char *property, char *bufer);
97 const char *Object_GetTextProperty(ScriptObject *objj, const char *property);
98 
99 void    move_object(int objj, int tox, int toy, int spee, int ignwal);
100 void    get_object_blocking_rect(int objid, int *x1, int *y1, int *width, int *y2);
101 int     isposinbox(int mmx, int mmy, int lf, int tp, int rt, int bt);
102 int     is_pos_in_sprite(int xx, int yy, int arx, int ary, Shared::Bitmap *sprit, int spww, int sphh, int flipped = 0);
103 // X and Y co-ordinates must be in native format
104 // X and Y are ROOM coordinates
105 int     check_click_on_object(int roomx, int roomy, int mood);
106 
107 } // namespace AGS3
108 
109 #endif
110