Skip to content

Commit 03b3131

Browse files
authored
Draw smoke particles with fog enabled (#1186)
1 parent 55ab783 commit 03b3131

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Common/Settings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
visit(SetSixtyFPS, true) \
135135
visit(SetSwapEffectUpgradeShim, false) \
136136
visit(ShowerRoomFlashlightFix, true) \
137+
visit(SmokeFogFix, true) \
137138
visit(Southpaw, false) \
138139
visit(SpecificSoundLoopFix, true) \
139140
visit(SpecularFix, true) \
@@ -281,6 +282,7 @@
281282
visit(ShowerRoomFlashlightFix) \
282283
visit(SmallFontHeight) \
283284
visit(SmallFontWidth) \
285+
visit(SmokeFogFix) \
284286
visit(SpaceSize) \
285287
visit(water_spec_mult_apt_staircase) \
286288
visit(water_spec_mult_strange_area) \

Wrappers/d3d8/IDirect3DDevice8.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,6 +2569,17 @@ HRESULT m_IDirect3DDevice8::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT
25692569
}
25702570
}
25712571

2572+
// Draw smoke particles with fog enabled
2573+
if (SmokeFogFix && PrimitiveType == D3DPT_TRIANGLESTRIP && PrimitiveCount == 2 && VertexStreamZeroStride == 24 &&
2574+
pVertexStreamZeroData && GetEventIndex() == EVENT_IN_GAME)
2575+
{
2576+
CUSTOMVERTEX_TEX1 *pVertex = (CUSTOMVERTEX_TEX1*)pVertexStreamZeroData;
2577+
if (fabs(pVertex[0].x + 200.0f) < 1e-6 && fabs(pVertex[0].y + 400.0f) < 1e-6) {
2578+
ProxyInterface->SetRenderState(D3DRS_FOGENABLE, TRUE);
2579+
ProxyInterface->SetRenderState(D3DRS_FOGTABLEMODE, D3DFOG_LINEAR);
2580+
}
2581+
}
2582+
25722583
return ProxyInterface->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
25732584
}
25742585

0 commit comments

Comments
 (0)