ScummVM API documentation
render_table.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 ZVISION_RENDER_TABLE_H
23 #define ZVISION_RENDER_TABLE_H
24 
25 #include "common/rect.h"
26 #include "graphics/surface.h"
27 
28 namespace ZVision {
29 
30 class RenderTable {
31 public:
32  RenderTable(uint numRows, uint numColumns);
33  ~RenderTable();
34 
35 public:
36  enum RenderState {
37  PANORAMA,
38  TILT,
39  FLAT
40  };
41 
42 private:
43  uint _numColumns, _numRows;
44  Common::Point *_internalBuffer;
45  RenderState _renderState;
46 
47  struct {
48  float fieldOfView;
49  float linearScale;
50  bool reverse;
51  uint16 zeroPoint;
52  } _panoramaOptions;
53 
54  // TODO: See if tilt and panorama need to have separate options
55  struct {
56  float fieldOfView;
57  float linearScale;
58  bool reverse;
59  float gap;
60  } _tiltOptions;
61 
62 public:
63  RenderState getRenderState() {
64  return _renderState;
65  }
66  void setRenderState(RenderState newState);
67 
68  const Common::Point convertWarpedCoordToFlatCoord(const Common::Point &point);
69 
70  void mutateImage(uint16 *sourceBuffer, uint16 *destBuffer, uint32 destWidth, const Common::Rect &subRect);
71  void mutateImage(Graphics::Surface *dstBuf, Graphics::Surface *srcBuf);
72  void generateRenderTable();
73 
74  void setPanoramaFoV(float fov);
75  void setPanoramaScale(float scale);
76  void setPanoramaReverse(bool reverse);
77  void setPanoramaZeroPoint(uint16 point);
78  uint16 getPanoramaZeroPoint();
79  bool getPanoramaReverse();
80 
81  void setTiltFoV(float fov);
82  void setTiltScale(float scale);
83  void setTiltReverse(bool reverse);
84 
85  float getTiltGap();
86  float getAngle();
87  float getLinscale();
88 
89 private:
90  void generatePanoramaLookupTable();
91  void generateTiltLookupTable();
92 };
93 
94 } // End of namespace ZVision
95 
96 #endif
Definition: surface.h:67
Definition: render_table.h:30
Definition: rect.h:144
Definition: clock.h:29
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: rect.h:45