Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heretic: Adding Translucency Option #1251

Merged
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
41de092
Heretic: Adding Translucency Option - not functionally yet
Noseey Dec 18, 2024
f2ebddc
Heretic: Adding certain sprites to be translucent and disable item/pr…
Noseey Dec 18, 2024
88b613f
Heretic: Adding further translucency effects.
Noseey Dec 20, 2024
5b4926e
Heretic: Dirty Translucent Goldwand firing.
Noseey Dec 20, 2024
43d2b48
Heretic: Translucency gun flash Goldwand
Noseey Dec 20, 2024
c29bf51
Heretic: Translucency gun flash Blaster, Hellrod
Noseey Dec 21, 2024
0cb6f26
Heretic: Reconstructing maxlight when loading to align with Doom.
Noseey Dec 21, 2024
65c4275
Heretic: Translucency gun flash Gauntlet, PhoenixRod
Noseey Dec 21, 2024
ae7bafc
Heretic: Restructured Translucent Weapon Fire evaluation.
Noseey Dec 22, 2024
cfcf484
Heretic: Translucency conditions and selection changed
Noseey Dec 23, 2024
feca92a
Heretic: Restructured Translucent Weapon Fire evaluation. (2nd)
Noseey Dec 23, 2024
d7f93db
Heretic: Translucency Option cleanup
Noseey Dec 23, 2024
fdef0dd
Merge branch 'fabiangreffrath:master' into Heretic_Translucency_Option
Noseey Dec 23, 2024
359a359
Heretic: Changed Translucency for various things
Noseey Dec 24, 2024
5e9aeb7
Merge branch 'Heretic_Translucency_Option' of https://github.com/Nose…
Noseey Dec 24, 2024
df9dae1
Heretic: Add Miscmissle Flag directly to MT_POD
Noseey Dec 25, 2024
7159024
Heretic: Translucency Option fixing whitespaces, adding comments and …
Noseey Dec 25, 2024
65f7469
Heretic: Weapon Translucency considering Invisibility Powerup
Noseey Dec 25, 2024
facde61
Heretic: Undo Translucency for dying Mummyleaders.
Noseey Dec 30, 2024
dafa64b
Revert "Heretic: Reconstructing maxlight when loading to align with D…
Noseey Dec 30, 2024
94f4d1f
Heretic: Gauntlets no longer considered for weapon sprite translucency.
Noseey Dec 30, 2024
a7d2127
Heretic: Moved Translucency offsets to r_things.c
Noseey Dec 30, 2024
ae33ec6
Heretic: Fixing Whitespaces in info.h
Noseey Dec 30, 2024
16e15f8
Heretic: Renamed translucency option for weapon flashes.
Noseey Jan 2, 2025
b974d88
Heretic: Removed MISCMISSILE Flag
Noseey Jan 2, 2025
94f29f4
Heretic: Reworked y-offets for translucency
Noseey Jan 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/heretic/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,7 @@ void D_BindVariables(void)
M_BindIntVariable("crispy_secretmessage", &crispy->secretmessage);
M_BindIntVariable("crispy_smoothlight", &crispy->smoothlight);
M_BindIntVariable("crispy_soundmono", &crispy->soundmono);
M_BindIntVariable("crispy_translucency", &crispy->translucency);
#ifdef CRISPY_TRUECOLOR
M_BindIntVariable("crispy_truecolor", &crispy->truecolor);
#endif
Expand Down
1 change: 1 addition & 0 deletions src/heretic/doomdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ typedef struct

#define MF_TRANSLATION 0xc000000 // if 0x4 0x8 or 0xc, use a translation
#define MF_TRANSSHIFT 26 // table for player colormaps
#define MF_TRANSLUCENT 0x80000000 // [crispy] translucent sprite

// --- mobj.flags2 ---

Expand Down
132 changes: 66 additions & 66 deletions src/heretic/info.c

Large diffs are not rendered by default.

