ScummVM API documentation
camera.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 MADS_CORE_CAMERA_H
23 #define MADS_CORE_CAMERA_H
24 
25 #include "mads/madsv2/core/general.h"
26 
27 namespace MADS {
28 namespace MADSV2 {
29 
30 
31 #define CAMERA_PLAYER 0 /* Camera follows player */
32 #define CAMERA_MANUAL 1 /* Camera manually panned */
33 
34 #define CAMERA_DEFAULT_X_VELOCITY 4 /* Camera defaults */
35 #define CAMERA_DEFAULT_X_START 80
36 #define CAMERA_DEFAULT_X_STOP 4
37 #define CAMERA_DEFAULT_X_OFF_CENTER 80
38 
39 #define CAMERA_DEFAULT_Y_VELOCITY 2
40 #define CAMERA_DEFAULT_Y_START 60
41 #define CAMERA_DEFAULT_Y_STOP 4
42 #define CAMERA_DEFAULT_Y_OFF_CENTER 80
43 
44 
45 typedef struct {
46  int pans; /* Flag if camera can pan in this room */
47  int panning; /* Flag if camera now panning */
48  int pan_mode; /* Panning mode (CAMERA_PLAYER, etc.) */
49  int pan_velocity; /* Pixel velocity of pan */
50  int pan_rate; /* Pan frame rate */
51  int pan_target; /* Pan X or Y target for manual pans */
52  int pan_off_center; /* Pan distance off center */
53  int pan_on_tolerance; /* Pan initiator tolerance */
54  int pan_off_tolerance; /* Pan terminator tolerance */
55  int pan_direction; /* Pan initial direction */
56  long pan_clock; /* Pan clock for next update */
57  int pan_this_frame; /* Flag if panned this frame */
58 } Camera;
59 
60 
61 extern Camera camera_x; /* Horizontal panning camera */
62 extern Camera camera_y; /* Vertical panning camera */
63 
64 extern int camera_old_x_target;/* For saving/restoring game */
65 extern int camera_old_y_target;
66 
67 extern void camera_init_default();
68 extern void camera_jump_to(int x, int y);
69 extern void camera_pan_to(Camera *camera, int target);
70 extern void camera_update();
71 
72 extern void init_camera();
73 
74 } // namespace MADSV2
75 } // namespace MADS
76 
77 #endif
Definition: camera.h:45
Definition: sound_manager.h:38