From aa564926a0e1bf93b80863539cb535add5226e85 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Thu, 11 Aug 2022 15:46:58 -0400 Subject: [PATCH] Fix CameraPos translation --- dx2cg/disassembler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dx2cg/disassembler.py b/dx2cg/disassembler.py index 0045ed9..b3fc2a9 100644 --- a/dx2cg/disassembler.py +++ b/dx2cg/disassembler.py @@ -30,7 +30,7 @@ reserved = { decls = { "dcl_position": "float4 {0} = vdat.vertex;", - "dcl_normal": "float4 {0} = float4(vdat.normal.x, vdat.normal.y, vdat.normal.z, 0);", + "dcl_normal": "float4 {0} = float4(vdat.normal, 0);", "dcl_texcoord0": "float4 {0} = vdat.texcoord;", "dcl_texcoord1": "float4 {0} = vdat.texcoord1;", "dcl_color": "float4 {0} = vdat.color;", @@ -155,7 +155,7 @@ def process_header(prog): val = f"glstate.light[{lightval[1]}].{lightval[2]}" lighting = True elif val == "_ObjectSpaceCameraPos" and not legacy: - val = "mul(_World2Object, float4(_WorldSpaceCameraPos.x, _WorldSpaceCameraPos.y, _WorldSpaceCameraPos.z, 0))" + val = "mul(_World2Object, float4(_WorldSpaceCameraPos, 1.0f))" elif val == "_ObjectSpaceLightPos0" and not legacy: val = "mul(_World2Object, _WorldSpaceLightPos0)" lighting = True