Decompile 2 functions in Source/Render/DX9/RendererFogDX9.cpp, Source/Render/DX9/RendererDX9.cpp, ...
Batch #12214 by cremane: 1 byte-identical, 1 confirmed by peer review. - fn_02217 CRendererDX9::ApplyFog: logic confirmed by peer review - fn_02230 CRendererDX9::SetFog: byte-identical Peer-reviewed-by: Yommy, Tanke, codeplay Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
6dac69e27e
commit
0631a3548c
3 changed files with 13 additions and 21 deletions
|
|
@ -28,10 +28,6 @@ void CRendererDX9::SetClearColor(unsigned color) {
|
|||
this->clearColor = color;
|
||||
}
|
||||
|
||||
void CRendererDX9::SetFog(int enabled) {
|
||||
this->fog.Set(enabled, this->device->caps);
|
||||
}
|
||||
|
||||
// OFFSET: 0x00567E70
|
||||
// FUNCTION: fn_02231
|
||||
float CRendererDX9::FPS() const {
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@
|
|||
|
||||
// OFFSET: 0x00567E20
|
||||
// FUNCTION: fn_02230
|
||||
void RendererFogDX9::Set(int value, const _D3DCAPS9& caps) {
|
||||
const int supported = (caps.RasterCaps & D3DPRASTERCAPS_FOGVERTEX) != 0;
|
||||
this->dirty = 1;
|
||||
this->supported = supported;
|
||||
this->enabled = value;
|
||||
void CRendererDX9::SetFog(int enabled) {
|
||||
const int supported = (this->device->caps.RasterCaps & D3DPRASTERCAPS_FOGVERTEX) != 0;
|
||||
this->fog.dirty = 1;
|
||||
this->fog.supported = supported;
|
||||
this->fog.enabled = enabled;
|
||||
g_fogRange = 1;
|
||||
g_fogVertexMode = D3DFOG_LINEAR;
|
||||
}
|
||||
|
|
@ -23,7 +23,6 @@ void RendererFogDX9::Set(int value, const _D3DCAPS9& caps) {
|
|||
// OFFSET: 0x005654D0
|
||||
// FUNCTION: fn_02217
|
||||
void CRendererDX9::ApplyFog() {
|
||||
DeviceStateDX9& state = this->device->state;
|
||||
if (this->fog.dirty == 1) {
|
||||
const float inverseAspect = 1.0f / this->viewport.aspect;
|
||||
const bool supported = (this->device->caps.RasterCaps & D3DPRASTERCAPS_FOGVERTEX) != 0;
|
||||
|
|
@ -37,15 +36,15 @@ void CRendererDX9::ApplyFog() {
|
|||
this->nativeDevice->SetTransform(D3DTS_PROJECTION, &projection);
|
||||
this->nativeDevice->SetTransform(D3DTS_VIEW, &identity);
|
||||
|
||||
state.SetRenderState(D3DRS_FOGCOLOR, g_worldOverlayColor);
|
||||
state.SetRenderState(D3DRS_RANGEFOGENABLE, g_fogRange);
|
||||
state.SetRenderState(D3DRS_FOGSTART, std::bit_cast<unsigned>(start));
|
||||
state.SetRenderState(D3DRS_FOGEND, std::bit_cast<unsigned>(end));
|
||||
state.SetRenderState(D3DRS_FOGDENSITY, std::bit_cast<unsigned>(g_fogDensity));
|
||||
this->device->state.SetRenderState(D3DRS_FOGCOLOR, g_worldOverlayColor);
|
||||
this->device->state.SetRenderState(D3DRS_RANGEFOGENABLE, g_fogRange);
|
||||
this->device->state.SetRenderState(D3DRS_FOGSTART, std::bit_cast<unsigned>(start));
|
||||
this->device->state.SetRenderState(D3DRS_FOGEND, std::bit_cast<unsigned>(end));
|
||||
this->device->state.SetRenderState(D3DRS_FOGDENSITY, std::bit_cast<unsigned>(g_fogDensity));
|
||||
|
||||
if (supported) {
|
||||
state.SetRenderState(D3DRS_FOGTABLEMODE, D3DFOG_NONE);
|
||||
state.SetRenderState(D3DRS_FOGVERTEXMODE, g_fogVertexMode);
|
||||
this->device->state.SetRenderState(D3DRS_FOGTABLEMODE, D3DFOG_NONE);
|
||||
this->device->state.SetRenderState(D3DRS_FOGVERTEXMODE, g_fogVertexMode);
|
||||
} else {
|
||||
this->fog.enabled = 0;
|
||||
}
|
||||
|
|
@ -53,5 +52,5 @@ void CRendererDX9::ApplyFog() {
|
|||
this->fog.dirty = 0;
|
||||
}
|
||||
|
||||
state.SetRenderState(D3DRS_FOGENABLE, this->fog.enabled);
|
||||
this->device->state.SetRenderState(D3DRS_FOGENABLE, this->fog.enabled);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,11 @@
|
|||
#include <cstddef>
|
||||
|
||||
struct DeviceStateDX9;
|
||||
struct _D3DCAPS9;
|
||||
|
||||
struct RendererFogDX9 {
|
||||
/* 0150 */ int enabled;
|
||||
/* 0154 */ int dirty;
|
||||
/* 0158 */ int supported;
|
||||
|
||||
void Set(int enabled, const _D3DCAPS9& caps);
|
||||
};
|
||||
|
||||
static_assert(sizeof(RendererFogDX9) == 12);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue