ScummVM API documentation
adv_hotspot.h
1
2/* ScummVM - Graphic Adventure Engine
3 *
4 * ScummVM is the legal property of its developers, whose names
5 * are too numerous to list here. Please refer to the COPYRIGHT
6 * file distributed with this source distribution.
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef M4_ADV_R_ADV_HOTSPOT_H
24#define M4_ADV_R_ADV_HOTSPOT_H
25
26#include "m4/m4_types.h"
27
28namespace M4 {
29
30struct HotSpotRec {
31 int32 ul_x, ul_y, lr_x, lr_y; // Hotspot screen coordinates
32 int32 feet_x, feet_y; // Walk-to target for player
33 int8 facing; // Direction player should face
34 bool active; // Flag if hotspot is active
35 byte cursor_number; // Mouse cursor number
36 byte syntax; // Word syntax
37 int32 vocabID, verbID; // ids of name and verb
38 char *vocab; // Vocabulary name of hotspot
39 char *verb; // Vocabulary default verb name
40 char *prep; // Preposition
41 char *sprite; // Sprite name
42 int16 hash; // woodscript sprite hash (runtime only)
43 HotSpotRec *next;
44
45 void clear();
46};
47
48HotSpotRec *hotspot_add_dynamic(
49 const char *verb, const char *noun,
50 int32 x1, int32 y1, int32 x2, int32 y2,
51 int32 cursor,
52 bool new_head = true,
53 int32 walkto_x = 32767, int32 walkto_y = 32767, int32 facing = 0);
54
60HotSpotRec *hotspot_new(int x1, int y1, int x2, int y2);
61
67HotSpotRec *hotspot_add(HotSpotRec *head, HotSpotRec *h, bool new_head);
68HotSpotRec *hotspot_duplicate(HotSpotRec *dupMe);
69
75
81void hotspot_delete_all(HotSpotRec *head);
82
83void hotspot_set_active(HotSpotRec *head, const char *name, bool active_or_not);
84void hotspot_set_active(const char *name, bool active_or_not);
85void hotspot_set_active_xy(HotSpotRec *head, const char *name, int32 x, int32 y, bool active_or_not);
86void hotspot_set_active_xy(const char *name, int32 x, int32 y, bool active_or_not);
87#define kernel_flip_hotspot(aa,bb) (hotspot_set_active(currentSceneDef.hotspots,aa,bb))
88#define kernel_flip_hotspot_xy(aa,bb,xx,yy) (hotspot_set_active_xy(currentSceneDef.hotspots,aa,xx,yy,bb))
89#define kernel_flip_hotspot_loc(aa,bb,xx,yy) (hotspot_set_active_xy(currentSceneDef.hotspots,aa,xx,yy,bb))
90
91void hotspot_new_sprite(HotSpotRec *h, const char *verb);
92void hotspot_newVerb(HotSpotRec *h, const char *verb);
93void hotspot_newVocab(HotSpotRec *h, const char *vocab);
94void hotspot_newPrep(HotSpotRec *h, const char *prep);
95
100HotSpotRec *hotspot_which(HotSpotRec *head, int x, int y);
101HotSpotRec *hotspot_which(int x, int y);
102void kill_hotspot_node(HotSpotRec *h);
103
104void hotspot_restore_all();
105void hotspot_hide_all();
106void hotspot_unhide_and_dump();
107
108} // End of namespace M4
109
110#endif
Definition: database.h:28
HotSpotRec * hotspot_new(int x1, int y1, int x2, int y2)
HotSpotRec * hotspot_unlink(HotSpotRec *head, HotSpotRec *h)
HotSpotRec * hotspot_delete_record(HotSpotRec *head, HotSpotRec *h)
HotSpotRec * hotspot_which(HotSpotRec *head, int x, int y)
HotSpotRec * hotspot_add(HotSpotRec *head, HotSpotRec *h, bool new_head)
Definition: adv_hotspot.h:30