HackerN64 / HackerSM64

A Super Mario 64 decompilation repo based on CrashOveride95/ultrasm64 that aims to provide a flexible, easy-to-use base for creating romhacks.
351 stars 160 forks source link

Fix lighting engine by removing duplicate setup_global_light call #839

Closed Reonu closed 2 months ago

Reonu commented 2 months ago

This function was erroneously being called twice, which caused the directional light color to break, but the direction still worked, which was confusing. I removed the duplicate call. Here is Wiseguy's explanation of the issue:

This is supposed to only be called in the game loop, before reading the controller inputs, so that it's one of the first things in the frame, thus allowing one to set the directional lighting almost anywhere in the code with no issue. But the duplicate call was resetting the global light color.