ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 
31 namespace AGS3 {
32 
33 namespace AGS {
34 namespace Shared {
35 class Graphics;
36 } // namespace Shared
37 } // namespace AGS
38 
39 using namespace AGS; // FIXME later
40 
41 int ViewFrame_GetFlipped(ScriptViewFrame *svf);
42 int ViewFrame_GetGraphic(ScriptViewFrame *svf);
43 void ViewFrame_SetGraphic(ScriptViewFrame *svf, int newPic);
44 ScriptAudioClip *ViewFrame_GetLinkedAudio(ScriptViewFrame *svf);
45 void ViewFrame_SetLinkedAudio(ScriptViewFrame *svf, ScriptAudioClip *clip);
46 int ViewFrame_GetSound(ScriptViewFrame *svf);
47 void ViewFrame_SetSound(ScriptViewFrame *svf, int newSound);
48 int ViewFrame_GetSpeed(ScriptViewFrame *svf);
49 int ViewFrame_GetView(ScriptViewFrame *svf);
50 int ViewFrame_GetLoop(ScriptViewFrame *svf);
51 int 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 :/
56 int 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)
59 void CheckViewFrame(int view, int loop, int frame, int sound_volume = 100);
60 // draws a view frame, flipped if appropriate
61 void DrawViewFrame(Shared::Bitmap *ds, const ViewFrame *vframe, int x, int y, bool alpha_blend = false);
62 
63 } // namespace AGS3
64 
65 #endif
Definition: achievements_tables.h:27
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: formatinfo.h:28
Definition: ags.h:40