ScummVM API documentation
view.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_SHARED_AC_VIEW_H
23#define AGS_SHARED_AC_VIEW_H
24
25#include "common/std/vector.h"
26#include "ags/shared/core/types.h"
27
28namespace AGS3 {
29
30namespace AGS {
31namespace Shared {
32class Stream;
33} // namespace Shared
34} // namespace AGS
35
36using namespace AGS; // FIXME later
37
38#define VFLG_FLIPSPRITE 1
39
40struct ViewFrame {
41 int pic;
42 short xoffs, yoffs;
43 short speed;
44 int flags; // VFLG_* flags
45 int sound; // play sound when this frame comes round
46 int reserved_for_future[2]; // kept only for plugin api
47 // not saved, set at runtime only
48 int audioclip; // actual audio clip reference (in case sound is a legacy number)
49
50 ViewFrame();
51
52 void ReadFromFile(Shared::Stream *in);
53 void WriteToFile(Shared::Stream *out);
54};
55
56#define LOOPFLAG_RUNNEXTLOOP 1
57
59 int numFrames;
60 int flags;
62 // NOTE: we still need numFrames:
63 // as we always allocate at least 1 frame for safety, to avoid crashes,
64 // but have to report "logical" number of frames for the engine API.
65
67 void Initialize(int frameCount);
68 void Dispose();
69 bool RunNextLoop();
70 void WriteToFile_v321(Shared::Stream *out);
71 void ReadFromFile_v321(Shared::Stream *in);
72 void WriteFrames(Shared::Stream *out);
73 void ReadFrames(Shared::Stream *in);
74};
75
76struct ViewStruct {
77 int numLoops;
79
80 ViewStruct();
81 void Initialize(int loopCount);
82 void Dispose();
83 void WriteToFile(Shared::Stream *out);
84 void ReadFromFile(Shared::Stream *in);
85};
86
88 short numloops;
89 short numframes[16];
90 int32_t loopflags[16];
91 ViewFrame frames[16][20];
92
94 void ReadFromFile(Shared::Stream *in);
95};
96
97extern void Convert272ViewsToNew(const std::vector<ViewStruct272> &oldv, std::vector<ViewStruct> &newv);
98
99} // namespace AGS3
100
101#endif
Definition: stream.h:52
Definition: vector.h:39
Definition: view.h:40
Definition: view.h:58
Definition: view.h:87
Definition: view.h:76