Odamex
Setting the Standard in Multiplayer Doom
common/r_draw.h
Go to the documentation of this file.
00001 // Emacs style mode select   -*- C++ -*- 
00002 //-----------------------------------------------------------------------------
00003 //
00004 // $Id: r_draw.h 1837 2010-09-02 04:21:09Z spleen $
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 //      System specific interface stuff.
00021 //
00022 //-----------------------------------------------------------------------------
00023 
00024 
00025 #ifndef __R_DRAW__
00026 #define __R_DRAW__
00027 
00028 
00029 
00030 extern "C" byte**               ylookup;
00031 extern "C" int*                 columnofs;
00032 
00033 extern "C" int                  dc_pitch;               // [RH] Distance between rows
00034 
00035 extern "C" lighttable_t*        dc_colormap;
00036 extern "C" unsigned int*        dc_shademap;    // [RH] For high/true color modes
00037 extern "C" int                  dc_x;
00038 extern "C" int                  dc_yl;
00039 extern "C" int                  dc_yh;
00040 extern "C" fixed_t              dc_iscale;
00041 extern "C" fixed_t              dc_texturemid;
00042 extern "C" fixed_t              dc_texturefrac;
00043 extern "C" int                  dc_color;               // [RH] For flat colors (no texturing)
00044 
00045 // first pixel in a column
00046 extern "C" byte*                        dc_source;
00047 
00048 // [RH] Temporary buffer for column drawing
00049 extern "C" byte                 dc_temp[1536*4];
00050 extern "C" unsigned int dc_tspans[4][256];
00051 extern "C" unsigned int *dc_ctspan[4];
00052 extern "C" unsigned int horizspans[4];
00053 
00054 
00055 // [RH] Pointers to the different column and span drawers...
00056 
00057 // The span blitting interface.
00058 // Hook in assembler or system specific BLT here.
00059 extern void (*R_DrawColumn)(void);
00060 
00061 // The Spectre/Invisibility effect.
00062 extern void (*R_DrawFuzzColumn)(void);
00063 
00064 // [RH] Draw translucent column;
00065 extern void (*R_DrawTranslucentColumn)(void);
00066 
00067 // Draw with color translation tables,
00068 //      for player sprite rendering,
00069 //      Green/Red/Blue/Indigo shirts.
00070 extern void (*R_DrawTranslatedColumn)(void);
00071 
00072 // Span blitting for rows, floor/ceiling.
00073 // No Sepctre effect needed.
00074 extern void (*R_DrawSpan)(void);
00075 
00076 // [RH] Span blit into an interleaved intermediate buffer
00077 extern void (*R_DrawColumnHoriz)(void);
00078 void R_DrawMaskedColumnHoriz (column_t *column);
00079 
00080 // [RH] Initialize the above five pointers
00081 void R_InitColumnDrawers (BOOL is8bit);
00082 
00083 // [RH] Moves data from the temporary horizontal buffer to the screen.
00084 void rt_copy1col_c (int hx, int sx, int yl, int yh);
00085 void rt_copy2cols_c (int hx, int sx, int yl, int yh);
00086 void rt_copy4cols_c (int sx, int yl, int yh);
00087 void rt_map1col_c (int hx, int sx, int yl, int yh);
00088 void rt_map2cols_c (int hx, int sx, int yl, int yh);
00089 void rt_map4cols_c (int sx, int yl, int yh);
00090 void rt_lucent1col (int hx, int sx, int yl, int yh);
00091 void rt_lucent2cols (int hx, int sx, int yl, int yh);
00092 void rt_lucent4cols (int sx, int yl, int yh);
00093 void rt_tlate1col (int hx, int sx, int yl, int yh);
00094 void rt_tlate2cols (int hx, int sx, int yl, int yh);
00095 void rt_tlate4cols (int sx, int yl, int yh);
00096 void rt_tlatelucent1col (int hx, int sx, int yl, int yh);
00097 void rt_tlatelucent2cols (int hx, int sx, int yl, int yh);
00098 void rt_tlatelucent4cols (int sx, int yl, int yh);
00099 extern "C" void rt_copy1col_asm (int hx, int sx, int yl, int yh);
00100 extern "C" void rt_copy2cols_asm (int hx, int sx, int yl, int yh);
00101 extern "C" void rt_copy4cols_asm (int sx, int yl, int yh);
00102 extern "C" void rt_map1col_asm (int hx, int sx, int yl, int yh);
00103 extern "C" void rt_map2cols_asm (int hx, int sx, int yl, int yh);
00104 extern "C" void rt_map4cols_asm1 (int sx, int yl, int yh);
00105 extern "C" void rt_map4cols_asm2 (int sx, int yl, int yh);
00106 
00107 extern void (*rt_map4cols)(int sx, int yl, int yh);
00108 
00109 #ifdef USEASM
00110 #define rt_copy1col             rt_copy1col_asm
00111 #define rt_copy2cols    rt_copy2cols_asm
00112 #define rt_copy4cols    rt_copy4cols_asm
00113 #define rt_map1col              rt_map1col_asm
00114 #define rt_map2cols             rt_map2cols_asm
00115 #else
00116 #define rt_copy1col             rt_copy1col_c
00117 #define rt_copy2cols    rt_copy2cols_c
00118 #define rt_copy4cols    rt_copy4cols_c
00119 #define rt_map1col              rt_map1col_c
00120 #define rt_map2cols             rt_map2cols_c
00121 #endif
00122 
00123 void rt_draw1col (int hx, int sx);
00124 void rt_draw2cols (int hx, int sx);
00125 void rt_draw4cols (int sx);
00126 
00127 // [RH] Preps the temporary horizontal buffer.
00128 void rt_initcols (void);
00129 
00130 
00131 #ifndef USEASM
00132 void    R_DrawColumnHorizP_C (void);
00133 void    R_DrawColumnP_C (void);
00134 void    R_DrawFuzzColumnP_C (void);
00135 void    R_DrawTranslucentColumnP_C (void);
00136 void    R_DrawTranslatedColumnP_C (void);
00137 void    R_DrawSpanP_C (void);
00138 
00139 void    R_DrawColumnD_C (void);
00140 void    R_DrawFuzzColumnD_C (void);
00141 void    R_DrawTranslucentColumnD_C (void);
00142 void    R_DrawTranslatedColumnD_C (void);
00143 void    R_DrawSpanD (void);
00144 
00145 #else   /* USEASM */
00146 
00147 extern "C" void R_DrawColumnP_Unrolled (void);
00148 
00149 extern "C" void R_DrawColumnHorizP_ASM (void);
00150 extern "C" void R_DrawColumnP_ASM (void);
00151 extern "C" void R_DrawFuzzColumnP_ASM (void);
00152 void    R_DrawTranslucentColumnP_C (void);
00153 void    R_DrawTranslatedColumnP_C (void);
00154 extern "C" void R_DrawSpanP_ASM (void);
00155 
00156 void    R_DrawColumnD_C (void);
00157 void    R_DrawFuzzColumnD_C (void);
00158 void    R_DrawTranslucentColumnD_C (void);
00159 void    R_DrawTranslatedColumnD_C (void);
00160 void    R_DrawSpanD (void);
00161 #endif
00162 
00163 void    R_DrawTlatedLucentColumnP_C (void);
00164 #define R_DrawTlatedLucentColumn R_DrawTlatedLucentColumnP_C
00165 void    R_StretchColumnP_C (void);
00166 #define R_StretchColumn R_StretchColumnP_C
00167 
00168 void    R_FillColumnP (void);
00169 void    R_FillColumnHorizP (void);
00170 void    R_FillSpan (void);
00171 
00172 extern "C" int                          ds_colsize;             // [RH] Distance between columns
00173 
00174 extern "C" int                          ds_y;
00175 extern "C" int                          ds_x1;
00176 extern "C" int                          ds_x2;
00177 
00178 extern "C" lighttable_t*        ds_colormap;
00179 
00180 extern "C" dsfixed_t            ds_xfrac;
00181 extern "C" dsfixed_t            ds_yfrac;
00182 extern "C" dsfixed_t            ds_xstep;
00183 extern "C" dsfixed_t            ds_ystep;
00184 
00185 // start of a 64*64 tile image
00186 extern "C" byte*                        ds_source;
00187 
00188 extern "C" int                          ds_color;               // [RH] For flat color (no texturing)
00189 
00190 extern byte*                    translationtables;
00191 extern byte*                    dc_translation;
00192 
00193 extern fixed_t dc_translevel;
00194 
00195 
00196 // [RH] Double view pixels by detail mode
00197 void R_DetailDouble (void);
00198 
00199 void
00200 R_InitBuffer
00201 ( int           width,
00202   int           height );
00203 
00204 
00205 // Initialize color translation tables,
00206 //      for player rendering etc.
00207 void R_InitTranslationTables (void);
00208 void R_FreeTranslationTables (void);
00209 
00210 // [RH] Actually create a player's translation table.
00211 void R_BuildPlayerTranslation (int player, int color);
00212 
00213 // [Nes] Classic player translation table.
00214 void R_BuildClassicPlayerTranslation (int player, int color);
00215 
00216 
00217 // If the view size is not full screen, draws a border around it.
00218 void R_DrawViewBorder (void);
00219 void R_DrawBorder (int x1, int y1, int x2, int y2);
00220 
00221 // [RH] Added for muliresolution support
00222 void R_InitFuzzTable (void);
00223 
00224 
00225 #endif
00226 
00227 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends