Skip to content

Commit 5028ef7

Browse files
committed
feat(video): enable brightness filter and remove windowed mode restriction
1 parent b6aa0a9 commit 5028ef7

File tree

2 files changed

+22
-6
lines changed
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient

2 files changed

+22
-6
lines changed

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,9 @@ void W3DDisplay::getDisplayModeDescription(Int modeIndex, Int *xres, Int *yres,
489489

490490
void W3DDisplay::setGamma(Real gamma, Real bright, Real contrast, Bool calibrate)
491491
{
492-
if (m_windowed)
493-
return; //we don't allow gamma to change in window because it would affect desktop.
494-
492+
// TheSuperHackers @feature bobtista 11/02/2025 Brightness is now handled by post-processing filter
493+
// Keep old gamma ramp code for backward compatibility, but it's no longer the primary method
494+
// The windowed mode check is removed since the filter works in all modes
495495
DX8Wrapper::Set_Gamma(gamma,bright,contrast,calibrate, false);
496496
}
497497

@@ -763,6 +763,14 @@ void W3DDisplay::init( void )
763763
init3DScene();
764764
W3DShaderManager::init();
765765

766+
// TheSuperHackers @feature bobtista 11/02/2025 Enable brightness post-processing filter
767+
// The filter will only render when brightness is non-zero (checked in preRender())
768+
if (TheTacticalView)
769+
{
770+
TheTacticalView->setViewFilter(FT_VIEW_BRIGHTNESS_FILTER);
771+
TheTacticalView->setViewFilterMode(FM_VIEW_BRIGHTNESS_ADJUST);
772+
}
773+
766774
// Create and initialize the debug display
767775
m_nativeDebugDisplay = NEW W3DDebugDisplay();
768776
m_debugDisplay = m_nativeDebugDisplay;

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,9 @@ void W3DDisplay::getDisplayModeDescription(Int modeIndex, Int *xres, Int *yres,
538538

539539
void W3DDisplay::setGamma(Real gamma, Real bright, Real contrast, Bool calibrate)
540540
{
541-
if (m_windowed)
542-
return; //we don't allow gamma to change in window because it would affect desktop.
543-
541+
// TheSuperHackers @feature bobtista 11/02/2025 Brightness is now handled by post-processing filter
542+
// Keep old gamma ramp code for backward compatibility, but it's no longer the primary method
543+
// The windowed mode check is removed since the filter works in all modes
544544
DX8Wrapper::Set_Gamma(gamma,bright,contrast,calibrate, false);
545545
}
546546

@@ -813,6 +813,14 @@ void W3DDisplay::init( void )
813813
init3DScene();
814814
W3DShaderManager::init();
815815

816+
// TheSuperHackers @feature bobtista 11/02/2025 Enable brightness post-processing filter
817+
// The filter will only render when brightness is non-zero (checked in preRender())
818+
if (TheTacticalView)
819+
{
820+
TheTacticalView->setViewFilter(FT_VIEW_BRIGHTNESS_FILTER);
821+
TheTacticalView->setViewFilterMode(FM_VIEW_BRIGHTNESS_ADJUST);
822+
}
823+
816824
// Create and initialize the debug display
817825
m_nativeDebugDisplay = NEW W3DDebugDisplay();
818826
m_debugDisplay = m_nativeDebugDisplay;

0 commit comments

Comments
 (0)