From 5c5e7430cd6314840a3227ad50542deec3d5fe9b Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Mon, 10 Jul 2023 15:40:45 -0400 Subject: [PATCH] Changes to light shade color (#444) --- autogen/lua_definitions/structs.lua | 12 ++++++------ docs/lua/structs.md | 12 ++++++------ include/types.h | 14 +++++++------- src/game/mario.c | 12 ++++++------ src/game/mario_misc.c | 12 ++++++------ src/pc/lua/smlua_cobject_autogen.c | 12 ++++++------ 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/autogen/lua_definitions/structs.lua b/autogen/lua_definitions/structs.lua index 955da147..c0d30eab 100644 --- a/autogen/lua_definitions/structs.lua +++ b/autogen/lua_definitions/structs.lua @@ -708,14 +708,14 @@ --- @field public headAngle Vec3s --- @field public headPos Vec3f --- @field public heldObjLastPosition Vec3f ---- @field public lightB number ---- @field public lightG number ---- @field public lightR number +--- @field public lightB integer +--- @field public lightG integer +--- @field public lightR integer --- @field public modelState integer --- @field public punchState integer ---- @field public shadeB number ---- @field public shadeG number ---- @field public shadeR number +--- @field public shadeB integer +--- @field public shadeG integer +--- @field public shadeR integer --- @field public torsoAngle Vec3s --- @field public torsoPos Vec3f --- @field public updateTorsoTime integer diff --git a/docs/lua/structs.md b/docs/lua/structs.md index 03b1016d..5fc57d03 100644 --- a/docs/lua/structs.md +++ b/docs/lua/structs.md @@ -1035,14 +1035,14 @@ | headAngle | [Vec3s](structs.md#Vec3s) | read-only | | headPos | [Vec3f](structs.md#Vec3f) | read-only | | heldObjLastPosition | [Vec3f](structs.md#Vec3f) | read-only | -| lightB | `number` | | -| lightG | `number` | | -| lightR | `number` | | +| lightB | `integer` | | +| lightG | `integer` | | +| lightR | `integer` | | | modelState | `integer` | | | punchState | `integer` | | -| shadeB | `number` | | -| shadeG | `number` | | -| shadeR | `number` | | +| shadeB | `integer` | | +| shadeG | `integer` | | +| shadeR | `integer` | | | torsoAngle | [Vec3s](structs.md#Vec3s) | read-only | | torsoPos | [Vec3f](structs.md#Vec3f) | read-only | | updateTorsoTime | `integer` | read-only | diff --git a/include/types.h b/include/types.h index 5e0cb8c3..28efb63f 100644 --- a/include/types.h +++ b/include/types.h @@ -306,13 +306,13 @@ struct MarioBodyState /*????*/ Vec3f handFootPos[4]; /*????*/ u32 updateTorsoTime; /*????*/ Vec3f headPos; - //u8 padding[4]; - /*????*/ f32 shadeR; // Shadow Red Value - /*????*/ f32 shadeG; // Shadow Green Value - /*????*/ f32 shadeB; // Shadow Blue Value - /*????*/ f32 lightR; // Shadow Red Value - /*????*/ f32 lightG; // Shadow Green Value - /*????*/ f32 lightB; // Shadow Blue Value + /*????*/ u8 shadeR; // Shadow Red Value + /*????*/ u8 shadeG; // Shadow Green Value + /*????*/ u8 shadeB; // Shadow Blue Value + /*????*/ u8 lightR; // Shadow Red Value + /*????*/ u8 lightG; // Shadow Green Value + /*????*/ u8 lightB; // Shadow Blue Value + // u8 padding[4]; }; struct OffsetSizePair diff --git a/src/game/mario.c b/src/game/mario.c index 775e95f6..c44c6962 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -2291,13 +2291,13 @@ void init_single_mario(struct MarioState* m) { update_mario_info_for_cam(m); m->marioBodyState->punchState = 0; - m->marioBodyState->shadeR = 127.0f; - m->marioBodyState->shadeG = 127.0f; - m->marioBodyState->shadeB = 127.0f; + m->marioBodyState->shadeR = 127; + m->marioBodyState->shadeG = 127; + m->marioBodyState->shadeB = 127; - m->marioBodyState->lightR = 255.0f; - m->marioBodyState->lightG = 255.0f; - m->marioBodyState->lightB = 255.0f; + m->marioBodyState->lightR = 255; + m->marioBodyState->lightG = 255; + m->marioBodyState->lightB = 255; m->marioObj->oPosX = m->pos[0]; m->marioObj->oPosY = m->pos[1]; diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c index 6783a4f4..ea76cd4e 100644 --- a/src/game/mario_misc.c +++ b/src/game/mario_misc.c @@ -755,13 +755,13 @@ static struct PlayerColor geo_mario_get_player_color(const struct PlayerPalette for (s32 part = 0; part != PLAYER_PART_MAX; ++part) { color.parts[part] = (Lights1) gdSPDefLights1( // Shadow - palette->parts[part][0] * bodyState->shadeR/255.0f, - palette->parts[part][1] * bodyState->shadeG/255.0f, - palette->parts[part][2] * bodyState->shadeB/255.0f, + palette->parts[part][0] * bodyState->shadeR / 255.0f, + palette->parts[part][1] * bodyState->shadeG / 255.0f, + palette->parts[part][2] * bodyState->shadeB / 255.0f, // Light - palette->parts[part][0] * bodyState->lightR/255.0f, - palette->parts[part][1] * bodyState->lightG/255.0f, - palette->parts[part][2] * bodyState->lightB/255.0f, + palette->parts[part][0] * bodyState->lightR / 255.0f, + palette->parts[part][1] * bodyState->lightG / 255.0f, + palette->parts[part][2] * bodyState->lightB / 255.0f, 0x28, 0x28, 0x28 ); } diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c index 8531e9b8..8879ed8e 100644 --- a/src/pc/lua/smlua_cobject_autogen.c +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -820,14 +820,14 @@ static struct LuaObjectField sMarioBodyStateFields[LUA_MARIO_BODY_STATE_FIELD_CO { "headAngle", LVT_COBJECT, offsetof(struct MarioBodyState, headAngle), true, LOT_VEC3S }, { "headPos", LVT_COBJECT, offsetof(struct MarioBodyState, headPos), true, LOT_VEC3F }, { "heldObjLastPosition", LVT_COBJECT, offsetof(struct MarioBodyState, heldObjLastPosition), true, LOT_VEC3F }, - { "lightB", LVT_F32, offsetof(struct MarioBodyState, lightB), false, LOT_NONE }, - { "lightG", LVT_F32, offsetof(struct MarioBodyState, lightG), false, LOT_NONE }, - { "lightR", LVT_F32, offsetof(struct MarioBodyState, lightR), false, LOT_NONE }, + { "lightB", LVT_U8, offsetof(struct MarioBodyState, lightB), false, LOT_NONE }, + { "lightG", LVT_U8, offsetof(struct MarioBodyState, lightG), false, LOT_NONE }, + { "lightR", LVT_U8, offsetof(struct MarioBodyState, lightR), false, LOT_NONE }, { "modelState", LVT_S16, offsetof(struct MarioBodyState, modelState), false, LOT_NONE }, { "punchState", LVT_U8, offsetof(struct MarioBodyState, punchState), false, LOT_NONE }, - { "shadeB", LVT_F32, offsetof(struct MarioBodyState, shadeB), false, LOT_NONE }, - { "shadeG", LVT_F32, offsetof(struct MarioBodyState, shadeG), false, LOT_NONE }, - { "shadeR", LVT_F32, offsetof(struct MarioBodyState, shadeR), false, LOT_NONE }, + { "shadeB", LVT_U8, offsetof(struct MarioBodyState, shadeB), false, LOT_NONE }, + { "shadeG", LVT_U8, offsetof(struct MarioBodyState, shadeG), false, LOT_NONE }, + { "shadeR", LVT_U8, offsetof(struct MarioBodyState, shadeR), false, LOT_NONE }, { "torsoAngle", LVT_COBJECT, offsetof(struct MarioBodyState, torsoAngle), true, LOT_VEC3S }, { "torsoPos", LVT_COBJECT, offsetof(struct MarioBodyState, torsoPos), true, LOT_VEC3F }, { "updateTorsoTime", LVT_U32, offsetof(struct MarioBodyState, updateTorsoTime), true, LOT_NONE },