Browse Source

Vector classes : added one (for consistency)

SceneSetup : Added ClearColor command
EZMesh : Added Dup[ ... ] command && cgs command syntax refactor
MViewer : Tweak & dictionnary.js updates
undefined
Benjamin ‘Touky’ Huet Sam Hocevar <sam@hocevar.net> 11 years ago
parent
commit
2b4dc175ee
21 changed files with 1553 additions and 1394 deletions
  1. +17
    -10
      src/easymesh/easymesh-parser.y
  2. +7
    -4
      src/easymesh/easymesh-scanner.l
  3. +12
    -4
      src/easymesh/easymesh.cpp
  4. +3
    -3
      src/easymesh/easymesh.h
  5. +569
    -550
      src/generated/easymesh-parser.cpp
  6. +28
    -26
      src/generated/easymesh-parser.h
  7. +278
    -259
      src/generated/easymesh-scanner.cpp
  8. +3
    -0
      src/lol/math/vector.h
  9. +3
    -0
      src/math/constants.cpp
  10. +24
    -3
      test/data/mesh-buffer.txt
  11. +6
    -5
      test/easymeshdictionnary.js
  12. +115
    -100
      test/generated/scenesetup-parser.cpp
  13. +10
    -9
      test/generated/scenesetup-parser.h
  14. +350
    -310
      test/generated/scenesetup-parser.output
  15. +115
    -103
      test/generated/scenesetup-scanner.cpp
  16. +2
    -2
      test/meshviewer.cpp
  17. +4
    -1
      test/scenesetup-parser.y
  18. +1
    -0
      test/scenesetup-scanner.l
  19. +1
    -0
      test/scenesetup.cpp
  20. +1
    -2
      test/scenesetup.h
  21. +4
    -3
      test/scenesetupdictionnary.js

+ 17
- 10
src/easymesh/easymesh-parser.y View File

@@ -38,6 +38,7 @@
bool bval;
float vval[4];
int ivval[4];
char* lval;
/* Can't use uin32_t here for some reason */
unsigned u32val;
}
@@ -50,6 +51,7 @@
%token T_TRANSLATEY T_ROTATEY T_TAPERY T_TWISTY T_SHEARY T_STRETCHY T_BENDYX T_BENDYZ T_SCALEY T_MIRRORY
%token T_TRANSLATEZ T_ROTATEZ T_TAPERZ T_TWISTZ T_SHEARZ T_STRETCHZ T_BENDZX T_BENDZY T_SCALEZ T_MIRRORZ
%token T_TRANSLATE T_ROTATE T_SCALE T_TOGGLESCALEWINDING T_RADIALJITTER T_SPLITTRIANGLE T_SMOOTHMESH
%token T_DUPLICATE
%token T_CSGUNION T_CSGSUBSTRACT T_CSGSUBSTRACTLOSS T_CSGAND T_CSGXOR
%token T_CHAMFER

@@ -103,30 +105,35 @@ mesh_expression:

mesh_command_list:
mesh_command
| mesh_command_list mesh_command
| mesh_command mesh_command_list
;

mesh_command:
color_command
| transform_command
| primitive_command
| csg_command
| post_brace_command
| pre_brace_command '[' mesh_expression_list mesh_close
;

csg_command:
T_CSGUNION { mc.m_mesh.CsgUnion(); }
| T_CSGSUBSTRACT { mc.m_mesh.CsgSubstract(); }
| T_CSGSUBSTRACTLOSS { mc.m_mesh.CsgSubstractLoss(); }
| T_CSGAND { mc.m_mesh.CsgAnd(); }
| T_CSGXOR { mc.m_mesh.CsgXor(); }
post_brace_command:
T_CSGUNION mesh_open mesh_expression_list ']' { mc.m_mesh.CsgUnion(); mc.m_mesh.CloseBrace(); }
| T_CSGSUBSTRACT mesh_open mesh_expression_list ']' { mc.m_mesh.CsgSub(); mc.m_mesh.CloseBrace(); }
| T_CSGSUBSTRACTLOSS mesh_open mesh_expression_list ']' { mc.m_mesh.CsgSubL(); mc.m_mesh.CloseBrace(); }
| T_CSGAND mesh_open mesh_expression_list ']' { mc.m_mesh.CsgAnd(); mc.m_mesh.CloseBrace(); }
| T_CSGXOR mesh_open mesh_expression_list ']' { mc.m_mesh.CsgXor(); mc.m_mesh.CloseBrace(); }
;

pre_brace_command:
T_DUPLICATE { mc.m_mesh.DupAndScale(vec3::one, true); }
;

mesh_open:
'[' { mc.m_mesh.OpenBrace(); }
'[' { mc.m_mesh.OpenBrace(); }
;

mesh_close:
']' { mc.m_mesh.CloseBrace(); }
']' { mc.m_mesh.CloseBrace(); }
;

color_command:


+ 7
- 4
src/easymesh/easymesh-scanner.l View File

@@ -48,8 +48,8 @@ typedef lol::EasyMeshParser::token_type token_type;
%}

(csgu|csgunion) { return token::T_CSGUNION; }
(csgs|csgsubstract) { return token::T_CSGSUBSTRACT; }
(csgsl|csgsubstractloss) { return token::T_CSGSUBSTRACTLOSS; }
(csgs|CsgSub) { return token::T_CSGSUBSTRACT; }
(csgsl|CsgSubL) { return token::T_CSGSUBSTRACTLOSS; }
(csga|csgand) { return token::T_CSGAND; }
(csgx|csgxor) { return token::T_CSGXOR; }

@@ -94,6 +94,7 @@ typedef lol::EasyMeshParser::token_type token_type;
(ch|chamfer) { return token::T_CHAMFER; }
(splt|splittriangle) { return token::T_SPLITTRIANGLE; }
(smth|smooth) { return token::T_SMOOTHMESH; }
(dup|duplicate) { return token::T_DUPLICATE; }

(ac|addcylinder) { return token::T_CYLINDER; }
(asph|addsphere) { return token::T_SPHERE; }
@@ -151,8 +152,10 @@ false { yylval->bval = false; return token::BOOLEAN; }
"-" { return token_type('-'); }
"(" { return token_type('('); }
")" { return token_type(')'); }
"[" { return token_type('['); }
"]" { return token_type(']'); }
"{" { return token_type('{'); }
"}" { return token_type('}'); }
[\[] { return token_type('['); }
[\]] { return token_type(']'); }
[ ,] { /* ignore this */ }
[\n] { /* ignore this */ }
. { return token::T_ERROR; }


+ 12
- 4
src/easymesh/easymesh.cpp View File

@@ -787,11 +787,11 @@ void EasyMesh::MeshCsg(CSGUsage csg_operation)
//Triangle Kill Test
if (//csgu : CSGUnion() -> m0_Outside + m1_Outside
(csg_operation == CSGUsage::Union && tri_list[k].m1 == LEAF_BACK) ||
//csgs : CSGSubstract() -> m0_Outside + m1_Inside-inverted
//csgs : CsgSub() -> m0_Outside + m1_Inside-inverted
(csg_operation == CSGUsage::Substract &&
((mesh_id == 0 && tri_list[k].m1 == LEAF_BACK) ||
(mesh_id == 1 && tri_list[k].m1 == LEAF_FRONT))) ||
//csgs : CSGSubstractLoss() -> m0_Outside
//csgs : CsgSubL() -> m0_Outside
(csg_operation == CSGUsage::SubstractLoss &&
((mesh_id == 0 && tri_list[k].m1 == LEAF_BACK) || mesh_id == 1)) ||
//csga : CSGAnd() -> m0_Inside + m1_Inside
@@ -801,7 +801,7 @@ void EasyMesh::MeshCsg(CSGUsage csg_operation)
}

//Triangle Invert Test
if (//csgs : CSGSubstract() -> m0_Outside + m1_Inside-inverted
if (//csgs : CsgSub() -> m0_Outside + m1_Inside-inverted
(csg_operation == CSGUsage::Substract && mesh_id == 1 && tri_list[k].m1 == LEAF_BACK) ||
//csgx : CSGXor() -> m0_Outside/m0_Inside-inverted + m1_Outside/m1_Inside-inverted
(csg_operation == CSGUsage::Xor && tri_list[k].m1 == LEAF_BACK))
@@ -1364,7 +1364,7 @@ void EasyMesh::MirrorY() { DupAndScale(vec3(1, -1, 1)); }
void EasyMesh::MirrorZ() { DupAndScale(vec3(1, 1, -1)); }

//-----------------------------------------------------------------------------
void EasyMesh::DupAndScale(vec3 const &s)
void EasyMesh::DupAndScale(vec3 const &s, bool open_brace)
{
int vlen = m_vert.Count() - m_cursors.Last().m1;
int tlen = m_indices.Count() - m_cursors.Last().m2;
@@ -1379,6 +1379,14 @@ void EasyMesh::DupAndScale(vec3 const &s)

m_cursors.Last().m1 -= vlen;
m_cursors.Last().m2 -= tlen;

if (open_brace)
{
OpenBrace();

m_cursors.Last().m1 -= vlen;
m_cursors.Last().m2 -= tlen;
}
}

//-----------------------------------------------------------------------------


+ 3
- 3
src/easymesh/easymesh.h View File

@@ -553,9 +553,9 @@ public:
/* [cmd:csgu] Performs a Union operation as (mesh0_Outside + mesh1_Outside) */
void CsgUnion() { MeshCsg(CSGUsage::Union); }
/* [cmd:csgs] Performs a Substract operation as (mesh0_Outside + mesh1_Inside-inverted) */
void CsgSubstract() { MeshCsg(CSGUsage::Substract); }
void CsgSub() { MeshCsg(CSGUsage::Substract); }
/* [cmd:csgsl] Performs a Substract operation without keeping the mesh1 part */
void CsgSubstractLoss() { MeshCsg(CSGUsage::SubstractLoss); }
void CsgSubL() { MeshCsg(CSGUsage::SubstractLoss); }
/* [cmd:csga] Performs an And operation as (mesh0_Inside + mesh1_Inside) */
void CsgAnd() { MeshCsg(CSGUsage::And); }
/* [cmd:csgx] Performs a Xor operation as (m0_Outside/m0_Inside-inverted + m1_Outside/m1_Inside-inverted) */
@@ -722,7 +722,7 @@ public:
/* [no-cmd] Duplicates vertices and scale duplicate
Acts as an OpenBrace
*/
void DupAndScale(vec3 const &s);
void DupAndScale(vec3 const &s, bool open_brace=false);
/* [cmd:ch] Performs a chamfer operation //TODO : Make it work
- f : Chamfer quantity.
*/


+ 569
- 550
src/generated/easymesh-parser.cpp
File diff suppressed because it is too large
View File


+ 28
- 26
src/generated/easymesh-parser.h View File

@@ -116,13 +116,14 @@ namespace lol {
bool bval;
float vval[4];
int ivval[4];
char* lval;
/* Can't use uin32_t here for some reason */
unsigned u32val;



/* Line 34 of lalr1.cc */
#line 126 "generated/easymesh-parser.h"
#line 127 "generated/easymesh-parser.h"
};
#else
typedef YYSTYPE semantic_type;
@@ -174,30 +175,31 @@ namespace lol {
T_RADIALJITTER = 294,
T_SPLITTRIANGLE = 295,
T_SMOOTHMESH = 296,
T_CSGUNION = 297,
T_CSGSUBSTRACT = 298,
T_CSGSUBSTRACTLOSS = 299,
T_CSGAND = 300,
T_CSGXOR = 301,
T_CHAMFER = 302,
T_CYLINDER = 303,
T_BOX = 304,
T_SMOOTHCHAMFBOX = 305,
T_FLATCHAMFBOX = 306,
T_SPHERE = 307,
T_CAPSULE = 308,
T_STAR = 309,
T_EXPANDEDSTAR = 310,
T_DISC = 311,
T_TRIANGLE = 312,
T_QUAD = 313,
T_COG = 314,
T_TORUS = 315,
T_ERROR = 316,
F_NUMBER = 317,
I_NUMBER = 318,
BOOLEAN = 319,
COLOR = 320
T_DUPLICATE = 297,
T_CSGUNION = 298,
T_CSGSUBSTRACT = 299,
T_CSGSUBSTRACTLOSS = 300,
T_CSGAND = 301,
T_CSGXOR = 302,
T_CHAMFER = 303,
T_CYLINDER = 304,
T_BOX = 305,
T_SMOOTHCHAMFBOX = 306,
T_FLATCHAMFBOX = 307,
T_SPHERE = 308,
T_CAPSULE = 309,
T_STAR = 310,
T_EXPANDEDSTAR = 311,
T_DISC = 312,
T_TRIANGLE = 313,
T_QUAD = 314,
T_COG = 315,
T_TORUS = 316,
T_ERROR = 317,
F_NUMBER = 318,
I_NUMBER = 319,
BOOLEAN = 320,
COLOR = 321
};

};
@@ -371,7 +373,7 @@ namespace lol {
} // lol

