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 
28 namespace AGS3 {
29 
30 namespace AGS {
31 namespace Shared {
32 class Stream;
33 } // namespace Shared
34 } // namespace AGS
35 
36 using namespace AGS; // FIXME later
37 
38 #define VFLG_FLIPSPRITE 1
39 
40 struct 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 
58 struct ViewLoopNew {
59  int numFrames;
60  int flags;
62  // NOTE: we still need numFrames for backward compatibility:
63  // some older versions could allocate extra frame(s) for safety,
64  // but have to report "logical" number of frames for the engine API.
65 
66  ViewLoopNew();
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_Aligned(Shared::Stream *out);
73  void ReadFrames_Aligned(Shared::Stream *in);
74 };
75 
76 struct 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 
87 struct ViewStruct272 {
88  short numloops;
89  short numframes[16];
90  int32_t loopflags[16];
91  ViewFrame frames[16][20];
92 
93  ViewStruct272();
94  void ReadFromFile(Shared::Stream *in);
95 };
96 
97 extern void Convert272ViewsToNew(const std::vector<ViewStruct272> &oldv, std::vector<ViewStruct> &newv);
98 
99 } // namespace AGS3
100 
101 #endif
Definition: achievements_tables.h:27
Definition: vector.h:39
Definition: view.h:58
Definition: view.h:76
Definition: view.h:87
Definition: view.h:40
Definition: stream.h:52
Definition: ags.h:40