ScummVM API documentation
view_frame.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_VIEW_FRAME_H
23#define AGS_ENGINE_AC_VIEW_FRAME_H
24
25#include "ags/engine/ac/runtime_defines.h"
26#include "ags/shared/ac/view.h"
27#include "ags/shared/ac/dynobj/script_audio_clip.h"
28#include "ags/engine/ac/dynobj/script_view_frame.h"
29#include "ags/shared/gfx/bitmap.h"
30
31namespace AGS3 {
32
33namespace AGS {
34namespace Shared {
35class Graphics;
36} // namespace Shared
37} // namespace AGS
38
39using namespace AGS; // FIXME later
40
41int ViewFrame_GetFlipped(ScriptViewFrame *svf);
42int ViewFrame_GetGraphic(ScriptViewFrame *svf);
43void ViewFrame_SetGraphic(ScriptViewFrame *svf, int newPic);
44ScriptAudioClip *ViewFrame_GetLinkedAudio(ScriptViewFrame *svf);
45void ViewFrame_SetLinkedAudio(ScriptViewFrame *svf, ScriptAudioClip *clip);
46int ViewFrame_GetSound(ScriptViewFrame *svf);
47void ViewFrame_SetSound(ScriptViewFrame *svf, int newSound);
48int ViewFrame_GetSpeed(ScriptViewFrame *svf);
49int ViewFrame_GetView(ScriptViewFrame *svf);
50int ViewFrame_GetLoop(ScriptViewFrame *svf);
51int ViewFrame_GetFrame(ScriptViewFrame *svf);
52
53// Calculate the frame sound volume from different factors;
54// pass scale as 100 if volume scaling is disabled
55// NOTE: historically scales only in 0-100 range :/
56int CalcFrameSoundVolume(int obj_vol, int anim_vol, int scale = 100);
57// Handle the new animation frame (play linked sounds, etc);
58// sound_volume is an optional *relative* factor, 100 is default (unchanged)
59void CheckViewFrame(int view, int loop, int frame, int sound_volume = 100);
60// draws a view frame, flipped if appropriate
61void DrawViewFrame(Shared::Bitmap *ds, const ViewFrame *vframe, int x, int y, bool alpha_blend = false);
62
63} // namespace AGS3
64
65#endif
Definition: formatinfo.h:28