Skip to content

Commit

Permalink
Added (All Games): cvar "view-filter-strength" strength multiplier fo…
Browse files Browse the repository at this point in the history
…r screen filters (such as that used when the player collectings items or takes damage). Note that in deathmatch games this value is ignored when drawing the damage filter.
  • Loading branch information
danij-deng committed Nov 19, 2009
1 parent d49af69 commit 9fb6340
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 18 deletions.
3 changes: 3 additions & 0 deletions doomsday/plugins/jdoom/data/conhelp.txt
Expand Up @@ -294,6 +294,9 @@ desc = Crosshair color blue component.
[view-cross-a]
desc = Crosshair color alpha component.

[view-filter-strength]
desc = Strength of view filter.

[msg-show]
desc = 1=Show messages.

Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom/include/d_config.h
Expand Up @@ -112,6 +112,7 @@ typedef struct jdoom_config_s {
int weaponOrder[NUM_WEAPON_TYPES];
byte weaponNextMode; // if true use the weaponOrder for next/previous.
byte secretMsg;
float filterStrength;
int plrViewHeight;
byte mapTitle, hideIWADAuthor;
float menuColor[3];
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom/src/d_console.c
Expand Up @@ -96,6 +96,7 @@ cvar_t gameCVars[] = {
{"view-bob-height", 0, CVT_FLOAT, &cfg.bobView, 0, 1},
{"view-bob-weapon", 0, CVT_FLOAT, &cfg.bobWeapon, 0, 1},
{"view-bob-weapon-switch-lower", 0, CVT_BYTE, &cfg.bobWeaponLower, 0, 1},
{"view-filter-strength", 0, CVT_FLOAT, &cfg.filterStrength, 0, 1},

// Server-side options
// Game state
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom/src/d_main.c
Expand Up @@ -402,6 +402,7 @@ void G_PreInit(void)
cfg.xhairColor[1] = 1;
cfg.xhairColor[2] = 1;
cfg.xhairColor[3] = 1;
cfg.filterStrength = .8f;
cfg.moveCheckZ = true;
cfg.jumpPower = 9;
cfg.airborneMovement = 1;
Expand Down
6 changes: 3 additions & 3 deletions doomsday/plugins/jdoom/src/d_refresh.c
Expand Up @@ -119,7 +119,7 @@ boolean R_GetFilterColor(float rgba[4], int filter)
rgba[CR] = 1;
rgba[CG] = 0;
rgba[CB] = 0;
rgba[CA] = filter / 9.f;
rgba[CA] = (deathmatch? 1.0f : cfg.filterStrength) * filter / 9.f;
return true;
}

Expand All @@ -128,7 +128,7 @@ boolean R_GetFilterColor(float rgba[4], int filter)
rgba[CR] = 1;
rgba[CG] = .8f;
rgba[CB] = .5f;
rgba[CA] = (filter - STARTBONUSPALS + 1) / 16.f;
rgba[CA] = cfg.filterStrength * (filter - STARTBONUSPALS + 1) / 16.f;
return true;
}

Expand All @@ -137,7 +137,7 @@ boolean R_GetFilterColor(float rgba[4], int filter)
rgba[CR] = 0;
rgba[CG] = .7f;
rgba[CB] = 0;
rgba[CA] = .15f;
rgba[CA] = cfg.filterStrength * .25f;
return true;
}

Expand Down
3 changes: 3 additions & 0 deletions doomsday/plugins/jdoom64/data/conhelp.txt
Expand Up @@ -286,6 +286,9 @@ desc = Crosshair color blue component.
[view-cross-a]
desc = Crosshair color alpha component.

[view-filter-strength]
desc = Strength of view filter.

