ScummVM API documentation
game_run.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_MAIN_GAME_RUN_H
23#define AGS_ENGINE_MAIN_GAME_RUN_H
24
25#include "ags/shared/ac/keycode.h"
26
27namespace AGS3 {
28
29namespace AGS {
30namespace Engine {
31class IDriverDependantBitmap;
32}
33}
34using namespace AGS::Engine; // FIXME later
35
36// Loops game frames until certain event takes place (for blocking actions)
37void GameLoopUntilValueIsZero(const int8 *value);
38void GameLoopUntilValueIsZero(const short *value);
39void GameLoopUntilValueIsZero(const int *value);
40void GameLoopUntilValueIsZeroOrLess(const short *move);
41void GameLoopUntilValueIsNegative(const short *value);
42void GameLoopUntilValueIsNegative(const int *value);
43void GameLoopUntilNotMoving(const short *move);
44void GameLoopUntilNoOverlay();
45void GameLoopUntilButAnimEnd(int guin, int objn);
46
47// Run the actual game until it ends, or aborted by player/error; loops GameTick() internally
48void RunGameUntilAborted();
49// Update everything game related; wait for the next frame
50void UpdateGameOnce(bool checkControls = false, IDriverDependantBitmap *extraBitmap = nullptr, int extraX = 0, int extraY = 0);
51// Update minimal required game state: audio, loop counter, etc; wait for the next frame
52void UpdateGameAudioOnly();
53// Updates everything related to object views that could have changed in the midst of a
54// blocking script, cursor position and view, poll anything related to cursor position;
55// this function is useful when you don't want to update whole game, but only things
56// that are necessary for rendering the game screen.
57void UpdateCursorAndDrawables();
58// Syncs object drawable states with their logical states.
59// Useful after a major game state change, such as loading new room, in case we expect
60// that a render may occur before a normal game update is performed.
61void SyncDrawablesState();
62// Gets current logical game FPS, this is normally a fixed number set in script;
63// in case of "maxed fps" mode this function returns real measured FPS.
64float get_game_fps();
65// Gets real fps, calculated based on the game performance.
66float get_real_fps();
67// Runs service key controls, returns false if no key was pressed or key input was claimed by the engine,
68// otherwise returns true and provides a keycode.
69bool run_service_key_controls(KeyInput &kgn);
70// Runs service mouse controls, returns false if mouse input was claimed by the engine,
71// otherwise returns true and provides mouse button code.
72bool run_service_mb_controls(eAGSMouseButton &mbut, int &mwheelz);
73// Polls few things (exit flag and debugger messages)
74// TODO: refactor this
75void update_polled_stuff();
76
77} // namespace AGS3
78
79#endif
Definition: engine.h:149
Out move(In first, In last, Out dst)
Definition: algorithm.h:109