/* Line 34 of lalr1.cc */
#line 375 "generated/easymesh-parser.h"
#line 377 "generated/easymesh-parser.h"





+ 278
- 259
src/generated/easymesh-scanner.cpp View File

@@ -330,8 +330,8 @@ typedef unsigned char YY_CHAR;
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;

#define YY_NUM_RULES 76
#define YY_END_OF_BUFFER 77
#define YY_NUM_RULES 79
#define YY_END_OF_BUFFER 80
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -339,42 +339,43 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[306] =
static yyconst flex_int16_t yy_accept[312] =
{ 0,
0, 0, 77, 75, 74, 73, 75, 69, 70, 75,
68, 75, 75, 66, 71, 72, 75, 75, 75, 75,
75, 16, 39, 12, 0, 0, 66, 65, 67, 50,
46, 55, 0, 0, 57, 53, 56, 0, 0, 43,
0, 0, 0, 40, 41, 42, 0, 17, 0, 13,
14, 15, 7, 0, 0, 0, 0, 0, 36, 37,
38, 0, 0, 0, 0, 9, 10, 11, 0, 0,
67, 0, 58, 0, 54, 0, 0, 0, 49, 0,
0, 0, 80, 78, 77, 76, 78, 70, 71, 78,
69, 78, 78, 67, 78, 74, 75, 78, 78, 78,
78, 78, 78, 16, 39, 12, 72, 73, 0, 0,
67, 66, 68, 0, 51, 47, 56, 0, 0, 58,
54, 57, 0, 0, 43, 0, 0, 0, 0, 40,
41, 42, 0, 17, 0, 13, 14, 15, 7, 0,
0, 0, 0, 0, 36, 37, 38, 0, 0, 0,
0, 9, 10, 11, 0, 0, 68, 0, 0, 59,
0, 55, 0, 0, 0, 50, 0, 0, 0, 0,
0, 0, 46, 0, 0, 0, 0, 0, 8, 0,

0, 24, 25, 26, 0, 0, 0, 0, 27, 28,
29, 0, 18, 19, 20, 0, 0, 6, 0, 21,
22, 23, 60, 0, 66, 0, 49, 0, 0, 0,
0, 0, 0, 0, 0, 53, 52, 48, 30, 31,
32, 33, 34, 35, 0, 0, 4, 2, 1, 5,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8, 0, 0, 24, 25, 26, 0, 0, 0, 0,

27, 28, 29, 0, 18, 19, 20, 0, 0, 6,
0, 21, 22, 23, 59, 0, 65, 48, 0, 0,
0, 0, 0, 0, 0, 0, 52, 51, 47, 30,
31, 32, 33, 34, 35, 0, 0, 4, 2, 1,
5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
45, 0, 44, 0, 0, 0, 63, 0, 60, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
0, 64, 0, 0, 0, 39, 0, 0, 0, 0,
45, 0, 44, 0, 0, 0, 64, 0, 61, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
0, 0, 65, 0, 0, 0, 39, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 4, 0,
0, 5, 0, 0, 16, 0, 0, 0, 0, 0,
0, 61, 0, 0, 55, 0, 0, 0, 0, 53,
0, 0, 43, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 5, 0, 0, 0, 16, 0, 0, 0,
0, 0, 0, 62, 0, 0, 56, 0, 0, 0,
0, 54, 0, 0, 43, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 7, 0, 0, 62, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
0, 0, 0, 0, 0, 0, 0, 0, 0, 46,
0, 0, 0, 56, 0, 0, 0, 0, 0, 0,
0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 7, 0, 0,
63, 0, 0, 0, 0, 0, 0, 46, 0, 0,
0, 12, 0, 0, 0, 0, 0, 0, 0, 0,
47, 0, 0, 0, 57, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0
} ;

static yyconst flex_int32_t yy_ec[256] =
@@ -385,14 +386,14 @@ static yyconst flex_int32_t yy_ec[256] =
1, 3, 1, 1, 4, 1, 1, 1, 1, 5,
6, 1, 7, 3, 8, 9, 10, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 1, 1, 1,
1, 1, 1, 1, 12, 12, 12, 12, 13, 12,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
14, 1, 15, 1, 1, 1, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 1, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 1, 36, 37,
38, 39, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 12, 12, 13, 12, 14, 12,
1, 1, 1, 1, 1, 15, 1, 1, 1, 1,
1, 1, 16, 1, 1, 1, 1, 1, 1, 1,
17, 1, 18, 1, 1, 1, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 1, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 1, 39, 40,
41, 42, 43, 1, 44, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -409,190 +410,193 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;

static yyconst flex_int32_t yy_meta[40] =
static yyconst flex_int32_t yy_meta[45] =
{ 0,
1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
3, 3, 3, 1, 1, 3, 3, 3, 3, 3,
3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1
3, 3, 3, 3, 1, 1, 1, 1, 3, 3,
3, 3, 3, 3, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1
} ;

static yyconst flex_int16_t yy_base[315] =
static yyconst flex_int16_t yy_base[321] =
{ 0,
0, 0, 378, 379, 379, 379, 0, 379, 379, 31,
32, 366, 366, 35, 379, 379, 30, 33, 22, 359,
30, 54, 76, 100, 0, 363, 47, 46, 0, 379,
49, 354, 339, 353, 379, 42, 341, 36, 341, 352,
345, 340, 333, 379, 379, 379, 345, 379, 329, 379,
379, 379, 60, 328, 70, 51, 335, 49, 379, 379,
379, 81, 62, 324, 88, 379, 379, 379, 0, 93,
0, 329, 379, 123, 379, 341, 340, 333, 379, 83,
45, 86, 336, 327, 112, 320, 320, 327, 334, 323,
379, 112, 332, 379, 379, 379, 318, 323, 71, 325,
379, 379, 379, 324, 379, 379, 379, 315, 322, 379,
308, 379, 379, 379, 0, 329, 328, 379, 309, 130,
313, 299, 309, 299, 121, 102, 379, 379, 379, 379,
379, 379, 379, 379, 379, 123, 312, 304, 63, 303,
301, 309, 299, 311, 292, 305, 306, 294, 290, 287,
379, 286, 379, 285, 286, 284, 379, 282, 0, 278,
284, 291, 286, 278, 280, 293, 292, 278, 283, 289,
272, 279, 114, 126, 129, 282, 282, 379, 283, 275,
266, 379, 265, 270, 275, 133, 265, 267, 136, 269,
257, 272, 139, 263, 142, 0, 255, 263, 268, 269,
250, 264, 253, 261, 248, 244, 262, 245, 379, 243,
246, 379, 145, 249, 148, 249, 246, 242, 238, 246,
252, 0, 232, 238, 379, 237, 246, 229, 230, 379,
228, 232, 379, 225, 230, 233, 228, 226, 222, 229,
151, 218, 0, 225, 231, 230, 225, 224, 226, 223,
212, 379, 209, 223, 209, 379, 224, 219, 379, 218,
217, 216, 219, 216, 207, 216, 197, 206, 201, 154,
196, 208, 199, 202, 204, 205, 202, 193, 198, 379,
186, 197, 201, 379, 182, 183, 192, 187, 178, 194,
183, 183, 188, 191, 177, 184, 175, 171, 165, 184,
167, 170, 165, 160, 379, 192, 161, 193, 155, 147,
132, 114, 99, 59
0, 0, 385, 386, 386, 386, 0, 386, 386, 36,
37, 373, 373, 40, 346, 386, 386, 32, 35, 24,
343, 361, 32, 43, 65, 89, 386, 386, 0, 368,
52, 53, 0, 353, 386, 62, 355, 340, 354, 386,
44, 342, 38, 342, 353, 346, 337, 340, 333, 386,
386, 386, 345, 386, 329, 386, 386, 386, 70, 328,
59, 60, 335, 69, 386, 386, 386, 79, 75, 324,
76, 386, 386, 386, 0, 115, 0, 346, 328, 386,
112, 386, 340, 339, 332, 386, 73, 97, 100, 335,
326, 119, 326, 318, 318, 325, 332, 321, 386, 122,
330, 386, 386, 386, 316, 321, 117, 323, 386, 386,
386, 322, 386, 386, 386, 313, 320, 386, 306, 386,
386, 386, 0, 330, 329, 301, 386, 306, 126, 310,
296, 306, 296, 123, 61, 386, 386, 386, 386, 386,
386, 386, 386, 386, 110, 309, 301, 302, 299, 297,
301, 304, 294, 306, 287, 300, 301, 289, 285, 282,
386, 281, 386, 280, 281, 279, 386, 277, 0, 293,
272, 278, 285, 280, 272, 274, 287, 286, 272, 277,
283, 266, 273, 120, 123, 128, 276, 276, 386, 270,
261, 274, 386, 259, 264, 269, 131, 259, 261, 134,
263, 251, 266, 137, 257, 140, 0, 270, 248, 256,
261, 262, 243, 257, 246, 254, 241, 237, 255, 238,
386, 240, 386, 252, 143, 242, 146, 242, 239, 235,
231, 239, 245, 0, 225, 231, 386, 230, 239, 222,
223, 386, 221, 225, 386, 224, 217, 226, 221, 219,
215, 222, 149, 211, 0, 218, 224, 223, 218, 217,
219, 216, 386, 217, 202, 216, 202, 386, 217, 212,
386, 211, 210, 209, 212, 209, 200, 386, 191, 200,
195, 152, 190, 202, 193, 196, 198, 197, 188, 193,
386, 181, 192, 196, 386, 179, 188, 183, 174, 190,
179, 185, 188, 174, 181, 169, 163, 182, 169, 160,
386, 196, 195, 194, 193, 163, 161, 144, 124, 67
} ;

