diff --git a/src/b_game.cpp b/src/b_game.cpp index 2ff74a285..7d8e94ffe 100644 --- a/src/b_game.cpp +++ b/src/b_game.cpp @@ -48,7 +48,6 @@ Everything that is changed is marked (maybe commented) with "Added by MC" #include "b_bot.h" #include "g_game.h" #include "m_random.h" -#include "r_things.h" #include "doomstat.h" #include "cmdlib.h" #include "sc_man.h" diff --git a/src/c_console.cpp b/src/c_console.cpp index c19ff3f2a..c8cac63bb 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -54,7 +54,6 @@ #include "v_text.h" #include "w_wad.h" #include "r_main.h" -#include "r_draw.h" #include "sbar.h" #include "s_sound.h" #include "s_sndseq.h" diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index a661ba697..931c656cf 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -60,7 +60,6 @@ #include "gi.h" #include "c_dispatch.h" #include "decallib.h" -#include "r_draw.h" #include "v_palette.h" #include "a_sharedglobal.h" #include "thingdef/thingdef.h" diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index deb7c5b22..45ae686c6 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -47,7 +47,6 @@ #include "v_palette.h" #include "v_video.h" #include "i_system.h" -#include "r_draw.h" #include "r_state.h" #include "sbar.h" #include "gi.h" diff --git a/src/decallib.cpp b/src/decallib.cpp index 95b77b1a7..2ebc35577 100644 --- a/src/decallib.cpp +++ b/src/decallib.cpp @@ -42,7 +42,6 @@ #include "weightedlist.h" #include "statnums.h" #include "templates.h" -#include "r_draw.h" #include "a_sharedglobal.h" #include "r_data/r_translate.h" #include "gi.h" diff --git a/src/g_doom/a_scriptedmarine.cpp b/src/g_doom/a_scriptedmarine.cpp index 55cbab279..67bbbf0b3 100644 --- a/src/g_doom/a_scriptedmarine.cpp +++ b/src/g_doom/a_scriptedmarine.cpp @@ -2,7 +2,6 @@ #include "actor.h" #include "p_enemy.h" #include "a_action.h" -#include "r_draw.h" #include "m_random.h" #include "p_local.h" #include "a_doomglobal.h" diff --git a/src/g_game.cpp b/src/g_game.cpp index 0d3975183..dda2e9753 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -62,7 +62,6 @@ #include "s_sound.h" #include "gstrings.h" #include "r_sky.h" -#include "r_draw.h" #include "g_game.h" #include "g_level.h" #include "b_bot.h" //Added by MC: diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index 4f1edfe1f..0a8badb80 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -41,7 +41,6 @@ #include "c_console.h" #include "v_video.h" #include "m_swap.h" -#include "r_draw.h" #include "w_wad.h" #include "v_text.h" #include "s_sound.h" diff --git a/src/p_effect.cpp b/src/p_effect.cpp index c5ea4e2d1..12453abb2 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -44,7 +44,6 @@ #include "v_video.h" #include "m_random.h" #include "r_defs.h" -#include "r_things.h" #include "s_sound.h" #include "templates.h" #include "gi.h" diff --git a/src/p_user.cpp b/src/p_user.cpp index d18a31b6a..c8b615d04 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -30,7 +30,6 @@ #include "doomstat.h" #include "s_sound.h" #include "i_system.h" -#include "r_draw.h" #include "gi.h" #include "m_random.h" #include "p_pspr.h" diff --git a/src/r_data/colormaps.cpp b/src/r_data/colormaps.cpp index c0ce25c25..50cf5ced9 100644 --- a/src/r_data/colormaps.cpp +++ b/src/r_data/colormaps.cpp @@ -47,8 +47,6 @@ #include "v_text.h" #include "st_start.h" #include "doomstat.h" -#include "r_bsp.h" -#include "r_segs.h" #include "v_palette.h" #include "colormatcher.h" #include "colormaps.h" diff --git a/src/r_data/r_translate.cpp b/src/r_data/r_translate.cpp index 8e52c0b6d..81b840604 100644 --- a/src/r_data/r_translate.cpp +++ b/src/r_data/r_translate.cpp @@ -35,7 +35,6 @@ #include #include "templates.h" -#include "r_draw.h" #include "r_main.h" #include "r_data/r_translate.h" #include "v_video.h" @@ -54,6 +53,7 @@ TAutoGrowArray translationtables[NUM_TRANSLATION_TABLES]; + const BYTE IcePalette[16][3] = { { 10, 8, 18 }, @@ -681,7 +681,7 @@ static void PushIdentityTable(int slot) void R_InitTranslationTables () { - int i, j; + int i; // Each player gets two translations. Doom and Strife don't use the // extra ones, but Heretic and Hexen do. These are set up during @@ -815,41 +815,6 @@ void R_InitTranslationTables () remap->Remap[i] = IcePaletteRemap[v]; remap->Palette[i] = PalEntry(255, IcePalette[v][0], IcePalette[v][1], IcePalette[v][2]); } - - // set up shading tables for shaded columns - // 16 colormap sets, progressing from full alpha to minimum visible alpha - - BYTE *table = shadetables; - - // Full alpha - for (i = 0; i < 16; ++i) - { - ShadeFakeColormap[i].Color = ~0u; - ShadeFakeColormap[i].Desaturate = ~0u; - ShadeFakeColormap[i].Next = NULL; - ShadeFakeColormap[i].Maps = table; - - for (j = 0; j < NUMCOLORMAPS; ++j) - { - int a = (NUMCOLORMAPS - j) * 256 / NUMCOLORMAPS * (16-i); - for (int k = 0; k < 256; ++k) - { - BYTE v = (((k+2) * a) + 256) >> 14; - table[k] = MIN (v, 64); - } - table += 256; - } - } - for (i = 0; i < NUMCOLORMAPS*16*256; ++i) - { - assert(shadetables[i] <= 64); - } - - // Set up a guaranteed identity map - for (i = 0; i < 256; ++i) - { - identitymap[i] = i; - } } //---------------------------------------------------------------------------- diff --git a/src/r_data/voxels.cpp b/src/r_data/voxels.cpp index 3648d3a05..d5a1cca6f 100644 --- a/src/r_data/voxels.cpp +++ b/src/r_data/voxels.cpp @@ -58,9 +58,6 @@ #include "d_net.h" #include "colormatcher.h" #include "d_netinf.h" -#include "r_bsp.h" -#include "r_plane.h" -#include "r_segs.h" #include "v_palette.h" #include "r_data/r_translate.h" #include "r_data/colormaps.h" diff --git a/src/r_draw.cpp b/src/r_draw.cpp index 080407886..7003a65a3 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -127,6 +127,46 @@ BYTE identitymap[256]; EXTERN_CVAR (Int, r_columnmethod) + +void R_InitShadeMaps() +{ + int i,j; + // set up shading tables for shaded columns + // 16 colormap sets, progressing from full alpha to minimum visible alpha + + BYTE *table = shadetables; + + // Full alpha + for (i = 0; i < 16; ++i) + { + ShadeFakeColormap[i].Color = ~0u; + ShadeFakeColormap[i].Desaturate = ~0u; + ShadeFakeColormap[i].Next = NULL; + ShadeFakeColormap[i].Maps = table; + + for (j = 0; j < NUMCOLORMAPS; ++j) + { + int a = (NUMCOLORMAPS - j) * 256 / NUMCOLORMAPS * (16-i); + for (int k = 0; k < 256; ++k) + { + BYTE v = (((k+2) * a) + 256) >> 14; + table[k] = MIN (v, 64); + } + table += 256; + } + } + for (i = 0; i < NUMCOLORMAPS*16*256; ++i) + { + assert(shadetables[i] <= 64); + } + + // Set up a guaranteed identity map + for (i = 0; i < 256; ++i) + { + identitymap[i] = i; + } +} + /************************************/ /* */ /* Palettized drawers (C versions) */ diff --git a/src/r_draw.h b/src/r_draw.h index be254a62f..ace6bde0b 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -252,6 +252,7 @@ extern BYTE identitymap[256]; extern BYTE *dc_translation; // [RH] Added for muliresolution support +void R_InitShadeMaps(); void R_InitFuzzTable (int fuzzoff); // [RH] Consolidate column drawer selection diff --git a/src/r_main.cpp b/src/r_main.cpp index b201147f5..7643e890c 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -827,6 +827,7 @@ void R_Init () R_SetViewSize (screenblocks); R_InitPlanes (); R_InitTranslationTables (); + R_InitShadeMaps(); R_InitParticles (); // [RH] Setup particle engine R_InitColumnDrawers (); diff --git a/src/thingdef/olddecorations.cpp b/src/thingdef/olddecorations.cpp index aa0230d46..421ff1e88 100644 --- a/src/thingdef/olddecorations.cpp +++ b/src/thingdef/olddecorations.cpp @@ -40,7 +40,6 @@ #include "tarray.h" #include "templates.h" #include "r_defs.h" -#include "r_draw.h" #include "a_pickups.h" #include "s_sound.h" #include "cmdlib.h" diff --git a/src/thingdef/thingdef.cpp b/src/thingdef/thingdef.cpp index 0d9dfad30..ea067ae88 100644 --- a/src/thingdef/thingdef.cpp +++ b/src/thingdef/thingdef.cpp @@ -46,7 +46,6 @@ #include "w_wad.h" #include "templates.h" #include "r_defs.h" -#include "r_draw.h" #include "a_pickups.h" #include "s_sound.h" #include "cmdlib.h" diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 9d5a19f93..e1c5e1363 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -47,7 +47,6 @@ #include "w_wad.h" #include "templates.h" #include "r_defs.h" -#include "r_draw.h" #include "a_pickups.h" #include "s_sound.h" #include "cmdlib.h" diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 7e6aadbc2..558caa6c1 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -45,7 +45,6 @@ #include "w_wad.h" #include "templates.h" #include "r_defs.h" -#include "r_draw.h" #include "a_pickups.h" #include "s_sound.h" #include "cmdlib.h" diff --git a/src/v_font.cpp b/src/v_font.cpp index afe12b75b..29f2b3632 100644 --- a/src/v_font.cpp +++ b/src/v_font.cpp @@ -90,7 +90,8 @@ The FON2 header is followed by variable length data: #include "cmdlib.h" #include "sc_man.h" #include "hu_stuff.h" -#include "r_draw.h" +#include "farchive.h" +#include "textures/textures.h" #include "r_data/r_translate.h" #include "colormatcher.h" #include "v_palette.h" diff --git a/src/v_video.cpp b/src/v_video.cpp index 042f2ce6d..35b5c6b50 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -29,7 +29,6 @@ #include "x86.h" #include "i_video.h" #include "r_local.h" -#include "r_draw.h" #include "r_state.h" #include "doomdef.h"