1 /*
2 Copyright (C) 1994-1995 Apogee Software, Ltd.
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13 See the GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 
19 */
20 #ifndef _rt_draw_public
21 #define _rt_draw_public
22 
23 //***************************************************************************
24 //
25 //    RT_DRAW.C - Draw-o-rama
26 //
27 //***************************************************************************
28 
29 
30 #define MAXVISIBLE              256
31 
32 extern int whereami;
33 
34 extern byte * shadingtable;            // Shading table for DrawPost
35 
36 typedef struct
37 {
38 int viewheight;
39 int viewx;
40 int shapenum;
41 int altshapenum;
42 int shapesize;
43 int x1,x2,h1,h2;
44 int texturestart;
45 int textureend;
46 byte * colormap;
47 
48 } visobj_t;
49 
50 
51 extern  word             tilemap[MAPSIZE][MAPSIZE];    // wall values only
52 extern  byte             spotvis[MAPSIZE][MAPSIZE];
53 
54 extern int tics;
55 extern int wstart;
56 extern int fandc;
57 
58 //
59 // math tables
60 //
61 extern short    tantable[FINEANGLES];
62 extern fixed    sintable[FINEANGLES+FINEANGLEQUAD+1];
63 extern fixed    *costable;
64 
65 //
66 // refresh variables
67 //
68 
69 extern fixed   viewx,viewy;             // the focal point
70 extern int     viewangle;
71 extern fixed   viewsin,viewcos;
72 
73 //
74 // ray tracing variables
75 //
76 
77 extern visobj_t vislist[MAXVISIBLE];
78 extern visobj_t *visptr,*visstep,*farthest;
79 
80 extern long     xintercept,yintercept;
81 extern byte     mapseen[MAPSIZE][MAPSIZE];
82 extern unsigned long * lights;
83 
84 extern int hp_startfrac;
85 extern int hp_srcstep;
86 extern int levelheight;
87 extern int maxheight;
88 extern int nominalheight;
89 
90 extern int actortime;
91 extern int drawtime;
92 extern int c_startx;
93 extern int c_starty;
94 
95 extern const int dirangle8[9];
96 extern const int dirangle16[16];
97 extern  int firstcoloffset;
98 
99 //=========================== macros =============================
100 
101 #define LightSourceAt(x,y)    (*(lights+((x)<<7)+(y)))
102 #define SetLight(x,y,level)   (LightSourceAt((x),(y))|=(unsigned long)(level))
103 
104 //=========================== functions =============================
105 
106 void  BuildTables (void);
107 void  CalcTics (void);
108 void  ThreeDRefresh (void);
109 void  FlipPage ( void );
110 void  TurnShakeOff( void );
111 void  AdaptDetail ( void );
112 int   CalcHeight (void);
113 void  DoLoadGameSequence( void );
114 void RotateBuffer (int startangle, int endangle, int startscale, int endscale, int time);
115 void ApogeeTitle (void);
116 void DopefishTitle (void);
117 void RotationFun (void);
118 void GetRainBoundingBox (int * xmin, int * xmax, int * ymin, int * ymax);
119 void StartupScreenSaver ( void );
120 void ShutdownScreenSaver ( void );
121 void UpdateScreenSaver ( void );
122 void DoEndCinematic ( void );
123 void DoCreditScreen ( void );
124 void DoMicroStoryScreen ( void );
125 void DoInBetweenCinematic (int yoffset, int lump, int delay, char * string );
126 
127 #endif
128