static yyconst flex_int16_t yy_def[315] =
static yyconst flex_int16_t yy_def[321] =
{ 0,
305, 1, 305, 305, 305, 305, 306, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 307, 305, 305, 305, 308, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 309, 305,
308, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 310, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 311, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 312, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 313, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 314, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 0, 305, 305, 305, 305, 305,
305, 305, 305, 305
311, 1, 311, 311, 311, 311, 312, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 313, 311,
311, 311, 314, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 315, 311, 314, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 316, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 317, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 318, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 319, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 320, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
0, 311, 311, 311, 311, 311, 311, 311, 311, 311
} ;

static yyconst flex_int16_t yy_nxt[419] =
static yyconst flex_int16_t yy_nxt[431] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 4, 4, 15, 16, 17, 18, 19, 4, 4,
20, 4, 4, 4, 4, 4, 21, 4, 4, 4,
4, 22, 23, 24, 4, 4, 4, 4, 4, 26,
26, 27, 27, 26, 40, 27, 30, 31, 32, 33,
34, 38, 39, 43, 41, 26, 28, 27, 70, 77,
35, 259, 36, 37, 72, 70, 44, 45, 46, 47,
73, 78, 80, 81, 82, 90, 91, 108, 48, 97,
100, 132, 49, 133, 98, 101, 102, 103, 178, 93,
50, 51, 52, 53, 152, 54, 109, 179, 55, 116,

116, 243, 56, 117, 153, 57, 94, 95, 96, 58,
104, 111, 59, 60, 61, 62, 222, 105, 106, 107,
130, 131, 134, 135, 112, 113, 114, 138, 147, 148,
171, 63, 64, 172, 196, 65, 66, 67, 68, 119,
120, 121, 122, 123, 139, 161, 140, 168, 141, 159,
169, 130, 131, 124, 170, 125, 126, 115, 162, 173,
174, 175, 132, 69, 133, 134, 135, 163, 216, 59,
60, 61, 94, 95, 96, 105, 106, 107, 112, 113,
114, 44, 45, 46, 50, 51, 52, 101, 102, 103,
66, 67, 68, 71, 25, 71, 128, 178, 304, 303,

302, 127, 75, 301, 300, 299, 298, 153, 297, 296,
295, 294, 293, 110, 48, 292, 291, 290, 289, 288,
287, 286, 285, 284, 283, 282, 281, 280, 279, 278,
277, 276, 275, 274, 273, 272, 271, 118, 270, 269,
91, 268, 267, 266, 265, 129, 264, 263, 262, 261,
260, 258, 257, 256, 255, 254, 253, 252, 251, 250,
79, 249, 248, 247, 246, 245, 244, 242, 241, 240,
239, 238, 237, 236, 235, 234, 233, 232, 231, 230,
229, 228, 35, 227, 226, 225, 224, 223, 221, 220,
219, 151, 218, 217, 215, 214, 213, 212, 211, 210,

209, 208, 207, 206, 205, 204, 203, 202, 201, 200,
199, 198, 73, 197, 30, 195, 194, 193, 192, 191,
190, 189, 188, 187, 186, 185, 184, 183, 182, 181,
180, 177, 176, 167, 166, 165, 164, 160, 117, 117,
158, 157, 156, 155, 154, 151, 150, 149, 146, 145,
144, 143, 142, 137, 136, 129, 128, 127, 118, 110,
99, 92, 89, 88, 87, 86, 85, 84, 83, 79,
76, 75, 74, 28, 42, 29, 28, 305, 3, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,

305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305
14, 4, 15, 4, 4, 4, 16, 17, 18, 19,
20, 21, 4, 22, 4, 4, 4, 4, 4, 23,
4, 4, 4, 4, 24, 25, 26, 4, 4, 4,
4, 4, 27, 28, 30, 30, 31, 31, 30, 45,
31, 35, 36, 37, 38, 39, 43, 44, 49, 46,
30, 53, 31, 32, 84, 40, 76, 41, 42, 271,
54, 50, 51, 52, 55, 76, 85, 87, 88, 89,
79, 101, 56, 57, 58, 59, 80, 60, 98, 99,
61, 105, 182, 116, 62, 183, 106, 63, 102, 103,

104, 64, 119, 108, 65, 66, 67, 68, 109, 110,
111, 112, 117, 139, 140, 120, 121, 122, 113, 114,
115, 124, 124, 69, 70, 125, 255, 71, 72, 73,
74, 128, 129, 130, 131, 132, 141, 147, 142, 143,
144, 157, 158, 162, 172, 133, 234, 134, 135, 184,
185, 186, 179, 163, 148, 180, 149, 173, 150, 181,
139, 140, 141, 207, 142, 169, 174, 143, 144, 228,
65, 66, 67, 102, 103, 104, 113, 114, 115, 120,
121, 122, 50, 51, 52, 56, 57, 58, 109, 110,
111, 72, 73, 74, 77, 123, 77, 75, 29, 137,

310, 309, 136, 82, 308, 307, 306, 163, 305, 304,
303, 302, 118, 54, 301, 300, 299, 298, 297, 296,
295, 294, 293, 292, 291, 290, 289, 288, 287, 286,
285, 284, 283, 127, 282, 281, 99, 280, 279, 278,
277, 138, 276, 275, 274, 273, 272, 270, 269, 268,
267, 266, 265, 264, 263, 262, 86, 261, 260, 259,
258, 257, 256, 254, 253, 252, 251, 250, 249, 248,
247, 246, 245, 244, 243, 242, 241, 240, 40, 239,
238, 237, 236, 235, 189, 233, 232, 231, 161, 230,
229, 227, 226, 225, 224, 223, 222, 221, 220, 219,

218, 217, 216, 215, 214, 213, 212, 211, 210, 80,
209, 35, 208, 206, 205, 204, 203, 202, 201, 200,
199, 198, 197, 196, 195, 194, 193, 192, 191, 190,
189, 188, 187, 178, 177, 176, 175, 171, 170, 125,
125, 168, 167, 166, 165, 164, 161, 160, 159, 156,
155, 154, 153, 152, 151, 146, 145, 138, 137, 136,
127, 126, 118, 107, 100, 97, 96, 95, 94, 93,
92, 91, 90, 86, 83, 82, 81, 78, 32, 48,
47, 34, 33, 32, 311, 3, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,

311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311
} ;

static yyconst flex_int16_t yy_chk[419] =
static yyconst flex_int16_t yy_chk[431] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 10,
11, 10, 11, 14, 19, 14, 17, 17, 17, 17,
17, 18, 18, 21, 19, 27, 28, 27, 28, 36,
17, 314, 17, 17, 31, 28, 21, 21, 21, 22,
31, 36, 38, 38, 38, 53, 53, 63, 22, 56,
58, 81, 22, 81, 56, 58, 58, 58, 139, 55,
22, 22, 22, 23, 99, 23, 63, 139, 23, 70,

70, 313, 23, 70, 99, 23, 55, 55, 55, 23,
62, 65, 23, 23, 23, 24, 312, 62, 62, 62,
80, 80, 82, 82, 65, 65, 65, 85, 92, 92,
126, 24, 24, 126, 311, 24, 24, 24, 24, 74,
74, 74, 74, 74, 85, 120, 85, 125, 85, 310,
125, 173, 173, 74, 125, 74, 74, 309, 120, 136,
136, 136, 174, 307, 174, 175, 175, 120, 186, 186,
186, 186, 189, 189, 189, 193, 193, 193, 195, 195,
195, 213, 213, 213, 215, 215, 215, 241, 241, 241,
270, 270, 270, 308, 306, 308, 304, 303, 302, 301,

300, 299, 298, 297, 296, 295, 294, 293, 292, 291,
290, 289, 288, 287, 286, 285, 283, 282, 281, 279,
278, 277, 276, 275, 274, 273, 272, 271, 269, 268,
267, 266, 265, 264, 263, 262, 261, 260, 258, 257,
255, 254, 253, 251, 250, 249, 248, 247, 246, 245,
244, 242, 240, 239, 238, 237, 236, 235, 234, 232,
231, 229, 228, 227, 226, 224, 223, 221, 220, 219,
218, 217, 216, 214, 211, 210, 208, 207, 206, 205,
204, 203, 202, 201, 200, 199, 198, 197, 194, 192,
191, 190, 188, 187, 185, 184, 183, 181, 180, 179,

177, 176, 172, 171, 170, 169, 168, 167, 166, 165,
164, 163, 162, 161, 160, 158, 156, 155, 154, 152,
150, 149, 148, 147, 146, 145, 144, 143, 142, 141,
140, 138, 137, 124, 123, 122, 121, 119, 117, 116,
111, 109, 108, 104, 100, 98, 97, 93, 90, 89,
88, 87, 86, 84, 83, 78, 77, 76, 72, 64,
57, 54, 49, 47, 43, 42, 41, 40, 39, 37,
34, 33, 32, 26, 20, 13, 12, 3, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305, 305, 305,

305, 305, 305, 305, 305, 305, 305, 305, 305, 305,
305, 305, 305, 305, 305, 305, 305, 305
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 10, 11, 10, 11, 14, 20,
14, 18, 18, 18, 18, 18, 19, 19, 23, 20,
31, 24, 31, 32, 41, 18, 32, 18, 18, 320,
24, 23, 23, 23, 24, 32, 41, 43, 43, 43,
36, 61, 24, 24, 24, 25, 36, 25, 59, 59,
25, 62, 135, 69, 25, 135, 62, 25, 61, 61,

61, 25, 71, 64, 25, 25, 25, 26, 64, 64,
64, 68, 69, 87, 87, 71, 71, 71, 68, 68,
68, 76, 76, 26, 26, 76, 319, 26, 26, 26,
26, 81, 81, 81, 81, 81, 88, 92, 88, 89,
89, 100, 100, 107, 129, 81, 318, 81, 81, 145,
145, 145, 134, 107, 92, 134, 92, 129, 92, 134,
184, 184, 185, 317, 185, 316, 129, 186, 186, 197,
197, 197, 197, 200, 200, 200, 204, 204, 204, 206,
206, 206, 225, 225, 225, 227, 227, 227, 253, 253,
253, 282, 282, 282, 314, 315, 314, 313, 312, 310,

