From 15eb8dd8fc44e8d220a45912526a0e32e7a4c9a8 Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:58:53 +1000 Subject: [PATCH] Revert "changes to recent pr" This reverts commit 4ba997097295aa51a49436f6e02793ca5b28d2b8. --- src/pc/gfx/gfx_pc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pc/gfx/gfx_pc.c b/src/pc/gfx/gfx_pc.c index a2aad136..8568c5ae 100644 --- a/src/pc/gfx/gfx_pc.c +++ b/src/pc/gfx/gfx_pc.c @@ -768,6 +768,14 @@ static float gfx_adjust_x_for_aspect_ratio(float x) { } static void OPTIMIZE_O3 gfx_sp_vertex(size_t n_vertices, size_t dest_index, const Vtx *vertices, bool luaVertexColor) { + float globalLightCached[2][3]; + if (rsp.geometry_mode & G_LIGHTING) { + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 3; j++) + globalLightCached[i][j] = gLightingColor[i][j] / 255.0f; + } + } + #ifdef __SSE__ __m128 mat0 = _mm_load_ps(rsp.MP_matrix[0]); __m128 mat1 = _mm_load_ps(rsp.MP_matrix[1]); @@ -803,11 +811,6 @@ static void OPTIMIZE_O3 gfx_sp_vertex(size_t n_vertices, size_t dest_index, cons short V = v->tc[1] * rsp.texture_scaling_factor.t >> 16; if (rsp.geometry_mode & G_LIGHTING) { - float globalLightCached[2][3] = { - {gLightingColor[0][0] / 255.0f, gLightingColor[0][1] / 255.0f, gLightingColor[0][2] / 255.0f}, - {gLightingColor[1][0] / 255.0f, gLightingColor[1][1] / 255.0f, gLightingColor[1][2] / 255.0f}, - }; - if (rsp.lights_changed) { bool applyLightingDir = !(rsp.geometry_mode & G_TEXTURE_GEN); for (int32_t i = 0; i < rsp.current_num_lights - 1; i++) {