Skip to content

Commit

Permalink
fix crash with missing matfx matrices; stop wood from spray blood drops
Browse files Browse the repository at this point in the history
  • Loading branch information
aap committed Jun 6, 2020
1 parent 988fc5f commit 926616a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/buildingPipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ CCustomBuildingDNPipeline__CustomPipeRenderCB_PS2(RwResEntry *repEntry, void *ob
int effect = RpMatFXMaterialGetEffects(material);
if(effect == rpMATFXEFFECTUVTRANSFORM){
RpMatFXMaterialGetUVTransformMatrices(material, &m1, &m2);
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
if(m1)
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
else
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);
}else
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);

Expand Down Expand Up @@ -327,7 +330,10 @@ CCustomBuildingDNPipeline__CustomPipeRenderCB_Xbox(RwResEntry *repEntry, void *o
int effect = RpMatFXMaterialGetEffects(material);
if(effect == rpMATFXEFFECTUVTRANSFORM){
RpMatFXMaterialGetUVTransformMatrices(material, &m1, &m2);
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
if(m1)
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
else
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);
}else
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);

Expand Down Expand Up @@ -439,7 +445,10 @@ CCustomBuildingDNPipeline__CustomPipeRenderCB_Sphere(RwResEntry *repEntry, void
int effect = RpMatFXMaterialGetEffects(material);
if(effect == rpMATFXEFFECTUVTRANSFORM){
RpMatFXMaterialGetUVTransformMatrices(material, &m1, &m2);
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
if(m1)
RwD3D9SetVertexShaderConstant(REG_texmat, m1, 4);
else
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);
}else
RwD3D9SetVertexShaderConstant(REG_texmat, &ident, 4);

Expand Down
2 changes: 1 addition & 1 deletion src/neoWaterdrops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ hookWaterDrops()
//injector::MakeCALL(0x5E37AF, f2, true); // "prt_splash"
//injector::MakeCALL(0x5E3782, f2, true); // "prt_splash"
injector::MakeCALL(0x49FEEE, f2, true); // "prt_boatsplash"
injector::MakeCALL(0x49F01F, f2, true); // "prt_blood"
//injector::MakeCALL(0x49F01F, f2, true); // "prt_blood"
injector::MakeCALL(0x49EC92, f2, true); // "prt_blood"

//chainsaw
Expand Down

0 comments on commit 926616a

Please sign in to comment.