diff --git a/src/game/bg.c b/src/game/bg.c index c8244fb07..b9de243b9 100644 --- a/src/game/bg.c +++ b/src/game/bg.c @@ -182,7 +182,7 @@ void roomSetOnscreen(s32 roomnum, s32 draworder, struct screenbox *box) g_Rooms[roomnum].flags |= ROOMFLAG_ONSCREEN; #endif - if (g_Rooms[roomnum].flags & ROOMFLAG_0800) { + if (g_Rooms[roomnum].flags & ROOMFLAG_BBOXHACK) { box->xmin = var800a4640.unk2d0.box.xmin; box->ymin = var800a4640.unk2d0.box.ymin; box->xmax = var800a4640.unk2d0.box.xmax; @@ -249,10 +249,10 @@ void roomSetOnscreen(s32 roomnum, s32 draworder, struct screenbox *box) } } -void func0f158108(s32 roomnum, u8 *arg1, u8 *arg2) +void bgGetRoomBrightnessRange(s32 roomnum, u8 *min, u8 *max) { - *arg1 = g_BgRooms[roomnum].unk10; - *arg2 = g_BgRooms[roomnum].unk11; + *min = g_BgRooms[roomnum].br_light_min; + *max = g_BgRooms[roomnum].br_light_max; } struct var800a4640_00 *func0f158140(s32 roomnum) @@ -4513,8 +4513,8 @@ void bgLoadRoom(s32 roomnum) // Create vertex batches - these are used for hit detection bgFindRoomVtxBatches(roomnum); - g_Rooms[roomnum].flags |= ROOMFLAG_DIRTY; - g_Rooms[roomnum].flags |= ROOMFLAG_0200; + g_Rooms[roomnum].flags |= ROOMFLAG_LIGHTS_DIRTY; + g_Rooms[roomnum].flags |= ROOMFLAG_BRIGHTNESS_DIRTY_PERM; g_Rooms[roomnum].colours = NULL; diff --git a/src/game/bondview.c b/src/game/bondview.c index 0616fbc03..b10222e7d 100644 --- a/src/game/bondview.c +++ b/src/game/bondview.c @@ -1945,7 +1945,7 @@ Gfx *bviewDrawNvLens(Gfx *gdl) s32 viewtop = viGetViewTop(); s32 viewleft = viGetViewLeft(); s32 viewbottom = viewtop + viewheight; - s32 roomvalue; + s32 brightness; s32 y; var8007f840++; @@ -1962,10 +1962,10 @@ Gfx *bviewDrawNvLens(Gfx *gdl) var8009caed = 0x50; var8009caee = 0xc0; - roomvalue = func0f0009c0(g_Vars.currentplayer->prop->rooms[0]); + brightness = roomGetFinalBrightness(g_Vars.currentplayer->prop->rooms[0]); - if (roomvalue > 128) { - sky0f127334(roomvalue, roomvalue, roomvalue); + if (brightness > 128) { + sky0f127334(brightness, brightness, brightness); } if (g_Menus[g_Vars.currentplayerstats->mpindex].curdialog == NULL) { diff --git a/src/game/chraction.c b/src/game/chraction.c index b75bc1b7f..9fb5d7759 100644 --- a/src/game/chraction.c +++ b/src/game/chraction.c @@ -13305,7 +13305,7 @@ void chraTick(struct chrdata *chr) // Consider setting darkroomlist if (chr->prop && chr->aidarkroomlist >= 0 - && roomGetBrightness(chr->prop->rooms[0]) < 25 + && roomGetSettledLocalBrightness(chr->prop->rooms[0]) < 25 && ailistFindById(chr->aidarkroomlist) != chr->ailist) { chr->darkroomthing = true; } diff --git a/src/game/chraicommands.c b/src/game/chraicommands.c index a6652c9d9..8c94d1594 100644 --- a/src/game/chraicommands.c +++ b/src/game/chraicommands.c @@ -5832,7 +5832,8 @@ bool aiSetLights(void) roomSetLightsOn(roomnum, true); break; default: - roomSetLighting(roomnum, cmd[4], cmd[5], cmd[6], TICKS(cmd[7])); + roomSetLightOp(roomnum, cmd[4], cmd[5], cmd[6], TICKS(cmd[7])); + break; } } diff --git a/src/game/dlights.c b/src/game/dlights.c index 2264236e8..0a3e95f7b 100644 --- a/src/game/dlights.c +++ b/src/game/dlights.c @@ -84,12 +84,9 @@ u32 var80061450 = 0x00000000; u32 var80061454 = 0xffffffff; #if VERSION >= VERSION_NTSC_1_0 -s32 var80061458 = 0x00000000; -u32 var8006145c = 0x00000000; +s32 g_LightsPrevTickMode = 0; #endif -Lights1 var80061460 = gdSPDefLights1(0x96, 0x96, 0x96, 0xff, 0xff, 0xff, 0x4d, 0x4d, 0x2e); - u32 func0f000920(s32 portalnum1, s32 portalnum2) { if (portalnum1 != portalnum2) { @@ -107,40 +104,40 @@ struct light *roomGetLight(s32 roomnum, s32 lightnum) return (struct light *)&g_BgLightsFileData[(g_Rooms[roomnum].lightindex + lightnum) * 0x22]; } -u8 func0f0009c0(s32 roomnum) +u8 roomGetFinalBrightness(s32 roomnum) { - s32 value = g_Rooms[roomnum].unk52 + g_Rooms[roomnum].unk4b; + s32 brightness = g_Rooms[roomnum].br_flash + g_Rooms[roomnum].br_settled_regional; - if (value > 255) { - value = 255; + if (brightness > 255) { + brightness = 255; } - if (value < 0) { - value = 0; + if (brightness < 0) { + brightness = 0; } - return value; + return brightness; } -u8 func0f000a10(s32 roomnum) +u8 roomGetFinalBrightnessForPlayer(s32 roomnum) { - s32 value = g_Rooms[roomnum].unk52; + s32 brightness = g_Rooms[roomnum].br_flash; if (USINGDEVICE(DEVICE_NIGHTVISION) || USINGDEVICE(DEVICE_IRSCANNER)) { - value += var8009caec; + brightness += var8009caec; } else { - value += g_Rooms[roomnum].unk4b; + brightness += g_Rooms[roomnum].br_settled_regional; } - if (value > 255) { - value = 255; + if (brightness > 255) { + brightness = 255; } - if (value < 0) { - value = 0; + if (brightness < 0) { + brightness = 0; } - return value; + return brightness; } u8 func0f000b18(u32 arg0) @@ -148,69 +145,69 @@ u8 func0f000b18(u32 arg0) return 255; } -u8 func0f000b24(s32 roomnum) +u8 roomGetSettledRegionalBrightnessForPlayer(s32 roomnum) { - u32 value; + u32 brightness; if (USINGDEVICE(DEVICE_NIGHTVISION) || USINGDEVICE(DEVICE_IRSCANNER)) { return var8009caec; } - if (g_Rooms[roomnum].flags & ROOMFLAG_0040) { - value = g_Rooms[roomnum].unk4b; + if (g_Rooms[roomnum].flags & ROOMFLAG_BRIGHTNESS_CALCED) { + brightness = g_Rooms[roomnum].br_settled_regional; } else { - value = 255; + brightness = 255; } - return value; + return brightness; } -u8 roomGetBrightness(s32 room) +u8 roomGetSettledLocalBrightness(s32 room) { - return g_Rooms[room].brightness & 0xff; + return g_Rooms[room].br_settled_local & 0xff; } -s32 func0f000c54(s32 roomnum) +s32 roomGetFlashBrightness(s32 roomnum) { - if (g_Rooms[roomnum].unk52 > 255) { + if (g_Rooms[roomnum].br_flash > 255) { return 255; } - if (g_Rooms[roomnum].unk52 < 0) { + if (g_Rooms[roomnum].br_flash < 0) { return 0; } - return (g_Rooms[roomnum].flags & ROOMFLAG_0040) ? g_Rooms[roomnum].unk52 : 0; + return (g_Rooms[roomnum].flags & ROOMFLAG_BRIGHTNESS_CALCED) ? g_Rooms[roomnum].br_flash : 0; } -f32 roomGetUnk5c(s32 roomnum) +f32 roomGetLightOpCurFrac(s32 roomnum) { - return g_Rooms[roomnum].unk5c; + return g_Rooms[roomnum].lightop_cur_frac; } -f32 func0f000cec(s32 roomnum) +f32 roomGetFinalBrightnessFrac(s32 roomnum) { - f32 value = (g_Rooms[roomnum].unk52 + g_Rooms[roomnum].unk4b) / 0.0039215688593686f; + f32 frac = (g_Rooms[roomnum].br_flash + g_Rooms[roomnum].br_settled_regional) / (1.0f / 255.0f); - if (value > 1) { - value = 1; + if (frac > 1) { + frac = 1; } - if (value < 0) { - value = 0; + if (frac < 0) { + frac = 0; } - return value; + return frac; } -f32 func0f000d6c(s32 roomnum) +f32 roomGetSettledRegionalBrightnessFrac(s32 roomnum) { - return g_Rooms[roomnum].unk4b / 255.0f; + return g_Rooms[roomnum].br_settled_regional / 255.0f; } -f32 func0f000dbc(s32 roomnum) +f32 roomGetSettledLocalBrightnessFrac(s32 roomnum) { - return g_Rooms[roomnum].brightness / 255.0f; + return g_Rooms[roomnum].br_settled_local / 255.0f; } /** @@ -272,19 +269,19 @@ bool lightIsOn(s32 roomnum, s32 lightnum) return on; } -void roomSetUnk52(s32 roomnum, s32 value) +void roomSetFlashBrightness(s32 roomnum, s32 value) { - g_Rooms[roomnum].unk52 = value; + g_Rooms[roomnum].br_flash = value; } -void lightGetUnk07(s32 roomnum, u32 lightnum, struct coord *coord) +void lightGetDirection(s32 roomnum, u32 lightnum, struct coord *dir) { struct light *light = (struct light *)&g_BgLightsFileData[g_Rooms[roomnum].lightindex * 0x22]; light += lightnum; - coord->x = light->unk07; - coord->y = light->unk08; - coord->z = light->unk09; + dir->x = light->dirx; + dir->y = light->diry; + dir->z = light->dirz; } void func0f0010b4(void) @@ -298,28 +295,28 @@ void func0f0010b4(void) void roomSetDefaults(struct room *room) { - room->unk48 = 0; - room->unk49 = 255; - room->unk4a = 0; - room->brightness = 128; - room->unk52 = 0; - room->unk4b = 0; - room->lightop = 0; - room->flags &= ~(ROOMFLAG_0200 | ROOMFLAG_DIRTY | ROOMFLAG_RENDERALWAYS | ROOMFLAG_0040); + room->br_light_min = 0; + room->br_light_max = 255; + room->br_light_each = 0; + room->br_settled_local = 128; + room->br_flash = 0; + room->br_settled_regional = 0; + room->lightop = LIGHTOP_NONE; + room->flags &= ~(ROOMFLAG_BRIGHTNESS_DIRTY_PERM | ROOMFLAG_LIGHTS_DIRTY | ROOMFLAG_RENDERALWAYS | ROOMFLAG_BRIGHTNESS_CALCED); room->unk6c = 1; room->unk70 = 1; - room->unk5c = 1; - room->unk60 = 0; - room->unk64 = 0; - room->unk68 = 0; + room->lightop_cur_frac = 1; + room->lightop_to_frac = 0; + room->lightop_from_frac = 0; + room->lightop_duration240 = 0; } Gfx *lightsSetForRoom(Gfx *gdl, s16 roomnum) { Lights1 *lights = gfxAllocate(sizeof(Lights1)); - u8 v0 = func0f000a10(roomnum); - u8 a0 = (u32)(v0 * 0.5882353f); + u8 brightness = roomGetFinalBrightnessForPlayer(roomnum); + u8 a0 = (u32)(brightness * 0.5882353f); lights->a.l.col[0] = a0; lights->a.l.col[1] = a0; @@ -328,12 +325,12 @@ Gfx *lightsSetForRoom(Gfx *gdl, s16 roomnum) lights->a.l.colc[1] = a0; lights->a.l.colc[2] = a0; - lights->l[0].l.col[0] = v0; - lights->l[0].l.col[1] = v0; - lights->l[0].l.col[2] = v0; - lights->l[0].l.colc[0] = v0; - lights->l[0].l.colc[1] = v0; - lights->l[0].l.colc[2] = v0; + lights->l[0].l.col[0] = brightness; + lights->l[0].l.col[1] = brightness; + lights->l[0].l.col[2] = brightness; + lights->l[0].l.colc[0] = brightness; + lights->l[0].l.colc[1] = brightness; + lights->l[0].l.colc[2] = brightness; lights->l[0].l.dir[0] = 0x4d; lights->l[0].l.dir[1] = 0x4d; lights->l[0].l.dir[2] = 0x2e; @@ -348,6 +345,8 @@ Gfx *lightsSetForRoom(Gfx *gdl, s16 roomnum) Gfx *lightsSetDefault(Gfx *gdl) { + static Lights1 var80061460 = gdSPDefLights1(0x96, 0x96, 0x96, 0xff, 0xff, 0xff, 0x4d, 0x4d, 0x2e); + gSPSetLights1(gdl++, var80061460); gSPLookAtX(gdl++, &camGetLookAt()->l[0]); @@ -362,35 +361,35 @@ void roomInitLights(s32 roomnum) struct light *light; s32 i; - func0f158108(roomnum, &room->unk48, &room->unk49); + bgGetRoomBrightnessRange(roomnum, &room->br_light_min, &room->br_light_max); - room->unk48 = room->unk48 / 4; + room->br_light_min = room->br_light_min / 4; if (room->numlights) { - room->unk4a = (f32)(room->unk49 - room->unk48) / (f32)room->numlights; + room->br_light_each = (f32)(room->br_light_max - room->br_light_min) / (f32)room->numlights; } else { - room->unk4a = 0; + room->br_light_each = 0; } - if (room->unk48 > 255) { - room->unk48 = 255; + if (room->br_light_min > 255) { + room->br_light_min = 255; } - if (room->unk49 > 255) { - room->unk49 = 255; + if (room->br_light_max > 255) { + room->br_light_max = 255; } - room->unk4c = room->unk48; + room->br_base = room->br_light_min; if (room->numlights == 0) { - room->unk4c += (room->unk49 - room->unk48) * 4 / 5; + room->br_base += (room->br_light_max - room->br_light_min) * 4 / 5; } switch (g_Vars.stagenum) { case STAGE_EXTRACTION: case STAGE_DEFECTION: if (roomnum == 0x003d) { // near the top comms hub - room->unk4c = 2; + room->br_base = 2; } break; } @@ -410,12 +409,12 @@ void roomInitLights(s32 roomnum) room->flags &= ~ROOMFLAG_RENDERALWAYS; } - room->flags |= ROOMFLAG_DIRTY; + room->flags |= ROOMFLAG_LIGHTS_DIRTY; #if VERSION < VERSION_NTSC_1_0 if (cheatIsActive(CHEAT_PERFECTDARKNESS) && (room->flags & ROOMFLAG_RENDERALWAYS) == 0) { - room->lightop = LIGHTOP_1; - room->unk60 = 0.0f; + room->lightop = LIGHTOP_SET; + room->lightop_to_frac = 0.0f; } #endif @@ -424,8 +423,8 @@ void roomInitLights(s32 roomnum) for (i = 0; i < room->numlights; i++) { #if VERSION < VERSION_NTSC_1_0 if (cheatIsActive(CHEAT_PERFECTDARKNESS)) { - light->unk04 = 0; - light->unk05_00 = (random() % 2) ? true : false; + light->brightness = 0; + light->sparkable = (random() % 2) ? true : false; light->healthy = false; light->on = false; light->sparking = false; @@ -433,8 +432,8 @@ void roomInitLights(s32 roomnum) } else #endif { - light->unk04 = g_Rooms[roomnum].unk4a; - light->unk05_00 = true; + light->brightness = g_Rooms[roomnum].br_light_each; + light->sparkable = true; light->healthy = true; light->on = true; light->sparking = false; @@ -536,12 +535,12 @@ void roomSetLightsFaulty(s32 roomnum, s32 chance) } #if VERSION >= VERSION_NTSC_1_0 - g_Rooms[roomnum].unk4c = 50; + g_Rooms[roomnum].br_base = 50; #else - g_Rooms[roomnum].unk4c = 15; + g_Rooms[roomnum].br_base = 15; #endif - g_Rooms[roomnum].flags |= ROOMFLAG_DIRTY; + g_Rooms[roomnum].flags |= ROOMFLAG_LIGHTS_DIRTY; } void roomSetLightBroken(s32 roomnum, s32 lightnum) @@ -550,7 +549,7 @@ void roomSetLightBroken(s32 roomnum, s32 lightnum) light->healthy = false; light->on = false; - g_Rooms[roomnum].flags |= ROOMFLAG_DIRTY; + g_Rooms[roomnum].flags |= ROOMFLAG_LIGHTS_DIRTY; } void lightsReset(void) @@ -822,8 +821,8 @@ void func0f00259c(s32 roomnum) } if (sp58 < 0.1f) { - g_Rooms[roomnum].unk48 = g_Rooms[roomnum].unk49 >> 1; - var80061434[roomnum] = g_Rooms[roomnum].unk49; + g_Rooms[roomnum].br_light_min = g_Rooms[roomnum].br_light_max >> 1; + var80061434[roomnum] = g_Rooms[roomnum].br_light_max; } } @@ -877,7 +876,7 @@ void func0f002a98(void) var8009cae0 = align4(g_Vars.roomcount); #if VERSION >= VERSION_NTSC_1_0 - var80061458 = 0; + g_LightsPrevTickMode = 0; #endif g_Vars.remakewallhitvtx = 0; @@ -886,7 +885,7 @@ void func0f002a98(void) roomInitLights(i); } - var80061420 = 0; + var80061420 = NULL; if (IS4MB()) { var80061444 = 0; @@ -914,37 +913,42 @@ void roomSetLightsOn(s32 roomnum, s32 enable) g_Rooms[roomnum].flags |= ROOMFLAG_LIGHTSOFF; } - g_Rooms[roomnum].flags |= ROOMFLAG_DIRTY; + g_Rooms[roomnum].flags |= ROOMFLAG_LIGHTS_DIRTY; } -void roomSetLighting(s32 roomnum, s32 operation, u8 arg2, u8 arg3, u8 arg4) +/** + * @bug: The lightop_timer240 values are not set correctly. + * They should be duration60 * 4. This only affects LIGHTOP_TRANSITION, + * which makes it start the transition 3/4 of the way into it. + */ +void roomSetLightOp(s32 roomnum, s32 operation, u8 br_to, u8 br_from, u8 duration60) { if (cheatIsActive(CHEAT_PERFECTDARKNESS) == false) { g_Rooms[roomnum].lightop = operation; switch (operation) { - case LIGHTOP_1: - g_Rooms[roomnum].unk60 = arg2 * 0.01f; + case LIGHTOP_SET: + g_Rooms[roomnum].lightop_to_frac = br_to * 0.01f; break; - case LIGHTOP_2: - g_Rooms[roomnum].unk60 = arg2; - g_Rooms[roomnum].unk64 = arg3 * 0.01f; - g_Rooms[roomnum].unk68 = arg4 * 4.0f; - g_Rooms[roomnum].unk54 = arg4; + case LIGHTOP_SETRANDOM: + g_Rooms[roomnum].lightop_to_frac = br_to; + g_Rooms[roomnum].lightop_from_frac = br_from * 0.01f; + g_Rooms[roomnum].lightop_duration240 = duration60 * 4.0f; + g_Rooms[roomnum].lightop_timer240 = duration60; break; - case LIGHTOP_3: - g_Rooms[roomnum].unk60 = arg2 * 0.01f; - g_Rooms[roomnum].unk64 = arg3 * 0.01f; - g_Rooms[roomnum].unk68 = arg4 * 4.0f; - g_Rooms[roomnum].unk54 = arg4; + case LIGHTOP_TRANSITION: + g_Rooms[roomnum].lightop_to_frac = br_to * 0.01f; + g_Rooms[roomnum].lightop_from_frac = br_from * 0.01f; + g_Rooms[roomnum].lightop_duration240 = duration60 * 4.0f; + g_Rooms[roomnum].lightop_timer240 = duration60; break; - case LIGHTOP_4: - g_Rooms[roomnum].unk60 = arg2 * 0.01f; - g_Rooms[roomnum].unk64 = arg3 * 0.01f; - g_Rooms[roomnum].unk68 = arg4 * 4.0f; - g_Rooms[roomnum].unk54 = 0; + case LIGHTOP_SINELOOP: + g_Rooms[roomnum].lightop_to_frac = br_to * 0.01f; + g_Rooms[roomnum].lightop_from_frac = br_from * 0.01f; + g_Rooms[roomnum].lightop_duration240 = duration60 * 4.0f; + g_Rooms[roomnum].lightop_timer240 = 0; break; - case LIGHTOP_5: + case LIGHTOP_HIGHLIGHT: break; } } @@ -1219,7 +1223,7 @@ glabel lightTickBroken .L0f0032ec: /* f0032ec: 8fa400d8 */ lw $a0,0xd8($sp) /* f0032f0: 24050040 */ addiu $a1,$zero,0x40 -/* f0032f4: 0fc010e3 */ jal roomAdjustLighting +/* f0032f4: 0fc010e3 */ jal roomFlashLighting /* f0032f8: 24060050 */ addiu $a2,$zero,0x50 /* f0032fc: 0fc25480 */ jal propsndGetRandomSparkSound /* f003300: 00000000 */ nop @@ -1538,7 +1542,7 @@ glabel lightTickBroken .L0f0032ec: /* f0032ec: 8fa400d8 */ lw $a0,0xd8($sp) /* f0032f0: 24050040 */ addiu $a1,$zero,0x40 -/* f0032f4: 0fc010e3 */ jal roomAdjustLighting +/* f0032f4: 0fc010e3 */ jal roomFlashLighting /* f0032f8: 24060050 */ addiu $a2,$zero,0x50 /* f0032fc: 0fc25480 */ jal propsndGetRandomSparkSound /* f003300: 00000000 */ nop @@ -1610,7 +1614,7 @@ bool lightTickBroken(s32 roomnum, s32 lightnum) f32 rand2; // 6c s32 sparktype; // 68 - if (!light->unk05_00) { + if (!light->sparkable) { return false; } @@ -1643,9 +1647,9 @@ bool lightTickBroken(s32 roomnum, s32 lightnum) sp98.y = light->bbox[0].x + spc8.y + spbc.y; sp98.z = light->bbox[0].x + spc8.z + spbc.z; - sp8c.x = light->unk07; - sp8c.y = light->unk08; - sp8c.z = light->unk09; + sp8c.x = light->dirx; + sp8c.y = light->diry; + sp8c.z = light->dirz; sp80.x = -sp8c.f[0]; sp80.y = -sp8c.f[1]; @@ -1695,7 +1699,7 @@ bool lightTickBroken(s32 roomnum, s32 lightnum) smokeCreateSimple(¢re, smokerooms, SMOKETYPE_BULLETIMPACT); } - roomAdjustLighting(roomnum, 0x40, 0x50); + roomFlashLighting(roomnum, 0x40, 0x50); propsnd0f0939f8(NULL, NULL, propsndGetRandomSparkSound(), -1, -1, 0x400, 0, 0x10, ¢re, -1.0f, 0, roomnum, -1.0f, -1.0f, -1.0f); return true; } @@ -1730,7 +1734,7 @@ void lightingTick(void) { s32 i; - func0f0037ac(); + roomsTickLighting(); if (g_Vars.remakewallhitvtx) { wallhitsRecolour(); @@ -1738,29 +1742,29 @@ void lightingTick(void) g_Vars.remakewallhitvtx = false; for (i = 1; i < g_Vars.roomcount; i++) { - g_Rooms[i].flags &= ~ROOMFLAG_1000; + g_Rooms[i].flags &= ~ROOMFLAG_NEEDRESHADE; } } } #if VERSION >= VERSION_NTSC_1_0 -void func0f003444(void) +void lightsConfigureForPerfectDarknessCutscene(void) { s32 i; s32 j; for (i = 0; i < g_Vars.roomcount; i++) { struct light *light = (struct light *)&g_BgLightsFileData[g_Rooms[i].lightindex * 0x22]; - g_Rooms[i].lightop = LIGHTOP_1; - g_Rooms[i].unk60 = 0.5f; + g_Rooms[i].lightop = LIGHTOP_SET; + g_Rooms[i].lightop_to_frac = 0.5f; for (j = 0; j < g_Rooms[i].numlights; j++) { - light->unk05_00 = random() % 2 ? true : false; + light->sparkable = random() % 2 ? true : false; light->healthy = true; light->on = true; light->sparking = false; light->vulnerable = true; - light->unk04 = g_Rooms[i].unk4a; + light->brightness = g_Rooms[i].br_light_each; light++; } @@ -1769,23 +1773,23 @@ void func0f003444(void) #endif #if VERSION >= VERSION_NTSC_1_0 -void func0f0035c0(void) +void lightsConfigureForPerfectDarknessGameplay(void) { s32 i; s32 j; for (i = 0; i < g_Vars.roomcount; i++) { struct light *light = (struct light *)&g_BgLightsFileData[g_Rooms[i].lightindex * 0x22]; - g_Rooms[i].lightop = LIGHTOP_1; - g_Rooms[i].unk60 = 0; + g_Rooms[i].lightop = LIGHTOP_SET; + g_Rooms[i].lightop_to_frac = 0; for (j = 0; j < g_Rooms[i].numlights; j++) { - light->unk05_00 = random() % 2 ? true : false; + light->sparkable = random() % 2 ? true : false; light->healthy = false; light->on = false; light->sparking = false; light->vulnerable = false; - light->unk04 = 0; + light->brightness = 0; light++; } @@ -1794,21 +1798,21 @@ void func0f0035c0(void) #endif #if VERSION >= VERSION_NTSC_1_0 -void func0f00372c(void) +void lightsTickPerfectDarkness(void) { - if (g_Vars.tickmode != var80061458) { - if (TICKMODE_CUTSCENE == g_Vars.tickmode && TICKMODE_CUTSCENE != var80061458) { - func0f003444(); - } else if (TICKMODE_NORMAL == g_Vars.tickmode && TICKMODE_NORMAL != var80061458) { - func0f0035c0(); + if (g_Vars.tickmode != g_LightsPrevTickMode) { + if (TICKMODE_CUTSCENE == g_Vars.tickmode && TICKMODE_CUTSCENE != g_LightsPrevTickMode) { + lightsConfigureForPerfectDarknessCutscene(); + } else if (TICKMODE_NORMAL == g_Vars.tickmode && TICKMODE_NORMAL != g_LightsPrevTickMode) { + lightsConfigureForPerfectDarknessGameplay(); } - var80061458 = g_Vars.tickmode; + g_LightsPrevTickMode = g_Vars.tickmode; } } #endif -void func0f0037ac(void) +void roomsTickLighting(void) { #if VERSION >= VERSION_NTSC_1_0 s32 i; @@ -1821,14 +1825,14 @@ void func0f0037ac(void) bool wasdirty = false; struct light *light; f32 amount; - s32 v1; + s32 timer240; f32 angle; f32 average; u32 stack; #if VERSION >= VERSION_NTSC_1_0 if (cheatIsActive(CHEAT_PERFECTDARKNESS)) { - func0f00372c(); + lightsTickPerfectDarkness(); } #else static s32 prevtickmode = 0; @@ -1847,77 +1851,79 @@ void func0f0037ac(void) } for (i = 1; i < g_Vars.roomcount; i++) { - g_Rooms[i].flags &= ~ROOMFLAG_0400; + g_Rooms[i].flags &= ~ROOMFLAG_BRIGHTNESS_DIRTY_TEMP; } for (i = 1; i < g_Vars.roomcount; i++) { - g_Rooms[i].unk54 -= g_Vars.lvupdate240; + // Tick any light operations + g_Rooms[i].lightop_timer240 -= g_Vars.lvupdate240; switch (g_Rooms[i].lightop) { - case LIGHTOP_1: - g_Rooms[i].unk5c = g_Rooms[i].unk60; + case LIGHTOP_SET: + g_Rooms[i].lightop_cur_frac = g_Rooms[i].lightop_to_frac; - if (g_Rooms[i].unk5c < 0.0f) { - g_Rooms[i].unk5c = 0.0f; + if (g_Rooms[i].lightop_cur_frac < 0.0f) { + g_Rooms[i].lightop_cur_frac = 0.0f; } - g_Rooms[i].flags |= ROOMFLAG_DIRTY; - roomSetLighting(i, 0, 0, 0, 0); + g_Rooms[i].flags |= ROOMFLAG_LIGHTS_DIRTY; + roomSetLightOp(i, LIGHTOP_NONE, 0, 0, 0); break; - case LIGHTOP_2: - if (g_Rooms[i].unk54 < 0) { - if (RANDOMFRAC() * 100.0f < g_Rooms[i].unk60) { - g_Rooms[i].unk5c = 1.0f; + case LIGHTOP_SETRANDOM: + if (g_Rooms[i].lightop_timer240 < 0) { + if (RANDOMFRAC() * 100.0f < g_Rooms[i].lightop_to_frac) { + g_Rooms[i].lightop_cur_frac = 1.0f; } else { - g_Rooms[i].unk5c = g_Rooms[i].unk64; + g_Rooms[i].lightop_cur_frac = g_Rooms[i].lightop_from_frac; - if (g_Rooms[i].unk5c < 0.0f) { - g_Rooms[i].unk5c = 0.0f; + if (g_Rooms[i].lightop_cur_frac < 0.0f) { + g_Rooms[i].lightop_cur_frac = 0.0f; } } - g_Rooms[i].unk54 = g_Rooms[i].unk68; - g_Rooms[i].flags |= ROOMFLAG_DIRTY; + g_Rooms[i].lightop_timer240 = g_Rooms[i].lightop_duration240; + g_Rooms[i].flags |= ROOMFLAG_LIGHTS_DIRTY; } break; - case LIGHTOP_3: - if (g_Rooms[i].unk54 > 0) { - g_Rooms[i].unk5c = g_Rooms[i].unk64; - g_Rooms[i].unk5c += g_Rooms[i].unk54 / g_Rooms[i].unk68 * (g_Rooms[i].unk60 - g_Rooms[i].unk64); + case LIGHTOP_TRANSITION: + if (g_Rooms[i].lightop_timer240 > 0) { + g_Rooms[i].lightop_cur_frac = g_Rooms[i].lightop_from_frac; + g_Rooms[i].lightop_cur_frac += g_Rooms[i].lightop_timer240 / g_Rooms[i].lightop_duration240 * (g_Rooms[i].lightop_to_frac - g_Rooms[i].lightop_from_frac); - if (g_Rooms[i].unk5c < 0.0f) { - g_Rooms[i].unk5c = 0.0f; + if (g_Rooms[i].lightop_cur_frac < 0.0f) { + g_Rooms[i].lightop_cur_frac = 0.0f; } } else { - roomSetLighting(i, 0, 0, 0, 0); + roomSetLightOp(i, LIGHTOP_NONE, 0, 0, 0); } - g_Rooms[i].flags |= ROOMFLAG_DIRTY; + g_Rooms[i].flags |= ROOMFLAG_LIGHTS_DIRTY; break; - case LIGHTOP_4: - v1 = g_Rooms[i].unk54 > 0 ? g_Rooms[i].unk54 : -g_Rooms[i].unk54; + case LIGHTOP_SINELOOP: + timer240 = g_Rooms[i].lightop_timer240 > 0 ? g_Rooms[i].lightop_timer240 : -g_Rooms[i].lightop_timer240; - angle = (v1 % (s32) g_Rooms[i].unk68) * M_TAU / g_Rooms[i].unk68; - average = (g_Rooms[i].unk60 + g_Rooms[i].unk64) * 0.5f; + angle = (timer240 % (s32) g_Rooms[i].lightop_duration240) * M_TAU / g_Rooms[i].lightop_duration240; + average = (g_Rooms[i].lightop_to_frac + g_Rooms[i].lightop_from_frac) * 0.5f; - g_Rooms[i].unk5c = g_Rooms[i].unk60 + (cosf(angle) + 1.0f) * average; + g_Rooms[i].lightop_cur_frac = g_Rooms[i].lightop_to_frac + (cosf(angle) + 1.0f) * average; - if (g_Rooms[i].unk5c < 0.0f) { - g_Rooms[i].unk5c = 0.0f; + if (g_Rooms[i].lightop_cur_frac < 0.0f) { + g_Rooms[i].lightop_cur_frac = 0.0f; } - g_Rooms[i].flags |= ROOMFLAG_DIRTY; + g_Rooms[i].flags |= ROOMFLAG_LIGHTS_DIRTY; break; - case LIGHTOP_5: - g_Rooms[i].flags |= ROOMFLAG_DIRTY; + case LIGHTOP_HIGHLIGHT: + g_Rooms[i].flags |= ROOMFLAG_LIGHTS_DIRTY; break; } if (g_IsSwitchingGoggles) { - g_Rooms[i].flags |= ROOMFLAG_DIRTY; + g_Rooms[i].flags |= ROOMFLAG_LIGHTS_DIRTY; } - if (g_Rooms[i].flags & ROOMFLAG_DIRTY) { + if (g_Rooms[i].flags & ROOMFLAG_LIGHTS_DIRTY) { + // Calculate the settled local brightness if (g_Rooms[i].numlights != 0) { s32 numlightson = 0; struct light *light = (struct light *)&g_BgLightsFileData[g_Rooms[i].lightindex * 0x22]; @@ -1933,43 +1939,45 @@ void func0f0037ac(void) if (g_Rooms[i].flags & ROOMFLAG_LIGHTSOFF) { amount = 2.0f; } else if (numlightson != 0) { - amount = g_Rooms[i].unk4c; + amount = g_Rooms[i].br_base; } else { - amount = (f32)g_Rooms[i].unk4c / 2; + amount = (f32)g_Rooms[i].br_base / 2; } } else { if (g_Rooms[i].flags & ROOMFLAG_LIGHTSOFF) { amount = 2.0f; } else { - amount = g_Rooms[i].unk4c; + amount = g_Rooms[i].br_base; } } - amount *= g_Rooms[i].unk5c; - g_Rooms[i].brightness = amount; + amount *= g_Rooms[i].lightop_cur_frac; + g_Rooms[i].br_settled_local = amount; + // Add brightness for each light that is on light = (struct light *)&g_BgLightsFileData[g_Rooms[i].lightindex * 0x22]; for (j = 0; j < g_Rooms[i].numlights; j++) { if (light->on) { - amount = g_Rooms[i].unk5c * light->unk04; - g_Rooms[i].brightness += (s32)amount; + amount = g_Rooms[i].lightop_cur_frac * light->brightness; + g_Rooms[i].br_settled_local += (s32)amount; } light++; } - if (g_Rooms[i].brightness > 255) { - g_Rooms[i].brightness = 255; + if (g_Rooms[i].br_settled_local > 255) { + g_Rooms[i].br_settled_local = 255; } - g_Rooms[i].flags &= ~ROOMFLAG_DIRTY; + g_Rooms[i].flags &= ~ROOMFLAG_LIGHTS_DIRTY; wasdirty = 1; } - if (g_Rooms[i].unk52 != 0) { - s32 updaterate = g_Vars.lvupdate240 * 2; + // Tick any flash lighting + if (g_Rooms[i].br_flash != 0) { + s32 increment = g_Vars.lvupdate240 * 2; if (var80061420 != NULL) { s32 spa0 = 0; @@ -1979,43 +1987,48 @@ void func0f0037ac(void) while (ret != -1) { if (ret != 0) { - g_Rooms[sp9c].flags |= ROOMFLAG_0400; + g_Rooms[sp9c].flags |= ROOMFLAG_BRIGHTNESS_DIRTY_TEMP; } ret = func0f177c8c(var80061420[i].unk04, &spa0, &sp9c); } } - if (g_Rooms[i].unk52 > 0) { - if (g_Rooms[i].unk52 < updaterate) { - updaterate = g_Rooms[i].unk52; + if (g_Rooms[i].br_flash > 0) { + if (increment > g_Rooms[i].br_flash) { + increment = g_Rooms[i].br_flash; } - g_Rooms[i].unk52 -= updaterate; + g_Rooms[i].br_flash -= increment; } else { - if (g_Rooms[i].unk52 > updaterate) { - updaterate = g_Rooms[i].unk52; + // @bug: In this branch br_flash is zero or negative. + // Both instances of br_flash should be negated here. + if (increment < g_Rooms[i].br_flash) { + increment = g_Rooms[i].br_flash; } - g_Rooms[i].unk52 += updaterate; + g_Rooms[i].br_flash += increment; } - g_Rooms[i].flags |= ROOMFLAG_0400; + g_Rooms[i].flags |= ROOMFLAG_BRIGHTNESS_DIRTY_TEMP; } - g_Rooms[i].flags &= ~ROOMFLAG_DIRTY; + g_Rooms[i].flags &= ~ROOMFLAG_LIGHTS_DIRTY; } + // If switching googles, mark all rooms as dirty so their brightness will be + // recalculated the next time they appear on screen. if (g_IsSwitchingGoggles || wasdirty) { for (i = 1; i < g_Vars.roomcount; i++) { - g_Rooms[i].flags |= ROOMFLAG_0200; + g_Rooms[i].flags |= ROOMFLAG_BRIGHTNESS_DIRTY_PERM; } } + // Calculate settled regional lighting for any rooms that need it for (i = 1; i < g_Vars.roomcount; i++) { if (i != 0) { if ((g_Rooms[i].flags & ROOMFLAG_RENDERALWAYS) || (g_Rooms[i].flags & (ROOMFLAG_ONSCREEN | ROOMFLAG_STANDBY))) { - if (g_Rooms[i].flags & (ROOMFLAG_0200 | ROOMFLAG_0400)) { + if (g_Rooms[i].flags & (ROOMFLAG_BRIGHTNESS_DIRTY_PERM | ROOMFLAG_BRIGHTNESS_DIRTY_TEMP)) { s32 sum = 0; s32 sp90 = 0; s32 sp8c = 0; @@ -2027,7 +2040,7 @@ void func0f0037ac(void) s32 add = 0; if (sp8c) { - add += (s32)((1.0f / 255.0f) * ret * g_Rooms[sp8c].brightness); + add += (s32)((1.0f / 255.0f) * ret * g_Rooms[sp8c].br_settled_local); } sum += add; @@ -2040,27 +2053,25 @@ void func0f0037ac(void) sum = 255; } - g_Rooms[i].unk4b = sum; - g_Rooms[i].flags |= ROOMFLAG_0040; - g_Rooms[i].flags |= ROOMFLAG_1000; - g_Rooms[i].flags &= ~(ROOMFLAG_0200 | ROOMFLAG_0400); + g_Rooms[i].br_settled_regional = sum; + g_Rooms[i].flags |= ROOMFLAG_BRIGHTNESS_CALCED; + g_Rooms[i].flags |= ROOMFLAG_NEEDRESHADE; + g_Rooms[i].flags &= ~(ROOMFLAG_BRIGHTNESS_DIRTY_PERM | ROOMFLAG_BRIGHTNESS_DIRTY_TEMP); - if (g_Rooms[i].lightop == LIGHTOP_5) { - s32 sp80; - s32 sp7c; - s32 sp78; + if (g_Rooms[i].lightop == LIGHTOP_HIGHLIGHT) { + s32 r = roomGetFinalBrightnessForPlayer(i); + s32 g = r; + s32 b = r; - sp78 = sp7c = sp80 = func0f000a10(i); + scenarioHighlightRoom(i, &r, &g, &b); - scenarioHighlightRoom(i, &sp80, &sp7c, &sp78); - - g_Rooms[i].unk74 = sp80 * (1.0f / 255.0f); - g_Rooms[i].unk78 = sp7c * (1.0f / 255.0f); - g_Rooms[i].unk7c = sp78 * (1.0f / 255.0f); + g_Rooms[i].highlightfrac_r = r * (1.0f / 255.0f); + g_Rooms[i].highlightfrac_g = g * (1.0f / 255.0f); + g_Rooms[i].highlightfrac_b = b * (1.0f / 255.0f); } else { - g_Rooms[i].unk74 = func0f000a10(i) * (1.0f / 255.0f); - g_Rooms[i].unk78 = g_Rooms[i].unk74; - g_Rooms[i].unk7c = g_Rooms[i].unk74; + g_Rooms[i].highlightfrac_r = roomGetFinalBrightnessForPlayer(i) * (1.0f / 255.0f); + g_Rooms[i].highlightfrac_g = g_Rooms[i].highlightfrac_r; + g_Rooms[i].highlightfrac_b = g_Rooms[i].highlightfrac_r; } numprocessed++; @@ -2075,7 +2086,7 @@ void func0f0037ac(void) while (prop) { if (prop->type == PROPTYPE_CHR) { for (i = 0; prop->rooms[i] != -1; i++) { - if (g_Rooms[prop->rooms[i]].flags & ROOMFLAG_1000) { + if (g_Rooms[prop->rooms[i]].flags & ROOMFLAG_NEEDRESHADE) { if (2 == g_IsSwitchingGoggles) { struct chrdata *chr = prop->chr; propCalculateShadeColour(chr->prop, chr->nextcol, chr->floorcol); @@ -2106,7 +2117,7 @@ void lightsTick(void) func0f005bb0(); if (hand1->flashon || hand2->flashon) { - roomAdjustLighting(g_Vars.currentplayer->prop->rooms[0], 64, 80); + roomFlashLighting(g_Vars.currentplayer->prop->rooms[0], 64, 80); } } @@ -2115,7 +2126,12 @@ void func0f004384(void) // empty } -void roomAdjustLighting(s32 roomnum, s32 start, s32 limit) +/** + * Set a lighting flash in the given room and its neighbours. + * + * The room must not have ROOMFLAG_OUTDOORS. + */ +void roomFlashLighting(s32 roomnum, s32 start, s32 limit) { if (var80061420 && !(g_Rooms[roomnum].flags & ROOMFLAG_OUTDOORS ? 1 : 0)) { s32 value; @@ -2125,7 +2141,7 @@ void roomAdjustLighting(s32 roomnum, s32 start, s32 limit) value = func0f177c8c(var80061420[roomnum].unk04, &sp78, &neighbournum); while (value != -1) { - f32 increment = value * 0.0039215688593686f * start * 5.0f; + f32 increment = value * (1.0f / 255.0f) * start * 5.0f; if (start > 0) { if (increment > start) { @@ -2139,7 +2155,7 @@ void roomAdjustLighting(s32 roomnum, s32 start, s32 limit) // @bug: Should be checking neighbournum flags, not roomnum if (!(g_Rooms[roomnum].flags & ROOMFLAG_OUTDOORS ? 1 : 0)) { - func0f004558(neighbournum, increment, limit); + roomFlashLocalLighting(neighbournum, increment, limit); } value = func0f177c8c(var80061420[roomnum].unk04, &sp78, &neighbournum); @@ -2147,26 +2163,26 @@ void roomAdjustLighting(s32 roomnum, s32 start, s32 limit) } } -void func0f004558(s32 roomnum, s32 increment, s32 limit) +void roomFlashLocalLighting(s32 roomnum, s32 increment, s32 limit) { if (roomnum) { if (g_Rooms[roomnum].flags & ROOMFLAG_ONSCREEN) { if (increment > 0) { // Increasing - if (g_Rooms[roomnum].unk52 < limit) { - g_Rooms[roomnum].unk52 += increment; + if (g_Rooms[roomnum].br_flash < limit) { + g_Rooms[roomnum].br_flash += increment; - if (g_Rooms[roomnum].unk52 > limit) { - g_Rooms[roomnum].unk52 = limit; + if (g_Rooms[roomnum].br_flash > limit) { + g_Rooms[roomnum].br_flash = limit; } } } else { // Decreasing - if (g_Rooms[roomnum].unk52 > limit) { - g_Rooms[roomnum].unk52 += increment; + if (g_Rooms[roomnum].br_flash > limit) { + g_Rooms[roomnum].br_flash += increment; - if (g_Rooms[roomnum].unk52 < limit) { - g_Rooms[roomnum].unk52 = limit; + if (g_Rooms[roomnum].br_flash < limit) { + g_Rooms[roomnum].br_flash = limit; } } } @@ -2188,7 +2204,7 @@ void roomHighlight(s32 roomnum) s32 numcolours; struct colour *src; struct colour *dst; - u8 s2; + u8 br_settled_regional; s32 max; f32 mult; u32 stack; @@ -2196,16 +2212,16 @@ void roomHighlight(s32 roomnum) if (var8007fc3c != g_Rooms[roomnum].unk56 && g_Rooms[roomnum].loaded240 != 0) { g_Rooms[roomnum].unk56 = var8007fc3c; - if ((g_Rooms[roomnum].flags & ROOMFLAG_0040) == 0) { - g_Rooms[roomnum].flags |= ROOMFLAG_0200; + if ((g_Rooms[roomnum].flags & ROOMFLAG_BRIGHTNESS_CALCED) == 0) { + g_Rooms[roomnum].flags |= ROOMFLAG_BRIGHTNESS_DIRTY_PERM; } - s2 = func0f000b24(roomnum); + br_settled_regional = roomGetSettledRegionalBrightnessForPlayer(roomnum); numcolours = g_Rooms[roomnum].gfxdata->numcolours; dst = gfxAllocateColours(numcolours); g_Rooms[roomnum].colours = dst; - extra = g_Rooms[roomnum].unk52; + extra = g_Rooms[roomnum].br_flash; src = (struct colour *)((uintptr_t)g_Rooms[roomnum].gfxdata->vertices + g_Rooms[roomnum].gfxdata->numvertices * sizeof(struct gfxvtx)); src = (struct colour *)ALIGN8((uintptr_t)src); @@ -2220,7 +2236,7 @@ void roomHighlight(s32 roomnum) dst[i].r = src[i].r; dst[i].g = src[i].g; dst[i].b = src[i].b; - dst[i].a = src[i].a * (1.0f / 255.0f * s2); + dst[i].a = src[i].a * (1.0f / 255.0f * br_settled_regional); } else { if (USINGDEVICE(DEVICE_NIGHTVISION) || USINGDEVICE(DEVICE_IRSCANNER)) { tmpr = tmpg = tmpb = (src[i].r > src[i].g && src[i].r > src[i].b) @@ -2243,8 +2259,8 @@ void roomHighlight(s32 roomnum) max = tmpb; } - if (max > s2) { - mult = s2 / (f32)max; + if (max > br_settled_regional) { + mult = br_settled_regional / (f32)max; } else { mult = 1.0f; } @@ -2261,14 +2277,14 @@ void roomHighlight(s32 roomnum) } if (red + green + blue != 0 - || g_Rooms[roomnum].unk5c == 0.0f + || g_Rooms[roomnum].lightop_cur_frac == 0.0f || (g_Rooms[roomnum].flags & ROOMFLAG_LIGHTSOFF)) { red += extra; green += extra; blue += extra; } - if (g_Rooms[roomnum].lightop == LIGHTOP_5) { + if (g_Rooms[roomnum].lightop == LIGHTOP_HIGHLIGHT) { scenarioHighlightRoom(roomnum, &red, &green, &blue); } @@ -2651,7 +2667,7 @@ void func0f0059fc(s32 roomnum1, struct coord *pos1, s32 roomnum2, struct coord * */ void func0f005bb0(void) { - s32 brightness = func0f0009c0(g_Vars.currentplayer->prop->rooms[0]); + s32 brightness = roomGetFinalBrightness(g_Vars.currentplayer->prop->rooms[0]); if (((USINGDEVICE(DEVICE_NIGHTVISION) || USINGDEVICE(DEVICE_IRSCANNER)) && !g_Vars.currentplayer->usinggoggles) || ((!USINGDEVICE(DEVICE_NIGHTVISION) && !USINGDEVICE(DEVICE_IRSCANNER)) && g_Vars.currentplayer->usinggoggles)) { diff --git a/src/game/explosions.c b/src/game/explosions.c index 32befe75f..717548ba3 100644 --- a/src/game/explosions.c +++ b/src/game/explosions.c @@ -333,7 +333,7 @@ bool explosionCreate(struct prop *sourceprop, struct coord *exppos, s16 *exproom for (i = 0; exprooms[i] != -1 && i < 7; i++) { expprop->rooms[i] = exprooms[i]; - roomAdjustLighting(exprooms[i], g_ExplosionTypes[type].rangeh, 255); + roomFlashLighting(exprooms[i], g_ExplosionTypes[type].rangeh, 255); } expprop->rooms[i] = -1; @@ -706,7 +706,7 @@ void explosionInflictDamage(struct prop *expprop) // Flicker room lighting for (i = 0; expprop->rooms[i] != -1; i++) { if (random() % 2048 <= 240) { - roomAdjustLighting(expprop->rooms[i], type->rangeh, 255); + roomFlashLighting(expprop->rooms[i], type->rangeh, 255); } } diff --git a/src/game/game_13c510.c b/src/game/game_13c510.c index 1c06027dd..2f929dd24 100644 --- a/src/game/game_13c510.c +++ b/src/game/game_13c510.c @@ -172,11 +172,11 @@ void artifactsCalculateGlaresForRoom(s32 roomnum) s1[i * 3 + 1] = 0; s1[i * 3 + 2] = 0; - tmp = roomlights[i].unk07 * roomlights[i].unk07 + roomlights[i].unk08 * roomlights[i].unk08 + roomlights[i].unk09 * roomlights[i].unk09; + tmp = roomlights[i].dirx * roomlights[i].dirx + roomlights[i].diry * roomlights[i].diry + roomlights[i].dirz * roomlights[i].dirz; f16 = spc4.f[0] * spc4.f[0] + spc4.f[1] * spc4.f[1] + spc4.f[2] * spc4.f[2]; if (tmp > 0.0001f && f16 > 0.0001f) { - sp190 = -((roomlights[i].unk07 * spc4.f[0] + roomlights[i].unk08 * spc4.f[1] + roomlights[i].unk09 * spc4.f[2]) / sqrtf(tmp * f16)); + sp190 = -((roomlights[i].dirx * spc4.f[0] + roomlights[i].diry * spc4.f[1] + roomlights[i].dirz * spc4.f[2]) / sqrtf(tmp * f16)); if (sp190 > 0.4f) { sp190 = 0.4f; @@ -385,7 +385,7 @@ Gfx *artifactsRenderGlaresForRoom(Gfx *gdl, s32 roomnum) struct artifact *artifacts; u16 min; u16 max; - f32 f30; + f32 lightop_cur_frac; s32 t2; struct light *light; u8 *s3; @@ -413,7 +413,7 @@ Gfx *artifactsRenderGlaresForRoom(Gfx *gdl, s32 roomnum) f32 f26; artifacts = schedGetFrontArtifacts(); - f30 = roomGetUnk5c(roomnum); + lightop_cur_frac = roomGetLightOpCurFrac(roomnum); if (g_Rooms[roomnum].gfxdata == NULL || g_Rooms[roomnum].loaded240 == 0) { return gdl; @@ -500,7 +500,7 @@ Gfx *artifactsRenderGlaresForRoom(Gfx *gdl, s32 roomnum) } if (USINGDEVICE(DEVICE_NIGHTVISION)) { - s3[2] *= (s32) (f30 * 7.0f); + s3[2] *= (s32) (lightop_cur_frac * 7.0f); } f0 = s3[2] * (1.0f / 255.0f); @@ -519,18 +519,18 @@ Gfx *artifactsRenderGlaresForRoom(Gfx *gdl, s32 roomnum) brightness *= 27500.0f / (-lightscreenpos.z < 1.0f ? 1.0f : -lightscreenpos.z); - if (light->unk06 != 0) { - brightness *= light->unk06 * (1.0f / 32.0f); + if (light->brightnessmult != 0) { + brightness *= light->brightnessmult * (1.0f / 32.0f); } brightness *= s3[1] * (1.0f / 255.0f); if (USINGDEVICE(DEVICE_NIGHTVISION)) { - brightness *= 14.0f * f30; + brightness *= 14.0f * lightop_cur_frac; } brightness += add; - brightness *= 2.0f * func0f000dbc(roomnum); + brightness *= 2.0f * roomGetSettledLocalBrightnessFrac(roomnum); if (brightness > 750.0f) { brightness = 750.0f; @@ -554,7 +554,7 @@ Gfx *artifactsRenderGlaresForRoom(Gfx *gdl, s32 roomnum) alpha *= (s3[0] / 8.0f); if (USINGDEVICE(DEVICE_NIGHTVISION)) { - alpha *= f30 * 7.0f; + alpha *= lightop_cur_frac * 7.0f; } if (alpha > 255.0f) { diff --git a/src/game/mplayer/scenarios/capturethecase.inc b/src/game/mplayer/scenarios/capturethecase.inc index 4fb9b9bf3..7b9a74b1b 100644 --- a/src/game/mplayer/scenarios/capturethecase.inc +++ b/src/game/mplayer/scenarios/capturethecase.inc @@ -338,7 +338,7 @@ void ctcInitProps(void) for (i = 0; i < 4; i++) { if (g_ScenarioData.ctc.playercountsperteam[i] && g_ScenarioData.ctc.baserooms[i] != -1) { - roomSetLighting(g_ScenarioData.ctc.baserooms[i], 5, 0, 0, 0); + roomSetLightOp(g_ScenarioData.ctc.baserooms[i], LIGHTOP_HIGHLIGHT, 0, 0, 0); } } } diff --git a/src/game/mplayer/scenarios/kingofthehill.inc b/src/game/mplayer/scenarios/kingofthehill.inc index b1fcff644..2c86fb3ed 100644 --- a/src/game/mplayer/scenarios/kingofthehill.inc +++ b/src/game/mplayer/scenarios/kingofthehill.inc @@ -196,6 +196,7 @@ void kohInitProps(void) } padUnpack(pad_id, PADFIELD_POS | PADFIELD_ROOM, &pad); + g_ScenarioData.koh.hillrooms[0] = pad.room; g_ScenarioData.koh.hillrooms[1] = -1; g_ScenarioData.koh.hillpos.x = pad.pos.x; @@ -203,7 +204,8 @@ void kohInitProps(void) g_ScenarioData.koh.hillpos.z = pad.pos.z; g_ScenarioData.koh.hillpos.y = cdFindFloorYColourTypeAtPos(&g_ScenarioData.koh.hillpos, &g_ScenarioData.koh.hillrooms[0], 0, 0); g_ScenarioData.koh.movehill = false; - roomSetLighting(g_ScenarioData.koh.hillrooms[0], LIGHTOP_5, 0, 0, 0); + + roomSetLightOp(g_ScenarioData.koh.hillrooms[0], LIGHTOP_HIGHLIGHT, 0, 0, 0); } /** @@ -265,7 +267,7 @@ void kohTick(void) && g_ScenarioData.koh.colourfracb >= .95f) { // The old hill is now "natural enough" to set it back to full // natural colour and actually choose a new hill. - roomSetLighting(g_ScenarioData.koh.hillrooms[0], 0, 0, 0, 0); + roomSetLightOp(g_ScenarioData.koh.hillrooms[0], LIGHTOP_NONE, 0, 0, 0); // Choose the new hill. Note that hillcount refers to the number of // hill options, which is always >= 2. @@ -294,7 +296,7 @@ void kohTick(void) g_ScenarioData.koh.hillpos.y = cdFindFloorYColourTypeAtPos(&g_ScenarioData.koh.hillpos, g_ScenarioData.koh.hillrooms, NULL, NULL); - roomSetLighting(g_ScenarioData.koh.hillrooms[0], 5, 0, 0, 0); + roomSetLightOp(g_ScenarioData.koh.hillrooms[0], LIGHTOP_HIGHLIGHT, 0, 0, 0); g_ScenarioData.koh.occupiedteam = -1; g_ScenarioData.koh.elapsed240 = 0; diff --git a/src/game/nbomb.c b/src/game/nbomb.c index db8f0325c..b25cffe77 100644 --- a/src/game/nbomb.c +++ b/src/game/nbomb.c @@ -461,7 +461,7 @@ void nbombInflictDamage(struct nbomb *nbomb) if (index < 52) { roomnums[index] = i; index++; - roomAdjustLighting(i, -38, -180); + roomFlashLighting(i, -38, -180); } } } diff --git a/src/game/propobj.c b/src/game/propobj.c index 4702ee276..74080dc19 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -1353,21 +1353,21 @@ struct modelrodata_bbox *objFindBboxRodata(struct defaultobj *obj) return modelFindBboxRodata(obj->model); } -s32 func0f068b14(s16 *rooms, s32 arg1) +s32 objGetAverageBrightnessInRooms(s16 *rooms, s32 brightnesstype) { - s32 total = 0; + s32 brightness = 0; s32 i; for (i = 0; rooms[i] != -1; i++) { - if (arg1 == 0) { - total += func0f000b24(rooms[i]); - } else if (arg1 == 1) { - total += func0f000c54(rooms[i]); + if (brightnesstype == 0) { + brightness += roomGetSettledRegionalBrightnessForPlayer(rooms[i]); + } else if (brightnesstype == 1) { + brightness += roomGetFlashBrightness(rooms[i]); } } if (i) { - s32 average = total / i; + s32 average = brightness / i; if (average > 255) { average = 255; @@ -1384,12 +1384,12 @@ s32 door0f068c04(struct prop *prop, s32 *arg1, s32 *arg2) struct doorobj *door = prop->door; struct doorobj *sibling; s32 i; - s32 s1; - s32 s3 = 0; - s32 s4 = 0; + s32 br_settled_average; + s32 total_br_settled = 0; + s32 total_br_flash = 0; s32 s2 = 0; s32 s5 = 0; - s32 v1; + s32 br_flash_average; s32 result; struct prop *loopprop; struct pad pad; @@ -1411,11 +1411,11 @@ s32 door0f068c04(struct prop *prop, s32 *arg1, s32 *arg2) padUnpack(sibling->base.pad, PADFIELD_POS | PADFIELD_LOOK | PADFIELD_UP | PADFIELD_NORMAL | PADFIELD_ROOM, &pad); if (door->base.flags3 & OBJFLAG3_04000000) { - s3 += func0f000b24(pad.room); - s4 += func0f000c54(pad.room); + total_br_settled += roomGetSettledRegionalBrightnessForPlayer(pad.room); + total_br_flash += roomGetFlashBrightness(pad.room); s5++; - s2 = s3 + s4; + s2 = total_br_settled + total_br_flash; if (s2 > 255) { s2 = 255; @@ -1454,8 +1454,8 @@ s32 door0f068c04(struct prop *prop, s32 *arg1, s32 *arg2) // @bug? Duplicate sum1 < 0.0f check in the first part. // Perhaps one of them should be sum2 < 0.0f. if ((sum1 < 0.0f && sum1 < 0.0f) || (sum1 > 0.0f && sum2 > 0.0f)) { - s32 value1 = func0f000c54(loopprop->rooms[i]); - s32 value2 = func0f000b24(loopprop->rooms[i]); + s32 value1 = roomGetFlashBrightness(loopprop->rooms[i]); + s32 value2 = roomGetSettledRegionalBrightnessForPlayer(loopprop->rooms[i]); s32 sum = value2 + value1; if (sum > 255) { @@ -1463,8 +1463,8 @@ s32 door0f068c04(struct prop *prop, s32 *arg1, s32 *arg2) } s5++; - s3 += value2; - s4 += value1; + total_br_settled += value2; + total_br_flash += value1; s2 += sum; } } @@ -1480,23 +1480,23 @@ s32 door0f068c04(struct prop *prop, s32 *arg1, s32 *arg2) } if (s5 == 0) { - s1 = func0f068b14(prop->rooms, 0); - v1 = func0f068b14(prop->rooms, 1); + br_settled_average = objGetAverageBrightnessInRooms(prop->rooms, 0); + br_flash_average = objGetAverageBrightnessInRooms(prop->rooms, 1); } else { - s1 = s3 / s5; - v1 = s4 / s5; + br_settled_average = total_br_settled / s5; + br_flash_average = total_br_flash / s5; } if (arg1 != NULL) { - *arg1 = s1; + *arg1 = br_settled_average; } if (arg2 != NULL) { - *arg2 = v1; + *arg2 = br_flash_average; } - if (s1 + v1 < 255) { - result = s1 + v1; + if (br_settled_average + br_flash_average < 255) { + result = br_settled_average + br_flash_average; } else { result = 255; } @@ -1547,8 +1547,8 @@ s32 func0f068fc8(struct prop *prop, bool arg1) } } } else { - actual = func0f068b14(prop->rooms, 0); - extra = func0f068b14(prop->rooms, 1); + actual = objGetAverageBrightnessInRooms(prop->rooms, 0); + extra = objGetAverageBrightnessInRooms(prop->rooms, 1); } if (arg1 == 0) { @@ -18799,7 +18799,7 @@ void weaponSetGunfireVisible(struct prop *prop, bool visible, s16 room) } if (flash && room != -1) { - roomAdjustLighting(room, 48, 128); + roomFlashLighting(room, 48, 128); } } @@ -19993,7 +19993,7 @@ void doorCreateSparks(struct doorobj *door) -1, 0, 0, 0, &sp7c, -1, door->base.prop->rooms, -1, -1, -1, -1); for (i = 0; door->base.prop->rooms[i] != -1; i++) { - roomAdjustLighting(door->base.prop->rooms[i], 128, 200); + roomFlashLighting(door->base.prop->rooms[i], 128, 200); } } diff --git a/src/game/smoke.c b/src/game/smoke.c index 36df567ac..160e3e3f0 100644 --- a/src/game/smoke.c +++ b/src/game/smoke.c @@ -207,7 +207,7 @@ Gfx *smokeRenderPart(struct smoke *smoke, struct smokepart *part, Gfx *gdl, stru colours[0].a = alpha * alphamult; } else { if (smoke->type != SMOKETYPE_PINBALL) { - frac = func0f000a10(smoke->prop->rooms[0]) * (1.0f / 255.0f); + frac = roomGetFinalBrightnessForPlayer(smoke->prop->rooms[0]) * (1.0f / 255.0f); if (frac > 1) { frac = 1; diff --git a/src/game/sparks.c b/src/game/sparks.c index 87f56c482..be4441b5b 100644 --- a/src/game/sparks.c +++ b/src/game/sparks.c @@ -277,21 +277,21 @@ void sparksCreate(s32 room, struct prop *prop, struct coord *pos, struct coord * switch (typenum) { case SPARKTYPE_DEFAULT: - roomAdjustLighting(group->room, 24, 32); + roomFlashLighting(group->room, 24, 32); break; case SPARKTYPE_ENVIRONMENTAL1: if (g_Vars.stagenum != STAGE_CRASHSITE) { - roomAdjustLighting(group->room, 32, 128); + roomFlashLighting(group->room, 32, 128); } break; case SPARKTYPE_ENVIRONMENTAL2: if (g_Vars.stagenum != STAGE_CRASHSITE) { - roomAdjustLighting(group->room, 64, 128); + roomFlashLighting(group->room, 64, 128); } break; case SPARKTYPE_ENVIRONMENTAL3: if (g_Vars.stagenum != STAGE_CRASHSITE) { - roomAdjustLighting(group->room, 200, 255); + roomFlashLighting(group->room, 200, 255); } break; } diff --git a/src/game/training.c b/src/game/training.c index 2d276fb54..2f842acdc 100644 --- a/src/game/training.c +++ b/src/game/training.c @@ -414,10 +414,10 @@ void frInitLighting(void) s32 roomnum; for (roomnum = 7; roomnum < 10; roomnum++) { - roomSetLighting(roomnum, LIGHTOP_3, 50, 100, TICKS(32)); + roomSetLightOp(roomnum, LIGHTOP_TRANSITION, 50, 100, TICKS(32)); } - roomSetLighting(ROOM_DISH_FIRINGRANGE, LIGHTOP_3, 25, 100, TICKS(32)); + roomSetLightOp(ROOM_DISH_FIRINGRANGE, LIGHTOP_TRANSITION, 25, 100, TICKS(32)); g_FrData.donelighting = true; @@ -433,10 +433,10 @@ void frRestoreLighting(void) s32 roomnum; for (roomnum = 7; roomnum < 10; roomnum++) { - roomSetLighting(roomnum, LIGHTOP_3, 100, 50, TICKS(8)); + roomSetLightOp(roomnum, LIGHTOP_TRANSITION, 100, 50, TICKS(8)); } - roomSetLighting(ROOM_DISH_FIRINGRANGE, LIGHTOP_3, 100, 25, TICKS(8)); + roomSetLightOp(ROOM_DISH_FIRINGRANGE, LIGHTOP_TRANSITION, 100, 25, TICKS(8)); g_FrData.donelighting = false; diff --git a/src/game/wallhit.c b/src/game/wallhit.c index ac039f342..6f09f29c2 100644 --- a/src/game/wallhit.c +++ b/src/game/wallhit.c @@ -1078,7 +1078,7 @@ void wallhitCreateWith20Args(struct coord *relpos, struct coord *arg1, struct co u8 b; u8 a; - brightnessfrac = func0f000a10(room2) * (1.0f / 255.0f); + brightnessfrac = roomGetFinalBrightnessForPlayer(room2) * (1.0f / 255.0f); range = maxalpha - (u32)minalpha; @@ -1427,9 +1427,9 @@ void wallhitsRecolour(void) s32 j; u32 stack; struct wallhit *wallhit; - f32 sp0c; - f32 sp08; - f32 sp04; + f32 r; + f32 g; + f32 b; for (i = 0, wallhit = g_Wallhits; i < g_WallhitsMax; i++) { if (wallhit->roomnum > 0) { @@ -1443,30 +1443,30 @@ void wallhitsRecolour(void) } for (j = 0; prop->rooms[j] != -1; j++) { - if (g_Rooms[prop->rooms[j]].flags & ROOMFLAG_1000) { + if (g_Rooms[prop->rooms[j]].flags & ROOMFLAG_NEEDRESHADE) { room = prop->rooms[j]; - sp0c = g_Rooms[room].unk74; - sp08 = g_Rooms[room].unk78; - sp04 = g_Rooms[room].unk7c; + r = g_Rooms[room].highlightfrac_r; + g = g_Rooms[room].highlightfrac_g; + b = g_Rooms[room].highlightfrac_b; break; } } } else { - if (g_Rooms[wallhit->roomnum].flags & ROOMFLAG_1000) { + if (g_Rooms[wallhit->roomnum].flags & ROOMFLAG_NEEDRESHADE) { room = wallhit->roomnum; - sp0c = g_Rooms[room].unk74; - sp08 = g_Rooms[room].unk78; - sp04 = g_Rooms[room].unk7c; + r = g_Rooms[room].highlightfrac_r; + g = g_Rooms[room].highlightfrac_g; + b = g_Rooms[room].highlightfrac_b; } } if (room > 0) { for (j = 0; j < 4; j++) { - wallhit->finalcolours[j].r = wallhit->basecolours[j].r * sp0c; - wallhit->finalcolours[j].g = wallhit->basecolours[j].g * sp08; - wallhit->finalcolours[j].b = wallhit->basecolours[j].b * sp04; + wallhit->finalcolours[j].r = wallhit->basecolours[j].r * r; + wallhit->finalcolours[j].g = wallhit->basecolours[j].g * g; + wallhit->finalcolours[j].b = wallhit->basecolours[j].b * b; } } } diff --git a/src/game/weather.c b/src/game/weather.c index b6a51d3fb..efd7ac719 100644 --- a/src/game/weather.c +++ b/src/game/weather.c @@ -1291,7 +1291,7 @@ glabel var7f1b5780 /* f133540: 02002025 */ or $a0,$s0,$zero /* f133544: 14400003 */ bnez $v0,.L0f133554 /* f133548: 02002025 */ or $a0,$s0,$zero -/* f13354c: 0fc00400 */ jal roomSetUnk52 +/* f13354c: 0fc00400 */ jal roomSetFlashBrightness /* f133550: 02202825 */ or $a1,$s1,$zero .L0f133554: /* f133554: 8e6d02bc */ lw $t5,0x2bc($s3) @@ -2712,7 +2712,7 @@ Gfx *weatherRenderRain(Gfx *gdl, struct weatherdata *weather, s32 arg2) // 3534 for (s0 = 1; s0 < g_Vars.roomcount; s0++) { if (!weatherIsRoomWeatherProof(s0)) { - roomSetUnk52(s0, s1); + roomSetFlashBrightness(s0, s1); } } } diff --git a/src/include/commands.h b/src/include/commands.h index 16a690dba..53b490ae5 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -2347,16 +2347,57 @@ mkshort(0x0101), \ u1, -#define set_lights_state(pad, operation, u1, u2, u3) \ +/** + * Modifies the lighting of a room. + * + * The room is specified by the argument. If less than 10000 then it + * is interpreted as a room number. If it is 10000 or more then 10000 is + * subtracted from it, it's interpreted as a pad number and the room that the + * pad can be found in is used. + * + * is a LIGHTOP constant. + * Unless noted otherwise, the and arguments are percentages of the + * usual brightness. Less than 100 is darker and more than 100 is brighter. + * + * LIGHTOP_NONE: + * Stops any of the below ongoing effects (setrandom, transition or sineloop). + * + * LIGHTOP_SET: + * Set the room's brightness to , without any transition. + * + * LIGHTOP_SETRANDOM: + * Set the room's brightness randomly. + * is the interval between rolls of the dice. + * is the probability (range 0-100) of it using normal brightness on any + * given interval. Otherwise the brightness is used. + * For example, with to=80, from=50 and duration60=120, then every 2 seconds + * there will be an 80% chance of changing to normal brightness and a 20% chance + * of changing to 50% brightness. + * + * LIGHTOP_TRANSITION: + * Transition from to over ticks. + * Due to a bug, the timer starts at 75% completion. + * + * LIGHTOP_SINELOOP: + * Repeatedly adjust lighting between and in a sine pattern, + * taking ticks to complete a loop cycle. + * + * LIGHTOP_TURNON: + * Turn the room's lights on (eg. using a light switch). + * + * LIGHTOP_TURNOFF: + * Turn the room's lights off (eg. using a light switch). + */ +#define set_lights_state(roomorpad, operation, to, from, duration60) \ mkshort(0x0102), \ - mkshort(pad), \ + mkshort(roomorpad), \ operation, \ - u1, \ - u2, \ - u3, \ - 0x00, \ - 0x00, \ - 0x00, + to, \ + from, \ + duration60, \ + 0, \ + 0, \ + 0, /** * Checks if the current chr's proppreset is blocking line of sight from the chr diff --git a/src/include/constants.h b/src/include/constants.h index b5a4b4fe6..0ab9f4148 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -1439,13 +1439,14 @@ #define LANGUAGE_PAL_IT 3 #define LANGUAGE_PAL_ES 4 -#define LIGHTOP_1 1 -#define LIGHTOP_2 2 -#define LIGHTOP_3 3 -#define LIGHTOP_4 4 -#define LIGHTOP_5 5 -#define LIGHTOP_TURNON 6 -#define LIGHTOP_TURNOFF 7 +#define LIGHTOP_NONE 0 +#define LIGHTOP_SET 1 +#define LIGHTOP_SETRANDOM 2 +#define LIGHTOP_TRANSITION 3 +#define LIGHTOP_SINELOOP 4 +#define LIGHTOP_HIGHLIGHT 5 +#define LIGHTOP_TURNON 6 +#define LIGHTOP_TURNOFF 7 #define LOADTYPE_NONE 0 #define LOADTYPE_BG 1 @@ -3475,22 +3476,22 @@ #define ROOMBLOCKTYPE_LEAF 0 #define ROOMBLOCKTYPE_PARENT 1 -#define ROOMFLAG_DISABLEDBYSCRIPT 0x0001 -#define ROOMFLAG_HASDYNTEX 0x0002 // Has dynamic textures such as water -#define ROOMFLAG_ONSCREEN 0x0004 -#define ROOMFLAG_STANDBY 0x0008 // Neighbour of an onscreen room - usually loaded as well -#define ROOMFLAG_0010 0x0010 -#define ROOMFLAG_LOADCANDIDATE 0x0020 // Room is a good candidate for loading on this tick -#define ROOMFLAG_0040 0x0040 -#define ROOMFLAG_RENDERALWAYS 0x0080 -#define ROOMFLAG_DIRTY 0x0100 -#define ROOMFLAG_0200 0x0200 -#define ROOMFLAG_0400 0x0400 -#define ROOMFLAG_0800 0x0800 -#define ROOMFLAG_1000 0x1000 -#define ROOMFLAG_LIGHTSOFF 0x2000 -#define ROOMFLAG_PLAYAMBIENTTRACK 0x4000 -#define ROOMFLAG_OUTDOORS 0x8000 +#define ROOMFLAG_DISABLEDBYSCRIPT 0x0001 +#define ROOMFLAG_HASDYNTEX 0x0002 // Has dynamic textures such as water +#define ROOMFLAG_ONSCREEN 0x0004 +#define ROOMFLAG_STANDBY 0x0008 // Neighbour of an onscreen room - usually loaded as well +#define ROOMFLAG_0010 0x0010 +#define ROOMFLAG_LOADCANDIDATE 0x0020 // Room is a good candidate for loading on this tick +#define ROOMFLAG_BRIGHTNESS_CALCED 0x0040 +#define ROOMFLAG_RENDERALWAYS 0x0080 +#define ROOMFLAG_LIGHTS_DIRTY 0x0100 +#define ROOMFLAG_BRIGHTNESS_DIRTY_PERM 0x0200 +#define ROOMFLAG_BRIGHTNESS_DIRTY_TEMP 0x0400 +#define ROOMFLAG_BBOXHACK 0x0800 +#define ROOMFLAG_NEEDRESHADE 0x1000 +#define ROOMFLAG_LIGHTSOFF 0x2000 +#define ROOMFLAG_PLAYAMBIENTTRACK 0x4000 +#define ROOMFLAG_OUTDOORS 0x8000 #define RUMBLESTATE_1 1 #define RUMBLESTATE_ENABLED_STOPPED 2 diff --git a/src/include/game/bg.h b/src/include/game/bg.h index ede82bc09..cde4a5f4f 100644 --- a/src/include/game/bg.h +++ b/src/include/game/bg.h @@ -6,7 +6,7 @@ void roomUnpauseProps(u32 roomnum, bool tintedglassonly); void roomSetOnscreen(s32 room, s32 draworder, struct screenbox *arg2); -void func0f158108(s32 roomnum, u8 *arg1, u8 *arg2); +void bgGetRoomBrightnessRange(s32 roomnum, u8 *min, u8 *max); struct var800a4640_00 *func0f158140(s32 roomnum); Gfx *bg0f158184(Gfx *gdl, struct xraydata *xraydata); Gfx *func0f158400(Gfx *gdl, struct xraydata *xraydata, s16 vertices1[3], s16 vertices2[3], s16 vertices3[3], u32 colour1, u32 colour2, u32 colour3); diff --git a/src/include/game/dlights.h b/src/include/game/dlights.h index 9e06a2500..491c985b1 100644 --- a/src/include/game/dlights.h +++ b/src/include/game/dlights.h @@ -6,18 +6,18 @@ u32 func0f000920(s32 portalnum1, s32 portalnum2); struct light *roomGetLight(s32 roomnum, s32 lightnum); -u8 func0f0009c0(s32 roomnum); -u8 func0f000a10(s32 roomnum); -u8 func0f000b24(s32 roomnum); -u8 roomGetBrightness(s32 room); -s32 func0f000c54(s32 roomnum); -f32 roomGetUnk5c(s32 roomnum); -f32 func0f000dbc(s32 roomnum); +u8 roomGetFinalBrightness(s32 roomnum); +u8 roomGetFinalBrightnessForPlayer(s32 roomnum); +u8 roomGetSettledRegionalBrightnessForPlayer(s32 roomnum); +u8 roomGetSettledLocalBrightness(s32 room); +s32 roomGetFlashBrightness(s32 roomnum); +f32 roomGetLightOpCurFrac(s32 roomnum); +f32 roomGetSettledLocalBrightnessFrac(s32 roomnum); bool lightGetBboxCentre(s32 roomnum, u32 lightnum, struct coord *pos); bool lightIsHealthy(s32 roomnum, s32 lightnum); bool lightIsVulnerable(s32 roomnum, s32 lightnum); bool lightIsOn(s32 roomnum, s32 lightnum); -void roomSetUnk52(s32 roomnum, s32 value); +void roomSetFlashBrightness(s32 roomnum, s32 value); void roomSetDefaults(struct room *room); Gfx *lightsSetForRoom(Gfx *gdl, s16 roomnum); Gfx *lightsSetDefault(Gfx *gdl); @@ -33,16 +33,16 @@ void func0f00259c(s32 roomnum); void func0f002844(s32 roomnum, f32 arg1, s32 arg2, s32 portalnum); void func0f002a98(void); void roomSetLightsOn(s32 roomnum, s32 enable); -void roomSetLighting(s32 roomnum, s32 operation, u8 arg2, u8 arg3, u8 arg4); +void roomSetLightOp(s32 roomnum, s32 operation, u8 br_to, u8 br_from, u8 duration60); bool lightTickBroken(s32 roomnum, s32 lightnum); void lightingTick(void); -void func0f003444(void); -void func0f0035c0(void); -void func0f00372c(void); -void func0f0037ac(void); +void lightsConfigureForPerfectDarknessCutscene(void); +void lightsConfigureForPerfectDarknessGameplay(void); +void lightsTickPerfectDarkness(void); +void roomsTickLighting(void); void lightsTick(void); -void roomAdjustLighting(s32 roomnum, s32 start, s32 limit); -void func0f004558(s32 roomnum, s32 increment, s32 limit); +void roomFlashLighting(s32 roomnum, s32 start, s32 limit); +void roomFlashLocalLighting(s32 roomnum, s32 increment, s32 limit); void roomHighlight(s32 roomnum); void func0f004c6c(void); void func0f00505c(void); diff --git a/src/include/game/propobj.h b/src/include/game/propobj.h index 0e52a481f..3102c42dd 100644 --- a/src/include/game/propobj.h +++ b/src/include/game/propobj.h @@ -82,7 +82,7 @@ struct modelnode *modelFindBboxNode(struct model *model); struct modelrodata_bbox *modelFindBboxRodata(struct model *model); struct modelnode *objFindBboxNode(struct defaultobj *obj); struct modelrodata_bbox *objFindBboxRodata(struct defaultobj *obj); -s32 func0f068b14(s16 *rooms, s32 arg1); +s32 objGetAverageBrightnessInRooms(s16 *rooms, s32 arg1); s32 door0f068c04(struct prop *prop, s32 *arg1, s32 *arg2); s32 func0f068fc8(struct prop *prop, bool arg1); void propCalculateShadeColour(struct prop *prop, u8 *nextcol, u16 floorcol); diff --git a/src/include/types.h b/src/include/types.h index 5b1917830..eb8b8360d 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -3610,28 +3610,57 @@ struct room { /*0x3c*/ f32 radius; // from volume centre to the corner in 3D /*0x40*/ s32 numvtxbatches; /*0x44*/ struct vtxbatch *vtxbatches; - /*0x48*/ u8 unk48; - /*0x49*/ u8 unk49; - /*0x4a*/ u8 unk4a; - /*0x4b*/ u8 unk4b; - /*0x4c*/ u8 unk4c; + + /** + * br values are a brightness value (0-255). + */ + + // The min and max values are the brightness levels when the room has all + // its lights shot out, or all lights healthy. They come from the BG file. + // The br_light_each value is calculated from these based on the number of + // lights in the room. + /*0x48*/ u8 br_light_min; + /*0x49*/ u8 br_light_max; + /*0x4a*/ u8 br_light_each; + + // The brightness level of the room, assuming no flashes are taking place, + // and factoring in settled brightness from neighbouring rooms. + /*0x4b*/ u8 br_settled_regional; + + // Generally the same as br_light_min, but is sometimes fudged a bit. + /*0x4c*/ u8 br_base; + + // Unused /*0x4d*/ u8 unk4d; + + // Lightops control what a room is doing with its lighting. They can be used + // to simply set a brightness multiplier, or transition to another + // brightness level over several frames, or repeat a brightness sine pattern. + // The lightop calculates lightop_cur_frac, which is a multiplier. /*0x4e*/ u8 lightop : 4; + + // Unused /*0x4e*/ u8 unk4e_04 : 4; - /*0x50*/ s16 brightness; - /*0x52*/ s16 unk52; - /*0x54*/ s16 unk54; + + // The brightness level of the room, assuming no flashes are taking place, + // and ignoring the brightness of neighbouring rooms. + /*0x50*/ s16 br_settled_local; + + // The current brightness of any temporary flash of light, + // such as gunfire or lightning. + /*0x52*/ s16 br_flash; + /*0x54*/ s16 lightop_timer240; /*0x56*/ u16 unk56; /*0x58*/ struct colour *colours; - /*0x5c*/ f32 unk5c; - /*0x60*/ f32 unk60; - /*0x64*/ f32 unk64; - /*0x68*/ f32 unk68; + /*0x5c*/ f32 lightop_cur_frac; + /*0x60*/ f32 lightop_to_frac; + /*0x64*/ f32 lightop_from_frac; + /*0x68*/ f32 lightop_duration240; /*0x6c*/ f32 unk6c; /*0x70*/ f32 unk70; - /*0x74*/ f32 unk74; - /*0x78*/ f32 unk78; - /*0x7c*/ f32 unk7c; + /*0x74*/ f32 highlightfrac_r; + /*0x78*/ f32 highlightfrac_g; + /*0x7c*/ f32 highlightfrac_b; /*0x80*/ s32 gfxdatalen; // when inflated /*0x84*/ struct wallhit *opawallhits; // opaque /*0x88*/ struct wallhit *xluwallhits; // translucent @@ -5358,8 +5387,8 @@ struct shieldhit { struct bgroom { u32 unk00; struct coord pos; - u8 unk10; - u8 unk11; + u8 br_light_min; + u8 br_light_max; }; struct damagetype { @@ -5478,16 +5507,16 @@ struct vec3s16 { struct light { /*0x00*/ u16 roomnum; /*0x02*/ u16 colour; // 4/4/4/4 - /*0x04*/ u8 unk04; - /*0x05*/ u8 unk05_00 : 1; + /*0x04*/ u8 brightness; + /*0x05*/ u8 sparkable : 1; /*0x05*/ u8 healthy : 1; /*0x05*/ u8 on : 1; /*0x05*/ u8 sparking : 1; /*0x05*/ u8 vulnerable : 1; - /*0x06*/ u8 unk06; - /*0x07*/ s8 unk07; - /*0x08*/ s8 unk08; - /*0x09*/ s8 unk09; + /*0x06*/ u8 brightnessmult; + /*0x07*/ s8 dirx; + /*0x08*/ s8 diry; + /*0x09*/ s8 dirz; /*0x0a*/ struct vec3s16 bbox[4]; }; diff --git a/src/setups/setupame.c b/src/setups/setupame.c index cfdd89728..6cb225899 100644 --- a/src/setups/setupame.c +++ b/src/setups/setupame.c @@ -2430,33 +2430,33 @@ u8 func100b_lightswitch[] = { // Turning lights off set_stage_flag(STAGEFLAG_LIGHTS_OFF) - set_lights_state(0x0044, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0039, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003c, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003d, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003e, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003b, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0042, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003f, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003a, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0041, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0040, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) + set_lights_state(0x0044, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0039, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003c, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003d, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003e, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003b, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0042, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003f, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003a, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0041, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0040, LIGHTOP_TURNOFF, 0, 0, 0) reloop(0x04) // Turning lights on label(0x06) unset_stage_flag(STAGEFLAG_LIGHTS_OFF) - set_lights_state(0x0044, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x0039, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003c, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003d, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003e, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003b, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x0042, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003f, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003a, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x0041, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x0040, LIGHTOP_TURNON, 0x00, 0x00, 0x00) + set_lights_state(0x0044, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x0039, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003c, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003d, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003e, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003b, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x0042, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003f, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003a, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x0041, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x0040, LIGHTOP_TURNON, 0, 0, 0) endloop(0x04) endlist diff --git a/src/setups/setupark.c b/src/setups/setupark.c index 9e573ffdb..dddaa3c11 100644 --- a/src/setups/setupark.c +++ b/src/setups/setupark.c @@ -783,48 +783,48 @@ u8 func100c_foyer_lights_timer[] = { set_stage_flag(STAGEFLAG_FOYER_LIGHTS_RESTORED) hide_countdown_timer stop_countdown_timer - set_lights_state(0x0019, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x001a, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x001b, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x001c, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x001d, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x001e, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x001f, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0020, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0021, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0017, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0018, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0016, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0022, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0023, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0024, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0025, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0026, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0027, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0028, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0029, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x002a, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x002b, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x002c, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x002d, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x002e, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x002f, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0030, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0031, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0032, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0033, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0034, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0035, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0036, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0015, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x000f, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x000e, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0010, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0011, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0012, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0013, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0014, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x000d, LIGHTOP_1, 0x64, 0x00, 0x00) + set_lights_state(0x0019, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x001a, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x001b, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x001c, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x001d, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x001e, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x001f, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0020, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0021, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0017, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0018, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0016, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0022, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0023, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0024, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0025, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0026, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0027, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0028, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0029, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x002a, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x002b, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x002c, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x002d, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x002e, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x002f, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0030, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0031, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0032, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0033, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0034, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0035, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0036, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0015, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x000f, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x000e, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0010, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0011, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0012, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0013, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0014, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x000d, LIGHTOP_SET, 100, 0, 0) set_ailist(CHR_SELF, GAILIST_IDLE) endlist }; @@ -2065,17 +2065,17 @@ u8 func040d_cass[] = { endloop(0x2a) label(0x20) - set_lights_state(0x0044, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0039, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003c, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003d, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003e, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003b, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0042, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003f, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003a, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0041, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0040, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) + set_lights_state(0x0044, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0039, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003c, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003d, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003e, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003b, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0042, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003f, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003a, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0041, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0040, LIGHTOP_TURNOFF, 0, 0, 0) set_stage_flag(STAGEFLAG_TOP_LIGHTS_OFF) set_stage_flag(STAGEFLAG_TOP_GUARDS_ATTACKING) walk_to_pad(PAD_ARK_000F) @@ -2182,33 +2182,33 @@ u8 func100a_lightswitch[] = { label(0x20) play_sound(SFX_PRESS_SWITCH, -1) if_stage_flag_eq(STAGEFLAG_TOP_LIGHTS_OFF, TRUE, /*goto*/ 0x00) - set_lights_state(0x0044, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0039, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003c, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003d, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003e, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003b, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0042, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003f, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x003a, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0041, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) - set_lights_state(0x0040, LIGHTOP_TURNOFF, 0x00, 0x00, 0x00) + set_lights_state(0x0044, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0039, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003c, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003d, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003e, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003b, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0042, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003f, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x003a, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0041, LIGHTOP_TURNOFF, 0, 0, 0) + set_lights_state(0x0040, LIGHTOP_TURNOFF, 0, 0, 0) set_stage_flag(STAGEFLAG_TOP_LIGHTS_OFF) reloop(0x1f) label(0x00) unset_stage_flag(STAGEFLAG_TOP_LIGHTS_OFF) - set_lights_state(0x0044, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x0039, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003c, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003d, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003e, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003b, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x0042, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003f, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x003a, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x0041, LIGHTOP_TURNON, 0x00, 0x00, 0x00) - set_lights_state(0x0040, LIGHTOP_TURNON, 0x00, 0x00, 0x00) + set_lights_state(0x0044, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x0039, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003c, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003d, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003e, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003b, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x0042, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003f, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x003a, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x0041, LIGHTOP_TURNON, 0, 0, 0) + set_lights_state(0x0040, LIGHTOP_TURNON, 0, 0, 0) endloop(0x1f) endlist @@ -2245,48 +2245,48 @@ u8 func100c_foyer_lights[] = { endloop(0x21) label(0x00) - set_lights_state(0x0019, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x001a, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x001b, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x001c, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x001d, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x001e, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x001f, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0020, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0021, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0017, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0018, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0016, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0022, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0023, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0024, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0025, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0026, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0027, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0028, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0029, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x002a, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x002b, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x002c, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x002d, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x002e, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x002f, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0030, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0031, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0032, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0033, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0034, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0035, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0036, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x0015, LIGHTOP_3, 0x64, 0x02, 0x78) - set_lights_state(0x000f, LIGHTOP_3, 0x64, 0x02, 0xf0) - set_lights_state(0x000e, LIGHTOP_3, 0x64, 0x02, 0xf0) - set_lights_state(0x0010, LIGHTOP_3, 0x64, 0x02, 0xf0) - set_lights_state(0x0011, LIGHTOP_3, 0x64, 0x02, 0xf0) - set_lights_state(0x0012, LIGHTOP_3, 0x64, 0x02, 0xf0) - set_lights_state(0x0013, LIGHTOP_3, 0x64, 0x02, 0xf0) - set_lights_state(0x0014, LIGHTOP_3, 0x64, 0x02, 0xf0) - set_lights_state(0x000d, LIGHTOP_3, 0x64, 0x02, 0xf0) + set_lights_state(0x0019, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x001a, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x001b, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x001c, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x001d, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x001e, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x001f, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0020, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0021, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0017, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0018, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0016, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0022, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0023, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0024, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0025, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0026, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0027, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0028, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0029, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x002a, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x002b, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x002c, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x002d, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x002e, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x002f, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0030, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0031, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0032, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0033, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0034, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0035, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0036, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x0015, LIGHTOP_TRANSITION, 100, 2, 120) + set_lights_state(0x000f, LIGHTOP_TRANSITION, 100, 2, 240) + set_lights_state(0x000e, LIGHTOP_TRANSITION, 100, 2, 240) + set_lights_state(0x0010, LIGHTOP_TRANSITION, 100, 2, 240) + set_lights_state(0x0011, LIGHTOP_TRANSITION, 100, 2, 240) + set_lights_state(0x0012, LIGHTOP_TRANSITION, 100, 2, 240) + set_lights_state(0x0013, LIGHTOP_TRANSITION, 100, 2, 240) + set_lights_state(0x0014, LIGHTOP_TRANSITION, 100, 2, 240) + set_lights_state(0x000d, LIGHTOP_TRANSITION, 100, 2, 240) restart_timer beginloop(0x22) @@ -2294,48 +2294,48 @@ u8 func100c_foyer_lights[] = { endloop(0x22) label(0x00) - set_lights_state(0x0019, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x001a, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x001b, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x001c, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x001d, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x001e, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x001f, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0020, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0021, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0017, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0018, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0016, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0022, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0023, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0024, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0025, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0026, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0027, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0028, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0029, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x002a, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x002b, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x002c, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x002d, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x002e, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x002f, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0030, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0031, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0032, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0033, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0034, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0035, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0036, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0015, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x000f, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x000e, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0010, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0011, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0012, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0013, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x0014, LIGHTOP_1, 0x02, 0x00, 0x00) - set_lights_state(0x000d, LIGHTOP_1, 0x02, 0x00, 0x00) + set_lights_state(0x0019, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x001a, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x001b, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x001c, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x001d, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x001e, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x001f, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0020, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0021, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0017, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0018, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0016, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0022, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0023, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0024, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0025, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0026, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0027, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0028, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0029, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x002a, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x002b, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x002c, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x002d, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x002e, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x002f, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0030, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0031, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0032, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0033, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0034, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0035, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0036, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0015, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x000f, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x000e, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0010, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0011, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0012, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0013, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x0014, LIGHTOP_SET, 2, 0, 0) + set_lights_state(0x000d, LIGHTOP_SET, 2, 0, 0) set_ailist(CHR_SELF, GAILIST_IDLE) endlist }; diff --git a/src/setups/setupazt.c b/src/setups/setupazt.c index 574517222..37befec22 100644 --- a/src/setups/setupazt.c +++ b/src/setups/setupazt.c @@ -1971,21 +1971,21 @@ u8 func0421_starting_area_guard[] = { u8 func1010_set_cave_lights[] = { yield - set_lights_state(ROOM_AZT_0064, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_0063, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_0062, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_0061, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_0060, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_005F, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_005E, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_005D, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_005C, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_005B, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_005A, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_0059, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_0053, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_0058, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(ROOM_AZT_0056, LIGHTOP_1, 0x06, 0x00, 0x00) + set_lights_state(ROOM_AZT_0064, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_0063, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_0062, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_0061, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_0060, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_005F, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_005E, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_005D, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_005C, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_005B, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_005A, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_0059, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_0053, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_0058, LIGHTOP_SET, 6, 0, 0) + set_lights_state(ROOM_AZT_0056, LIGHTOP_SET, 6, 0, 0) set_ailist(CHR_SELF, GAILIST_IDLE) endlist }; diff --git a/src/setups/setupcave.c b/src/setups/setupcave.c index 95c16f7d2..a2e0bd17f 100644 --- a/src/setups/setupcave.c +++ b/src/setups/setupcave.c @@ -1790,12 +1790,12 @@ u8 func1007_console_activation[] = { label(0x00) \ yield \ mute_channel(CHANNEL_6) \ - set_lights_state(0x0039, LIGHTOP_3, 0x78, 0xff, 0x3c) \ - set_lights_state(0x003a, LIGHTOP_3, 0x78, 0xff, 0x3c) \ - set_lights_state(0x003b, LIGHTOP_3, 0x78, 0xff, 0x3c) \ - set_lights_state(0x0041, LIGHTOP_3, 0x78, 0xff, 0x3c) \ - set_lights_state(0x0042, LIGHTOP_3, 0x78, 0xff, 0x3c) \ - set_lights_state(0x0043, LIGHTOP_3, 0x78, 0xff, 0x3c) \ + set_lights_state(0x0039, LIGHTOP_TRANSITION, 120, 255, 60) \ + set_lights_state(0x003a, LIGHTOP_TRANSITION, 120, 255, 60) \ + set_lights_state(0x003b, LIGHTOP_TRANSITION, 120, 255, 60) \ + set_lights_state(0x0041, LIGHTOP_TRANSITION, 120, 255, 60) \ + set_lights_state(0x0042, LIGHTOP_TRANSITION, 120, 255, 60) \ + set_lights_state(0x0043, LIGHTOP_TRANSITION, 120, 255, 60) \ \ beginloop(0x65) \ if_stage_flag_eq(STAGEFLAG_SUITCASE_DEPOSITED, TRUE, /*goto*/ 0x08) \ @@ -1809,12 +1809,12 @@ u8 func1007_console_activation[] = { \ /* In hallway with weapons */ \ label(0x31) \ - set_lights_state(0x0039, LIGHTOP_4, 0x00, 0xff, 0x3c) \ - set_lights_state(0x003a, LIGHTOP_4, 0x00, 0xff, 0x3c) \ - set_lights_state(0x003b, LIGHTOP_4, 0x00, 0xff, 0x3c) \ - set_lights_state(0x0041, LIGHTOP_4, 0x00, 0xff, 0x3c) \ - set_lights_state(0x0042, LIGHTOP_4, 0x00, 0xff, 0x3c) \ - set_lights_state(0x0043, LIGHTOP_4, 0x00, 0xff, 0x3c) \ + set_lights_state(0x0039, LIGHTOP_SINELOOP, 0, 255, 60) \ + set_lights_state(0x003a, LIGHTOP_SINELOOP, 0, 255, 60) \ + set_lights_state(0x003b, LIGHTOP_SINELOOP, 0, 255, 60) \ + set_lights_state(0x0041, LIGHTOP_SINELOOP, 0, 255, 60) \ + set_lights_state(0x0042, LIGHTOP_SINELOOP, 0, 255, 60) \ + set_lights_state(0x0043, LIGHTOP_SINELOOP, 0, 255, 60) \ play_sound(SFX_ALARM_INFILTRATION, CHANNEL_6) \ restart_timer \ \ @@ -1834,12 +1834,12 @@ u8 func1007_console_activation[] = { /* In hallway with weapons for over 60 frames */ \ label(0x02) \ restart_timer \ - set_lights_state(0x0039, LIGHTOP_4, 0x00, 0xff, 0x32) \ - set_lights_state(0x003a, LIGHTOP_4, 0x00, 0xff, 0x32) \ - set_lights_state(0x003b, LIGHTOP_4, 0x00, 0xff, 0x32) \ - set_lights_state(0x0041, LIGHTOP_4, 0x00, 0xff, 0x32) \ - set_lights_state(0x0042, LIGHTOP_4, 0x00, 0xff, 0x32) \ - set_lights_state(0x0043, LIGHTOP_4, 0x00, 0xff, 0x32) \ + set_lights_state(0x0039, LIGHTOP_SINELOOP, 0, 255, 50) \ + set_lights_state(0x003a, LIGHTOP_SINELOOP, 0, 255, 50) \ + set_lights_state(0x003b, LIGHTOP_SINELOOP, 0, 255, 50) \ + set_lights_state(0x0041, LIGHTOP_SINELOOP, 0, 255, 50) \ + set_lights_state(0x0042, LIGHTOP_SINELOOP, 0, 255, 50) \ + set_lights_state(0x0043, LIGHTOP_SINELOOP, 0, 255, 50) \ \ beginloop(0x05) \ if_timer_gt(40, /*goto*/ 0x02) \ @@ -1857,12 +1857,12 @@ u8 func1007_console_activation[] = { /* In hallway with weapons for over 100 frames */ \ label(0x02) \ restart_timer \ - set_lights_state(0x0039, LIGHTOP_4, 0x00, 0xff, 0x28) \ - set_lights_state(0x003a, LIGHTOP_4, 0x00, 0xff, 0x28) \ - set_lights_state(0x003b, LIGHTOP_4, 0x00, 0xff, 0x28) \ - set_lights_state(0x0041, LIGHTOP_4, 0x00, 0xff, 0x28) \ - set_lights_state(0x0042, LIGHTOP_4, 0x00, 0xff, 0x28) \ - set_lights_state(0x0043, LIGHTOP_4, 0x00, 0xff, 0x28) \ + set_lights_state(0x0039, LIGHTOP_SINELOOP, 0, 255, 40) \ + set_lights_state(0x003a, LIGHTOP_SINELOOP, 0, 255, 40) \ + set_lights_state(0x003b, LIGHTOP_SINELOOP, 0, 255, 40) \ + set_lights_state(0x0041, LIGHTOP_SINELOOP, 0, 255, 40) \ + set_lights_state(0x0042, LIGHTOP_SINELOOP, 0, 255, 40) \ + set_lights_state(0x0043, LIGHTOP_SINELOOP, 0, 255, 40) \ \ beginloop(0x06) \ if_timer_gt(1, /*goto*/ 0x02) \ @@ -1880,12 +1880,12 @@ u8 func1007_console_activation[] = { /* In hallway with weapons for over 101 frames */ \ label(0x02) \ restart_timer \ - set_lights_state(0x0039, LIGHTOP_4, 0x00, 0xff, 0x1e) \ - set_lights_state(0x003a, LIGHTOP_4, 0x00, 0xff, 0x1e) \ - set_lights_state(0x003b, LIGHTOP_4, 0x00, 0xff, 0x1e) \ - set_lights_state(0x0041, LIGHTOP_4, 0x00, 0xff, 0x1e) \ - set_lights_state(0x0042, LIGHTOP_4, 0x00, 0xff, 0x1e) \ - set_lights_state(0x0043, LIGHTOP_4, 0x00, 0xff, 0x1e) \ + set_lights_state(0x0039, LIGHTOP_SINELOOP, 0, 255, 30) \ + set_lights_state(0x003a, LIGHTOP_SINELOOP, 0, 255, 30) \ + set_lights_state(0x003b, LIGHTOP_SINELOOP, 0, 255, 30) \ + set_lights_state(0x0041, LIGHTOP_SINELOOP, 0, 255, 30) \ + set_lights_state(0x0042, LIGHTOP_SINELOOP, 0, 255, 30) \ + set_lights_state(0x0043, LIGHTOP_SINELOOP, 0, 255, 30) \ \ beginloop(0x07) \ yield \ @@ -4347,7 +4347,7 @@ u8 func1032_unhide_guards_near_plane[] = { u8 func1420_setup_portals[] = { yield - set_room_flag(0x0080, ROOMFLAG_0800) + set_room_flag(0x0080, ROOMFLAG_BBOXHACK) set_ailist(CHR_SELF, GAILIST_IDLE) endlist }; diff --git a/src/setups/setupdam.c b/src/setups/setupdam.c index 593fe9a78..df22e5b8c 100644 --- a/src/setups/setupdam.c +++ b/src/setups/setupdam.c @@ -1126,7 +1126,7 @@ u8 func100a_reactor_switch[] = { mute_channel(CHANNEL_1) assign_sound(SFX_8147, CHANNEL_0) control_sound_from_object(CHANNEL_0, OBJ_REACTOR_SWITCH, TRUE) - set_lights_state(0x007f, LIGHTOP_3, 0xff, 0x06, 0x78) + set_lights_state(0x007f, LIGHTOP_TRANSITION, 255, 6, 120) set_object_image(OBJ_REACTOR_SWITCH, 0, TVCMDLIST_12) set_object_image(OBJ_REACTOR_SWITCH, 1, TVCMDLIST_12) set_object_image(OBJ_REACTOR_SWITCH, 2, TVCMDLIST_12) diff --git a/src/setups/setupdepo.c b/src/setups/setupdepo.c index bb9663b86..cc4f31489 100644 --- a/src/setups/setupdepo.c +++ b/src/setups/setupdepo.c @@ -2425,28 +2425,28 @@ u8 func101b_cloak2_entry[] = { if_stage_flag_eq(STAGEFLAG_LIGHTS_OFF, TRUE, /*goto*/ 0x2c) play_sound(SFX_8147, -1) restart_timer - set_lights_state(0x000b, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x000c, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x000d, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x000e, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0010, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x000f, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0011, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0012, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0013, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0014, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0015, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0017, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0018, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0001, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0003, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0004, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0005, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0006, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0007, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0008, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0009, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x000a, LIGHTOP_3, 0xff, 0x06, 0x78) + set_lights_state(0x000b, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x000c, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x000d, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x000e, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0010, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x000f, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0011, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0012, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0013, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0014, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0015, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0017, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0018, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0001, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0003, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0004, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0005, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0006, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0007, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0008, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0009, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x000a, LIGHTOP_TRANSITION, 255, 6, 120) // Wait 2 seconds beginloop(0x09) @@ -2454,54 +2454,54 @@ u8 func101b_cloak2_entry[] = { endloop(0x09) label(0x06) - set_lights_state(0x000b, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x000c, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x000d, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x000e, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0010, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x000f, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0011, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0012, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0013, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0014, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0015, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0017, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0018, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0001, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0003, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0004, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0005, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0006, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0007, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0008, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0009, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x000a, LIGHTOP_1, 0x0a, 0x00, 0x00) + set_lights_state(0x000b, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x000c, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x000d, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x000e, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0010, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x000f, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0011, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0012, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0013, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0014, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0015, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0017, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0018, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0001, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0003, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0004, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0005, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0006, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0007, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0008, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0009, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x000a, LIGHTOP_SET, 10, 0, 0) goto_next(0x07) label(0x2c) play_sound(SFX_8148, -1) - set_lights_state(0x000b, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x000c, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x000d, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x000e, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0010, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x000f, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0011, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0012, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0013, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0014, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0015, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0017, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0018, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0001, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0003, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0004, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0005, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0006, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0007, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0008, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0009, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x000a, LIGHTOP_3, 0x06, 0xff, 0x78) + set_lights_state(0x000b, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x000c, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x000d, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x000e, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0010, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x000f, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0011, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0012, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0013, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0014, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0015, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0017, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0018, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0001, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0003, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0004, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0005, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0006, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0007, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0008, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0009, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x000a, LIGHTOP_TRANSITION, 6, 255, 120) // Wait 2 seconds restart_timer @@ -2511,28 +2511,28 @@ u8 func101b_cloak2_entry[] = { endloop(0x0a) label(0x06) - set_lights_state(0x000b, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x000c, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x000d, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x000e, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0010, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x000f, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0011, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0012, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0013, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0014, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0015, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0017, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0018, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0001, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0003, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0004, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0005, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0006, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0007, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0008, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0009, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x000a, LIGHTOP_1, 0xff, 0x00, 0x00) + set_lights_state(0x000b, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x000c, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x000d, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x000e, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0010, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x000f, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0011, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0012, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0013, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0014, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0015, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0017, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0018, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0001, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0003, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0004, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0005, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0006, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0007, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0008, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0009, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x000a, LIGHTOP_SET, 255, 0, 0) label(0x07) unset_chr_chrflag(CHR_CLOAK_2A, CHRCFLAG_HIDDEN) @@ -2744,28 +2744,28 @@ u8 func1022_light_switch[] = { yield set_object_image(OBJ_LIGHTSWITCH, 0, TVCMDLIST_14) play_sound(SFX_8147, -1) - set_lights_state(0x000b, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x000c, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x000d, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x000e, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0010, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x000f, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0011, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0012, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0013, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0014, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0015, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0017, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0018, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0001, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0003, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0004, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0005, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0006, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0007, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0008, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x0009, LIGHTOP_3, 0xff, 0x06, 0x78) - set_lights_state(0x000a, LIGHTOP_3, 0xff, 0x06, 0x78) + set_lights_state(0x000b, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x000c, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x000d, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x000e, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0010, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x000f, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0011, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0012, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0013, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0014, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0015, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0017, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0018, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0001, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0003, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0004, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0005, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0006, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0007, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0008, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x0009, LIGHTOP_TRANSITION, 255, 6, 120) + set_lights_state(0x000a, LIGHTOP_TRANSITION, 255, 6, 120) restart_timer @@ -2774,28 +2774,28 @@ u8 func1022_light_switch[] = { endloop(0x09) label(0x06) - set_lights_state(0x000b, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x000c, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x000d, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x000e, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0010, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x000f, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0011, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0012, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0013, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0014, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0015, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0017, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0018, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0001, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0003, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0004, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0005, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0006, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0007, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0008, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x0009, LIGHTOP_1, 0x0a, 0x00, 0x00) - set_lights_state(0x000a, LIGHTOP_1, 0x0a, 0x00, 0x00) + set_lights_state(0x000b, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x000c, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x000d, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x000e, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0010, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x000f, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0011, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0012, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0013, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0014, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0015, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0017, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0018, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0001, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0003, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0004, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0005, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0006, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0007, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0008, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x0009, LIGHTOP_SET, 10, 0, 0) + set_lights_state(0x000a, LIGHTOP_SET, 10, 0, 0) goto_first(0x04) // Turning lights on @@ -2806,28 +2806,28 @@ u8 func1022_light_switch[] = { yield play_sound(SFX_8148, -1) set_object_image(0x3d, 0, TVCMDLIST_06) - set_lights_state(0x000b, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x000c, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x000d, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x000e, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0010, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x000f, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0011, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0012, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0013, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0014, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0015, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0017, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0018, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0001, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0003, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0004, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0005, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0006, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0007, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0008, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0009, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x000a, LIGHTOP_3, 0x06, 0xff, 0x78) + set_lights_state(0x000b, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x000c, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x000d, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x000e, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0010, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x000f, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0011, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0012, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0013, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0014, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0015, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0017, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0018, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0001, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0003, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0004, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0005, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0006, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0007, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0008, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0009, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x000a, LIGHTOP_TRANSITION, 6, 255, 120) restart_timer @@ -2836,28 +2836,28 @@ u8 func1022_light_switch[] = { endloop(0x0a) label(0x06) - set_lights_state(0x000b, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x000c, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x000d, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x000e, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0010, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x000f, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0011, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0012, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0013, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0014, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0015, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0017, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0018, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0001, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0003, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0004, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0005, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0006, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0007, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0008, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0009, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x000a, LIGHTOP_1, 0xff, 0x00, 0x00) + set_lights_state(0x000b, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x000c, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x000d, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x000e, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0010, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x000f, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0011, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0012, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0013, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0014, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0015, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0017, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0018, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0001, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0003, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0004, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0005, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0006, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0007, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0008, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0009, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x000a, LIGHTOP_SET, 255, 0, 0) endloop(0x04) endlist diff --git a/src/setups/setupdish.c b/src/setups/setupdish.c index ab503eb54..dfe7410c3 100644 --- a/src/setups/setupdish.c +++ b/src/setups/setupdish.c @@ -943,14 +943,14 @@ u8 func1003_devicetraining_nightvision[] = { endloop(0x08) label(0x81) - set_lights_state(0x0030, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x002e, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x002f, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x0020, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x0024, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x0025, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x0026, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x0022, LIGHTOP_1, 0x00, 0x00, 0x00) + set_lights_state(0x0030, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x002e, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x002f, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x0020, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x0024, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x0025, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x0026, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x0022, LIGHTOP_SET, 0, 0, 0) set_stage_flag(STAGEFLAG_IN_TRAINING) lock_door(0x31, 0x40) lock_door(0x8a, 0x40) @@ -1022,14 +1022,14 @@ u8 func1003_devicetraining_nightvision[] = { label(0x2f) #if VERSION >= VERSION_NTSC_1_0 play_sound(SFX_PRESS_SWITCH, -1) - set_lights_state(0x0030, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x002e, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x002f, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0020, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0024, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0025, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0026, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0022, LIGHTOP_1, 0xff, 0x00, 0x00) + set_lights_state(0x0030, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x002e, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x002f, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0020, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0024, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0025, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0026, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0022, LIGHTOP_SET, 255, 0, 0) #endif remove_hudmsgs show_hudmsg(CHR_BOND, L_DISH_023) // "Lights have been reactivated." @@ -1048,14 +1048,14 @@ u8 func1003_devicetraining_nightvision[] = { set_savefile_flag(GAMEFILEFLAG_CI_NIGHTVISION_DONE) dprint 'd','o','n','e',0, set_stage_flag(STAGEFLAG_TRIGGER_DEVICE_SUCCESS) - set_lights_state(0x0030, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x002e, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x002f, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0020, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0024, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0025, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0026, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0022, LIGHTOP_1, 0xff, 0x00, 0x00) + set_lights_state(0x0030, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x002e, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x002f, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0020, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0024, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0025, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0026, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0022, LIGHTOP_SET, 255, 0, 0) yield label(0x84) if_chr_in_room(CHR_BOND, 0x00, 0x001e, /*goto*/ 0x90) @@ -2788,14 +2788,14 @@ u8 func100e_training_unlockables[] = { endloop(0x0a) label(0x2f) - set_lights_state(0x0030, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x002e, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x002f, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0020, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0024, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0025, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0026, LIGHTOP_1, 0xff, 0x00, 0x00) - set_lights_state(0x0022, LIGHTOP_1, 0xff, 0x00, 0x00) + set_lights_state(0x0030, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x002e, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x002f, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0020, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0024, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0025, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0026, LIGHTOP_SET, 255, 0, 0) + set_lights_state(0x0022, LIGHTOP_SET, 255, 0, 0) beginloop(0x0b) if_savefile_flag_is_set(GAMEFILEFLAG_CI_DOORDECODER_DONE, /*goto*/ 0x2f) @@ -6054,10 +6054,10 @@ s32 path00[] = { u8 func1032_setup_lifts[] = { activate_lift(1, 0x43) activate_lift(2, 0x44) - set_lights_state(0x0007, LIGHTOP_1, 0x32, 0x00, 0x00) - set_lights_state(0x0008, LIGHTOP_1, 0x32, 0x00, 0x00) - set_lights_state(0x0009, LIGHTOP_1, 0x32, 0x00, 0x00) - set_lights_state(0x000a, LIGHTOP_1, 0x19, 0x00, 0x00) + set_lights_state(0x0007, LIGHTOP_SET, 50, 0, 0) + set_lights_state(0x0008, LIGHTOP_SET, 50, 0, 0) + set_lights_state(0x0009, LIGHTOP_SET, 50, 0, 0) + set_lights_state(0x000a, LIGHTOP_SET, 25, 0, 0) set_ailist(CHR_SELF, GAILIST_IDLE) endlist }; diff --git a/src/setups/setupeld.c b/src/setups/setupeld.c index add007009..641767d66 100644 --- a/src/setups/setupeld.c +++ b/src/setups/setupeld.c @@ -3022,12 +3022,12 @@ u8 func101f_check_one_basement_guard_remaining[] = { */ u8 func1420_setup_portals[] = { yield - set_room_flag(0x0050, ROOMFLAG_0800) - set_room_flag(0x0052, ROOMFLAG_0800) - set_room_flag(0x006c, ROOMFLAG_0800) - set_room_flag(0x004d, ROOMFLAG_0800) - set_room_flag(0x0065, ROOMFLAG_0800) - set_room_flag(0x0059, ROOMFLAG_0800) + set_room_flag(0x0050, ROOMFLAG_BBOXHACK) + set_room_flag(0x0052, ROOMFLAG_BBOXHACK) + set_room_flag(0x006c, ROOMFLAG_BBOXHACK) + set_room_flag(0x004d, ROOMFLAG_BBOXHACK) + set_room_flag(0x0065, ROOMFLAG_BBOXHACK) + set_room_flag(0x0059, ROOMFLAG_BBOXHACK) set_ailist(CHR_SELF, GAILIST_IDLE) endlist }; diff --git a/src/setups/setuplee.c b/src/setups/setuplee.c index 24b10e70d..6b06eac75 100644 --- a/src/setups/setuplee.c +++ b/src/setups/setuplee.c @@ -2052,7 +2052,7 @@ u8 func100b_msg_getshieldsdown[] = { }; u8 func100c_engineroom[] = { - set_lights_state(0x0067, LIGHTOP_4, 0x46, 0xff, 0xfa) + set_lights_state(0x0067, LIGHTOP_SINELOOP, 70, 255, 250) // Wait until both engines destroyed beginloop(0x04) diff --git a/src/setups/setuplip.c b/src/setups/setuplip.c index e390c8dab..b17f6d3b3 100644 --- a/src/setups/setuplip.c +++ b/src/setups/setuplip.c @@ -2338,14 +2338,14 @@ u8 func041b_labtech_keycardguy[] = { }; u8 func100c_keycardguy_lights[] = { - set_lights_state(0x0088, LIGHTOP_1, 0x00, 0x00, 0x00) + set_lights_state(0x0088, LIGHTOP_SET, 0, 0, 0) beginloop(0x04) if_stage_flag_eq(STAGEFLAG_KEYCARDGUY_ANGRY, TRUE, /*goto*/ LABEL_2D) endloop(0x04) label(LABEL_2D) - set_lights_state(0x0088, LIGHTOP_1, 0x64, 0x00, 0x00) + set_lights_state(0x0088, LIGHTOP_SET, 100, 0, 0) set_ailist(CHR_SELF, GAILIST_IDLE) endlist }; diff --git a/src/setups/setuplue.c b/src/setups/setuplue.c index c0f2b178a..db7f8a060 100644 --- a/src/setups/setuplue.c +++ b/src/setups/setuplue.c @@ -2201,7 +2201,7 @@ u8 func1010_bunker_lighting[] = { yield assign_sound(SFX_ALARM_INFILTRATION, CHANNEL_0) play_sound_from_object(CHANNEL_0, 0x10, 1, 800, 1100) - set_lights_state(0x0009, LIGHTOP_3, 0xff, 0x32, 0x78) + set_lights_state(0x0009, LIGHTOP_TRANSITION, 255, 50, 120) if_difficulty_lt(DIFF_SA, /*goto*/ 0x0e) restart_timer diff --git a/src/setups/setuppam.c b/src/setups/setuppam.c index 0c2dc6ab3..1721d5ede 100644 --- a/src/setups/setuppam.c +++ b/src/setups/setuppam.c @@ -901,7 +901,7 @@ u8 func0402_elvis_follow_and_reactive_teleportals[] = { set_stage_flag(STAGEFLAG_TELEPORTALS_ACTIVATED) set_self_chrflag(CHRCFLAG_PUSHABLE) play_sound(SFX_8148, -1) - set_lights_state(0x003c, LIGHTOP_4, 0x00, 0xff, 0xb4) + set_lights_state(0x003c, LIGHTOP_SINELOOP, 0, 255, 180) set_chr_chrflag(0x14, CHRCFLAG_NEVERSLEEP) set_chr_chrflag(0x15, CHRCFLAG_NEVERSLEEP) set_chr_chrflag(0x16, CHRCFLAG_NEVERSLEEP) @@ -1064,7 +1064,7 @@ u8 func0404_elvis_follow_and_do_agent_megaweapon[] = { show_hudmsg(CHR_BOND, L_PAM_020) // "Cetan megaweapon has been disabled." set_stage_flag(STAGEFLAG_AGENT_MEGAWEAPON_DISABLED) set_stage_flag(STAGEFLAG_MEGAWEAPON_DISABLED) - set_lights_state(0x006c, LIGHTOP_3, 0x64, 0xff, 0x78) + set_lights_state(0x006c, LIGHTOP_TRANSITION, 100, 255, 120) assign_sound(SFX_8148, CHANNEL_7) play_sound_from_entity(CHANNEL_7, CHR_SELF, 0x0bb8, 0x1770, 0x01) unlock_door(0xb7, 0x02) @@ -3672,17 +3672,17 @@ u8 func041e_init_sa_megaweapon_miniskedar[] = { set_ailist(CHR_SELF, 0x0408) u8 func1013_pa_doorcylinder1[] = { - set_lights_state(0x00a1, LIGHTOP_4, 0x00, 0xff, 0xb4) - set_lights_state(0x00a9, LIGHTOP_4, 0x00, 0xff, 0xb4) - set_lights_state(0x00ac, LIGHTOP_4, 0x00, 0xff, 0xb4) - set_lights_state(0x00b4, LIGHTOP_4, 0x00, 0xff, 0xb4) - set_lights_state(0x00b7, LIGHTOP_4, 0x00, 0xff, 0xb4) - set_lights_state(0x00bf, LIGHTOP_4, 0x00, 0xff, 0xb4) - set_lights_state(0x00c0, LIGHTOP_4, 0x00, 0xff, 0xb4) - set_lights_state(0x00c1, LIGHTOP_4, 0x00, 0xff, 0xb4) - set_lights_state(0x00c2, LIGHTOP_4, 0x00, 0xff, 0xb4) - set_lights_state(0x00c3, LIGHTOP_4, 0x00, 0xff, 0xb4) - set_lights_state(0x006c, LIGHTOP_4, 0x00, 0xff, 0xf0) + set_lights_state(0x00a1, LIGHTOP_SINELOOP, 0, 255, 180) + set_lights_state(0x00a9, LIGHTOP_SINELOOP, 0, 255, 180) + set_lights_state(0x00ac, LIGHTOP_SINELOOP, 0, 255, 180) + set_lights_state(0x00b4, LIGHTOP_SINELOOP, 0, 255, 180) + set_lights_state(0x00b7, LIGHTOP_SINELOOP, 0, 255, 180) + set_lights_state(0x00bf, LIGHTOP_SINELOOP, 0, 255, 180) + set_lights_state(0x00c0, LIGHTOP_SINELOOP, 0, 255, 180) + set_lights_state(0x00c1, LIGHTOP_SINELOOP, 0, 255, 180) + set_lights_state(0x00c2, LIGHTOP_SINELOOP, 0, 255, 180) + set_lights_state(0x00c3, LIGHTOP_SINELOOP, 0, 255, 180) + set_lights_state(0x006c, LIGHTOP_SINELOOP, 0, 255, 240) doorcylinder_logic(0x11, 0x12, 0x13, 0x9c, STAGEFLAG_PA_EARLYDOORCYLINDER1_DESTROYED) endlist @@ -3731,12 +3731,12 @@ u8 func0408_check_pa_earlydoorcylinders_destroyed[] = { endloop(0x08) label(0x06) - set_lights_state(0x008b, LIGHTOP_3, 0xff, 0x0a, 0x78) - set_lights_state(0x00bf, LIGHTOP_3, 0xff, 0x0a, 0x78) - set_lights_state(0x00c0, LIGHTOP_3, 0xff, 0x0a, 0x78) - set_lights_state(0x00c1, LIGHTOP_3, 0xff, 0x0a, 0x78) - set_lights_state(0x00c2, LIGHTOP_3, 0xff, 0x0a, 0x78) - set_lights_state(0x00c3, LIGHTOP_3, 0xff, 0x0a, 0x78) + set_lights_state(0x008b, LIGHTOP_TRANSITION, 255, 10, 120) + set_lights_state(0x00bf, LIGHTOP_TRANSITION, 255, 10, 120) + set_lights_state(0x00c0, LIGHTOP_TRANSITION, 255, 10, 120) + set_lights_state(0x00c1, LIGHTOP_TRANSITION, 255, 10, 120) + set_lights_state(0x00c2, LIGHTOP_TRANSITION, 255, 10, 120) + set_lights_state(0x00c3, LIGHTOP_TRANSITION, 255, 10, 120) open_door(0x09) open_door(0x0a) goto_first(0x08) @@ -3803,7 +3803,7 @@ u8 func0408_check_pa_earlydoorcylinders_destroyed[] = { u8 func1018_pa_door1[] = { pa_cylinder(0x20, 0xa1) set_stage_flag(STAGEFLAG_PA_MIDDOORCYLINDER_DESTROYED) - set_lights_state(0x00a1, LIGHTOP_3, 0xff, 0x0a, 0x78) + set_lights_state(0x00a1, LIGHTOP_TRANSITION, 255, 10, 120) beginloop(0x08) if_door_state(0x0b, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06) @@ -3850,7 +3850,7 @@ u8 func0409_check_pa_latedoorcylinders_destroyed[] = { u8 func1019_pa_door2[] = { pa_cylinder(0x2c, 0xa2) - set_lights_state(0x00a9, LIGHTOP_3, 0xff, 0x0a, 0x78) + set_lights_state(0x00a9, LIGHTOP_TRANSITION, 255, 10, 120) label(0x08) set_stage_flag(STAGEFLAG_PA_LATEDOORCYLINDER1_DESTROYED) set_ailist(CHR_SELF, 0x0409) @@ -3859,7 +3859,7 @@ u8 func1019_pa_door2[] = { u8 func101a_pa_door3[] = { pa_cylinder(0x38, 0xa3) - set_lights_state(0x00ac, LIGHTOP_3, 0xff, 0x0a, 0x78) + set_lights_state(0x00ac, LIGHTOP_TRANSITION, 255, 10, 120) label(0x08) set_stage_flag(STAGEFLAG_PA_LATEDOORCYLINDER2_DESTROYED) set_ailist(CHR_SELF, 0x0409) @@ -3868,7 +3868,7 @@ u8 func101a_pa_door3[] = { u8 func101b_pa_door4[] = { pa_cylinder(0x44, 0xa4) - set_lights_state(0x00b4, LIGHTOP_3, 0xff, 0x0a, 0x78) + set_lights_state(0x00b4, LIGHTOP_TRANSITION, 255, 10, 120) label(0x08) set_stage_flag(STAGEFLAG_PA_LATEDOORCYLINDER3_DESTROYED) set_ailist(CHR_SELF, 0x0409) @@ -3934,7 +3934,7 @@ u8 func101c_pa_door5[] = { destroy_object(0x59) destroy_object(0x5a) - set_lights_state(0x00b7, LIGHTOP_3, 0xff, 0x0a, 0x78) + set_lights_state(0x00b7, LIGHTOP_TRANSITION, 255, 10, 120) label(0x08) set_stage_flag(STAGEFLAG_PA_LATEDOORCYLINDER4_DESTROYED) set_ailist(CHR_SELF, 0x0409) @@ -3969,7 +3969,7 @@ u8 func040a_check_pa_canisters_destroyed[] = { // Both canisters destroyed label(0x2e) set_object_flag(0x0f, OBJFLAG_DOOR_KEEPOPEN) - set_lights_state(0x00bc, LIGHTOP_3, 0xff, 0x0a, 0x78) + set_lights_state(0x00bc, LIGHTOP_TRANSITION, 255, 10, 120) beginloop(0x08) if_door_state(0x0f, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ 0x06) @@ -4540,7 +4540,7 @@ u8 func0432_dead_skedar[] = { }; u8 unregistered_function2[] = { - set_lights_state(0x0009, LIGHTOP_4, 0x00, 0xff, 0xfa) + set_lights_state(0x0009, LIGHTOP_SINELOOP, 0, 255, 250) beginloop(0x08) endloop(0x08) diff --git a/src/setups/setupsho.c b/src/setups/setupsho.c index 14306a3ce..46c0c5b56 100644 --- a/src/setups/setupsho.c +++ b/src/setups/setupsho.c @@ -1519,38 +1519,38 @@ u8 func1009_altar[] = { label(0x0f) unlock_door(0x09, 0x02) unlock_door(0x0a, 0x02) - set_lights_state(0x0060, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0061, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0062, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0063, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0064, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0065, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0066, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0067, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0068, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0069, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x006a, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x006b, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x006c, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x006d, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x006e, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x006f, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0070, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0071, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0072, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0073, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0074, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0075, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0076, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0077, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0078, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x0079, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x007a, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x007b, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x007c, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x007d, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x007e, LIGHTOP_3, 0x06, 0x80, 0x78) - set_lights_state(0x007f, LIGHTOP_3, 0x06, 0x80, 0x78) + set_lights_state(0x0060, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0061, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0062, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0063, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0064, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0065, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0066, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0067, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0068, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0069, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x006a, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x006b, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x006c, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x006d, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x006e, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x006f, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0070, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0071, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0072, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0073, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0074, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0075, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0076, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0077, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0078, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x0079, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x007a, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x007b, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x007c, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x007d, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x007e, LIGHTOP_TRANSITION, 6, 128, 120) + set_lights_state(0x007f, LIGHTOP_TRANSITION, 6, 128, 120) restart_timer beginloop(0x0e) @@ -1575,36 +1575,36 @@ u8 func101c_setup_corridor_lighting[] = { label(0x04) yield label(0x2d) - set_lights_state(0x0060, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0061, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0062, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0063, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0064, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0065, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0066, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0067, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0068, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0069, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x006a, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x006b, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x006c, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x006d, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x006e, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x006f, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0070, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0071, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0072, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0073, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0074, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0076, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0078, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0079, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x007a, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x007b, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x007c, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x007d, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x007e, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x007f, LIGHTOP_1, 0x06, 0x00, 0x00) + set_lights_state(0x0060, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0061, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0062, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0063, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0064, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0065, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0066, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0067, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0068, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0069, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x006a, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x006b, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x006c, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x006d, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x006e, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x006f, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0070, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0071, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0072, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0073, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0074, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0076, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0078, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0079, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x007a, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x007b, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x007c, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x007d, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x007e, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x007f, LIGHTOP_SET, 6, 0, 0) yield set_ailist(CHR_SELF, GAILIST_IDLE) @@ -1616,38 +1616,38 @@ u8 func101c_setup_corridor_lighting[] = { endloop(0x08) label(0x2d) - set_lights_state(0x0060, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0061, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0062, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0063, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0064, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0065, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0066, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0067, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0068, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0069, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x006a, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x006b, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x006c, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x006d, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x006e, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x006f, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0070, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0071, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0072, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0073, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0074, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0075, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0076, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0077, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0078, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0079, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x007a, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x007b, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x007c, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x007d, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x007e, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x007f, LIGHTOP_3, 0x06, 0xff, 0x78) + set_lights_state(0x0060, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0061, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0062, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0063, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0064, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0065, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0066, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0067, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0068, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0069, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x006a, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x006b, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x006c, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x006d, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x006e, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x006f, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0070, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0071, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0072, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0073, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0074, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0075, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0076, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0077, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0078, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0079, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x007a, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x007b, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x007c, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x007d, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x007e, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x007f, LIGHTOP_TRANSITION, 6, 255, 120) goto_first(0x59) set_ailist(CHR_SELF, GAILIST_IDLE) @@ -1833,8 +1833,8 @@ u8 func100a_army_room[] = { #if VERSION >= VERSION_NTSC_1_0 yield #endif - set_lights_state(0x0082, LIGHTOP_1, 0x06, 0x00, 0x00) - set_lights_state(0x0087, LIGHTOP_1, 0x06, 0x00, 0x00) + set_lights_state(0x0082, LIGHTOP_SET, 6, 0, 0) + set_lights_state(0x0087, LIGHTOP_SET, 6, 0, 0) beginloop(0x04) chr_toggle_p1p2(CHR_SELF) @@ -1862,8 +1862,8 @@ u8 func100a_army_room[] = { endloop(0x08) label(0x06) - set_lights_state(0x0082, LIGHTOP_3, 0x06, 0xff, 0x78) - set_lights_state(0x0087, LIGHTOP_3, 0x06, 0xff, 0x78) + set_lights_state(0x0082, LIGHTOP_TRANSITION, 6, 255, 120) + set_lights_state(0x0087, LIGHTOP_TRANSITION, 6, 255, 120) set_stage_flag(STAGEFLAG_TRIGGER_SKEDAR_ARMY) play_x_track(XREASON_DEFAULT, 10, 60) set_ailist(CHR_SELF, GAILIST_IDLE) diff --git a/src/setups/setupwax.c b/src/setups/setupwax.c index d1d2b6d93..499ef50eb 100644 --- a/src/setups/setupwax.c +++ b/src/setups/setupwax.c @@ -1199,33 +1199,33 @@ u8 func1002_lightswitch[] = { // Turning lights off set_stage_flag(STAGEFLAG_LIGHTS_OFF) - set_lights_state(0x0044, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x0039, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x003c, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x003d, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x003e, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x003b, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x0042, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x003f, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x003a, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x0041, LIGHTOP_1, 0x00, 0x00, 0x00) - set_lights_state(0x0040, LIGHTOP_1, 0x00, 0x00, 0x00) + set_lights_state(0x0044, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x0039, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x003c, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x003d, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x003e, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x003b, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x0042, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x003f, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x003a, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x0041, LIGHTOP_SET, 0, 0, 0) + set_lights_state(0x0040, LIGHTOP_SET, 0, 0, 0) reloop(0x04) // Turning lights on label(0x06) unset_stage_flag(STAGEFLAG_LIGHTS_OFF) - set_lights_state(0x0044, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0039, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x003c, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x003d, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x003e, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x003b, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0042, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x003f, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x003a, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0041, LIGHTOP_1, 0x64, 0x00, 0x00) - set_lights_state(0x0040, LIGHTOP_1, 0x64, 0x00, 0x00) + set_lights_state(0x0044, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0039, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x003c, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x003d, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x003e, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x003b, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0042, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x003f, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x003a, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0041, LIGHTOP_SET, 100, 0, 0) + set_lights_state(0x0040, LIGHTOP_SET, 100, 0, 0) endloop(0x04) endlist @@ -1557,7 +1557,7 @@ u8 func1006_lift_disabling[] = { // Disable player's lift label(0x06) - set_lights_state(0x0082, LIGHTOP_2, 0x00, 0x78, 0x00) + set_lights_state(0x0082, LIGHTOP_SETRANDOM, 0, 120, 0) play_sound(SFX_8147, -1) set_object_flag(OBJ_BLONDE_LIFT, OBJFLAG_DEACTIVATED) unlock_door(0x50, 0x40)