Skip to content

Commit

Permalink
Restore flashlight reflections on buildings throughout Silent Hill, a…
Browse files Browse the repository at this point in the history
…nd introduce flashlight reflections to some special objects (#986)
  • Loading branch information
FrozenFish24 authored Jun 27, 2024
1 parent 32cd222 commit 4c46e90
Show file tree
Hide file tree
Showing 14 changed files with 1,292 additions and 0 deletions.
75 changes: 75 additions & 0 deletions Common/IUnknownPtr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// added by iOrange in 2024

#pragma once

// simplified version of Microsoft::WRL::ComPtr

template <typename T>
class IUnknownPtr {
public:
IUnknownPtr() : mPtr(nullptr) {}

~IUnknownPtr() {
InternalRelease();
}

IUnknownPtr& operator=(decltype(__nullptr)) {
InternalRelease();
return *this;
}

IUnknownPtr& operator=(T* other) {
if (mPtr != other) {
InternalRelease();
mPtr = other;
}
return *this;
}

operator bool() const {
return mPtr != nullptr;
}

T* GetPtr() const {
return mPtr;
}

T* operator->() const {
return mPtr;
}

T* const* GetAddressOf() const {
return &mPtr;
}

T** GetAddressOf() {
return &mPtr;
}

T** ReleaseAndGetAddressOf() {
InternalRelease();
return &mPtr;
}

private:
void InternalAddRef() const {
if (mPtr) {
mPtr->AddRef();
}
}

unsigned long InternalRelease() {
unsigned long refs = 0ul;
T* temp = mPtr;

if (temp) {
mPtr = nullptr;
refs = temp->Release();
}

return refs;
}

private:
T* mPtr;
};
1 change: 1 addition & 0 deletions Common/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
visit(FixSaveBGImage, true) \
visit(FixTownGateEvents, true) \
visit(FlashlightFlickerFix, true) \
visit(FlashlightReflection, true) \
visit(FlashlightToggleSFX, true) \
visit(FmvSubtitlesNoiseFix, true) \
visit(FmvSubtitlesSyncFix, true) \
Expand Down
3 changes: 3 additions & 0 deletions Common/Settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ UseBestGraphics = 1
; Restores shadows and shadow behaviors throughout the game. This includes the use of soft shadows, correct shadow level intensities, accurate shadow fading on flashlight toggles, and the restoration of self shadows (shadows being casted upon dynamic objects such as items and characters).
EnableSoftShadows = 1

; Creates a reflection of the flashlight on glass and glossy surfaces throughout the game.
FlashlightReflection = 1

; Restores post-processing effects to their original intensities throughout the game. Effects include depth-of-field blur, motion blur, static blur, and pseudo blooms.
RestoreSpecialFX = 1

Expand Down
9 changes: 9 additions & 0 deletions Launcher/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@
</Choices>
</Feature>

<Feature name="FlashlightReflection">
<Title>Flashlight reflection</Title>
<Description>Creates a reflection of the flashlight on glass and glossy surfaces throughout the game.</Description>
<Choices type="check">
<Value name="Disable">0</Value>
<Value name="Enable" default="true">1</Value>
</Choices>
</Feature>

<Feature name="RestoreSpecialFX">
<Title>Restore post-processing effects</Title>
<Description>Restores post-processing effects to their original intensities throughout the game. Effects include depth-of-field blur, motion blur, static blur, and pseudo blooms.</Description>
Expand Down
9 changes: 9 additions & 0 deletions Launcher/config_br.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@
</Choices>
</Feature>

<Feature name="FlashlightReflection">
<Title>Flashlight reflection</Title>
<Description>Creates a reflection of the flashlight on glass and glossy surfaces throughout the game.</Description>
<Choices type="check">
<Value name="Disable">0</Value>
<Value name="Enable" default="true">1</Value>
</Choices>
</Feature>

<Feature name="RestoreSpecialFX">
<Title>Restaurar efeitos de pós-processamento</Title>
<Description>Restaura os efeitos de pós-processamento às suas intensidades originais ao longo do jogo. Os efeitos incluem desfoque de profundidade de campo, desfoque de movimento, desfoque estático e pseudo bloom.</Description>
Expand Down
9 changes: 9 additions & 0 deletions Launcher/config_es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@
</Choices>
</Feature>

<Feature name="FlashlightReflection">
<Title>Flashlight reflection</Title>
<Description>Creates a reflection of the flashlight on glass and glossy surfaces throughout the game.</Description>
<Choices type="check">
<Value name="Disable">0</Value>
<Value name="Enable" default="true">1</Value>
</Choices>
</Feature>

<Feature name="RestoreSpecialFX">
<Title>Restaurar los efectos de posprocesado</Title>
<Description>Restaura la intensidad original de los efectos de posprocesado del juego, entre los cuales se incluyen los desenfoques de campo, de movimiento, estáticos y los pseudoresplandores.</Description>
Expand Down
9 changes: 9 additions & 0 deletions Launcher/config_it.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@
</Choices>
</Feature>

<Feature name="FlashlightReflection">
<Title>Flashlight reflection</Title>
<Description>Creates a reflection of the flashlight on glass and glossy surfaces throughout the game.</Description>
<Choices type="check">
<Value name="Disable">0</Value>
<Value name="Enable" default="true">1</Value>
</Choices>
</Feature>

<Feature name="RestoreSpecialFX">
<Title>Ripristina gli effetti di post-processing</Title>
<Description>Ripristina gli effetti di post-processing alla loro intensità originale durante il gioco. Gli effetti includono sfocamento dovuto a profondità di campo, sfocamento dovuto al movimento, sfocamento statico e pseudo bloom.</Description>
Expand Down
Loading

0 comments on commit 4c46e90

Please sign in to comment.