diff options
author | David Walter Seikel | 2012-02-04 23:02:04 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-02-04 23:02:04 +1000 |
commit | 1ba092a0c394ac5cf5d4d8ab1ea280b29ff9742d (patch) | |
tree | 52c1ff36d3e2cdc0507cf5529f33031271017c9b /LuaSL | |
parent | Comment new problem - dot operator not mixing too well with unplain assignments. (diff) | |
download | SledjHamr-1ba092a0c394ac5cf5d4d8ab1ea280b29ff9742d.zip SledjHamr-1ba092a0c394ac5cf5d4d8ab1ea280b29ff9742d.tar.gz SledjHamr-1ba092a0c394ac5cf5d4d8ab1ea280b29ff9742d.tar.bz2 SledjHamr-1ba092a0c394ac5cf5d4d8ab1ea280b29ff9742d.tar.xz |
Fix up rotation and vector subscripts in expressions and non plain assignments.
Diffstat (limited to 'LuaSL')
-rw-r--r-- | LuaSL/src/LSL.lua | 4 | ||||
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 14 |
2 files changed, 7 insertions, 11 deletions
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; | |||
186 | LSL.NULL_KEY = "00000000-0000-0000-0000-000000000000"; | 186 | LSL.NULL_KEY = "00000000-0000-0000-0000-000000000000"; |
187 | LSL.EOF = "\n\n\n"; | 187 | LSL.EOF = "\n\n\n"; |
188 | 188 | ||
189 | LSL.ZERO_ROTATION = {0.0, 0.0, 0.0, 1.0}; | 189 | LSL.ZERO_ROTATION = {x=0.0, y=0.0, z=0.0, s=1.0}; |
190 | LSL.ZERO_VECTOR = {0.0, 0.0, 0.0}; | 190 | LSL.ZERO_VECTOR = {x=0.0, y=0.0, z=0.0}; |
191 | 191 | ||
192 | -- TODO - Temporary dummy variables to got vector and rotation thingies to work for now. | 192 | -- TODO - Temporary dummy variables to got vector and rotation thingies to work for now. |
193 | 193 | ||
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 @@ | |||
1 | #include "LuaSL.h" | 1 | #include "LuaSL.h" |
2 | 2 | ||
3 | /* TODO - problem dejour | 3 | /* TODO - problem de jour |
4 | |||
5 | RefPos.z += (float) Zoffset / 100.; | ||
6 | |||
7 | Gets converted to - | ||
8 | |||
9 | RefPos.z --[[+=]] = RefPos + --[[float]] Zoffset/100.; | ||
10 | |||
11 | */ | 4 | */ |
12 | 5 | ||
13 | static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right); | 6 | static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right); |
@@ -1696,7 +1689,10 @@ else | |||
1696 | } | 1689 | } |
1697 | if ((LSL_ASSIGNMENT & leaf->toKen->flags) && (LSL_ASSIGNMENT_PLAIN != leaf->toKen->type)) | 1690 | if ((LSL_ASSIGNMENT & leaf->toKen->flags) && (LSL_ASSIGNMENT_PLAIN != leaf->toKen->type)) |
1698 | { | 1691 | { |
1699 | fprintf(file, " --[[%s]] = %s %.1s ", leaf->toKen->toKen, leaf->left->value.identifierValue->name.text, leaf->toKen->toKen); | 1692 | if (leaf->left->value.identifierValue->sub) |
1693 | fprintf(file, " --[[%s]] = %s.%s %.1s ", leaf->toKen->toKen, leaf->left->value.identifierValue->name.text, leaf->left->value.identifierValue->sub, leaf->toKen->toKen); | ||
1694 | else | ||
1695 | fprintf(file, " --[[%s]] = %s %.1s ", leaf->toKen->toKen, leaf->left->value.identifierValue->name.text, leaf->toKen->toKen); | ||
1700 | } | 1696 | } |
1701 | else if (LSL_TYPE & leaf->toKen->flags) | 1697 | else if (LSL_TYPE & leaf->toKen->flags) |
1702 | { | 1698 | { |