[msg-show]
desc = 1=Show messages.

Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom64/include/d_config.h
Expand Up @@ -113,6 +113,7 @@ typedef struct jdoom64_config_s {
byte weaponNextMode; // if true use the weaponOrder for next/previous.
byte weaponRecoil; // jd64
byte secretMsg;
float filterStrength;
int plrViewHeight;
byte mapTitle, hideIWADAuthor;
float menuColor[3];
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom64/src/d_console.c
Expand Up @@ -98,6 +98,7 @@ cvar_t gameCVars[] = {
{"view-bob-height", 0, CVT_FLOAT, &cfg.bobView, 0, 1},
{"view-bob-weapon", 0, CVT_FLOAT, &cfg.bobWeapon, 0, 1},
{"view-bob-weapon-switch-lower", 0, CVT_BYTE, &cfg.bobWeaponLower, 0, 1},
{"view-filter-strength", 0, CVT_FLOAT, &cfg.filterStrength, 0, 1},

// Server-side options
// Game state
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom64/src/d_main.c
Expand Up @@ -288,6 +288,7 @@ void G_PreInit(void)
cfg.xhairColor[1] = 1;
cfg.xhairColor[2] = 1;
cfg.xhairColor[3] = 1;
cfg.filterStrength = .8f;
cfg.moveCheckZ = true;
cfg.jumpPower = 9;
cfg.airborneMovement = 1;
Expand Down
6 changes: 3 additions & 3 deletions doomsday/plugins/jdoom64/src/d_refresh.c
Expand Up @@ -124,7 +124,7 @@ boolean R_GetFilterColor(float rgba[4], int filter)
rgba[CR] = 1;
rgba[CG] = 0;
rgba[CB] = 0;
rgba[CA] = filter / 9.f;
rgba[CA] = (deathmatch? 1.0f : cfg.filterStrength) * filter / 9.f;
return true;
}

Expand All @@ -133,7 +133,7 @@ boolean R_GetFilterColor(float rgba[4], int filter)
rgba[CR] = 1;
rgba[CG] = .8f;
rgba[CB] = .5f;
rgba[CA] = (filter - STARTBONUSPALS + 1) / 16.f;
rgba[CA] = cfg.filterStrength * (filter - STARTBONUSPALS + 1) / 16.f;
return true;
}

Expand All @@ -142,7 +142,7 @@ boolean R_GetFilterColor(float rgba[4], int filter)
rgba[CR] = 0;
rgba[CG] = .7f;
rgba[CB] = 0;
rgba[CA] = .15f;
rgba[CA] = cfg.filterStrength * .25f;
return true;
}

Expand Down
3 changes: 3 additions & 0 deletions doomsday/plugins/jheretic/data/conhelp.txt
Expand Up @@ -300,6 +300,9 @@ desc = Crosshair color blue component.
[view-cross-a]
desc = Crosshair color alpha component.

[view-filter-strength]
desc = Strength of view filter.