110 changes: 81 additions & 29 deletions src/heretic/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef enum
MENU_MOUSE,
MENU_CRISPNESS1,
MENU_CRISPNESS2,
MENU_CRISPNESS3,
MENU_NONE
} MenuType_t;

Expand Down Expand Up @@ -133,6 +134,7 @@ static boolean CrispySmoothing(int option);
static boolean CrispyBrightmaps(int option);
static boolean CrispySmoothLighting(int option);
static boolean CrispySoundMono(int option);
static boolean CrispyTranslucency(int option);
static boolean CrispySndChannels(int option);
static boolean CrispyAutomapStats(int option);
static boolean CrispyLevelTime(int option);
Expand Down Expand Up @@ -163,6 +165,7 @@ static void DrawMouseMenu(void);
static void DrawCrispness(void);
static void DrawCrispness1(void);
static void DrawCrispness2(void);
static void DrawCrispness3(void);
void MN_LoadSlotText(void);

// External Functions
Expand Down Expand Up @@ -359,7 +362,7 @@ static Menu_t Options2Menu = {

static int crispnessmenupage;

#define NUM_CRISPNESS_MENUS 2
#define NUM_CRISPNESS_MENUS 3

static MenuItem_t Crispness1Items[] = {
{ITT_LRFUNC2, "HIGH RESOLUTION RENDERING:", CrispyHires, 0, MENU_NONE},
Expand All @@ -372,54 +375,80 @@ static MenuItem_t Crispness1Items[] = {
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_LRFUNC2, "APPLY BRIGHTMAPS TO:", CrispyBrightmaps, 0, MENU_NONE},
{ITT_LRFUNC2, "SMOOTH DIMINISHING LIGHTING:", CrispySmoothLighting, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_LRFUNC2, "MONO SFX:", CrispySoundMono, 0, MENU_NONE},
{ITT_LRFUNC2, "SOUND CHANNELS:", CrispySndChannels, 0, MENU_NONE},
{ITT_LRFUNC2, "ENABLE TRANSLUCENCY:", CrispyTranslucency, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EFUNC, "NEXT PAGE", CrispyNextPage, 0, MENU_NONE},
{ITT_EFUNC, "LAST PAGE", CrispyPrevPage, 0, MENU_NONE},
};

static Menu_t Crispness1Menu = {
68, 35,
DrawCrispness,
16, Crispness1Items,
14, Crispness1Items,
0,
MENU_OPTIONS
};

static MenuItem_t Crispness2Items[] = {
{ITT_LRFUNC2, "MONO SFX:", CrispySoundMono, 0, MENU_NONE},
{ITT_LRFUNC2, "SOUND CHANNELS:", CrispySndChannels, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_LRFUNC2, "SHOW LEVEL STATS:", CrispyAutomapStats, 0, MENU_NONE},
{ITT_LRFUNC2, "SHOW LEVEL TIME:", CrispyLevelTime, 0, MENU_NONE},
{ITT_LRFUNC2, "SHOW PLAYER COORDS:", CrispyPlayerCoords, 0, MENU_NONE},
{ITT_LRFUNC2, "REPORT REVEALED SECRETS:", CrispySecretMessage, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EFUNC, "NEXT PAGE", CrispyNextPage, 0, MENU_NONE},
{ITT_EFUNC, "PREV PAGE", CrispyPrevPage, 0, MENU_NONE},
};

static Menu_t Crispness2Menu = {
68, 35,
DrawCrispness,
14, Crispness2Items,
0,
MENU_OPTIONS
};

static MenuItem_t Crispness3Items[] = {
{ITT_LRFUNC2, "FREELOOK MODE:", CrispyFreelook, 0, MENU_NONE},
{ITT_LRFUNC2, "PERMANENT MOUSELOOK:", CrispyMouselook, 0, MENU_NONE},
{ITT_LRFUNC2, "PLAYER VIEW/WEAPON BOBBING:", CrispyBobfactor, 0, MENU_NONE},
{ITT_LRFUNC2, "WEAPON ATTACK ALIGNMENT:", CrispyCenterWeapon, 0, MENU_NONE},
{ITT_LRFUNC2, "DEFAULT DIFFICULTY:", CrispyDefaultskill, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
{ITT_EFUNC, "FIRST PAGE", CrispyNextPage, 0, MENU_NONE},
{ITT_EFUNC, "PREV PAGE", CrispyPrevPage, 0, MENU_NONE},
};

static Menu_t Crispness2Menu = {
static Menu_t Crispness3Menu = {
68, 35,
DrawCrispness,
13, Crispness2Items,
14, Crispness3Items,
0,
MENU_OPTIONS
};

static void (*CrispnessMenuDrawers[])(void) = {
&DrawCrispness1,
&DrawCrispness2,
&DrawCrispness3,
};

static MenuType_t CrispnessMenus[] = {
MENU_CRISPNESS1,
MENU_CRISPNESS2,
MENU_CRISPNESS3,
};

static const multiitem_t multiitem_bobfactor[NUM_BOBFACTORS] =
Expand Down Expand Up @@ -483,6 +512,14 @@ static const multiitem_t multiitem_difficulties[NUM_SKILLS] =
{SKILL_HNTR, "YELLOWBELLIES"},
};

multiitem_t multiitem_translucency[NUM_TRANSLUCENCY] =
{
{TRANSLUCENCY_OFF, "OFF"},
{TRANSLUCENCY_MISSILE, "PROJECTILES"},
{TRANSLUCENCY_ITEM, "WEAPON FLASHES"},
{TRANSLUCENCY_BOTH, "BOTH"},
};

static const multiitem_t multiitem_sndchannels[3] =
{
{8, "8"},
Expand All @@ -502,6 +539,7 @@ static Menu_t *Menus[] = {
&MouseMenu,
&Crispness1Menu,
&Crispness2Menu,
&Crispness3Menu,
};

// [crispy] gamma correction messages
Expand Down Expand Up @@ -1735,6 +1773,12 @@ static boolean CrispySoundMono(int option)
return true;
}

static boolean CrispyTranslucency(int choice)
{
ChangeSettingEnum(&crispy->translucency, choice, NUM_TRANSLUCENCY);
return true;
}

static boolean CrispySndChannels(int option)
{
S_UpdateSndChannels(option);
Expand Down Expand Up @@ -2980,7 +3024,7 @@ static void DrawCrispnessNumericItem(int item, int x, int y, const char *zero,

static void DrawCrispness1(void)
{
DrawCrispnessHeader("CRISPNESS 1/2");
DrawCrispnessHeader("CRISPNESS 1/3");

DrawCrispnessSubheader("RENDERING", 25);

Expand Down Expand Up @@ -3010,47 +3054,55 @@ static void DrawCrispness1(void)
// Smooth Diminishing Lighting
DrawCrispnessItem(crispy->smoothlight, 257, 125);

DrawCrispnessSubheader("AUDIBLE", 145);

// Mono SFX
DrawCrispnessItem(crispy->soundmono, 137, 155);

// Sound Channels
DrawCrispnessMultiItem(snd_Channels >> 4, 181, 165, multiitem_sndchannels, false);
// Translucency
DrawCrispnessMultiItem(crispy->translucency, 218, 135, multiitem_translucency, false);
}

static void DrawCrispness2(void)
{
DrawCrispnessHeader("CRISPNESS 2/2");
DrawCrispnessHeader("CRISPNESS 2/3");

DrawCrispnessSubheader("AUDIBLE", 25);

// Mono SFX
DrawCrispnessItem(crispy->soundmono, 137, 35);

DrawCrispnessSubheader("NAVIGATIONAL", 25);
// Sound Channels
DrawCrispnessMultiItem(snd_Channels >> 4, 181, 45, multiitem_sndchannels, false);

DrawCrispnessSubheader("NAVIGATIONAL", 65);

// Show level stats
DrawCrispnessMultiItem(crispy->automapstats, 190, 35, multiitem_widgets, false);
DrawCrispnessMultiItem(crispy->automapstats, 190, 75, multiitem_widgets, false);

// Show level time
DrawCrispnessMultiItem(crispy->leveltime, 179, 45, multiitem_widgets, false);
DrawCrispnessMultiItem(crispy->leveltime, 179, 85, multiitem_widgets, false);
// Show player coords
DrawCrispnessMultiItem(crispy->playercoords, 211, 55, multiitem_widgets, false);
DrawCrispnessMultiItem(crispy->playercoords, 211, 95, multiitem_widgets, false);

// Show secret message
DrawCrispnessMultiItem(crispy->secretmessage, 250, 65, multiitem_secretmessage, false);
DrawCrispnessMultiItem(crispy->secretmessage, 250, 105, multiitem_secretmessage, false);
}

DrawCrispnessSubheader("TACTICAL", 85);
static void DrawCrispness3(void)
{
DrawCrispnessHeader("CRISPNESS 3/3");

DrawCrispnessSubheader("TACTICAL", 25);

// Freelook
DrawCrispnessMultiItem(crispy->freelook_hh, 175, 95, multiitem_freelook_hh, false);
DrawCrispnessMultiItem(crispy->freelook_hh, 175, 35, multiitem_freelook_hh, false);

// Mouselook
DrawCrispnessItem(crispy->mouselook, 220, 105);
DrawCrispnessItem(crispy->mouselook, 220, 45);

// Bobfactor
DrawCrispnessMultiItem(crispy->bobfactor, 265, 115, multiitem_bobfactor, false);
DrawCrispnessMultiItem(crispy->bobfactor, 265, 55, multiitem_bobfactor, false);

// Weapon attack alignment
DrawCrispnessMultiItem(crispy->centerweapon, 245, 125, multiitem_centerweapon,
DrawCrispnessMultiItem(crispy->centerweapon, 245, 65, multiitem_centerweapon,
crispy->bobfactor == BOBFACTOR_OFF);

// Default difficulty
DrawCrispnessMultiItem(crispy->defaultskill, 200, 135, multiitem_difficulties, false);
}
DrawCrispnessMultiItem(crispy->defaultskill, 200, 75, multiitem_difficulties, false);
}
16 changes: 15 additions & 1 deletion src/heretic/p_enemy.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,11 @@ void A_Look(mobj_t *actor, player_t *player, pspdef_t *psp)
else
goto seeyou;
}

// [crispy] Undo Mummyleader translucency
if (actor->type == MT_MUMMYLEADER)
{
actor->flags &= ~MF_TRANSLUCENT;
}

if (!P_LookForPlayers(actor, false))
return;
Expand Down Expand Up @@ -701,6 +705,11 @@ void A_Chase(mobj_t *actor, player_t *player, pspdef_t *psp)
actor->tics = 3;
}
}
// [crispy] Undo Mummyleader translucency
if (actor->type == MT_MUMMYLEADER)
{
actor->flags &= ~MF_TRANSLUCENT;
}

//
// turn towards movement direction if not there yet
Expand Down Expand Up @@ -822,6 +831,11 @@ void A_FaceTarget(mobj_t *actor, player_t *player, pspdef_t *psp)
{ // Target is a ghost
actor->angle += P_SubRandom() << 21;
}
// [crispy] Charging-up Mummyleaders are translucent in that state (blinking)
if (actor->type == MT_MUMMYLEADER)
{
actor->flags |= MF_TRANSLUCENT;
}
}

//----------------------------------------------------------------------------
Expand Down
9 changes: 9 additions & 0 deletions src/heretic/p_inter.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,15 @@ void P_KillMobj(mobj_t * source, mobj_t * target)
return;
}
}

// [crispy] Exploding Goo-Pods are translucent
if (target->type == MT_POD)
target->flags |= MF_TRANSLUCENT;

// [crispy] Undo Mummyleader translucency
if (target->type == MT_MUMMYLEADER)
target->flags &= ~MF_TRANSLUCENT;

if (target->health < -(target->info->spawnhealth >> 1)
&& target->info->xdeathstate)
{ // Extreme death
Expand Down
Loading
Loading