mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-13 07:57:52 +00:00
Added menu option for toggling true color output on and off
This commit is contained in:
parent
8aabc26cd9
commit
7080180d47
6 changed files with 216 additions and 194 deletions
327
src/r_draw.cpp
327
src/r_draw.cpp
|
@ -178,7 +178,7 @@ FDynamicColormap ShadeFakeColormap[16];
|
||||||
BYTE identitymap[256];
|
BYTE identitymap[256];
|
||||||
|
|
||||||
EXTERN_CVAR (Int, r_columnmethod)
|
EXTERN_CVAR (Int, r_columnmethod)
|
||||||
|
EXTERN_CVAR (Bool, r_swtruecolor)
|
||||||
|
|
||||||
void R_InitShadeMaps()
|
void R_InitShadeMaps()
|
||||||
{
|
{
|
||||||
|
@ -4135,181 +4135,180 @@ const BYTE *R_GetColumn (FTexture *tex, int col)
|
||||||
// [RH] Initialize the column drawer pointers
|
// [RH] Initialize the column drawer pointers
|
||||||
void R_InitColumnDrawers ()
|
void R_InitColumnDrawers ()
|
||||||
{
|
{
|
||||||
#ifndef PALETTEOUTPUT
|
if (r_swtruecolor)
|
||||||
|
|
||||||
R_DrawColumnHoriz = R_DrawColumnHorizP_RGBA_C;
|
|
||||||
R_DrawColumn = R_DrawColumnP_RGBA_C;
|
|
||||||
R_DrawFuzzColumn = R_DrawFuzzColumnP_RGBA_C;
|
|
||||||
R_DrawTranslatedColumn = R_DrawTranslatedColumnP_RGBA_C;
|
|
||||||
R_DrawShadedColumn = R_DrawShadedColumnP_RGBA_C;
|
|
||||||
R_DrawSpan = R_DrawSpanP_RGBA_C;
|
|
||||||
R_DrawSpanMasked = R_DrawSpanMaskedP_RGBA_C;
|
|
||||||
rt_map4cols = rt_map4cols_RGBA_c;
|
|
||||||
|
|
||||||
R_DrawSpanTranslucent = R_DrawSpanTranslucentP_RGBA_C;
|
|
||||||
R_DrawSpanMaskedTranslucent = R_DrawSpanMaskedTranslucentP_RGBA_C;
|
|
||||||
R_DrawSpanAddClamp = R_DrawSpanAddClampP_RGBA_C;
|
|
||||||
R_DrawSpanMaskedAddClamp = R_DrawSpanMaskedAddClampP_RGBA_C;
|
|
||||||
R_FillColumn = R_FillColumnP_RGBA;
|
|
||||||
R_FillAddColumn = R_FillAddColumn_RGBA_C;
|
|
||||||
R_FillAddClampColumn = R_FillAddClampColumn_RGBA;
|
|
||||||
R_FillSubClampColumn = R_FillSubClampColumn_RGBA;
|
|
||||||
R_FillRevSubClampColumn = R_FillRevSubClampColumn_RGBA;
|
|
||||||
R_DrawAddColumn = R_DrawAddColumnP_RGBA_C;
|
|
||||||
R_DrawTlatedAddColumn = R_DrawTlatedAddColumnP_RGBA_C;
|
|
||||||
R_DrawAddClampColumn = R_DrawAddClampColumnP_RGBA_C;
|
|
||||||
R_DrawAddClampTranslatedColumn = R_DrawAddClampTranslatedColumnP_RGBA_C;
|
|
||||||
R_DrawSubClampColumn = R_DrawSubClampColumnP_RGBA_C;
|
|
||||||
R_DrawSubClampTranslatedColumn = R_DrawSubClampTranslatedColumnP_RGBA_C;
|
|
||||||
R_DrawRevSubClampColumn = R_DrawRevSubClampColumnP_RGBA_C;
|
|
||||||
R_DrawRevSubClampTranslatedColumn = R_DrawRevSubClampTranslatedColumnP_RGBA_C;
|
|
||||||
R_FillSpan = R_FillSpan_RGBA;
|
|
||||||
R_DrawFogBoundary = R_DrawFogBoundary_RGBA;
|
|
||||||
R_FillColumnHoriz = R_FillColumnHorizP_RGBA_C;
|
|
||||||
|
|
||||||
R_DrawFogBoundary = R_DrawFogBoundary_RGBA;
|
|
||||||
R_MapColoredPlane = R_MapColoredPlane_RGBA;
|
|
||||||
R_DrawParticle = R_DrawParticle_RGBA;
|
|
||||||
|
|
||||||
tmvline1_add = tmvline1_add_RGBA;
|
|
||||||
tmvline4_add = tmvline4_add_RGBA;
|
|
||||||
tmvline1_addclamp = tmvline1_addclamp_RGBA;
|
|
||||||
tmvline4_addclamp = tmvline4_addclamp_RGBA;
|
|
||||||
tmvline1_subclamp = tmvline1_subclamp_RGBA;
|
|
||||||
tmvline4_subclamp = tmvline4_subclamp_RGBA;
|
|
||||||
tmvline1_revsubclamp = tmvline1_revsubclamp_RGBA;
|
|
||||||
tmvline4_revsubclamp = tmvline4_revsubclamp_RGBA;
|
|
||||||
|
|
||||||
rt_copy1col = rt_copy1col_RGBA_c;
|
|
||||||
rt_copy4cols = rt_copy4cols_RGBA_c;
|
|
||||||
rt_map1col = rt_map1col_RGBA_c;
|
|
||||||
rt_shaded4cols = rt_shaded4cols_RGBA_c;
|
|
||||||
rt_add4cols = rt_add4cols_RGBA_c;
|
|
||||||
rt_addclamp4cols = rt_addclamp4cols_RGBA_c;
|
|
||||||
rt_shaded1col = rt_shaded1col_RGBA_c;
|
|
||||||
rt_add1col = rt_add1col_RGBA_c;
|
|
||||||
rt_addclamp1col = rt_addclamp1col_RGBA_c;
|
|
||||||
rt_subclamp1col = rt_subclamp1col_RGBA_c;
|
|
||||||
rt_revsubclamp1col = rt_revsubclamp1col_RGBA_c;
|
|
||||||
rt_tlate1col = rt_tlate1col_RGBA_c;
|
|
||||||
rt_tlateadd1col = rt_tlateadd1col_RGBA_c;
|
|
||||||
rt_tlateaddclamp1col = rt_tlateaddclamp1col_RGBA_c;
|
|
||||||
rt_tlatesubclamp1col = rt_tlatesubclamp1col_RGBA_c;
|
|
||||||
rt_tlaterevsubclamp1col = rt_tlaterevsubclamp1col_RGBA_c;
|
|
||||||
rt_map4cols = rt_map4cols_RGBA_c;
|
|
||||||
rt_subclamp4cols = rt_subclamp4cols_RGBA_c;
|
|
||||||
rt_revsubclamp4cols = rt_revsubclamp4cols_RGBA_c;
|
|
||||||
rt_tlate4cols = rt_tlate4cols_RGBA_c;
|
|
||||||
rt_tlateadd4cols = rt_tlateadd4cols_RGBA_c;
|
|
||||||
rt_tlateaddclamp4cols = rt_tlateaddclamp4cols_RGBA_c;
|
|
||||||
rt_tlatesubclamp4cols = rt_tlatesubclamp4cols_RGBA_c;
|
|
||||||
rt_tlaterevsubclamp4cols = rt_tlaterevsubclamp4cols_RGBA_c;
|
|
||||||
rt_initcols = rt_initcols_rgba;
|
|
||||||
|
|
||||||
dovline1 = vlinec1_RGBA;
|
|
||||||
doprevline1 = vlinec1_RGBA;
|
|
||||||
dovline4 = vlinec4_RGBA;
|
|
||||||
domvline1 = mvlinec1_RGBA;
|
|
||||||
domvline4 = mvlinec4_RGBA;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#ifdef X86_ASM
|
|
||||||
R_DrawColumn = R_DrawColumnP_ASM;
|
|
||||||
R_DrawColumnHoriz = R_DrawColumnHorizP_ASM;
|
|
||||||
R_DrawFuzzColumn = R_DrawFuzzColumnP_ASM;
|
|
||||||
R_DrawTranslatedColumn = R_DrawTranslatedColumnP_C;
|
|
||||||
R_DrawShadedColumn = R_DrawShadedColumnP_C;
|
|
||||||
R_DrawSpan = R_DrawSpanP_ASM;
|
|
||||||
R_DrawSpanMasked = R_DrawSpanMaskedP_ASM;
|
|
||||||
if (CPU.Family <= 5)
|
|
||||||
{
|
{
|
||||||
rt_map4cols = rt_map4cols_asm2;
|
R_DrawColumnHoriz = R_DrawColumnHorizP_RGBA_C;
|
||||||
|
R_DrawColumn = R_DrawColumnP_RGBA_C;
|
||||||
|
R_DrawFuzzColumn = R_DrawFuzzColumnP_RGBA_C;
|
||||||
|
R_DrawTranslatedColumn = R_DrawTranslatedColumnP_RGBA_C;
|
||||||
|
R_DrawShadedColumn = R_DrawShadedColumnP_RGBA_C;
|
||||||
|
R_DrawSpan = R_DrawSpanP_RGBA_C;
|
||||||
|
R_DrawSpanMasked = R_DrawSpanMaskedP_RGBA_C;
|
||||||
|
rt_map4cols = rt_map4cols_RGBA_c;
|
||||||
|
|
||||||
|
R_DrawSpanTranslucent = R_DrawSpanTranslucentP_RGBA_C;
|
||||||
|
R_DrawSpanMaskedTranslucent = R_DrawSpanMaskedTranslucentP_RGBA_C;
|
||||||
|
R_DrawSpanAddClamp = R_DrawSpanAddClampP_RGBA_C;
|
||||||
|
R_DrawSpanMaskedAddClamp = R_DrawSpanMaskedAddClampP_RGBA_C;
|
||||||
|
R_FillColumn = R_FillColumnP_RGBA;
|
||||||
|
R_FillAddColumn = R_FillAddColumn_RGBA_C;
|
||||||
|
R_FillAddClampColumn = R_FillAddClampColumn_RGBA;
|
||||||
|
R_FillSubClampColumn = R_FillSubClampColumn_RGBA;
|
||||||
|
R_FillRevSubClampColumn = R_FillRevSubClampColumn_RGBA;
|
||||||
|
R_DrawAddColumn = R_DrawAddColumnP_RGBA_C;
|
||||||
|
R_DrawTlatedAddColumn = R_DrawTlatedAddColumnP_RGBA_C;
|
||||||
|
R_DrawAddClampColumn = R_DrawAddClampColumnP_RGBA_C;
|
||||||
|
R_DrawAddClampTranslatedColumn = R_DrawAddClampTranslatedColumnP_RGBA_C;
|
||||||
|
R_DrawSubClampColumn = R_DrawSubClampColumnP_RGBA_C;
|
||||||
|
R_DrawSubClampTranslatedColumn = R_DrawSubClampTranslatedColumnP_RGBA_C;
|
||||||
|
R_DrawRevSubClampColumn = R_DrawRevSubClampColumnP_RGBA_C;
|
||||||
|
R_DrawRevSubClampTranslatedColumn = R_DrawRevSubClampTranslatedColumnP_RGBA_C;
|
||||||
|
R_FillSpan = R_FillSpan_RGBA;
|
||||||
|
R_DrawFogBoundary = R_DrawFogBoundary_RGBA;
|
||||||
|
R_FillColumnHoriz = R_FillColumnHorizP_RGBA_C;
|
||||||
|
|
||||||
|
R_DrawFogBoundary = R_DrawFogBoundary_RGBA;
|
||||||
|
R_MapColoredPlane = R_MapColoredPlane_RGBA;
|
||||||
|
R_DrawParticle = R_DrawParticle_RGBA;
|
||||||
|
|
||||||
|
tmvline1_add = tmvline1_add_RGBA;
|
||||||
|
tmvline4_add = tmvline4_add_RGBA;
|
||||||
|
tmvline1_addclamp = tmvline1_addclamp_RGBA;
|
||||||
|
tmvline4_addclamp = tmvline4_addclamp_RGBA;
|
||||||
|
tmvline1_subclamp = tmvline1_subclamp_RGBA;
|
||||||
|
tmvline4_subclamp = tmvline4_subclamp_RGBA;
|
||||||
|
tmvline1_revsubclamp = tmvline1_revsubclamp_RGBA;
|
||||||
|
tmvline4_revsubclamp = tmvline4_revsubclamp_RGBA;
|
||||||
|
|
||||||
|
rt_copy1col = rt_copy1col_RGBA_c;
|
||||||
|
rt_copy4cols = rt_copy4cols_RGBA_c;
|
||||||
|
rt_map1col = rt_map1col_RGBA_c;
|
||||||
|
rt_shaded4cols = rt_shaded4cols_RGBA_c;
|
||||||
|
rt_add4cols = rt_add4cols_RGBA_c;
|
||||||
|
rt_addclamp4cols = rt_addclamp4cols_RGBA_c;
|
||||||
|
rt_shaded1col = rt_shaded1col_RGBA_c;
|
||||||
|
rt_add1col = rt_add1col_RGBA_c;
|
||||||
|
rt_addclamp1col = rt_addclamp1col_RGBA_c;
|
||||||
|
rt_subclamp1col = rt_subclamp1col_RGBA_c;
|
||||||
|
rt_revsubclamp1col = rt_revsubclamp1col_RGBA_c;
|
||||||
|
rt_tlate1col = rt_tlate1col_RGBA_c;
|
||||||
|
rt_tlateadd1col = rt_tlateadd1col_RGBA_c;
|
||||||
|
rt_tlateaddclamp1col = rt_tlateaddclamp1col_RGBA_c;
|
||||||
|
rt_tlatesubclamp1col = rt_tlatesubclamp1col_RGBA_c;
|
||||||
|
rt_tlaterevsubclamp1col = rt_tlaterevsubclamp1col_RGBA_c;
|
||||||
|
rt_map4cols = rt_map4cols_RGBA_c;
|
||||||
|
rt_subclamp4cols = rt_subclamp4cols_RGBA_c;
|
||||||
|
rt_revsubclamp4cols = rt_revsubclamp4cols_RGBA_c;
|
||||||
|
rt_tlate4cols = rt_tlate4cols_RGBA_c;
|
||||||
|
rt_tlateadd4cols = rt_tlateadd4cols_RGBA_c;
|
||||||
|
rt_tlateaddclamp4cols = rt_tlateaddclamp4cols_RGBA_c;
|
||||||
|
rt_tlatesubclamp4cols = rt_tlatesubclamp4cols_RGBA_c;
|
||||||
|
rt_tlaterevsubclamp4cols = rt_tlaterevsubclamp4cols_RGBA_c;
|
||||||
|
rt_initcols = rt_initcols_rgba;
|
||||||
|
|
||||||
|
dovline1 = vlinec1_RGBA;
|
||||||
|
doprevline1 = vlinec1_RGBA;
|
||||||
|
dovline4 = vlinec4_RGBA;
|
||||||
|
domvline1 = mvlinec1_RGBA;
|
||||||
|
domvline4 = mvlinec4_RGBA;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rt_map4cols = rt_map4cols_asm1;
|
#ifdef X86_ASM
|
||||||
}
|
R_DrawColumn = R_DrawColumnP_ASM;
|
||||||
|
R_DrawColumnHoriz = R_DrawColumnHorizP_ASM;
|
||||||
|
R_DrawFuzzColumn = R_DrawFuzzColumnP_ASM;
|
||||||
|
R_DrawTranslatedColumn = R_DrawTranslatedColumnP_C;
|
||||||
|
R_DrawShadedColumn = R_DrawShadedColumnP_C;
|
||||||
|
R_DrawSpan = R_DrawSpanP_ASM;
|
||||||
|
R_DrawSpanMasked = R_DrawSpanMaskedP_ASM;
|
||||||
|
if (CPU.Family <= 5)
|
||||||
|
{
|
||||||
|
rt_map4cols = rt_map4cols_asm2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rt_map4cols = rt_map4cols_asm1;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
R_DrawColumnHoriz = R_DrawColumnHorizP_C;
|
R_DrawColumnHoriz = R_DrawColumnHorizP_C;
|
||||||
R_DrawColumn = R_DrawColumnP_C;
|
R_DrawColumn = R_DrawColumnP_C;
|
||||||
R_DrawFuzzColumn = R_DrawFuzzColumnP_C;
|
R_DrawFuzzColumn = R_DrawFuzzColumnP_C;
|
||||||
R_DrawTranslatedColumn = R_DrawTranslatedColumnP_C;
|
R_DrawTranslatedColumn = R_DrawTranslatedColumnP_C;
|
||||||
R_DrawShadedColumn = R_DrawShadedColumnP_C;
|
R_DrawShadedColumn = R_DrawShadedColumnP_C;
|
||||||
R_DrawSpan = R_DrawSpanP_C;
|
R_DrawSpan = R_DrawSpanP_C;
|
||||||
R_DrawSpanMasked = R_DrawSpanMaskedP_C;
|
R_DrawSpanMasked = R_DrawSpanMaskedP_C;
|
||||||
rt_map4cols = rt_map4cols_c;
|
rt_map4cols = rt_map4cols_c;
|
||||||
#endif
|
#endif
|
||||||
R_DrawSpanTranslucent = R_DrawSpanTranslucentP_C;
|
R_DrawSpanTranslucent = R_DrawSpanTranslucentP_C;
|
||||||
R_DrawSpanMaskedTranslucent = R_DrawSpanMaskedTranslucentP_C;
|
R_DrawSpanMaskedTranslucent = R_DrawSpanMaskedTranslucentP_C;
|
||||||
R_DrawSpanAddClamp = R_DrawSpanAddClampP_C;
|
R_DrawSpanAddClamp = R_DrawSpanAddClampP_C;
|
||||||
R_DrawSpanMaskedAddClamp = R_DrawSpanMaskedAddClampP_C;
|
R_DrawSpanMaskedAddClamp = R_DrawSpanMaskedAddClampP_C;
|
||||||
R_FillColumn = R_FillColumnP_C;
|
R_FillColumn = R_FillColumnP_C;
|
||||||
R_FillAddColumn = R_FillAddColumn_C;
|
R_FillAddColumn = R_FillAddColumn_C;
|
||||||
R_FillAddClampColumn = R_FillAddClampColumn_C;
|
R_FillAddClampColumn = R_FillAddClampColumn_C;
|
||||||
R_FillSubClampColumn = R_FillSubClampColumn_C;
|
R_FillSubClampColumn = R_FillSubClampColumn_C;
|
||||||
R_FillRevSubClampColumn = R_FillRevSubClampColumn_C;
|
R_FillRevSubClampColumn = R_FillRevSubClampColumn_C;
|
||||||
R_DrawAddColumn = R_DrawAddColumnP_C;
|
R_DrawAddColumn = R_DrawAddColumnP_C;
|
||||||
R_DrawTlatedAddColumn = R_DrawTlatedAddColumnP_C;
|
R_DrawTlatedAddColumn = R_DrawTlatedAddColumnP_C;
|
||||||
R_DrawAddClampColumn = R_DrawAddClampColumnP_C;
|
R_DrawAddClampColumn = R_DrawAddClampColumnP_C;
|
||||||
R_DrawAddClampTranslatedColumn = R_DrawAddClampTranslatedColumnP_C;
|
R_DrawAddClampTranslatedColumn = R_DrawAddClampTranslatedColumnP_C;
|
||||||
R_DrawSubClampColumn = R_DrawSubClampColumnP_C;
|
R_DrawSubClampColumn = R_DrawSubClampColumnP_C;
|
||||||
R_DrawSubClampTranslatedColumn = R_DrawSubClampTranslatedColumnP_C;
|
R_DrawSubClampTranslatedColumn = R_DrawSubClampTranslatedColumnP_C;
|
||||||
R_DrawRevSubClampColumn = R_DrawRevSubClampColumnP_C;
|
R_DrawRevSubClampColumn = R_DrawRevSubClampColumnP_C;
|
||||||
R_DrawRevSubClampTranslatedColumn = R_DrawRevSubClampTranslatedColumnP_C;
|
R_DrawRevSubClampTranslatedColumn = R_DrawRevSubClampTranslatedColumnP_C;
|
||||||
R_FillSpan = R_FillSpan_C;
|
R_FillSpan = R_FillSpan_C;
|
||||||
R_DrawFogBoundary = R_DrawFogBoundary_C;
|
R_DrawFogBoundary = R_DrawFogBoundary_C;
|
||||||
R_FillColumnHoriz = R_FillColumnHorizP_C;
|
R_FillColumnHoriz = R_FillColumnHorizP_C;
|
||||||
|
|
||||||
R_DrawFogBoundary = R_DrawFogBoundary_C;
|
R_DrawFogBoundary = R_DrawFogBoundary_C;
|
||||||
R_MapColoredPlane = R_MapColoredPlane_C;
|
R_MapColoredPlane = R_MapColoredPlane_C;
|
||||||
R_DrawParticle = R_DrawParticle_C;
|
R_DrawParticle = R_DrawParticle_C;
|
||||||
|
|
||||||
tmvline1_add = tmvline1_add_C;
|
tmvline1_add = tmvline1_add_C;
|
||||||
tmvline4_add = tmvline4_add_C;
|
tmvline4_add = tmvline4_add_C;
|
||||||
tmvline1_addclamp = tmvline1_addclamp_C;
|
tmvline1_addclamp = tmvline1_addclamp_C;
|
||||||
tmvline4_addclamp = tmvline4_addclamp_C;
|
tmvline4_addclamp = tmvline4_addclamp_C;
|
||||||
tmvline1_subclamp = tmvline1_subclamp_C;
|
tmvline1_subclamp = tmvline1_subclamp_C;
|
||||||
tmvline4_subclamp = tmvline4_subclamp_C;
|
tmvline4_subclamp = tmvline4_subclamp_C;
|
||||||
tmvline1_revsubclamp = tmvline1_revsubclamp_C;
|
tmvline1_revsubclamp = tmvline1_revsubclamp_C;
|
||||||
tmvline4_revsubclamp = tmvline4_revsubclamp_C;
|
tmvline4_revsubclamp = tmvline4_revsubclamp_C;
|
||||||
|
|
||||||
#ifdef X86_ASM
|
#ifdef X86_ASM
|
||||||
rt_copy1col = rt_copy1col_asm;
|
rt_copy1col = rt_copy1col_asm;
|
||||||
rt_copy4cols = rt_copy4cols_asm;
|
rt_copy4cols = rt_copy4cols_asm;
|
||||||
rt_map1col = rt_map1col_asm;
|
rt_map1col = rt_map1col_asm;
|
||||||
rt_shaded4cols = rt_shaded4cols_asm;
|
rt_shaded4cols = rt_shaded4cols_asm;
|
||||||
rt_add4cols = rt_add4cols_asm;
|
rt_add4cols = rt_add4cols_asm;
|
||||||
rt_addclamp4cols = rt_addclamp4cols_asm;
|
rt_addclamp4cols = rt_addclamp4cols_asm;
|
||||||
#else
|
#else
|
||||||
rt_copy1col = rt_copy1col_c;
|
rt_copy1col = rt_copy1col_c;
|
||||||
rt_copy4cols = rt_copy4cols_c;
|
rt_copy4cols = rt_copy4cols_c;
|
||||||
rt_map1col = rt_map1col_c;
|
rt_map1col = rt_map1col_c;
|
||||||
rt_shaded4cols = rt_shaded4cols_c;
|
rt_shaded4cols = rt_shaded4cols_c;
|
||||||
rt_add4cols = rt_add4cols_c;
|
rt_add4cols = rt_add4cols_c;
|
||||||
rt_addclamp4cols = rt_addclamp4cols_c;
|
rt_addclamp4cols = rt_addclamp4cols_c;
|
||||||
#endif
|
|
||||||
rt_shaded1col = rt_shaded1col_c;
|
|
||||||
rt_add1col = rt_add1col_c;
|
|
||||||
rt_addclamp1col = rt_addclamp1col_c;
|
|
||||||
rt_subclamp1col = rt_subclamp1col_c;
|
|
||||||
rt_revsubclamp1col = rt_revsubclamp1col_c;
|
|
||||||
rt_tlate1col = rt_tlate1col_c;
|
|
||||||
rt_tlateadd1col = rt_tlateadd1col_c;
|
|
||||||
rt_tlateaddclamp1col = rt_tlateaddclamp1col_c;
|
|
||||||
rt_tlatesubclamp1col = rt_tlatesubclamp1col_c;
|
|
||||||
rt_tlaterevsubclamp1col = rt_tlaterevsubclamp1col_c;
|
|
||||||
rt_map4cols = rt_map4cols_c;
|
|
||||||
rt_subclamp4cols = rt_subclamp4cols_c;
|
|
||||||
rt_revsubclamp4cols = rt_revsubclamp4cols_c;
|
|
||||||
rt_tlate4cols = rt_tlate4cols_c;
|
|
||||||
rt_tlateadd4cols = rt_tlateadd4cols_c;
|
|
||||||
rt_tlateaddclamp4cols = rt_tlateaddclamp4cols_c;
|
|
||||||
rt_tlatesubclamp4cols = rt_tlatesubclamp4cols_c;
|
|
||||||
rt_tlaterevsubclamp4cols = rt_tlaterevsubclamp4cols_c;
|
|
||||||
rt_initcols = rt_initcols_pal;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
rt_shaded1col = rt_shaded1col_c;
|
||||||
|
rt_add1col = rt_add1col_c;
|
||||||
|
rt_addclamp1col = rt_addclamp1col_c;
|
||||||
|
rt_subclamp1col = rt_subclamp1col_c;
|
||||||
|
rt_revsubclamp1col = rt_revsubclamp1col_c;
|
||||||
|
rt_tlate1col = rt_tlate1col_c;
|
||||||
|
rt_tlateadd1col = rt_tlateadd1col_c;
|
||||||
|
rt_tlateaddclamp1col = rt_tlateaddclamp1col_c;
|
||||||
|
rt_tlatesubclamp1col = rt_tlatesubclamp1col_c;
|
||||||
|
rt_tlaterevsubclamp1col = rt_tlaterevsubclamp1col_c;
|
||||||
|
rt_map4cols = rt_map4cols_c;
|
||||||
|
rt_subclamp4cols = rt_subclamp4cols_c;
|
||||||
|
rt_revsubclamp4cols = rt_revsubclamp4cols_c;
|
||||||
|
rt_tlate4cols = rt_tlate4cols_c;
|
||||||
|
rt_tlateadd4cols = rt_tlateadd4cols_c;
|
||||||
|
rt_tlateaddclamp4cols = rt_tlateaddclamp4cols_c;
|
||||||
|
rt_tlatesubclamp4cols = rt_tlatesubclamp4cols_c;
|
||||||
|
rt_tlaterevsubclamp4cols = rt_tlaterevsubclamp4cols_c;
|
||||||
|
rt_initcols = rt_initcols_pal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// [RH] Choose column drawers in a single place
|
// [RH] Choose column drawers in a single place
|
||||||
|
|
|
@ -103,6 +103,7 @@ bool r_dontmaplines;
|
||||||
|
|
||||||
CVAR (String, r_viewsize, "", CVAR_NOSET)
|
CVAR (String, r_viewsize, "", CVAR_NOSET)
|
||||||
CVAR (Bool, r_shadercolormaps, true, CVAR_ARCHIVE)
|
CVAR (Bool, r_shadercolormaps, true, CVAR_ARCHIVE)
|
||||||
|
CVAR (Bool, r_swtruecolor, false, CVAR_ARCHIVE)
|
||||||
|
|
||||||
double r_BaseVisibility;
|
double r_BaseVisibility;
|
||||||
double r_WallVisibility;
|
double r_WallVisibility;
|
||||||
|
|
|
@ -187,6 +187,7 @@ EXTERN_CVAR (Float, Gamma)
|
||||||
EXTERN_CVAR (Bool, vid_vsync)
|
EXTERN_CVAR (Bool, vid_vsync)
|
||||||
EXTERN_CVAR (Float, transsouls)
|
EXTERN_CVAR (Float, transsouls)
|
||||||
EXTERN_CVAR (Int, vid_refreshrate)
|
EXTERN_CVAR (Int, vid_refreshrate)
|
||||||
|
EXTERN_CVAR (Bool, r_swtruecolor)
|
||||||
|
|
||||||
extern IDirect3D9 *D3D;
|
extern IDirect3D9 *D3D;
|
||||||
|
|
||||||
|
@ -765,11 +766,7 @@ void D3DFB::KillNativeTexs()
|
||||||
|
|
||||||
bool D3DFB::CreateFBTexture ()
|
bool D3DFB::CreateFBTexture ()
|
||||||
{
|
{
|
||||||
#ifndef PALETTEOUTPUT
|
FBFormat = r_swtruecolor ? D3DFMT_A8R8G8B8 : D3DFMT_L8;
|
||||||
D3DFORMAT FBFormat = D3DFMT_A8R8G8B8;
|
|
||||||
#else
|
|
||||||
D3DFORMAT FBFormat = D3DFMT_L8;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (FAILED(D3DDevice->CreateTexture(Width, Height, 1, D3DUSAGE_DYNAMIC, FBFormat, D3DPOOL_DEFAULT, &FBTexture, NULL)))
|
if (FAILED(D3DDevice->CreateTexture(Width, Height, 1, D3DUSAGE_DYNAMIC, FBFormat, D3DPOOL_DEFAULT, &FBTexture, NULL)))
|
||||||
{
|
{
|
||||||
|
@ -1310,20 +1307,45 @@ void D3DFB::Draw3DPart(bool copy3d)
|
||||||
SUCCEEDED(FBTexture->LockRect (0, &lockrect, NULL, D3DLOCK_DISCARD))) ||
|
SUCCEEDED(FBTexture->LockRect (0, &lockrect, NULL, D3DLOCK_DISCARD))) ||
|
||||||
SUCCEEDED(FBTexture->LockRect (0, &lockrect, &texrect, 0)))
|
SUCCEEDED(FBTexture->LockRect (0, &lockrect, &texrect, 0)))
|
||||||
{
|
{
|
||||||
if (lockrect.Pitch == Pitch * sizeof(canvas_pixel_t) && Pitch == Width)
|
if (r_swtruecolor && FBFormat == D3DFMT_A8R8G8B8)
|
||||||
{
|
{
|
||||||
memcpy (lockrect.pBits, MemBuffer, Width * Height * sizeof(canvas_pixel_t));
|
if (lockrect.Pitch == Pitch * sizeof(uint32_t) && Pitch == Width)
|
||||||
|
{
|
||||||
|
memcpy(lockrect.pBits, MemBuffer, Width * Height * sizeof(uint32_t));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uint32_t *dest = (uint32_t *)lockrect.pBits;
|
||||||
|
uint32_t *src = MemBuffer;
|
||||||
|
for (int y = 0; y < Height; y++)
|
||||||
|
{
|
||||||
|
memcpy(dest, src, Width * sizeof(uint32_t));
|
||||||
|
dest = reinterpret_cast<uint32_t*>(reinterpret_cast<uint8_t*>(dest) + lockrect.Pitch);
|
||||||
|
src += Pitch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!r_swtruecolor && FBFormat == D3DFMT_L8)
|
||||||
|
{
|
||||||
|
if (lockrect.Pitch == Pitch && Pitch == Width)
|
||||||
|
{
|
||||||
|
memcpy(lockrect.pBits, MemBuffer, Width * Height);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BYTE *dest = (BYTE *)lockrect.pBits;
|
||||||
|
BYTE *src = (BYTE *)MemBuffer;
|
||||||
|
for (int y = 0; y < Height; y++)
|
||||||
|
{
|
||||||
|
memcpy(dest, src, Width);
|
||||||
|
dest = reinterpret_cast<BYTE*>(reinterpret_cast<uint8_t*>(dest) + lockrect.Pitch);
|
||||||
|
src += Pitch;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
canvas_pixel_t *dest = (canvas_pixel_t *)lockrect.pBits;
|
memset(lockrect.pBits, 0, lockrect.Pitch * Height);
|
||||||
canvas_pixel_t *src = MemBuffer;
|
|
||||||
for (int y = 0; y < Height; y++)
|
|
||||||
{
|
|
||||||
memcpy (dest, src, Width * sizeof(canvas_pixel_t));
|
|
||||||
dest = reinterpret_cast<canvas_pixel_t*>(reinterpret_cast<uint8_t*>(dest) + lockrect.Pitch);
|
|
||||||
src += Pitch;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
FBTexture->UnlockRect (0);
|
FBTexture->UnlockRect (0);
|
||||||
}
|
}
|
||||||
|
@ -1355,11 +1377,10 @@ void D3DFB::Draw3DPart(bool copy3d)
|
||||||
memset(Constant, 0, sizeof(Constant));
|
memset(Constant, 0, sizeof(Constant));
|
||||||
SetAlphaBlend(D3DBLENDOP(0));
|
SetAlphaBlend(D3DBLENDOP(0));
|
||||||
EnableAlphaTest(FALSE);
|
EnableAlphaTest(FALSE);
|
||||||
#ifndef PALETTEOUTPUT
|
if (r_swtruecolor)
|
||||||
SetPixelShader(Shaders[SHADER_NormalColor]);
|
SetPixelShader(Shaders[SHADER_NormalColor]);
|
||||||
#else
|
else
|
||||||
SetPixelShader(Shaders[SHADER_NormalColorPal]);
|
SetPixelShader(Shaders[SHADER_NormalColorPal]);
|
||||||
#endif
|
|
||||||
if (copy3d)
|
if (copy3d)
|
||||||
{
|
{
|
||||||
FBVERTEX verts[4];
|
FBVERTEX verts[4];
|
||||||
|
@ -1377,11 +1398,10 @@ void D3DFB::Draw3DPart(bool copy3d)
|
||||||
realfixedcolormap->ColorizeStart[1]/2, realfixedcolormap->ColorizeStart[2]/2, 0);
|
realfixedcolormap->ColorizeStart[1]/2, realfixedcolormap->ColorizeStart[2]/2, 0);
|
||||||
color1 = D3DCOLOR_COLORVALUE(realfixedcolormap->ColorizeEnd[0]/2,
|
color1 = D3DCOLOR_COLORVALUE(realfixedcolormap->ColorizeEnd[0]/2,
|
||||||
realfixedcolormap->ColorizeEnd[1]/2, realfixedcolormap->ColorizeEnd[2]/2, 1);
|
realfixedcolormap->ColorizeEnd[1]/2, realfixedcolormap->ColorizeEnd[2]/2, 1);
|
||||||
#ifndef PALETTEOUTPUT
|
if (r_swtruecolor)
|
||||||
SetPixelShader(Shaders[SHADER_SpecialColormap]);
|
SetPixelShader(Shaders[SHADER_SpecialColormap]);
|
||||||
#else
|
else
|
||||||
SetPixelShader(Shaders[SHADER_SpecialColormapPal]);
|
SetPixelShader(Shaders[SHADER_SpecialColormapPal]);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1392,11 +1412,10 @@ void D3DFB::Draw3DPart(bool copy3d)
|
||||||
CalcFullscreenCoords(verts, Accel2D, false, color0, color1);
|
CalcFullscreenCoords(verts, Accel2D, false, color0, color1);
|
||||||
D3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, verts, sizeof(FBVERTEX));
|
D3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, verts, sizeof(FBVERTEX));
|
||||||
}
|
}
|
||||||
#ifndef PALETTEOUTPUT
|
if (r_swtruecolor)
|
||||||
SetPixelShader(Shaders[SHADER_NormalColor]);
|
SetPixelShader(Shaders[SHADER_NormalColor]);
|
||||||
#else
|
else
|
||||||
SetPixelShader(Shaders[SHADER_NormalColorPal]);
|
SetPixelShader(Shaders[SHADER_NormalColorPal]);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -424,6 +424,7 @@ private:
|
||||||
bool NeedPalUpdate;
|
bool NeedPalUpdate;
|
||||||
bool NeedGammaUpdate;
|
bool NeedGammaUpdate;
|
||||||
int FBWidth, FBHeight;
|
int FBWidth, FBHeight;
|
||||||
|
D3DFORMAT FBFormat;
|
||||||
bool VSync;
|
bool VSync;
|
||||||
RECT BlendingRect;
|
RECT BlendingRect;
|
||||||
int In2D;
|
int In2D;
|
||||||
|
|
|
@ -1780,6 +1780,7 @@ DSPLYMNU_BRIGHTNESS = "Brightness";
|
||||||
DSPLYMNU_VSYNC = "Vertical Sync";
|
DSPLYMNU_VSYNC = "Vertical Sync";
|
||||||
DSPLYMNU_CAPFPS = "Rendering Interpolation";
|
DSPLYMNU_CAPFPS = "Rendering Interpolation";
|
||||||
DSPLYMNU_COLUMNMETHOD = "Column render mode";
|
DSPLYMNU_COLUMNMETHOD = "Column render mode";
|
||||||
|
DSPLYMNU_TRUECOLOR = "True color output";
|
||||||
DSPLYMNU_WIPETYPE = "Screen wipe style";
|
DSPLYMNU_WIPETYPE = "Screen wipe style";
|
||||||
DSPLYMNU_SHOWENDOOM = "Show ENDOOM screen";
|
DSPLYMNU_SHOWENDOOM = "Show ENDOOM screen";
|
||||||
DSPLYMNU_PALLETEHACK = "DirectDraw palette hack"; // Not used
|
DSPLYMNU_PALLETEHACK = "DirectDraw palette hack"; // Not used
|
||||||
|
|
|
@ -661,6 +661,7 @@ OptionMenu "VideoOptions"
|
||||||
Option "$DSPLYMNU_VSYNC", "vid_vsync", "OnOff"
|
Option "$DSPLYMNU_VSYNC", "vid_vsync", "OnOff"
|
||||||
Option "$DSPLYMNU_CAPFPS", "cl_capfps", "OffOn"
|
Option "$DSPLYMNU_CAPFPS", "cl_capfps", "OffOn"
|
||||||
Option "$DSPLYMNU_COLUMNMETHOD", "r_columnmethod", "ColumnMethods"
|
Option "$DSPLYMNU_COLUMNMETHOD", "r_columnmethod", "ColumnMethods"
|
||||||
|
Option "$DSPLYMNU_TRUECOLOR", "r_swtruecolor", "OnOff"
|
||||||
|
|
||||||
StaticText " "
|
StaticText " "
|
||||||
Option "$DSPLYMNU_WIPETYPE", "wipetype", "Wipes"
|
Option "$DSPLYMNU_WIPETYPE", "wipetype", "Wipes"
|
||||||
|
|
Loading…
Reference in a new issue