ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 
30 namespace AGS3 {
31 
32 ScriptDrawingSurface *Room_GetDrawingSurfaceForBackground(int backgroundNumber);
33 ScriptDrawingSurface *Room_GetDrawingSurfaceForMask(RoomAreaMask mask);
34 int Room_GetObjectCount();
35 int Room_GetWidth();
36 int Room_GetHeight();
37 int Room_GetColorDepth();
38 int Room_GetLeftEdge();
39 int Room_GetRightEdge();
40 int Room_GetTopEdge();
41 int Room_GetBottomEdge();
42 int Room_GetMusicOnLoad();
43 const char *Room_GetTextProperty(const char *property);
44 int Room_GetProperty(const char *property);
45 bool Room_SetProperty(const char *property, int value);
46 bool Room_SetTextProperty(const char *property, const char *value);
47 const char *Room_GetMessages(int index);
48 bool Room_Exists(int room);
49 RuntimeScriptValue Sc_Room_GetProperty(const RuntimeScriptValue *params, int32_t param_count);
50 ScriptDrawingSurface *GetDrawingSurfaceForWalkableArea();
51 ScriptDrawingSurface *GetDrawingSurfaceForWalkbehind();
52 ScriptDrawingSurface *Hotspot_GetDrawingSurface();
53 ScriptDrawingSurface *Region_GetDrawingSurface();
54 
55 //=============================================================================
56 
57 void save_room_data_segment();
58 void unload_old_room();
59 void load_new_room(int newnum, CharacterInfo *forchar);
60 void 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
63 void set_room_placeholder();
64 int find_highest_room_entered();
65 void first_room_initialization();
66 void check_new_room();
67 void compile_room_script();
68 void on_background_frame_change();
69 // Clear the current room pointer if room status is no longer valid
70 void 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)
80 extern int room_to_mask_coord(int coord);
81 // coordinate conversion (room mask) ---> game ---> (data)
82 extern int mask_to_room_coord(int coord);
83 
84 struct MoveList;
85 // Convert move path from room's mask resolution to room resolution
86 void convert_move_path_to_room_resolution(MoveList *ml, int from_step = 0, int to_step = -1);
87 
88 } // namespace AGS3
89 
90 #endif
Definition: ags.h:40