ScummVM API documentation
te_tiled_surface.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 TETRAEDGE_TE_TE_TILED_SURFACE_H
23#define TETRAEDGE_TE_TE_TILED_SURFACE_H
24
25#include "common/ptr.h"
26#include "common/path.h"
27
28#include "tetraedge/te/te_model.h"
29#include "tetraedge/te/te_frame_anim.h"
30#include "tetraedge/te/te_image.h"
31#include "tetraedge/te/te_3d_texture.h"
32#include "tetraedge/te/te_tiled_texture.h"
33#include "tetraedge/te/te_i_codec.h"
34#include "tetraedge/te/te_intrusive_ptr.h"
35
36namespace Tetraedge {
37
38class TeTiledSurface : public TeModel {
39public:
41 virtual ~TeTiledSurface();
42
43 virtual int bufferSize() { return 1; } // unused?
44 void cont();
45 void draw() override;
46 virtual void entry() {};
47 byte isLoaded();
48 bool load(const TetraedgeFSNode &node);
49 bool load(const TeImage &image);
50 bool load(const TeIntrusivePtr<Te3DTexture> &texture);
51
52 bool onFrameAnimCurrentFrameChanged();
53 void pause();
54 void play();
55
56 void setBottomCropping(float val) {
57 _bottomCrop = val;
58 updateSurface();
59 }
60 void setLeftCropping(float val) {
61 _leftCrop = val;
62 updateSurface();
63 }
64 void setRightCropping(float val) {
65 _rightCrop = val;
66 updateSurface();
67 }
68 void setTopCropping(float val) {
69 _topCrop = val;
70 updateSurface();
71 }
72
73 virtual void setBufferSize(long bufSz) {}; // unused?
74
75 void setColorKey(const TeColor &col);
76 void setColorKeyActivated(bool val);
77 void setColorKeyTolerence(float val);
78 void setTiledTexture(const TeIntrusivePtr<TeTiledTexture> &texture);
79
80 void stop();
81 void unload();
82 void update(const TeImage &image);
83 void updateSurface();
84 void updateVideoProperties();
85
86 const Common::Path &loadedPath() const { return _loadedPath; }
87 void setLoadedPath(const Common::Path &p) { _loadedPath = p; }
88
89 TeFrameAnim _frameAnim;
90
91 TeICodec *codec() { return _codec; }
92
93private:
94 float _bottomCrop;
95 float _leftCrop;
96 float _rightCrop;
97 float _topCrop;
98
99 TeICodec *_codec;
100
101 TeColor _colorKey;
102 bool _colorKeyActive;
103 float _colorKeyTolerence;
104
105 bool _shouldDraw;
106
107 Graphics::PixelFormat _imgFormat;
108
109 Common::Path _loadedPath;
110
111};
112
113} // end namespace Tetraedge
114
115#endif // TETRAEDGE_TE_TE_TILED_SURFACE_H
Definition: path.h:52
Definition: te_color.h:30
Definition: te_frame_anim.h:30
Definition: te_i_codec.h:34
Definition: te_image.h:42
Definition: te_intrusive_ptr.h:31
Definition: te_model.h:44
Definition: te_tiled_surface.h:38
Definition: tetraedge.h:65
Definition: pixelformat.h:138