1 line
97 KiB
Lua
1 line
97 KiB
Lua
|
//{"expression2/":{"expression2/_helloworld_.txt":"@name Hello World\n@inputs A B\n@outputs Add Sub Mul Div\n@outputs GreaterThan Highest Lowest\n@outputs Vector:vector\n@persist D\n@trigger all\n\nAdd = A + B\nSub = A - B\nMul = A * B\nDiv = A / B\n\nGreaterThan = A > B\n\nif(A > B) {\n Highest = A, Lowest = B\n} else {\n Highest = B, Lowest = A\n}\n\nVector = vec(A, B, 0)\nVector = Vector + vec(0, 0, A + B)\nVector = Vector:normalized()\n","expression2/tests/":{"expression2/tests/regressions/":{"expression2/tests/regressions/1975.txt":"vec() * 0\n0 * vec()\n\nlocal Calls = 0\nfunction number f() {\n Calls++\n return 1\n}\nf() * 0\n0 * f()\nassert(Calls == 2)\n"},"expression2/tests/parsing.txt":"@inputs In\n@outputs Out\n\nlocal A = 0\n\nif (A) { A = 0 }\nif (A) { A = 0 } else { A = 0 }\nif (A) { A = 0 } elseif (A) { A = 0 }\nif (A) { A = 0 } elseif (A) { A = 0 }\n\nwhile (A) { A = 0 }\n\nfor (B = 1, 2) { A = 0 }\nfor (B = 1, 2, 3) { A = 0 }\n\nforeach (K, V: number = array(1, 2, 3)) { A = 0 }\n\nwhile (A) { break }\nwhile (A) { continue }\n\nA++\nA--\nA += 1\nA -= 1\nA *= 1\nA /= 1\n\nlocal B = vec()\nB[1] = 2\n\nswitch (A) {\n case A + A,\n A = 0\n A = 0\n case A + A + A,\n A = 0\n break\n default,\n A = 0\n}\n\nfunction f() {}\nfunction void f() {}\nfunction void f() { return }\nfunction number g() { return 0 }\nfunction number f(X) { return X }\nfunction vector f(X: vector) { return X }\nfunction number f(X, Y) { return X + Y }\nfunction number f(X, Y: vector) { return X }\nfunction number f([X Y]) { return X + Y }\nfunction number f([X Y]: number) { return X + Y }\n\nA ? A : A\nA ?: A\nA | A\nA & A\nA || A\nA && A\nA ^^ A\nA == A\nA != A\nA > A\nA < A\nA >= A\nA <= A\nA << A\nA >> A\nA + A\nA - A\nA * A\nA / A\nA % A\nA ^ A\n+A\n-A\n!A\n\narray():count()\narray()[0, number]\n(A)\n0\n\"foo\"\n~In\n$In\n->In\nA\n\ntable(1 = 1, 2 = 2)\n"}},"gpuchip/":{"gpuchip/examples/":{"gpuchip/examples/sprite.txt":"// Author: Drunkie\n// Description: A very simple sprite example\n\nMain();\n\n#include <drivers\\drv_gl.txt>\n\nvoid Main()\n{\n // Enable vertex mode\n glVertexMode( 1 );\n\n // Draw to sprite buffer\n glSetRenderTarget( GL_BUFFER_BACK );\n glClear( 0, 255, 0 );\n\n // Draw to vertex buffer (world)\n glSetRenderTarget( GL_BUFFER_VERTEX );\n glEnable( GL_VERTEX_TEXTURING );\n\n // Sample from sprite 0\n glTextureSize( 256 );\n glTexture( 0 );\n glClear( 0, 255, 0 );\n glRectWH( 128, 128, 256, 256 );\n\n glSetRenderTarget( GL_BUFFER_FRONT );\n\n glExit();\n}\n","gpuchip/examples/3d_icosahedron.txt":"// Author: Drunkie\n// Description: Draws a 3D icosahedron model (solid and wireframe)\n\nMain();\n\n#include <drivers\\drv_gl.txt>\n\nvoid Main()\n{\n glSleep( 40 ); // Sleep for 40 milliseconds (Reduces fps lag)\n glClear( 0, 0, 0 ); // Clear screen\n\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode\n glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation\n\n glLightPos( 0, 0, -50 ); // Set the light position\n glLightColor( 255, 255, 255, 1 ); // Set the light color\n\n glLookAt(\n 0, 0, -2.25, // Camera pos\n 0, 0, 0, // Camera target\n 0, 1, 0 // Camera up\n );\n\n // Create variable to hold curtime\n float time;\n timer time;\n\n // Create perspective and matrix transformations\n glPerspective( 30, 1, 1, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR\n glRotate( 1, 1, 0, time ); // AXIS X, Y, Z, ANGLE W\n glTranslate( 0, 0, 0 ); // TRANSLATION X, Y, Z\n glScale( 1, 1, 1, 0 ); // SCALE X, Y, Z\n\n glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer\n glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting\n glEnable( GL_VERTEX_LIGHTING ); // Enable vertex lighting\n //glEnable( GL_VERTEX_CULLING ); // Enable face culling\n\n // Solid 3D polygon\n glFillMode( GL_FILL_SOLID ); // Set fillmode as solid\n glColor4( 100, 149, 237, 180 ); // Set the draw color with alpha\n glPoly3D( vertexBuffer, 2
|