unkRoomFunc3 (bug #588501)
|Reported by:||SF/jamieson630||Owned by:||fingolfin|
The included patch file makes corrections to the partial patch supplied with bug report #588501. The patch was a partial implementation of unkRoomFunc3. After considerable trial and error, I discovered that the shadow palette had to be constructed using the room's default (CLUT) palette, rather than the current palette (which was darkened almost to black in one case study). This is true for both the palette that is scaled by the supplied factors, AND for the palette against which to compare the scaled color for a closest-match.
In addition, the start and end palette locations ARE significant in that they bound the area of the palette that can be used to search for closest-match colors. For example, FOA Room 48 (subway crashing into Atlantis entrance area) restricts the palette entries to be used for the headlight beam to be in the range of 160 - 191.
This patch has been tested with all four FOA rooms that have been identified as using this opcode (23, 48, 53 and 82). Everything looks good, although close pixel scrutiny revealed occassional and very subtle difference in the resulting palette entries used, compared to the output of the LEC executable.
Finally, I left the function name as is because I'm not sure what we want to call this operation. shadowManipulate?
Ticket imported from: #608543. Ticket imported from: patches/150.