aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-04 23:02:04 +1000
committerDavid Walter Seikel2012-02-04 23:02:04 +1000
commit1ba092a0c394ac5cf5d4d8ab1ea280b29ff9742d (patch)
tree52c1ff36d3e2cdc0507cf5529f33031271017c9b /LuaSL
parentComment new problem - dot operator not mixing too well with unplain assignments. (diff)
downloadSledjHamr-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.lua4
-rw-r--r--LuaSL/src/LuaSL_compile.c14
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;
186LSL.NULL_KEY = "00000000-0000-0000-0000-000000000000"; 186LSL.NULL_KEY = "00000000-0000-0000-0000-000000000000";
187LSL.EOF = "\n\n\n"; 187LSL.EOF = "\n\n\n";
188 188
189LSL.ZERO_ROTATION = {0.0, 0.0, 0.0, 1.0}; 189LSL.ZERO_ROTATION = {x=0.0, y=0.0, z=0.0, s=1.0};
190LSL.ZERO_VECTOR = {0.0, 0.0, 0.0}; 190LSL.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
7Gets converted to -
8
9 RefPos.z --[[+=]] = RefPos + --[[float]] Zoffset/100.;
10
11*/ 4*/
12 5
13static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right); 6static 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 {