[go: up one dir, main page]

Skip to content

Commit

Permalink
* Added RenderSkybox option to the .ini (and disabled it by default u…
Browse files Browse the repository at this point in the history
…ntil skybox is fixed).

* No longer write (default) .ini on startup. There are now code-defaults and the .ini ships with the package anyway.
  • Loading branch information
onnoj committed Aug 10, 2024
1 parent ee3806f commit f2f7d7b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Source/Renderer/DeusExEchelonRenderer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ HijackTexture[0]=CoreTexGlass.Glass.07WindOpacStrek
HijackTexture[1]=

[DeusExEchelonRenderer.Settings]
RenderPlayerBody=True

;RenderPlayerBody=True
;RenderSkybox=True
8 changes: 4 additions & 4 deletions Source/Renderer/rendering/hlrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ void HighlevelRenderer::OnSceneEnd(FSceneNode* Frame)
{
auto& ctx = *g_ContextManager.GetContext();

if (ctx.frameIsSkybox && !g_ConfigManager.GetRenderSkybox())
{
return;
}

UModel* Model = Frame->Level->Model;
auto& GSurfs = Model->Surfs;
Expand Down Expand Up @@ -574,10 +578,6 @@ void HighlevelRenderer::OnDrawGeometryBegin(FSceneNode* Frame)
void HighlevelRenderer::OnDrawGeometry(FSceneNode* Frame, FSurfaceInfo& Surface, FSurfaceFacet& Facet)
{
auto& ctx = *g_ContextManager.GetContext();
if (ctx.frameIsSkybox)
{
int x = 1;
}

if (Facet.Polys == nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Renderer/uefacade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ UBOOL UD3D9FPRenderDevice::Init(UViewport* pInViewport, int32_t pWidth, int32_t
InitializeEchelonCore();

g_ConfigManager.LoadConfig();
g_ConfigManager.SaveConfig(); //save file again so that we have the defaults
//g_ConfigManager.SaveConfig(); //save file again so that we have the defaults

g_CommandManager.Initialize();
g_DemoManager.Initialize();
Expand Down
5 changes: 4 additions & 1 deletion Source/Renderer/utils/configmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ void ConfigManager::LoadConfig()
m_HijackedTextureNames.push_back(value);
}
}

//Misc properties
GConfig->GetBool(g_RendererName L".Settings", L"RenderPlayerBody", m_RenderPlayerBody, g_ConfigFilename.c_str());
GConfig->GetBool(g_RendererName L".Settings", L"RenderSkybox", m_RenderSkybox, g_ConfigFilename.c_str());
}


Expand Down Expand Up @@ -90,7 +92,8 @@ void ConfigManager::SaveConfig()
}

//Misc properties
GConfig->SetBool(g_RendererName L".Settings", L"RenderPlayerBodys", m_RenderPlayerBody, g_ConfigFilename.c_str());
GConfig->SetBool(g_RendererName L".Settings", L"RenderPlayerBody", m_RenderPlayerBody, g_ConfigFilename.c_str());
GConfig->SetBool(g_RendererName L".Settings", L"RenderSkybox", m_RenderSkybox, g_ConfigFilename.c_str());

//Store file
GConfig->Flush(0, g_ConfigFilename.c_str());
Expand Down
2 changes: 2 additions & 0 deletions Source/Renderer/utils/configmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ class ConfigManager
public:
std::vector<std::wstring>& GetHijackedTextureNames() { return m_HijackedTextureNames; }
bool GetRenderPlayerBody() const { return m_RenderPlayerBody; }
bool GetRenderSkybox() const { return m_RenderSkybox; }
private:
std::vector<std::wstring> m_HijackedTextureNames;
UBOOL m_RenderPlayerBody = true;
UBOOL m_RenderSkybox = false;
};

extern ConfigManager g_ConfigManager;

0 comments on commit f2f7d7b

Please sign in to comment.