309, 308, 307, 306, 305, 304, 303, 302, 301, 300,
299, 298, 297, 296, 294, 293, 292, 290, 289, 288,
287, 286, 285, 284, 283, 281, 280, 279, 277, 276,
275, 274, 273, 272, 270, 269, 267, 266, 265, 264,
262, 261, 260, 259, 258, 257, 256, 254, 252, 251,
250, 249, 248, 247, 246, 244, 243, 241, 240, 239,
238, 236, 235, 233, 232, 231, 230, 229, 228, 226,
224, 222, 220, 219, 218, 217, 216, 215, 214, 213,
212, 211, 210, 209, 208, 205, 203, 202, 201, 199,
198, 196, 195, 194, 192, 191, 190, 188, 187, 183,

182, 181, 180, 179, 178, 177, 176, 175, 174, 173,
172, 171, 170, 168, 166, 165, 164, 162, 160, 159,
158, 157, 156, 155, 154, 153, 152, 151, 150, 149,
148, 147, 146, 133, 132, 131, 130, 128, 126, 125,
124, 119, 117, 116, 112, 108, 106, 105, 101, 98,
97, 96, 95, 94, 93, 91, 90, 85, 84, 83,
79, 78, 70, 63, 60, 55, 53, 49, 48, 47,
46, 45, 44, 42, 39, 38, 37, 34, 30, 22,
21, 15, 13, 12, 3, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,

311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311,
311, 311, 311, 311, 311, 311, 311, 311, 311, 311
} ;

/* The intent behind this definition is that it'll catch
@@ -641,7 +645,7 @@ typedef lol::EasyMeshParser::token_type token_type;
#define yyterminate() return token::T_END
#define YY_NO_UNISTD_H
#define YY_USER_ACTION yylloc->columns(yyleng);
#line 645 "generated/easymesh-scanner.cpp"
#line 649 "generated/easymesh-scanner.cpp"

#define INITIAL 0

@@ -753,7 +757,7 @@ YY_DECL
yylloc->step();


#line 757 "generated/easymesh-scanner.cpp"
#line 761 "generated/easymesh-scanner.cpp"

if ( !(yy_init) )
{
@@ -806,13 +810,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 306 )
if ( yy_current_state >= 312 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_current_state != 305 );
while ( yy_current_state != 311 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);

@@ -1059,74 +1063,79 @@ YY_RULE_SETUP
YY_BREAK
case 46:
YY_RULE_SETUP
#line 98 "easymesh/easymesh-scanner.l"
{ return token::T_CYLINDER; }
#line 97 "easymesh/easymesh-scanner.l"
{ return token::T_DUPLICATE; }
YY_BREAK
case 47:
YY_RULE_SETUP
#line 99 "easymesh/easymesh-scanner.l"
{ return token::T_SPHERE; }
{ return token::T_CYLINDER; }
YY_BREAK
case 48:
YY_RULE_SETUP
#line 100 "easymesh/easymesh-scanner.l"
{ return token::T_CAPSULE; }
{ return token::T_SPHERE; }
YY_BREAK
case 49:
YY_RULE_SETUP
#line 101 "easymesh/easymesh-scanner.l"
{ return token::T_TORUS; }
{ return token::T_CAPSULE; }
YY_BREAK
case 50:
YY_RULE_SETUP
#line 102 "easymesh/easymesh-scanner.l"
{ return token::T_BOX; }
{ return token::T_TORUS; }
YY_BREAK
case 51:
YY_RULE_SETUP
#line 103 "easymesh/easymesh-scanner.l"
{ return token::T_SMOOTHCHAMFBOX; }
{ return token::T_BOX; }
YY_BREAK
case 52:
YY_RULE_SETUP
#line 104 "easymesh/easymesh-scanner.l"
{ return token::T_FLATCHAMFBOX; }
{ return token::T_SMOOTHCHAMFBOX; }
YY_BREAK
case 53:
YY_RULE_SETUP
#line 105 "easymesh/easymesh-scanner.l"
{ return token::T_STAR; }
{ return token::T_FLATCHAMFBOX; }
YY_BREAK
case 54:
YY_RULE_SETUP
#line 106 "easymesh/easymesh-scanner.l"
{ return token::T_EXPANDEDSTAR; }
{ return token::T_STAR; }
YY_BREAK
case 55:
YY_RULE_SETUP
#line 107 "easymesh/easymesh-scanner.l"
{ return token::T_DISC; }
{ return token::T_EXPANDEDSTAR; }
YY_BREAK
case 56:
YY_RULE_SETUP
#line 108 "easymesh/easymesh-scanner.l"
{ return token::T_TRIANGLE; }
{ return token::T_DISC; }
YY_BREAK
case 57:
YY_RULE_SETUP
#line 109 "easymesh/easymesh-scanner.l"
{ return token::T_QUAD; }
{ return token::T_TRIANGLE; }
YY_BREAK
case 58:
YY_RULE_SETUP
#line 110 "easymesh/easymesh-scanner.l"
{ return token::T_QUAD; }
YY_BREAK
case 59:
YY_RULE_SETUP
#line 111 "easymesh/easymesh-scanner.l"
{ return token::T_COG; }
YY_BREAK
/* ======= BASE COLOR TYPES ========================================= */
/* COLOR */
case 59:
case 60:
YY_RULE_SETUP
#line 114 "easymesh/easymesh-scanner.l"
#line 115 "easymesh/easymesh-scanner.l"
{
uint32_t tmp = std::strtol(yytext + 1, nullptr, 16);
yylval->u32val = 0x11000000u * (tmp >> 8)
@@ -1135,9 +1144,9 @@ YY_RULE_SETUP
| 0x000000ffu;
return token::COLOR; }
YY_BREAK
case 60:
case 61:
YY_RULE_SETUP
#line 121 "easymesh/easymesh-scanner.l"
#line 122 "easymesh/easymesh-scanner.l"
{
uint32_t tmp = std::strtol(yytext + 1, nullptr, 16);
yylval->u32val = 0x11000000u * (tmp >> 12)
@@ -1146,101 +1155,111 @@ YY_RULE_SETUP
| 0x00000011u * (tmp & 0xf);
return token::COLOR; }
YY_BREAK
case 61:
case 62:
YY_RULE_SETUP
#line 128 "easymesh/easymesh-scanner.l"
#line 129 "easymesh/easymesh-scanner.l"
{
yylval->u32val = 0xffu
| 0x100u * (uint32_t)std::strtol(yytext + 1, nullptr, 16);
return token::COLOR; }
YY_BREAK
case 62:
case 63:
YY_RULE_SETUP
#line 132 "easymesh/easymesh-scanner.l"
#line 133 "easymesh/easymesh-scanner.l"
{
yylval->u32val = (uint32_t)std::strtol(yytext + 1, nullptr, 16);
return token::COLOR; }
YY_BREAK
/* ======= BASE DATA TYPES ========================================= */
/* BOOL */
case 63:
case 64:
YY_RULE_SETUP
#line 138 "easymesh/easymesh-scanner.l"
#line 139 "easymesh/easymesh-scanner.l"
{ yylval->bval = true; return token::BOOLEAN; }
YY_BREAK
case 64:
case 65:
YY_RULE_SETUP
#line 139 "easymesh/easymesh-scanner.l"
#line 140 "easymesh/easymesh-scanner.l"
{ yylval->bval = false; return token::BOOLEAN; }
YY_BREAK
/* FLOAT */
case 65:
case 66:
YY_RULE_SETUP
#line 141 "easymesh/easymesh-scanner.l"
#line 142 "easymesh/easymesh-scanner.l"
{
yylval->fval = (float)std::atof(yytext); return token::F_NUMBER; }
YY_BREAK
/* INT */
case 66:
case 67:
YY_RULE_SETUP
#line 144 "easymesh/easymesh-scanner.l"
#line 145 "easymesh/easymesh-scanner.l"
{
yylval->ival = std::atoi(yytext); return token::I_NUMBER; }
YY_BREAK
/* ======= COMMENTS ======= */
case 67:
case 68:
YY_RULE_SETUP
#line 148 "easymesh/easymesh-scanner.l"
#line 149 "easymesh/easymesh-scanner.l"
{ /* ignore this */ }
YY_BREAK
/* Semantics tokens */
case 68:
YY_RULE_SETUP
#line 151 "easymesh/easymesh-scanner.l"
{ return token_type('-'); }
YY_BREAK
case 69:
YY_RULE_SETUP
#line 152 "easymesh/easymesh-scanner.l"
{ return token_type('('); }
{ return token_type('-'); }
YY_BREAK
case 70:
YY_RULE_SETUP
#line 153 "easymesh/easymesh-scanner.l"
{ return token_type(')'); }
{ return token_type('('); }
YY_BREAK
case 71:
YY_RULE_SETUP
#line 154 "easymesh/easymesh-scanner.l"
{ return token_type('['); }
{ return token_type(')'); }
YY_BREAK
case 72:
YY_RULE_SETUP
#line 155 "easymesh/easymesh-scanner.l"
{ return token_type(']'); }
{ return token_type('{'); }
YY_BREAK
case 73:
YY_RULE_SETUP
#line 156 "easymesh/easymesh-scanner.l"
{ /* ignore this */ }
{ return token_type('}'); }
YY_BREAK
case 74:
/* rule 74 can match eol */
YY_RULE_SETUP
#line 157 "easymesh/easymesh-scanner.l"
{ /* ignore this */ }
{ return token_type('['); }
YY_BREAK
case 75:
YY_RULE_SETUP
#line 158 "easymesh/easymesh-scanner.l"
{ return token::T_ERROR; }
{ return token_type(']'); }
YY_BREAK
case 76:
YY_RULE_SETUP
#line 159 "easymesh/easymesh-scanner.l"
{ /* ignore this */ }
YY_BREAK
case 77:
/* rule 77 can match eol */
YY_RULE_SETUP
#line 160 "easymesh/easymesh-scanner.l"
{ /* ignore this */ }
YY_BREAK
case 78:
YY_RULE_SETUP
#line 161 "easymesh/easymesh-scanner.l"
{ return token::T_ERROR; }
YY_BREAK
case 79:
YY_RULE_SETUP
#line 163 "easymesh/easymesh-scanner.l"
ECHO;
YY_BREAK
#line 1244 "generated/easymesh-scanner.cpp"
#line 1263 "generated/easymesh-scanner.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();

@@ -1622,7 +1641,7 @@ int yyFlexLexer::yy_get_next_buffer()
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 306 )
if ( yy_current_state >= 312 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1650,11 +1669,11 @@ int yyFlexLexer::yy_get_next_buffer()
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 306 )
if ( yy_current_state >= 312 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 305);
yy_is_jam = (yy_current_state == 311);

return yy_is_jam ? 0 : yy_current_state;
}
@@ -2141,7 +2160,7 @@ void EasyMeshfree (void * ptr )

#define YYTABLES_NAME "yytables"

#line 160 "easymesh/easymesh-scanner.l"
#line 163 "easymesh/easymesh-scanner.l"





+ 3
- 0
src/lol/math/vector.h View File

@@ -251,6 +251,7 @@ template <typename T> struct Vec2 : BVec2<T>

LOL_MEMBER_OPS(Vec2, x)

