Skip to content

Commit

Permalink
Can now set reflection detail level in video options
Browse files Browse the repository at this point in the history
  • Loading branch information
HumanGamer committed Jan 9, 2023
1 parent b7eeb16 commit 3e08d65
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
12 changes: 6 additions & 6 deletions engine/source/gfx/D3D9/gfxD3D9Cubemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,16 @@ void GFXD3D9Cubemap::updateDynamic( const Point3F &pos )
// render scene
switch (smReflectionDetailLevel)
{
case 1: // Basic Reflection
case 1: // Sky
getCurrentClientSceneGraph()->renderScene( EnvironmentObjectType );
break;
case 2: // Level
getCurrentClientSceneGraph()->renderScene( TerrainObjectType | InteriorObjectType | EnvironmentObjectType );
break;
case 2: // Items
case 3: // Items
getCurrentClientSceneGraph()->renderScene( TerrainObjectType | InteriorObjectType | EnvironmentObjectType | ItemObjectType );
break;
case 3: // Static Shapes like glass and pads
getCurrentClientSceneGraph()->renderScene( TerrainObjectType | InteriorObjectType | EnvironmentObjectType | ItemObjectType | StaticShapeObjectType );
break;
case 4: // Astrolabe and anything else
case 4: // Static Shapes like glass and pads
getCurrentClientSceneGraph()->renderScene( TerrainObjectType | InteriorObjectType | EnvironmentObjectType | ItemObjectType | StaticShapeObjectType | StaticTSObjectType );
break;
default: // No Reflection
Expand Down
2 changes: 1 addition & 1 deletion engine/source/gfx/gfxCubemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "console/consoleTypes.h"

// Added as console variable in gfxDevice.cpp - GFXDevice::create()
S32 GFXCubemap::smReflectionDetailLevel = 1;
S32 GFXCubemap::smReflectionDetailLevel = 2;

void GFXCubemap::initNormalize(U32 size)
{
Expand Down
2 changes: 2 additions & 0 deletions game/common/local/englishStrings.inf
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ $Text::FullscreenResolution = "Fullscreen Resolution";
$Text::WindowedResolution = "Windowed Resolution";
$Text::DisplayMode = "Display Mode";
$Text::DisplayModeOptions = "Windowed\tBorderless Fullscreen\tExclusive Fullscreen";
$Text::ReflectionDetailLevel = "Reflection Detail Level";
$Text::ReflectionDetailLevelOptions = "Nothing\tSky\tLevel and Sky\tLevel, Sky and Items\tEverything";
$Text::MarbleSkin = "Marble Type";

;This string is no longer used $Text::MarbleOptions = "one\ttwo\tthree\tfour\tfive\tsix\tseven\teight\tnine\tten\televen\ttwelve\tthirteen\tfourteen\tfifteen\tsixteen\tseventeen\teighteen\tnineteen\ttwenty";
Expand Down
10 changes: 10 additions & 0 deletions game/marble/client/ui/videoOptionsGui.gui
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ function videoOptionsGui::show(%this, %backGui)
// Block Exclusive Fullscreen for now as it's buggy
videoOptionsList.addRow($Text::DisplayMode, getFields($Text::DisplayModeOptions, 0, 1), 8); // display mode
//videoOptionsList.addRow($Text::DisplayMode, $Text::DisplayModeOptions, 8); // display mode

videoOptionsList.addRow($Text::ReflectionDetailLevel, $Text::ReflectionDetailLevelOptions, 8); // reflection detail level

for (%i = 0; %i < getFieldCount($Option::resList); %i++)
{
Expand All @@ -125,10 +127,13 @@ function videoOptionsGui::show(%this, %backGui)
$Option::fullScreen = 2;
else if ($Option::fullScreen == 2)
$Option::fullScreen = 1;

$Option::reflection = $pref::Video::ReflectionDetailLevel;

videoOptionsList.setOptionIndex(0, $Option::resolution);
videoOptionsList.setOptionIndex(1, $Option::windowedRes);
videoOptionsList.setOptionIndex(2, $Option::fullScreen);
videoOptionsList.setOptionIndex(3, $Option::reflection);

RootGui.setA( $Text::OK );
RootGui.setTitle( strupr($Text::HOVideoOptions) );
Expand Down Expand Up @@ -162,6 +167,11 @@ function videoOptionsList::onOptionChange(%this, %increase)

$pref::Video::fullScreen = %val;
echo("Display Mode = " @ $pref::Video::fullScreen);
case 3:
$Option::reflection = %val;
$pref::Video::ReflectionDetailLevel = $Option::reflection;

echo("Reflection Detail Level = " @ $pref::Video::ReflectionDetailLevel);
}
}

Expand Down

0 comments on commit 3e08d65

Please sign in to comment.