[msg-show]
desc = 1=Show messages.

Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jheretic/include/h_config.h
Expand Up @@ -109,6 +109,7 @@ typedef struct jheretic_config_s {
int weaponOrder[NUM_WEAPON_TYPES];
byte weaponNextMode; // if true use the weaponOrder for next/previous.
byte secretMsg;
float filterStrength;
int plrViewHeight;
byte mapTitle, hideIWADAuthor;
float menuColor[3];
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jheretic/src/h_console.c
Expand Up @@ -98,7 +98,7 @@ cvar_t gameCVars[] = {
{"view-bob-height", 0, CVT_FLOAT, &cfg.bobView, 0, 1},
{"view-bob-weapon", 0, CVT_FLOAT, &cfg.bobWeapon, 0, 1},
{"view-bob-weapon-switch-lower", 0, CVT_BYTE, &cfg.bobWeaponLower, 0, 1},

{"view-filter-strength", 0, CVT_FLOAT, &cfg.filterStrength, 0, 1},
{"view-ringfilter", 0, CVT_INT, &cfg.ringFilter, 1, 2},

// Server-side options
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jheretic/src/h_main.c
Expand Up @@ -292,6 +292,7 @@ void G_PreInit(void)
cfg.xhairColor[1] = 1;
cfg.xhairColor[2] = 1;
cfg.xhairColor[3] = 1;
cfg.filterStrength = .8f;
//cfg.snd_3D = false;
//cfg.snd_ReverbFactor = 100;
cfg.moveCheckZ = true;
Expand Down
8 changes: 4 additions & 4 deletions doomsday/plugins/jheretic/src/h_refresh.c
Expand Up @@ -89,12 +89,12 @@ void R_DrawSpecialFilter(int pnum)
if(cfg.ringFilter == 1)
{
DGL_BlendFunc(DGL_SRC_COLOR, DGL_SRC_COLOR);
DGL_DrawRect(x, y, w, h, .5f, .35f, .1f, 1);
DGL_DrawRect(x, y, w, h, .5f, .35f, .1f, cfg.filterStrength);
}
else
{
DGL_BlendFunc(DGL_DST_COLOR, DGL_SRC_COLOR);
DGL_DrawRect(x, y, w, h, 0, 0, .6f, 1);
DGL_DrawRect(x, y, w, h, 0, 0, .6f, cfg.filterStrength);
}

// Restore the normal rendering state.
Expand All @@ -113,15 +113,15 @@ boolean R_GetFilterColor(float rgba[4], int filter)
rgba[CR] = 1;
rgba[CG] = 0;
rgba[CB] = 0;
rgba[CA] = filter / 8.f; // Full red with filter 8.
rgba[CA] = (deathmatch? 1.0f : cfg.filterStrength) * filter / 8.f; // Full red with filter 8.
return true;
}
else if(filter >= STARTBONUSPALS && filter < STARTBONUSPALS + NUMBONUSPALS)
{ // Light Yellow.
rgba[CR] = 1;
rgba[CG] = 1;
rgba[CB] = .5f;
rgba[CA] = (filter - STARTBONUSPALS + 1) / 16.f;
rgba[CA] = cfg.filterStrength * (filter - STARTBONUSPALS + 1) / 16.f;
return true;
}

Expand Down
3 changes: 3 additions & 0 deletions doomsday/plugins/jhexen/data/conhelp.txt
Expand Up @@ -309,6 +309,9 @@ desc = Crosshair color blue component.
[view-cross-a]
desc = Crosshair color alpha component.

[view-filter-strength]
desc = Strength of view filter.

[msg-show]
desc = 1=Show messages.

Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jhexen/include/x_config.h
Expand Up @@ -112,7 +112,7 @@ typedef struct {
byte ammoAutoSwitch;
int weaponOrder[NUM_WEAPON_TYPES];
byte weaponNextMode; // if true use the weaponOrder for next/previous.

float filterStrength;
byte counterCheat;
float counterCheatScale;

Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jhexen/src/h2_main.c
Expand Up @@ -257,6 +257,7 @@ void G_PreInit(void)
cfg.xhairColor[1] = 1;
cfg.xhairColor[2] = 1;
cfg.xhairColor[3] = 1;
cfg.filterStrength = .8f;
cfg.jumpEnabled = cfg.netJumping = true; // true by default in Hexen
cfg.jumpPower = 9;
cfg.airborneMovement = 1;
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jhexen/src/hconsole.c
Expand Up @@ -103,6 +103,7 @@ cvar_t gameCVars[] = {

{"view-bob-height", 0, CVT_FLOAT, &cfg.bobView, 0, 1},
{"view-bob-weapon", 0, CVT_FLOAT, &cfg.bobWeapon, 0, 1},
{"view-filter-strength", 0, CVT_FLOAT, &cfg.filterStrength, 0, 1},

// Server-side options
// Game state
Expand Down
12 changes: 6 additions & 6 deletions doomsday/plugins/jhexen/src/hrefresh.c
Expand Up @@ -387,47 +387,47 @@ boolean R_GetFilterColor(float rgba[4], int filter)
rgba[CR] = 1;
rgba[CG] = 0;
rgba[CB] = 0;
rgba[CA] = filter / 8.f; // Full red with filter 8.
rgba[CA] = (deathmatch? 1.0f : cfg.filterStrength) * filter / 8.f; // Full red with filter 8.
return true;
}
else if(filter >= STARTBONUSPALS && filter < STARTBONUSPALS + NUMBONUSPALS)
{ // Light Yellow.
rgba[CR] = 1;
rgba[CG] = 1;
rgba[CB] = .5f;
rgba[CA] = (filter - STARTBONUSPALS + 1) / 16.f;
rgba[CA] = cfg.filterStrength * (filter - STARTBONUSPALS + 1) / 16.f;
return true;
}
else if(filter >= STARTPOISONPALS && filter < STARTPOISONPALS + NUMPOISONPALS)
{ // Green.
rgba[CR] = 0;
rgba[CG] = 1;
rgba[CB] = 0;
rgba[CA] = (filter - STARTPOISONPALS + 1) / 16.f;
rgba[CA] = cfg.filterStrength * (filter - STARTPOISONPALS + 1) / 16.f;
return true;
}
else if(filter >= STARTSCOURGEPAL)
{ // Orange.
rgba[CR] = 1;
rgba[CG] = .5f;
rgba[CB] = 0;
rgba[CA] = (STARTSCOURGEPAL + 3 - filter) / 6.f;
rgba[CA] = cfg.filterStrength * (STARTSCOURGEPAL + 3 - filter) / 6.f;
return true;
}
else if(filter >= STARTHOLYPAL)
{ // White.
rgba[CR] = 1;
rgba[CG] = 1;
rgba[CB] = 1;
rgba[CA] = (STARTHOLYPAL + 3 - filter) / 6.f;
rgba[CA] = cfg.filterStrength * (STARTHOLYPAL + 3 - filter) / 6.f;
return true;
}
else if(filter == STARTICEPAL)
{ // Light blue.
rgba[CR] = .5f;
rgba[CG] = .5f;
rgba[CB] = 1;
rgba[CA] = .4f;
rgba[CA] = cfg.filterStrength * .4f;
return true;
}

Expand Down

0 comments on commit 9fb6340

Please sign in to comment.