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 #include "ags/plugins/core/hotspot.h"
24 #include "ags/engine/ac/hotspot.h"
25 
26 namespace AGS3 {
27 namespace Plugins {
28 namespace Core {
29 
AGS_EngineStartup(IAGSEngine * engine)30 void Hotspot::AGS_EngineStartup(IAGSEngine *engine) {
31 	ScriptContainer::AGS_EngineStartup(engine);
32 
33 	SCRIPT_METHOD(Hotspot::GetAtRoomXY^2, Hotspot::GetHotspotAtRoom);
34 	SCRIPT_METHOD(Hotspot::GetAtScreenXY^2, Hotspot::GetHotspotAtScreen);
35 	SCRIPT_METHOD(Hotspot::GetName^1, Hotspot::GetName);
36 	SCRIPT_METHOD(Hotspot::GetProperty^1, Hotspot::GetProperty);
37 	SCRIPT_METHOD(Hotspot::GetPropertyText^2, Hotspot::GetPropertyText);
38 	SCRIPT_METHOD(Hotspot::GetTextProperty^1, Hotspot::GetTextProperty);
39 	SCRIPT_METHOD(Hotspot::RunInteraction^1, Hotspot::RunInteraction);
40 	SCRIPT_METHOD(Hotspot::get_Enabled, Hotspot::GetEnabled);
41 	SCRIPT_METHOD(Hotspot::set_Enabled, Hotspot::SetEnabled);
42 	SCRIPT_METHOD(Hotspot::get_ID, Hotspot::GetID);
43 	SCRIPT_METHOD(Hotspot::get_Name, Hotspot::GetName_New);
44 	SCRIPT_METHOD(Hotspot::get_WalkToX, Hotspot::GetWalkToX);
45 	SCRIPT_METHOD(Hotspot::get_WalkToY, Hotspot::GetWalkToY);
46 }
47 
GetHotspotAtRoom(ScriptMethodParams & params)48 void Hotspot::GetHotspotAtRoom(ScriptMethodParams &params) {
49 	PARAMS2(int, x, int, y);
50 	params._result = AGS3::GetHotspotAtRoom(x, y);
51 }
52 
GetHotspotAtScreen(ScriptMethodParams & params)53 void Hotspot::GetHotspotAtScreen(ScriptMethodParams &params) {
54 	PARAMS2(int, xx, int, yy);
55 	params._result = AGS3::GetHotspotAtScreen(xx, yy);
56 }
57 
GetName(ScriptMethodParams & params)58 void Hotspot::GetName(ScriptMethodParams &params) {
59 	PARAMS2(ScriptHotspot *, hss, char *, buffer);
60 	AGS3::Hotspot_GetName(hss, buffer);
61 }
62 
GetProperty(ScriptMethodParams & params)63 void Hotspot::GetProperty(ScriptMethodParams &params) {
64 	PARAMS2(ScriptHotspot *, hss, const char *, property);
65 	params._result = AGS3::Hotspot_GetProperty(hss, property);
66 }
67 
GetPropertyText(ScriptMethodParams & params)68 void Hotspot::GetPropertyText(ScriptMethodParams &params) {
69 	PARAMS3(ScriptHotspot *, hss, const char *, property, char *, bufer);
70 	AGS3::Hotspot_GetPropertyText(hss, property, bufer);
71 }
72 
GetTextProperty(ScriptMethodParams & params)73 void Hotspot::GetTextProperty(ScriptMethodParams &params) {
74 	PARAMS2(ScriptHotspot *, hss, const char *, property);
75 	params._result = AGS3::Hotspot_GetTextProperty(hss, property);
76 }
77 
RunInteraction(ScriptMethodParams & params)78 void Hotspot::RunInteraction(ScriptMethodParams &params) {
79 	PARAMS2(ScriptHotspot *, hss, int, mood);
80 	AGS3::Hotspot_RunInteraction(hss, mood);
81 }
82 
GetEnabled(ScriptMethodParams & params)83 void Hotspot::GetEnabled(ScriptMethodParams &params) {
84 	PARAMS1(ScriptHotspot *, hss);
85 	params._result = AGS3::Hotspot_GetEnabled(hss);
86 }
87 
SetEnabled(ScriptMethodParams & params)88 void Hotspot::SetEnabled(ScriptMethodParams &params) {
89 	PARAMS2(ScriptHotspot *, hss, int, newval);
90 	AGS3::Hotspot_SetEnabled(hss, newval);
91 }
92 
GetID(ScriptMethodParams & params)93 void Hotspot::GetID(ScriptMethodParams &params) {
94 	PARAMS1(ScriptHotspot *, hss);
95 	params._result = AGS3::Hotspot_GetID(hss);
96 }
97 
GetName_New(ScriptMethodParams & params)98 void Hotspot::GetName_New(ScriptMethodParams &params) {
99 	PARAMS1(ScriptHotspot *, hss);
100 	params._result = AGS3::Hotspot_GetName_New(hss);
101 }
102 
GetWalkToX(ScriptMethodParams & params)103 void Hotspot::GetWalkToX(ScriptMethodParams &params) {
104 	PARAMS1(ScriptHotspot *, hss);
105 	params._result = AGS3::Hotspot_GetWalkToX(hss);
106 }
107 
GetWalkToY(ScriptMethodParams & params)108 void Hotspot::GetWalkToY(ScriptMethodParams &params) {
109 	PARAMS1(ScriptHotspot *, hss);
110 	params._result = AGS3::Hotspot_GetWalkToY(hss);
111 }
112 
113 } // namespace Core
114 } // namespace Plugins
115 } // namespace AGS3
116