ScummVM API documentation
renderer3d.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 TRECISION_RENDERER3D_H
23 #define TRECISION_RENDERER3D_H
24 
25 #include "trecision/struct.h"
26 
27 namespace Trecision {
28 
29 struct SVVertex {
30  int32 _x, _y, _z;
31  int32 _angle;
32 
33  void clear() {
34  _x = _y = _z = 0;
35  _angle = 0;
36  }
37 };
38 
39 class TrecisionEngine;
40 
41 class Renderer3D {
42  TrecisionEngine *_vm;
43 
44  int16 _minXClip;
45  int16 _minYClip;
46  int16 _maxXClip;
47  int16 _maxYClip;
48 
49  int16 *_zBuffer;
50 
51  int16 _zBufStartX;
52  int16 _zBufStartY;
53  int16 _zBufWid;
54 
55  int16 _shadowLightNum;
56  int16 _totalShadowVerts;
57  uint8 _shadowIntens[10];
58 
59  SVVertex _vVertex[MAXVERTEX];
60  SVertex _shVertex[MAXVERTEX];
61 
62  // data for the triangle routines
63  int16 _lEdge[480];
64  int16 _rEdge[480];
65  uint8 _lColor[480];
66  uint8 _rColor[480];
67  int16 _lZ[480];
68  int16 _rZ[480];
69  uint16 _lTextX[480];
70  uint16 _rTextX[480];
71  uint16 _lTextY[480];
72  uint16 _rTextY[480];
73 
74  void setZBufferRegion(int16 sx, int16 sy, int16 dx);
75  int8 clockWise(int16 x1, int16 y1, int16 x2, int16 y2, int16 x3, int16 y3);
76  void textureTriangle(int32 x1, int32 y1, int32 z1, int32 c1, int32 tx1, int32 ty1, int32 x2, int32 y2, int32 z2, int32 c2, int32 tx2, int32 ty2, int32 x3, int32 y3, int32 z3, int32 c3, int32 tx3, int32 ty3, const STexture *t);
77  void textureScanEdge(int32 x1, int32 y1, int32 z1, int32 c1, int32 tx1, int32 ty1, int32 x2, int32 y2, int32 z2, int32 c2, int32 tx2, int32 ty2);
78  void shadowTriangle(int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, uint8 cv, int32 zv);
79  void shadowScanEdge(int32 x1, int32 y1, int32 x2, int32 y2);
80  void calcCharacterPoints();
81  void drawCharacterFaces();
82 
83 public:
85  ~Renderer3D();
86 
87  void init3DRoom();
88  void resetZBuffer(Common::Rect area);
89  void setClipping(int16 x1, int16 y1, int16 x2, int16 y2);
90  void drawCharacter(uint8 flag);
91 };
92 
93 } // End of namespace Trecision
94 #endif
95 
Definition: struct.h:203
Definition: struct.h:215
Definition: trecision.h:112
Definition: rect.h:144
Definition: renderer3d.h:29
Definition: renderer3d.h:41
Definition: actor.h:29