ScummVM API documentation
raycast.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  * of the License, or(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_PLUGINS_AGS_PAL_RENDER_RAYCAST_H
23 #define AGS_PLUGINS_AGS_PAL_RENDER_RAYCAST_H
24 
25 #include "ags/plugins/ags_pal_render/pal_render.h"
26 
27 namespace AGS3 {
28 namespace Plugins {
29 namespace AGSPalRender {
30 
31 #define MAP_WIDTH 64
32 #define MAP_HEIGHT 64
33 
34 struct Sprite {
35  double x;
36  double y;
37  int texture;
38  byte alpha;
39  int blendmode;
40  double uDivW;
41  double uDivH;
42  double vMove;
43  double hMove;
44  int8 objectinteract;
45  int view;
46  int frame;
47  int angle;
48 };
49 
50 struct wallType {
51  int texture[4];
52  int solid[4];
53  int ignorelighting[4];
54  int alpha[4];
55  int blendtype[4];
56  int mask[4];
57  byte hotspotinteract;
58 };
59 
60 
61 extern bool raycastOn;
62 extern double posX;
63 extern double posY; //x and y start position
64 extern double dirX;
65 extern double dirY; //initial direction vector
66 extern double planeX;
67 extern double planeY; //the 2d raycaster version of camera plane
68 extern double moveSpeed; //the constant value is in squares/second
69 extern double rotSpeed; //the constant value is in radians/second
70 extern unsigned char worldMap[MAP_WIDTH][MAP_HEIGHT];
71 extern unsigned char lightMap[MAP_WIDTH][MAP_HEIGHT];
72 extern int ceilingMap[MAP_WIDTH][MAP_HEIGHT];
73 extern int floorMap[MAP_WIDTH][MAP_HEIGHT];
74 extern int heightMap[MAP_WIDTH][MAP_HEIGHT];
75 extern unsigned char seenMap[MAP_WIDTH][MAP_HEIGHT];
76 extern int textureSlot;
77 extern int ambientlight;
78 
79 #define numSprites 256
80 extern Sprite sprite[numSprites];
81 
82 
83 #define texWidth 64
84 #define texHeight 64
85 #define MAX_TEXTURES 512
86 extern unsigned char texture[][texWidth * texHeight];
87 
88 extern bool heightmapOn;
89 
90 
91 extern wallType wallData[256];
92 
93 //arrays used to sort the sprites
94 extern unsigned char **transcolorbuffer;
95 extern unsigned char **transalphabuffer;
96 extern double **transzbuffer;
97 extern bool *transslicedrawn;
98 extern int *transwallblendmode;
99 extern double **ZBuffer;
100 extern double *distTable;
101 extern short *interactionmap;
102 extern int skybox;
103 
104 } // namespace AGSPalRender
105 } // namespace Plugins
106 } // namespace AGS3
107 
108 #endif
Definition: raycast.h:34
Definition: ags.h:40