isledecomp / isle

A work-in-progress decompilation of LEGO Island (1997)
1.78k stars 89 forks source link

Use alias functions from Lego3DManager #1167

Closed disinvite closed 5 days ago

disinvite commented 5 days ago

Lego3DView provides four functions: Add, Remove, SetPointOfView, and Moved. Lego3DManager has the same four functions: they are an alias to Lego3DView via the m_pLego3DView member.

The typical use case is:

VideoManager()->Get3DManager()->GetLego3DView()->Remove(*roi);
VideoManager()->Get3DManager()->GetLego3DView()->Add(*roi);

The beta shows that the Lego3DView functions are rarely called directly, so we get:

VideoManager()->Get3DManager()->Remove(*roi);
VideoManager()->Get3DManager()->Add(*roi);

I fixed this anywhere the beta supported fixing it, and put in addresses for the calling functions. The exception is Lego3DView::Moved, which is called directly in a few places. Those are marked too.

LegoModelPresenter::FUN_1007ff70 should be an effective match, but swapping ebp in place of ebx makes two of the instructions one byte larger. The tools don't detect that we are jumping to the same instruction.