From 1ba092a0c394ac5cf5d4d8ab1ea280b29ff9742d Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sat, 4 Feb 2012 23:02:04 +1000 Subject: Fix up rotation and vector subscripts in expressions and non plain assignments. --- LuaSL/src/LSL.lua | 4 ++-- LuaSL/src/LuaSL_compile.c | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'LuaSL') diff --git a/LuaSL/src/LSL.lua b/LuaSL/src/LSL.lua index 1e7cc13..9b52d8c 100644 --- a/LuaSL/src/LSL.lua +++ b/LuaSL/src/LSL.lua @@ -186,8 +186,8 @@ LSL.TYPE_INVALID = 0; LSL.NULL_KEY = "00000000-0000-0000-0000-000000000000"; LSL.EOF = "\n\n\n"; -LSL.ZERO_ROTATION = {0.0, 0.0, 0.0, 1.0}; -LSL.ZERO_VECTOR = {0.0, 0.0, 0.0}; +LSL.ZERO_ROTATION = {x=0.0, y=0.0, z=0.0, s=1.0}; +LSL.ZERO_VECTOR = {x=0.0, y=0.0, z=0.0}; -- TODO - Temporary dummy variables to got vector and rotation thingies to work for now. diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 610753a..16e1c1d 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c @@ -1,13 +1,6 @@ #include "LuaSL.h" -/* TODO - problem dejour - - RefPos.z += (float) Zoffset / 100.; - -Gets converted to - - - RefPos.z --[[+=]] = RefPos + --[[float]] Zoffset/100.; - +/* TODO - problem de jour */ static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right); @@ -1696,7 +1689,10 @@ else } if ((LSL_ASSIGNMENT & leaf->toKen->flags) && (LSL_ASSIGNMENT_PLAIN != leaf->toKen->type)) { - fprintf(file, " --[[%s]] = %s %.1s ", leaf->toKen->toKen, leaf->left->value.identifierValue->name.text, leaf->toKen->toKen); + if (leaf->left->value.identifierValue->sub) + fprintf(file, " --[[%s]] = %s.%s %.1s ", leaf->toKen->toKen, leaf->left->value.identifierValue->name.text, leaf->left->value.identifierValue->sub, leaf->toKen->toKen); + else + fprintf(file, " --[[%s]] = %s %.1s ", leaf->toKen->toKen, leaf->left->value.identifierValue->name.text, leaf->toKen->toKen); } else if (LSL_TYPE & leaf->toKen->flags) { -- cgit v1.1