1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 22:44:30 +00:00

Match Lights_Free (#333)

* Match Lights_Free

* Remove bug comment
This commit is contained in:
Roman971 2020-08-20 00:15:02 +02:00 committed by GitHub
parent 4ad461c797
commit 3a22219d5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 44 deletions

View file

@ -101,19 +101,14 @@ z_Light* Lights_FindFreeSlot() {
return ret;
}
#ifdef NON_MATCHING
// single ordering difference
void Lights_Free(z_Light* light) {
// return type must not be void to match
s32 Lights_Free(z_Light* light) {
if (light != NULL) {
sLightsList.numOccupied--;
light->info = NULL;
sLightsList.nextFree = (light - sLightsList.lights) /
sizeof(z_Light); //! @bug Due to pointer arithmetic, the division is unnecessary
sLightsList.nextFree = (light - sLightsList.lights) / sizeof(z_Light);
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/Lights_Free.s")
#endif
void func_8007A614(GlobalContext* globalCtx, LightingContext* lightCtx) {
Lights_ClearHead(globalCtx, lightCtx);