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