From b2d015e02c52322a38b3b6cd97be00fae8f5eb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Sat, 27 Jul 2019 13:10:09 +0300 Subject: [PATCH] Heretic: Added map info flag "mif_dim_torch" Setting the "mif_dim_torch" flag causes the Torch artifact to be rendered like in Hexen so that the light attenuates by distance from the viewer. --- doomsday/apps/api/def_share.h | 1 + .../apps/libdoomsday/net.dengine.base.pack/defs/flags.ded | 1 + doomsday/apps/plugins/common/src/world/p_mapsetup.cpp | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/doomsday/apps/api/def_share.h b/doomsday/apps/api/def_share.h index e46223b6b5..b5007dfedc 100644 --- a/doomsday/apps/api/def_share.h +++ b/doomsday/apps/api/def_share.h @@ -118,6 +118,7 @@ typedef struct { #define MIF_NO_INTERMISSION 0x4 ///< Skip any intermission between maps. #define MIF_LIGHTNING 0x8 ///< Lightning is used in the map. #define MIF_SPAWN_ALL_FIREMACES 0x10 ///< Heretic: Spawn all firemaces (disable randomness). +#define MIF_DIM_TORCH 0x20 ///< Heretic: Use the attenuated torch (not fullbright). ///@} #define DDLT_MAX_APARAMS 10 diff --git a/doomsday/apps/libdoomsday/net.dengine.base.pack/defs/flags.ded b/doomsday/apps/libdoomsday/net.dengine.base.pack/defs/flags.ded index 9ed81385e0..81b6d8a37c 100644 --- a/doomsday/apps/libdoomsday/net.dengine.base.pack/defs/flags.ded +++ b/doomsday/apps/libdoomsday/net.dengine.base.pack/defs/flags.ded @@ -71,6 +71,7 @@ Flag { ID = "mif_sphere"; Value = 0x2; } # Draw the sky sphere even when models Flag { ID = "mif_nointermission"; Value = 0x4; } Flag { ID = "mif_lightning"; Value = 0x8; } Flag { ID = "mif_spawn_all_firemaces"; Value = 0x10; } +Flag { ID = "mif_dim_torch"; Value = 0x20; } # Sky Info Flag { ID = "sif_sphere"; Value = 0x1; } # Draw the sky sphere even when models are in use. diff --git a/doomsday/apps/plugins/common/src/world/p_mapsetup.cpp b/doomsday/apps/plugins/common/src/world/p_mapsetup.cpp index 28215532f3..a1738b68eb 100644 --- a/doomsday/apps/plugins/common/src/world/p_mapsetup.cpp +++ b/doomsday/apps/plugins/common/src/world/p_mapsetup.cpp @@ -990,6 +990,11 @@ void P_FinalizeMapChange(uri_s const *mapUri_) #endif #if __JHERETIC__ P_TurnGizmosAwayFromDoors(); + + // Torch rendering mode for the map. By default (vanilla), Heretic has a + // fullbright torch. + DD_SetInteger(DD_FIXEDCOLORMAP_ATTENUATE, + (gfw_Session()->mapInfo().geti("flags") & MIF_DIM_TORCH) != 0); #endif }