static const Vec2<T> one;
static const Vec2<T> zero;
static const Vec2<T> axis_x;
static const Vec2<T> axis_y;
@@ -524,6 +525,7 @@ template <typename T> struct Vec3 : BVec3<T>

LOL_MEMBER_OPS(Vec3, x)

static const Vec3<T> one;
static const Vec3<T> zero;
static const Vec3<T> axis_x;
static const Vec3<T> axis_y;
@@ -946,6 +948,7 @@ template <typename T> struct Vec4 : BVec4<T>

LOL_MEMBER_OPS(Vec4, x)

static const Vec4<T> one;
static const Vec4<T> zero;
static const Vec4<T> axis_x;
static const Vec4<T> axis_y;


+ 3
- 0
src/math/constants.cpp View File

@@ -29,15 +29,18 @@ namespace lol {
Vec4<type> const Vec4<type>::name = Vec4<type>((type)a, (type)b, (type)c, (type)d);

#define LOL_ALL_VECTOR_CONST_INNER(type) \
LOL_VEC_2_CONST(type, one, 1, 1) \
LOL_VEC_2_CONST(type, zero, 0, 0) \
LOL_VEC_2_CONST(type, axis_x, 1, 0) \
LOL_VEC_2_CONST(type, axis_y, 0, 1) \
\
LOL_VEC_3_CONST(type, one, 1, 1, 1) \
LOL_VEC_3_CONST(type, zero, 0, 0, 0) \
LOL_VEC_3_CONST(type, axis_x, 1, 0, 0) \
LOL_VEC_3_CONST(type, axis_y, 0, 1, 0) \
LOL_VEC_3_CONST(type, axis_z, 0, 0, 1) \
\
LOL_VEC_4_CONST(type, one, 1, 1, 1, 1) \
LOL_VEC_4_CONST(type, zero, 0, 0, 0, 0) \
LOL_VEC_4_CONST(type, axis_x, 1, 0, 0, 0) \
LOL_VEC_4_CONST(type, axis_y, 0, 1, 0, 0) \


+ 24
- 3
test/data/mesh-buffer.txt View File

@@ -1,7 +1,28 @@
addlight 0.0 position (1 0 1) color #0ff
addlight 0.0 position (-0.2 -1 -0.5) color (.0 .2 .5 1)
addlight 0.0 position (1 -1 1) color #fff
addlight 0.0 position (-1 -1 -1) color #fff
clearcolor #f00
//addlight 0.0 position (1 0 1) color #0ff
//addlight 0.0 position (-0.2 -1 -0.5) color (.0 .2 .5 1)

custom setmesh "sc#fff ab 2 ty 1.5 ab 2"
//custom setmesh "sc#f00 ab 2 ty 1.5 ab 2"
custom setmesh "
[sc#0f0 scb#0f0 ac 3 .5 .4 0 ty .25 [ad 3 .4 sy -1] ty .5 ac 3 1 .1 .1 ty .5 dup [ rz 90 ry 90 dup [ ry 90 ] ] ]
//[sc#f00 scb#f00 ac 3 .5 .4 0 ty .25 [ad 3 .4 sy -1] ty .5 ac 3 1 .1 .1 ty .5 rz -90]
//[sc#00f scb#00f ac 3 .5 .4 0 ty .25 [ad 3 .4 sy -1] ty .5 ac 3 1 .1 .1 ty .5 rx 90]
//[sc#fff ab .1]
[sc#f00 ab .2 tx 1]
[sc#0f0 ab .2 ty 1]
[sc#00f ab .2 tz 1]
//sc#0f0 ab 2 ty 1.5 ab 2
//sc#00f ab 2 ty 1.5 ab 2
"
//splt 0
//test


+ 6
- 5
test/easymeshdictionnary.js View File

@@ -13,11 +13,11 @@ CmdVar("vec3", ["X/Y/Z as float", "&nbsp;f f f", "(f f f)", "(f)"]);
//-------------------------------------------------------------------------
//Mesh CSG operations
//-------------------------------------------------------------------------
CmdType(["csgu", "csgunion"], "Performs a Union operation as (mesh0_Outside + mesh1_Outside)");
CmdType(["csgs", "csgsubstract"], "Performs a Substract operation as (mesh0_Outside + mesh1_Inside-inverted)");
CmdType(["csgsl", "csgsubstractloss"], "Performs a Substract operation without keeping the mesh1 part");
CmdType(["csga", "csgand"], "Performs an And operation as (mesh0_Inside + mesh1_Inside)");
CmdType(["csgx", "csgxor"], "Performs a Xor operation as (m0_Outside/m0_Inside-inverted + m1_Outside/m1_Inside-inverted)");
CmdType(["csgu", "csgunion"], "Performs a Union operation as (mesh0_Outside + mesh1_Outside)", [CmdArg("[ ]", "")]);
CmdType(["csgs", "csgsubstract"], "Performs a Substract operation as (mesh0_Outside + mesh1_Inside-inverted)", [CmdArg("[ ]", "")]);
CmdType(["csgsl", "csgsubstractloss"], "Performs a Substract operation without keeping the mesh1 part", [CmdArg("[ ]", "")]);
CmdType(["csga", "csgand"], "Performs an And operation as (mesh0_Inside + mesh1_Inside)", [CmdArg("[ ]", "")]);
CmdType(["csgx", "csgxor"], "Performs a Xor operation as (m0_Outside/m0_Inside-inverted + m1_Outside/m1_Inside-inverted)", [CmdArg("[ ]", "")]);

//-------------------------------------------------------------------------
//Mesh Base operations
@@ -60,6 +60,7 @@ CmdType(["sx", "scalex"], "Scale vertices", [CmdArg("vec3", "s")]);
CmdType(["sy", "scaley"], "Scale vertices", [CmdArg("vec3", "s")]);
CmdType(["sz", "scalez"], "Scale vertices", [CmdArg("vec3", "s")]);
CmdType(["s", "scale"], "Uniformly Scale vertices", [CmdArg("float", "s")]);
CmdType(["dup", "duplicate"], "Duplicate scope mesh and apply commands in the brackets.", [CmdArg("[ ]", "")]);
CmdType(["mx", "mirrorx"], "Mirror vertices through X-plane");
CmdType(["my", "mirrory"], "Mirror vertices through Y-plane");
CmdType(["mz", "mirrorz"], "Mirror vertices through Z-plane");


+ 115
- 100
test/generated/scenesetup-parser.cpp View File

@@ -488,115 +488,130 @@ namespace lol {
case 17:

/* Line 677 of lalr1.cc */
#line 134 "scenesetup-parser.y"
{ uc.m_sstp.m_custom_cmd.Push((yysemantic_stack_[(3) - (2)].svval), (yysemantic_stack_[(3) - (3)].sval)); }
#line 131 "scenesetup-parser.y"
{ uc.m_sstp.m_clear_color = vec4((yysemantic_stack_[(2) - (2)].vval)[0], (yysemantic_stack_[(2) - (2)].vval)[1], (yysemantic_stack_[(2) - (2)].vval)[2], (yysemantic_stack_[(2) - (2)].vval)[3]); }
break;

case 18:

/* Line 677 of lalr1.cc */
#line 140 "scenesetup-parser.y"
{ (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); }
#line 132 "scenesetup-parser.y"
{ uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); ivec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff);
uc.m_sstp.m_clear_color = vec4(v) * (1.f / 255.f); }
break;

case 19:

/* Line 677 of lalr1.cc */
#line 141 "scenesetup-parser.y"
{ (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); }
#line 137 "scenesetup-parser.y"
{ uc.m_sstp.m_custom_cmd.Push((yysemantic_stack_[(3) - (2)].svval), (yysemantic_stack_[(3) - (3)].sval)); }
break;

case 20:

/* Line 677 of lalr1.cc */
#line 142 "scenesetup-parser.y"
{ (yyval.fval) = (float)(yysemantic_stack_[(1) - (1)].ival); }
#line 143 "scenesetup-parser.y"
{ (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); }
break;

case 21:

/* Line 677 of lalr1.cc */
#line 143 "scenesetup-parser.y"
{ (yyval.fval) = -(float)(yysemantic_stack_[(2) - (2)].ival); }
#line 144 "scenesetup-parser.y"
{ (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); }
break;

case 22:

/* Line 677 of lalr1.cc */
#line 147 "scenesetup-parser.y"
{ (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); }
#line 145 "scenesetup-parser.y"
{ (yyval.fval) = (float)(yysemantic_stack_[(1) - (1)].ival); }
break;

case 23:

/* Line 677 of lalr1.cc */
#line 148 "scenesetup-parser.y"
{ (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); }
#line 146 "scenesetup-parser.y"
{ (yyval.fval) = -(float)(yysemantic_stack_[(2) - (2)].ival); }
break;

case 24:

/* Line 677 of lalr1.cc */
#line 149 "scenesetup-parser.y"
{ (yyval.ival) = (int)(yysemantic_stack_[(1) - (1)].fval); }
#line 150 "scenesetup-parser.y"
{ (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); }
break;

case 25:

/* Line 677 of lalr1.cc */
#line 150 "scenesetup-parser.y"
{ (yyval.ival) = -(int)(yysemantic_stack_[(2) - (2)].fval); }
#line 151 "scenesetup-parser.y"
{ (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); }
break;

case 26:

/* Line 677 of lalr1.cc */
#line 155 "scenesetup-parser.y"
{ (yyval.vval)[0] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[2] = (yysemantic_stack_[(3) - (2)].fval); }
#line 152 "scenesetup-parser.y"
{ (yyval.ival) = (int)(yysemantic_stack_[(1) - (1)].fval); }
break;

case 27:

/* Line 677 of lalr1.cc */
#line 156 "scenesetup-parser.y"
{ (yyval.vval)[0] = (yysemantic_stack_[(5) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(5) - (3)].fval); (yyval.vval)[2] = (yysemantic_stack_[(5) - (4)].fval); }
#line 153 "scenesetup-parser.y"
{ (yyval.ival) = -(int)(yysemantic_stack_[(2) - (2)].fval); }
break;

case 28:

/* Line 677 of lalr1.cc */
#line 165 "scenesetup-parser.y"
{ (yyval.vval)[0] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[2] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[3] = (yysemantic_stack_[(3) - (2)].fval); }
#line 158 "scenesetup-parser.y"
{ (yyval.vval)[0] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[2] = (yysemantic_stack_[(3) - (2)].fval); }
break;

case 29:

/* Line 677 of lalr1.cc */
#line 166 "scenesetup-parser.y"
{ (yyval.vval)[0] = (yysemantic_stack_[(6) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(6) - (3)].fval); (yyval.vval)[2] = (yysemantic_stack_[(6) - (4)].fval); (yyval.vval)[3] = (yysemantic_stack_[(6) - (5)].fval); }
#line 159 "scenesetup-parser.y"
{ (yyval.vval)[0] = (yysemantic_stack_[(5) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(5) - (3)].fval); (yyval.vval)[2] = (yysemantic_stack_[(5) - (4)].fval); }
break;

case 30:

/* Line 677 of lalr1.cc */
#line 177 "scenesetup-parser.y"
{ (yyval.svval) = (yysemantic_stack_[(1) - (1)].svval); }
#line 168 "scenesetup-parser.y"
{ (yyval.vval)[0] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[2] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[3] = (yysemantic_stack_[(3) - (2)].fval); }
break;

case 31:

/* Line 677 of lalr1.cc */
#line 181 "scenesetup-parser.y"
#line 169 "scenesetup-parser.y"
{ (yyval.vval)[0] = (yysemantic_stack_[(6) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(6) - (3)].fval); (yyval.vval)[2] = (yysemantic_stack_[(6) - (4)].fval); (yyval.vval)[3] = (yysemantic_stack_[(6) - (5)].fval); }
break;

case 32:

/* Line 677 of lalr1.cc */
#line 180 "scenesetup-parser.y"
{ (yyval.svval) = (yysemantic_stack_[(1) - (1)].svval); }
break;

case 33:

/* Line 677 of lalr1.cc */
#line 184 "scenesetup-parser.y"
{ String t = (yysemantic_stack_[(1) - (1)].sval);
t.Replace('"', ' ', true);
free((yysemantic_stack_[(1) - (1)].sval));
(yyval.sval) = strdup((const char *)t.C()); }
break;

case 32:
case 34:

/* Line 677 of lalr1.cc */
#line 185 "scenesetup-parser.y"
#line 188 "scenesetup-parser.y"
{ String t = (yysemantic_stack_[(2) - (1)].sval);
t += (yysemantic_stack_[(2) - (2)].sval);
t.Replace('"', ' ', true);
@@ -608,7 +623,7 @@ namespace lol {


/* Line 677 of lalr1.cc */
#line 612 "generated/scenesetup-parser.cpp"
#line 627 "generated/scenesetup-parser.cpp"
default:
break;
}
@@ -813,16 +828,16 @@ namespace lol {

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
const signed char SceneSetupParser::yypact_ninf_ = -17;
const signed char SceneSetupParser::yypact_ninf_ = -18;
const signed char
SceneSetupParser::yypact_[] =
{
28, 7, -12, -12, -5, 1, 24, 25, 28, 28,
-17, -17, -17, -17, -17, -17, 11, -17, 7, -17,
-17, -17, 7, -17, -17, -11, -17, -17, -17, -17,
-17, -17, 11, -17, -17, -7, -3, -11, -17, -17,
-17, -17, 7, -17, 7, -17, 12, 7, -17, 19,
-17
30, 8, -13, -13, -6, -2, 3, 1, 26, 30,
30, -18, -18, -18, -18, -18, -18, 12, -18, 8,
-18, -18, -18, 8, -18, -18, -18, -18, 14, -18,
-18, -18, -18, -18, -18, 12, -18, -18, -8, -4,
14, -18, -18, -18, -18, 8, -18, 8, -18, 13,
8, -18, 21, -18
};

/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
@@ -831,28 +846,28 @@ namespace lol {
const unsigned char
SceneSetupParser::yydefact_[] =
{
0, 11, 0, 0, 0, 0, 0, 0, 3, 5,
6, 8, 9, 10, 18, 20, 0, 12, 0, 13,
14, 16, 0, 15, 30, 0, 1, 2, 4, 7,
18, 20, 0, 19, 21, 0, 0, 31, 17, 19,
21, 26, 0, 28, 0, 32, 0, 0, 27, 0,
29
0, 11, 0, 0, 0, 0, 0, 0, 0, 3,
5, 6, 8, 9, 10, 20, 22, 0, 12, 0,
13, 14, 16, 0, 15, 18, 17, 32, 0, 1,
2, 4, 7, 20, 22, 0, 21, 23, 0, 0,
33, 19, 21, 23, 28, 0, 30, 0, 34, 0,
0, 29, 0, 31
};

/* YYPGOTO[NTERM-NUM]. */
const signed char
SceneSetupParser::yypgoto_[] =
{
-17, -17, 21, -17, -17, 29, -17, -17, -17, -16,
8, 36, -17, -17, 4
-18, -18, 22, -18, -18, 31, -18, -18, -18, -17,
7, 40, 39, -18, 5
};

/* YYDEFGOTO[NTERM-NUM]. */
const signed char
SceneSetupParser::yydefgoto_[] =
{
-1, 6, 7, 8, 9, 10, 11, 12, 13, 17,
34, 19, 23, 25, 38
-1, 7, 8, 9, 10, 11, 12, 13, 14, 18,
37, 20, 24, 28, 41
};

/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@@ -862,22 +877,22 @@ namespace lol {
const unsigned char
SceneSetupParser::yytable_[] =
{
33, 37, 35, 14, 15, 18, 36, 14, 15, 16,
21, 41, 22, 16, 24, 43, 39, 14, 15, 42,
44, 30, 31, 16, 26, 27, 46, 32, 47, 28,
48, 49, 1, 2, 3, 4, 5, 50, 29, 20,
40, 45
36, 29, 38, 15, 16, 19, 39, 15, 16, 17,
22, 44, 23, 17, 25, 46, 23, 27, 42, 15,
16, 45, 47, 33, 34, 17, 30, 40, 49, 35,
50, 31, 51, 52, 1, 2, 3, 4, 5, 6,
53, 32, 43, 21, 26, 48
};

/* YYCHECK. */
const unsigned char
SceneSetupParser::yycheck_[] =
{
16, 12, 18, 10, 11, 17, 22, 10, 11, 16,
15, 18, 17, 16, 13, 18, 32, 10, 11, 35,
36, 10, 11, 16, 0, 0, 42, 16, 44, 8,
18, 47, 4, 5, 6, 7, 8, 18, 9, 3,
32, 37
17, 0, 19, 11, 12, 18, 23, 11, 12, 17,
16, 19, 18, 17, 16, 19, 18, 14, 35, 11,
12, 38, 39, 11, 12, 17, 0, 13, 45, 17,
47, 9, 19, 50, 4, 5, 6, 7, 8, 9,
19, 10, 35, 3, 5, 40
};

/* STOS_[STATE-NUM] -- The (internal number of the) accessing
@@ -885,12 +900,12 @@ namespace lol {
const unsigned char
SceneSetupParser::yystos_[] =
{
0, 4, 5, 6, 7, 8, 20, 21, 22, 23,
24, 25, 26, 27, 10, 11, 16, 28, 17, 30,
30, 15, 17, 31, 13, 32, 0, 0, 21, 24,
10, 11, 16, 28, 29, 28, 28, 12, 33, 28,
29, 18, 28, 18, 28, 33, 28, 28, 18, 28,
18
0, 4, 5, 6, 7, 8, 9, 21, 22, 23,
24, 25, 26, 27, 28, 11, 12, 17, 29, 18,
31, 31, 16, 18, 32, 16, 32, 14, 33, 0,
0, 22, 25, 11, 12, 17, 29, 30, 29, 29,
13, 34, 29, 30, 19, 29, 19, 29, 34, 29,
29, 19, 29, 19
};

#if YYDEBUG
@@ -900,7 +915,7 @@ namespace lol {
SceneSetupParser::yytoken_number_[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 45, 40, 41
265, 266, 267, 268, 269, 270, 271, 45, 40, 41
};
#endif

@@ -908,10 +923,10 @@ namespace lol {
const unsigned char
SceneSetupParser::yyr1_[] =
{
0, 19, 20, 21, 21, 22, 23, 23, 24, 24,
24, 25, 25, 26, 26, 26, 26, 27, 28, 28,
28, 28, 29, 29, 29, 29, 30, 30, 31, 31,
32, 33, 33
0, 20, 21, 22, 22, 23, 24, 24, 25, 25,
25, 26, 26, 27, 27, 27, 27, 27, 27, 28,
29, 29, 29, 29, 30, 30, 30, 30, 31, 31,
32, 32, 33, 34, 34
};

/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
@@ -919,9 +934,9 @@ namespace lol {
SceneSetupParser::yyr2_[] =
{
0, 2, 2, 1, 2, 1, 1, 2, 1, 1,
1, 1, 2, 2, 2, 2, 2, 3, 1, 2,
1, 2, 1, 2, 1, 2, 3, 5, 3, 6,
1, 1, 2
1, 1, 2, 2, 2, 2, 2, 2, 2, 3,
1, 2, 1, 2, 1, 2, 1, 2, 3, 5,
3, 6, 1, 1, 2
};

#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
@@ -931,9 +946,9 @@ namespace lol {
const SceneSetupParser::yytname_[] =
{
"T_END", "error", "$undefined", "T_COLOR", "T_ADDLIGHT",
"T_OBJPOSITION", "T_OBJLOOKAT", "T_OBJCOLOR", "T_CUSTOMCMD", "T_ERROR",
"F_NUMBER", "I_NUMBER", "STRING", "STRING_VAR", "BOOLEAN", "COLOR",
"'-'", "'('", "')'", "$accept", "sstp_description",
"T_OBJPOSITION", "T_OBJLOOKAT", "T_OBJCOLOR", "T_CLEARCOLOR",
"T_CUSTOMCMD", "T_ERROR", "F_NUMBER", "I_NUMBER", "STRING", "STRING_VAR",
"BOOLEAN", "COLOR", "'-'", "'('", "')'", "$accept", "sstp_description",
"sstp_expression_list", "sstp_expression", "sstp_command_list",
"sstp_command", "light_command", "setup_command", "custom_command", "fv",
"iv", "v3", "v4", "svv", "sv", 0
@@ -945,16 +960,16 @@ namespace lol {
const SceneSetupParser::rhs_number_type
SceneSetupParser::yyrhs_[] =
{
20, 0, -1, 21, 0, -1, 22, -1, 22, 21,
-1, 23, -1, 24, -1, 23, 24, -1, 25, -1,
26, -1, 27, -1, 4, -1, 4, 28, -1, 5,
30, -1, 6, 30, -1, 7, 31, -1, 7, 15,
-1, 8, 32, 33, -1, 10, -1, 16, 28, -1,
11, -1, 16, 29, -1, 11, -1, 16, 29, -1,
10, -1, 16, 28, -1, 17, 28, 18, -1, 17,
28, 28, 28, 18, -1, 17, 28, 18, -1, 17,
28, 28, 28, 28, 18, -1, 13, -1, 12, -1,
12, 33, -1
21, 0, -1, 22, 0, -1, 23, -1, 23, 22,
-1, 24, -1, 25, -1, 24, 25, -1, 26, -1,
27, -1, 28, -1, 4, -1, 4, 29, -1, 5,
31, -1, 6, 31, -1, 7, 32, -1, 7, 16,
-1, 8, 32, -1, 8, 16, -1, 9, 33, 34,
-1, 11, -1, 17, 29, -1, 12, -1, 17, 30,
-1, 12, -1, 17, 30, -1, 11, -1, 17, 29,
-1, 18, 29, 19, -1, 18, 29, 29, 29, 19,
-1, 18, 29, 19, -1, 18, 29, 29, 29, 29,
19, -1, 14, -1, 13, -1, 13, 34, -1
};

/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
@@ -963,9 +978,9 @@ namespace lol {
SceneSetupParser::yyprhs_[] =
{
0, 0, 3, 6, 8, 11, 13, 15, 18, 20,
22, 24, 26, 29, 32, 35, 38, 41, 45, 47,
50, 52, 55, 57, 60, 62, 65, 69, 75, 79,
86, 88, 90
22, 24, 26, 29, 32, 35, 38, 41, 44, 47,
51, 53, 56, 58, 61, 63, 66, 68, 71, 75,
81, 85, 92, 94, 96
};

/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
@@ -973,9 +988,9 @@ namespace lol {
SceneSetupParser::yyrline_[] =
{
0, 90, 90, 94, 95, 99, 103, 104, 108, 109,
110, 114, 115, 120, 122, 124, 126, 134, 140, 141,
142, 143, 147, 148, 149, 150, 155, 156, 165, 166,
177, 181, 185
110, 114, 115, 120, 122, 124, 126, 131, 132, 137,
143, 144, 145, 146, 150, 151, 152, 153, 158, 159,
168, 169, 180, 184, 188
};

// Print the state stack on the debug stream.
@@ -1019,7 +1034,7 @@ namespace lol {
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
17, 18, 2, 2, 2, 16, 2, 2, 2, 2,
18, 19, 2, 2, 2, 17, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -1042,7 +1057,7 @@ namespace lol {
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15
15, 16
};
if ((unsigned int) t <= yyuser_token_number_max_)
return translate_table[t];
@@ -1051,26 +1066,26 @@ namespace lol {
}

const int SceneSetupParser::yyeof_ = 0;
const int SceneSetupParser::yylast_ = 41;
const int SceneSetupParser::yylast_ = 45;
const int SceneSetupParser::yynnts_ = 15;
const int SceneSetupParser::yyempty_ = -2;
const int SceneSetupParser::yyfinal_ = 26;
const int SceneSetupParser::yyfinal_ = 29;
const int SceneSetupParser::yyterror_ = 1;
const int SceneSetupParser::yyerrcode_ = 256;
const int SceneSetupParser::yyntokens_ = 19;
const int SceneSetupParser::yyntokens_ = 20;

const unsigned int SceneSetupParser::yyuser_token_number_max_ = 270;
const unsigned int SceneSetupParser::yyuser_token_number_max_ = 271;
const SceneSetupParser::token_number_type SceneSetupParser::yyundef_token_ = 2;


} // lol

/* Line 1053 of lalr1.cc */
#line 1070 "generated/scenesetup-parser.cpp"
#line 1085 "generated/scenesetup-parser.cpp"


/* Line 1055 of lalr1.cc */
#line 193 "scenesetup-parser.y"
#line 196 "scenesetup-parser.y"


void lol::SceneSetupParser::error(const SceneSetupParser::location_type& l,


+ 10
- 9
test/generated/scenesetup-parser.h View File

@@ -142,14 +142,15 @@ namespace lol {
T_OBJPOSITION = 260,
T_OBJLOOKAT = 261,
T_OBJCOLOR = 262,
T_CUSTOMCMD = 263,
T_ERROR = 264,
F_NUMBER = 265,
I_NUMBER = 266,
STRING = 267,
STRING_VAR = 268,
BOOLEAN = 269,
COLOR = 270
T_CLEARCOLOR = 263,
T_CUSTOMCMD = 264,
T_ERROR = 265,
F_NUMBER = 266,
I_NUMBER = 267,
STRING = 268,
STRING_VAR = 269,
BOOLEAN = 270,
COLOR = 271
};

};
@@ -323,7 +324,7 @@ namespace lol {
} // lol

/* Line 34 of lalr1.cc */
#line 327 "generated/scenesetup-parser.h"
#line 328 "generated/scenesetup-parser.h"





+ 350
- 310
test/generated/scenesetup-parser.output
File diff suppressed because it is too large
View File


+ 115
- 103
test/generated/scenesetup-scanner.cpp View File

@@ -330,8 +330,8 @@ typedef unsigned char YY_CHAR;
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;

#define YY_NUM_RULES 23
#define YY_END_OF_BUFFER 24
#define YY_NUM_RULES 24
#define YY_END_OF_BUFFER 25
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -339,16 +339,17 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[78] =
static yyconst flex_int16_t yy_accept[87] =
{ 0,
0, 0, 24, 22, 21, 20, 22, 22, 18, 19,
22, 17, 22, 22, 13, 22, 22, 22, 22, 22,
22, 22, 0, 14, 0, 0, 13, 12, 16, 15,
15, 15, 15, 15, 15, 15, 15, 0, 0, 16,
15, 15, 15, 15, 15, 15, 15, 6, 0, 12,
15, 15, 15, 15, 15, 15, 10, 7, 15, 4,
15, 11, 15, 15, 0, 15, 5, 3, 15, 8,
15, 15, 0, 1, 2, 9, 0
0, 0, 25, 23, 22, 21, 23, 23, 19, 20,
23, 18, 23, 23, 14, 23, 23, 23, 23, 23,
23, 23, 0, 15, 0, 0, 14, 13, 17, 16,
16, 16, 16, 16, 16, 16, 16, 16, 0, 0,
17, 16, 16, 16, 16, 16, 16, 16, 16, 7,
0, 13, 16, 16, 16, 16, 16, 16, 16, 11,
8, 16, 16, 4, 16, 12, 16, 16, 0, 16,
16, 6, 3, 16, 9, 16, 16, 16, 0, 1,
16, 2, 10, 16, 5, 0
} ;

static yyconst flex_int32_t yy_ec[256] =
@@ -391,72 +392,78 @@ static yyconst flex_int32_t yy_meta[35] =
3, 3, 3, 3
} ;

static yyconst flex_int16_t yy_base[89] =
static yyconst flex_int16_t yy_base[98] =
{ 0,
0, 0, 118, 119, 119, 119, 113, 0, 119, 119,
25, 26, 104, 104, 29, 0, 95, 11, 96, 83,
82, 79, 105, 119, 0, 96, 32, 34, 0, 0,
88, 80, 73, 78, 74, 70, 67, 0, 41, 0,
74, 70, 65, 65, 71, 71, 74, 0, 81, 80,
67, 59, 60, 68, 70, 53, 0, 0, 63, 0,
57, 0, 35, 39, 0, 29, 0, 0, 22, 0,
14, 15, 0, 0, 0, 119, 119, 54, 56, 59,
61, 66, 68, 70, 72, 74, 76, 78
0, 0, 127, 128, 128, 128, 122, 0, 128, 128,
25, 26, 113, 113, 29, 0, 104, 14, 105, 92,
91, 88, 114, 128, 0, 105, 32, 33, 0, 0,
97, 95, 88, 81, 86, 82, 78, 75, 0, 42,
0, 82, 90, 77, 72, 72, 78, 78, 81, 0,
88, 87, 74, 66, 65, 66, 74, 76, 59, 0,
0, 69, 72, 0, 62, 0, 55, 63, 0, 63,
56, 0, 0, 55, 0, 35, 37, 24, 0, 0,
20, 0, 128, 15, 0, 128, 54, 56, 59, 61,
66, 68, 70, 72, 74, 76, 78

} ;

static yyconst flex_int16_t yy_def[89] =
static yyconst flex_int16_t yy_def[98] =
{ 0,
77, 1, 77, 77, 77, 77, 78, 79, 77, 77,
77, 77, 77, 77, 77, 80, 80, 80, 80, 80,
80, 80, 78, 77, 81, 77, 77, 77, 82, 80,
80, 80, 80, 80, 80, 80, 80, 83, 77, 82,
80, 80, 80, 80, 80, 80, 80, 84, 77, 77,
80, 80, 80, 80, 80, 80, 80, 85, 80, 80,
80, 80, 80, 80, 86, 80, 80, 80, 80, 87,
80, 80, 88, 80, 80, 77, 0, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77
86, 1, 86, 86, 86, 86, 87, 88, 86, 86,
86, 86, 86, 86, 86, 89, 89, 89, 89, 89,
89, 89, 87, 86, 90, 86, 86, 86, 91, 89,
89, 89, 89, 89, 89, 89, 89, 89, 92, 86,
91, 89, 89, 89, 89, 89, 89, 89, 89, 93,
86, 86, 89, 89, 89, 89, 89, 89, 89, 89,
94, 89, 89, 89, 89, 89, 89, 89, 95, 89,
89, 89, 89, 89, 96, 89, 89, 89, 97, 89,
89, 89, 86, 89, 89, 0, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86

} ;

static yyconst flex_int16_t yy_nxt[154] =
static yyconst flex_int16_t yy_nxt[163] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 16, 16, 4, 17, 18, 16, 16,
19, 16, 16, 16, 16, 20, 16, 16, 16, 21,
16, 16, 22, 16, 26, 26, 27, 27, 26, 32,
27, 26, 75, 27, 33, 28, 74, 39, 49, 49,
72, 71, 50, 39, 23, 23, 23, 23, 23, 25,
25, 30, 69, 30, 38, 38, 40, 68, 40, 40,
40, 48, 48, 58, 58, 65, 65, 70, 70, 73,
73, 76, 76, 67, 66, 64, 63, 62, 61, 60,
59, 50, 50, 57, 56, 55, 54, 53, 52, 51,

47, 46, 45, 44, 43, 42, 41, 28, 24, 37,
36, 35, 34, 31, 29, 28, 24, 77, 3, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77
27, 26, 33, 27, 28, 85, 40, 34, 84, 51,
51, 82, 40, 52, 23, 23, 23, 23, 23, 25,
25, 30, 81, 30, 39, 39, 41, 80, 41, 41,
41, 50, 50, 61, 61, 69, 69, 75, 75, 79,
79, 83, 83, 78, 77, 76, 74, 73, 72, 71,
70, 68, 67, 66, 65, 64, 63, 62, 52, 52,

60, 59, 58, 57, 56, 55, 54, 53, 49, 48,
47, 46, 45, 44, 43, 42, 28, 24, 38, 37,
36, 35, 31, 29, 28, 24, 86, 3, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86
} ;

static yyconst flex_int16_t yy_chk[154] =
static yyconst flex_int16_t yy_chk[163] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 11, 12, 11, 12, 15, 18,
15, 27, 72, 27, 18, 28, 71, 28, 39, 39,
69, 66, 39, 28, 78, 78, 78, 78, 78, 79,
79, 80, 64, 80, 81, 81, 82, 63, 82, 82,
82, 83, 83, 84, 84, 85, 85, 86, 86, 87,
87, 88, 88, 61, 59, 56, 55, 54, 53, 52,
51, 50, 49, 47, 46, 45, 44, 43, 42, 41,

37, 36, 35, 34, 33, 32, 31, 26, 23, 22,
21, 20, 19, 17, 14, 13, 7, 3, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77
15, 27, 18, 27, 28, 84, 28, 18, 81, 40,
40, 78, 28, 40, 87, 87, 87, 87, 87, 88,
88, 89, 77, 89, 90, 90, 91, 76, 91, 91,
91, 92, 92, 93, 93, 94, 94, 95, 95, 96,
96, 97, 97, 74, 71, 70, 68, 67, 65, 63,
62, 59, 58, 57, 56, 55, 54, 53, 52, 51,

49, 48, 47, 46, 45, 44, 43, 42, 38, 37,
36, 35, 34, 33, 32, 31, 26, 23, 22, 21,
20, 19, 17, 14, 13, 7, 3, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86
} ;

/* The intent behind this definition is that it'll catch
@@ -505,7 +512,7 @@ typedef lol::SceneSetupParser::token_type token_type;
#define yyterminate() return token::T_END
#define YY_NO_UNISTD_H
#define YY_USER_ACTION yylloc->columns(yyleng);
#line 509 "generated/scenesetup-scanner.cpp"
#line 516 "generated/scenesetup-scanner.cpp"

#define INITIAL 0

@@ -617,7 +624,7 @@ YY_DECL
yylloc->step();


#line 621 "generated/scenesetup-scanner.cpp"
#line 628 "generated/scenesetup-scanner.cpp"

if ( !(yy_init) )
{
@@ -670,13 +677,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 78 )
if ( yy_current_state >= 87 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_current_state != 77 );
while ( yy_current_state != 86 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);

@@ -718,14 +725,19 @@ YY_RULE_SETUP
YY_BREAK
case 5:
YY_RULE_SETUP
#line 55 "scenesetup-scanner.l"
#line 54 "scenesetup-scanner.l"
{ return token::T_CLEARCOLOR; }
YY_BREAK
case 6:
YY_RULE_SETUP
#line 56 "scenesetup-scanner.l"
{ return token::T_CUSTOMCMD; }
YY_BREAK
/* ======= BASE COLOR TYPES ========================================= */
/* COLOR */
case 6:
case 7:
YY_RULE_SETUP
#line 59 "scenesetup-scanner.l"
#line 60 "scenesetup-scanner.l"
{
uint32_t tmp = std::strtol(yytext + 1, nullptr, 16);
yylval->u32val = 0x11000000u * (tmp >> 8)
@@ -734,9 +746,9 @@ YY_RULE_SETUP
| 0x000000ffu;
return token::COLOR; }
YY_BREAK
case 7:
case 8:
YY_RULE_SETUP
#line 66 "scenesetup-scanner.l"
#line 67 "scenesetup-scanner.l"
{
uint32_t tmp = std::strtol(yytext + 1, nullptr, 16);
yylval->u32val = 0x11000000u * (tmp >> 12)
@@ -745,106 +757,106 @@ YY_RULE_SETUP
| 0x00000011u * (tmp & 0xf);
return token::COLOR; }
YY_BREAK
case 8:
case 9:
YY_RULE_SETUP
#line 73 "scenesetup-scanner.l"
#line 74 "scenesetup-scanner.l"
{
yylval->u32val = 0xffu
| 0x100u * (uint32_t)std::strtol(yytext + 1, nullptr, 16);
return token::COLOR; }
YY_BREAK
case 9:
case 10:
YY_RULE_SETUP
#line 77 "scenesetup-scanner.l"
#line 78 "scenesetup-scanner.l"
{
yylval->u32val = (uint32_t)std::strtol(yytext + 1, nullptr, 16);
return token::COLOR; }
YY_BREAK
/* ======= BASE DATA TYPES ========================================= */
/* BOOL */
case 10:
case 11:
YY_RULE_SETUP
#line 83 "scenesetup-scanner.l"
#line 84 "scenesetup-scanner.l"
{ yylval->bval = true; return token::BOOLEAN; }
YY_BREAK
case 11:
case 12:
YY_RULE_SETUP
#line 84 "scenesetup-scanner.l"
#line 85 "scenesetup-scanner.l"
{ yylval->bval = false; return token::BOOLEAN; }
YY_BREAK
/* FLOAT */
case 12:
case 13:
YY_RULE_SETUP
#line 86 "scenesetup-scanner.l"
#line 87 "scenesetup-scanner.l"
{
yylval->fval = (float)std::atof(yytext); return token::F_NUMBER; }
YY_BREAK
/* INT */
case 13:
case 14:
YY_RULE_SETUP
#line 89 "scenesetup-scanner.l"
#line 90 "scenesetup-scanner.l"
{
yylval->ival = std::atoi(yytext); return token::I_NUMBER; }
YY_BREAK
/* STRING */
case 14:
/* rule 14 can match eol */
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
#line 92 "scenesetup-scanner.l"
#line 93 "scenesetup-scanner.l"
{
yylval->sval = strdup(yytext); return token::STRING; }
YY_BREAK
/* STRING VAR */
case 15:
case 16:
YY_RULE_SETUP
#line 95 "scenesetup-scanner.l"
#line 96 "scenesetup-scanner.l"
{
yylval->svval = strdup(yytext); return token::STRING_VAR; }
YY_BREAK
/* ======= COMMENTS ======= */
case 16:
case 17:
YY_RULE_SETUP
#line 99 "scenesetup-scanner.l"
#line 100 "scenesetup-scanner.l"
{ /* ignore this */ }
YY_BREAK
/* Semantics tokens */
case 17:
YY_RULE_SETUP
#line 102 "scenesetup-scanner.l"
{ return token_type('-'); }
YY_BREAK
case 18:
YY_RULE_SETUP
#line 103 "scenesetup-scanner.l"
{ return token_type('('); }
{ return token_type('-'); }
YY_BREAK
case 19:
YY_RULE_SETUP
#line 104 "scenesetup-scanner.l"
{ return token_type(')'); }
{ return token_type('('); }
YY_BREAK
case 20:
YY_RULE_SETUP
#line 105 "scenesetup-scanner.l"
{ /* ignore this */ }
{ return token_type(')'); }
YY_BREAK
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
#line 106 "scenesetup-scanner.l"
{ /* ignore this */ }
YY_BREAK
case 22:
/* rule 22 can match eol */
YY_RULE_SETUP
#line 107 "scenesetup-scanner.l"
{ return token::T_ERROR; }
{ /* ignore this */ }
YY_BREAK
case 23:
YY_RULE_SETUP
#line 109 "scenesetup-scanner.l"
#line 108 "scenesetup-scanner.l"
{ return token::T_ERROR; }
YY_BREAK
case 24:
YY_RULE_SETUP
#line 110 "scenesetup-scanner.l"
ECHO;
YY_BREAK
#line 848 "generated/scenesetup-scanner.cpp"
#line 860 "generated/scenesetup-scanner.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();

@@ -1226,7 +1238,7 @@ int yyFlexLexer::yy_get_next_buffer()
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 78 )
if ( yy_current_state >= 87 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1254,11 +1266,11 @@ int yyFlexLexer::yy_get_next_buffer()
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 78 )
if ( yy_current_state >= 87 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 77);
yy_is_jam = (yy_current_state == 86);

return yy_is_jam ? 0 : yy_current_state;
}
@@ -1745,7 +1757,7 @@ void SceneSetupfree (void * ptr )

#define YYTABLES_NAME "yytables"

#line 109 "scenesetup-scanner.l"
#line 110 "scenesetup-scanner.l"





+ 2
- 2
test/meshviewer.cpp View File

@@ -504,7 +504,7 @@ public:
while (o-- > 0)
{
SceneSetup* new_ssetup = new SceneSetup();
if (new_ssetup->Compile(mesh.C()) && new_ssetup->GetLightNb())
if (new_ssetup->Compile(mesh.C()) && new_ssetup->m_lights.Count())
{
//Store current light datas, in World
Array<LightData> light_datas;
@@ -641,7 +641,7 @@ public:
m_texture_shader->SetUniform(m_texture_uni, m_default_texture->GetTexture(), 0);
#endif //NO_NACL_EM

g_renderer->SetClearColor(vec4(0.0f, 0.0f, 0.0f, 1.0f));
g_renderer->SetClearColor(m_ssetup->m_clear_color);

vec3 x = vec3(1.f,0.f,0.f);
vec3 y = vec3(0.f,1.f,0.f);


+ 4
- 1
test/scenesetup-parser.y View File

@@ -46,7 +46,7 @@

%token T_COLOR

%token T_ADDLIGHT T_OBJPOSITION T_OBJLOOKAT T_OBJCOLOR
%token T_ADDLIGHT T_OBJPOSITION T_OBJLOOKAT T_OBJCOLOR T_CLEARCOLOR
%token T_CUSTOMCMD

%token T_END 0
@@ -128,6 +128,9 @@ setup_command:
vec4 vv = vec4(v) * (1.f / 255.f);
if (uc.m_last_cmd == "ADDLIGHT")
uc.m_sstp.m_lights.Last()->SetColor(vv); }
| T_CLEARCOLOR v4 { uc.m_sstp.m_clear_color = vec4($2[0], $2[1], $2[2], $2[3]); }
| T_CLEARCOLOR COLOR { uint32_t x = $2; ivec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff);
uc.m_sstp.m_clear_color = vec4(v) * (1.f / 255.f); }
;

custom_command:


+ 1
- 0
test/scenesetup-scanner.l View File

@@ -51,6 +51,7 @@ addlight { return token::T_ADDLIGHT; }
position { return token::T_OBJPOSITION; }
lookat { return token::T_OBJLOOKAT; }
color { return token::T_OBJCOLOR; }
clearcolor { return token::T_CLEARCOLOR; }

custom { return token::T_CUSTOMCMD; }



+ 1
- 0
test/scenesetup.cpp View File

@@ -24,6 +24,7 @@ namespace lol
//CTor/DTor
SceneSetup::SceneSetup()
{
m_clear_color = vec4(vec3::zero, 1.f);
}

//----


+ 1
- 2
test/scenesetup.h View File

@@ -39,8 +39,7 @@ public:
bool Shutdown(bool destroy=false);

//--
int GetLightNb() { return m_lights.Count(); }

vec4 m_clear_color;
Array<Light *> m_lights;
Array<String, String> m_custom_cmd;
};


+ 4
- 3
test/scenesetupdictionnary.js View File

@@ -12,7 +12,8 @@ CmdVar("vec3", ["X/Y/Z as float", "&nbsp;f f f", "(f f f)", "(f)"]);
//-------------------------------------------------------------------------
//scene operations
//-------------------------------------------------------------------------
CmdType(["addlight"], "Add a light to the scene.\nUse other commands after this one to fully setup.", [CmdArg("float", "type")]);
CmdType(["position"], "Set a position.\nWhen put after a light, sets its position.", [CmdArg("vec3", "pos")]);
CmdType(["color"], "Set a color.", [CmdArg("color", "color")]);
CmdType(["addlight"], "Add a light to the scene.\nUse other commands after this one to fully setup.", [CmdArg("float", "type")]);
CmdType(["position"], "Set a position.\nWhen put after a light, sets its position.", [CmdArg("vec3", "pos")]);
CmdType(["color"], "Set a color.", [CmdArg("color", "color")]);
CmdType(["clearcolor"], "Sets the color used for screen clearing.", [CmdArg("color", "color")]);


Loading…
Cancel
Save