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 #ifndef AGS_ENGINE_AC_ROOM_H 24 #define AGS_ENGINE_AC_ROOM_H 25 26 #include "ags/engine/ac/dynobj/script_drawing_surface.h" 27 #include "ags/shared/ac/character_info.h" 28 #include "ags/engine/script/runtime_script_value.h" 29 #include "ags/shared/game/room_struct.h" 30 31 namespace AGS3 { 32 33 ScriptDrawingSurface *Room_GetDrawingSurfaceForBackground(int backgroundNumber); 34 ScriptDrawingSurface *Room_GetDrawingSurfaceForMask(RoomAreaMask mask); 35 int Room_GetObjectCount(); 36 int Room_GetWidth(); 37 int Room_GetHeight(); 38 int Room_GetColorDepth(); 39 int Room_GetLeftEdge(); 40 int Room_GetRightEdge(); 41 int Room_GetTopEdge(); 42 int Room_GetBottomEdge(); 43 int Room_GetMusicOnLoad(); 44 const char *Room_GetTextProperty(const char *property); 45 int Room_GetProperty(const char *property); 46 const char *Room_GetMessages(int index); 47 bool Room_Exists(int room); 48 RuntimeScriptValue Sc_Room_GetProperty(const RuntimeScriptValue *params, int32_t param_count); 49 50 //============================================================================= 51 52 void save_room_data_segment(); 53 void unload_old_room(); 54 void load_new_room(int newnum, CharacterInfo *forchar); 55 void new_room(int newnum, CharacterInfo *forchar); 56 int find_highest_room_entered(); 57 void first_room_initialization(); 58 void check_new_room(); 59 void compile_room_script(); 60 void on_background_frame_change(); 61 // Clear the current room pointer if room status is no longer valid 62 void croom_ptr_clear(); 63 64 // These functions convert coordinates between data resolution and region mask. 65 // In hi-res games region masks are 1:2 (or smaller) of the room size. 66 // In legacy games with low-res data resolution there's additional conversion 67 // between data and room coordinates. 68 // 69 // gets multiplier for converting from room mask to data coordinate 70 extern AGS_INLINE int get_roommask_to_data_mul(); 71 // coordinate conversion data ---> room ---> mask 72 extern AGS_INLINE int room_to_mask_coord(int coord); 73 // coordinate conversion mask ---> room ---> data 74 extern AGS_INLINE int mask_to_room_coord(int coord); 75 76 struct MoveList; 77 // Convert move path from room's mask resolution to room resolution 78 void convert_move_path_to_room_resolution(MoveList *ml); 79 80 } // namespace AGS3 81 82 #endif 83