Odamex
Setting the Standard in Multiplayer Doom
common/r_state.h
Go to the documentation of this file.
00001 // Emacs style mode select   -*- C++ -*- 
00002 //-----------------------------------------------------------------------------
00003 //
00004 // $Id: r_state.h 1788 2010-08-24 04:42:57Z russellrice $
00005 //
00006 // Copyright (C) 1993-1996 by id Software, Inc.
00007 // Copyright (C) 2006-2010 by The Odamex Team.
00008 //
00009 // This program is free software; you can redistribute it and/or
00010 // modify it under the terms of the GNU General Public License
00011 // as published by the Free Software Foundation; either version 2
00012 // of the License, or (at your option) any later version.
00013 //
00014 // This program is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // DESCRIPTION:
00020 //      Refresh/render internal state variables (global).
00021 //
00022 //-----------------------------------------------------------------------------
00023 
00024 
00025 #ifndef __R_STATE_H__
00026 #define __R_STATE_H__
00027 
00028 // Need data structure definitions.
00029 #include "d_player.h"
00030 #include "r_data.h"
00031 
00032 #define WALLFRACBITS    4
00033 #define WALLFRACUNIT    (1<<WALLFRACBITS)
00034 
00035 
00036 //
00037 // Refresh internal data structures,
00038 //      for rendering.
00039 //
00040 
00041 // needed for texture pegging
00042 extern fixed_t*                 textureheight;
00043 
00044 extern "C" int                  viewwidth;
00045 extern "C" int                  realviewwidth;
00046 extern "C" int                  viewheight;
00047 extern "C" int                  realviewheight;
00048 
00049 extern int                              firstflat;
00050 extern int                              numflats;
00051 
00052 // for global animation
00053 extern bool*                    flatwarp;
00054 extern byte**                   warpedflats;
00055 extern int*                             flatwarpedwhen;
00056 extern int*                             flattranslation;
00057                 
00058 extern int*                     texturetranslation;     
00059 
00060 // Sprite....
00061 extern int                              firstspritelump;
00062 extern int                              lastspritelump;
00063 extern int                              numspritelumps;
00064 
00065 extern size_t                   numskins;       // [RH]
00066 extern playerskin_t*    skins;          // [RH]
00067 
00068 
00069 
00070 //
00071 // Lookup tables for map data.
00072 //
00073 extern int                              numsprites;
00074 extern spritedef_t*     sprites;
00075 
00076 extern int                              numvertexes;
00077 extern vertex_t*                vertexes;
00078 
00079 extern int                              numsegs;
00080 extern seg_t*                   segs;
00081 
00082 extern int                              numsectors;
00083 extern sector_t*                sectors;
00084 
00085 extern int                              numsubsectors;
00086 extern subsector_t*     subsectors;
00087 
00088 extern int                              numnodes;
00089 extern node_t*                  nodes;
00090 
00091 extern int                              numlines;
00092 extern line_t*                  lines;
00093 
00094 extern int                              numsides;
00095 extern side_t*                  sides;
00096 
00097 inline FArchive &operator<< (FArchive &arc, sector_t *sec)
00098 {
00099         if (sec)
00100                 return arc << (WORD)(sec - sectors);
00101         else
00102                 return arc << (WORD)0xffff;
00103 }
00104 inline FArchive &operator>> (FArchive &arc, sector_t *&sec)
00105 {
00106         WORD ofs;
00107         arc >> ofs;
00108         if (ofs == 0xffff)
00109                 sec = NULL;
00110         else
00111                 sec = sectors + ofs;
00112         return arc;
00113 }
00114 
00115 inline FArchive &operator<< (FArchive &arc, line_t *line)
00116 {
00117         if (line)
00118                 return arc << (WORD)(line - lines);
00119         else
00120                 return arc << (WORD)0xffff;
00121 }
00122 inline FArchive &operator>> (FArchive &arc, line_t *&line)
00123 {
00124         WORD ofs;
00125         arc >> ofs;
00126         if (ofs == 0xffff)
00127                 line = NULL;
00128         else
00129                 line = lines + ofs;
00130         return arc;
00131 }
00132 
00133 
00134 //
00135 // POV data.
00136 //
00137 extern fixed_t                  viewx;
00138 extern fixed_t                  viewy;
00139 extern fixed_t                  viewz;
00140 
00141 extern angle_t                  viewangle;
00142 extern AActor*                  camera;         // [RH] camera instead of viewplayer
00143 
00144 extern angle_t                  clipangle;
00145 
00146 extern int                              viewangletox[FINEANGLES/2];
00147 extern angle_t                  *xtoviewangle;
00148 //extern fixed_t                finetangent[FINEANGLES/2];
00149 
00150 extern fixed_t                  rw_distance;
00151 extern angle_t                  rw_normalangle;
00152 
00153 
00154 
00155 // angle to line origin
00156 extern int                              rw_angle1;
00157 
00158 
00159 extern visplane_t*              floorplane;
00160 extern visplane_t*              ceilingplane;
00161 
00162 
00163 #endif // __R_STATE_H__
00164 
00165 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends