Continued from the previous entry
In the last post, we examined the sectors and setups in the set files for EMI and GRIM and identified the problem spot.
In the ResisdualVM source, these are the places where the substring check of the sector name is used:
In the last post, we examined the sectors and setups in the set files for EMI and GRIM and identified the problem spot.
In the ResisdualVM source, these are the places where the substring check of the sector name is used:
- Actor::setShadowPlane (called from Lua_V1::SetActorShadowPlane)
- Lua_V1::IsPointInSector
- Lua_V1::IsActorInSector
- Lua_V1::GetSectorOppositeEdge
After a bunch of decompilation and poking through the game with a debugger, I found that for GRIM:
- SetActorShadowPlane appears to use an exact string comparison
- IsPointInSector uses a substring check (_strstr)
- IsActorInSector uses a substring check (_strstr)
- GetSectorOppositeEdge appears to use an exact string comparison
The functions SetActorShadowPlane and GetSectorOppositeEdge both use a byte by byte comparison to check the string equality.
In EMI, in the original retail version:
With all of this information, I can finally say that the updated PR should have the correct behavior for both GRIM and EMI. Whew, that was a lot of work for very little code contribution! Hopefully next week is more productive!
- SetActorShadowPlane is not present in EMI
- IsPointInSector is not used in the EMI game scripts
- IsActorInSector appears to use an exact string comparison
- GetSectorOppositeEdge appears to use an exact string comparison
With all of this information, I can finally say that the updated PR should have the correct behavior for both GRIM and EMI. Whew, that was a lot of work for very little code contribution! Hopefully next week is more productive!
No comments:
Post a Comment