From 85bab15d23b6ed37a316fdfceaae3cdf496f5f59 Mon Sep 17 00:00:00 2001 From: oreo639 Date: Fri, 11 Aug 2023 14:57:10 -0700 Subject: [PATCH] Add C3D_LightEnvBumpUseNormalZ() --- include/c3d/light.h | 1 + source/lightenv.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/c3d/light.h b/include/c3d/light.h index 3a477a1e..de2fed9f 100644 --- a/include/c3d/light.h +++ b/include/c3d/light.h @@ -77,6 +77,7 @@ enum void C3D_LightEnvFresnel(C3D_LightEnv* env, GPU_FRESNELSEL selector); void C3D_LightEnvBumpMode(C3D_LightEnv* env, GPU_BUMPMODE mode); void C3D_LightEnvBumpSel(C3D_LightEnv* env, int texUnit); +void C3D_LightEnvBumpUseNormalZ(C3D_LightEnv *env, bool usez); void C3D_LightEnvShadowMode(C3D_LightEnv* env, u32 mode); void C3D_LightEnvShadowSel(C3D_LightEnv* env, int texUnit); void C3D_LightEnvClampHighlights(C3D_LightEnv* env, bool clamp); diff --git a/source/lightenv.c b/source/lightenv.c index 25eea29a..e69d7089 100644 --- a/source/lightenv.c +++ b/source/lightenv.c @@ -250,6 +250,14 @@ void C3D_LightEnvBumpSel(C3D_LightEnv* env, int texUnit) env->flags |= C3DF_LightEnv_Dirty; } +void C3D_LightEnvBumpUseNormalZ(C3D_LightEnv *env, bool usez) { + if (usez) + env->conf.config[0] |= BIT(30); + else + env->conf.config[0] &= ~BIT(30); + env->flags |= C3DF_LightEnv_Dirty; +} + void C3D_LightEnvShadowMode(C3D_LightEnv* env, u32 mode) { mode &= 0xF<<16;