ScummVM API documentation
room.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 AGS_ENGINE_AC_ROOM_H
23#define AGS_ENGINE_AC_ROOM_H
24
25#include "ags/engine/ac/dynobj/script_drawing_surface.h"
26#include "ags/shared/ac/character_info.h"
27#include "ags/engine/script/runtime_script_value.h"
28#include "ags/shared/game/room_struct.h"
29
30namespace AGS3 {
31
32ScriptDrawingSurface *Room_GetDrawingSurfaceForBackground(int backgroundNumber);
33ScriptDrawingSurface *Room_GetDrawingSurfaceForMask(RoomAreaMask mask);
34int Room_GetObjectCount();
35int Room_GetWidth();
36int Room_GetHeight();
37int Room_GetColorDepth();
38int Room_GetLeftEdge();
39int Room_GetRightEdge();
40int Room_GetTopEdge();
41int Room_GetBottomEdge();
42int Room_GetMusicOnLoad();
43const char *Room_GetTextProperty(const char *property);
44int Room_GetProperty(const char *property);
45bool Room_SetProperty(const char *property, int value);
46bool Room_SetTextProperty(const char *property, const char *value);
47const char *Room_GetMessages(int index);
48bool Room_Exists(int room);
49RuntimeScriptValue Sc_Room_GetProperty(const RuntimeScriptValue *params, int32_t param_count);
50ScriptDrawingSurface *GetDrawingSurfaceForWalkableArea();
51ScriptDrawingSurface *GetDrawingSurfaceForWalkbehind();
52ScriptDrawingSurface *Hotspot_GetDrawingSurface();
53ScriptDrawingSurface *Region_GetDrawingSurface();
54
55//=============================================================================
56
57void save_room_data_segment();
58void unload_old_room();
59void load_new_room(int newnum, CharacterInfo *forchar);
60void new_room(int newnum, CharacterInfo *forchar);
61// Sets up a placeholder room object; this is used to avoid occasional crashes
62// in case an API function was called that needs to access a room, while no real room is loaded
63void set_room_placeholder();
64int find_highest_room_entered();
65void first_room_initialization();
66void check_new_room();
67void compile_room_script();
68void on_background_frame_change();
69// Clear the current room pointer if room status is no longer valid
70void croom_ptr_clear();
71
72// Following functions convert coordinates between room resolution and region mask.
73// Region masks can be 1:N of the room size: 1:1, 1:2 etc.
74// In contemporary games this is simply multiplying or dividing on mask resolution.
75// In legacy upscale mode (and generally pre-3.* high-res games) things are more
76// complicated, as first we need to make an additional conversion between data coords
77// and upscale game coordinates.
78//
79// coordinate conversion (data) ---> game ---> (room mask)
80extern int room_to_mask_coord(int coord);
81// coordinate conversion (room mask) ---> game ---> (data)
82extern int mask_to_room_coord(int coord);
83
84struct MoveList;
85// Convert move path from room's mask resolution to room resolution
86void convert_move_path_to_room_resolution(MoveList *ml, int from_step = 0, int to_step = -1);
87
88} // namespace AGS3
89
90#endif