pass actor to FModelRenderer::SetMaterial

This commit is contained in:
Ricardo Luís Vaz Silva 2025-01-10 19:49:35 -03:00 committed by Magnus Norddahl
commit 8c3268ae1c
17 changed files with 25 additions and 23 deletions

View file

@ -630,7 +630,7 @@ int FOBJModel::FindFrame(const char* name, bool nodefault)
* @param inter The amount to interpolate the two frames.
* @param translation The translation for the skin
*/
void FOBJModel::RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int frameno, int frameno2, double inter, FTranslationID translation, const FTextureID* surfaceskinids, const TArray<VSMatrix>& boneData, int boneStartPosition)
void FOBJModel::RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int frameno, int frameno2, double inter, FTranslationID translation, const FTextureID* surfaceskinids, const TArray<VSMatrix>& boneData, int boneStartPosition, AActor * act)
{
// Prevent the model from rendering if the frame number is < 0
if (frameno < 0 || frameno2 < 0) return;
@ -658,7 +658,7 @@ void FOBJModel::RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int f
continue;
}
renderer->SetMaterial(userSkin, false, translation);
renderer->SetMaterial(userSkin, false, translation, act);
renderer->SetupFrame(this, surf->vbStart, surf->vbStart, surf->numTris * 3, {}, -1);
renderer->DrawArrays(0, surf->numTris * 3);
}