ScummVM API documentation
animator.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 SNATCHER_ANIMATOR_H
23#define SNATCHER_ANIMATOR_H
24
25#include "common/platform.h"
26#include "snatcher/state.h"
27#include "snatcher/graphics.h"
28#include "snatcher/resource.h"
29
30namespace Snatcher {
31
32class SoundEngine;
33class Animator {
34public:
35 virtual ~Animator() {}
36
37 virtual bool enqueueDrawCommands(ResourcePointer &res) = 0;
38 virtual void clearDrawCommands() = 0;
39 virtual void initData(ResourcePointer &res, uint8 mode) = 0;
40 virtual void initAnimations(ResourcePointer &res, uint16 len, bool dontUpdate) = 0;
41 virtual void linkAnimations(ResourcePointer &res, uint16 len) = 0;
42 virtual void clearAnimations(int mode = 0) = 0;
43 virtual void setPlaneMode(uint16 mode) = 0;
44
45 virtual void resetTextFields() = 0;
46 virtual void clearTextInputLine() = 0;
47 virtual uint8 *getTextRenderBuffer() const = 0;
48 virtual void renderTextBuffer(uint16 firstLine, uint8 numLines) = 0;
49
50 virtual void updateSaveLoadDialog(SaveInfo &saveInfo) = 0;
51
52 virtual void updateScreen(uint8 *screen) = 0;
53 virtual void updateAnimations() = 0;
54
55 virtual void setAnimParameter(uint8 animObjId, int param, int32 value) = 0;
56 virtual void setAnimGroupParameter(uint8 animObjId, int groupOp, int32 value = 0) = 0;
57 virtual int32 getAnimParameter(uint8 animObjId, int param) const = 0;
58 virtual uint8 getAnimScriptByte(uint8 animObjId, uint16 offset) const = 0;
59 virtual void animCopySpec(uint8 srcAnimObjId, uint8 dstAnimObjId) = 0;
60
61 virtual uint16 screenWidth() const = 0;
62 virtual uint16 screenHeight() const = 0;
63 virtual uint16 realScreenWidth() const = 0;
64 virtual uint16 realScreenHeight() const = 0;
65
66 // The original game does not have mouse control on any platform. But
67 // the Sega CD version supports a lightgun. So we do have some fundamentals
68 // on which we can set this this up...
69 virtual void createMouseCursor() = 0;
70
71 // This is special code from the CD-ROM boot sectors that does not
72 // share anything with the rest of the game. So it makes sense to
73 // keep it separate.
74 virtual int drawBootLogoFrame(uint8 *screen, int frameNo) = 0;
75
76protected:
77 Animator(GraphicsEngine::GfxState &state) : _gfxState(state) {}
78 GraphicsEngine::GfxState &_gfxState;
79
80private:
81 static Animator *createSCDAnimator(const Graphics::PixelFormat *pxf, GraphicsEngine::GfxState &state, Palette *pal, TransitionManager *scr, SoundEngine *snd, bool enableAspectRatioCorrection);
82
83public:
84 static Animator *create(const Graphics::PixelFormat *pxf, Common::Platform platform, GraphicsEngine::GfxState &state, Palette *pal, TransitionManager *scr, SoundEngine *snd, bool enableAspectRatioCorrection) {
85 switch (platform) {
86 case Common::kPlatformSegaCD:
87 return createSCDAnimator(pxf, state, pal, scr, snd, enableAspectRatioCorrection);
88 default:
89 break;
90 };
91 return 0;
92 }
93};
94
95} // End of namespace Snatcher
96
97#endif // SNATCHER_ANIMATOR_H
Definition: animator.h:33
Definition: palette.h:42
Definition: resource.h:52
Definition: sound.h:42
Definition: transition.h:36
Platform
Definition: platform.h:93
Definition: pixelformat.h:138
Definition: graphics.h:163
Definition: state.h:51