diff --git a/.gitattributes b/.gitattributes index 83f166ce..9a8d916d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,4 +14,4 @@ *.vvd binary *.wav binary -* text=auto \ No newline at end of file +* text=auto diff --git a/.travis.yml b/.travis.yml index b34e893e..165cac64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ install: - luarocks list --outdated --porcelain | awk '{ print $1, $3 }' | xargs --no-run-if-empty -n 2 luarocks install script: - - git -c core.whitespace=-blank-at-eol,-blank-at-eof,-space-before-tab diff --check $TRAVIS_COMMIT_RANGE + - git diff --check $TRAVIS_COMMIT_RANGE - git diff --name-only $TRAVIS_COMMIT_RANGE | grep '\.lua$' | grep -v '^lua/entities/gmod_wire_expression2/core/' | xargs --no-run-if-empty luacheck - luacheck .luacheckrc diff --git a/data/adv_duplicator/wireman.txt b/data/adv_duplicator/wireman.txt index 22d4797e..c0058427 100644 --- a/data/adv_duplicator/wireman.txt +++ b/data/adv_duplicator/wireman.txt @@ -62,4 +62,4 @@ Constraints:1A790460{Y:31=N:242;Y:32=N:0;}1926A480{Y:33=T:18FACDC8;Y:35=Y:34;}1B 39:"Weld" 40:"Keepupright" 41:"angularlimit" -Saved:291 \ No newline at end of file +Saved:291 diff --git a/data/cpuchip/examples/helloworld.txt b/data/cpuchip/examples/helloworld.txt index 520662b1..64b994a4 100644 --- a/data/cpuchip/examples/helloworld.txt +++ b/data/cpuchip/examples/helloworld.txt @@ -1,7 +1,7 @@ //Wired Hello World! //Connect CPU membus input to console screen //Connect CPUs CLK input to button (toggle) -//Notice how you can store your +//Notice how you can store your //subroutines/calls in DATA area jmp _code; message: @@ -26,7 +26,7 @@ _code: call WriteString; //More about colors: -//Lower 3 digits are foreground, +//Lower 3 digits are foreground, //and higher 3 digits are background //Each of 3 digits shows amount of //RED, GREEN, and BLUE (in order) diff --git a/data/cpuchip/examples/udh_test.txt b/data/cpuchip/examples/udh_test.txt index 156c63cb..085a116b 100644 --- a/data/cpuchip/examples/udh_test.txt +++ b/data/cpuchip/examples/udh_test.txt @@ -10,7 +10,7 @@ void main() { float i; udhSetBusAddress(65536); - + cscrInitialize(0); udhQueryDevices(); @@ -19,10 +19,10 @@ void main() { cscrSelect(i); cscrSetActive(1); cscrClear(); - + cscrSetCursor(0,0); cscrPrintLine("Screen ",930); - cscrPrintNumber(i,930); + cscrPrintNumber(i,930); } cscrSelect(0); diff --git a/data/cpuchip/lib/drivers/drv_cscr.txt b/data/cpuchip/lib/drivers/drv_cscr.txt index 7498b653..799d9a54 100644 --- a/data/cpuchip/lib/drivers/drv_cscr.txt +++ b/data/cpuchip/lib/drivers/drv_cscr.txt @@ -37,7 +37,7 @@ float cscrSelectedScreen; //Update console screen offsets void cscrUDHQueryFunction() { float i,n; - n = udhGetDevices(11,MAX_CONSOLE_SCREENS,cscrDevices); + n = udhGetDevices(11,MAX_CONSOLE_SCREENS,cscrDevices); for (i = 0; i < n; i++) { cscrOffsets[i] = udhGetDeviceOffset(cscrDevices[i]); } @@ -83,12 +83,12 @@ void cscrClear() { } void cscrSetBackground(float col) { - if (!cscrOffsets[cscrSelectedScreen]) return; + if (!cscrOffsets[cscrSelectedScreen]) return; *(cscrOffsets[cscrSelectedScreen]+BACKGROUND_COLOR) = col; } void cscrSetRotation(float rot) { - *(cscrOffsets[cscrSelectedScreen]+SCREEN_ROTATION) = rot; + *(cscrOffsets[cscrSelectedScreen]+SCREEN_ROTATION) = rot; } void cscrSetBrightness(float bright) { @@ -96,7 +96,7 @@ void cscrSetBrightness(float bright) { } void cscrLoadImage(char* imgdata) { - if (!cscrOffsets[cscrSelectedScreen]) return; + if (!cscrOffsets[cscrSelectedScreen]) return; preserve ESI,EDI; ESI = imgdata; @@ -105,7 +105,7 @@ void cscrLoadImage(char* imgdata) { } void cscrPutLine(char* scrptr, float col, char* str) { - if (!cscrOffsets[cscrSelectedScreen]) return; + if (!cscrOffsets[cscrSelectedScreen]) return; char* curptr = scrptr; while (*str) { @@ -118,7 +118,7 @@ void cscrPutLine(char* scrptr, float col, char* str) { } void cscrPutChar(char* scrptr, float col, char ch) { - if (!cscrOffsets[cscrSelectedScreen]) return; + if (!cscrOffsets[cscrSelectedScreen]) return; *(cscrOffsets[cscrSelectedScreen]+scrptr*2+0) = ch; *(cscrOffsets[cscrSelectedScreen]+scrptr*2+1) = col; @@ -146,26 +146,26 @@ void cscrPrintLine(char* str, float col) { str++; if (*str == 0) return; } - + *(cscrOffsets[cscrSelectedScreen]+cscrCharacterPointer[cscrSelectedScreen]*2+0) = *str; *(cscrOffsets[cscrSelectedScreen]+cscrCharacterPointer[cscrSelectedScreen]*2+1) = col; - - cscrCharacterPointer[cscrSelectedScreen]++; - if (cscrCharacterPointer[cscrSelectedScreen] >= 30*18) cscrNewLine(); + + cscrCharacterPointer[cscrSelectedScreen]++; + if (cscrCharacterPointer[cscrSelectedScreen] >= 30*18) cscrNewLine(); str++; } } void cscrPrintNumber(float num, float col) { if (!cscrOffsets[cscrSelectedScreen]) return; - + float ndig,a; a = num; ndig = 0; while (a > 0) { ndig++; a /= 10; - fint a; + fint a; } max ndig,1; a = num; @@ -177,19 +177,19 @@ void cscrPrintNumber(float num, float col) { mov EDX,a; mod EDX,10; add EDX,48; - + *(cscrOffsets[cscrSelectedScreen]+charPtr*2+0) = EDX; *(cscrOffsets[cscrSelectedScreen]+charPtr*2+1) = col; charPtr--; - + a /= 10; fint a; - + ndig--; } } void cscrSetCursor(float x, y) { - if (!cscrOffsets[cscrSelectedScreen]) return; + if (!cscrOffsets[cscrSelectedScreen]) return; cscrCharacterPointer[cscrSelectedScreen] = x+y*30; -} \ No newline at end of file +} diff --git a/data/cpuchip/lib/drivers/drv_udh.txt b/data/cpuchip/lib/drivers/drv_udh.txt index 06622b13..fd618523 100644 --- a/data/cpuchip/lib/drivers/drv_udh.txt +++ b/data/cpuchip/lib/drivers/drv_udh.txt @@ -37,7 +37,7 @@ string udhDeviceString17,"Sound emitter"; string udhDeviceString18,"Constant value"; string udhDeviceString19,"Data port"; string udhDeviceString20,"RAM"; -udhDeviceName: +udhDeviceName: db udhDeviceString0, udhDeviceString1, udhDeviceString2; db udhDeviceString3, udhDeviceString4, udhDeviceString5; db udhDeviceString6, udhDeviceString7, udhDeviceString8; @@ -63,7 +63,7 @@ void udhQueryDevices() { //Run the query udhBusOffset[16] = 32+MAX_UDH_DEVICES; - udhBusOffset[17] = 1; + udhBusOffset[17] = 1; //Reconfigure all devices //FIXME: only supports single extended bus right now @@ -95,7 +95,7 @@ float udhGetDeviceOffset(float busIndex) { char* udhGetDeviceName(float busIndex) { float deviceType = udhGetDeviceType(busIndex); if ((deviceType >= 0) && (deviceType <= 20)) { - return udhDeviceName[deviceType]; + return udhDeviceName[deviceType]; } else { return udhDeviceName[1]; } @@ -107,20 +107,20 @@ void udhSetDeviceOffsetSize(float busIndex, char* offst, char* size) { } float udhGetNumDevices() { - return MAX_UDH_DEVICES; + return MAX_UDH_DEVICES; } float udhGetDevices(float type, float maxCount, char* deviceList) { float i,devPtr,n; - + devPtr = deviceList; n = 0; for (i = 0; i < MAX_UDH_DEVICES; i++) { if ((udhGetDeviceType(i) == type) && (n < maxCount)) { n++; - *devPtr++ = i; + *devPtr++ = i; } } return n; -} \ No newline at end of file +} diff --git a/data/cpuchip/lib/zcrt/ctype.txt b/data/cpuchip/lib/zcrt/ctype.txt index aa65e3ec..4d3a21e3 100644 --- a/data/cpuchip/lib/zcrt/ctype.txt +++ b/data/cpuchip/lib/zcrt/ctype.txt @@ -21,7 +21,7 @@ float isalnum(char c) { preserve eax; eax = c; max eax,0; min eax,_MAXCHARS; eax = __ctype_characters[eax]; - + band eax,_LOWER+_UPPER+_DIGIT; } @@ -265,8 +265,8 @@ __ctype_characters: db _PUNCT; //7D } db _PUNCT; //7E ~ db _CONTROL; //7F (DEL) - + db _GRAPH; //80 db _GRAPH; //81 db _GRAPH; //82 - db _GRAPH; //83 \ No newline at end of file + db _GRAPH; //83 diff --git a/data/cpuchip/lib/zcrt/init.txt b/data/cpuchip/lib/zcrt/init.txt index 6b49e01d..c00ade74 100644 --- a/data/cpuchip/lib/zcrt/init.txt +++ b/data/cpuchip/lib/zcrt/init.txt @@ -34,7 +34,7 @@ int 1; #ifdef ZCRT_EXTENDED_MODE float zcrtInterruptTable[1024]; char* zcrtInterruptEntrypoint; - + // Default interrupt handlers zcrtErrorHandler: //Execute handler if required diff --git a/data/cpuchip/lib/zcrt/string.txt b/data/cpuchip/lib/zcrt/string.txt index 291aea0b..da6b31e4 100644 --- a/data/cpuchip/lib/zcrt/string.txt +++ b/data/cpuchip/lib/zcrt/string.txt @@ -10,7 +10,7 @@ void *memcpy(void *dest, void *src, float n) { preserve esi,edi; register float rem; - + esi = src; edi = dest; rem = n; @@ -64,7 +64,7 @@ void* memset(void *ptr, float c, float n) { //appends the string src to dest char* strcat(char *src, *dest) { register char *srcptr, *destptr; - + srcptr = src; while (*++srcptr) ; @@ -77,7 +77,7 @@ char* strcat(char *src, *dest) { char* strncat(char *src, *dest, float n) { register char *srcptr, *destptr; register float i; - + srcptr = src; srcptr--; while (*++srcptr) ; @@ -107,7 +107,7 @@ char* strchr(char *str, c) { char* strrchr(char *str, c) { register char *strptr, ch; register char *findptr; - + findptr = 0; strptr = str; ch = c; @@ -135,7 +135,7 @@ float strcmp(char *src, *dest) { float strncmp(char *src, *dest, float n) { register char *srcptr, *destptr; register float i; - + srcptr = src; destptr = dest; i = n; @@ -167,7 +167,7 @@ char* strncpy(char *dest, *src, float n) { destptr = dest; srcptr = src; i = n; - + while (i-- > 0) { if (*destptr++ = *srcptr++) continue; while (i-- > 0) *destptr++ = 0; @@ -183,7 +183,7 @@ char* strncpy(char *dest, *src, float n) { float strlen(char* str) { register char* strptr; register float n; - + strptr = str; n = 0; while (*strptr++) n++; @@ -207,7 +207,7 @@ float strspn(char *str, *accept) { //determines the length of the maximal initial substring consisting entirely of characters not in reject float strcspn(char *str, char *reject) { register char *s, *p; - + for (s=str; *s; s++) { for (p=reject; *p; p++) { if (*p == *s) goto done; diff --git a/data/expression2/_helloworld_.txt b/data/expression2/_helloworld_.txt index 704d7d24..e32235d5 100644 --- a/data/expression2/_helloworld_.txt +++ b/data/expression2/_helloworld_.txt @@ -21,4 +21,4 @@ if(A > B) { Vector = vec(A, B, 0) Vector = Vector + vec(0, 0, A + B) -Vector = Vector:normalized() \ No newline at end of file +Vector = Vector:normalized() diff --git a/data/gpuchip/examples/3d_cube.txt b/data/gpuchip/examples/3d_cube.txt index f2abce21..bd2324f8 100644 --- a/data/gpuchip/examples/3d_cube.txt +++ b/data/gpuchip/examples/3d_cube.txt @@ -8,10 +8,10 @@ Main(); void Main() { glClear( 0, 0, 0 ); // Clear screen - - glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode + + glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation - + glLightPos( 0, 0, -20 ); // Set the light position glLightColor( 255, 255, 255, 1 ); // Set the light color @@ -19,7 +19,7 @@ void Main() 0, 0, -5, // Camera pos 0, 0, 0, // Camera target 0, 1, 0 // Camera up - ); + ); // Create variable to hold curtime float time; @@ -31,22 +31,22 @@ void Main() glTranslate( 0, 0, 0 ); // TRANSLATION X, Y, Z glScale( 1, 1, 1 ); // SCALE X, Y, Z - glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer + glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting // Solid 3D polygon glFillMode( GL_FILL_SOLID ); // Set fillmode as solid glColor4( 100, 149, 237, 180 ); // Set draw color with alpha - glPoly3D( vertexBuffer, 12 ); // Draw 3D polygon + glPoly3D( vertexBuffer, 12 ); // Draw 3D polygon glFlush(); // Flush the vertex buffer to the screen - + // Wireframe 3D polygon glLineWidth( 1 ); // Set line width glFillMode( GL_FILL_WIREFRAME ); // Set fillmode as solid glColor4( 255, 255, 255, 255 ); // Set draw color with alpha - glPoly3D( vertexBuffer, 12 ); // Draw 3D polygon + glPoly3D( vertexBuffer, 12 ); // Draw 3D polygon glFlush(); // Flush the vertex buffer to the screen - + glExit(); // Exit } diff --git a/data/gpuchip/examples/3d_icosahedron.txt b/data/gpuchip/examples/3d_icosahedron.txt index d42af8c2..0c5041d6 100644 --- a/data/gpuchip/examples/3d_icosahedron.txt +++ b/data/gpuchip/examples/3d_icosahedron.txt @@ -9,49 +9,49 @@ void Main() { glSleep( 40 ); // Sleep for 40 milliseconds (Reduces fps lag) glClear( 0, 0, 0 ); // Clear screen - - glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode + + glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation glLightPos( 0, 0, -50 ); // Set the light position glLightColor( 255, 255, 255, 1 ); // Set the light color - + glLookAt( 0, 0, -2.25, // Camera pos 0, 0, 0, // Camera target 0, 1, 0 // Camera up - ); - + ); + // Create variable to hold curtime float time; timer time; - + // Create perspective and matrix transformations glPerspective( 30, 1, 1, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR glRotate( 1, 1, 0, time ); // AXIS X, Y, Z, ANGLE W glTranslate( 0, 0, 0 ); // TRANSLATION X, Y, Z glScale( 1, 1, 1, 0 ); // SCALE X, Y, Z - - glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer + + glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting glEnable( GL_VERTEX_LIGHTING ); // Enable vertex lighting //glEnable( GL_VERTEX_CULLING ); // Enable face culling - + // Solid 3D polygon glFillMode( GL_FILL_SOLID ); // Set fillmode as solid glColor4( 100, 149, 237, 180 ); // Set the draw color with alpha glPoly3D( vertexBuffer, 20 ); // Draw 3D polygon glFlush(); // Flush the vertex buffer to the screen - + glDisable( GL_VERTEX_LIGHTING ); // Enable vertex lighting - + // Wireframe 3D polygon glLineWidth( 1 ); // Set line width of wireframe glFillMode( GL_FILL_WIREFRAME ); // Set fillmode as wireframe glColor4( 255, 255, 255, 255 ); // Set the draw color with alpha glPoly3D( vertexBuffer, 20 ); // Draw 3D polygon glFlush(); // Flush the vertex buffer to the screen - + glExit(); // Exit } diff --git a/data/gpuchip/examples/3d_letter_a.txt b/data/gpuchip/examples/3d_letter_a.txt index 72df34d2..01d61060 100644 --- a/data/gpuchip/examples/3d_letter_a.txt +++ b/data/gpuchip/examples/3d_letter_a.txt @@ -9,8 +9,8 @@ void Main() { glSleep( 40 ); // Sleep for 40 milliseconds (reduces fps lag) glClear( 100, 149, 237 ); // Clear screen - - glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode + + glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation glLightPos( 0, 0, -50 ); // Set the light position @@ -20,29 +20,29 @@ void Main() 0, 0, -2.8, // Camera pos 0, 0, 0, // Camera target 0, 1, 0 // Camera up - ); - + ); + // Create variable to hold curtime float time; timer time; - + // Create perspective and matrix transformations glPerspective( 30, 1, 1, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR glRotate( 0, 1, 0, time ); // AXIS X, Y, Z, ANGLE W glTranslate( 0, -0.1, 0, 0 ); // TRANSLATION X, Y, Z glScale( 1, 1, 1, 0 ); // SCALE X, Y, Z - glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer + glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting glEnable( GL_VERTEX_LIGHTING ); // Enable vertex lighting glEnable( GL_VERTEX_CULLING ); // Enable face culling - + // Solid 3D polygon glFillMode( GL_FILL_SOLID ); // Set fillmode as solid glColor4( 255, 255, 255, 255 ); // Set draw color with alpha - glPoly3D( vertexBuffer, 30 ); // Draw 3D polygon + glPoly3D( vertexBuffer, 30 ); // Draw 3D polygon glFlush(); // Flush the vertex buffer to the screen - + glExit(); // Exit } @@ -71,7 +71,7 @@ db 0.38,0.01,0; db 0.47,0.25,0; db -0.47,0.25,0; db -0.47,0.25,0.25; db 0.38,0.01,0.25; db -0.38,0.01,0.25; db 0.38,0.01,0.25; db -0.47,0.25,0.25; db 0.47,0.25,0.25; db -0.38,0.01,0; db -0.38,0.01,0.25; db 0.38,0.01,0; -db 0.38,0.01,0; db -0.38,0.01,0.25; db 0.38,0.01,0.25; +db 0.38,0.01,0; db -0.38,0.01,0.25; db 0.38,0.01,0.25; db -0.47,0.25,0; db 0.47,0.25,0; db -0.47,0.25,0.25; db -0.47,0.25,0.25; db 0.47,0.25,0; db 0.47,0.25,0.25; db -1,1,0; db -0.75,1,0; db -1,1,0.25; diff --git a/data/gpuchip/examples/3d_tunnel.txt b/data/gpuchip/examples/3d_tunnel.txt index c5a183d5..39494793 100644 --- a/data/gpuchip/examples/3d_tunnel.txt +++ b/data/gpuchip/examples/3d_tunnel.txt @@ -9,8 +9,8 @@ void Main() { glSleep( 60 ); // Sleep for 60 milliseconds (reduces fps lag) glClear( 0, 0, 0 ); // Clear screen - - glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode + + glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation glLightPos( -1, -1, -1 ); // Set the light position @@ -20,7 +20,7 @@ void Main() 0, 0, -25, // Camera pos 0, 0, 0, // Camera target 0, 1, 0 // Camera up - ); + ); // Loop and draw 4 models for (i = 0; i < 4; i++) @@ -30,14 +30,14 @@ void Main() zTranslate *= -16; mod zTranslate,16; zTranslate += (i * 16); - + // Create perspective and matrix transformations glPerspective( 8, 1, 0.4, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR glRotate( 0, 0, 0, 0 ); // AXIS X, Y, Z, ANGLE W glTranslate( 0, 0, zTranslate ); // TRANSLATION X, Y, Z glScale( 1.2, 1, 8 ); // SCALE X, Y, Z - - glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer + + glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting glEnable( GL_VERTEX_LIGHTING ); // Enable vertex lighting glEnable( GL_VERTEX_CULLING ); // Enable face culling @@ -47,7 +47,7 @@ void Main() glColor4( 255, 255, 255, 150 ); // Set the draw color with alpha glPoly3D( VertexBuffer, 12 ); // Draw 3D polygon glFlush(); // Send our vertex buffer to screen - + // Wireframe 3D polygon glLineWidth( 1 ); // Set line width of wireframe glFillMode( GL_FILL_WIREFRAME ); // Set fillmode to wireframe @@ -68,6 +68,6 @@ db -1,1,-1; db -1,1,1; db 1,1,1; db 1,1,-1; db 1,1,1; db 1,-1,-1; db 1,-1,-1; db 1,1,1; db 1,-1,1; db -1,1,-1; db -1,-1,-1; db -1,1,1; -db -1,-1,-1; db -1,-1,1; db -1,1,1; +db -1,-1,-1; db -1,-1,1; db -1,1,1; db 1,-1,-1; db 1,-1,1; db -1,-1,-1; db -1,-1,-1; db 1,-1,1; db -1,-1,1; diff --git a/data/gpuchip/examples/bounce.txt b/data/gpuchip/examples/bounce.txt index 7ebe295d..fe04d50a 100644 --- a/data/gpuchip/examples/bounce.txt +++ b/data/gpuchip/examples/bounce.txt @@ -62,4 +62,4 @@ vector2f textpos,0.1,0.1; // Text position vector2f d,1.0,1.0; // Movement direction & speed // string text,'Bouncing ball!'; // "Bouncing ball!" -////////////////////////////////// \ No newline at end of file +////////////////////////////////// diff --git a/data/gpuchip/examples/cube.txt b/data/gpuchip/examples/cube.txt index a6f45f9f..959c09c0 100644 --- a/data/gpuchip/examples/cube.txt +++ b/data/gpuchip/examples/cube.txt @@ -135,4 +135,4 @@ vector3f vLookAt_Center, 0, 0, 0; //What we look at vector3f vLookAt_Up, 0, 1, 0; //Where our matt-hat is color fg_color,255,255,25; -color bg_color,64,32,12; \ No newline at end of file +color bg_color,64,32,12; diff --git a/data/gpuchip/examples/foxlogo.txt b/data/gpuchip/examples/foxlogo.txt index d1ff2d06..6bc42f3a 100644 --- a/data/gpuchip/examples/foxlogo.txt +++ b/data/gpuchip/examples/foxlogo.txt @@ -81,4 +81,4 @@ db 340,238 db 286,257 db 274,203 db 311,213 -//=========================================== \ No newline at end of file +//=========================================== diff --git a/data/gpuchip/examples/hud_fighter.txt b/data/gpuchip/examples/hud_fighter.txt index d6c8ff7c..fd8ed717 100644 --- a/data/gpuchip/examples/hud_fighter.txt +++ b/data/gpuchip/examples/hud_fighter.txt @@ -88,7 +88,7 @@ dexit; vec2f hud_pos1,50,20; string hud_text1,'ROLL %i %tPITCH %i%tHDG %i'; -alloc roll; +alloc roll; alloc pitch; alloc hdg; diff --git a/data/gpuchip/examples/line_graph.txt b/data/gpuchip/examples/line_graph.txt index 3ba02e38..fbc366cd 100644 --- a/data/gpuchip/examples/line_graph.txt +++ b/data/gpuchip/examples/line_graph.txt @@ -17,27 +17,27 @@ void Main() { glVertexMode( 1 ); // Enable vertex mode glColor( 255, 255, 255 ); // Set draw color - + // Set texture as background glBindTexture( "phoenix_storms/lag_sign" ); glClearTexture(); glBindTexture( 0 ); // Discard texture - + glFont( GL_FONT_AKBAR ); // Set font type glFontSize( 36 ); // Set font size glWriteString( 2, 2, "LAG-O-METER" ); // Write string to screen - + glOffset( lineWidth, 90 ); // Offset the screen coordinates - + glColor4( 0, 0, 0, 160 ); // Set draw color with alpha glRectWH( 0, 0, frameWidth, frameHeight ); // Draw rectangle - - glColor( 255, 255, 255 ); + + glColor( 255, 255, 255 ); glLineWidth( lineWidth ); // Set line width glORectWH( 0, 0, frameWidth, frameHeight ); // Draw outlined rectangle - + glLineWidth( 1 ); // Set line width to 1 - + // Loop and make a bunch of connected lines for (i = 0; i < lines; i++) { @@ -54,9 +54,9 @@ void Main() y *= frameHeight; glLine( ox, oy, x, y ); // Draw line on graph } - + glOffset( 0, 0 ); // Set screen offset back to 0,0 glWriteString( 2, 400, "INTENSE LAG DETECTED" ); - + glExit(); // Exit } diff --git a/data/gpuchip/examples/mt2.txt b/data/gpuchip/examples/mt2.txt index edb4bd96..8aac635d 100644 --- a/data/gpuchip/examples/mt2.txt +++ b/data/gpuchip/examples/mt2.txt @@ -18,7 +18,7 @@ DrawLoop: fsin #HSL.R,EAX; mul #HSL.R,127; add #HSL.R,128; add EAX,1.57;// mul EAX,2; fsin #HSL.G,EAX; mul #HSL.G,127; add #HSL.G,128; add EAX,1.57;// mul EAX,2; fsin #HSL.B,EAX; mul #HSL.B,127; add #HSL.B,128; - + dcolor HSL; //Looks very nice @@ -26,7 +26,7 @@ DrawLoop: dline StartPoint2,EndPoint; dline StartPoint3,EndPoint; dline StartPoint4,EndPoint; - + mul EDX,EBP; add #Angle,EDX; loop DrawLoop; diff --git a/data/gpuchip/examples/mt3.txt b/data/gpuchip/examples/mt3.txt index bb757fe6..b0201313 100644 --- a/data/gpuchip/examples/mt3.txt +++ b/data/gpuchip/examples/mt3.txt @@ -38,7 +38,7 @@ // drotatescale EAX,EBX; mul EBX,2; dsetwidth 0.8; - call Draw.Background; + call Draw.Background; dexit; alloc Time; @@ -48,7 +48,7 @@ Draw.Background: //Draw all the rectangles mov EAX,#Background.MinDepth; mov ECX,#Background.ShadeStart; BackgroundLoop: - mov EDX,#Time; add EDX,EAX; + mov EDX,#Time; add EDX,EAX; mov EBP,#Time; div EBP,6.28; fcos EBP,EBP; fsin EDI,EDX; mul EDI,EBP; mul EDI,0.8; sub EDI,1; @@ -59,8 +59,8 @@ Draw.Background: mov EDX,ECX; fpwr EDX,2; mov #regZOffset,EAX; - - dcolor _rect.color; + + dcolor _rect.color; // Uncomment this for trippy HSL color // mov ESI,#Time; add ESI,EAX; // fsin #HSL.R,ESI; mul #HSL.R,127; add #HSL.R,128; add ESI,1.57;// mul EAX,2; diff --git a/data/gpuchip/examples/plasma.txt b/data/gpuchip/examples/plasma.txt index 95f95381..c80f6a4f 100644 --- a/data/gpuchip/examples/plasma.txt +++ b/data/gpuchip/examples/plasma.txt @@ -28,7 +28,7 @@ while(1){idle} //Infinatly loop void main(){ //Main function dsetbuf_spr; //Use sprite buffer - + setColor(255,255,255); //Set the colour to white rect(0,0,512,512); //Draw a large rectangle @@ -36,58 +36,58 @@ void main(){ //Main function width = 512; //GPU Width height = 512; //GPU Height noise = 5; //How noisy it will be - + //Give initial corner values R1 = random(1); R2 = random(1); R3 = random(1); R4 = random(1); - + plasma(0,0,width,height,R1,R2,R3,R4) //Start recursive function } void plasma(float x, y, width, height, c1, c2, c3, c4){ //Plasma function - + //Setup local variables float edge1, edge2, edge3, edge4, midPoint; - + //Work out the size of the next segments float newWidth = width / 2; float newHeight = height / 2; - + if((width > gridSize)||(height > gridSize)){ //If it is still bigger than the rectangle size - + midPoint = (c1 + c2 + c3 + c4) / 4 + displace(newWidth + newHeight); //Randomly change the midpoint - + //Calculate edges by averaging the corners - edge1 = (c1 + c2) / 2; - edge2 = (c2 + c3) / 2; - edge3 = (c3 + c4) / 2; - edge4 = (c4 + c1) / 2; - + edge1 = (c1 + c2) / 2; + edge2 = (c2 + c3) / 2; + edge3 = (c3 + c4) / 2; + edge4 = (c4 + c1) / 2; + //Make sure it doesn't displace too far max midPoint,0; min midPoint,1; - + //Run on the newly calculated segments plasma(x, y, newWidth, newHeight, c1, edge1, midPoint, edge4); - plasma(x + newWidth, y, newWidth, newHeight, edge1, c2, edge2, midPoint); - plasma(x + newWidth, y + newHeight, newWidth, newHeight, midPoint, edge2, c3, edge3); + plasma(x + newWidth, y, newWidth, newHeight, edge1, c2, edge2, midPoint); + plasma(x + newWidth, y + newHeight, newWidth, newHeight, midPoint, edge2, c3, edge3); plasma(x, y + newHeight, newWidth, newHeight, edge4, midPoint, edge3, c4); }else{ //Woo! It's the right size float c = (c1 + c2 + c3 + c4) / 4; //Average the corners - + float grey = c*255; //Multiply the corners by 255 to get a valid color - + setColor(grey,grey,grey); //Set the color to your new color based on the "height" rect(x,y,gridSize,gridSize); //Draw your rectangle } } float displace(float num){ //Displace function, it just works - float m = num / (width + height) * (1/noise); - R1 = random(1); - return (R1-0.5) * m; + float m = num / (width + height) * (1/noise); + R1 = random(1); + return (R1-0.5) * m; } float random(float x){ //C version of the ASM rand opcode @@ -100,17 +100,17 @@ void setColor(float r,float g,float b){ //C version of the dcolor opcode mov #col.r,r; mov #col.g,g; mov #col.b,b; - + dcolor col; } void rect(float x, float y, float width, float height){ //C version of the drectwh opcode mov #pos.x,x; mov #pos.y,y; - + mov #size.x,width; mov #size.y,height; - + drectwh pos, size; dswap; //dswap to make it show since we're drawing to the sprite buffer -} \ No newline at end of file +} diff --git a/data/gpuchip/examples/sprite.txt b/data/gpuchip/examples/sprite.txt index df9221a7..49b8a3db 100644 --- a/data/gpuchip/examples/sprite.txt +++ b/data/gpuchip/examples/sprite.txt @@ -9,22 +9,22 @@ void Main() { // Enable vertex mode glVertexMode( 1 ); - + // Draw to sprite buffer glSetRenderTarget( GL_BUFFER_BACK ); glClear( 0, 255, 0 ); - + // Draw to vertex buffer (world) glSetRenderTarget( GL_BUFFER_VERTEX ); glEnable( GL_VERTEX_TEXTURING ); - + // Sample from sprite 0 glTextureSize( 256 ); glTexture( 0 ); glClear( 0, 255, 0 ); glRectWH( 128, 128, 256, 256 ); - + glSetRenderTarget( GL_BUFFER_FRONT ); - + glExit(); } diff --git a/data/gpuchip/examples/table.txt b/data/gpuchip/examples/table.txt index 9fd6dbca..8e147d2e 100644 --- a/data/gpuchip/examples/table.txt +++ b/data/gpuchip/examples/table.txt @@ -15,9 +15,9 @@ float i, j, day; void Main() { - dentrypoint 0,DrawThread; + dentrypoint 0,DrawThread; dentrypoint 4,AsyncThread; - + *regHWClear = 0 *regAsyncFreq = 200000; *regAsyncClk = 1; @@ -31,25 +31,25 @@ void DrawThread() void AsyncThread() { glBegin(); - + glClear( 35, 35, 35 ); // Clear screen color - + glColor( 255, 255, 255 ); // Set draw color glFont( GL_FONT_ARIAL ); // Set font type glFontSize( 36 ); // Set font size glWriteString( 16, 6, 'Simple-Calendar 1.0'); - + glColor( 120, 120, 120 ); glOffset( 16, 64 ); // Set screen offset glRectWH( 0, 0, sizex + linewidth, sizey + linewidth); // Draw rectangle - + glFont( GL_FONT_TREBUCHET ); glFontSize( 14 ); - + // Calculate rectangle size float sx = (sizex / rows) - linewidth; float sy = (sizey / cols) - linewidth; - + // Loop through rows for (i = 0; i < rows; i++) { @@ -59,19 +59,17 @@ void AsyncThread() // Calculate x,y coordinate to draw at float x = i * (sizex / rows); float y = j * (sizey / cols); - + glColor( 200, 200, 200 ); // Set draw color glRectWH( x + linewidth, y + linewidth, sx, sy ); // Draw rectangle - + glColor( 0, 0, 0 ); // Set draw color - + // Write integer to screen day = i + (j * rows) - glWriteInt( x + linewidth + 2, y + linewidth + 2, day + 1 ); + glWriteInt( x + linewidth + 2, y + linewidth + 2, day + 1 ); } } - + glEnd(); } - - diff --git a/data/gpuchip/examples/texture.txt b/data/gpuchip/examples/texture.txt index d1828c4a..f5286f5f 100644 --- a/data/gpuchip/examples/texture.txt +++ b/data/gpuchip/examples/texture.txt @@ -13,8 +13,8 @@ void Main() glBindTexture( 'brick/brick_model' ); glColor( 255, 255, 255, 255 ); glRectWH( 128, 128, 256, 256 ); - - glExit(); + + glExit(); } // ZASM version diff --git a/data/gpuchip/examples/trig.txt b/data/gpuchip/examples/trig.txt index 1132b88a..f605a7fa 100644 --- a/data/gpuchip/examples/trig.txt +++ b/data/gpuchip/examples/trig.txt @@ -15,7 +15,7 @@ void Main() glColor( 255, 255, 255 ); // Set draw color glCircle( *orig.x, *orig.y, 0.66, 40 ); // Draw circle (x, y, radius, quality) - + glColor( 0, 0, 0 ); glCircle( *orig.x, *orig.y, 0.64, 40 ); @@ -26,13 +26,13 @@ void Main() *PosR.x = *cos; *PosR.x *= 0.65; *PosR.x += *orig.x; - + *PosR.y = *sin; *PosR.y *= 0.65; *PosR.y += *orig.y; *PosX.x = *PosR.x; - + glLineWidth( 0.01 ); // Set line width glFontSize( 24 ); // Set font size @@ -46,10 +46,10 @@ void Main() glLine( *PosR.x, *PosR.y, *PosX.x, *PosX.y ); *sin *= -1; // Negate glWriteFmt( -0.95, -0.85, sSin ); - + glColor( 255, 255, 255 ); glLine( *orig.x, *orig.y, *PosR.x, *PosR.y ); // Draw line - + glExit(); // Exit } diff --git a/data/gpuchip/examples/verynice1.txt b/data/gpuchip/examples/verynice1.txt index d4eb0362..460f1e99 100644 --- a/data/gpuchip/examples/verynice1.txt +++ b/data/gpuchip/examples/verynice1.txt @@ -51,4 +51,4 @@ vec2f p3,60,60; vec2f p4,430,430; vec2f p5,70,70; -vec2f p6,440,440; \ No newline at end of file +vec2f p6,440,440; diff --git a/data/gpuchip/examples/verynice2.txt b/data/gpuchip/examples/verynice2.txt index 5e24ec12..33948e80 100644 --- a/data/gpuchip/examples/verynice2.txt +++ b/data/gpuchip/examples/verynice2.txt @@ -120,4 +120,3 @@ vec2f _a_73,272,440 string _s_74,'Y: %f' vec2f _a_76,272,456 string _s_77,'Z: %f' - diff --git a/data/gpuchip/lib/drivers/drv_gl.txt b/data/gpuchip/lib/drivers/drv_gl.txt index 8b621414..a7094eca 100644 --- a/data/gpuchip/lib/drivers/drv_gl.txt +++ b/data/gpuchip/lib/drivers/drv_gl.txt @@ -151,13 +151,13 @@ void glTextureOffsetUV( float u, float v ) { // Frame void glSleep( float ms ) { div ms,1000; - timer #GL_CURTIME; + timer #GL_CURTIME; sub #GL_CURTIME,#GL_TIMESTAMP; if (*GL_CURTIME <= ms) { mov #regHWClear,0; dexit; } - timer #GL_TIMESTAMP; + timer #GL_TIMESTAMP; } void glExit() { dexit; @@ -360,7 +360,7 @@ float glParamList() { // 3D graphics void glPoly3D( float* buffer, float count ) { - + if (*GL_MUPDATE == 1) { mov #GL_MUPDATE,0; mrotate GL_MROTATEMATRIX,GL_VROTATE; @@ -371,10 +371,10 @@ void glPoly3D( float* buffer, float count ) { mmul GL_MMODELMATRIX,GL_MSCALEMATRIX; mmov GL_MMODELVIEWMATRIX,GL_MVIEWMATRIX; mmul GL_MMODELVIEWMATRIX,GL_MMODELMATRIX; - mload GL_MMODELVIEWMATRIX; + mload GL_MMODELVIEWMATRIX; mloadproj GL_MPROJECTIONMATRIX; } - + if (*GL_FILLMODE == GL_FILL_SOLID) { dvxdata_3f buffer,count; } @@ -420,7 +420,7 @@ void glPerspective( float fov, float asp, float znear, float zfar ) { mov #GL_MUPDATE,1; } void glRotate( float x, float y, float z, float w ) { - mov #GL_VROTATE.x,x; mov #GL_VROTATE.y,y; mov #GL_VROTATE.z,z; mov #GL_VROTATE.w,w; + mov #GL_VROTATE.x,x; mov #GL_VROTATE.y,y; mov #GL_VROTATE.z,z; mov #GL_VROTATE.w,w; mov #GL_MUPDATE,1; } void glTranslate( float x, float y, float z ) { @@ -500,5 +500,3 @@ vec4f GL_VROTATE; vec4f GL_VTRANSLATE; vec4f GL_VPERSPECTIVE; vec4f GL_VSCALE,1,1,1,0; - - diff --git a/data/gpuchip/lib/drivers/drv_gl_toolkit.txt b/data/gpuchip/lib/drivers/drv_gl_toolkit.txt index 7c2465d5..0b20ca9c 100644 --- a/data/gpuchip/lib/drivers/drv_gl_toolkit.txt +++ b/data/gpuchip/lib/drivers/drv_gl_toolkit.txt @@ -13,15 +13,15 @@ float __GLT_VERTCNT = 0; void gltVertex(float x, float y, float z) { if ((__GLT_VERTCNT / 3) >= GLT_MAX_TRIANGLES) - return; - + return; + float* ptr = __GLT_VERTBUFF; ptr += (__GLT_VERTCNT * 3); - + *ptr = x; *(++ptr) = y; *(++ptr) = z; - + __GLT_VERTCNT++; } @@ -44,7 +44,7 @@ void gltQuad(float tlx, float tly, float tlz, tlx, tly, tlz, blx, bly, blz ); - + gltTriangle( brx, bry, brz, trx, try, trz, @@ -55,42 +55,42 @@ void gltQuad(float tlx, float tly, float tlz, void gltCube(float cex, float cey, float cez, float size) { float s2 = size / 2; - + gltQuad( cex - s2, cey + s2, cez - s2, cex + s2, cey + s2, cez - s2, cex + s2, cey - s2, cez - s2, cex - s2, cey - s2, cez - s2 ); - + gltQuad( cex + s2, cey + s2, cez + s2, cex - s2, cey + s2, cez + s2, cex - s2, cey - s2, cez + s2, cex + s2, cey - s2, cez + s2 ); - + gltQuad( cex - s2, cey + s2, cez + s2, cex - s2, cey + s2, cez - s2, cex - s2, cey - s2, cez - s2, cex - s2, cey - s2, cez + s2 ); - + gltQuad( cex + s2, cey + s2, cez - s2, cex + s2, cey + s2, cez + s2, cex + s2, cey - s2, cez + s2, cex + s2, cey - s2, cez - s2 ); - + gltQuad( cex - s2, cey + s2, cez + s2, cex + s2, cey + s2, cez + s2, cex + s2, cey + s2, cez - s2, cex - s2, cey + s2, cez - s2 ); - + gltQuad( cex - s2, cey - s2, cez - s2, cex + s2, cey - s2, cez - s2, @@ -108,13 +108,13 @@ void gltFlushBuffer() { if (__GLT_VERTCNT <= 3) return; - + float vcnt = __GLT_VERTCNT; float tcnt = (vcnt / 3) - (vcnt % 3); - + if (tcnt > GLT_MAX_TRIANGLES) tcnt = GLT_MAX_TRIANGLES; - + glPoly3D(__GLT_VERTBUFF, tcnt); glFlush(); } diff --git a/data/spuchip/examples/mario_theme.txt b/data/spuchip/examples/mario_theme.txt index 146d7fd2..db5fbd99 100644 --- a/data/spuchip/examples/mario_theme.txt +++ b/data/spuchip/examples/mario_theme.txt @@ -35,22 +35,22 @@ void main() fpwr note,(trackA[i]/12); note /= 100; chpitch 0,note; - + // Track B note = 2; fpwr note,(trackB[i]/12); note /= 100; chpitch 1,note; - + // Bass note = 2; fpwr note,(bass[i]/12); note /= 100; chpitch 2,note; - + // Index i++; mod i,tracklen; - + // Repeat jmp main; } @@ -96,9 +96,9 @@ db 87,87,87,87, 87,87,87,87, 87,87,87,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,78,7 // Part 2 db 90,90,90,90, 90,90,90,90, 90,90,90,-1, 90,90,90,90, 90,90,90,90, 90,90,90,-1; db 90,90,90,90, 90,90,90,90, 90,90,90,-1, 90,90,90,-1, 92,92,-1,-1, -1,-1,90,90; -db 88,88,88,88, 88,88,88,88, 88,88,88,-1, 88,88,88,88, 88,88,88,88, 88,88,88,-1; -db 88,88,88,88, 88,88,88,88, 88,88,88,-1, 88,88,88,-1, 90,90,-1,-1, -1,-1,88,88; -db 87,87,87,87, 87,87,87,87, 87,87,87,-1, 80,80,80,-1, 82,82,82,-1, 88,88,88,-1; +db 88,88,88,88, 88,88,88,88, 88,88,88,-1, 88,88,88,88, 88,88,88,88, 88,88,88,-1; +db 88,88,88,88, 88,88,88,88, 88,88,88,-1, 88,88,88,-1, 90,90,-1,-1, -1,-1,88,88; +db 87,87,87,87, 87,87,87,87, 87,87,87,-1, 80,80,80,-1, 82,82,82,-1, 88,88,88,-1; db 87,-1,87,-1, 87,87,87,87, 87,-1,82,82, 83,83,83,83, 83,83,83,83, 83,83,83,-1; db 0; // End string @@ -106,7 +106,7 @@ db 0; // End string trackB: // Intro -db 73,73,73,73, 72,72,72,72, 71,71,71,71, 70,70,70,70, 71,71,71,71, 72,72,72,72; +db 73,73,73,73, 72,72,72,72, 71,71,71,71, 70,70,70,70, 71,71,71,71, 72,72,72,72; db 73,-1,73,-1, 73,73,73,-1, 75,75,75,-1, 76,76,76,76, 76,76,76,-1, -1,-1,-1,-1; // Part 1 @@ -129,7 +129,7 @@ db 82,-1,82,-1, 82,82,82,-1, -1,-1,76,76, 75,75,75,75, 75,75,75,75, 75,75,75,- db 0; // End string -bass: +bass: // Intro db -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1; @@ -154,4 +154,3 @@ db 47,47,47,-1, 66,66,66,-1, 75,75,75,-1, 54,54,54,-1, 66,66,66,-1, 66,66,66,-1; db 64,-1,64,-1, 64,64,64,-1, -1,-1,58,58, 59,59,59,59, 59,59,59,59, 59,59,59,-1; db 0; // End string - diff --git a/license b/license index 54c7d92e..37176fa9 100644 --- a/license +++ b/license @@ -201,9 +201,9 @@ See the License for the specific language governing permissions and limitations under the License. - - - + + + Wiremod was previous licensed under GPL3. If you were one of the few developers we were unable to contact prior to the switch, and do not wish your contributions to remain in the project under the Apache2 license, diff --git a/lua/entities/base_wire_entity.lua b/lua/entities/base_wire_entity.lua index e9edc379..d6721f3e 100644 --- a/lua/entities/base_wire_entity.lua +++ b/lua/entities/base_wire_entity.lua @@ -9,7 +9,7 @@ ENT.AdminOnly = false ENT.IsWire = true -if CLIENT then +if CLIENT then local wire_drawoutline = CreateClientConVar("wire_drawoutline", 1, true, false) function ENT:Initialize() @@ -19,20 +19,20 @@ if CLIENT then function ENT:Draw() self:DoNormalDraw() Wire_Render(self) - if self.GetBeamLength and (not self.GetShowBeam or self:GetShowBeam()) then + if self.GetBeamLength and (not self.GetShowBeam or self:GetShowBeam()) then -- Every SENT that has GetBeamLength should draw a tracer. Some of them have the GetShowBeam boolean - Wire_DrawTracerBeam( self, 1, self.GetBeamHighlight and self:GetBeamHighlight() or false ) + Wire_DrawTracerBeam( self, 1, self.GetBeamHighlight and self:GetBeamHighlight() or false ) end end - + local WorldTip = { dietime = 0 } function ENT:AddWorldTip( txt ) WorldTip.dietime = SysTime() + RealFrameTime() * 4 WorldTip.ent = self end - + local edgesize = 18 - + -- makes sure the overlay doesn't go out of the screen & provides several useful sizes and positions for the DrawBody function function ENT:GetWorldTipPositions( w, h, w_body, h_body, w_footer, h_footer ) local pos = LocalPlayer():GetEyeTrace().HitPos @@ -41,34 +41,34 @@ if CLIENT then pos = spos + LocalPlayer():GetAimVector() * 5 end pos = pos:ToScreen() - + pos.x = math.Round(pos.x) pos.y = math.Round(pos.y) - + w = math.min( w, ScrW() - 64 ) h = math.min( h, ScrH() - 64 ) - + local maxx = pos.x - 32 local maxy = pos.y - 32 - + local minx = maxx - w local miny = maxy - h - + if minx < 32 then maxx = 32 + w minx = 32 end - + if miny < 32 then maxy = 32 + h miny = 32 end - + local centerx = (maxx+minx)/2 local centery = (maxy+miny)/2 - + return { min = {x = minx,y = miny}, - max = {x = maxx,y = maxy}, + max = {x = maxx,y = maxy}, center = {x = centerx, y = centery}, size = {w = w, h = h}, bodysize = {w = w_body, h = h_body }, @@ -81,7 +81,7 @@ if CLIENT then function ENT:DrawWorldTipOutline( pos ) draw.NoTexture() surface.SetDrawColor(Color(25,25,25,200)) - + local poly = { {x = pos.min.x + edgesize, y = pos.min.y, u = 0, v = 0 }, {x = pos.max.x, y = pos.min.y, u = 0, v = 0 }, @@ -90,90 +90,90 @@ if CLIENT then {x = pos.min.x, y = pos.max.y, u = 0, v = 0 }, {x = pos.min.x, y = pos.min.y + edgesize, u = 0, v = 0 }, } - + render.CullMode(MATERIAL_CULLMODE_CCW) surface.DrawPoly( poly ) - + surface.SetDrawColor(Color(0,0,0,255)) - + for i=1,#poly-1 do surface.DrawLine( poly[i].x, poly[i].y, poly[i+1].x, poly[i+1].y ) end surface.DrawLine( poly[#poly].x, poly[#poly].y, poly[1].x, poly[1].y ) end - + local function getWireName( ent ) local name = ent:GetNWString("WireName") if not name or name == "" then return ent.PrintName else return name end end - + -- This is overridable by other wire entities which want to customize the overlay function ENT:GetWorldTipBodySize() local txt = self:GetOverlayData().txt if txt == nil or txt == "" then return 0,0 end return surface.GetTextSize( txt ) end - + -- This is overridable by other wire entities which want to customize the overlay function ENT:DrawWorldTipBody( pos ) local data = self:GetOverlayData() draw.DrawText( data.txt, "GModWorldtip", pos.center.x, pos.min.y + edgesize/2, Color(255,255,255,255), TEXT_ALIGN_CENTER ) end - + -- This is overridable by other wire entities which want to customize the overlay function ENT:DrawWorldTip() local data = self:GetOverlayData() if not data then return end - + surface.SetFont( "GModWorldtip" ) - + local txt = data.txt local class = getWireName( self ) .. " [" .. self:EntIndex() .. "]" local name = "(" .. self:GetPlayerName() .. ")" - + local w_body, h_body = self:GetWorldTipBodySize() local w_class, h_class = surface.GetTextSize( class ) local w_name, h_name = surface.GetTextSize( name ) - + local w_total = txt ~= "" and w_body or 0 local h_total = txt ~= "" and h_body or 0 - + local w_footer, h_footer = 0, 0 - + local info_requires_multiline = false if w_total < w_class + w_name - edgesize then info_requires_multiline = true - + w_footer = math.max(w_total,w_class,w_name) h_footer = h_class + h_name + edgesize + 8 - + w_total = w_footer h_total = h_total + h_footer else w_footer = math.max(w_total,w_class + 8 + w_name) h_footer = math.max(h_class,h_name) + edgesize + 8 - + w_total = w_footer h_total = h_total + h_footer end - + if h_body == 0 then h_total = h_total - h_body - edgesize end - + local pos = self:GetWorldTipPositions( w_total + edgesize*2,h_total + edgesize, w_body,h_body, w_footer,h_footer ) self:DrawWorldTipOutline( pos ) - + local offset = pos.min.y if h_body > 0 then self:DrawWorldTipBody( pos ) offset = offset + h_body + edgesize - + surface.SetDrawColor( Color(0,0,0,255) ) surface.DrawLine( pos.min.x, offset, pos.max.x, offset ) end - + if info_requires_multiline then draw.DrawText( class, "GModWorldtip", pos.center.x, offset + 8, Color(255,255,255,255), TEXT_ALIGN_CENTER ) draw.DrawText( name, "GModWorldtip", pos.center.x, offset + h_class + 16, Color(255,255,255,255), TEXT_ALIGN_CENTER ) @@ -182,23 +182,23 @@ if CLIENT then draw.DrawText( name, "GModWorldtip", pos.min.x + pos.size.w - w_name - edgesize, offset + 16, Color(255,255,255,255) ) end end - + hook.Add("HUDPaint","wire_draw_world_tips",function() if SysTime() > WorldTip.dietime then return end - + local ent = WorldTip.ent if not IsValid(ent) then return end - + ent:DrawWorldTip() end) - + -- Custom better version of this base_gmodentity function function ENT:BeingLookedAtByLocalPlayer() local trace = LocalPlayer():GetEyeTrace() - + if trace.Entity ~= self then return false end if trace.HitPos:Distance(LocalPlayer():GetShootPos()) > 200 then return false end - + return true end @@ -249,17 +249,17 @@ if CLIENT then halos = {} halos_inv = {} end) - + -------------------------------------------------------------------------------- -- Overlay getting -------------------------------------------------------------------------------- - + -- Basic legacy GetOverlayText, is no longer used here but we leave it here in case other addons rely on it. function ENT:GetOverlayText() local name = self:GetNWString("WireName") if name == "" then name = self.PrintName end local header = "- " .. name .. " -" - + local data = self:GetOverlayData() if data and data.txt then return header .. "\n" .. data.txt @@ -267,7 +267,7 @@ if CLIENT then return header end end - + -------------------------------------------------------------------------------- -- Overlay receiving -------------------------------------------------------------------------------- @@ -292,13 +292,13 @@ function ENT:SetOverlayText( txt ) if not self.OverlayData then self.OverlayData = {} end - + if txt and #txt > 12000 then txt = string.sub(txt,1,12000) -- I have tested this and 12000 chars is enough to cover the entire screen at 1920x1080. You're unlikely to need more end - + self.OverlayData.txt = txt - + if not self.OverlayData_UpdateTime then self.OverlayData_UpdateTime = {} end self.OverlayData_UpdateTime.time = CurTime() end @@ -308,7 +308,7 @@ function ENT:SetOverlayData( data ) if self.OverlayData.txt and #self.OverlayData.txt > 12000 then self.OverlayData.txt = string.sub(self.OverlayData.txt,1,12000) end - + if not self.OverlayData_UpdateTime then self.OverlayData_UpdateTime = {} end self.OverlayData_UpdateTime.time = CurTime() end @@ -328,13 +328,13 @@ util.AddNetworkString( "wire_overlay_data" ) timer.Create("WireOverlayUpdate", 0.1, 0, function() for _, ply in ipairs(player.GetAll()) do local ent = ply:GetEyeTrace().Entity - if IsValid(ent) and ent.IsWire and - ent.OverlayData and - ent.OverlayData_UpdateTime and + if IsValid(ent) and ent.IsWire and + ent.OverlayData and + ent.OverlayData_UpdateTime and ent.OverlayData_UpdateTime.time > (ent.OverlayData_UpdateTime[ply] or 0) then - + ent.OverlayData_UpdateTime[ply] = CurTime() - + net.Start( "wire_overlay_data" ) net.WriteEntity( ent ) net.WriteTable( ent.OverlayData ) @@ -382,7 +382,7 @@ end function ENT:OnEntityCopyTableFinish(dupedata) -- Called by Garry's duplicator, to modify the table that will be saved about an ent - + -- Remove anything with non-string keys, or util.TableToJSON will crash the game dupedata.OverlayData_UpdateTime = nil end diff --git a/lua/entities/gmod_wire_adv_input.lua b/lua/entities/gmod_wire_adv_input.lua index d4ab10f3..ef587f8e 100644 --- a/lua/entities/gmod_wire_adv_input.lua +++ b/lua/entities/gmod_wire_adv_input.lua @@ -16,12 +16,12 @@ end function ENT:Setup(key_more,key_less,toggle,value_min,value_max,value_start,speed) self.keymore = key_more self.keyless = key_less - + numpad.OnDown( pl, key_more, "WireAdvInput_On", self, 1 ) numpad.OnUp( pl, key_more, "WireAdvInput_Off", self, 1 ) numpad.OnDown( pl, key_less, "WireAdvInput_On", self, -1 ) numpad.OnUp( pl, key_less, "WireAdvInput_Off", self, -1 ) - + self.toggle = (toggle == 1 || toggle == true) self.value_min = value_min self.value_max = value_max diff --git a/lua/entities/gmod_wire_button.lua b/lua/entities/gmod_wire_button.lua index 0a9add9a..2beab921 100644 --- a/lua/entities/gmod_wire_button.lua +++ b/lua/entities/gmod_wire_button.lua @@ -7,7 +7,7 @@ function ENT:SetupDataTables() self:NetworkVar( "Bool", 0, "On" ) end -if CLIENT then +if CLIENT then local halo_ent, halo_blur function ENT:Initialize() @@ -37,7 +37,7 @@ if CLIENT then halo_ent = nil end end) - + return -- No more client end diff --git a/lua/entities/gmod_wire_clutch.lua b/lua/entities/gmod_wire_clutch.lua index 6d0080b8..35f03a46 100644 --- a/lua/entities/gmod_wire_clutch.lua +++ b/lua/entities/gmod_wire_clutch.lua @@ -116,12 +116,12 @@ function ENT:SetClutchFriction( const, friction ) local Ent2 = const.Ent2 const:Remove() - + local newconst = NewBallSocket( Ent1, Ent2, friction ) if newconst then self.clutch_ballsockets[newconst] = true end - + else print("Wire Clutch: Attempted to set friction on invalid constraint") end @@ -131,13 +131,13 @@ end function ENT:OnRemove() - - for k, _ in pairs( self.clutch_ballsockets ) do - + + for k, v in pairs( self.clutch_ballsockets ) do + self:RemoveClutch( k ) - + end - + end diff --git a/lua/entities/gmod_wire_colorer.lua b/lua/entities/gmod_wire_colorer.lua index 38eb56f7..d90da62d 100644 --- a/lua/entities/gmod_wire_colorer.lua +++ b/lua/entities/gmod_wire_colorer.lua @@ -14,75 +14,75 @@ if CLIENT then function ENT:GetWorldTipBodySize() -- "Input color:" text local w_total,h_total = surface.GetTextSize( "Input color:\n255,255,255,255" ) - + -- Color box width w_total = math.max(w_total,color_box_size) - + -- "Target color:" text local w,h = surface.GetTextSize( "Target color:\n255,255,255,255" ) w_total = w_total + 18 + math.max(w,color_box_size) h_total = math.max(h_total, h) - + -- Color box height h_total = h_total + 18 + color_box_size + 18/2 - + return w_total, h_total end - + local white = Color(255,255,255,255) local black = Color(0,0,0,255) - + local function drawColorBox( color, x, y ) surface.SetDrawColor( color ) surface.DrawRect( x, y, color_box_size, color_box_size ) - + local size = color_box_size - + surface.SetDrawColor( black ) surface.DrawLine( x, y, x + size, y ) surface.DrawLine( x + size, y, x + size, y + size ) surface.DrawLine( x + size, y + size, x, y + size ) surface.DrawLine( x, y + size, x, y ) end - + function ENT:DrawWorldTipBody( pos ) -- get colors local data = self:GetOverlayData() local inColor = Color(data.r or 255,data.g or 255,data.b or 255,data.a or 255) - + local trace = util.TraceLine( { start = self:GetPos(), endpos = self:GetPos() + self:GetUp() * self:GetBeamLength(), filter = {self} } ) - + local targetColor = Color(255,255,255,255) if IsValid( trace.Entity ) then targetColor = trace.Entity:GetColor() end - + -- "Input color" text local color_text = string.format("Input color:\n%d,%d,%d,%d",inColor.r,inColor.g,inColor.b,inColor.a) - + local w,h = surface.GetTextSize( color_text ) draw.DrawText( color_text, "GModWorldtip", pos.min.x + pos.edgesize + w/2, pos.min.y + pos.edgesize, white, TEXT_ALIGN_CENTER ) - + -- "Target color" text local color_text = string.format("Target color:\n%d,%d,%d,%d",targetColor.r,targetColor.g,targetColor.b,targetColor.a) local w2,h2 = surface.GetTextSize( color_text ) draw.DrawText( color_text, "GModWorldtip", pos.max.x - w/2 - pos.edgesize, pos.min.y + pos.edgesize, white, TEXT_ALIGN_CENTER ) - + local h = math.max(h,h2) - + -- Input color box local x = pos.min.x + pos.edgesize + w/2 - color_box_size/2 local y = pos.min.y + pos.edgesize * 1.5 + h - drawColorBox( inColor, x, y ) - + drawColorBox( inColor, x, y ) + -- Target color box - + local x = pos.max.x - pos.edgesize - w/2 - color_box_size/2 local y = pos.min.y + pos.edgesize * 1.5 + h drawColorBox( targetColor, x, y ) - + end - + return -- No more client end @@ -105,7 +105,7 @@ function ENT:Setup(outColor,Range) else WireLib.AdjustOutputs(self, {"Out"}) end - + if Range then self:SetBeamLength(Range) end self:ShowOutput() end @@ -122,7 +122,7 @@ function ENT:TriggerInput(iname, value) } if not IsValid(trace.Entity) then return end if not hook.Run( "CanTool", self:GetPlayer(), trace, "colour" ) then return end - + if trace.Entity:IsPlayer() then trace.Entity:SetColor(Color(self.InColor.r, self.InColor.g, self.InColor.b, 255)) else diff --git a/lua/entities/gmod_wire_consolescreen/cl_init.lua b/lua/entities/gmod_wire_consolescreen/cl_init.lua index 0d3239e6..824ee40d 100644 --- a/lua/entities/gmod_wire_consolescreen/cl_init.lua +++ b/lua/entities/gmod_wire_consolescreen/cl_init.lua @@ -93,7 +93,7 @@ function ENT:Initialize() GPULib.ClientCacheCallback(self,function(Address,Value) self:WriteCell(Address,Value) end) - + WireLib.netRegister(self) end diff --git a/lua/entities/gmod_wire_cpu.lua b/lua/entities/gmod_wire_cpu.lua index ce1c4995..90a57646 100644 --- a/lua/entities/gmod_wire_cpu.lua +++ b/lua/entities/gmod_wire_cpu.lua @@ -10,7 +10,7 @@ local cpu_max_frequency = 1400000 local wire_cpu_max_frequency = CreateConVar("wire_cpu_max_frequency", cpu_max_frequency, FCVAR_REPLICATED) cvars.AddChangeCallback("wire_cpu_max_frequency",function() - cpu_max_frequency = math.Clamp(math.floor(wire_cpu_max_frequency:GetInt()),1,30000000) + cpu_max_frequency = math.Clamp(math.floor(wire_cpu_max_frequency:GetInt()),1,30000000) end) function ENT:Initialize() @@ -88,11 +88,11 @@ function ENT:Initialize() end else VM:Interrupt(8,Address+1) return end - else return 0 + else return 0 end end end - + local oldReset = self.VM.Reset self.VM.Reset = function(...) if self.Clk and self.VMStopped then diff --git a/lua/entities/gmod_wire_damage_detector.lua b/lua/entities/gmod_wire_damage_detector.lua index ad4b80af..bede8797 100644 --- a/lua/entities/gmod_wire_damage_detector.lua +++ b/lua/entities/gmod_wire_damage_detector.lua @@ -53,10 +53,10 @@ function ENT:Initialize() self.hit = false -- Tracks whether detector registered any damage that tick self.firsthit_dmginfo = {} -- Stores damage info representing damage during an interval - + self.linked_entities = {} -- numerical array self.linked_entities_lookup = {} -- lookup table indexed by entities - + self:LinkEnt( self ) self.count = 0 @@ -100,7 +100,7 @@ function ENT:ShowOutput() text = text .. "Linked to " .. #self.linked_entities .. " entities." end end - + self:SetOverlayText( text ) self:SetOverlayText(text) @@ -113,7 +113,7 @@ end function ENT:LinkEnt( ent ) if self.linked_entities_lookup[ent] then return false end - + self.linked_entities_lookup[ent] = true self.linked_entities[#self.linked_entities+1] = ent ent:CallOnRemove( "DDetector.Unlink", function( ent ) @@ -121,7 +121,7 @@ function ENT:LinkEnt( ent ) self:UnlinkEnt( ent ) end end ) - + self:ShowOutput() WireLib.SendMarks( self, self.linked_entities ) return true @@ -129,18 +129,18 @@ end function ENT:UnlinkEnt( ent ) if not self.linked_entities_lookup[ent] then return false end - + self.linked_entities_lookup[ent] = nil - + for i=1,#self.linked_entities do if self.linked_entities[i] == ent then table.remove( self.linked_entities, i ) break end end - + ent:RemoveCallOnRemove( "DDetector.Unlink" ) - + self:ShowOutput() WireLib.SendMarks( self, self.linked_entities ) return true @@ -152,10 +152,10 @@ function ENT:ClearEntities() self.linked_entities[i]:RemoveCallOnRemove( "DDetector.Unlink" ) end end - + self.linked_entities = {} self.linked_entities_lookup = {} - + self:ShowOutput() WireLib.SendMarks( self, self.linked_entities ) return true @@ -167,7 +167,7 @@ function ENT:TriggerInput( iname, value ) elseif iname == "Entities" then -- Populate linked_entities from "Array" if value then self:ClearEntities() - + for _, v in pairs( value ) do if IsValid( v ) then self:LinkEnt( v ) @@ -217,7 +217,7 @@ function ENT:UpdateLinkedEnts() -- Check to see if prop is registered by the de if self.includeconstrained == 1 then -- Don't update constrained entities unless we have to self:UpdateConstrainedEnts( ent ) end - + self.key_ents[ent] = true else self.linked_entities[ent] = nil @@ -227,7 +227,7 @@ end function ENT:UpdateConstrainedEnts( ent ) -- Finds all entities constrained to 'ent' local ents = constraint.GetAllConstrainedEntities( ent ) - + for _,v in pairs( ents ) do self.key_ents[v] = true end @@ -291,10 +291,10 @@ duplicator.RegisterEntityClass("gmod_wire_damage_detector", WireLib.MakeWireEnt, function ENT:BuildDupeInfo() local info = self.BaseClass.BuildDupeInfo(self) or {} - + if #self.linked_entities > 0 then info.linked_entities = {} - + for i=1,#self.linked_entities do if IsValid( self.linked_entities[i] ) then info.linked_entities[i] = self.linked_entities[i]:EntIndex() @@ -303,13 +303,13 @@ function ENT:BuildDupeInfo() end end end - + return info end function ENT:ApplyDupeInfo(ply, ent, info, GetEntByID) self.BaseClass.ApplyDupeInfo(self, ply, ent, info, GetEntByID) - + if info.linked_entities then if type( info.linked_entities ) == "number" then -- old dupe compatibility self:LinkEnt( GetEntByID( info.linked_entities ) ) @@ -319,7 +319,7 @@ function ENT:ApplyDupeInfo(ply, ent, info, GetEntByID) end end end - + self:ShowOutput() -- wait a while after dupe before sending marks, because the entity doesn't exist clientside yet timer.Simple( 0.1, function() if IsValid( self ) then WireLib.SendMarks( self, self.linked_entities ) end end ) diff --git a/lua/entities/gmod_wire_data_satellitedish.lua b/lua/entities/gmod_wire_data_satellitedish.lua index 2967f57e..d103bbf3 100644 --- a/lua/entities/gmod_wire_data_satellitedish.lua +++ b/lua/entities/gmod_wire_data_satellitedish.lua @@ -13,7 +13,7 @@ function ENT:Initialize() end function ENT:LinkEnt( transmitter ) - if not IsValid(transmitter) || transmitter:GetClass() != "gmod_wire_data_transferer" then + if not IsValid(transmitter) || transmitter:GetClass() != "gmod_wire_data_transferer" then return false, "Satellite Dishes can only be linked to Wire Data Transferers!" end self.Transmitter = transmitter diff --git a/lua/entities/gmod_wire_digitalscreen/cl_init.lua b/lua/entities/gmod_wire_digitalscreen/cl_init.lua index 094bea5e..30add317 100644 --- a/lua/entities/gmod_wire_digitalscreen/cl_init.lua +++ b/lua/entities/gmod_wire_digitalscreen/cl_init.lua @@ -34,7 +34,7 @@ function ENT:Initialize() self.GPU = WireGPU(self) self.buffer = {} - + WireLib.netRegister(self) end @@ -56,12 +56,12 @@ end local pixelbits = {3, 1, 3, 4, 1} net.Receive("wire_digitalscreen", function(netlen) local ent = Entity(net.ReadUInt(16)) - + if IsValid(ent) and ent.Memory1 and ent.Memory2 then local pixelformat = net.ReadUInt(5) local pixelbit = pixelbits[pixelformat] local readData - + local datastr = util.Decompress(net.ReadData((netlen-21)/8)) if not datastr then return end local readIndex = 1 diff --git a/lua/entities/gmod_wire_digitalscreen/init.lua b/lua/entities/gmod_wire_digitalscreen/init.lua index 57d17c43..a4f6422d 100644 --- a/lua/entities/gmod_wire_digitalscreen/init.lua +++ b/lua/entities/gmod_wire_digitalscreen/init.lua @@ -114,7 +114,7 @@ function ENT:FlushCache(ply) end if self.UseBuffering then - -- This section allows the data to build up until + -- This section allows the data to build up until -- the user stops writing data, or up to three seconds if not self.WaitToFlush then self.OldChangedCount = #self.ChangedCellRanges @@ -131,48 +131,48 @@ function ENT:FlushCache(ply) end self.WaitToFlush = nil - + local pixelformat = (math.floor(self.Memory[1048569]) or 0) + 1 if pixelformat < 1 or pixelformat > #pixelbits then pixelformat = 1 end local pixelbit = pixelbits[pixelformat] local bitsremaining = 200000 - local datastr = {} - + local datastr = {} + net.Start("wire_digitalscreen") net.WriteUInt(self:EntIndex(),16) net.WriteUInt(pixelformat, 5) bitsremaining = bitsremaining - 21 - + while bitsremaining>0 and next(self.ChangedCellRanges) do local range = self.ChangedCellRanges[1] local start = range.start local length = math.min(range.length, math.ceil(bitsremaining/pixelbit)) --Estimate how many numbers to read from the range - + range.length = range.length - length --Update the range and remove it if its empty range.start = start + length if range.length==0 then table.remove(self.ChangedCellRanges, 1) end buildData(datastr, self.Memory, pixelbit, start, length) - + bitsremaining = bitsremaining - length*pixelbit end numberToString(datastr,0,3) local compressed = util.Compress(table.concat(datastr)) net.WriteData(compressed,#compressed) - + if ply then net.Send(ply) else net.Broadcast() end end function ENT:Retransmit(ply) self:FlushCache() -- Empty the cache - + self:MarkCellChanged(1048569) -- Colormode self:MarkCellChanged(1048572) -- Screen Width self:MarkCellChanged(1048573) -- Screen Height self:MarkCellChanged(1048575) -- Clk self:FlushCache(ply) - + local memory = self.Memory for addr=0, self.ScreenWidth*self.ScreenHeight do if memory[addr] then @@ -213,7 +213,7 @@ function ENT:WriteCell(Address, value) return true end else - if Address == 1048569 then + if Address == 1048569 then -- Color mode (0: RGBXXX; 1: R G B; 2: 24 bit RGB; 3: RRRGGGBBB; 4: XXX) value = math.Clamp(math.floor(value or 0), 0, 9) elseif Address == 1048570 then -- Clear row diff --git a/lua/entities/gmod_wire_dual_input.lua b/lua/entities/gmod_wire_dual_input.lua index e14a6fc3..eda66ef3 100644 --- a/lua/entities/gmod_wire_dual_input.lua +++ b/lua/entities/gmod_wire_dual_input.lua @@ -22,7 +22,7 @@ function ENT:Setup(keygroup, keygroup2, toggle, value_off, value_on, value_on2) numpad.OnUp( pl, keygroup, "WireDualInput_Off", self, 1 ) numpad.OnDown( pl, keygroup2, "WireDualInput_On", self, -1 ) numpad.OnUp( pl, keygroup2, "WireDualInput_Off", self, -1 ) - + self.toggle = (toggle == 1 || toggle == true) self.value_off = value_off self.value_on = value_on diff --git a/lua/entities/gmod_wire_dynamic_button.lua b/lua/entities/gmod_wire_dynamic_button.lua index 7acfdec3..4208335e 100644 --- a/lua/entities/gmod_wire_dynamic_button.lua +++ b/lua/entities/gmod_wire_dynamic_button.lua @@ -8,7 +8,7 @@ function ENT:SetupDataTables() end -if CLIENT then +if CLIENT then local halo_ent, halo_blur function ENT:Draw() @@ -30,7 +30,7 @@ if CLIENT then halo_ent = nil end end) - + return -- No more client end diff --git a/lua/entities/gmod_wire_egp/lib/egplib/materials.lua b/lua/entities/gmod_wire_egp/lib/egplib/materials.lua index 1e6c5fc1..8804646d 100644 --- a/lua/entities/gmod_wire_egp/lib/egplib/materials.lua +++ b/lua/entities/gmod_wire_egp/lib/egplib/materials.lua @@ -29,7 +29,7 @@ if (CLIENT) then additive = false } surface.CreateFont( font, fontTable ) - + EGP.ValidFonts_Lookup[font] = true table.insert( new, font ) end @@ -56,7 +56,7 @@ if (CLIENT) then NoTexture() end end - + function EGP:FixMaterial( OldTex ) if (!OldTex) then return end WireGPU_matScreen:SetTexture("$basetexture", OldTex) diff --git a/lua/entities/gmod_wire_egp/lib/egplib/queuesystem.lua b/lua/entities/gmod_wire_egp/lib/egplib/queuesystem.lua index 791efc1a..de583888 100644 --- a/lua/entities/gmod_wire_egp/lib/egplib/queuesystem.lua +++ b/lua/entities/gmod_wire_egp/lib/egplib/queuesystem.lua @@ -132,7 +132,7 @@ timer.Create("EGP_Queue_Process", 1, 0, function() for ply, tab in pairs(EGP.Queue) do if !IsValid(ply) then removetab[ply] = true continue end EGP:SendQueueItem(ply) - end + end for ply in pairs(removetab) do EGP.Queue[ply] = nil end end) diff --git a/lua/entities/gmod_wire_egp/lib/egplib/transmitreceive.lua b/lua/entities/gmod_wire_egp/lib/egplib/transmitreceive.lua index 0a17a4f1..1a6fae18 100644 --- a/lua/entities/gmod_wire_egp/lib/egplib/transmitreceive.lua +++ b/lua/entities/gmod_wire_egp/lib/egplib/transmitreceive.lua @@ -120,7 +120,7 @@ if (SERVER) then -- Extra Set Poly queue item, used by poly objects with a lot of vertices in them util.AddNetworkString( "SetVertex" ) function EGP._SetVertex( Ent, ply, index, vertices, skiptoadd ) - + if not IsValid(ply) or not ply:IsPlayer() then return end if (EGP:CheckInterval( ply ) == false) then EGP:InsertQueue( Ent, ply, EGP._SetVertex, "SetVertex", index, vertices, skiptoadd ) @@ -324,7 +324,7 @@ if (SERVER) then if (E2 and E2.entity and E2.entity:IsValid()) then E2.prf = E2.prf + 20 end - + for i=1,#Ent.RenderTable do E2.prf = E2.prf + 0.3 if Ent.RenderTable[i].index == Data[1] then @@ -338,7 +338,7 @@ if (SERVER) then if (E2 and E2.entity and E2.entity:IsValid()) then E2.prf = E2.prf + 20 end - + // Remove all queued actions for this screen local queue = self.Queue[E2.player] or {} local i = 1 @@ -350,7 +350,7 @@ if (SERVER) then i = i + 1 end end - + Ent.RenderTable = {} self:AddQueue( Ent, E2.player, ClearScreen, "ClearScreen" ) @@ -515,7 +515,7 @@ else -- SERVER/CLIENT -- For EGP HUD if (Obj.res) then Obj.res = nil end - + current_obj = Obj else -- Edit self:EditObject( v, v:Receive() ) @@ -527,7 +527,7 @@ else -- SERVER/CLIENT -- For EGP HUD if (v.res) then v.res = nil end - + current_obj = v end else -- Object does not exist. Create new @@ -536,7 +536,7 @@ else -- SERVER/CLIENT Obj.index = index if (Obj.OnCreate) then Obj:OnCreate() end Ent.RenderTable[#Ent.RenderTable+1] = Obj--table.insert( Ent.RenderTable, Obj ) - + current_obj = Obj end @@ -547,7 +547,7 @@ else -- SERVER/CLIENT end end end - + -- Change order now if order_was_changed then @@ -637,7 +637,7 @@ if (SERVER) then DataToSend[#DataToSend+1] = { ID = obj.ID, index = obj.index, Settings = obj:DataStreamInfo() } end - + timer.Simple( k, function() -- send 1 second apart net.Start("EGP_Request_Transmit") net.WriteTable({ @@ -675,7 +675,7 @@ else function EGP:ReceiveDataStream( decoded ) local Ent = decoded.Ent local Objects = decoded.Objects - + if (self:ValidEGP( Ent )) then Ent.RenderTable = {} if Ent.GPU then -- Only Screens use GPULib @@ -693,7 +693,7 @@ else end Ent:EGP_Update() end - + if decoded.IsLastScreen then LocalPlayer():ChatPrint("[EGP] Received EGP object reload. " .. decoded.IsLastScreen .. " screens' objects were reloaded.") end diff --git a/lua/entities/gmod_wire_egp/lib/egplib/usefulfunctions.lua b/lua/entities/gmod_wire_egp/lib/egplib/usefulfunctions.lua index 83f0fdbe..9fbccf1f 100644 --- a/lua/entities/gmod_wire_egp/lib/egplib/usefulfunctions.lua +++ b/lua/entities/gmod_wire_egp/lib/egplib/usefulfunctions.lua @@ -251,10 +251,10 @@ function EGP:DrawLine( x, y, x2, y2, size ) -- Calculate angle (Thanks to Fizyk) local angle = math.deg(math.atan2(y-y2,x2-x)) - + -- if the rectangle's less than a pixel wide, nothing will get drawn. if w < 1 then w = 1 end - + surface.DrawTexturedRectRotated( x3, y3, w, size, angle ) end end diff --git a/lua/entities/gmod_wire_egp_emitter.lua b/lua/entities/gmod_wire_egp_emitter.lua index da2557b3..45981d98 100644 --- a/lua/entities/gmod_wire_egp_emitter.lua +++ b/lua/entities/gmod_wire_egp_emitter.lua @@ -4,7 +4,7 @@ ENT.PrintName = "Wire E2 Graphics Processor Emitter" ENT.RenderGroup = RENDERGROUP_TRANSLUCENT ENT.WireDebugName = "E2 Graphics Processor Emitter" -if CLIENT then +if CLIENT then ENT.gmod_wire_egp_emitter = true function ENT:Initialize() @@ -69,7 +69,7 @@ if CLIENT then self:DrawModel() Wire_Render(self) end - + return -- No more client end diff --git a/lua/entities/gmod_wire_egp_hud/huddraw.lua b/lua/entities/gmod_wire_egp_hud/huddraw.lua index eb8d9f5e..c4a3682e 100644 --- a/lua/entities/gmod_wire_egp_hud/huddraw.lua +++ b/lua/entities/gmod_wire_egp_hud/huddraw.lua @@ -91,18 +91,18 @@ hook.Add("Initialize","EGP_HUD_Initialize",function() function EGP:LinkHUDToVehicle( hud, vehicle ) if not hud.LinkedVehicles then hud.LinkedVehicles = {} end if not hud.Marks then hud.Marks = {} end - + hud.Marks[#hud.Marks+1] = vehicle hud.LinkedVehicles[vehicle] = true vehiclelinks[hud] = hud.LinkedVehicles - + timer.Simple( 0.1, function() -- timers solve everything (this time, it's the fact that the entity isn't valid on the client after dupe) WireLib.SendMarks( hud ) end) end function EGP:UnlinkHUDFromVehicle( hud, vehicle ) - if not vehicle then -- unlink all + if not vehicle then -- unlink all vehiclelinks[hud] = nil hud.LinkedVehicles = nil hud.Marks = nil @@ -117,7 +117,7 @@ hook.Add("Initialize","EGP_HUD_Initialize",function() umsg.End() end end - + if hud.Marks then for i=1,#hud.Marks do if hud.Marks[i] == vehicle then @@ -126,17 +126,17 @@ hook.Add("Initialize","EGP_HUD_Initialize",function() end end end - + hud.LinkedVehicles[vehicle] = nil if not next( hud.LinkedVehicles ) then hud.LinkedVehicles = nil hud.Marks = nil end - + vehiclelinks[hud] = hud.LinkedVehicles end end - + WireLib.SendMarks( hud ) end diff --git a/lua/entities/gmod_wire_egp_hud/init.lua b/lua/entities/gmod_wire_egp_hud/init.lua index 2ff7eaae..869aa7b1 100644 --- a/lua/entities/gmod_wire_egp_hud/init.lua +++ b/lua/entities/gmod_wire_egp_hud/init.lua @@ -60,7 +60,7 @@ function ENT:LinkEnt( ent ) if self.LinkedVehicles and self.LinkedVehicles[ent] then return false end - + EGP:LinkHUDToVehicle( self, ent ) ent:CallOnRemove( "EGP HUD unlink on remove", function( ent ) EGP:UnlinkHUDFromVehicle( self, ent ) @@ -77,7 +77,7 @@ function ENT:OnRemove() self.Marks[i]:RemoveCallOnRemove( "EGP HUD unlink on remove" ) end end - + EGP:UnlinkHUDFromVehicle( self ) end @@ -103,7 +103,7 @@ function ENT:ApplyDupeInfo(ply, ent, info, GetEntByID) if vehicles then for i=1,#vehicles do local vehicle = GetEntByID( vehicles[i] ) - + if IsValid( vehicle ) then self:LinkEnt( vehicle ) end diff --git a/lua/entities/gmod_wire_egp_hud/shared.lua b/lua/entities/gmod_wire_egp_hud/shared.lua index f0b568d9..7116f2d0 100644 --- a/lua/entities/gmod_wire_egp_hud/shared.lua +++ b/lua/entities/gmod_wire_egp_hud/shared.lua @@ -8,4 +8,4 @@ ENT.Purpose = "EGP Hud" ENT.Instructions = "WireLink To E2" ENT.Spawnable = false -ENT.AdminSpawnable = false \ No newline at end of file +ENT.AdminSpawnable = false diff --git a/lua/entities/gmod_wire_exit_point.lua b/lua/entities/gmod_wire_exit_point.lua index 525521e0..9f74d000 100644 --- a/lua/entities/gmod_wire_exit_point.lua +++ b/lua/entities/gmod_wire_exit_point.lua @@ -6,16 +6,16 @@ if CLIENT then return end -- No more client function ENT:Initialize() self.BaseClass.Initialize(self) - + self.Inputs = WireLib.CreateInputs(self, {"Entity [ENTITY]", "Entities [ARRAY]", "Position [VECTOR]", "Local Position [VECTOR]", "Angle [ANGLE]", "Local Angle [ANGLE]"}) - + self.Position = Vector(0,0,0) self.Angle = Angle(0,0,0) self.Entities = {} self.Global = false self.GlobalAngle = false self:AddExitPoint() - + self:ShowOutput() end @@ -82,7 +82,7 @@ local function MovePlayer( ply, vehicle ) local LocalPosDistance = epoint.Position:Length() ply:SetPos( vehicle:LocalToWorld( epoint.Position / LocalPosDistance * math.min(LocalPosDistance, math.max(0, ClampDistance:GetInt()))) + Vector(0,0,5) ) end - + if epoint.GlobalAngle then ply:SetEyeAngles( Angle( epoint.Angle.p, epoint.Angle.y, 0 ) ) else @@ -90,7 +90,7 @@ local function MovePlayer( ply, vehicle ) ang.r = 0 ply:SetEyeAngles( ang ) end - + return end end @@ -111,7 +111,7 @@ function ENT:LinkEnt( ent ) ent:CallOnRemove("ExitPoint.Unlink", function(ent) if IsValid(self) then self:UnlinkEnt(ent) end end) - + self:SendMarks() self:ShowOutput() return true @@ -120,7 +120,7 @@ end function ENT:UnlinkEnt( ent ) if not self.Entities[ent] then return end self.Entities[ent] = nil - + self:SendMarks() self:ShowOutput() return true diff --git a/lua/entities/gmod_wire_explosive.lua b/lua/entities/gmod_wire_explosive.lua index 4da92f0b..8ff514f8 100644 --- a/lua/entities/gmod_wire_explosive.lua +++ b/lua/entities/gmod_wire_explosive.lua @@ -47,7 +47,7 @@ function ENT:TriggerInput(iname, value) end function ENT:Setup( key, damage, delaytime, removeafter, radius, affectother, notaffected, delayreloadtime, maxhealth, bulletproof, explosionproof, fallproof, explodeatzero, resetatexplode, fireeffect, coloreffect, invisibleatzero ) - + self.key = key self.Damage = math.Clamp( damage, 0, 1500 ) self.Delaytime = delaytime @@ -90,7 +90,7 @@ function ENT:Setup( key, damage, delaytime, removeafter, radius, affectother, no if (self.Delaytime > 0) then self.NormInfo = self.NormInfo.." Delay: "..self.Delaytime end self:ShowOutput() - + local ttable = { key = key, damage = damage, diff --git a/lua/entities/gmod_wire_expression2/base/compiler.lua b/lua/entities/gmod_wire_expression2/base/compiler.lua index a8c915e7..f09cd26b 100644 --- a/lua/entities/gmod_wire_expression2/base/compiler.lua +++ b/lua/entities/gmod_wire_expression2/base/compiler.lua @@ -21,7 +21,7 @@ function Compiler:Error(message, instr) error(message .. " at line " .. instr[2][1] .. ", char " .. instr[2][2], 0) end -function Compiler:Process(root, inputs, outputs, persist, delta, includes) -- Took params out becuase it isnt used. +function Compiler:Process(root, inputs, outputs, persist, delta, includes) -- Took params out becuase it isnt used. self.context = {} self:InitScope() -- Creates global scope! diff --git a/lua/entities/gmod_wire_expression2/cl_init.lua b/lua/entities/gmod_wire_expression2/cl_init.lua index c24313e7..192a7372 100644 --- a/lua/entities/gmod_wire_expression2/cl_init.lua +++ b/lua/entities/gmod_wire_expression2/cl_init.lua @@ -95,67 +95,67 @@ local h_of_lower = 100 -- height of the lower section (the prfbench/percent bar function ENT:GetWorldTipBodySize() local data = self:GetOverlayData() if not data then return 100, 20 end - + local w_total,h_total = wtfgarry( data.txt ) h_total = h_total + 18 - + local prfbench = data.prfbench local prfcount = data.prfcount local timebench = data.timebench local e2_hardquota = GetConVar("wire_expression2_quotahard"):GetInt() local e2_softquota = GetConVar("wire_expression2_quotasoft"):GetInt() - + -- ops text local hardtext = (prfcount / e2_hardquota > 0.33) and "(+" .. tostring(math.Round(prfcount / e2_hardquota * 100)) .. "%)" or "" local str = string.format("%i ops, %i%% %s", prfbench, prfbench / e2_softquota * 100, hardtext) - + h_of_lower = 0 local w,h = surface.GetTextSize( str ) w_total = math.max(w_total,w) h_total = h_total + h + 18 h_of_lower = h_of_lower + h + 18 - + -- cpu time text local str = string.format("cpu time: %ius", timebench*1000000) - + local w,h = surface.GetTextSize( str ) w_total = math.max(w_total,w) h_total = h_total + h + 20 h_of_lower = h_of_lower + h + 20 + 18 - + return w_total, math.min(h_total,ScrH() - (h_of_lower + 32*2)) end function ENT:DrawWorldTipBody( pos ) local data = self:GetOverlayData() if not data then return end - + local txt = data.txt local err = data.error -- this isn't used (yet), might do something with it later - + local white = Color(255,255,255,255) local black = Color(0,0,0,255) - + local w_total, yoffset = 0, pos.min.y - + ------------------- -- Name ------------------- local w,h = wtfgarry( txt ) h = h + pos.edgesize h = math.min(h,pos.size.h - (h_of_lower+pos.footersize.h)) - + render.SetScissorRect( pos.min.x + 16, pos.min.y, pos.max.x - 16, pos.min.y + h, true ) draw.DrawText( txt, "GModWorldtip", pos.min.x + pos.size.w/2, yoffset + 9, white, TEXT_ALIGN_CENTER ) render.SetScissorRect( 0, 0, ScrW(), ScrH(), false ) - + w_total = math.max( w_total, w ) yoffset = yoffset + h - + surface.SetDrawColor( black ) surface.DrawLine( pos.min.x, yoffset, pos.max.x, yoffset ) - + ------------------- -- prfcount/benchmarking/etc ------------------- @@ -165,41 +165,41 @@ function ENT:DrawWorldTipBody( pos ) local e2_hardquota = GetConVar("wire_expression2_quotahard"):GetInt() local e2_softquota = GetConVar("wire_expression2_quotasoft"):GetInt() - + -- fancy percent bar local w = pos.size.w - pos.edgesize * 2 - + -- ops text local hardtext = (prfcount / e2_hardquota > 0.33) and "(+" .. tostring(math.Round(prfcount / e2_hardquota * 100)) .. "%)" or "" local str = string.format("%i ops, %i%% %s", prfbench, prfbench / e2_softquota * 100, hardtext) draw.DrawText( str, "GModWorldtip", pos.min.x + pos.size.w/2, yoffset + 9, white, TEXT_ALIGN_CENTER ) - + local _,h = surface.GetTextSize( str ) yoffset = yoffset + h + pos.edgesize -- fancy percent bar - + local softquota_width = w * 0.7 local quota_width = softquota_width * math.min(prfbench/e2_softquota,1) + (w - softquota_width + 1) * (prfcount/e2_hardquota) - + local y = yoffset surface.SetDrawColor( Color(0,170,0,255) ) surface.DrawRect( pos.min.x + pos.edgesize, y, softquota_width, 20 ) - + surface.SetDrawColor( Color(170,0,0,255) ) surface.DrawRect( pos.min.x + pos.edgesize + softquota_width - 1, y, w - softquota_width + 2, 20 ) - + surface.SetDrawColor( Color(0,0,0,200) ) surface.DrawRect( pos.min.x + pos.edgesize, y, quota_width, 20 ) - + surface.SetDrawColor( black ) surface.DrawLine( pos.min.x + pos.edgesize, y, pos.min.x + pos.edgesize + w, y ) surface.DrawLine( pos.min.x + pos.edgesize + w, y, pos.min.x + pos.edgesize + w, y + 20 ) surface.DrawLine( pos.min.x + pos.edgesize + w, y + 20, pos.min.x + pos.edgesize, y + 20 ) surface.DrawLine( pos.min.x + pos.edgesize, y + 20, pos.min.x + pos.edgesize, y ) - + yoffset = yoffset + 20 - + -- cpu time text local str = string.format("cpu time: %ius", timebench*1000000) draw.DrawText( str, "GModWorldtip", pos.min.x + pos.size.w/2, yoffset + 9, white, TEXT_ALIGN_CENTER ) diff --git a/lua/entities/gmod_wire_expression2/core/angle.lua b/lua/entities/gmod_wire_expression2/core/angle.lua index 193cb824..7e0822bd 100644 --- a/lua/entities/gmod_wire_expression2/core/angle.lua +++ b/lua/entities/gmod_wire_expression2/core/angle.lua @@ -221,8 +221,8 @@ __e2setcost(5) e2function angle round(angle rv1) return { - floor(rv1[1] + 0.5), - floor(rv1[2] + 0.5), + floor(rv1[1] + 0.5), + floor(rv1[2] + 0.5), floor(rv1[3] + 0.5) } end @@ -230,16 +230,16 @@ end e2function angle round(angle rv1, decimals) local shf = 10 ^ decimals return { - floor(rv1[1] * shf + 0.5) / shf, - floor(rv1[2] * shf + 0.5) / shf, + floor(rv1[1] * shf + 0.5) / shf, + floor(rv1[2] * shf + 0.5) / shf, floor(rv1[3] * shf + 0.5) / shf } end e2function angle ceil(angle rv1) return { - ceil(rv1[1]), - ceil(rv1[2]), + ceil(rv1[1]), + ceil(rv1[2]), ceil(rv1[3]) } end @@ -247,16 +247,16 @@ end e2function angle ceil(angle rv1, decimals) local shf = 10 ^ decimals return { - ceil(rv1[1] * shf) / shf, - ceil(rv1[2] * shf) / shf, + ceil(rv1[1] * shf) / shf, + ceil(rv1[2] * shf) / shf, ceil(rv1[3] * shf) / shf } end e2function angle floor(angle rv1) return { - floor(rv1[1]), - floor(rv1[2]), + floor(rv1[1]), + floor(rv1[2]), floor(rv1[3]) } end @@ -264,8 +264,8 @@ end e2function angle floor(angle rv1, decimals) local shf = 10 ^ decimals return { - floor(rv1[1] * shf) / shf, - floor(rv1[2] * shf) / shf, + floor(rv1[1] * shf) / shf, + floor(rv1[2] * shf) / shf, floor(rv1[3] * shf) / shf } end diff --git a/lua/entities/gmod_wire_expression2/core/cl_debug.lua b/lua/entities/gmod_wire_expression2/core/cl_debug.lua index c031c285..8de1702f 100644 --- a/lua/entities/gmod_wire_expression2/core/cl_debug.lua +++ b/lua/entities/gmod_wire_expression2/core/cl_debug.lua @@ -15,6 +15,6 @@ net.Receive("wire_expression2_printColor", function( len, ply ) chat.AddText(Color(255,0,0),"While in somone's seat/car/whatever, printColorDriver can be used to 100% realistically fake people talking, including admins.") chat.AddText(Color(255,0,0),"Don't trust a word you hear while in a seat after seeing this message!") end - + chat.AddText(unpack(net.ReadTable())) end) diff --git a/lua/entities/gmod_wire_expression2/core/cl_hologram.lua b/lua/entities/gmod_wire_expression2/core/cl_hologram.lua index f6bdb4fd..8800a5fb 100644 --- a/lua/entities/gmod_wire_expression2/core/cl_hologram.lua +++ b/lua/entities/gmod_wire_expression2/core/cl_hologram.lua @@ -16,7 +16,7 @@ end local display_owners = false concommand.Add( "wire_holograms_display_owners", function() display_owners = !display_owners - if display_owners then + if display_owners then hook.Add( "HUDPaint", "wire_holograms_showowners", WireHologramsShowOwners) else hook.Remove("HUDPaint", "wire_holograms_showowners") diff --git a/lua/entities/gmod_wire_expression2/core/color.lua b/lua/entities/gmod_wire_expression2/core/color.lua index c92cf736..e7045f8c 100644 --- a/lua/entities/gmod_wire_expression2/core/color.lua +++ b/lua/entities/gmod_wire_expression2/core/color.lua @@ -81,7 +81,7 @@ e2function void entity:setAlpha(a) if !isOwner(self, this) then return end if this:IsPlayer() then return end - + local c = this:GetColor() c.a = Clamp(a, 0, 255) this:SetColor(c) @@ -92,7 +92,7 @@ e2function void entity:setRenderMode(mode) if !IsValid(this) then return end if !isOwner(self, this) then return end if this:IsPlayer() then return end - + this:SetRenderMode(mode) end @@ -151,9 +151,9 @@ local function Convert_hsl2rgb(h, s, l) end local function Convert_rgb2hsl(r, g, b) - r = r / 255 - g = g / 255 - b = b / 255 + r = r / 255 + g = g / 255 + b = b / 255 local max = math.max(r, g, b) local min = math.min(r, g, b) local h = (max + min) / 2 diff --git a/lua/entities/gmod_wire_expression2/core/console.lua b/lua/entities/gmod_wire_expression2/core/console.lua index af5c4848..b2b314b5 100644 --- a/lua/entities/gmod_wire_expression2/core/console.lua +++ b/lua/entities/gmod_wire_expression2/core/console.lua @@ -8,12 +8,12 @@ local function validConCmd(self, command) local ply = self.player if not ply:IsValid() then return false end if ply:GetInfoNum("wire_expression2_concmd", 0) == 0 then return false end - -- Validating the concmd length to ensure that it won't crash the server. - if #command > 500000 then return false end - + -- Validating the concmd length to ensure that it won't crash the server. + if #command > 500000 then return false end + local whitelist = (ply:GetInfo("wire_expression2_concmd_whitelist") or ""):Trim() if whitelist == "" then return true end - + for cmd in command:gmatch( "[^;]+" ) do -- Split around ; and space cmd = cmd:match( "[^%s]+" ) -- Get everything up to the first space local found = false diff --git a/lua/entities/gmod_wire_expression2/core/constraint.lua b/lua/entities/gmod_wire_expression2/core/constraint.lua index d5ec4134..b025e8cd 100644 --- a/lua/entities/gmod_wire_expression2/core/constraint.lua +++ b/lua/entities/gmod_wire_expression2/core/constraint.lua @@ -32,7 +32,7 @@ __e2setcost(20) local function GetAllConstrainedEntities( ent, ResultTable ) ResultTable[ ent ] = ent - + for _, con in pairs( ent.Constraints or {} ) do for i=1, 6 do local e = con["Ent"..i] diff --git a/lua/entities/gmod_wire_expression2/core/custom.lua b/lua/entities/gmod_wire_expression2/core/custom.lua index 318c3b13..be987c08 100644 --- a/lua/entities/gmod_wire_expression2/core/custom.lua +++ b/lua/entities/gmod_wire_expression2/core/custom.lua @@ -1,4 +1,3 @@ /******************************************************************************\ User defined support \******************************************************************************/ - diff --git a/lua/entities/gmod_wire_expression2/core/custom/cl_remoteupload.lua b/lua/entities/gmod_wire_expression2/core/custom/cl_remoteupload.lua index 7461e3d2..e8a16123 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/cl_remoteupload.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/cl_remoteupload.lua @@ -6,4 +6,4 @@ usermessage.Hook("e2_remoteupload_request", function(um) local str = file.Read("expression2/" .. filepath) WireLib.Expression2Upload(target, str, "expression2/" .. filepath) end -end) \ No newline at end of file +end) diff --git a/lua/entities/gmod_wire_expression2/core/custom/cl_wiring.lua b/lua/entities/gmod_wire_expression2/core/custom/cl_wiring.lua index dcbf0d37..659cde54 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/cl_wiring.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/cl_wiring.lua @@ -3,4 +3,4 @@ E2Helper.Descriptions["createWire(e:ess)"] = "Creates a wire from specified inpu E2Helper.Descriptions["deleteWire(e:s)"] = "Unwires the specified input of the entity" E2Helper.Descriptions["getWireInputs(e:)"] = "Returns array of all inputs of the entity" E2Helper.Descriptions["getWireOutputs(e:)"] = "Returns array of all outputs of the entity" -E2Helper.Descriptions["wirelink(e:)"] = "Returns entity's wirelink" \ No newline at end of file +E2Helper.Descriptions["wirelink(e:)"] = "Returns entity's wirelink" diff --git a/lua/entities/gmod_wire_expression2/core/custom/constraintcore.lua b/lua/entities/gmod_wire_expression2/core/custom/constraintcore.lua index 3e82dea3..eb491531 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/constraintcore.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/constraintcore.lua @@ -92,63 +92,63 @@ end local function CalcElasticConsts(Phys1, Phys2, Ent1, Ent2) local minMass - if Ent1:IsWorld() then + if Ent1:IsWorld() then minMass = Phys2:GetMass() - elseif Ent2:IsWorld() then + elseif Ent2:IsWorld() then minMass = Phys1:GetMass() - else + else minMass = math.min( Phys1:GetMass(), Phys2:GetMass() ) end - + local const = minMass * 100 local damp = const * 0.2 - + return const, damp end // Note: Winch is just a rename of Hydraulic with the last parameter True. ---- Makes a winch constraint (stored at index ) between and , at vectors local to their respective ents, with width. +--- Makes a winch constraint (stored at index ) between and , at vectors local to their respective ents, with width. e2function void winch(index, entity ent1, vector v1, entity ent2, vector v2, width) if !checkEnts(self, ent1, ent2) then return end if !ent1.data then ent1.data = {} end if !ent1.data.Ropes then ent1.data.Ropes = {} end local vec1, vec2 = Vector(v1[1],v1[2],v1[3]), Vector(v2[1],v2[2],v2[3]) if width < 0 || width > 50 then width = 1 end - + if IsValid(ent1.data.Ropes[index]) then ent1.data.Ropes[index]:Remove() end - + local constant, dampen = CalcElasticConsts( ent1:GetPhysicsObject(), ent2:GetPhysicsObject(), ent1, ent2 ) ent1.data.Ropes[index] = constraint.Elastic( ent1, ent2, 0, 0, vec1, vec2, constant, dampen, 0, "cable/cable2", width, true ) addundo(self, ent1.data.Ropes[index], "winch") end ---- Makes a hydraulic constraint (stored at index ) between and , at vectors local to their respective ents, with width. +--- Makes a hydraulic constraint (stored at index ) between and , at vectors local to their respective ents, with width. e2function void hydraulic(index, entity ent1, vector v1, entity ent2, vector v2, width) if !checkEnts(self, ent1, ent2) then return end if !ent1.data then ent1.data = {} end if !ent1.data.Ropes then ent1.data.Ropes = {} end local vec1, vec2 = Vector(v1[1],v1[2],v1[3]), Vector(v2[1],v2[2],v2[3]) if width < 0 || width > 50 then width = 1 end - + if IsValid(ent1.data.Ropes[index]) then ent1.data.Ropes[index]:Remove() end - + local constant, dampen = CalcElasticConsts( ent1:GetPhysicsObject(), ent2:GetPhysicsObject(), ent1, ent2 ) ent1.data.Ropes[index] = constraint.Elastic( ent1, ent2, 0, 0, vec1, vec2, constant, dampen, 0, "cable/cable2", width, false ) addundo(self, ent1.data.Ropes[index], "hydraulic") end ---- Makes a hydraulic constraint (stored at index ) between and , at vectors local to their respective ents, constant and damping, with width, material, and stretch only option. +--- Makes a hydraulic constraint (stored at index ) between and , at vectors local to their respective ents, constant and damping, with width, material, and stretch only option. e2function void hydraulic(index, entity ent1, vector v1, entity ent2, vector v2, constant, damping, string mat, width, stretch) if not checkEnts(self, ent1, ent2) then return end if not ent1.data then ent1.data = {} end if not ent1.data.Ropes then ent1.data.Ropes = {} end local vec1, vec2 = Vector(v1[1],v1[2],v1[3]), Vector(v2[1],v2[2],v2[3]) if width < 0 or width > 50 then width = 1 end - + if IsValid(ent1.data.Ropes[index]) then ent1.data.Ropes[index]:Remove() end @@ -157,14 +157,14 @@ e2function void hydraulic(index, entity ent1, vector v1, entity ent2, vector v2, addundo(self, ent1.data.Ropes[index], "hydraulic") end ---- Makes a hydraulic constraint (stored at index ) between and , at vectors local to their respective ents, constant, damping and relative damping, with width, material, and stretch only option. +--- Makes a hydraulic constraint (stored at index ) between and , at vectors local to their respective ents, constant, damping and relative damping, with width, material, and stretch only option. e2function void hydraulic(index, entity ent1, vector v1, entity ent2, vector v2, constant, damping, rdamping, string mat, width, stretch) if not checkEnts(self, ent1, ent2) then return end if not ent1.data then ent1.data = {} end if not ent1.data.Ropes then ent1.data.Ropes = {} end local vec1, vec2 = Vector(v1[1],v1[2],v1[3]), Vector(v2[1],v2[2],v2[3]) if width < 0 or width > 50 then width = 1 end - + if IsValid(ent1.data.Ropes[index]) then ent1.data.Ropes[index]:Remove() end @@ -180,11 +180,11 @@ e2function void rope(index, entity ent1, vector v1, entity ent2, vector v2) if not ent1.data.Ropes then ent1.data.Ropes = {} end local vec1, vec2 = Vector(v1[1], v1[2], v1[3]), Vector(v2[1], v2[2], v2[3]) local length = (ent1:LocalToWorld(vec1) - ent2:LocalToWorld(vec2)):Length() - - if IsValid(ent1.data.Ropes[index]) then - ent1.data.Ropes[index]:Remove() + + if IsValid(ent1.data.Ropes[index]) then + ent1.data.Ropes[index]:Remove() end - + ent1.data.Ropes[index] = constraint.Rope( ent1, ent2, 0, 0, vec1, vec2, length, 0, 0, 1, "cable/rope", false ) addundo(self, ent1.data.Ropes[index], "rope") end @@ -196,11 +196,11 @@ e2function void rope(index, entity ent1, vector v1, entity ent2, vector v2, addl if not ent1.data.Ropes then ent1.data.Ropes = {} end local vec1, vec2 = Vector(v1[1], v1[2], v1[3]), Vector(v2[1], v2[2], v2[3]) local length = (ent1:LocalToWorld(vec1) - ent2:LocalToWorld(vec2)):Length() - - if IsValid(ent1.data.Ropes[index]) then - ent1.data.Ropes[index]:Remove() + + if IsValid(ent1.data.Ropes[index]) then + ent1.data.Ropes[index]:Remove() end - + ent1.data.Ropes[index] = constraint.Rope( ent1, ent2, 0, 0, vec1, vec2, length, addlength, 0, width, mat, false ) addundo(self, ent1.data.Ropes[index], "rope") end @@ -212,11 +212,11 @@ e2function void rope(index, entity ent1, vector v1, entity ent2, vector v2, addl if not ent1.data.Ropes then ent1.data.Ropes = {} end local vec1, vec2 = Vector(v1[1], v1[2], v1[3]), Vector(v2[1], v2[2], v2[3]) local length = (ent1:LocalToWorld(vec1) - ent2:LocalToWorld(vec2)):Length() - - if IsValid(ent1.data.Ropes[index]) then - ent1.data.Ropes[index]:Remove() + + if IsValid(ent1.data.Ropes[index]) then + ent1.data.Ropes[index]:Remove() end - + ent1.data.Ropes[index] = constraint.Rope( ent1, ent2, 0, 0, vec1, vec2, length, addlength, 0, width, mat, tobool(rigid) ) addundo(self, ent1.data.Ropes[index], "rope") end @@ -300,14 +300,14 @@ end --- Nocollides to e2function void noCollide(entity ent1, entity ent2) if !checkEnts(self, ent1, ent2) then return end - addundo(self, constraint.NoCollide(ent1, ent2, 0, 0), "nocollide") + addundo(self, constraint.NoCollide(ent1, ent2, 0, 0), "nocollide") end --- Nocollides to entities/players, just like Right Click of No-Collide Stool e2function void noCollideAll(entity ent, state) if !IsValid(ent) then return end if !isOwner(self, ent) then return false end - if state != 0 then + if state != 0 then ent:SetCollisionGroup( COLLISION_GROUP_WORLD ) else ent:SetCollisionGroup( COLLISION_GROUP_NONE ) @@ -334,10 +334,10 @@ e2function void entity:constraintBreak(entity ent2) if !checkEnts(self, this, ent2) then return end local consts = this.Constraints local consts2 = ent2.Constraints - if !consts then + if !consts then if !consts2 then return end consts = consts2 - end + end for _,v in pairs( consts ) do if IsValid(v) then local CTab = v:GetTable() @@ -360,10 +360,10 @@ e2function void entity:constraintBreak(string type, entity ent2) if !checkEnts(self, this, ent2) then return end local consts = this.Constraints local consts2 = ent2.Constraints - if !consts then + if !consts then if !consts2 then return end consts = consts2 - end + end for _,v in pairs( consts ) do if IsValid(v) then local CTab = v:GetTable() diff --git a/lua/entities/gmod_wire_expression2/core/custom/effects.lua b/lua/entities/gmod_wire_expression2/core/custom/effects.lua index 16d699b2..aebeb566 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/effects.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/effects.lua @@ -10,11 +10,11 @@ local effect_blacklist = { local function isAllowed( self ) local data = self.data - + if data.effect_burst == 0 then return false end - + data.effect_burst = data.effect_burst - 1 - + local timerid = "E2_effect_burst_count_" .. self.entity:EntIndex() if not timer.Exists( timerid ) then timer.Create( timerid, wire_expression2_effect_burst_rate:GetFloat(), 0, function() @@ -22,14 +22,14 @@ local function isAllowed( self ) timer.Remove( timerid ) return end - + data.effect_burst = data.effect_burst + 1 if data.effect_burst == wire_expression2_effect_burst_max:GetInt() then timer.Remove( timerid ) end end) end - + return true end @@ -56,42 +56,42 @@ registerOperator("ass", "xef", "xef", function(self, args) self.Scopes[scope].vclk[lhs] = true return rhs end) - + e2function effect effect() return EffectData() end e2function effect effect:setOrigin(vector pos) if not this then return end - + this:SetOrigin(Vector( pos[1], pos[2], pos[3] )) return this end e2function effect effect:setStart(vector pos) if not this then return end - + this:SetStart(Vector( pos[1], pos[2], pos[3] )) return this end e2function effect effect:setMagnitude(number mag) if not this then return end - + this:SetMagnitude(mag) return this end e2function effect effect:setAngles(angle ang) if not this then return end - + this:SetAngles( Angle( ang[1] ,ang[2] ,ang[3] )) return this end e2function effect effect:setScale(number scale) if not this then return end - + this:SetScale(scale) return this end @@ -99,63 +99,63 @@ end e2function effect effect:setEntity(entity ent) if not this then return end if not IsValid(ent) then return end - + this:SetEntity(ent) return this end e2function effect effect:setNormal(vector norm) if not this then return end - + this:SetNormal(Vector( norm[1], norm[2], norm[3] )) return this end e2function effect effect:setSurfaceProp(number prop) if not this then return end - + this:SetSurfaceProp(prop) return this end e2function effect effect:setRadius(number radius) if not this then return end - + this:SetRadius(radius) return this end e2function effect effect:setMaterialIndex(number index) if not this then return end - + this:SetMaterialIndex(index) return this end e2function effect effect:setHitBox(number index) if not this then return end - + this:SetHitBox(index) return this end e2function effect effect:setFlags(number flags) if not this then return end - + this:SetFlags(flags) return this end e2function effect effect:setEntIndex(number index) if not this then return end - + this:SetEntIndex(index) return this end e2function effect effect:setDamageType(number index) if not this then return end - + this:SetDamageType(index) return this end @@ -169,7 +169,7 @@ end e2function effect effect:setAttachment(number index) if not this then return end - + this:SetAttachment(index) return this end @@ -179,12 +179,10 @@ e2function void effect:play(string name) if not isAllowed(self) then return end if effect_blacklist[name] then return end if hook.Run( "Expression2_CanEffect", name:lower(), self ) == false then return end - + util.Effect(name,this) end registerCallback("construct", function(self) self.data.effect_burst = wire_expression2_effect_burst_max:GetInt() end) - - diff --git a/lua/entities/gmod_wire_expression2/core/custom/remoteupload.lua b/lua/entities/gmod_wire_expression2/core/custom/remoteupload.lua index be7a36a1..51508a12 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/remoteupload.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/remoteupload.lua @@ -30,7 +30,7 @@ e2function void entity:remoteSetCode( string code ) if not this or not this:IsValid() or this:GetClass() ~= "gmod_wire_expression2" then return end if E2Lib.getOwner( self,this ) ~= self.player then return end if not check(self.player) then return end - + timer.Simple( 0, function() this:Setup( code, {}, nil, nil, "remoteSetCode" ) end ) @@ -42,7 +42,7 @@ e2function void entity:remoteSetCode( string main, table includes ) if not check(self.player) then return end local luatable = {} - + for k,v in pairs( includes.s ) do self.prf = self.prf + 0.3 if includes.stypes[k] == "s" then @@ -51,7 +51,7 @@ e2function void entity:remoteSetCode( string main, table includes ) error( "Non-string value given to remoteSetCode", 2 ) end end - + timer.Simple( 0, function() this:Setup( main, luatable, nil, nil, "remoteSetCode" ) end ) @@ -68,15 +68,15 @@ e2function table getCodeIncludes() local _, includes = self.entity:GetCode() local e2table = {n={},ntypes={},s={},stypes={},size=0} local size = 0 - + for k,v in pairs( includes ) do size = size + 1 e2table.s[k] = v e2table.stypes[k] = "s" end - + self.prf = self.prf + size * 0.3 e2table.size = size - + return e2table end diff --git a/lua/entities/gmod_wire_expression2/core/custom/wiring.lua b/lua/entities/gmod_wire_expression2/core/custom/wiring.lua index 0dea07b8..7a5ed850 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/wiring.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/wiring.lua @@ -3,7 +3,7 @@ E2Lib.RegisterExtension("wiring", false, "Allows the creation and deletion of wi __e2setcost(30) ---- Creates an invisible wire between the input of and the output of +--- Creates an invisible wire between the input of and the output of e2function number entity:createWire(entity ent2, string inputname, string outputname) if not IsValid(this) or not IsValid(ent2) then return 0 end if not isOwner(self, this) or not isOwner(self, ent2) then return 0 end @@ -15,13 +15,13 @@ e2function number entity:createWire(entity ent2, string inputname, string output local CheckInput = this.Inputs[inputname] if CheckInput.SrcId == outputname and CheckInput.Src == ent2 then return 0 end -- Already wired end - + local trigger = self.entity.trigger self.entity.trigger = { false, {} } -- So the wire creation doesn't execute the E2 immediately because an input changed WireLib.Link_Start(self.player:UniqueID(), this, this:WorldToLocal(this:GetPos()), inputname, "cable/rope", Vector(255,255,255), 0) WireLib.Link_End(self.player:UniqueID(), ent2, ent2:WorldToLocal(ent2:GetPos()), outputname, self.player) self.entity.trigger = trigger - + return 1 end @@ -38,7 +38,7 @@ e2function number entity:createWire(entity ent2, string inputname, string output local CheckInput = this.Inputs[inputname] if CheckInput.SrcId == outputname and CheckInput.Src == ent2 then return 0 end -- Already wired end - + if(!table.HasValue(ValidWireMat,mat)) then if(table.HasValue(ValidWireMat,"cable/"..mat)) then mat = "cable/"..mat @@ -48,13 +48,13 @@ e2function number entity:createWire(entity ent2, string inputname, string output return 0 end end - + local trigger = self.entity.trigger self.entity.trigger = { false, {} } -- So the wire creation doesn't execute the E2 immediately because an input changed WireLib.Link_Start(self.player:UniqueID(), this, this:WorldToLocal(this:GetPos()), inputname, mat, Vector(color[1],color[2],color[3]), width or 1) WireLib.Link_End(self.player:UniqueID(), ent2, ent2:WorldToLocal(ent2:GetPos()), outputname, self.player) self.entity.trigger = trigger - + return 1 end diff --git a/lua/entities/gmod_wire_expression2/core/datasignal.lua b/lua/entities/gmod_wire_expression2/core/datasignal.lua index e7b43dbf..e5070537 100644 --- a/lua/entities/gmod_wire_expression2/core/datasignal.lua +++ b/lua/entities/gmod_wire_expression2/core/datasignal.lua @@ -70,7 +70,7 @@ local function IsAllowed( froment, toent, fromscope, signaltype ) isFriend( toent.player, froment.player ) end end - + return false -- Any other outcome is false end diff --git a/lua/entities/gmod_wire_expression2/core/debug.lua b/lua/entities/gmod_wire_expression2/core/debug.lua index eae4e989..9c8752fa 100644 --- a/lua/entities/gmod_wire_expression2/core/debug.lua +++ b/lua/entities/gmod_wire_expression2/core/debug.lua @@ -21,11 +21,11 @@ hook.Add( "Think", "e2_printcolor_delays", function() for ply, delays in pairs( print_delays ) do if IsValid( ply ) then local print_max = ply:GetInfoNum( "wire_expression2_print_max", print_max ) - + if CurTime() > delays.next_time and delays.count < print_max then local print_delay = ply:GetInfoNum( "wire_expression2_print_delay", print_delay ) delays.next_time = CurTime() + print_delay - + delays.count = delays.count + 1 elseif delays.count > print_max then delays.count = print_max @@ -236,7 +236,7 @@ end e2function void printTable(array arr) if not checkOwner(self) then return end if not check_delay( self.player ) then return end - + for _,line in ipairs(string.Explode("\n",PrintTableToString(arr))) do self.player:ChatPrint(line) end diff --git a/lua/entities/gmod_wire_expression2/core/e2doc.lua b/lua/entities/gmod_wire_expression2/core/e2doc.lua index e8ef2d91..6c4b8b37 100644 --- a/lua/entities/gmod_wire_expression2/core/e2doc.lua +++ b/lua/entities/gmod_wire_expression2/core/e2doc.lua @@ -148,4 +148,4 @@ elseif CLIENT then end return ret end) -end \ No newline at end of file +end diff --git a/lua/entities/gmod_wire_expression2/core/e2lib.lua b/lua/entities/gmod_wire_expression2/core/e2lib.lua index e9063768..71d37f78 100644 --- a/lua/entities/gmod_wire_expression2/core/e2lib.lua +++ b/lua/entities/gmod_wire_expression2/core/e2lib.lua @@ -459,7 +459,7 @@ end do -- Shared stuff, defined later. - + local extensions = nil local function printExtensions() end local function conCommandSetExtensionStatus() end @@ -476,9 +476,9 @@ do function E2Lib.GetExtensionDocumentation(name) return extensions.documentation[name] or {} end - + if SERVER then -- serverside stuff - + util.AddNetworkString( "wire_expression2_server_send_extensions_list" ) util.AddNetworkString( "wire_expression2_client_request_print_extensions" ) util.AddNetworkString( "wire_expression2_client_request_set_extension_status" ) @@ -513,7 +513,7 @@ do -- thus making its functions not available in the E2 Editor (see function e2_include_pass2 in extloader.lua). assert( extensions.status[ name ], "EXTENSION_DISABLED" ) end - + function E2Lib.SetExtensionStatus( name, status ) name = name:Trim():lower() status = tobool( status ) @@ -522,7 +522,7 @@ do sql.Query( "REPLACE INTO wire_expression2_extensions ( name, enabled ) VALUES ( " .. sql.SQLStr( name ) .. ", " .. ( status and 1 or 0 ) .. " )" ) end end - + -- After using E2Lib.SetExtensionStatus in an external script, this function should be called. -- Its purpose is to update the clientside autocomplete list for the concommands. function E2Lib.UpdateClientsideExtensionsList( ply ) @@ -534,12 +534,12 @@ do net.Broadcast() end end - + local function buildPrettyList() local function padLeft( str, len ) return (" "):rep( len - #str ) .. str end local function padRight( str, len ) return str .. (" "):rep( len - #str ) end local function padCenter( str, len ) return padRight( padLeft( str, math.floor( (len + #str) / 2 ) ), len ) end - + local list, column1, column2, columnsWidth = extensions.list, {}, {}, 0 for i = 1, #list do local name = list[ i ] @@ -552,7 +552,7 @@ do columnsWidth = maxWidth / 2 maxWidth = maxWidth + 3 local delimiter = " +-" .. ("-"):rep( columnsWidth ) .. "-+-" .. ("-"):rep( columnsWidth ) .. "-+" - + list = { " +-" .. ("-"):rep( maxWidth ) .. "-+", @@ -563,10 +563,10 @@ do } for i = 1, maxRows do list[ #list + 1 ] = " | " .. padRight( column1[ i ] or "", columnsWidth ) .. " | " .. padRight( column2[ i ] or "", columnsWidth ) .. " |" end list[ #list + 1 ] = delimiter - + extensions.prettyList = list end - + function printExtensions( ply, str ) if IsValid( ply ) then if str then ply:PrintMessage( 2, str ) end @@ -576,7 +576,7 @@ do for i = 1, #extensions.prettyList do print( extensions.prettyList[ i ] ) end end end - + function conCommandSetExtensionStatus( ply, cmd, args ) if IsValid( ply ) and not ply:IsSuperAdmin() and not game.SinglePlayer() then ply:PrintMessage( 2, "Sorry " .. ply:Name() .. ", you don't have access to this command." ) @@ -603,21 +603,21 @@ do else printExtensions( ply, "Unknown extension '" .. name .. "'. Here is a list of available extensions:" ) end else printExtensions( ply, "Usage: '" .. cmd .. " '. Here is a list of available extensions:" ) end end - + net.Receive( "wire_expression2_client_request_print_extensions", function( _, ply ) printExtensions( ply ) end ) - + net.Receive( "wire_expression2_client_request_set_extension_status", function( _, ply ) conCommandSetExtensionStatus( ply, net.ReadString(), net.ReadTable() ) end ) - + hook.Add( "PlayerInitialSpawn", "wire_expression2_updateClientsideExtensions", E2Lib.UpdateClientsideExtensionsList ) - + function wire_expression2_PostLoadExtensions() table.sort( extensions.list, function( a, b ) return a < b end ) E2Lib.UpdateClientsideExtensionsList() @@ -627,16 +627,16 @@ do end hook.Run( "Expression2_PostLoadExtensions" ) end - + else -- clientside stuff extensions = { status = {}, list = {} } - + function printExtensions() net.Start( "wire_expression2_client_request_print_extensions" ) net.SendToServer() end - + function conCommandSetExtensionStatus( _, cmd, args ) net.Start( "wire_expression2_client_request_set_extension_status" ) net.WriteString( cmd ) @@ -647,11 +647,11 @@ do net.Receive( "wire_expression2_server_send_extensions_list", function() extensions = net.ReadTable() end) - + end -- shared stuff - + local function makeAutoCompleteList( cmd, args ) args = args:Trim():lower() local status, list, tbl, j = tobool( cmd:find( "enable" ) ), extensions.list, {}, 1 @@ -675,25 +675,25 @@ end do if SERVER then - + util.AddNetworkString( "wire_expression2_client_request_reload" ) net.Receive( "wire_expression2_client_request_reload", function( n, ply ) wire_expression2_reload( ply ) end ) - + else - + local function wire_expression2_reload() net.Start( "wire_expression2_client_request_reload" ) net.SendToServer() end - + concommand.Add( "wire_expression2_reload", wire_expression2_reload ) - + end - + end -- ------------------------------ compatibility -------------------------------- diff --git a/lua/entities/gmod_wire_expression2/core/extloader.lua b/lua/entities/gmod_wire_expression2/core/extloader.lua index bb2941ac..11cccc98 100644 --- a/lua/entities/gmod_wire_expression2/core/extloader.lua +++ b/lua/entities/gmod_wire_expression2/core/extloader.lua @@ -14,14 +14,14 @@ if ENT then ply:PrintMessage( 2, "Sorry " .. ply:Name() .. ", you don't have access to this command." ) return end - + local function _Msg( str ) if IsValid( ply ) then ply:PrintMessage( 2, str ) end if not game.SinglePlayer() then MsgN( str ) end end - + timer.Destroy( "E2_AutoReloadTimer" ) - + _Msg( "Calling destructors for all Expression 2 chips." ) local chips = ents.FindByClass( "gmod_wire_expression2" ) for _, chip in ipairs( chips ) do @@ -30,7 +30,7 @@ if ENT then end chip.script = nil end - + _Msg( "Reloading Expression 2 extensions." ) ENT = wire_expression2_ENT wire_expression2_is_reload = true @@ -48,12 +48,12 @@ if ENT then for _, chip in ipairs( chips ) do pcall( chip.OnRestore, chip ) end - + _Msg( "Done reloading Expression 2 extensions." ) end concommand.Add( "wire_expression2_reload", wire_expression2_reload ) - + end wire_expression2_reset_extensions() @@ -89,14 +89,14 @@ local function e2_include_pass2(name, luaname, contents) -- e2_extpp_pass2 returned false => file didn't need preprocessing => use the regular means of inclusion return include(name) end - + -- file needed preprocessing => Run the processed file local ok, func = pcall(CompileString,ret,luaname) if not ok then -- an error occurred while compiling error(func) return end - + local ok, err = pcall(func) if not ok then -- an error occured while executing if not err:find( "EXTENSION_DISABLED" ) then @@ -104,7 +104,7 @@ local function e2_include_pass2(name, luaname, contents) end return end - + __e2setcost(nil) -- Reset ops cost at the end of each file end diff --git a/lua/entities/gmod_wire_expression2/core/files.lua b/lua/entities/gmod_wire_expression2/core/files.lua index 1339c716..329ed071 100644 --- a/lua/entities/gmod_wire_expression2/core/files.lua +++ b/lua/entities/gmod_wire_expression2/core/files.lua @@ -341,7 +341,7 @@ util.AddNetworkString("wire_expression2_file_begin") net.Receive("wire_expression2_file_begin", function(netlen, ply) local pfile = uploads[ply] if !pfile then return end - + local len = net.ReadUInt(32) if len == 0 then -- file not found @@ -415,7 +415,7 @@ concommand.Add("wire_expression2_file_singleplayer", function(ply, cmd, args) if not ply:IsListenServerHost() then ply:Kick("Do not use wire_expression2_file_singleplayer in multiplayer, unless you're the host!") end local pfile = uploads[ply] if !pfile then return end - + local path = args[1] if not file.Exists(path, "DATA") then pfile.sp_wait = false diff --git a/lua/entities/gmod_wire_expression2/core/find.lua b/lua/entities/gmod_wire_expression2/core/find.lua index 63bac841..064e50f4 100644 --- a/lua/entities/gmod_wire_expression2/core/find.lua +++ b/lua/entities/gmod_wire_expression2/core/find.lua @@ -809,7 +809,7 @@ e2function number findSortByDistance(vector position) position = Vector(position[1], position[2], position[3]) local findlist = self.data.findlist self.prf = self.prf + #findlist * 12 - + local d = {} for i=1, #findlist do local v = findlist[i] @@ -829,7 +829,7 @@ __e2setcost(5) local function applyClip(self, filter) local findlist = self.data.findlist self.prf = self.prf + #findlist * 5 - + filterList(findlist, filter) return #findlist diff --git a/lua/entities/gmod_wire_expression2/core/gametick.lua b/lua/entities/gmod_wire_expression2/core/gametick.lua index 8902f92c..394a99fb 100644 --- a/lua/entities/gmod_wire_expression2/core/gametick.lua +++ b/lua/entities/gmod_wire_expression2/core/gametick.lua @@ -31,7 +31,7 @@ local function Expression2TickClock() -- this additional step is needed because we cant modify registered_chips while it is being iterated. local i = 1 for entity,_ in pairs(registered_chips) do - if entity:IsValid() then + if entity:IsValid() then ents[i] = entity i = i + 1 end diff --git a/lua/entities/gmod_wire_expression2/core/globalvars.lua b/lua/entities/gmod_wire_expression2/core/globalvars.lua index 301df99a..7e9f05f7 100644 --- a/lua/entities/gmod_wire_expression2/core/globalvars.lua +++ b/lua/entities/gmod_wire_expression2/core/globalvars.lua @@ -261,7 +261,7 @@ registerCallback("postinit",function() self:PopScope() end - end + end end) end -- allowed check diff --git a/lua/entities/gmod_wire_expression2/core/hologram.lua b/lua/entities/gmod_wire_expression2/core/hologram.lua index 96cea36e..823f37b6 100644 --- a/lua/entities/gmod_wire_expression2/core/hologram.lua +++ b/lua/entities/gmod_wire_expression2/core/hologram.lua @@ -152,7 +152,7 @@ local function GetModel(self, model, skin) -- If this model isn't already the absolute path of a default model, and only default models are allowed elseif not pathLookup[model] and wire_holograms_modelany:GetInt() == 0 then - return false + return false end if wire_holograms_modelany:GetInt() ~= 2 and not WireLib.CanModel(self.player, model, skin) then @@ -818,7 +818,7 @@ e2function vector holoBoneScale(index, boneindex) if table.Count(Holo.bone_scale) <= 0 then return {0,0,0} end for bidx,b_scale in pairs(Holo.bone_scale) do - if bidx == boneindex then return b_scale end + if bidx == boneindex then return b_scale end end return {0,0,0} diff --git a/lua/entities/gmod_wire_expression2/core/player.lua b/lua/entities/gmod_wire_expression2/core/player.lua index 42cca79b..68a5fa13 100644 --- a/lua/entities/gmod_wire_expression2/core/player.lua +++ b/lua/entities/gmod_wire_expression2/core/player.lua @@ -239,11 +239,11 @@ e2function number entity:keyPressed(string char) if this.keystate then local key = _G["KEY_" .. string.upper(char)] or "no_key" if this.keystate[key] then return 1 end - + key = _G[string.match(string.upper(char),"^(MOUSE_.+)$") or ""] or "no_key" if this.keystate[key] then return 1 end end - + return 0 end diff --git a/lua/entities/gmod_wire_expression2/core/quaternion.lua b/lua/entities/gmod_wire_expression2/core/quaternion.lua index 38046fbf..18cf9087 100644 --- a/lua/entities/gmod_wire_expression2/core/quaternion.lua +++ b/lua/entities/gmod_wire_expression2/core/quaternion.lua @@ -548,7 +548,7 @@ end e2function quaternion lerp(quaternion q0, quaternion q1, number t, number reduceTo360) local t1 = 1 - t local dot = q0[1]*q1[1] + q0[2]*q1[2] + q0[3]*q1[3] + q0[4]*q1[4] - + if reduceTo360 and dot < 0 then return ( qmul(q0, t1) + qmul(q1, -t) ) else diff --git a/lua/entities/gmod_wire_expression2/core/ranger.lua b/lua/entities/gmod_wire_expression2/core/ranger.lua index 11dec063..17f85c68 100644 --- a/lua/entities/gmod_wire_expression2/core/ranger.lua +++ b/lua/entities/gmod_wire_expression2/core/ranger.lua @@ -97,7 +97,7 @@ local function ranger(self, rangertype, range, p1, p2, hulltype, mins, maxs, tra tracedata.endpos = tracedata.start + chip:GetUp()*range end end - + -- clamp positions tracedata.start = E2Lib.clampPos( tracedata.start ) if tracedata.start:Distance( tracedata.endpos ) > 57000 then -- 57000 is slightly larger than the diagonal distance (min corner to max corner) of the source max map size @@ -119,7 +119,7 @@ local function ranger(self, rangertype, range, p1, p2, hulltype, mins, maxs, tra tracedata.mins = s1 tracedata.maxs = s2 end - + if not entities then -- unfortunately we have to add tons of ops if this happens -- If we didn't, it would be possible to crash servers with it. tracedata.mins = E2Lib.clampPos( tracedata.mins ) diff --git a/lua/entities/gmod_wire_expression2/core/sound.lua b/lua/entities/gmod_wire_expression2/core/sound.lua index 9b26dfe0..10135044 100644 --- a/lua/entities/gmod_wire_expression2/core/sound.lua +++ b/lua/entities/gmod_wire_expression2/core/sound.lua @@ -16,11 +16,11 @@ local function isAllowed( self ) local data = self.data.sound_data local count = data.count if count == wire_expression2_maxsounds:GetInt() then return false end - + if data.burst == 0 then return false end - + data.burst = data.burst - 1 - + local timerid = "E2_sound_burst_count_" .. self.entity:EntIndex() if not timer.Exists( timerid ) then timer.Create( timerid, wire_expression2_sound_burst_rate:GetFloat(), 0, function() @@ -28,14 +28,14 @@ local function isAllowed( self ) timer.Remove( timerid ) return end - + data.burst = data.burst + 1 if data.burst == wire_expression2_sound_burst_max:GetInt() then timer.Remove( timerid ) end end) end - + return true end @@ -47,22 +47,22 @@ end local function soundStop(self, index, fade) local sound = getSound( self, index ) if not sound then return end - + fade = math.abs( fade ) - + if fade == 0 then sound:Stop() - + if isnumber( index ) then index = math.floor( index ) end self.data.sound_data.sounds[index] = nil - + self.data.sound_data.count = self.data.sound_data.count - 1 else sound:FadeOut( fade ) - + timer.Simple( fade, function() soundStop( self, index, 0 ) end) end - + timer.Remove( "E2_sound_stop_" .. self.entity:EntIndex() .. "_" .. index ) end @@ -70,13 +70,13 @@ local function soundCreate(self, entity, index, time, path, fade) if path:match('["?]') then return end local data = self.data.sound_data if not isAllowed( self ) then return end - + path = path:Trim() path = path:gsub( "\\", "/" ) if isnumber( index ) then index = math.floor( index ) end - + local timerid = "E2_sound_stop_" .. self.entity:EntIndex() .. "_" .. index - + local sound = getSound( self, index ) if sound then sound:Stop() @@ -84,21 +84,21 @@ local function soundCreate(self, entity, index, time, path, fade) else data.count = data.count + 1 end - + local sound = CreateSound( entity, path ) data.sounds[index] = sound sound:Play() - + entity:CallOnRemove( "E2_stopsound", function() soundStop( self, index, 0 ) end ) - + if time == 0 and fade == 0 then return end time = math.abs( time ) - + timer.Create( timerid, time, 1, function() if not self or not IsValid( self.entity ) or not IsValid( entity ) then return end - + soundStop( self, index, fade ) end) end @@ -111,7 +111,7 @@ local function soundPurge( self ) timer.Remove( "E2_sound_stop_" .. self.entity:EntIndex() .. "_" .. k ) end end - + sound_data.sounds = {} sound_data.count = 0 end @@ -162,29 +162,29 @@ end e2function void soundVolume( index, volume ) local sound = getSound( self, index ) if not sound then return end - + sound:ChangeVolume( math.Clamp( volume, 0, 1 ), 0 ) end e2function void soundVolume( index, volume, fadetime ) local sound = getSound( self, index ) if not sound then return end - + sound:ChangeVolume( math.Clamp( volume, 0, 1 ), math.abs( fadetime ) ) end - + e2function void soundPitch( index, pitch ) local sound = getSound( self, index ) if not sound then return end - + sound:ChangePitch( math.Clamp( pitch, 0, 255 ), 0 ) end e2function void soundPitch( index, pitch, fadetime ) local sound = getSound( self, index ) if not sound then return end - + sound:ChangePitch( math.Clamp( pitch, 0, 255 ), math.abs( fadetime ) ) end diff --git a/lua/entities/gmod_wire_expression2/core/strfunc.lua b/lua/entities/gmod_wire_expression2/core/strfunc.lua index cea6930c..232c0e72 100644 --- a/lua/entities/gmod_wire_expression2/core/strfunc.lua +++ b/lua/entities/gmod_wire_expression2/core/strfunc.lua @@ -18,9 +18,9 @@ local insert = table.insert local concat = table.concat local function findFunc( self, funcname, typeids, typeids_str ) local func, func_return_type, vararg - + self.prf = self.prf + 40 - + local str = funcname .. "(" .. typeids_str .. ")" for i=1,#self.strfunc_cache do local t = self.strfunc_cache[i] @@ -28,36 +28,36 @@ local function findFunc( self, funcname, typeids, typeids_str ) return t[2], t[3], t[4] end end - + self.prf = self.prf + 40 - + if #typeids > 0 then if not func then func, func_return_type = checkFuncName( self, str ) end - + if not func then func, func_return_type = checkFuncName( self, funcname .. "(" .. typeids[1] .. ":" .. concat(typeids,"",2) .. ")" ) end - + if not func then for i=#typeids,1,-1 do func, func_return_type = checkFuncName( self, funcname .. "(" .. concat(typeids,"",1,i) .. "...)" ) if func then vararg = true break end end - + if not func then func, func_return_type = checkFuncName( self, funcname .. "(...)" ) if func then vararg = true end end end - + if not func then for i=#typeids,2,-1 do func, func_return_type = checkFuncName( self, funcname .. "(" .. typeids[1] .. ":" .. concat(typeids,"",2,i) .. "...)" ) if func then vararg = true break end end - + if not func then func, func_return_type = checkFuncName( self, funcname .. "(" .. typeids[1] .. ":...)" ) if func then vararg = true end @@ -66,13 +66,13 @@ local function findFunc( self, funcname, typeids, typeids_str ) else func, func_return_type = checkFuncName( self, funcname .. "()" ) end - + if func then local t = { str, func, func_return_type, vararg } insert( self.strfunc_cache, 1, t ) if #self.strfunc_cache == 21 then self.strfunc_cache[21] = nil end end - + return func, func_return_type, vararg end @@ -83,17 +83,17 @@ registerOperator( "sfun", "", "", function(self, args) local funcname = op1[1](self,op1) local func, func_return_type, vararg = findFunc( self, funcname, typeids, typeids_str ) - + if not func then error( "No such function: " .. funcname .. "(" .. tps_pretty( typeids_str ) .. ")", 0 ) end - + if returntype ~= "" and func_return_type ~= returntype then error( "Mismatching return types. Got " .. nicename(wire_expression_types2[returntype][1]) .. ", expected " .. nicename(wire_expression_types2[func_return_type][1] ), 0 ) end - + self.prf = self.prf + 40 - + if vararg then funcargs[#funcargs+1] = typeids end -- if this is a vararg func, we need to send the typeids as well - + if returntype ~= "" then local ret = func( self, funcargs ) if vararg then funcargs[#funcargs] = nil end -- clean up diff --git a/lua/entities/gmod_wire_expression2/core/string.lua b/lua/entities/gmod_wire_expression2/core/string.lua index 7124386c..37c313b3 100644 --- a/lua/entities/gmod_wire_expression2/core/string.lua +++ b/lua/entities/gmod_wire_expression2/core/string.lua @@ -109,8 +109,8 @@ __e2setcost(20) -- temporary e2function number string:toNumber() local ret = tonumber(this) - if ret == nil then return 0 end - return ret + if ret == nil then return 0 end + return ret end e2function number string:toNumber(number base) @@ -152,7 +152,7 @@ local math_floor = math.floor registerFunction("toUnicodeChar", "n", "s", function(self, args) local op1 = args[2] local rv1 = op1[1](self, op1) - + -- upper limit used to be 2097152, new limit acquired using pcall and a for loop -- above this limit, the function causes a lua error if rv1 < 1 or rv1 > 1114112 then return "" end diff --git a/lua/entities/gmod_wire_expression2/core/timer.lua b/lua/entities/gmod_wire_expression2/core/timer.lua index 5259ce26..9c4cc6cd 100644 --- a/lua/entities/gmod_wire_expression2/core/timer.lua +++ b/lua/entities/gmod_wire_expression2/core/timer.lua @@ -130,9 +130,9 @@ end local function luaDateToE2Table( time, utc ) local ret = {n={},ntypes={},s={},stypes={},size=0} local time = os.date((utc and "!" or "") .. "*t",time) - + if not time then return ret end -- this happens if you give it a negative time - + for k,v in pairs( time ) do if k == "isdst" then ret.s.isdst = (v and 1 or 0) @@ -141,10 +141,10 @@ local function luaDateToE2Table( time, utc ) ret.s[k] = v ret.stypes[k] = "n" end - + ret.size = ret.size + 1 end - + return ret end __e2setcost(10) @@ -192,16 +192,16 @@ end local validkeys = {hour = true, min = true, day = true, sec = true, yday = true, wday = true, month = true, year = true, isdst = true} e2function number time(table data) local args = {} - + for k,v in pairs( data.s ) do if data.stypes[k] ~= "n" or not validkeys[k] then continue end - + if k == "isdst" then args.isdst = (v == 1) else args[k] = v end end - + return os.time( args ) end diff --git a/lua/entities/gmod_wire_expression2/core/vector.lua b/lua/entities/gmod_wire_expression2/core/vector.lua index e65f3260..3e3d9dc1 100644 --- a/lua/entities/gmod_wire_expression2/core/vector.lua +++ b/lua/entities/gmod_wire_expression2/core/vector.lua @@ -391,8 +391,8 @@ __e2setcost(6) e2function vector round(vector rv1) return { - floor(rv1[1] + 0.5), - floor(rv1[2] + 0.5), + floor(rv1[1] + 0.5), + floor(rv1[2] + 0.5), floor(rv1[3] + 0.5) } end @@ -400,16 +400,16 @@ end e2function vector round(vector rv1, decimals) local shf = 10 ^ decimals return { - floor(rv1[1] * shf + 0.5) / shf, - floor(rv1[2] * shf + 0.5) / shf, + floor(rv1[1] * shf + 0.5) / shf, + floor(rv1[2] * shf + 0.5) / shf, floor(rv1[3] * shf + 0.5) / shf } end e2function vector ceil( vector rv1 ) return { - ceil(rv1[1]), - ceil(rv1[2]), + ceil(rv1[1]), + ceil(rv1[2]), ceil(rv1[3]) } end @@ -417,16 +417,16 @@ end e2function vector ceil(vector rv1, decimals) local shf = 10 ^ decimals return { - ceil(rv1[1] * shf) / shf, - ceil(rv1[2] * shf) / shf, + ceil(rv1[1] * shf) / shf, + ceil(rv1[2] * shf) / shf, ceil(rv1[3] * shf) / shf } end e2function vector floor(vector rv1) return { - floor(rv1[1]), - floor(rv1[2]), + floor(rv1[1]), + floor(rv1[2]), floor(rv1[3]) } end @@ -434,8 +434,8 @@ end e2function vector floor(vector rv1, decimals) local shf = 10 ^ decimals return { - floor(rv1[1] * shf) / shf, - floor(rv1[2] * shf) / shf, + floor(rv1[1] * shf) / shf, + floor(rv1[2] * shf) / shf, floor(rv1[3] * shf) / shf } end diff --git a/lua/entities/gmod_wire_expression2/core/vector2.lua b/lua/entities/gmod_wire_expression2/core/vector2.lua index 65adf661..4c439768 100644 --- a/lua/entities/gmod_wire_expression2/core/vector2.lua +++ b/lua/entities/gmod_wire_expression2/core/vector2.lua @@ -311,7 +311,7 @@ __e2setcost(4) e2function vector2 round(vector2 rv1) return { - floor(rv1[1] + 0.5), + floor(rv1[1] + 0.5), floor(rv1[2] + 0.5) } end @@ -319,14 +319,14 @@ end e2function vector2 round(vector2 rv1, decimals) local shf = 10 ^ decimals return { - floor(rv1[1] * shf + 0.5) / shf, + floor(rv1[1] * shf + 0.5) / shf, floor(rv1[2] * shf + 0.5) / shf } end e2function vector2 ceil( vector2 rv1 ) return { - ceil(rv1[1]), + ceil(rv1[1]), ceil(rv1[2]) } end @@ -334,14 +334,14 @@ end e2function vector2 ceil(vector2 rv1, decimals) local shf = 10 ^ decimals return { - ceil(rv1[1] * shf) / shf, + ceil(rv1[1] * shf) / shf, ceil(rv1[2] * shf) / shf } end e2function vector2 floor(vector2 rv1) return { - floor(rv1[1]), + floor(rv1[1]), floor(rv1[2]) } end @@ -349,7 +349,7 @@ end e2function vector2 floor(vector2 rv1, decimals) local shf = 10 ^ decimals return { - floor(rv1[1] * shf) / shf, + floor(rv1[1] * shf) / shf, floor(rv1[2] * shf) / shf } end @@ -864,9 +864,9 @@ end e2function vector4 round(vector4 rv1, decimals) local shf = 10 ^ decimals return { - floor(rv1[1] * shf + 0.5) / shf, + floor(rv1[1] * shf + 0.5) / shf, floor(rv1[2] * shf + 0.5) / shf, - floor(rv1[3] * shf + 0.5) / shf, + floor(rv1[3] * shf + 0.5) / shf, floor(rv1[4] * shf + 0.5) / shf } end diff --git a/lua/entities/gmod_wire_expression2/init.lua b/lua/entities/gmod_wire_expression2/init.lua index 25ae1c61..168e439e 100644 --- a/lua/entities/gmod_wire_expression2/init.lua +++ b/lua/entities/gmod_wire_expression2/init.lua @@ -94,7 +94,7 @@ function ENT:UpdateOverlay(clear) prfcount = self.context.prfcount, timebench = self.context.timebench }) - end + end end function ENT:Initialize() @@ -344,11 +344,11 @@ function ENT:ResetContext() self.Inputs = WireLib.AdjustSpecialInputs(self, self.inports[1], self.inports[2]) self.Outputs = WireLib.AdjustSpecialOutputs(self, self.outports[1], self.outports[2]) - + if self.extended then -- It was extended before the adjustment, recreate the wirelink WireLib.CreateWirelinkOutput( self.player, self, {true} ) end - + self._original = string.Replace(string.Replace(self.original, "\"", string.char(163)), "\n", string.char(128)) self._name = self.name @@ -570,7 +570,7 @@ function MakeWireExpression2(player, Pos, Ang, model, buffer, name, inputs, outp local self = ents.Create("gmod_wire_expression2") if not self:IsValid() then return false end - + if buffer then self.duped = true end self:SetModel(model) @@ -585,21 +585,21 @@ function MakeWireExpression2(player, Pos, Ang, model, buffer, name, inputs, outp buffer = string.Replace(string.Replace(buffer, string.char(163), "\""), string.char(128), "\n") self.buffer = buffer self:SetOverlayText(name) - + self.inc_files = inc_files or {} self.Inputs = WireLib.AdjustSpecialInputs(self, inputs[1], inputs[2]) self.Outputs = WireLib.AdjustSpecialOutputs(self, outputs[1], outputs[2]) self.dupevars = vars - + self.filepath = filepath else self.buffer = "error(\"You tried to dupe an E2 with compile errors!\")\n#Unfortunately, no code can be saved when duping an E2 with compile errors.\n#Fix your errors and try again." - + self.inc_files = {} self.dupevars = {} - + self.name = "generic" end @@ -615,16 +615,16 @@ duplicator.RegisterEntityClass("gmod_wire_expression2", MakeWireExpression2, "Po -- Emergency shutdown (beta testing so far) -------------------------------------------------- local average_ram = 0 -local enable = CreateConVar( - "wire_expression2_ram_emergency_shutdown_enable", "0", {FCVAR_ARCHIVE}, +local enable = CreateConVar( + "wire_expression2_ram_emergency_shutdown_enable", "0", {FCVAR_ARCHIVE}, "Enable/disable the emergency shutdown feature." ) -local average_halt_multiplier = CreateConVar( - "wire_expression2_ram_emergency_shutdown_spike", "4", {FCVAR_ARCHIVE}, +local average_halt_multiplier = CreateConVar( + "wire_expression2_ram_emergency_shutdown_spike", "4", {FCVAR_ARCHIVE}, "if (current_ram > average_ram * spike_convar) then shut down all E2s" ) -local halt_max_amount = CreateConVar( - "wire_expression2_ram_emergency_shutdown_total", "512", {FCVAR_ARCHIVE}, +local halt_max_amount = CreateConVar( + "wire_expression2_ram_emergency_shutdown_total", "512", {FCVAR_ARCHIVE}, "This is in kilobytes, if (current_ram > total_convar) then shut down all E2s" ) local function enableEmergencyShutdown() @@ -662,4 +662,4 @@ local function enableEmergencyShutdown() end enableEmergencyShutdown() -cvars.AddChangeCallback( "wire_expression2_ram_emergency_shutdown_enable", enableEmergencyShutdown ) \ No newline at end of file +cvars.AddChangeCallback( "wire_expression2_ram_emergency_shutdown_enable", enableEmergencyShutdown ) diff --git a/lua/entities/gmod_wire_eyepod.lua b/lua/entities/gmod_wire_eyepod.lua index 81433993..3a858c3b 100644 --- a/lua/entities/gmod_wire_eyepod.lua +++ b/lua/entities/gmod_wire_eyepod.lua @@ -4,7 +4,7 @@ ENT.PrintName = "Wire Eye Pod" ENT.Purpose = "To control the player's view in a pod and output their mouse movements" ENT.WireDebugName = "Eye Pod" -if CLIENT then +if CLIENT then local enabled = false local rotate90 = false local freezePitch = true @@ -47,7 +47,7 @@ if CLIENT then previousEnabled = false end end) - + return -- No more client end @@ -119,7 +119,7 @@ function ENT:Setup(DefaultToZero, RateOfChange, ClampXMin, ClampXMax, ClampYMin, self.ClampYMax = ClampYMax self.ClampX = ClampX self.ClampY = ClampY - + self:UpdateOverlay() end @@ -251,15 +251,15 @@ function ENT:TriggerInput(iname, value) -- Change variables to reflect input if iname == "Enable" then self.enabled = value ~= 0 - + if self.enabled == false and self.DefaultToZero == 1 and (self.X ~= 0 or self.Y ~= 0) then self.X = 0 self.Y = 0 WireLib.TriggerOutput( self, "X", 0 ) WireLib.TriggerOutput( self, "Y", 0 ) WireLib.TriggerOutput( self, "XY", {0,0} ) - end - + end + self:UpdateOverlay() elseif iname == "SetPitch" then self.eyeAng = Angle(AngNorm90(value), self.eyeAng.y, self.eyeAng.r) @@ -280,7 +280,7 @@ function ENT:TriggerInput(iname, value) elseif iname == "UnfreezeYaw" then self.freezeYaw = value == 0 end - + if IsValid(self.pod) and IsValid(self.driver) then self:updateEyePodState(self.enabled) end @@ -303,10 +303,10 @@ hook.Add("SetupMove", "WireEyePodMouseControl", function(ply, movedata) if eyePod.enabled then local cmd = ply:GetCurrentCommand() - + local oldX = eyePod.X local oldY = eyePod.Y - + --reset the output so it is not cumualative if you want the rate of change if eyePod.ShowRateOfChange == 1 then eyePod.X = 0 @@ -329,7 +329,7 @@ hook.Add("SetupMove", "WireEyePodMouseControl", function(ply, movedata) -- Update outputs WireLib.TriggerOutput(eyePod, "X", eyePod.X) WireLib.TriggerOutput(eyePod, "Y", eyePod.Y) - + local XY_Vec = {eyePod.X, eyePod.Y} WireLib.TriggerOutput(eyePod, "XY", XY_Vec) end diff --git a/lua/entities/gmod_wire_freezer.lua b/lua/entities/gmod_wire_freezer.lua index d30fe401..5c06ad7c 100644 --- a/lua/entities/gmod_wire_freezer.lua +++ b/lua/entities/gmod_wire_freezer.lua @@ -70,8 +70,8 @@ local collisionDescriptions = { } function ENT:UpdateOverlay() - self:SetOverlayText( - (self.State and "Frozen" or "Unfrozen") .. "\n" .. + self:SetOverlayText( + (self.State and "Frozen" or "Unfrozen") .. "\n" .. collisionDescriptions[self.CollisionState] .. "\n" .. "Linked Entities: " .. #self.Marks) end diff --git a/lua/entities/gmod_wire_fx_emitter.lua b/lua/entities/gmod_wire_fx_emitter.lua index 9261d0f5..5e346af6 100644 --- a/lua/entities/gmod_wire_fx_emitter.lua +++ b/lua/entities/gmod_wire_fx_emitter.lua @@ -36,7 +36,7 @@ end include( "wire/fx_emitter_default.lua" ) -if CLIENT then +if CLIENT then ENT.Delay = 0.05 function ENT:Draw() @@ -83,7 +83,7 @@ if CLIENT then self.Effects[ Effect ] = nil end end - + return -- No more client end diff --git a/lua/entities/gmod_wire_gate.lua b/lua/entities/gmod_wire_gate.lua index bc507da7..a44df96a 100644 --- a/lua/entities/gmod_wire_gate.lua +++ b/lua/entities/gmod_wire_gate.lua @@ -22,7 +22,7 @@ function ENT:Setup( action, noclip ) if GateActions[action].is_banned then return end self.Updating = true - + self.action = action self.WireDebugName = gate.name diff --git a/lua/entities/gmod_wire_gimbal.lua b/lua/entities/gmod_wire_gimbal.lua index 1872fcac..495a7069 100644 --- a/lua/entities/gmod_wire_gimbal.lua +++ b/lua/entities/gmod_wire_gimbal.lua @@ -10,9 +10,9 @@ function ENT:Initialize() self:SetMoveType( MOVETYPE_VPHYSICS ) self:SetSolid( SOLID_VPHYSICS ) self:GetPhysicsObject():EnableGravity(false) - + self.Inputs = WireLib.CreateInputs(self,{"On", "X", "Y", "Z", "Target [VECTOR]", "Direction [VECTOR]", "Angle [ANGLE]"}) - + self.XYZ = Vector() end @@ -23,7 +23,7 @@ function ENT:TriggerInput(name,value) self.TargetPos = nil self.TargetDir = nil self.TargetAng = nil - + if name == "X" then self.XYZ.x = value self.TargetPos = self.XYZ @@ -46,7 +46,7 @@ function ENT:TriggerInput(name,value) return true end - + function ENT:Think() if self.On then local ang diff --git a/lua/entities/gmod_wire_gps.lua b/lua/entities/gmod_wire_gps.lua index b3d17ad3..026b04f5 100644 --- a/lua/entities/gmod_wire_gps.lua +++ b/lua/entities/gmod_wire_gps.lua @@ -3,7 +3,7 @@ DEFINE_BASECLASS( "base_wire_entity" ) ENT.PrintName = "Wire GPS" ENT.WireDebugName = "GPS" -if CLIENT then +if CLIENT then function ENT:Think() self.BaseClass.Think(self) @@ -16,7 +16,7 @@ if CLIENT then self:NextThink(CurTime()+0.04) return true end - + return -- No more client end diff --git a/lua/entities/gmod_wire_gpu/cl_gpuvm.lua b/lua/entities/gmod_wire_gpu/cl_gpuvm.lua index a34b8fb2..f7db8cda 100644 --- a/lua/entities/gmod_wire_gpu/cl_gpuvm.lua +++ b/lua/entities/gmod_wire_gpu/cl_gpuvm.lua @@ -61,7 +61,7 @@ function ENT:OverrideVM() surface.SetTexture(0) surface.SetDrawColor(0,0,0,120) surface.DrawRect(0,0,self.ScreenWidth,self.ScreenHeight) - + draw.DrawText("Error in the instruction stream","WireGPU_ErrorFont",48,16,Color(255,255,255,255)) draw.DrawText((self.ErrorText[interruptNo] or "Unknown error").." (#"..interruptNo..")","WireGPU_ErrorFont",16,16+32*2,Color(255,255,255,255)) draw.DrawText("Parameter: "..(interruptParameter or 0),"WireGPU_ErrorFont",16,16+32*3,Color(255,255,255,255)) @@ -198,7 +198,7 @@ function VM:SetFont() local name, size = self.FontName[self.Font], self.FontSize if not fontcache[name] or not fontcache[name][size] then if not fontcache[name] then fontcache[name] = {} end - + surface.CreateFont("WireGPU_"..name..size, { font = name, size = size, @@ -208,7 +208,7 @@ function VM:SetFont() }) fontcache[name][size] = true end - + surface.SetFont("WireGPU_"..name..size) end @@ -584,7 +584,7 @@ function VM:HardReset() -- Has initialized already self.INIT = 0 - + -- Reset async thread self.AsyncState = nil end @@ -833,7 +833,7 @@ function VM:ReadString(address) currentChar = self:ReadCell(address + charCount) -- Reading failed if not currentChar then - return + return elseif currentChar > 0 and currentChar < 255 then charString = charString .. string.char(currentChar) elseif currentChar ~= 0 then diff --git a/lua/entities/gmod_wire_gpu/init.lua b/lua/entities/gmod_wire_gpu/init.lua index 1efa0a65..78bd6063 100644 --- a/lua/entities/gmod_wire_gpu/init.lua +++ b/lua/entities/gmod_wire_gpu/init.lua @@ -117,7 +117,7 @@ function ENT:ReadCell(Address) self:Interrupt(15,Address) return end - + if (Address < 0) or (Address >= self.RAMSize) then return nil else diff --git a/lua/entities/gmod_wire_grabber.lua b/lua/entities/gmod_wire_grabber.lua index 9ffa917a..e8f956ce 100644 --- a/lua/entities/gmod_wire_grabber.lua +++ b/lua/entities/gmod_wire_grabber.lua @@ -79,7 +79,7 @@ function ENT:CanGrab(trace) if (not trace.Entity:IsValid() and not trace.Entity:IsWorld()) or trace.Entity:IsPlayer() then return false end -- If there's no physics object then we can't constraint it! if not util.IsValidPhysicsObject(trace.Entity, trace.PhysicsBone) then return false end - + if not gamemode.Call( "CanTool", self:GetPlayer(), trace, "weld" ) then return false end return true diff --git a/lua/entities/gmod_wire_gyroscope.lua b/lua/entities/gmod_wire_gyroscope.lua index 49f9b4f6..0a9a0ed4 100644 --- a/lua/entities/gmod_wire_gyroscope.lua +++ b/lua/entities/gmod_wire_gyroscope.lua @@ -7,7 +7,7 @@ function ENT:SetupDataTables() self:NetworkVar( "Bool", 0, "Out180" ) end -if CLIENT then +if CLIENT then --handle overlay text client side instead (TAD2020) function ENT:Think() self.BaseClass.Think(self) @@ -34,7 +34,7 @@ if CLIENT then function ENT:ShowOutput(p, y, r) self:SetOverlayText(string.format("Angles = %.3f, %.3f, %.3f", p, y, r)) end - + return -- No more client end diff --git a/lua/entities/gmod_wire_hdd.lua b/lua/entities/gmod_wire_hdd.lua index 04c8cce3..81365fd6 100644 --- a/lua/entities/gmod_wire_hdd.lua +++ b/lua/entities/gmod_wire_hdd.lua @@ -54,7 +54,7 @@ function ENT:Setup(DriveID, DriveCap) self.DriveCap = DriveCap self:UpdateCap() self:SetOverlayText(self.DriveCap.."kb".."\nWriteAddr:"..self.AWrite.." Data:"..self.Data.." Clock:"..self.Clk.."\nReadAddr:"..self.ARead.." = ".. self.Out) - Wire_TriggerOutput(self, "DriveID", self.DriveID) + Wire_TriggerOutput(self, "DriveID", self.DriveID) end function ENT:GetStructName(name) @@ -94,8 +94,8 @@ function ENT:GetCap() if (not game.SinglePlayer()) and (self.DriveCap > 256) then self.DriveCap = 256 end - - Wire_TriggerOutput(self, "Capacity", self.DriveCap) + + Wire_TriggerOutput(self, "Capacity", self.DriveCap) end function ENT:UpdateCap() diff --git a/lua/entities/gmod_wire_holoemitter.lua b/lua/entities/gmod_wire_holoemitter.lua index 3e4ab891..4038bb5f 100644 --- a/lua/entities/gmod_wire_holoemitter.lua +++ b/lua/entities/gmod_wire_holoemitter.lua @@ -4,7 +4,7 @@ ENT.PrintName = "Wire Holographic Emitter" ENT.RenderGroup = RENDERGROUP_BOTH ENT.WireDebugName = "Holographic Emitter" -if CLIENT then +if CLIENT then local cvar = CreateClientConVar("cl_wire_holoemitter_maxfadetime",5,true,false) -- "cl_" in the cvar name isn't very neat... probably too late to change it now, though. local keeplatest = CreateClientConVar("wire_holoemitter_keeplatestdot", "0", true, false) @@ -165,7 +165,7 @@ if CLIENT then ) end end - + return -- No more client end @@ -200,7 +200,7 @@ function ENT:Initialize( ) self.Data.LineBeam = false self.Data.GroundBeam = false self.Data.Size = 1 - + self:SetOverlayText( "Holo Emitter" ) end diff --git a/lua/entities/gmod_wire_hologram.lua b/lua/entities/gmod_wire_hologram.lua index dc1147d3..5d82a2db 100644 --- a/lua/entities/gmod_wire_hologram.lua +++ b/lua/entities/gmod_wire_hologram.lua @@ -204,10 +204,10 @@ if CLIENT then -- Some entities, like ragdolls, cannot be resized with EnableMatrix, so lets average the three components to get a float self:SetModelScale((scale.x + scale.y + scale.z) / 3, 0) end - + if table.Count( self.bone_scale ) > 0 then local count = self:GetBoneCount() or -1 - + for i = count, 0, -1 do local bone_scale = self.bone_scale[i] or Vector(1,1,1) self:ManipulateBoneScale(i, bone_scale) // Note: Using ManipulateBoneScale currently causes RenderBounds to be reset every frame! @@ -261,13 +261,13 @@ if CLIENT then else vis_buffer[index] = net.ReadBit() == 0 end - + index = net.ReadUInt(16) end end) -- ----------------------------------------------------------------------------- - + local function SetPlayerColor(entindex, color) local ent = Entity(entindex) -- For reference, here's why this works: @@ -276,20 +276,20 @@ if CLIENT then return color end end - + function ENT:DoPlayerColor() local eidx = self:EntIndex() if player_color_buffer[eidx] ~= nil then SetPlayerColor(eidx, player_color_buffer[eidx]) player_color_buffer[eidx] = nil end - - + + end net.Receive("wire_holograms_set_player_color", function(netlen) local index = net.ReadUInt(16) - + while index ~= 0 do local ent = Entity(index) if IsValid(ent) and ent.DoPlayerColor then @@ -297,11 +297,11 @@ if CLIENT then else player_color_buffer[index] = net.ReadVector() end - + index = net.ReadUInt(16) end end) - + -- ----------------------------------------------------------------------------- concommand.Add("wire_holograms_block_client", diff --git a/lua/entities/gmod_wire_hoverball.lua b/lua/entities/gmod_wire_hoverball.lua index 5425c274..a9728e9c 100644 --- a/lua/entities/gmod_wire_hoverball.lua +++ b/lua/entities/gmod_wire_hoverball.lua @@ -13,31 +13,31 @@ if CLIENT then local drawhoverballs = CreateConVar( "cl_drawhoverballs", "1" ) local glowmat = Material( "sprites/light_glow02_add" ) - + function ENT:DrawTranslucent() - if not drawhoverballs:GetBool() then return end - + if not drawhoverballs:GetBool() then return end + if self:IsOn() then local Pos = self:GetPos() local vDiff = (Pos - LocalPlayer():EyePos()):GetNormalized() - + local color = Color( 70, 180, 255, 255 ) -- Color( 40, 50, 200, 255 ) render.SetMaterial( glowmat ) - + -- Draw central glow render.DrawSprite( Pos - vDiff * 2, 22, 22, color ) - + -- Draw glow based on distance from target local Distance = math.Clamp( math.abs( ( self:GetZTarget() - Pos.z ) * math.sin( RealTime() * 20 ) ) * 0.05, 0, 1 ) color.r = color.r * Distance color.g = color.g * Distance color.b = color.b * Distance - + render.DrawSprite( Pos + vDiff * 4, 48, 48, color ) render.DrawSprite( Pos + vDiff * 4, 52, 52, color ) end end - + return -- No more client end @@ -50,7 +50,7 @@ end function ENT:GetZVelocity() return self.zvelocity end function ENT:SetZVelocity( z ) self.zvelocity = z * FrameTime() * 5000 - + if z ~= 0 then local phys = self:GetPhysicsObject() if IsValid( phys ) then @@ -63,7 +63,7 @@ function ENT:SetSpeed( s ) if not game.SinglePlayer() then s = math.Clamp( s, 0, 10 ) end - + self.speed = s end function ENT:SetOn( h ) self:SetNWBool( "On", h ) end @@ -85,15 +85,15 @@ function ENT:GetStrength() return self.strength end function ENT:Initialize() self:PhysicsInitSphere( 6, "metal_bouncy" ) self:StartMotionController() - + self:SetZVelocity( 0 ) self:SetZTarget( self:GetPos().z ) - + self:SetSpeed( 1 ) self:SetStrength( 1 ) self:SetAirResistance( 1 ) self:SetZTarget( self:GetPos().z ) -- reset target position - + self.Inputs = WireLib.CreateInputs( self, { "On", "ZVelocity", "ZTarget" } ) self.Outputs = WireLib.CreateOutputs( self, { "Position [VECTOR]", "X", "Y", "Z", "Distance" } ) end @@ -110,7 +110,7 @@ function ENT:Setup(speed, resistance, strength, starton) self:SetSpeed( speed ) self:SetStrength( strength ) self:SetAirResistance( resistance ) - + if starton then self:Enable() else self:Disable() end self.starton = starton end @@ -151,13 +151,13 @@ end function ENT:Think() self.BaseClass.Think( self ) - + local on = self:IsOn() and "\nActivated" or "\nDeactivated" - + local pos = self:GetPos() local Distance = self:GetZTarget() - pos.z self:SetOverlayText( string.format( "Speed: %i\nResistance: %.2f\nStrength: %.2f\nDistance to ZTarget: %.2f%s", self:GetSpeed(), self:GetAirResistance(), self:GetStrength(), Distance, on ) ) - + WireLib.TriggerOutput( self, "Position", pos ) WireLib.TriggerOutput( self, "X", pos.x ) WireLib.TriggerOutput( self, "Y", pos.y ) @@ -223,7 +223,7 @@ end function ENT:ApplyDupeInfo(ply, ent, info, GetEntByID) self.BaseClass.ApplyDupeInfo(self, ply, ent, info, GetEntByID) - + if info and info.OnState and info.OnState == 1 then self:Enable() end diff --git a/lua/entities/gmod_wire_hudindicator/init.lua b/lua/entities/gmod_wire_hudindicator/init.lua index a4595289..06c2b55f 100644 --- a/lua/entities/gmod_wire_hudindicator/init.lua +++ b/lua/entities/gmod_wire_hudindicator/init.lua @@ -41,7 +41,7 @@ function ENT:Setup(a, ar, ag, ab, aa, b, br, bg, bb, ba, material, showinhud, hu self.BB = bb or 0 self.BA = ba or 255 self:SetMaterial(material) - + local ttable = { a = a, ar = ar, @@ -63,7 +63,7 @@ function ENT:Setup(a, ar, ag, ab, aa, b, br, bg, bb, ba, material, showinhud, hu fullcircleangle = fullcircleangle } table.Merge(self:GetTable(), ttable ) - + self:HUDSetup(showinhud, huddesc, hudaddname, hudshowvalue, hudstyle, allowhook, fullcircleangle) end diff --git a/lua/entities/gmod_wire_hydraulic.lua b/lua/entities/gmod_wire_hydraulic.lua index 7cabe607..dcf3a863 100644 --- a/lua/entities/gmod_wire_hydraulic.lua +++ b/lua/entities/gmod_wire_hydraulic.lua @@ -41,11 +41,11 @@ function ENT:Think() local deltaTime = CurTime() - self.last_time self.last_time = CurTime() - + if self.direction ~= 0 then self:SetLength(math.max(self.TargetLength + (self.constraint:GetTable().speed * self.direction * deltaTime), 1)) end - + self:UpdateOutputs( true ) self:NextThink(CurTime()+0.05) return true @@ -103,7 +103,7 @@ function ENT:TriggerInput(iname, value) elseif (iname == "Out") then self.direction = value elseif (iname == "Constant") then - if value == 0 then + if value == 0 then self.current_constant, _ = WireLib.CalcElasticConsts(self.constraint.Ent1, self.constraint.Ent2) else self.current_constant = value @@ -111,7 +111,7 @@ function ENT:TriggerInput(iname, value) self.constraint:Fire("SetSpringConstant",self.current_constant) timer.Simple( 0.1, function() if IsValid(self) then self:UpdateOutputs() end end) -- Needs to be delayed because ent:Fire doesn't update that fast. elseif (iname == "Damping") then - if value == 0 then + if value == 0 then _, self.current_damping = WireLib.CalcElasticConsts(self.constraint.Ent1, self.constraint.Ent2) else self.current_damping = value diff --git a/lua/entities/gmod_wire_igniter.lua b/lua/entities/gmod_wire_igniter.lua index 89c0d04a..f64072a4 100644 --- a/lua/entities/gmod_wire_igniter.lua +++ b/lua/entities/gmod_wire_igniter.lua @@ -40,7 +40,7 @@ function ENT:DoTrace() if not gamemode.Call("CanProperty", self:GetPlayer(), "ignite", trace.Entity) then return false end if (trace.Entity:IsPlayer() and (not self.TargetPlayers or not cvarTargetPlayers)) then return false end if (trace.Entity:IsWorld()) then return false end - + return trace.Entity end @@ -48,9 +48,9 @@ function ENT:TriggerInput(iname, value) if (iname == "A") then if (value ~= 0) then local target = self:DoTrace() - + if target == false then return false end - + target:Extinguish() target:Ignite( self.IgniteLength, 0 ) end @@ -59,10 +59,10 @@ function ENT:TriggerInput(iname, value) elseif (iname == "Extinguish") then if value ~= 0 then local target = self:DoTrace() - + if target == false then return false end - - target:Extinguish() + + target:Extinguish() end end end diff --git a/lua/entities/gmod_wire_indicator.lua b/lua/entities/gmod_wire_indicator.lua index 34a7b255..c698df58 100644 --- a/lua/entities/gmod_wire_indicator.lua +++ b/lua/entities/gmod_wire_indicator.lua @@ -23,7 +23,7 @@ if CLIENT then function ENT:GetWorldTipBodySize() return 400,80 end - + local white = Color(255,255,255,255) local black = Color(0,0,0,255) @@ -34,7 +34,7 @@ if CLIENT then surface.DrawLine( x + w, y + h, x, y + h ) surface.DrawLine( x, y + h, x, y ) end - + local function drawColorSlider( x, y, w, h, self ) if self.a == self.b then -- no infinite loops! draw.DrawText( "Can't draw color bar because A == B", @@ -82,7 +82,7 @@ if CLIENT then drawSquare(pos_x - step / 2,y-h*0.15,math.ceil(w/50),h*1.4) end end - + function ENT:DrawWorldTipBody( pos ) -- Get colors local data = self:GetOverlayData() @@ -94,7 +94,7 @@ if CLIENT then -- A local color_text = string.format("A color: %d,%d,%d,%d\nA value: %d",self.ar,self.ag,self.ab,self.aa,self.a) draw.DrawText( color_text, "GModWorldtip", pos.min.x + pos.edgesize, pos.min.y + pos.edgesize, white, TEXT_ALIGN_LEFT ) - + -- B local color_text = string.format("B color: %d,%d,%d,%d\nB value: %d",self.br,self.bg,self.bb,self.ba,self.b) draw.DrawText( color_text, "GModWorldtip", pos.max.x - pos.edgesize, pos.min.y + pos.edgesize, white, TEXT_ALIGN_RIGHT ) @@ -187,8 +187,8 @@ function MakeWire7Seg( pl, Pos, Ang, Model, a, ar, ag, ab, aa, b, br, bg, bb, ba Pos = Pos, Angle = Ang, Model = Model, frozen = frozen, nocollide = nocollide }, a, ar, ag, ab, aa, b, br, bg, bb, ba ) - if IsValid(ent) then - ent:SetNWString("WireName", name) + if IsValid(ent) then + ent:SetNWString("WireName", name) duplicator.StoreEntityModifier( ent, "WireName", { name = name } ) end return ent @@ -220,7 +220,7 @@ function MakeWire7Seg( pl, Pos, Ang, Model, a, ar, ag, ab, aa, b, br, bg, bb, ba end wire_indicators[i - 1]:DeleteOnRemove( wire_indicators[i] ) --when one is removed, all are. a linked chain end - + if wire_indicators[7] then wire_indicators[7]:DeleteOnRemove( wire_indicators[1] ) --loops chain back to first end diff --git a/lua/entities/gmod_wire_keypad.lua b/lua/entities/gmod_wire_keypad.lua index 8d340ccd..437b2a6d 100644 --- a/lua/entities/gmod_wire_keypad.lua +++ b/lua/entities/gmod_wire_keypad.lua @@ -2,7 +2,7 @@ AddCSLuaFile() DEFINE_BASECLASS( "base_wire_entity" ) ENT.PrintName = "Wire Keypad" -if CLIENT then +if CLIENT then local X = -50 local Y = -100 local W = 100 @@ -12,15 +12,15 @@ if CLIENT then {X+5 , Y+100 , 25, 25, -2.2, 3.45, 1.3 , 0 }, -- 1 {X+37.5, Y+100 , 25, 25, -0.6, 1.85, 1.3 , 0 }, -- 2 {X+70 , Y+100 , 25, 25, 1.0, 0.25, 1.3 , 0 }, -- 3 - + {X+5 , Y+132.5, 25, 25, -2.2, 3.45, 2.9 , -1.6}, -- 4 {X+37.5, Y+132.5, 25, 25, -0.6, 1.85, 2.9 , -1.6}, -- 5 {X+70 , Y+132.5, 25, 25, 1.0, 0.25, 2.9 , -1.6}, -- 6 - + {X+5 , Y+165 , 25, 25, -2.2, 3.45, 4.55, -3.3}, -- 7 {X+37.5, Y+165 , 25, 25, -0.6, 1.85, 4.55, -3.3}, -- 8 {X+70 , Y+165 , 25, 25, 1.0, 0.25, 4.55, -3.3}, -- 9 - + {X+5 , Y+ 67.5, 40, 25, -2.2, 4.25, -0.3 , 1.6}, -- abort {X+55 , Y+ 67.5, 40, 25, 0.3, 1.65, -0.3 , 1.6}, -- ok } @@ -37,29 +37,29 @@ if CLIENT then local highlight_key, highlight_until function ENT:Draw() self:DrawModel() - + local Ply = LocalPlayer() if (Ply:GetShootPos() - self:GetPos()):Length() > 750 then return end - + local pos = self:GetPos() + (self:GetForward() * 1.1) local ang = self:GetAngles() local rot = Vector(-90, 90, 0) - + ang:RotateAroundAxis(ang:Right(), rot.x) ang:RotateAroundAxis(ang:Up(), rot.y) ang:RotateAroundAxis(ang:Forward(), rot.z) - + cam.Start3D2D(pos, ang, 0.05) local trace = Ply:GetEyeTrace() - + local pos = self:WorldToLocal(trace.HitPos) - + surface.SetDrawColor(0, 0, 0, 255) surface.DrawRect(X-5, Y-5, W+10, H+10) - + surface.SetDrawColor(50, 75, 50, 255) surface.DrawRect(X+5, Y+5, 90, 50) - + for k,v in pairs(KeyPos) do local text = k local textx = v[1] + 9 @@ -67,7 +67,7 @@ if CLIENT then local x = (pos.y - v[5]) / (v[5] + v[6]) local y = 1 - (pos.z + v[7]) / (v[7] + v[8]) local highlight_current_key = highlight_key == k and highlight_until >= CurTime() - + if (k == 10) then text = "ABORT" textx = v[1] + 2 @@ -81,7 +81,7 @@ if CLIENT then else surface.SetDrawColor(150, 150, 150, 255) end - + if highlight_current_key or (trace.Entity == self and x >= 0 and y >= 0 and x <= 1 and y <= 1) then if (k <= 9) then surface.SetDrawColor(200, 200, 200, 255) @@ -90,7 +90,7 @@ if CLIENT then elseif (k == 11) then surface.SetDrawColor(50, 200, 50, 255) end - + if Ply:KeyDown(IN_USE) and not Ply.KeyOnce and not highlight_current_key then net.Start("wire_keypad") net.WriteEntity(self) @@ -102,7 +102,7 @@ if CLIENT then surface.DrawRect(v[1], v[2], v[3], v[4]) draw.DrawText(text, "Trebuchet18", textx, texty, Color(0, 0, 0, 255)) end - + local Display = self:GetNWString("keypad_display", "") if Display == "y" then draw.DrawText("ACCESS", "Trebuchet24", X+17, Y+7, Color(0, 255, 0, 255)) @@ -123,7 +123,7 @@ if CLIENT then local binds = { ["+gm_special 1" ] = 1, ["+gm_special 2" ] = 2, - ["+gm_special 3" ] = 3, + ["+gm_special 3" ] = 3, ["+gm_special 4" ] = 4, ["+gm_special 5" ] = 5, ["+gm_special 6" ] = 6, @@ -138,18 +138,18 @@ if CLIENT then if not pressed then return end local command = binds[bind] if not command then return end - + local trace = ply:GetEyeTraceNoCursor() local ent = trace.Entity if not IsValid(ent) then return end - + if ent:GetClass() ~= "gmod_wire_keypad" then return end - + net.Start("wire_keypad") net.WriteEntity(ent) net.WriteUInt(command, 4) net.SendToServer() - + highlight_key, highlight_until = command, CurTime()+0.5 return true end) @@ -163,9 +163,9 @@ util.PrecacheSound("buttons/button15.wav") function ENT:Initialize() self.BaseClass.Initialize(self) - + self.Outputs = WireLib.CreateOutputs(self, {"Valid", "Invalid"}) - + self.CurrentNum = 0 end @@ -178,12 +178,12 @@ util.AddNetworkString("wire_keypad") net.Receive("wire_keypad", function(netlen, ply) local ent = net.ReadEntity() if not IsValid(ent) or not ent.Password then return end - + if ent.CurrentNum == -1 then return end -- Display still shows ACCESS from a past success if (ply:GetShootPos() - ent:GetPos()):Length() > 50 then return end - + local key = net.ReadUInt(4) - + if key == 10 then -- Reset ent:SetNWString("keypad_display", "") ent:EmitSound("buttons/button14.wav") @@ -199,7 +199,7 @@ net.Receive("wire_keypad", function(netlen, ply) Wire_TriggerOutput(ent, "Invalid", 1) ent:EmitSound("buttons/button8.wav") end - + ent.CurrentNum = -1 timer.Create("wire_keypad_"..ent:EntIndex().."_"..tostring(access), 2, 1, function() if IsValid(ent) then @@ -214,7 +214,7 @@ net.Receive("wire_keypad", function(netlen, ply) end) else ent.CurrentNum = ent.CurrentNum * 10 + key - + if ent.Secure then ent:SetNWString("keypad_display", string.rep("*", string.len(ent.CurrentNum))) else diff --git a/lua/entities/gmod_wire_lamp.lua b/lua/entities/gmod_wire_lamp.lua index 7767da98..1f25554f 100644 --- a/lua/entities/gmod_wire_lamp.lua +++ b/lua/entities/gmod_wire_lamp.lua @@ -8,7 +8,7 @@ function ENT:SetupDataTables() self:NetworkVar( "Bool", 0, "On" ) end -if CLIENT then +if CLIENT then local matLight = Material( "sprites/light_ignorez" ) local matBeam = Material( "effects/lamp_beam" ) @@ -17,25 +17,25 @@ if CLIENT then end function ENT:DrawTranslucent() - + self.BaseClass.DrawTranslucent( self ) - + -- No glow if we're not switched on! if not self:GetOn() then return end - + local LightNrm = self:GetAngles():Forward() local ViewNormal = self:GetPos() - EyePos() local Distance = ViewNormal:Length() ViewNormal:Normalize() local ViewDot = ViewNormal:Dot( LightNrm * -1 ) local LightPos = self:GetPos() + LightNrm * 5 - + -- glow sprite --[[ render.SetMaterial( matBeam ) - + local BeamDot = BeamDot = 0.25 - + render.StartBeam( 3 ) render.AddBeam( LightPos + LightNrm * 1, 128, 0.0, Color( r, g, b, 255 * BeamDot) ) render.AddBeam( LightPos - LightNrm * 100, 128, 0.5, Color( r, g, b, 64 * BeamDot) ) @@ -44,25 +44,25 @@ if CLIENT then --]] if ViewDot >= 0 then - + render.SetMaterial( matLight ) - local Visibile = util.PixelVisible( LightPos, 16, self.PixVis ) - + local Visibile = util.PixelVisible( LightPos, 16, self.PixVis ) + if (!Visibile) then return end - + local Size = math.Clamp( Distance * Visibile * ViewDot * 2, 64, 512 ) - + Distance = math.Clamp( Distance, 32, 800 ) local Alpha = math.Clamp( (1000 - Distance) * Visibile * ViewDot, 0, 100 ) local Col = self:GetColor() Col.a = Alpha - + render.DrawSprite( LightPos, Size, Size, Col, Visibile * ViewDot ) render.DrawSprite( LightPos, Size*0.4, Size*0.4, Color(255, 255, 255, Alpha), Visibile * ViewDot ) - + end end - + return -- No more client end @@ -123,28 +123,28 @@ function ENT:Switch( on ) self:SetOn( true ) local angForward = self:GetAngles() - + self.flashlight = ents.Create( "env_projectedtexture" ) - + self.flashlight:SetParent( self ) - + -- The local positions are the offsets from parent.. self.flashlight:SetLocalPos( Vector( 0, 0, 0 ) ) self.flashlight:SetLocalAngles( Angle(0,0,0) ) - + -- Looks like only one flashlight can have shadows enabled! self.flashlight:SetKeyValue( "enableshadows", 1 ) - + self.flashlight:SetKeyValue( "farz", self.Dist ) self.flashlight:SetKeyValue( "nearz", 12 ) self.flashlight:SetKeyValue( "lightfov", self.FOV ) - + local c = self:GetColor() local b = self.Brightness self.flashlight:SetKeyValue( "lightcolor", Format( "%i %i %i 255", c.r * b, c.g * b, c.b * b ) ) - + self.flashlight:Spawn() - + self.flashlight:Input( "SpotlightTexture", NULL, NULL, self.Texture ) end @@ -159,14 +159,14 @@ function ENT:UpdateLight() local c = self:GetColor() local b = self.Brightness self.flashlight:SetKeyValue( "lightcolor", Format( "%i %i %i 255", c.r*b, c.g*b, c.b*b ) ) - + self:SetOverlayText( "Red: " .. c.r .. " Green: " .. c.g .. " Blue: " .. c.b .. "\n" .. "FoV: " .. self.FOV .. " Distance: " .. self.Dist .. " Brightness: " .. self.Brightness ) end function ENT:Setup( r, g, b, Texture, fov, dist, brightness, on ) self.r, self.g, self.b = math.Clamp(r or 255,0,255), math.Clamp(g or 255,0,255), math.Clamp(b or 255,0,255) - + self.Texture = Texture or "effects/flashlight001" self.FOV = fov or 90 self.Dist = dist or 1024 diff --git a/lua/entities/gmod_wire_lever.lua b/lua/entities/gmod_wire_lever.lua index dfbffa37..61732c22 100644 --- a/lua/entities/gmod_wire_lever.lua +++ b/lua/entities/gmod_wire_lever.lua @@ -6,18 +6,18 @@ ENT.WireDebugName = "Lever" if CLIENT then return end -- No more client function ENT:Initialize() - self:SetModel("models/props_wasteland/tram_lever01.mdl") + self:SetModel("models/props_wasteland/tram_lever01.mdl") self:PhysicsInit( SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_VPHYSICS ) self:SetSolid( SOLID_VPHYSICS ) self:SetUseType( SIMPLE_USE ) - + self.EntToOutput = NULL - + self.Ang = 0 self.Value = 0 self:Setup(0, 1) - + self.Inputs = WireLib.CreateInputs(self, {"SetValue", "Min", "Max"}) self.Outputs = WireLib.CreateOutputs(self, {"Value", "Entity [ENTITY]"}) end @@ -46,7 +46,7 @@ end function ENT:Think() self.BaseClass.Think(self) if not IsValid(self.BaseEnt) then return end - + if IsValid(self.User) then local dist = self.User:GetShootPos():Distance(self:GetPos()) if dist < 160 and (self.User:KeyDown(IN_USE) or self.User:KeyDown(IN_ATTACK)) then @@ -57,17 +57,17 @@ function ENT:Think() distMax = TargPos:Distance(self.BaseEnt:GetPos()) distMin = TargPos:Distance(self.BaseEnt:GetPos() + self.BaseEnt:GetUp() * 40) local HPos = 20 - ((distMin - distMax) * 0.5) - + self.Ang = math.Clamp( math.deg( math.atan2( HPos, FPos ) ) - 90, -45, 45 ) else self.User = NULL WireLib.TriggerOutput( self, "Entity", NULL) end end - + self.Value = Lerp((self.Ang + 45) / 90, self.Min, self.Max) Wire_TriggerOutput(self, "Value", self.Value) - + local NAng = self.BaseEnt:GetAngles() NAng:RotateAroundAxis( NAng:Right(), -self.Ang ) local RAng = self.BaseEnt:WorldToLocalAngles(NAng) @@ -75,17 +75,17 @@ function ENT:Think() self:SetLocalAngles( RAng ) self:ShowOutput() - - self:NextThink(CurTime()) - return true + + self:NextThink(CurTime()) + return true end function ENT:ShowOutput() self:SetOverlayText(string.format("(%.2f - %.2f) = %.2f", self.Min, self.Max, self.Value)) end -function ENT:OnRemove( ) - if IsValid(self.BaseEnt) then +function ENT:OnRemove( ) + if IsValid(self.BaseEnt) then self.BaseEnt:Remove() self.BaseEnt = nil end diff --git a/lua/entities/gmod_wire_light.lua b/lua/entities/gmod_wire_light.lua index cce53121..1652eab7 100644 --- a/lua/entities/gmod_wire_light.lua +++ b/lua/entities/gmod_wire_light.lua @@ -13,7 +13,7 @@ function ENT:SetupDataTables() self:NetworkVar( "Int", 2, "B" ) end -if CLIENT then +if CLIENT then local matLight = Material( "sprites/light_ignorez" ) local matBeam = Material( "effects/lamp_beam" ) @@ -27,23 +27,23 @@ if CLIENT then sprite colors whenever the wire input changes. ]] self:SetOverlayData({}) end - + function ENT:GetMyColor() return Color( self:GetR(), self:GetG(), self:GetB(), 255 ) end function ENT:DrawTranslucent() local up = self:GetAngles():Up() - + local LightPos = self:GetPos() render.SetMaterial( matLight ) - + local ViewNormal = self:GetPos() - EyePos() local Distance = ViewNormal:Length() ViewNormal:Normalize() - - local Visible = util.PixelVisible( LightPos, 4, self.PixVis ) - + + local Visible = util.PixelVisible( LightPos, 4, self.PixVis ) + if not Visible or Visible < 0.1 then return end local c = self:GetMyColor() @@ -65,12 +65,12 @@ if CLIENT then local dlight = DynamicLight(self:EntIndex()) if dlight then dlight.Pos = self:GetPos() - + local c = self:GetMyColor() dlight.r = c.r dlight.g = c.g dlight.b = c.b - + dlight.Brightness = self:GetBrightness() dlight.Decay = self:GetSize() * 5 dlight.Size = self:GetSize() @@ -78,51 +78,51 @@ if CLIENT then end end end - + local color_box_size = 64 function ENT:GetWorldTipBodySize() -- text local w_total,h_total = surface.GetTextSize( "Color:\n255,255,255,255" ) - + -- Color box width w_total = math.max(w_total,color_box_size) - + -- Color box height h_total = h_total + 18 + color_box_size + 18/2 - + return w_total, h_total end - + local white = Color(255,255,255,255) local black = Color(0,0,0,255) - + local function drawColorBox( color, x, y ) surface.SetDrawColor( color ) surface.DrawRect( x, y, color_box_size, color_box_size ) - + local size = color_box_size - + surface.SetDrawColor( black ) surface.DrawLine( x, y, x + size, y ) surface.DrawLine( x + size, y, x + size, y + size ) surface.DrawLine( x + size, y + size, x, y + size ) surface.DrawLine( x, y + size, x, y ) end - + function ENT:DrawWorldTipBody( pos ) -- get color local color = self:GetMyColor() - + -- text local color_text = string.format("Color:\n%d,%d,%d",color.r,color.g,color.b) - + local w,h = surface.GetTextSize( color_text ) draw.DrawText( color_text, "GModWorldtip", pos.center.x, pos.min.y + pos.edgesize, white, TEXT_ALIGN_CENTER ) - + -- color box drawColorBox( color, pos.center.x - color_box_size / 2, pos.min.y + pos.edgesize * 1.5 + h ) end - + return -- No more client end @@ -139,7 +139,7 @@ end function ENT:Directional( On ) if On then if IsValid( self.DirectionalComponent ) then return end - + local flashlight = ents.Create( "env_projectedtexture" ) flashlight:SetParent( self ) @@ -159,7 +159,7 @@ function ENT:Directional( On ) local c = self:GetColor() local b = self.brightness flashlight:SetKeyValue( "lightcolor", Format( "%i %i %i 255", c.r * b, c.g * b, c.b * b ) ) - + flashlight:Spawn() flashlight:Input( "SpotlightTexture", NULL, NULL, "effects/flashlight001" ) @@ -185,7 +185,7 @@ function ENT:Radiant( On ) dynlight:SetKeyValue( "brightness", 5 ) dynlight:SetParent( self ) dynlight:Spawn() - + self.RadiantComponent = dynlight end elseif IsValid( self.RadiantComponent ) then @@ -197,7 +197,7 @@ function ENT:UpdateLight() self:SetR( self.R ) self:SetG( self.G ) self:SetB( self.B ) - + if IsValid( self.DirectionalComponent ) then self.DirectionalComponent:SetKeyValue( "lightcolor", Format( "%i %i %i 255", self.R * self.brightness, self.G * self.brightness, self.B * self.brightness ) ) end if IsValid( self.RadiantComponent ) then self.RadiantComponent:SetKeyValue( "_light", Format( "%i %i %i 255", self.R, self.G, self.B ) ) end end @@ -220,7 +220,7 @@ function ENT:TriggerInput(iname, value) self.size = value self:SetSize( value ) end - + self:UpdateLight() end @@ -233,24 +233,24 @@ function ENT:Setup(directional, radiant, glow, brightness, size, r, g, b) self.R = r or 255 self.G = g or 255 self.B = b or 255 - + if not game.SinglePlayer() then self.brightness = math.Clamp( self.brightness, 0, 10 ) self.size = math.Clamp( self.size, 0, 1024 ) end - + self:Directional( self.directional ) self:Radiant( self.radiant ) self:SetGlow( self.glow ) self:SetBrightness( self.brightness ) self:SetSize( self.size ) - + if self.glow then WireLib.AdjustInputs(self, {"Red", "Green", "Blue", "RGB [VECTOR]", "GlowBrightness", "GlowSize"}) else WireLib.AdjustInputs(self, {"Red", "Green", "Blue", "RGB [VECTOR]"}) end - + self:UpdateLight() end diff --git a/lua/entities/gmod_wire_motor.lua b/lua/entities/gmod_wire_motor.lua index 2dfdadfc..63981dd9 100644 --- a/lua/entities/gmod_wire_motor.lua +++ b/lua/entities/gmod_wire_motor.lua @@ -50,44 +50,44 @@ end --needed for the constraint to find the controller after being duplicator pasted local WireMotorTracking = {} - + function MakeWireMotorController( pl, Pos, Ang, MyEntId, model, const, axis ) local controller = WireLib.MakeWireEnt(pl, {Class = "gmod_wire_motor", Pos=Pos, Angle=Ang, Model=model}) if not IsValid(controller) then return end - + if not const then WireMotorTracking[ MyEntId ] = controller else controller.MyId = controller:EntIndex() const.MyCrtl = controller:EntIndex() - controller:SetConstraint( const ) + controller:SetConstraint( const ) controller:DeleteOnRemove( const ) end - + if axis then controller:SetAxis( axis ) controller:DeleteOnRemove( axis ) end - + return controller end duplicator.RegisterEntityClass("gmod_wire_motor", MakeWireMotorController, "Pos", "Ang", "MyId", "model") - + function MakeWireMotor( pl, Ent1, Ent2, Bone1, Bone2, LPos1, LPos2, friction, torque, nocollide, forcelimit, MyCrtl ) if not constraint.CanConstrain( Ent1, Bone1 ) then return false end if not constraint.CanConstrain( Ent2, Bone2 ) then return false end - + local Phys1 = Ent1:GetPhysicsObjectNum( Bone1 ) local Phys2 = Ent2:GetPhysicsObjectNum( Bone2 ) local WPos1 = Phys1:LocalToWorld( LPos1 ) local WPos2 = Phys2:LocalToWorld( LPos2 ) - + if Phys1 == Phys2 then return false end local const, axis = constraint.Motor( Ent1, Ent2, Bone1, Bone2, LPos1, LPos2, friction, torque, 0, nocollide, 0, pl, forcelimit ) - + if not const then return nil, axis end - + local ctable = { Type = "WireMotor", pl = pl, @@ -103,25 +103,25 @@ function MakeWireMotor( pl, Ent1, Ent2, Bone1, Bone2, LPos1, LPos2, friction, to forcelimit = forcelimit } const:SetTable( ctable ) - + if MyCrtl then local controller = WireMotorTracking[ MyCrtl ] - + const.MyCrtl = controller:EntIndex() controller.MyId = controller:EntIndex() - + controller:SetConstraint( const ) controller:DeleteOnRemove( const ) if axis then controller:SetAxis( axis ) controller:DeleteOnRemove( axis ) end - + Ent1:DeleteOnRemove( controller ) Ent2:DeleteOnRemove( controller ) const:DeleteOnRemove( controller ) end - + return const, axis end duplicator.RegisterConstraint( "WireMotor", MakeWireMotor, "pl", "Ent1", "Ent2", "Bone1", "Bone2", "LPos1", "LPos2", "friction", "torque", "nocollide", "forcelimit", "MyCrtl" ) diff --git a/lua/entities/gmod_wire_nailer.lua b/lua/entities/gmod_wire_nailer.lua index 0f3b4c4d..1c05e1cf 100644 --- a/lua/entities/gmod_wire_nailer.lua +++ b/lua/entities/gmod_wire_nailer.lua @@ -43,7 +43,7 @@ function ENT:TriggerInput(name, value) local trace1 = util.TraceLine( { start = self:GetPos(), - endpos = self:GetPos() + up * self:GetBeamLength(), + endpos = self:GetPos() + up * self:GetBeamLength(), filter = { self } } ) @@ -51,7 +51,7 @@ function ENT:TriggerInput(name, value) local trace2 = util.TraceLine( { start = trace1.HitPos, - endpos = trace1.HitPos + up * 50, + endpos = trace1.HitPos + up * 50, filter = { trace1.Entity, self } } ) diff --git a/lua/entities/gmod_wire_numpad.lua b/lua/entities/gmod_wire_numpad.lua index b012d004..db477aad 100644 --- a/lua/entities/gmod_wire_numpad.lua +++ b/lua/entities/gmod_wire_numpad.lua @@ -82,7 +82,7 @@ function ENT:Switch( on, key ) if (!self:IsValid()) then return false end self.Buffer[key] = on and 1 or 0 - + self:ShowOutput() self.Value = on and self.value_on or self.value_off diff --git a/lua/entities/gmod_wire_oscilloscope.lua b/lua/entities/gmod_wire_oscilloscope.lua index d7ac7ce9..dcab86f3 100644 --- a/lua/entities/gmod_wire_oscilloscope.lua +++ b/lua/entities/gmod_wire_oscilloscope.lua @@ -3,7 +3,7 @@ DEFINE_BASECLASS( "base_wire_entity" ) ENT.PrintName = "Wire Oscilloscope" ENT.WireDebugName = "Oscilloscope" -if CLIENT then +if CLIENT then function ENT:Initialize() self.GPU = WireGPU(self) @@ -92,7 +92,7 @@ if CLIENT then self.GPU:Render() Wire_Render(self) end - + return -- No more client end diff --git a/lua/entities/gmod_wire_pixel.lua b/lua/entities/gmod_wire_pixel.lua index f10466c3..69bd8ad7 100644 --- a/lua/entities/gmod_wire_pixel.lua +++ b/lua/entities/gmod_wire_pixel.lua @@ -3,11 +3,11 @@ DEFINE_BASECLASS( "base_wire_entity" ) ENT.PrintName = "Wire Pixel" ENT.WireDebugName = "Pixel" -if CLIENT then +if CLIENT then function ENT:Draw( ) self:DrawModel( ) end - + return -- No more client end diff --git a/lua/entities/gmod_wire_pod.lua b/lua/entities/gmod_wire_pod.lua index 7970618d..cfff2869 100644 --- a/lua/entities/gmod_wire_pod.lua +++ b/lua/entities/gmod_wire_pod.lua @@ -101,8 +101,8 @@ function ENT:Initialize() } local inputs = { - "Lock", "Terminate", "Strip weapons", "Eject", - "Disable", "Crosshairs", "Brake", "Allow Buttons", + "Lock", "Terminate", "Strip weapons", "Eject", + "Disable", "Crosshairs", "Brake", "Allow Buttons", "Relative", "Damage Health", "Damage Armor", "Hide Player", "Hide HUD", "Vehicle [ENTITY]" } @@ -198,7 +198,7 @@ function ENT:GetPod() return self.Pod end function ENT:SetPod( pod ) if (pod and pod:IsValid() and !pod:IsVehicle()) then return false end - if self:HasPly() then + if self:HasPly() then self:PlayerExited(self:GetPly()) else self:ColorByLinkStatus(IsValid(pod) and self.LINK_STATUS_LINKED or self.LINK_STATUS_UNLINKED) diff --git a/lua/entities/gmod_wire_ranger.lua b/lua/entities/gmod_wire_ranger.lua index 6809433e..34949d49 100644 --- a/lua/entities/gmod_wire_ranger.lua +++ b/lua/entities/gmod_wire_ranger.lua @@ -62,7 +62,7 @@ function ENT:Setup( range, default_zero, show_beam, ignore_world, trace_water, o if (out_dist) then add("Dist","NORMAL") end - if (out_pos) then + if (out_pos) then add("Pos", "VECTOR", "Pos X", "NORMAL", "Pos Y", "NORMAL", diff --git a/lua/entities/gmod_wire_relay.lua b/lua/entities/gmod_wire_relay.lua index 826515dc..0bde8ae0 100644 --- a/lua/entities/gmod_wire_relay.lua +++ b/lua/entities/gmod_wire_relay.lua @@ -20,17 +20,17 @@ function ENT:Initialize() end function ENT:Setup(keygroup1, keygroup2, keygroup3, keygroup4, keygroup5, keygroupoff, toggle, normclose, poles, throws, nokey) - + local outpoles = {"A", "B", "C", "D", "E", "F", "G", "H"} //output names - + // Clamp throws = throws > 10 and 10 or throws poles = poles > #outpoles and #outpoles or poles - + local inputs = {} //wont need this outside setup self.outputs = {} //need to rebuild output names - + self.keygroup1 = keygroup1 self.keygroup2 = keygroup2 self.keygroup3 = keygroup3 @@ -43,7 +43,7 @@ function ENT:Setup(keygroup1, keygroup2, keygroup3, keygroup4, keygroup5, keygro self.poles = poles self.throws = throws self.nokey = nokey - + //build inputs and putputs, init all nil values for p=1, self.poles do self.outputs[p] = outpoles[p] @@ -62,7 +62,7 @@ function ENT:Setup(keygroup1, keygroup2, keygroup3, keygroup4, keygroup5, keygro //set the switch to its new normal state self:Switch( normclose ) - + if not nokey then local pl = self:GetPlayer() if (keygroupoff) then diff --git a/lua/entities/gmod_wire_sensor.lua b/lua/entities/gmod_wire_sensor.lua index ae4d1380..dc52768d 100644 --- a/lua/entities/gmod_wire_sensor.lua +++ b/lua/entities/gmod_wire_sensor.lua @@ -19,7 +19,7 @@ end function ENT:Setup(xyz_mode, outdist, outbrng, gpscord, direction_vector, direction_normalized, target_velocity, velocity_normalized) if !xyz_mode and !outdist and !outbrng and !gpscord and !direction_vector and !target_velocity then outdist = true end - + self.xyz_mode = xyz_mode self.PrevOutput = nil self.Value = 0 @@ -43,8 +43,8 @@ function ENT:Setup(xyz_mode, outdist, outbrng, gpscord, direction_vector, direct table.insert(onames, "Z") end if (outbrng) then - table.insert(onames, "Bearing") - table.insert(onames, "Elevation") + table.insert(onames, "Bearing") + table.insert(onames, "Elevation") end if (gpscord) then table.insert(onames, "World_X") diff --git a/lua/entities/gmod_wire_socket.lua b/lua/entities/gmod_wire_socket.lua index 8e61b0c5..1a7d052f 100644 --- a/lua/entities/gmod_wire_socket.lua +++ b/lua/entities/gmod_wire_socket.lua @@ -72,7 +72,7 @@ function ENT:GetPlugClass() return "gmod_wire_plug" end -if CLIENT then +if CLIENT then function ENT:DrawEntityOutline() if (GetConVar("wire_plug_drawoutline"):GetBool()) then base.DrawEntityOutline( self ) @@ -94,7 +94,7 @@ if CLIENT then end end end) - + return -- No more client end diff --git a/lua/entities/gmod_wire_spawner.lua b/lua/entities/gmod_wire_spawner.lua index 5ed7b6cc..e7674e95 100644 --- a/lua/entities/gmod_wire_spawner.lua +++ b/lua/entities/gmod_wire_spawner.lua @@ -59,20 +59,20 @@ function ENT:Setup( delay, undo_delay, spawn_effect, mat, r, g, b, a, skin ) self.delay = delay self.undo_delay = undo_delay self.spawn_effect = spawn_effect - if r then + if r then self.mat = mat self.r = r self.g = g self.b = b self.a = a self.skin = skin - + self:SetRenderMode(3) self:SetMaterial(mat or "") self:SetSkin(skin or 0) self:SetColor(Color(r or 255, g or 255, b or 255, 100)) end - + self:ShowOutput() end @@ -130,7 +130,7 @@ function ENT:DoSpawn( pl, down ) undo.AddEntity( nocollide ) undo.SetPlayer( pl ) undo.Finish() - + -- Check if the player is NULL (ab0mbs) if IsValid(pl) then pl:AddCleanup( "props", prop ) diff --git a/lua/entities/gmod_wire_speedometer.lua b/lua/entities/gmod_wire_speedometer.lua index a0fa9ed1..fd19e9b4 100644 --- a/lua/entities/gmod_wire_speedometer.lua +++ b/lua/entities/gmod_wire_speedometer.lua @@ -16,7 +16,7 @@ function ENT:SetModes( XYZMode, AngVel ) self:SetNWBool( 1, AngVel ) end -if CLIENT then +if CLIENT then function ENT:Think() self.BaseClass.Think(self) @@ -40,7 +40,7 @@ if CLIENT then self:NextThink(CurTime()+0.04) return true end - + return -- No more client end diff --git a/lua/entities/gmod_wire_target_finder.lua b/lua/entities/gmod_wire_target_finder.lua index e175892b..828766a2 100644 --- a/lua/entities/gmod_wire_target_finder.lua +++ b/lua/entities/gmod_wire_target_finder.lua @@ -14,7 +14,7 @@ function ENT:Initialize() self.Outputs = WireLib.CreateSpecialOutputs( self, { "Out" }, { "ENTITY" } ) end -function ENT:Setup(maxrange, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel, vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist ) +function ENT:Setup(maxrange, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel, vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist ) local ttable = { -- For dupe support range = maxrange, players = players, @@ -47,7 +47,7 @@ function ENT:Setup(maxrange, players, npcs, npcname, beacons, hoverballs, thrust entity = entity, } table.Merge( self:GetTable(), ttable ) - + self.MaxRange = maxrange self.MinRange = minrange or 1 self.TargetPlayer = players @@ -221,7 +221,7 @@ end function ENT:CheckTheBuddyList(friend) if not self.CheckBuddyList or not CPPI then return true end if not IsValid(self:GetPlayer()) then return false end - + for _, v in pairs(self:GetPlayer():CPPIGetFriends()) do if v == friend then return self.OnBuddyList end end diff --git a/lua/entities/gmod_wire_textentry.lua b/lua/entities/gmod_wire_textentry.lua index 2ba16a10..ed57f64e 100644 --- a/lua/entities/gmod_wire_textentry.lua +++ b/lua/entities/gmod_wire_textentry.lua @@ -39,7 +39,7 @@ if CLIENT then "Enter","Cancel" ) end) - + net.Receive( "wire_textentry_kick", function() if IsValid( panel ) then panel:Remove() @@ -54,17 +54,17 @@ end function ENT:UpdateOverlay() local hold = math.Round(math.max(self:GetHold(),0),1) local txt = "Hold Length: " .. (hold > 0 and hold or "Forever") - + if self.BlockInput then txt = txt.."\nBlocking Input" elseif IsValid(self.User) then txt = txt.."\nIn use by: " .. self.User:Nick() end - + if self:GetDisableUse() then txt = txt .. "\nUse disabled" end - + self:SetOverlayText(txt) end @@ -74,13 +74,13 @@ end function ENT:Initialize() self:PhysicsInit(SOLID_VPHYSICS) self:SetUseType(SIMPLE_USE) - + self.Inputs=WireLib.CreateInputs(self,{"Block Input","Prompt"}) self.Outputs=WireLib.CreateOutputs(self,{"In Use","Text [STRING]","User [ENTITY]"}) - + self.BlockInput=false self.NextPrompt = 0 - + self:UpdateOverlay() end @@ -102,12 +102,12 @@ end ---------------------------------------------------- function ENT:UnlinkEnt(ent) if not IsValid( ent ) then return false, "Invalid entity specified" end - + if IsValid(self.Vehicle) then self.Vehicle:RemoveCallOnRemove( "wire_textentry_onremove" ) self.Vehicle.WireTextEntry = nil end - + self.Vehicle = nil WireLib.SendMarks( self, {} ) return true @@ -116,15 +116,15 @@ end function ENT:LinkEnt(ent) if not IsValid( ent ) then return false, "Invalid entity specified" end if not ent:IsVehicle() then return false, "Entity must be a vehicle" end - + if IsValid( self.Vehicle ) then -- remove old callback self.Vehicle:RemoveCallOnRemove( "wire_textentry_onremove" ) self.Vehicle.WireTextEntry = nil end - + self.Vehicle = ent self.Vehicle.WireTextEntry = self - + -- add new callback self.Vehicle:CallOnRemove( "wire_textentry_onremove", function() self:UnlinkEnt( ent ) @@ -143,7 +143,7 @@ function ENT:OnRemove() self.Vehicle:RemoveCallOnRemove( "wire_textentry_onremove" ) self.Vehicle.WireTextEntry = nil end - + self:Unprompt( true ) end @@ -153,16 +153,16 @@ end util.AddNetworkString("wire_textentry_action") net.Receive("wire_textentry_action",function(len,ply) local self=net.ReadEntity() - + if not IsValid( self ) or not IsValid( ply ) or ply ~= self.User then return end - + local text = net.ReadString() - + self:Unprompt() -- in all cases, make text entry available for use again - + if not self.BlockInput then WireLib.TriggerOutput( self, "Text", text ) - + local timername = "wire_textentry_" .. self:EntIndex() timer.Remove( timername ) if math.max(self:GetHold(),0) > 0 then @@ -174,7 +174,7 @@ net.Receive("wire_textentry_action",function(len,ply) end) end end - + self:UpdateOverlay() end) @@ -187,24 +187,24 @@ function ENT:Prompt( ply ) if ply then if CurTime() < self.NextPrompt then return end -- anti spam self.NextPrompt = CurTime() + 0.1 - + if self.BlockInput or IsValid( self.User ) then WireLib.AddNotify(ply,"That text entry is not accepting input right now!",NOTIFY_ERROR,5,6) return end - + self.User = ply - + WireLib.TriggerOutput( self, "User", ply ) WireLib.TriggerOutput( self, "In Use", 1 ) - + local timername = "wire_textentry_" .. self:EntIndex() timer.Remove( timername ) - + net.Start( "wire_textentry_show" ) net.WriteEntity( self ) net.Send( ply ) - + self:UpdateOverlay() elseif IsValid( self.Vehicle ) and IsValid( self.Vehicle:GetDriver() ) then -- linked self:Prompt( self.Vehicle:GetDriver() ) -- prompt for driver @@ -237,7 +237,7 @@ end hook.Add( "PlayerLeaveVehicle", "wire_textentry_leave_vehicle", function( ply, vehicle ) if vehicle.WireTextEntry and IsValid( vehicle.WireTextEntry ) and IsValid( vehicle.WireTextEntry.User ) and vehicle.WireTextEntry.User == ply then - + vehicle.WireTextEntry:Unprompt( true ) end end) @@ -247,7 +247,7 @@ end) ---------------------------------------------------- function ENT:Use(ply) if self:GetDisableUse() or not IsValid( ply ) then return end - + self:Prompt( ply ) end @@ -259,12 +259,12 @@ function ENT:Setup(hold,disableuse) if hold then self:SetHold( math.max( hold, 0 ) ) end - + disableuse = tobool(disableuse) if disableuse ~= nil then self:SetDisableUse( disableuse ) end - + self:UpdateOverlay() end duplicator.RegisterEntityClass("gmod_wire_textentry",WireLib.MakeWireEnt,"Data") diff --git a/lua/entities/gmod_wire_textreceiver.lua b/lua/entities/gmod_wire_textreceiver.lua index 39260e72..090d4296 100644 --- a/lua/entities/gmod_wire_textreceiver.lua +++ b/lua/entities/gmod_wire_textreceiver.lua @@ -42,12 +42,12 @@ end function ENT:Setup( UseLuaPatterns, Matches, CaseInsensitive ) local outputs = { "Message", "Player", "Clk" } local types = { "STRING", "ENTITY", "NORMAL" } - + if UseLuaPatterns then outputs[#outputs+1] = "PatternError" types[#types+1] = "STRING" end - + if #Matches > 0 then local txt = "Matches:" for i=1,#Matches do @@ -62,7 +62,7 @@ function ENT:Setup( UseLuaPatterns, Matches, CaseInsensitive ) self:SetOverlayText(txt) end self.Outputs = WireLib.AdjustSpecialOutputs( self, outputs, types ) - + self:PlayerSpoke( nil, "" ) -- Reset outputs self.UseLuaPatterns = UseLuaPatterns @@ -80,7 +80,7 @@ local string_match = string.match function ENT:PcallFind( text, match ) local ok, ret = pcall( string_find, text, match, 1, not self.UseLuaPatterns ) - + if ok == true then return ret ~= nil else @@ -94,7 +94,7 @@ end function ENT:PcallMatch( text, match, idx ) local ret = { pcall( string_match, text, match ) } - + if ret[1] == true then table.remove( ret, 1 ) return ret @@ -116,7 +116,7 @@ function ENT:PlayerSpoke( ply, text ) end ) if self.CaseInsensitive then text = string_lower(text) end - + if self.UseLuaPatterns then -- Reset error self.PatternError = "" @@ -136,7 +136,7 @@ function ENT:PlayerSpoke( ply, text ) WireLib.TriggerOutput( self, "Matches " .. i, self:PcallMatch( text, match, i ) ) end end - + if self.UseLuaPatterns then WireLib.TriggerOutput( self, "PatternError", string.sub( self.PatternError, 1, -2 ) ) end diff --git a/lua/entities/gmod_wire_textscreen.lua b/lua/entities/gmod_wire_textscreen.lua index 2856f556..a37cc57d 100644 --- a/lua/entities/gmod_wire_textscreen.lua +++ b/lua/entities/gmod_wire_textscreen.lua @@ -15,7 +15,7 @@ function ENT:InitializeShared() end -if CLIENT then +if CLIENT then local Layouter = {} Layouter.__index = Layouter @@ -190,7 +190,7 @@ if CLIENT then self:SetText(net.ReadString()) end end - + local createdFonts = {} function ENT:CreateFont(font, chrPerLine) if createdFonts[font .. chrPerLine] then return end @@ -206,7 +206,7 @@ if CLIENT then createdFonts[font .. chrPerLine] = true self.NeedRefresh = true end - + return -- No more client end @@ -229,7 +229,7 @@ function ENT:Setup(DefaultText, chrPerLine, textJust, valign, tfont, fgcolor, bg self.valign = valign or 0 self.tfont = tfont or "Arial" self:SendConfig() - + self.text = DefaultText or "" self:TriggerInput("String", self.text) end @@ -274,11 +274,11 @@ function ENT:SendConfig(ply) net.WriteUInt(self.chrPerLine, 4) net.WriteUInt(self.textJust, 2) net.WriteUInt(self.valign, 2) - + net.WriteUInt(self.fgcolor.r, 8) net.WriteUInt(self.fgcolor.g, 8) net.WriteUInt(self.fgcolor.b, 8) - + net.WriteUInt(self.bgcolor.r, 8) net.WriteUInt(self.bgcolor.g, 8) net.WriteUInt(self.bgcolor.b, 8) diff --git a/lua/entities/gmod_wire_thruster.lua b/lua/entities/gmod_wire_thruster.lua index 7ffa5396..3fcd819e 100644 --- a/lua/entities/gmod_wire_thruster.lua +++ b/lua/entities/gmod_wire_thruster.lua @@ -31,7 +31,7 @@ function ENT:GetOffset( name ) end -if CLIENT then +if CLIENT then function ENT:Initialize() self.ShouldDraw = 1 self.EffectAvg = 0 @@ -61,7 +61,7 @@ if CLIENT then function ENT:CalcNormal() return (self:LocalToWorld(self:GetOffset()) - self:GetPos()):GetNormalized() end - + return -- No more client end @@ -182,7 +182,7 @@ function ENT:Setup(force, force_min, force_max, oweffect, uweffect, owater, uwat self.uwater = uwater if (!soundname) then soundname = "" end - + -- Preventing client crashes local BlockedChars = '["?]' if ( string.find(soundname, BlockedChars) ) then @@ -257,7 +257,7 @@ function ENT:Switch( on, mul ) self:StopSound( self.soundname ) self:EmitSound( self.soundname ) end - + self.mul = mul self:SetForce( nil, mul ) @@ -265,7 +265,7 @@ function ENT:Switch( on, mul ) if (self.soundname and self.soundname != "") then self:StopSound( self.soundname ) end - + self.mul = 0 end self:ShowOutput() diff --git a/lua/entities/gmod_wire_trail.lua b/lua/entities/gmod_wire_trail.lua index 417766d2..3b2f0962 100644 --- a/lua/entities/gmod_wire_trail.lua +++ b/lua/entities/gmod_wire_trail.lua @@ -12,7 +12,7 @@ function ENT:Initialize() self:SetSolid( SOLID_VPHYSICS ) self.Inputs = Wire_CreateInputs(self, {"Set", "Length","StartSize","EndSize","R","G","B","A"}) self.Outputs = Wire_CreateOutputs(self, {}) - + self.Trail = { Color = Color(255, 255, 255, 255), Length = 5, diff --git a/lua/entities/gmod_wire_trigger.lua b/lua/entities/gmod_wire_trigger.lua index b28c298e..151b5ca9 100644 --- a/lua/entities/gmod_wire_trigger.lua +++ b/lua/entities/gmod_wire_trigger.lua @@ -43,13 +43,13 @@ end function ENT:Setup( model, filter, owneronly, sizex, sizey, sizez, offsetx, offsety, offsetz ) - filter = math.Clamp( filter, 0, 2 ) - sizex = math.Clamp( sizex, -1000, 1000 ) - sizey = math.Clamp( sizey, -1000, 1000 ) - sizez = math.Clamp( sizez, -1000, 1000 ) - offsetx = math.Clamp( offsetx, -1000, 1000 ) - offsety = math.Clamp( offsety, -1000, 1000 ) - offsetz = math.Clamp( offsetz, -1000, 1000 ) + filter = math.Clamp( filter, 0, 2 ) + sizex = math.Clamp( sizex, -1000, 1000 ) + sizey = math.Clamp( sizey, -1000, 1000 ) + sizez = math.Clamp( sizez, -1000, 1000 ) + offsetx = math.Clamp( offsetx, -1000, 1000 ) + offsety = math.Clamp( offsety, -1000, 1000 ) + offsetz = math.Clamp( offsetz, -1000, 1000 ) self.model = model self.filter = filter self.owneronly = owneronly diff --git a/lua/entities/gmod_wire_trigger_entity.lua b/lua/entities/gmod_wire_trigger_entity.lua index 98901ab9..2676d7bc 100644 --- a/lua/entities/gmod_wire_trigger_entity.lua +++ b/lua/entities/gmod_wire_trigger_entity.lua @@ -46,12 +46,12 @@ function ENT:EndTouch( ent ) local owner = self:GetTriggerEntity() if not IsValid( owner ) then return end - for i = 1, #self.EntsInside do + for i = 1, #self.EntsInside do if self.EntsInside[ i ] == ent then - table.remove( self.EntsInside, i ) - end + table.remove( self.EntsInside, i ) + end end - + WireLib.TriggerOutput( owner, "EntCount", #self.EntsInside ) WireLib.TriggerOutput( owner, "Entities", self.EntsInside ) diff --git a/lua/entities/gmod_wire_turret.lua b/lua/entities/gmod_wire_turret.lua index 6bac6439..4f3d6b00 100644 --- a/lua/entities/gmod_wire_turret.lua +++ b/lua/entities/gmod_wire_turret.lua @@ -39,7 +39,7 @@ function ENT:FireShot() local Attachment = self:GetAttachment( 1 ) -- Get the shot angles and stuff. - local shootOrigin = Attachment.Pos + self:GetVelocity() * engine.TickInterval() + local shootOrigin = Attachment.Pos + self:GetVelocity() * engine.TickInterval() local shootAngles = self:GetAngles() -- Shoot a bullet @@ -99,7 +99,7 @@ function ENT:Setup(delay, damage, force, sound, numbullets, spread, tracer, trac else self.delay = delay end - + self.damage = damage self.force = force -- Preventing client crashes @@ -108,7 +108,7 @@ function ENT:Setup(delay, damage, force, sound, numbullets, spread, tracer, trac else self.sound = sound end - + if not game.SinglePlayer() then self.numbullets = math.Clamp( numbullets, 1, 10 ) -- clamp num bullets if it's not single player else diff --git a/lua/entities/gmod_wire_twoway_radio.lua b/lua/entities/gmod_wire_twoway_radio.lua index 4b4514b6..54802a90 100644 --- a/lua/entities/gmod_wire_twoway_radio.lua +++ b/lua/entities/gmod_wire_twoway_radio.lua @@ -84,7 +84,7 @@ function ENT:LinkEnt( other ) --to a different one, then tell it to unlink self.Other.UnlinkEnt() end - + local id = Radio_GetTwoWayID() self:RadioLink(other, id) other:RadioLink(self, id) diff --git a/lua/entities/gmod_wire_value.lua b/lua/entities/gmod_wire_value.lua index e6bb05ce..9a4ebc17 100644 --- a/lua/entities/gmod_wire_value.lua +++ b/lua/entities/gmod_wire_value.lua @@ -24,16 +24,16 @@ local types_lookup = { function ENT:SetupLegacy( values ) local new = {} - + for k,v in pairs( values ) do local tp, val = string.match( v, "^ *([^: ]+) *:(.*)$" ) tp = string.upper(tp or "NORMAL") - + if types_lookup[tp] then new[#new+1] = { DataType = tp, Value = val or v } end end - + self.LegacyOutputs = true self:Setup( new ) end @@ -83,24 +83,24 @@ end function ENT:Setup( valuesin ) if not valuesin then return end - + local _, val = next( valuesin ) if not val then WireLib.AddNotify( self:GetPlayer(), "Constant Value: No values found!", NOTIFY_ERROR, 5, NOTIFYSOUND_ERROR1 ) elseif not istable( val ) then -- old dupe self:SetupLegacy( valuesin ) else - self.value = valuesin -- Wirelink/Duplicator Info - + self.value = valuesin -- Wirelink/Duplicator Info + local names = {} local types = {} local values = {} local descs = {} - + for k,v in pairs(valuesin) do v.DataType = string.upper( v.DataType ) if v.DataType == "NUMBER" then v.DataType = "NORMAL" end - + if types_lookup[string.upper( v.DataType )] ~= nil then names[k] = tostring( k ) types[k] = string.upper( v.DataType ) @@ -114,9 +114,9 @@ function ENT:Setup( valuesin ) descs[k] = "*ERROR*" end end - + if self.LegacyOutputs then - -- Gmod12 Constant Values will have outputs like Value1, Value2... + -- Gmod12 Constant Values will have outputs like Value1, Value2... -- To avoid breaking old dupes, we'll use those names if we're created from an old dupe for k,v in pairs(names) do names[k] = "Value"..v diff --git a/lua/entities/gmod_wire_vectorthruster.lua b/lua/entities/gmod_wire_vectorthruster.lua index b3b39e5d..dc383934 100644 --- a/lua/entities/gmod_wire_vectorthruster.lua +++ b/lua/entities/gmod_wire_vectorthruster.lua @@ -46,7 +46,7 @@ function ENT:GetNormal() ) end -if CLIENT then +if CLIENT then function ENT:Initialize() self.ShouldDraw = 1 self.EffectAvg = 0 @@ -87,7 +87,7 @@ if CLIENT then return (self:LocalToWorld(self:GetNormal()) - self:GetPos()):GetNormalized() end end - + return -- No more client end @@ -127,7 +127,7 @@ function ENT:Initialize() self:SetOffset(self.ThrustOffset) self:SetNormal(self.ThrustNormal) - + self:StartMotionController() self:Switch( false ) @@ -176,7 +176,7 @@ function ENT:SetForce( force, mul ) self.ForceLinear, self.ForceAngle = phys:CalculateVelocityOffset( ThrusterWorldForce, ThrusterWorldPos ); self.ForceLinear = phys:WorldToLocalVector( self.ForceLinear ) - + if self.neteffect then -- self.ForceLinear is 0 if the thruster is frozen self.effectforce = ThrusterWorldForce:Length() @@ -195,7 +195,7 @@ function ENT:Setup(force, force_min, force_max, oweffect, uweffect, owater, uwat self.owater = owater self.uwater = uwater self.angleinputs = angleinputs - + -- Preventing client crashes local BlockedChars = '["?]' if ( string.find(soundname, BlockedChars) ) then @@ -251,7 +251,7 @@ function ENT:TriggerInput(iname, value) self.ThrustNormal = Vector( self.X, self.Y, self.Z ):GetNormalized() self:SetNormal( self.ThrustNormal ) -- Tell the client the unadulterated vector - + if self.mode == 2 then self.ThrustNormal = Vector( self.X, self.Y, 0 ):GetNormalized() end diff --git a/lua/entities/gmod_wire_vehicle.lua b/lua/entities/gmod_wire_vehicle.lua index 051f3509..7889feac 100644 --- a/lua/entities/gmod_wire_vehicle.lua +++ b/lua/entities/gmod_wire_vehicle.lua @@ -9,7 +9,7 @@ function ENT:Initialize() self:PhysicsInit( SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_VPHYSICS ) self:SetSolid( SOLID_VPHYSICS ) - + self.Inputs = Wire_CreateInputs( self, { "Throttle", "Steering", "Handbrake", "Engine", "Lock" } ) end @@ -69,4 +69,4 @@ function ENT:ApplyDupeInfo(ply, ent, info, GetEntByID) self.Vehicle = GetEntByID(info.Vehicle) end -duplicator.RegisterEntityClass("gmod_wire_vehicle", WireLib.MakeWireEnt, "Data") \ No newline at end of file +duplicator.RegisterEntityClass("gmod_wire_vehicle", WireLib.MakeWireEnt, "Data") diff --git a/lua/entities/gmod_wire_wheel.lua b/lua/entities/gmod_wire_wheel.lua index 35c9c8c2..2eb570c2 100644 --- a/lua/entities/gmod_wire_wheel.lua +++ b/lua/entities/gmod_wire_wheel.lua @@ -30,7 +30,7 @@ function ENT:Setup(fwd, bck, stop, torque, direction, axis) if torque then self:SetTorque(math.max(1, torque)) end if direction then self:SetDirection( direction ) end if axis then self.Axis = axis end - + self:UpdateOverlayText() end @@ -38,11 +38,11 @@ function ENT:UpdateOverlayText(speed) local motor = self:GetMotor() local friction = 0 if IsValid(motor) then friction = motor.friction end - self:SetOverlayText( + self:SetOverlayText( "Torque: " .. math.floor( self.BaseTorque ) .. - "\nFriction: " .. friction .. - "\nSpeed: " .. (speed or 0) .. - "\nBreak: " .. self.Breaking .. + "\nFriction: " .. friction .. + "\nSpeed: " .. (speed or 0) .. + "\nBreak: " .. self.Breaking .. "\nSpeedMod: " .. math.floor( self.SpeedMod * 100 ) .. "%" ) end @@ -84,7 +84,7 @@ function ENT:Forward( mul ) mul = mul or 1 local mdir = Motor.direction local Speed = mdir * mul * (self.BaseTorque / WHEEL_BASE_TORQUE) * (1 + self.SpeedMod) - + self:UpdateOverlayText(mul ~= 0 and (mdir * mul * (1 + self.SpeedMod)) or 0) Motor:Fire( "Scale", Speed, 0 ) diff --git a/lua/entities/sent_deployableballoons.lua b/lua/entities/sent_deployableballoons.lua index 624795d5..618fc96e 100644 --- a/lua/entities/sent_deployableballoons.lua +++ b/lua/entities/sent_deployableballoons.lua @@ -158,7 +158,7 @@ end function ENT:DeployBalloons() local balloon balloon = ents.Create("gmod_balloon") --normal balloon - + local model = BalloonTypes[self.balloonType] if(model==nil) then model = BalloonTypes[1] @@ -198,7 +198,7 @@ function ENT:DeployBalloons() hitPos = hitEntity:WorldToLocal(hitPos) local constraint, rope = constraint.Rope( - balloon, hitEntity, 0, trace.PhysicsBone, balloonPos, hitPos, + balloon, hitEntity, 0, trace.PhysicsBone, balloonPos, hitPos, 0, self.rl, 0, 1.5, material, false) if constraint then balloon:DeleteOnRemove(constraint) diff --git a/lua/weapons/gmod_tool/stools/wire_adv.lua b/lua/weapons/gmod_tool/stools/wire_adv.lua index faf9b6dc..64ff1874 100644 --- a/lua/weapons/gmod_tool/stools/wire_adv.lua +++ b/lua/weapons/gmod_tool/stools/wire_adv.lua @@ -73,23 +73,23 @@ if SERVER then types[num] = v.Type descs[num] = v.Desc end - + names[x+1] = "wirelink" types[x+1] = "WIRELINK" descs[x+1] = "" - + WireLib.AdjustSpecialOutputs( ent, names, types, descs ) else WireLib.CreateSpecialOutputs( ent, { "wirelink" }, { "WIRELINK" } ) end - + ent.extended = true WireLib.TriggerOutput( ent, "wirelink", ent ) end duplicator.StoreEntityModifier( ent, "CreateWirelinkOutput", data ) end duplicator.RegisterEntityModifier( "CreateWirelinkOutput", WireLib.CreateWirelinkOutput ) - + function WireLib.CreateEntityOutput( ply, ent, data ) if data[1] == true then if ent.Outputs then @@ -105,50 +105,50 @@ if SERVER then types[num] = v.Type descs[num] = v.Desc end - + names[x+1] = "entity" types[x+1] = "ENTITY" descs[x+1] = "" - + WireLib.AdjustSpecialOutputs( ent, names, types, descs ) else WireLib.CreateSpecialOutputs( ent, { "entity" }, { "ENTITY" } ) end - + WireLib.TriggerOutput( ent, "entity", ent ) end duplicator.StoreEntityModifier( ent, "CreateEntityOutput", data ) end duplicator.RegisterEntityModifier( "CreateEntityOutput", WireLib.CreateEntityOutput ) - - + + ----------------------------------------------------------------- -- Receving data from client ----------------------------------------------------------------- - + util.AddNetworkString( "wire_adv_upload" ) net.Receive( "wire_adv_upload", function( len, ply ) local wirings = net.ReadTable() - + local tool = get_active_tool(ply,"wire_adv") if not tool then return end - + local material = tool:GetClientInfo("material") local width = tool:GetClientNumber("width") local color = Color(tool:GetClientNumber("r"), tool:GetClientNumber("g"), tool:GetClientNumber("b")) - + local uid = ply:UniqueID() - + for i=1,#wirings do local wiring = wirings[i] - + local inputentity = wiring[3] local outputentity = wiring[5] - + if IsValid( inputentity ) and IsValid( outputentity ) and hook.Run( "CanTool", ply, WireLib.dummytrace( inputentity ), "wire_adv" ) and hook.Run( "CanTool", ply, WireLib.dummytrace( outputentity ), "wire_adv" ) then - + local inputname = wiring[1] local inputpos = wiring[2] if WireLib.Link_Start( uid, inputentity, inputpos, inputname, material, color, width ) then @@ -158,7 +158,7 @@ if SERVER then end local outputpos = wiring[6] local outputname = wiring[7] - + if outputname == "Create Wirelink" and (not outputentity.Outputs or not outputentity.Outputs["wirelink"]) then WireLib.CreateWirelinkOutput( ply, outputentity, {true} ) outputname = "wirelink" @@ -170,18 +170,18 @@ if SERVER then elseif outputname == "Create Entity" and outputentity.Outputs and outputentity.Outputs["entity"] then outputname = "entity" end - + WireLib.Link_End( uid, outputentity, outputpos, outputname, ply ) end - end + end end end) - + util.AddNetworkString( "wire_adv_unwire" ) net.Receive( "wire_adv_unwire", function( len, ply ) local ent = net.ReadEntity() local tbl = net.ReadTable() - + if hook.Run( "CanTool", ply, WireLib.dummytrace( ent ), "wire_adv" ) then for i=1,#tbl do WireLib.Link_Clear( ent, tbl[i] ) @@ -208,22 +208,22 @@ elseif CLIENT then local inputentity = wiring[3] local outputentity = wiring[5] local outputname = wiring[7] - + if not IsValid(inputentity) or not IsValid(outputentity) or not outputname then -- we don't need to check everything because only these things can possibly be invalid - + table.remove(self.Wiring,i) end end end function TOOL:Upload() self:SanitizeUpload() -- Remove all invalid wirings before sending - + net.Start( "wire_adv_upload" ) net.WriteTable( self.Wiring ) net.SendToServer() - + self:Holster() end function TOOL:Unwire( ent, names ) @@ -232,8 +232,8 @@ elseif CLIENT then net.WriteTable( names ) net.SendToServer() end - - + + ----------------------------------------------------------------- -- GetPorts ----------------------------------------------------------------- @@ -242,9 +242,9 @@ elseif CLIENT then TOOL.CurrentOutputs = nil function TOOL:CachePorts( ent ) local inputs, outputs = WireLib.GetPorts( ent ) - + local copied = false - + if self.ShowWirelink then if outputs then local found = false @@ -260,7 +260,7 @@ elseif CLIENT then outputs = { { "Create Wirelink", "WIRELINK" } } end end - + if self.ShowEntity then if outputs then local found = false @@ -281,7 +281,7 @@ elseif CLIENT then self.CurrentInputs = inputs self.CurrentOutputs = outputs end - + local next_recache = 0 function TOOL:GetPorts( ent ) if IsValid( ent ) then @@ -319,12 +319,12 @@ elseif CLIENT then ----------------------------------------------------------------- -- Wiring helper functions ----------------------------------------------------------------- - + --[[ Wirings table format: self.Wiring[x] = wiring - + where - + wiring = { [1] = inputname, [2] = inputpos, @@ -335,23 +335,23 @@ elseif CLIENT then [7] = outputname, [8] = inputtype, } - + where - + nodes = { [1] = entity, [2] = pos, } ]] - - + + function TOOL:FindWiring( entity, inputname, inputtype ) for i=1,#self.Wiring do local wiring = self.Wiring[i] if wiring[1] == inputname and wiring[3] == entity and wiring[8] == inputtype then return wiring, i end end end - + function TOOL:WireStart( entity, pos, inputname, inputtype ) local wiring, id = self:FindWiring( entity, inputname, inputtype ) if wiring then -- wiring is already started, user wants to cancel it @@ -359,20 +359,20 @@ elseif CLIENT then self:WiringRenderRemove( inputname, inputtype ) return end - + local t = { inputname, entity:WorldToLocal( pos ), entity, {} } t[8] = inputtype self.Wiring[#self.Wiring+1] = t - + if inputtype == "WIRELINK" then self.ShowWirelink = true elseif inputtype == "ENTITY" then self.ShowEntity = true end - + -- Add info to the wiringrender table, which is used to render the "x2" "x3" etc self:WiringRenderAdd( inputname, inputtype ) - + return t end function TOOL:WireNode( wiring, entity, pos ) @@ -387,8 +387,8 @@ elseif CLIENT then wiring[8] = nil -- we don't need to send the type to the server; wasted net message space. Delete it self.NeedsUpload = true -- We want to upload next tick. We don't upload immediately because the client may call this function more this tick (for multi wiring) end - - + + -- This function will help when using ALT to wire, when a single output's type matches but the name does not -- it will allow us to check if only a single output of matching types exist on the entity without looping -- through the entity's outputs several times per frame @@ -401,7 +401,7 @@ elseif CLIENT then local _, outputs = self:GetPorts( ent ) for i=1,#outputs do local outputtype = outputs[i][2] - if self.AutoWiringTypeLookup_t[outputtype] == nil then -- if we haven't found any outputs of this type yet, + if self.AutoWiringTypeLookup_t[outputtype] == nil then -- if we haven't found any outputs of this type yet, self.AutoWiringTypeLookup_t[outputtype] = i -- set the index elseif self.AutoWiringTypeLookup_t[outputtype] ~= nil then -- if we've already found outputs of this type, self.AutoWiringTypeLookup_t[outputtype] = false -- set to false @@ -412,7 +412,7 @@ elseif CLIENT then function TOOL:AutoWiringTypeLookup_Check( inputtype ) return self.AutoWiringTypeLookup_t[inputtype] end - + ----------------------------------------------------------------- -- Mouse buttons ----------------------------------------------------------------- @@ -421,15 +421,15 @@ elseif CLIENT then function TOOL:LeftClick(trace) if self.wtfgarry > CurTime() then return end self.wtfgarry = CurTime() + 0.1 - + local shift = self:GetOwner():KeyDown(IN_SPEED) local alt = self:GetOwner():KeyDown(IN_WALK) - + if IsValid( trace.Entity ) then if self:GetStage() == 0 then local inputs, _ = self:GetPorts( trace.Entity ) if not inputs then return end - + if alt then -- Select everything for i=1,#inputs do self:WireStart( trace.Entity, trace.HitPos, inputs[i][1], inputs[i][2] ) @@ -439,33 +439,33 @@ elseif CLIENT then if not inputs[self.CurrentWireIndex] then return end -- Can happen if theres no inputs, only outputs self:WireStart( trace.Entity, trace.HitPos, inputs[self.CurrentWireIndex][1], inputs[self.CurrentWireIndex][2] ) end - + self:GetOwner():EmitSound( "weapons/airboat/airboat_gun_lastshot" .. math.random(1,2) .. ".wav" ) - + if not shift then self:SetStage(1) -- Set this immediately so the HUD doesn't glitch end - + return elseif self:GetStage() == 1 then local _, outputs = self:GetPorts( trace.Entity ) if not outputs then return end - + self.CurrentEntity = trace.Entity self:AutoWiringTypeLookup( self.CurrentEntity ) - + self:SetStage(2) - + for i=1,#self.Wiring do self:WireEndEntityPos( self.Wiring[i], self.CurrentEntity, trace.HitPos ) end - + if next(outputs,next(outputs)) == nil then -- there's only one element in the table self.wtfgarry = 0 self:LeftClick( trace ) -- wire it right away return end - + self:LoadMemorizedIndex( self.CurrentEntity, true ) -- find first matching output by name or type @@ -480,27 +480,27 @@ elseif CLIENT then if outputs[port][2] == self.Wiring[1][8] and not matchingByType then matchingByType = port end - + port = port + 1 if port > #outputs then port = 1 end until port == oldport or (matchingByName and matchingByType) - + if matchingByName then self.CurrentWireIndex = matchingByName elseif matchingByType then self.CurrentWireIndex = matchingByType end - + self:GetOwner():EmitSound( "weapons/airboat/airboat_gun_lastshot" .. math.random(1,2) .. ".wav" ) return end end - + if self:GetStage() == 2 then local _, outputs = self:GetPorts( self.CurrentEntity ) - + if alt then -- Auto wiring local notwired = 0 local typematched = 0 @@ -512,14 +512,14 @@ elseif CLIENT then for j=1,#outputs do local outputname = outputs[j][1] local outputtype = outputs[j][2] - + if self:IsMatch( inputname, inputtype, outputname, outputtype, true ) then self:WireEndOutputName( wiring, outputname ) found = true break end end - + if not found then -- if we didn't find a matching name & type, check if there's only one matching type (ignoring name) local idx = self:AutoWiringTypeLookup_Check( inputtype ) if idx then @@ -530,13 +530,13 @@ elseif CLIENT then end end end - + if notwired > 0 then WireLib.AddNotify( "Could not find a matching name/type for " .. notwired .. " inputs. They were not wired.", NOTIFY_HINT, 10, NOTIFYSOUND_DRIP1 ) end if typematched > 0 then WireLib.AddNotify( "Could not find a matching name/type for " .. typematched .. " inputs. However, a single output of that type was found, which was used instead.", NOTIFY_HINT, 10, NOTIFYSOUND_DRIP1 ) - end + end else -- Normal wiring local notwired = 0 for i=1,#self.Wiring do @@ -546,22 +546,22 @@ elseif CLIENT then notwired = notwired + 1 end end - + if notwired > 0 then WireLib.AddNotify( "The type did not match for " .. notwired .. " inputs. They were not wired.", NOTIFY_HINT, 5, NOTIFYSOUND_DRIP1 ) end end - + self:SetStage(0) self.WiringRender = {} -- Empty this now so the HUD doesn't glitch self:GetOwner():EmitSound( "weapons/airboat/airboat_gun_lastshot" .. math.random(1,2) .. ".wav" ) end end - + function TOOL:RightClick(trace) if self.wtfgarry > CurTime() then return end self.wtfgarry = CurTime() + 0.1 - + if self:GetStage() == 0 or self:GetStage() == 2 then self:ScrollDown(trace) elseif IsValid(trace.Entity) and self:GetStage() == 1 then @@ -574,7 +574,7 @@ elseif CLIENT then function TOOL:Reload(trace) if self.wtfgarry > CurTime() then return end self.wtfgarry = CurTime() + 0.1 - + if self:GetStage() == 0 and IsValid( trace.Entity ) and WireLib.HasPorts( trace.Entity ) then local inputs, outputs = self:GetPorts( trace.Entity ) if not inputs then return end @@ -593,7 +593,7 @@ elseif CLIENT then self:GetOwner():EmitSound( "weapons/airboat/airboat_gun_lastshot" .. math.random(1,2) .. ".wav" ) end - + function TOOL:Scroll(trace,dir) local ent = self:GetStage() == 0 and trace.Entity or self.CurrentEntity if IsValid(ent) then @@ -601,10 +601,10 @@ elseif CLIENT then if not inputs and not outputs then return end local check = self:GetStage() == 0 and inputs or outputs if #check == 0 then return end - + local b = false local oldport = self.CurrentWireIndex - + if self:GetStage() == 2 then repeat self.CurrentWireIndex = self.CurrentWireIndex + dir @@ -616,14 +616,14 @@ elseif CLIENT then until not self:IsBlocked( "Outputs", outputs, ent, self.CurrentWireIndex ) or self.CurrentWireIndex == oldport else self.CurrentWireIndex = self.CurrentWireIndex + dir - + if self.CurrentWireIndex > #check then self.CurrentWireIndex = 1 elseif self.CurrentWireIndex < 1 then self.CurrentWireIndex = #check end end - + if oldport ~= self.CurrentWireIndex then ent:SetNWString("BlinkWire", check[self.CurrentWireIndex][1]) self:GetOwner():EmitSound("weapons/pistol/pistol_empty.wav") @@ -631,48 +631,48 @@ elseif CLIENT then return true end end - + function TOOL:ScrollUp(trace) return self:Scroll(trace,-1) end function TOOL:ScrollDown(trace) return self:Scroll(trace,1) end - + local function hookfunc( ply, bind, pressed ) if not pressed then return end - + if bind == "invnext" then local self = get_active_tool(ply, "wire_adv") if not self then return end - + return self:ScrollDown(ply:GetEyeTraceNoCursor()) elseif bind == "invprev" then local self = get_active_tool(ply, "wire_adv") if not self then return end - + return self:ScrollUp(ply:GetEyeTraceNoCursor()) elseif bind == "impulse 100" and ply:KeyDown( IN_SPEED ) then local self = get_active_tool(ply, "wire_adv") if not self then self = get_active_tool(ply, "wire_debugger") if not self then return end - + spawnmenu.ActivateTool( "wire_adv") -- switch back to wire adv return true end - + spawnmenu.ActivateTool("wire_debugger") -- switch to debugger return true end end - + if game.SinglePlayer() then -- wtfgarry (have to have a delay in single player or the hook won't get added) timer.Simple(5,function() hook.Add( "PlayerBindPress", "wire_adv_playerbindpress", hookfunc ) end) else hook.Add( "PlayerBindPress", "wire_adv_playerbindpress", hookfunc ) end - + ----------------------------------------------------------------- -- Remember wire indexes ----------------------------------------------------------------- - + -- Remember wire index positions for entities TOOL.WireIndexMemory = {} TOOL.AimingEnt = nil @@ -682,7 +682,7 @@ elseif CLIENT then if self:GetStage() == 2 and self.CurrentEntity ~= ent then -- if you aim away during stage 2, don't change CurrentWireIndex return end - + -- Memorize selected input if IsValid(self.AimingEnt) and not forceload then if not self.WireIndexMemory[self.AimingEnt] then @@ -694,12 +694,12 @@ elseif CLIENT then self.WireIndexMemory[self.AimingEnt][self.AimingStage] = self.CurrentWireIndex self.WireIndexMemory[self.AimingEnt:GetClass()][self.AimingStage] = self.CurrentWireIndex -- save to class as well end - + -- Clear blinking wire if IsValid( self.AimingEnt ) then self.AimingEnt:SetNWString("BlinkWire", "") end - + if IsValid( ent ) then -- Retrieve memorized selected input if self.WireIndexMemory[ent] and self.WireIndexMemory[ent][self:GetStage()] then @@ -709,48 +709,48 @@ elseif CLIENT then else self.CurrentWireIndex = 1 end - + -- Clamp index local inputs, outputs = self:GetPorts( ent ) local check = self:GetStage() == 0 and inputs or outputs if check then self.CurrentWireIndex = math.Clamp( self.CurrentWireIndex, 1, #check ) - + -- Set blinking wire if check[self.CurrentWireIndex] then ent:SetNWString("BlinkWire", check[self.CurrentWireIndex][1]) end end end - + self.AimingEnt = ent self.AimingStage = self:GetStage() end end - + ----------------------------------------------------------------- -- Think ----------------------------------------------------------------- function TOOL:Think() local ent = self:GetOwner():GetEyeTrace().Entity self:LoadMemorizedIndex( ent ) - + -- Check for holding shift etc local shift = self:GetOwner():KeyDown( IN_SPEED ) - + if #self.Wiring > 0 and self:GetStage() == 0 and not shift then self:SetStage(1) elseif #self.Wiring > 0 and self:GetStage() == 1 and shift then self:SetStage(0) end - + -- Check if we need to upload if self.NeedsUpload then self.NeedsUpload = false self:Upload() end end - + ----------------------------------------------------------------- -- HUD Stuff ----------------------------------------------------------------- @@ -760,15 +760,15 @@ elseif CLIENT then if alt then -- if we're holding alt, highlight all outputs that will be wired to local outputname = tbl[idx][1] local outputtype = tbl[idx][2] - + for i=1,#self.WiringRender do local inputname = self.WiringRender[i][1] local inputtype = self.WiringRender[i][2] - + if self:IsMatch( inputname, inputtype, outputname, outputtype, true ) then return true end - + local _idx = self:AutoWiringTypeLookup_Check( inputtype ) if _idx then local _outputtype = tbl[_idx][2] @@ -782,10 +782,10 @@ elseif CLIENT then end elseif name == "Selected" and self:GetStage() == 2 and alt then -- highlight all selected inputs that will be wired local inputs, outputs = self:GetPorts( ent ) - + local inputname = tbl[idx][1] local inputtype = tbl[idx][2] - + for i=1,#outputs do local outputname = outputs[i][1] local outputtype = outputs[i][2] @@ -793,7 +793,7 @@ elseif CLIENT then return true end end - + local _idx = self:AutoWiringTypeLookup_Check( inputtype ) if _idx then return true @@ -805,7 +805,7 @@ elseif CLIENT then end return false end - + function TOOL:IsBlocked( name, tbl, ent, idx ) if name == "Outputs" and self:GetStage() > 0 then -- Gray out the ones that we can't wire any of the selected inputs to for i=1,#self.WiringRender do @@ -831,14 +831,14 @@ elseif CLIENT then end return false end - + local function getName( input ) local name = input[1] local tp = input[8] or (type(input[2]) == "string" and input[2] or "") local desc = (IsEntity(input[3]) and "" or input[3]) or "" return name .. (desc ~= "" and " (" .. desc .. ")" or "") .. (tp ~= "NORMAL" and " [" .. tp.. "]" or "") end - + local function getWidthHeight( inputs ) local width, height = 0, 0 for i=1,#inputs do @@ -853,15 +853,15 @@ elseif CLIENT then end return width, height end - + local fontData = {font = "Trebuchet24"} -- 24 and 18 are stock for _,size in pairs({22,20,16,14}) do fontData.size = size surface.CreateFont("Trebuchet"..size, fontData) end - + local fontheights - + local function getFontSizes() fontheights = {} for i=14,24,2 do @@ -870,7 +870,7 @@ elseif CLIENT then fontheights[fontname] = h end end - + TOOL.CurrentFont = "Trebuchet24" -- Find the largest font that can fit `lines` lines of text into a box `maxsize` -- tall. Set that font as current, and return the size of one line of text. @@ -881,7 +881,7 @@ elseif CLIENT then end local minFontSize = 14 - + for i=24, minFontSize, -2 do local fontname = "Trebuchet" .. i local height = fontheights[fontname] @@ -891,36 +891,36 @@ elseif CLIENT then local w, _ = surface.GetTextSize( "Selected:" ) return w, height end - end + end end - + function TOOL:DrawList( name, tbl, ent, x, y, w, h, fonth ) draw.RoundedBox( 6, x, y, w+16, h+14, Color(50,50,75,192) ) - + x = x + 8 y = y + 2 - + local temp,_ = surface.GetTextSize( name .. ":" ) surface.SetTextColor( Color(255,255,255,255) ) surface.SetTextPos( x-temp/2+w/2, y ) surface.DrawText( name .. ":" ) surface.SetDrawColor( Color(255,255,255,255) ) surface.DrawLine( x, y + fonth+2, x+w, y + fonth+2 ) - + y = y + 6 - + -- Draw inputs for i=1,#tbl do y = y + fonth - + local highlighted, diffcolor = self:IsHighlighted( name, tbl, ent, i ) if highlighted then - local clr = Color(0,150,0,192) + local clr = Color(0,150,0,192) if diffcolor and (self.CurrentWireIndex == i or self:GetOwner():KeyDown( IN_WALK )) then clr = Color(100,100,175,192) elseif diffcolor then clr = Color(0,0,150,192) end draw.RoundedBox( 4, x-4,y, w+8,fonth+2, clr ) end - + if tbl[i][4] == true then surface.SetTextColor( Color(255,0,0,255) ) elseif self:IsBlocked( name, tbl, ent, i ) then @@ -928,7 +928,7 @@ elseif CLIENT then else surface.SetTextColor( Color(255,255,255,255) ) end - + if tbl[i][9] and tbl[i][9] > 1 then surface.SetFont( "Trebuchet14" ) local tempw, temph = surface.GetTextSize( "x" .. tbl[i][9] ) @@ -936,7 +936,7 @@ elseif CLIENT then surface.DrawText( "x" .. tbl[i][9] ) surface.SetFont( self.CurrentFont ) end - + surface.SetTextPos( x, y ) surface.DrawText( getName( tbl[i] ) ) end @@ -944,7 +944,7 @@ elseif CLIENT then function TOOL:DrawHUD() local centerx, centery = ScrW()/2, ScrH()/2 - + local ent = self:GetStage() == 2 and self.CurrentEntity or self:GetOwner():GetEyeTrace().Entity local maxwidth = 0 if IsValid( ent ) then @@ -959,7 +959,7 @@ elseif CLIENT then local y = centery-hh/2-16 self:DrawList( "Inputs", inputs, ent, x, y, ww, hh, h ) end - + if outputs and #outputs > 0 and self:GetStage() > 0 then local w, h = self:fitFont( #outputs, ScrH() - 32 ) local ww, hh = getWidthHeight( outputs ) @@ -970,8 +970,8 @@ elseif CLIENT then self:DrawList( "Outputs", outputs, ent, x, y, ww, hh, h ) end end - - if #self.WiringRender > 0 then + + if #self.WiringRender > 0 then local w, h = self:fitFont( #self.WiringRender, ScrH() - 32 ) local ww, hh = getWidthHeight( self.WiringRender ) local ww = math.max(ww,w) @@ -981,7 +981,7 @@ elseif CLIENT then self:DrawList( "Selected", self.WiringRender, ent, x, y, ww, hh, h ) end end - + ----------------------------------------------------------------- -- Wiring Render @@ -997,7 +997,7 @@ elseif CLIENT then return (outputname == inputname and outputtype == inputtype) end end - + function TOOL:WiringRenderFind( inputname, inputtype ) for i=1,#self.WiringRender do local wiringrender = self.WiringRender[i] @@ -1006,10 +1006,10 @@ elseif CLIENT then end end end - + function TOOL:WiringRenderRemove( inputname, inputtype ) local wiringrender, idx = self:WiringRenderFind( inputname, inputtype ) - + if wiringrender then wiringrender[9] = wiringrender[9] - 1 if wiringrender[9] == 0 then @@ -1017,10 +1017,10 @@ elseif CLIENT then end end end - + function TOOL:WiringRenderAdd( inputname, inputtype ) local wiringrender = self:WiringRenderFind( inputname, inputtype ) - + if wiringrender then wiringrender[9] = wiringrender[9] + 1 else diff --git a/lua/weapons/remotecontroller.lua b/lua/weapons/remotecontroller.lua index 172f8dfe..27f12a44 100644 --- a/lua/weapons/remotecontroller.lua +++ b/lua/weapons/remotecontroller.lua @@ -93,7 +93,7 @@ function SWEP:Off() self.Active = nil self.OldMoveType = nil ply:DrawViewModel(true) - + if IsValid(self.Linked) then self.Linked:PlayerExited(ply) end diff --git a/lua/wire/client/cl_modelplug.lua b/lua/wire/client/cl_modelplug.lua index 53f637b9..7fa41ff1 100644 --- a/lua/wire/client/cl_modelplug.lua +++ b/lua/wire/client/cl_modelplug.lua @@ -6,7 +6,7 @@ CreateConVar("cl_showmodeltextbox", "0") -- Loads and converts model lists from the old WireModelPacks format do local converted = {} - + MsgN("WM: Loading models...") for _,filename in ipairs( file.Find("WireModelPacks/*", "DATA") ) do @@ -31,7 +31,7 @@ do end end MsgN("End loading models") - + file.Write("converted.txt", table.concat(converted, "\n")) end ]] diff --git a/lua/wire/client/customspawnmenu.lua b/lua/wire/client/customspawnmenu.lua index 28d313e8..bd5a7b19 100644 --- a/lua/wire/client/customspawnmenu.lua +++ b/lua/wire/client/customspawnmenu.lua @@ -19,7 +19,7 @@ local function expandall( bool, nodes ) nodes[i]:SetExpanded( bool ) if nodes[i].WireCookieText then cookie.Set( nodes[i].WireCookieText, bool and 1 or 0 ) end end - + if nodes[i].ChildNodes then expandall( bool, nodes[i].ChildNodes:GetChildren() ) end @@ -29,16 +29,16 @@ end local function expandbycookie( nodes ) for i=1,#nodes do local b = cookie.GetNumber( nodes[i].WireCookieText ) - + if b and b == 1 then nodes[i]:SetExpanded( b and b == 1 ) - + if nodes[i].ChildNodes then expandbycookie( nodes[i].ChildNodes:GetChildren() ) end else nodes[i]:SetExpanded( false ) - end + end end end @@ -50,7 +50,7 @@ function PANEL:Init() self.Divider = vgui.Create( "DHorizontalDivider", self ) self.Divider:Dock( FILL ) self.Divider:SetDividerWidth( 6 ) - + local width = tab_width:GetInt() local divider_width = horizontal_divider_width:GetFloat() if width > ScrW() * 0.6 then -- too big! you won't be able to see the rest of the spawn menu if it's this big, let's make it smaller @@ -62,68 +62,68 @@ function PANEL:Init() elseif width < 390 then -- too small! you won't be able to see the tools, make it bigger width = 390 end - + if width ~= tab_width:GetInt() then -- things changed, update convars divider_width = 0.28 -- reset horizontal divider width RunConsoleCommand( "wire_tool_menu_tab_width", width ) RunConsoleCommand( "wire_tool_menu_horizontal_divider_width", divider_width ) end - + self:SetWide( width ) self.Divider:SetLeftWidth( width * divider_width ) - + local old = self.Divider.OnMouseReleased function self.Divider.OnMouseReleased( ... ) local width_percent = math.Round(self.Divider:GetLeftWidth() / self:GetWide(),2) RunConsoleCommand( "wire_tool_menu_horizontal_divider_width", width_percent ) old( ... ) end - + local LeftPanel = vgui.Create( "DPanel" ) self.Divider:SetLeft( LeftPanel ) - + local SearchBoxPanel = vgui.Create( "DPanel", LeftPanel ) SearchBoxPanel:SetTall( 44 ) SearchBoxPanel:DockPadding( 2,2,2,2 ) SearchBoxPanel:Dock( TOP ) - + self.SearchBox = vgui.Create( "DTextEntry", SearchBoxPanel ) self.SearchBox:DockMargin( 2, 2, 2, 0 ) self.SearchBox:Dock( TOP ) self:SetupSearchbox() - + local ExpandAll = vgui.Create( "DCheckBoxLabel", SearchBoxPanel ) -- create this here so that it's below the slider - + self.List = vgui.Create( "DTree", LeftPanel ) - + ExpandAll:SetText( "Expand All" ) ExpandAll:SetConVar( "wire_tool_menu_expand_all" ) ExpandAll:DockMargin( 4, 4, 0, 0 ) ExpandAll:Dock( BOTTOM ) - + local first = true - + local parent = self local oldval function ExpandAll:OnChange( value ) if oldval == value then return end -- wtfgarry oldval = value - + local childNodes = parent.List:Root().ChildNodes:GetChildren() - + if first then -- this was the only way to get this to run at the right time... garry bypassing hacks wohoo -- it works because DCheckBox:OnChange is called when the player first sees the checkbox (aka when they open the wire tool tab) first = false - expandbycookie( childNodes ) + expandbycookie( childNodes ) else expandall( value, childNodes ) end end ExpandAll.Label:SetDark(true) - + self.List:Dock( FILL ) - + self.SearchList = vgui.Create( "DListView", LeftPanel ) local x,y = self.List:GetPos() local w,h = self.List:GetSize() @@ -133,7 +133,7 @@ function PANEL:Init() self.SearchList:AddColumn( "Name" ) self.SearchList:AddColumn( "Category" ) self.SearchList:SetMultiSelect( false ) - + function self.SearchList:OnClickLine( line ) -- Deselect old local t = self:GetSelected() @@ -144,7 +144,7 @@ function PANEL:Init() line:SetSelected(true) -- Select new spawnmenu.ActivateTool( line.Name ) end - + self.Content = vgui.Create( "DCategoryList" ) self.Divider:SetRight( self.Content ) @@ -152,7 +152,7 @@ function PANEL:Init() function LeftPanel:PerformLayout() searchlist:SetWide( self:GetWide() ) end - + self.ToolTable = {} self.OriginalToolTable = {} self.CategoryLookup = {} @@ -169,10 +169,10 @@ function PANEL:ReloadEverything() self.SearchList:Clear() self.SearchBox:SetValue( "" ) self.SearchBox:OnTextChanged() - + self.CategoryLookup = {} self.ToolTable = {} - + self:LoadToolsFromTable( self.OriginalToolTable ) expandbycookie( self.List:Root().ChildNodes:GetChildren() ) end @@ -197,7 +197,7 @@ function PANEL:SetupSearchbox() clearsearch:SetSize( 14, 10 ) clearsearch:SetVisible( false ) self.SearchBox.clearsearch = clearsearch - + -- OnEnter local parent = self function self.SearchBox:OnEnter( select_next ) @@ -212,10 +212,10 @@ function PANEL:SetupSearchbox() end elseif line == 0 then -- if not tabbed, only select first line if no line is selected parent.SearchList:OnClickLine( parent.SearchList:GetLine( 1 ) ) - end + end end end - + local old = self.SearchBox.OnGetFocus function self.SearchBox:OnGetFocus() if self:GetValue() == "Search..." then -- If "Search...", erase it @@ -223,7 +223,7 @@ function PANEL:SetupSearchbox() end old( self ) end - + -- On lose focus local old = self.SearchBox.OnLoseFocus function self.SearchBox:OnLoseFocus() @@ -237,7 +237,7 @@ function PANEL:SetupSearchbox() old( self ) end end - + -- detecting tab to select next item in search result local old = self.SearchBox.OnKeyCodeTyped function self.SearchBox:OnKeyCodeTyped( code ) @@ -248,13 +248,13 @@ function PANEL:SetupSearchbox() old( self, code ) end end - + self.SearchBox:SetValue( "Search..." ) local searching function self.SearchBox:OnTextChanged() timer.Remove( "wire_customspawnmenu_hidesearchbox" ) - + local text = self:GetValue() if text ~= "" then if not searching then @@ -274,13 +274,13 @@ function PANEL:SetupSearchbox() local line = parent.SearchList:AddLine( result.item.Text, result.item.Category ) line.Name = result.item.ItemName line.WireFavouritesCookieText = result.item.WireFavouritesCookieText - + function line:OnRightClick() -- the menu wasn't clickable unless the search list had focus for some reason parent.SearchList:RequestFocus() - + local menu = DermaMenu() - + local b = cookie.GetNumber( self.WireFavouritesCookieText ) if b and b == 1 then menu:AddOption( "Remove from favourites", function() cookie.Set( self.WireFavouritesCookieText, 0 ) parent:ReloadEverything() end ) @@ -288,7 +288,7 @@ function PANEL:SetupSearchbox() menu:AddOption( "Add to favourites", function() cookie.Set( self.WireFavouritesCookieText, 1 ) parent:ReloadEverything() end ) end menu:Open() - + return true end end @@ -331,7 +331,7 @@ function PANEL:Search( text ) for _, v in pairs( categories ) do local name = language_GetPhrase(string_gsub(v.Text,"^#","")) local lowname = string_lower( name ) - + if string_find( lowname, text, 1, true ) and not string_find( lowname, "(legacy)", 1, true ) and not v.Alias then results[#results+1] = { item = v, @@ -349,12 +349,12 @@ end -- Helper function local function AddNode( list, text, icon, cookietext ) local node = list:AddNode( text, icon ) - + node.Label:SetFont( "DermaDefaultBold" ) - + cookietext = "ToolMenu.Wire." .. cookietext node.WireCookieText = cookietext - + function node:DoClick() if autocollapse:GetBool() then local parent = (list.RootNode and list.RootNode.ChildNodes:GetChildren() or list.ChildNodes:GetChildren()) @@ -363,14 +363,14 @@ local function AddNode( list, text, icon, cookietext ) local b = not self.m_bExpanded self:SetExpanded( b ) - + cookie.Set( cookietext, b and 1 or 0 ) end node.Expander.DoClick = function() node:DoClick() end - + function node:DoRightClick() local menu = DermaMenu() - + local b = self.m_bExpanded if b then menu:AddOption( "Collapse all", function() @@ -384,10 +384,10 @@ local function AddNode( list, text, icon, cookietext ) end ) end menu:Open() - + return true end - + return node end @@ -398,18 +398,18 @@ end ---------------------------------------------------------------------- function PANEL:CreateCategories() for k,v in pairs( self.ToolTable ) do - if istable( v ) then - local category = v.ItemName - + if istable( v ) then + local category = v.ItemName + local expl = string.Explode("/",category) - + if not separate_wire_extras:GetBool() and expl[1] == "Wire Extras" then table.remove( expl, 1 ) v.ItemName = string.gsub( v.ItemName, "Wire Extras/", "" ) v.Text = string.gsub( v.Text, "Wire Extras/", "" ) category = v.ItemName end - + if #expl == 1 then if not self.CategoryLookup[category] then local node = AddNode( self.List, v.Text, v.Icon, category ) @@ -421,10 +421,10 @@ function PANEL:CreateCategories() local node = AddNode( self.List, category, nil, category ) self.CategoryLookup[category] = node end - + for i=2,#expl do local str = expl[i] - + local path = table.concat(expl,"/",1,i) if not self.CategoryLookup[path] then local node = AddNode( self.CategoryLookup[table.concat(expl,"/",1,i-1)], str, nil, path ) @@ -444,29 +444,29 @@ end function PANEL:AddToolToCategories( tool, categories ) for i=1,#categories do local categoryName = categories[i] - + local added = false - + local copy = table.Copy( tool ) copy.Alias = true - - for _, category in pairs( self.ToolTable ) do + + for _, category in pairs( self.ToolTable ) do if category.ItemName == categoryName then added = true category[#category+1] = copy table_SortByMember( category, "Text", true ) end end - + if not added then local new = { ItemName = categoryName, Text = categoryName, } - + new[1] = copy self.ToolTable[#self.ToolTable+1] = new - end + end end end @@ -485,8 +485,8 @@ function PANEL:FixWireCategories() local fav = cookie.GetNumber( "ToolMenu.Wire.Favourites." .. tool.ItemName ) if fav and fav == 1 then self:AddToolToCategories( tool, {"Favourites"} ) - end - + end + -- multi categories if not hide_duplicates:GetBool() then local tooltbl = weapons.Get("gmod_tool").Tool[tool.ItemName] @@ -508,7 +508,7 @@ end function PANEL:LoadToolsFromTable( inTable ) self.OriginalToolTable = table.Copy( inTable ) self.ToolTable = table.Copy( inTable ) - + -- If this tab has no favourites category, add one at the top if self.ToolTable[1].ItemName ~= "Favourites" then table.insert( self.ToolTable, 1, { ItemName = "Favourites", Text = "Favourites", Icon = "icon16/star.png" } ) @@ -517,29 +517,29 @@ function PANEL:LoadToolsFromTable( inTable ) elseif self.ToolTable[1].ItemName == "Favourites" then self.ToolTable[1].Icon = "icon16/star.png" end - + -- First, we copy all tools into their multi categories self:FixWireCategories() - + -- Then we create the categories, so everything goes to the right place self:CreateCategories() - + -- Then, we add all tools to the DTree for k, v in pairs( self.ToolTable ) do - + if ( istable( v ) ) then - + -- Remove these from the table so we can - -- send the rest of the table to the other + -- send the rest of the table to the other -- function - + local Name = v.ItemName local Label = v.Text v.ItemName = nil v.Text = nil v.Icon = nil - - self:AddCategory( Name, Label, v ) + + self:AddCategory( Name, Label, v ) end end end @@ -553,9 +553,9 @@ function PANEL:AddCategory( Name, Label, tItems, CategoryID ) if not Category then return end - + for k, v in pairs( tItems ) do - + v.Category = Label v.CategoryID = CategoryID @@ -569,19 +569,19 @@ function PANEL:AddCategory( Name, Label, tItems, CategoryID ) end end end - + local item = Category:AddNode( v.Text, icon ) - + function item:DoClick() spawnmenu.ActivateTool( self.Name ) end - + local parent = self function item:DoRightClick() local menu = DermaMenu() - + local b = cookie.GetNumber( self.WireFavouritesCookieText ) if b and b == 1 then menu:AddOption( "Remove from favourites", function() cookie.Set( self.WireFavouritesCookieText, 0 ) parent:ReloadEverything() end ) @@ -589,10 +589,10 @@ function PANEL:AddCategory( Name, Label, tItems, CategoryID ) menu:AddOption( "Add to favourites", function() cookie.Set( self.WireFavouritesCookieText, 1 ) parent:ReloadEverything() end ) end menu:Open() - + return true end - + item.WireFavouritesCookieText = "ToolMenu.Wire.Favourites." .. v.ItemName v.WireFavouritesCookieText = item.WireFavouritesCookieText item.ControlPanelBuildFunction = v.CPanelFunction @@ -600,9 +600,9 @@ function PANEL:AddCategory( Name, Label, tItems, CategoryID ) item.Name = v.ItemName item.Controls = v.Controls item.Text = v.Text - + end - + self:InvalidateLayout() end @@ -627,9 +627,9 @@ local function setUpTabReloadOnChange( checkbox ) function checkbox:OnChange( value ) if self.oldval == value then return end -- wtfgarry self.oldval = value - + if self.first then self.first = false return end - + timer.Simple( 0.1, function() if IsValid( wire_tab ) then wire_tab:ReloadEverything() @@ -641,18 +641,18 @@ end local function CreateCPanel( panel ) local checkbox = panel:CheckBox( "Use wire's custom tool menu for all tabs", "wire_tool_menu_custom_menu_for_all_tabs" ) checkbox:SetToolTip( "Requires rejoin to take effect" ) - + if WireLib.WireExtrasInstalled then local SeparateWireExtras = panel:CheckBox( "Separate Wire Extras", "wire_tool_menu_separate_wire_extras" ) SeparateWireExtras:SetToolTip( "Whether or not to separate wire extras tools into its own category." ) setUpTabReloadOnChange( SeparateWireExtras ) end - + local HideDuplicates = panel:CheckBox( "Hide tool duplicates", "wire_tool_menu_hide_duplicates" ) setUpTabReloadOnChange( HideDuplicates ) panel:Help( "It makes sense to have certain tools in multiple categories at once. However, if you don't want this, you can disable it here. The tools will then only appear in their primary category." ) - + local UseIcons = panel:CheckBox( "Use custom icons", "wire_tool_menu_custom_icons" ) setUpTabReloadOnChange( UseIcons ) UseIcons:SetToolTip( "If disabled, all tools will use the 'wrench' icon." ) @@ -706,18 +706,18 @@ hook.Add( "PopulateToolMenu", "Wire_CustomSpawnMenu", function() function ToolMenu:AddToolPanel( Name, ToolTable ) if tabs[ToolTable.Name] or custom_for_all_tabs:GetBool() == true then local Panel = vgui.Create( "WireToolPanel" ) - + if ToolTable.Name == "Wire" then wire_tab = Panel -- for wire tab options menu end all_tabs[#all_tabs+1] = Panel -- list of all registered tabs - + Panel:SetTabID( Name ) Panel:LoadToolsFromTable( ToolTable.Items ) - + self:AddSheet( ToolTable.Label, Panel, ToolTable.Icon ) self.ToolPanels[ Name ] = Panel - else + else return old( self, Name, ToolTable ) end end diff --git a/lua/wire/client/e2_extension_menu.lua b/lua/wire/client/e2_extension_menu.lua index a121b917..fa572464 100644 --- a/lua/wire/client/e2_extension_menu.lua +++ b/lua/wire/client/e2_extension_menu.lua @@ -14,7 +14,7 @@ surface.CreateFont("DermaDefaultItalic", { local function BuildExtensionMenu(panel) local allowed = LocalPlayer():IsSuperAdmin() - + if not allowed then local permissionNotice = panel:Help("You are not a superadmin - you cannot change these settings, only view them.") permissionNotice:SetColor(Color(153, 51, 0, 255)) diff --git a/lua/wire/client/e2helper.lua b/lua/wire/client/e2helper.lua index a3ec1c15..8c7e3909 100644 --- a/lua/wire/client/e2helper.lua +++ b/lua/wire/client/e2helper.lua @@ -429,4 +429,4 @@ hook.Add("Think", "E2Helper_KeyListener", function() E2Helper.Frame:SetVisible(false) end PrevCtrlQ = CtrlQ -end) \ No newline at end of file +end) diff --git a/lua/wire/client/hlzasm/hc_expression.lua b/lua/wire/client/hlzasm/hc_expression.lua index 288dc89f..a6b07731 100644 --- a/lua/wire/client/hlzasm/hc_expression.lua +++ b/lua/wire/client/hlzasm/hc_expression.lua @@ -561,42 +561,42 @@ function HCOMP:Expression_Level0() ) elseif self:MatchToken(self.TOKEN.EQLADD) then -- += local rightLeaf = self:Expression_LevelLeaf(0) - + local operationLeaf = self:NewOpcode("add",leftLeaf,rightLeaf) operationLeaf.ExplictAssign = true operationLeaf.ReturnAfterAssign = true return operationLeaf elseif self:MatchToken(self.TOKEN.EQLSUB) then -- -= local rightLeaf = self:Expression_LevelLeaf(0) - + local operationLeaf = self:NewOpcode("sub",leftLeaf,rightLeaf) operationLeaf.ExplictAssign = true operationLeaf.ReturnAfterAssign = true return operationLeaf elseif self:MatchToken(self.TOKEN.EQLMUL) then -- *= local rightLeaf = self:Expression_LevelLeaf(0) - + local operationLeaf = self:NewOpcode("mul",leftLeaf,rightLeaf) operationLeaf.ExplictAssign = true operationLeaf.ReturnAfterAssign = true return operationLeaf elseif self:MatchToken(self.TOKEN.EQLDIV) then -- /= local rightLeaf = self:Expression_LevelLeaf(0) - + local operationLeaf = self:NewOpcode("div",leftLeaf,rightLeaf) operationLeaf.ExplictAssign = true operationLeaf.ReturnAfterAssign = true return operationLeaf elseif self:MatchToken(self.TOKEN.SHR) then -- >> local rightLeaf = self:Expression_LevelLeaf(0) - + local operationLeaf = self:NewOpcode("bshr",leftLeaf,rightLeaf) operationLeaf.ExplictAssign = true operationLeaf.ReturnAfterAssign = true return operationLeaf elseif self:MatchToken(self.TOKEN.SHL) then -- << local rightLeaf = self:Expression_LevelLeaf(0) - + local operationLeaf = self:NewOpcode("bshl",leftLeaf,rightLeaf) operationLeaf.ExplictAssign = true operationLeaf.ReturnAfterAssign = true diff --git a/lua/wire/client/hlzasm/hc_tokenizer.lua b/lua/wire/client/hlzasm/hc_tokenizer.lua index f5d64e56..916c47e8 100644 --- a/lua/wire/client/hlzasm/hc_tokenizer.lua +++ b/lua/wire/client/hlzasm/hc_tokenizer.lua @@ -341,7 +341,7 @@ function HCOMP:Tokenize() local TOKEN = self.TOKEN token = self.Defines[token] end end - + local is_symbol = false -- If no alphanumeric token fetched, try to fetch the special-character ones @@ -377,21 +377,21 @@ function HCOMP:Tokenize() local TOKEN = self.TOKEN }) return true end - + -- Else it's a two-character symbol token is_symbol = true - + elseif HCOMP.PARSER_SYMBOLS[self.Settings.CurrentLanguage][token] then -- It's a one-character symbol token is_symbol = true - + else -- We have no idea what this is (it's not an identifier character, nor a recognized symbol) self:Error("Unknown character '"..token.."'", tokenPosition.Line,tokenPosition.Col,tokenPosition.File) end end - + assert(token ~= "") -- Determine which token it is @@ -404,7 +404,7 @@ function HCOMP:Tokenize() local TOKEN = self.TOKEN }) return true end - + if is_symbol then -- If we get here something is weird, because why would a symbol be in PARSER_DBCHARS or PARSER_SYMBOLS but not in PARSER_LOOKUP? self:Error("Unknown symbol '"..token.."'", diff --git a/lua/wire/client/sound_browser.lua b/lua/wire/client/sound_browser.lua index b6ca7bf8..18caf1a1 100644 --- a/lua/wire/client/sound_browser.lua +++ b/lua/wire/client/sound_browser.lua @@ -102,7 +102,7 @@ local function GenerateInfoTree(strfile, backnode, count) end end if(!SoundData) then return end - + local strcount = "" if (count) then strcount = " ("..count..")" @@ -113,7 +113,7 @@ local function GenerateInfoTree(strfile, backnode, count) local node = nil local mainnode = nil local subnode = nil - + if (IsValid(backnode)) then mainnode = backnode:AddNode("Sound File"..strcount, "icon16/sound.png") else @@ -121,7 +121,7 @@ local function GenerateInfoTree(strfile, backnode, count) SoundInfoTreeRoot = mainnode end - + do index = "Path" node = mainnode:AddNode(index, "icon16/sound.png") @@ -161,7 +161,7 @@ local function GenerateInfoTree(strfile, backnode, count) mainnode = SoundInfoTree:AddNode("Sound Property", "icon16/table_gear.png") SoundInfoTreeRoot = mainnode end - + do node = mainnode:AddNode("Name", "icon16/sound.png") subnode = node:AddNode(SoundData["name"], "icon16/page.png") @@ -569,7 +569,7 @@ local function CreateSoundBrowser(path, se) TabFileBrowser = vgui.Create("wire_filebrowser") // The file tree browser. TabSoundPropertyList = vgui.Create("wire_soundpropertylist") // The sound property browser. TabFavourites = vgui.Create("wire_listeditor") // The favourites manager. - + TabFileBrowser:SetListSpeed(6) TabFileBrowser:SetMaxItemsPerPage(200) @@ -592,13 +592,13 @@ local function CreateSoundBrowser(path, se) if (!IsValid(parent)) then return end if (!IsValid(node)) then return end parent:SetSelectedItem(node) - + local Clicktime = CurTime() if ((Clicktime - oldClicktime) > 0.3) then oldClicktime = Clicktime return end oldClicktime = Clicktime if (!node.IsSoundNode) then return end - + local file = node:GetText() PlaySound(file, nSoundVolume, nSoundPitch) PlaySoundNoEffect() @@ -653,7 +653,7 @@ local function CreateSoundBrowser(path, se) SplitPanel:SetLeftMin(500) SplitPanel:SetRightMin(150) SplitPanel:SetDividerWidth(3) - + TabFileBrowser:SetRootName("sound") TabFileBrowser:SetRootPath("sound") TabFileBrowser:SetWildCard("GAME") @@ -851,7 +851,7 @@ local function CreateSoundBrowser(path, se) SoundBrowserPanel.PerformLayout = function(self, ...) SoundemitterButton:SetVisible(self.Soundemitter) ClipboardButton:SetVisible(!self.Soundemitter) - + local w = self:GetWide() local rightw = SplitPanel:GetLeftWidth() + w - oldw @@ -874,7 +874,7 @@ local function CreateSoundBrowser(path, se) else ClipboardButton:SetTall(PlayStopPanel:GetTall() - 2) end - + oldw, oldh = self:GetSize() DFrame.PerformLayout(self, ...) @@ -896,7 +896,7 @@ end local function OpenSoundBrowser(pl, cmd, args) local path = args[1] // nil or "" will put the browser in e2 mode else the soundemitter mode is applied. local se = args[2] - + if (!IsValid(SoundBrowserPanel)) then CreateSoundBrowser(path, se) end @@ -940,4 +940,4 @@ local function OpenSoundBrowser(pl, cmd, args) end, SoundBrowserPanel, TabFileBrowser, path, se) end -concommand.Add("wire_sound_browser_open", OpenSoundBrowser) \ No newline at end of file +concommand.Add("wire_sound_browser_open", OpenSoundBrowser) diff --git a/lua/wire/client/thrusterlib.lua b/lua/wire/client/thrusterlib.lua index 888df664..6eae7332 100644 --- a/lua/wire/client/thrusterlib.lua +++ b/lua/wire/client/thrusterlib.lua @@ -232,7 +232,7 @@ WireLib.ThrusterEffectDraw.fire_smoke = function(self) local vOffset = self:LocalToWorld(self:GetOffset()) local vNormal = self:CalcNormal() - + self.EffectAvg = ( self.EffectAvg * 29 + math.min( self:GetNWFloat("Thrust") / 100000, 100 ) ) / 30 local Magnitude = self.EffectAvg @@ -314,7 +314,7 @@ WireLib.ThrusterEffectDraw.fire_smoke_big = function(self) particle:SetRoll( math.Rand( -0.2, 0.2 ) ) particle:SetColor( 200, 200, 210 ) - + local effectdata = EffectData() effectdata:SetOrigin( vOffset ) @@ -1365,5 +1365,5 @@ WireLib.ThrusterEffectThink.bubble = function(self) particle:SetEndSize( 0 ) particle:SetRoll( 0 ) - + end diff --git a/lua/wire/client/wire_expression2_browser.lua b/lua/wire/client/wire_expression2_browser.lua index 1bc17823..42189847 100644 --- a/lua/wire/client/wire_expression2_browser.lua +++ b/lua/wire/client/wire_expression2_browser.lua @@ -40,14 +40,14 @@ local string_lower = string.lower function PANEL:Search( str, foldername, fullpath, parentfullpath, first_recursion ) if not self.SearchFolders[fullpath] then self.SearchFolders[fullpath] = (self.SearchFolders[parentfullpath] or self.Folders):AddNode( foldername ) - + local files, folders = file.Find( fullpath .. "/*", "DATA" ) - + local node = self.SearchFolders[fullpath] if fullpath == self.startfolder then self.Root = node end -- get root node.Icon:SetImage( "icon16/arrow_refresh.png" ) node:SetExpanded( true ) - + local myresults = 0 for i=1,#files do if string_find( string_lower( files[i] ), str, 1, true ) ~= nil then @@ -55,10 +55,10 @@ function PANEL:Search( str, foldername, fullpath, parentfullpath, first_recursio filenode:SetFileName( fullpath .. "/" .. files[i] ) myresults = myresults + 1 end - + coroutine.yield() end - + if #folders == 0 then if myresults == 0 then if node ~= self.Root then node:Remove() end @@ -68,7 +68,7 @@ function PANEL:Search( str, foldername, fullpath, parentfullpath, first_recursio return false, myresults end end - + node.Icon:SetImage( "icon16/folder.png" ) if first_recursion then coroutine.yield( true, myresults ) @@ -81,11 +81,11 @@ function PANEL:Search( str, foldername, fullpath, parentfullpath, first_recursio if b then myresults = myresults + res end - + coroutine.yield() end - - + + if myresults > 0 then node.Icon:SetImage( "icon16/folder.png" ) if first_recursion then @@ -103,7 +103,7 @@ function PANEL:Search( str, foldername, fullpath, parentfullpath, first_recursio end end end - + if first_recursion then coroutine.yield( false, 0 ) else @@ -128,13 +128,13 @@ end function PANEL:StartSearch( str ) self:UpdateFolders( true ) - + self.SearchFolders = {} - + local crt = coroutine.create( self.Search ) local status, bool, count = coroutine.resume( crt, self, str, self.startfolder, self.startfolder, "", true ) self:CheckSearchResults( status, bool, count ) - + timer.Create( "wire_expression2_search", 0, 0, function() for i=1,100 do -- Load loads of files/folders at a time local status, bool, count = coroutine.resume( crt ) @@ -148,12 +148,12 @@ end function PANEL:Init() self:SetDrawBackground(false) - + self.SearchBox = vgui.Create( "DTextEntry", self ) self.SearchBox:Dock( TOP ) self.SearchBox:DockMargin( 0,0,0,0 ) self.SearchBox:SetValue( "Search..." ) - + local clearsearch = vgui.Create( "DImageButton", self.SearchBox ) clearsearch:SetMaterial( "icon16/cross.png" ) local src = self.SearchBox @@ -166,8 +166,8 @@ function PANEL:Init() clearsearch:Dock( RIGHT ) clearsearch:SetSize( 14, 10 ) clearsearch:SetVisible( false ) - - + + local old = self.SearchBox.OnGetFocus function self.SearchBox:OnGetFocus() if self:GetValue() == "Search..." then -- If "Search...", erase it @@ -175,7 +175,7 @@ function PANEL:Init() end old( self ) end - + -- On lose focus local old = self.SearchBox.OnLoseFocus function self.SearchBox:OnLoseFocus() @@ -184,13 +184,13 @@ function PANEL:Init() end old( self ) end - + function self.SearchBox.OnEnter() local str = self.SearchBox:GetValue() - + if str ~= "" then self:StartSearch( string.Replace( string.lower( str ), " ", "_" ) ) - + clearsearch:SetVisible( true ) else timer.Remove( "wire_expression2_search" ) @@ -310,7 +310,7 @@ function PANEL:UpdateFolders( empty ) if IsValid(self.Root) then self.Root:Remove() end - + if not empty then self.Root = self.Folders.RootNode:AddFolder(self.startfolder, self.startfolder, "DATA", true) self.Root:SetExpanded(true) @@ -398,4 +398,4 @@ end PANEL.Refresh = PANEL.UpdateFolders -- self:Refresh() is common -vgui.Register("wire_expression2_browser", PANEL, "DPanel") \ No newline at end of file +vgui.Register("wire_expression2_browser", PANEL, "DPanel") diff --git a/lua/wire/client/wire_filebrowser.lua b/lua/wire/client/wire_filebrowser.lua index 7d7bfa8c..2af9cbd6 100644 --- a/lua/wire/client/wire_filebrowser.lua +++ b/lua/wire/client/wire_filebrowser.lua @@ -457,7 +457,7 @@ function PANEL:LayoutPages(forcelayout) for i=1, self.m_nPageCount do local button = self.PageChooseNumbers.Buttons[i] if (!IsValid(button)) then continue end - + if (pagepos < i+ButtonCount and pagepos >= i-ButtonCount+1) then button:SetVisible(true) EnableButton(button, true) @@ -469,13 +469,13 @@ function PANEL:LayoutPages(forcelayout) button.Depressed = false end - + local SelectButton = self.PageChooseNumbers.Buttons[self.m_nPage] if (IsValid(SelectButton)) then SelectButton.Depressed = true SelectButton:SetMouseInputEnabled(false) end - + self.PageChooseNumbers:SetWide(VisibleButtons*self.PageButtonSize) self.PageChooseNumbers:Center() end diff --git a/lua/wire/client/wire_listeditor.lua b/lua/wire/client/wire_listeditor.lua index 62c9bef0..970f9767 100644 --- a/lua/wire/client/wire_listeditor.lua +++ b/lua/wire/client/wire_listeditor.lua @@ -38,7 +38,7 @@ local invalid_chars = { local function ConnectPathes(path1, path2) local path = "" - + if (isstring(path1) and path1 ~= "") then path = path1 if (isstring(path2) and path2 ~= "") then @@ -65,7 +65,7 @@ local function ReadLine(filedata) local line = "" local fileend = false - for i=1, max_char_count+56 do // maximum chars per line + for i=1, max_char_count+56 do // maximum chars per line local byte = filedata:ReadByte() fileend = !byte @@ -127,7 +127,7 @@ local function SaveTo(self, func, ...) strTextOut = string.gsub(strTextOut, ".", invalid_filename_chars) if (strTextOut == "") then return end - + local filepath = string.GetPathFromFilename(path) if (!filepath or filepath == "") then filepath = self.m_strRootPath.."/" end @@ -147,7 +147,7 @@ local function AsForOverride(self, func, filename, ...) if (!func) then return end if (filename == self.m_strList) then func(self, filename, ...) return end if (!file.Exists(filename, "DATA")) then func(self, filename, ...) return end - + local args = {...} Derma_Query( @@ -157,7 +157,7 @@ local function AsForOverride(self, func, filename, ...) function() if (!IsValid(self)) then return end - + func(self, filename, unpack(args)) end, @@ -171,7 +171,7 @@ local function AsForSave(self, func, ...) if (!func) then return end if (!self.m_bUnsaved) then func(self, ...) return end - + local args = {...} Derma_Query( "Would you like to save the changes?", @@ -185,18 +185,18 @@ local function AsForSave(self, func, ...) SaveTo(self, func, unpack(args)) return end - + local saved = self:SaveList(self.m_strList) if (saved) then func(self, unpack(args)) end - end, + end, "No", // Don't save and resume. function() if (!IsValid(self)) then return end func(self, unpack(args)) - end, + end, "Cancel" // Do nothing. ) @@ -343,7 +343,7 @@ function PANEL:Init() self.SplitPanel:SetLeftMin(150) self.SplitPanel:SetRightMin(300) self.SplitPanel:SetDividerWidth(3) - + self:SetRootPath("wirelists") end @@ -424,7 +424,7 @@ function PANEL:AddItem(...) for k, v in ipairs(itemtable) do if (k == 1) then continue end - + i = i + 1 itemargs[i] = v end @@ -473,19 +473,19 @@ function PANEL:OpenList(strfile) if (strfile == "") then return end AsForSave(self, function(self, strfile) - local filedata = file.Open(strfile, "rb", "DATA") + local filedata = file.Open(strfile, "rb", "DATA") if (!filedata) then return end - + WireLib.TimedpairsStop(self.TimedpairsName) self.Files:Clear(true) self.Tabfile = {} self.TabfileCount = 0 - + local counttab={} for i=1, self.m_nMaxItems do counttab[i] = true end - + WireLib.Timedpairs(self.TimedpairsName, counttab, self.m_nListSpeed, function(index, _, self, filedata) if (!IsValid(self)) then filedata:Close() @@ -500,7 +500,7 @@ function PANEL:OpenList(strfile) if (self.TabfileCount >= self.m_nMaxItems) then filedata:Close() self:SetUnsaved(false) - + return false end @@ -508,7 +508,7 @@ function PANEL:OpenList(strfile) if (!linetable) then // do not add to empty lines filedata:Close() self:SetUnsaved(false) - + return false end @@ -520,7 +520,7 @@ function PANEL:OpenList(strfile) if (!IsValid(self)) then return end self:SetUnsaved(false) end, self, filedata) - + self:SetUnsaved(false) self:SetList(strfile) end, strfile) @@ -567,13 +567,13 @@ end function PANEL:SetUnsaved(bool) self.m_bUnsaved = bool - + self:UpdateListNameLabel() end function PANEL:SetList(listfile) self.m_strList = listfile - + self:UpdateListNameLabel() end diff --git a/lua/wire/client/wire_soundpropertylist.lua b/lua/wire/client/wire_soundpropertylist.lua index 655856b3..aec51fd4 100644 --- a/lua/wire/client/wire_soundpropertylist.lua +++ b/lua/wire/client/wire_soundpropertylist.lua @@ -13,10 +13,10 @@ AccessorFunc( PANEL, "m_nMaxItems", "MaxItems" ) // how may items at maximum local function IsInString(strSource, strPattern) if (!strPattern) then return true end if (strPattern == "") then return true end - + strSource = string.lower(strSource) strPattern = string.lower(strPattern) - + if string.find(strSource, strPattern, 0, true) then return true end return false @@ -64,7 +64,7 @@ local function GenerateList(self, strPattern) end if (!IsInString(v, strPattern)) then return end - + self:AddItem(k, v) end, function(k, v, self) @@ -95,14 +95,14 @@ function PANEL:Init() self.SearchPanel:SetTall(20) self.SearchPanel:Dock(TOP) self.SearchPanel:SetDrawBackground(false) - + self.SearchText = self.SearchPanel:Add("DTextEntry") self.SearchText:DockMargin(0, 0, 3, 0) self.SearchText:Dock(FILL) self.SearchText.OnChange = function(panel) self:SetSearchPattern(panel:GetValue()) end - + self.RefreshIcon = self.SearchPanel:Add("DImageButton") // The Folder Button. self.RefreshIcon:SetImage("icon16/arrow_refresh.png") self.RefreshIcon:SetWide(20) @@ -126,7 +126,7 @@ function PANEL:Init() self.SearchProgressLabel:SetPaintBackground(false) self.SearchProgressLabel:SetDark(true) - + self.SoundProperties = self:Add("DListView") self.SoundProperties:SetMultiSelect(false) self.SoundProperties:Dock(FILL) @@ -178,7 +178,7 @@ end function PANEL:ClearList() WireLib.TimedpairsStop(self.TimedpairsName) self.SoundProperties:Clear(true) - + self.TabfileCount = 0 end @@ -195,7 +195,7 @@ function PANEL:AddItem(...) for k, v in ipairs(itemtable) do if (k == 2) then continue end - + i = i + 1 itemargs[i] = v end @@ -236,4 +236,4 @@ function PANEL:DoRightClick(name, data, parent, line) -- Override end -vgui.Register("wire_soundpropertylist", PANEL, "DPanel") \ No newline at end of file +vgui.Register("wire_soundpropertylist", PANEL, "DPanel") diff --git a/lua/wire/cpulib.lua b/lua/wire/cpulib.lua index 540d7794..57ad285b 100644 --- a/lua/wire/cpulib.lua +++ b/lua/wire/cpulib.lua @@ -304,7 +304,7 @@ if CLIENT then CPULib.Debugger.FirstFile = nil CPULib.DebugUpdateHighlights() end - + net.Receive("CPULib.InvalidateDebugger", function(netlen) local state = net.ReadUInt(2) -- 0: No change just invalidate, 1: detach, 2: attach if state == 1 then @@ -431,25 +431,25 @@ if CLIENT then ------------------------------------------------------------------------------ -- Show ZCPU/ZGPU documentation CPULib.HandbookWindow = nil - + function CPULib.ShowDocumentation(platform) local w = ScrW() * 2/3 - local h = ScrH() * 2/3 + local h = ScrH() * 2/3 local browserWindow = vgui.Create("DFrame") browserWindow:SetTitle("Documentation") - browserWindow:SetPos((ScrW() - w)/2, (ScrH() - h)/2) - browserWindow:SetSize(w,h) - browserWindow.OnClose = function() - browser = nil - browserWindow = nil - end + browserWindow:SetPos((ScrW() - w)/2, (ScrH() - h)/2) + browserWindow:SetSize(w,h) + browserWindow.OnClose = function() + browser = nil + browserWindow = nil + end browserWindow:MakePopup() - - local browser = vgui.Create("DHTML",browserWindow) - browser:SetPos(10, 25) - browser:SetSize(w - 20, h - 35) - - browser:OpenURL("http://wiki.wiremod.com/wiki/Category:ZCPU_Handbook") + + local browser = vgui.Create("DHTML",browserWindow) + browser:SetPos(10, 25) + browser:SetSize(w - 20, h - 35) + + browser:OpenURL("http://wiki.wiremod.com/wiki/Category:ZCPU_Handbook") end end @@ -487,17 +487,17 @@ if SERVER then end end) - -- Concommand to send a single stream of bytes + -- Concommand to send a single stream of bytes util.AddNetworkString("wire_cpulib_buffer") net.Receive("wire_cpulib_buffer", function(netlen, player) local Buffer = CPULib.DataBuffer[player:UserID()] if (not Buffer) or (Buffer.Player ~= player) then return end if not Buffer.Entity then return end - + for iteration=1, net.ReadUInt(16) do Buffer.Data[net.ReadUInt(24)] = net.ReadDouble() end - + if net.ReadBit() ~= 0 then -- We're done! CPULib.DataBuffer[player:UserID()] = nil net.Start("CPULib.ServerUploading") net.WriteBit(false) net.Send(player) @@ -527,7 +527,7 @@ if SERVER then end end end) - + ------------------------------------------------------------------------------ -- Players and corresponding entities (for the debugger) CPULib.DebuggerData = {} diff --git a/lua/wire/default_data_files.lua b/lua/wire/default_data_files.lua index 5111a459..edbbab6c 100644 --- a/lua/wire/default_data_files.lua +++ b/lua/wire/default_data_files.lua @@ -1 +1 @@ -//{"expression2/":{"expression2/_helloworld_.txt":"@name Hello World\r\n@inputs A B\r\n@outputs Add Sub Mul Div\r\n@outputs GreaterThan Highest Lowest\r\n@outputs Vector:vector\r\n@persist D\r\n@trigger all\r\n\r\nAdd = A + B\r\nSub = A - B\r\nMul = A * B\r\nDiv = A / B\r\n\r\nGreaterThan = A > B\r\n\r\nif(A > B) {\r\n Highest = A, Lowest = B\r\n} else {\r\n Highest = B, Lowest = A\r\n}\r\n\r\nVector = vec(A, B, 0)\r\nVector = Vector + vec(0, 0, A + B)\r\nVector = Vector:normalized()"},"soundlists/":{"soundlists/common_sounds.txt":"AlyxEMP.Charge | property\r\nAlyxEMP.Discharge | property\r\nAlyxEMP.Stop | property\r\nBaseExplosionEffect.Sound | property\r\nBaseGrenade.BounceSound | property\r\nBaseGrenade.Explode | property\r\nBaseGrenade.StopSounds | property\r\nBullets.DefaultNearmiss | property\r\nBullets.GunshipNearmiss | property\r\nBullets.StriderNearmiss | property\r\nFX_RicochetSound.Ricochet | property\r\nFuncTank.Fire | property\r\nFunc_Tank.BeginUse | property\r\nGenericNPC.GunSound | property\r\nGrenade.Blip | property\r\nGrenadeBeam.HitSound | property\r\nGrenadeBottle.Detonate | property\r\nGrenadeBugBait.Splat | property\r\nGrenadeHomer.StopSounds | property\r\nGrenadePathfollower.StopSounds | property\r\nGrenadeScanner.StopSound | property\r\nGrenade_Molotov.Detonate | property\r\nTripwireGrenade.ShootRope | property\r\nWaterExplosionEffect.Sound | property\r\nWeaponFrag.Roll | property\r\nWeaponFrag.Throw | property\r\nWeapon_357.OpenLoader | property\r\nWeapon_357.Reload | property\r\nWeapon_357.RemoveLoader | property\r\nWeapon_357.ReplaceLoader | property\r\nWeapon_357.Single | property\r\nWeapon_357.Spin | property\r\nWeapon_AR2.Double | property\r\nWeapon_AR2.Empty | property\r\nWeapon_AR2.NPC_Double | property\r\nWeapon_AR2.NPC_Reload | property\r\nWeapon_AR2.NPC_Single | property\r\nWeapon_AR2.Reload | property\r\nWeapon_AR2.Reload_Push | property\r\nWeapon_AR2.Reload_Rotate | property\r\nWeapon_AR2.Single | property\r\nWeapon_AR2.Special1 | property\r\nWeapon_AR2.Special2 | property\r\nWeapon_Binoculars.Reload | property\r\nWeapon_Binoculars.Special1 | property\r\nWeapon_Binoculars.Special2 | property\r\nWeapon_Brickbat.Special1 | property\r\nWeapon_Bugbait.Splat | property\r\nWeapon_CombineGuard.Special1 | property\r\nWeapon_Crossbow.BoltElectrify | property\r\nWeapon_Crossbow.BoltFly | property\r\nWeapon_Crossbow.BoltHitBody | property\r\nWeapon_Crossbow.BoltHitWorld | property\r\nWeapon_Crossbow.BoltSkewer | property\r\nWeapon_Crossbow.Reload | property\r\nWeapon_Crossbow.Single | property\r\nWeapon_Crowbar.Melee_Hit | property\r\nWeapon_Crowbar.Melee_HitWorld | property\r\nWeapon_Crowbar.Single | property\r\nWeapon_Extinguisher.Double | property\r\nWeapon_Extinguisher.Empty | property\r\nWeapon_Extinguisher.NPC_Double | property\r\nWeapon_Extinguisher.NPC_Reload | property\r\nWeapon_Extinguisher.NPC_Single | property\r\nWeapon_Extinguisher.Reload | property\r\nWeapon_Extinguisher.Single | property\r\nWeapon_Extinguisher.Special1 | property\r\nWeapon_FlareGun.Burn | property\r\nWeapon_FlareGun.Reload | property\r\nWeapon_FlareGun.Single | property\r\nWeapon_Gauss.ChargeLoop | property\r\nWeapon_IRifle.Empty | property\r\nWeapon_IRifle.Single | property\r\nWeapon_MegaPhysCannon.Charge | property\r\nWeapon_MegaPhysCannon.ChargeZap | property\r\nWeapon_MegaPhysCannon.Drop | property\r\nWeapon_MegaPhysCannon.DryFire | property\r\nWeapon_MegaPhysCannon.HoldSound | property\r\nWeapon_MegaPhysCannon.Launch | property\r\nWeapon_MegaPhysCannon.Pickup | property\r\nWeapon_Mortar.Impact | property\r\nWeapon_Mortar.Incomming | property\r\nWeapon_Mortar.Single | property\r\nWeapon_PhysCannon.Charge | property\r\nWeapon_PhysCannon.CloseClaws | property\r\nWeapon_PhysCannon.Drop | property\r\nWeapon_PhysCannon.DryFire | property\r\nWeapon_PhysCannon.HoldSound | property\r\nWeapon_PhysCannon.Launch | property\r\nWeapon_PhysCannon.OpenClaws | property\r\nWeapon_PhysCannon.Pickup | property\r\nWeapon_PhysCannon.TooHeavy | property\r\nWeapon_Physgun.HeavyObject | property\r\nWeapon_Physgun.LightObject | property\r\nWeapon_Physgun.LockedOn | property\r\nWeapon_Physgun.Off | property\r\nWeapon_Physgun.On | property\r\nWeapon_Physgun.Scanning | property\r\nWeapon_Physgun.Special1 | property\r\nWeapon_Pistol.Burst | property\r\nWeapon_Pistol.Empty | property\r\nWeapon_Pistol.NPC_Reload | property\r\nWeapon_Pistol.NPC_Single | property\r\nWeapon_Pistol.Reload | property\r\nWeapon_Pistol.Single | property\r\nWeapon_Pistol.Special1 | property\r\nWeapon_Pistol.Special2 | property\r\nWeapon_RPG.LaserOff | property\r\nWeapon_RPG.LaserOn | property\r\nWeapon_RPG.NPC_Single | property\r\nWeapon_RPG.Single | property\r\nWeapon_SMG1.Burst | property\r\nWeapon_SMG1.Double | property\r\nWeapon_SMG1.Empty | property\r\nWeapon_SMG1.NPC_Reload | property\r\nWeapon_SMG1.NPC_Single | property\r\nWeapon_SMG1.Reload | property\r\nWeapon_SMG1.Single | property\r\nWeapon_SMG1.Special1 | property\r\nWeapon_SMG1.Special2 | property\r\nWeapon_Shotgun.Double | property\r\nWeapon_Shotgun.Empty | property\r\nWeapon_Shotgun.NPC_Reload | property\r\nWeapon_Shotgun.NPC_Single | property\r\nWeapon_Shotgun.Reload | property\r\nWeapon_Shotgun.Single | property\r\nWeapon_Shotgun.Special1 | property\r\nWeapon_SniperRifle.NPC_Reload | property\r\nWeapon_SniperRifle.NPC_Single | property\r\nWeapon_SniperRifle.Reload | property\r\nWeapon_SniperRifle.Single | property\r\nWeapon_SniperRifle.Special1 | property\r\nWeapon_SniperRifle.Special2 | property\r\nWeapon_StunStick.Activate | property\r\nWeapon_StunStick.Deactivate | property\r\nWeapon_StunStick.Melee_Hit | property\r\nWeapon_StunStick.Melee_HitWorld | property\r\nWeapon_StunStick.Melee_Miss | property\r\nWeapon_StunStick.Swing | property\r\nWeapon_functank.Single | property\r\n"},"wire_version.txt":"gm13-401-gf291c42\r\n","gpuchip/":{"gpuchip/examples/":{"gpuchip/examples/3d_icosahedron.txt":"// Author: Drunkie\r\n// Description: Draws a 3D icosahedron model (solid and wireframe)\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glSleep( 40 ); // Sleep for 40 milliseconds (Reduces fps lag)\r\n glClear( 0, 0, 0 ); // Clear screen\r\n \r\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode \r\n glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation\r\n\r\n glLightPos( 0, 0, -50 ); // Set the light position\r\n glLightColor( 255, 255, 255, 1 ); // Set the light color\r\n \r\n glLookAt(\r\n 0, 0, -2.25, // Camera pos\r\n 0, 0, 0, // Camera target\r\n 0, 1, 0 // Camera up\r\n ); \r\n \r\n // Create variable to hold curtime\r\n float time;\r\n timer time;\r\n \r\n // Create perspective and matrix transformations\r\n glPerspective( 30, 1, 1, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR\r\n glRotate( 1, 1, 0, time ); // AXIS X, Y, Z, ANGLE W\r\n glTranslate( 0, 0, 0 ); // TRANSLATION X, Y, Z\r\n glScale( 1, 1, 1, 0 ); // SCALE X, Y, Z\r\n \r\n glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer \r\n glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting\r\n glEnable( GL_VERTEX_LIGHTING ); // Enable vertex lighting\r\n //glEnable( GL_VERTEX_CULLING ); // Enable face culling\r\n \r\n // Solid 3D polygon\r\n glFillMode( GL_FILL_SOLID ); // Set fillmode as solid\r\n glColor4( 100, 149, 237, 180 ); // Set the draw color with alpha\r\n glPoly3D( vertexBuffer, 20 ); // Draw 3D polygon\r\n glFlush(); // Flush the vertex buffer to the screen\r\n \r\n glDisable( GL_VERTEX_LIGHTING ); // Enable vertex lighting\r\n \r\n // Wireframe 3D polygon\r\n glLineWidth( 1 ); // Set line width of wireframe\r\n glFillMode( GL_FILL_WIREFRAME ); // Set fillmode as wireframe\r\n glColor4( 255, 255, 255, 255 ); // Set the draw color with alpha\r\n glPoly3D( vertexBuffer, 20 ); // Draw 3D polygon\r\n glFlush(); // Flush the vertex buffer to the screen\r\n \r\n glExit(); // Exit\r\n}\r\n\r\n// The vertex data for our model\r\nvertexBuffer:\r\ndb 0,0,1; db 0,0.9,0.5; db 0.9,0.3,0.4;\r\ndb 0,0,1; db -0.9,0.3,0.4; db 0,0.9,0.5;\r\ndb 0,0,1; db -0.5,-0.7,0.4; db -0.9,0.3,0.4;\r\ndb 0,0,1; db 0.5,-0.7,0.4; db -0.5,-0.7,0.4;\r\ndb 0,0,1; db 0.9,0.3,0.4; db 0.5,-0.7,0.4;\r\ndb 0.9,-0.3,-0.4; db 0.9,0.3,0.4; db 0.5,0.7,-0.4;\r\ndb 0,0.9,0.5; db 0.5,0.7,-0.4; db 0.9,0.3,0.4;\r\ndb 0,0.9,0.5; db -0.5,0.7,-0.4; db 0.5,0.7,-0.4;\r\ndb 0,0.9,0.5; db -0.9,0.3,0.4; db -0.5,0.7,-0.4;\r\ndb -0.9,-0.3,-0.4; db -0.5,0.7,-0.4; db -0.9,0.3,0.4;\r\ndb -0.9,-0.3,-0.4; db -0.9,0.3,0.4; db -0.5,-0.7,0.4;\r\ndb -0.9,-0.3,-0.4; db -0.5,-0.7,0.4; db 0,-0.9,-0.5;\r\ndb 0.5,-0.7,0.4; db 0,-0.9,-0.5; db -0.5,-0.7,0.4;\r\ndb 0.5,-0.7,0.4; db 0.9,-0.3,-0.4; db 0,-0.9,-0.5;\r\ndb 0.5,-0.7,0.4; db 0.9,0.3,0.4; db 0.9,-0.3,-0.4;\r\ndb 0,0,-1; db 0,-0.9,-0.5; db 0.9,-0.3,-0.4;\r\ndb 0,0,-1; db 0.9,-0.3,-0.4; db 0.5,0.7,-0.4;\r\ndb 0,0,-1; db 0.5,0.7,-0.4 db -0.5,0.7,-0.4;\r\ndb 0,0,-1; db -0.5,0.7,-0.4; db -0.9,-0.3,-0.4;\r\ndb 0,0,-1; db -0.9,-0.3,-0.4; db 0,-0.9,-0.5;\r\n","gpuchip/examples/hud_fighter.txt":"//Aircraft hud\r\n//port0 - ROLL\r\n//port1 - PITCH\r\n//port2 - YAW (heading)\r\n//port3 - speed (units/sec)\r\n//port4 - altitude (units)\r\n//port5 - radar altitude (put ranger under your plane, and attach to this)\r\n//port6 - flaps active, 1 or 0\r\n//port7 - go to \"Gates - Time\", and find \"Derivative\". Attach this to derivative, and derivative to altitude (vertical speed)\r\n\r\n//Artiftical horizon\r\nin eax,0; //Roll\r\nin ebx,1; //Pitch\r\n\r\n//mul ebx,0.017453292;\r\nmul eax,0.017453292;\r\nadd eax,1.57;\r\n\r\ndiv ebx,90;\r\nmul ebx,512;\r\nadd ebx,256;\r\n\r\nmov #horizon_moveoffset.y,ebx;\r\n\r\ndrotatescale eax,1;\r\ndmove horizon_moveoffset;\r\n\r\ndcolor art_sky;\r\ndrectwh horizon_sky_offset,horizon_size;\r\ndcolor art_grnd;\r\ndrectwh horizon_grnd_offset,horizon_size;\r\n\r\ndcolor hud_text;\r\ndsetsize 20;\r\nmov eax,-45;\r\n_horizon_text:\r\n mov ebx,eax;\r\n mul ebx,5.68;\r\n sub ebx,10;\r\n mov #horizon_textpos1.y,ebx;\r\n mov #horizon_textpos2.y,ebx; add ebx,9;\r\n mov #horizon_rectpos1.y,ebx; add ebx,2;\r\n mov #horizon_rectpos2.y,ebx;\r\n\r\n drect horizon_rectpos1,horizon_rectpos2;\r\n dwritei horizon_textpos1,eax;\r\n dwritei horizon_textpos2,eax;\r\n\r\n add eax,15;\r\n cmp eax,45;\r\n jle _horizon_text;\r\n\r\n//Reset\r\ndmove 0;\r\ndrotatescale 0,1;\r\n\r\n//Border around art horizon\r\ndcolor border_color;\r\ndrect border_p1,border_p2;\r\ndrect border_p3,border_p4;\r\ndrect border_p5,border_p6;\r\ndrect border_p7,border_p8;\r\ndcolor border_color2;\r\ndrect border_p9,border_p10;\r\n\r\n//Draw hud stuff\r\nmov #roll,port0;\r\nmov #pitch,port1;\r\nmov #hdg,port2; add #hdg,180;\r\nmov #spd,port3; div #spd,17.6;\r\nmov #alt,port4;\r\nadd #alt,12000;\r\ndiv #alt,12;\r\nmov #ralt,port5; div #ralt,12;\r\nmov #vspd,port7; div #vspd,17.6;\r\ndcolor hud_text;\r\ndwritefmt hud_pos1,hud_text1;\r\ndsetsize 16;\r\ndwritefmt hud_pos2,hud_text2;\r\n\r\ndcolor hud_text;\r\nmov eax,port6; mul eax,0.75; add eax,0.25;\r\ndshade eax;\r\ndwritefmt hud_pos3,hud_text3;\r\n\r\n\r\ndexit;\r\n\r\nvec2f hud_pos1,50,20;\r\nstring hud_text1,'ROLL %i %tPITCH %i%tHDG %i';\r\nalloc roll; \r\nalloc pitch;\r\nalloc hdg;\r\n\r\nvec2f hud_pos2,45,120;\r\nstring hud_text2,'SPD',10,'%ikt',10,10,'ALT',10,'%ift',10,10,'RALT',10,'%ift',10,10,'VSPD',10,'%ift/s';\r\nalloc spd;\r\nalloc alt;\r\nalloc ralt;\r\nalloc vspd;\r\n\r\nvec2f hud_pos3,45,400;\r\nstring hud_text3,'FLAPS';\r\n\r\n\r\nvec2f horizon_textpos1,96,0;\r\nvec2f horizon_textpos2,-64,0;\r\nvec2f horizon_rectpos1,-50,0;\r\nvec2f horizon_rectpos2,50,0;\r\ncolor hud_text,64,255,64;\r\n\r\ncolor border_color2,255,255,255;\r\ncolor border_color,30,30,30;\r\nvec2f border_p1,0,0;\r\nvec2f border_p2,128,512;\r\nvec2f border_p3,384,0;\r\nvec2f border_p4,512,512;\r\n\r\nvec2f border_p5,128,0;\r\nvec2f border_p6,384,64;\r\nvec2f border_p7,128,448;\r\nvec2f border_p8,384,512;\r\n\r\nvec2f border_p9,128,254;\r\nvec2f border_p10,384,258;\r\n\r\nvec2f horizon_sky_offset,-256,-512;\r\nvec2f horizon_grnd_offset,-256,0;\r\nvec2f horizon_size,512,512;\r\n\r\nvec2f horizon_moveoffset,256,256;\r\n\r\ncolor art_sky,24,144,255;\r\ncolor art_grnd,192,72,0;\r\n","gpuchip/examples/stargate.txt":"//STARGATE DIAL COMPUTER MAIN DISPLAY (realistic colors)\r\n//\r\n//How to connect:\r\n//GPU IOBus to Data Port\r\n//Port0 to \"Open\"\r\n//Port1 to \"Active\"\r\n//Port2 to \"Chevron\"\r\n//Port3 to \"Inbound\"\r\n//Port4 to iris\r\n//\r\n//That's all!\r\n\r\ndiv #65525,1.33;\r\nmov #65485,16; //65485 is the circle quality register\r\n\r\n//24 means circles have 24 sides\r\n//You can have up to 128 sides, but that LAGS\r\n//32 sides is not even noticable comparing to 128\r\n\r\n//= Misc decorations ==================\r\n\r\ndcolor stargate_out_ring;\r\ndcircle center,250;\r\ndcolor stargate_middle_ring;\r\ndcircle center,240;\r\ndcolor stargate_out_ring;\r\ndcircle center,223;\r\n\r\n//= Rotating ring =====================\r\nmov #65485,12;\r\ndcolor stargate_inner_ring;\r\n\r\nin ecx,2; //This block checks if chevron 7 is engaged\r\ncmp ecx,7; //If yes, dont spin\r\nmov eax,0;\r\njge _norotate;\r\n timer eax;\r\n_norotate:\r\n\r\nin ebx,1; //This one checks if stargate is active\r\nmul eax,ebx;\r\n\r\nin ebx,3; neg ebx; add ebx,1; //This one checks if its inbound\r\nmul eax,ebx; //wormhole\r\n\r\ndrotatescale eax,1; //rotate by EAX radians\r\ndmove center;\r\ndcircle 0,220;\r\n\r\ndrotatescale 0,1; //Reset scale/movment\r\ndmove 0;\r\n\r\n//= Inner ring around EH ==============\r\nmov #65485,24;\r\ndcolor stargate_out_ring;\r\ndcircle center,190;\r\n\r\n\r\n//= EH ================================\r\ndcolor black;\r\ndcircle center,180; //draw black hole instead of event horizon\r\n\r\ndcolor stargate_eventhorizon;\r\n\r\nin ebx,0; //Stargate active?\r\ncmp ebx,0;\r\nmov eax,0;\r\nje _active;\r\n rand eax;\r\n mul eax,0.1;\r\n add eax,0.9;\r\n_active:\r\n\r\nin ebx,0; mul ebx,180;\r\n\r\nmul #eventhorizon_radius,0.99;\r\nmul ebx,1.01;\r\nadd #eventhorizon_radius,ebx;\r\ndiv #eventhorizon_radius,2;\r\n\r\n\r\ndshade eax;\r\ndcircle center,#eventhorizon_radius;\r\n\r\n//= Iris ==============================\r\nmov edx,port4;\r\nneg edx; add edx,1;\r\n\r\nmov eax,#iris_status;\r\nsub eax,edx;\r\nfabs eax,eax;\r\n\r\ndmuldt ecx,8;\r\n\r\ncmp eax,0.02;\r\njl _donothing;\r\n cmp #iris_status,edx;\r\n jl _lower;\r\n sub #iris_status,ecx;\r\n jmp _donothing;\r\n _lower:\r\n add #iris_status,ecx;\r\n_donothing:\r\n\r\nmov #iris1.y,#iris_status;\r\nmul #iris1.y,#iris2.y;\r\n\r\ndmove center;\r\n\r\nmov ecx,12;\r\n_iris:\r\n fsin ebx,ecx; fabs ebx,ebx; div ebx,10; add ebx,0.7;\r\n\r\n mov eax,ecx; mul eax,0.490; add eax,0.01; //0.697\r\n add eax,#iris_status;\r\n\r\n drotatescale eax,1;\r\n\r\n dcolor iris_color;\r\n dshade ebx;\r\n\r\n drect iris1,iris2;\r\nloop _iris;\r\n\r\ndmove 0;\r\n\r\n//= Chevrons ==========================\r\nmov eax,1; //Chevron ID\r\nin ebx,2;\r\ndmove center;\r\n_chevron_loop:\r\n mov edx,eax; //Compute chevron angle in radians\r\n mul edx,0.69815;\r\n sub edx,1.23333;\r\n\r\n drotatescale edx,1; //Rotate chevron polygon\r\n dcolor stargate_chevron;\r\n\r\n mov edx,eax:#chevron_triggers;\r\n\r\n cmp edx,ebx; //Check if chevron is light up\r\n jle _noshade;\r\n dshade 0.25;\r\n _noshade:\r\n\r\n dvxpoly chevron_polygon,4; //draw chevron polygon\r\n\r\n inc eax;\r\n cmp eax,9;\r\n jle _chevron_loop;\r\n\r\n//= Computer text =====================\r\ndrotatescale 0,1; //reset movement and scale\r\ndmove 0;\r\n\r\nin eax,3; //Is inbound?\r\ncmp eax,0;\r\nje _dexit;\r\n\r\n timer eax; mul eax,2; fint eax; mod eax,2;\r\n dcolor sgc_text;\r\n dshade eax;\r\n\r\n dsetsize 64; //draw message\r\n dwrite sgc_inboundpos,sgc_inbound;\r\n\r\n_dexit:\r\ndexit;\r\n\r\n//= Helpers ===========================\r\n\r\nchevron_triggers:\r\ndb 9,4,5,6,7,1,2,3,8;\r\n// 1 2 3 4 5 6 7 8 9\r\n// Order in which chevrons light up\r\n// Only 1-7 are used though\r\n\r\n//=====================================\r\n\r\ncolor sgc_text,255,255,255;\r\n\r\nvector2f sgc_inboundpos,120,215;\r\nstring sgc_inbound,'INBOUND';\r\n\r\ncolor stargate_out_ring, 116,105, 76;\r\ncolor stargate_middle_ring, 93 , 85, 60;\r\ncolor stargate_inner_ring, 138,137,108;\r\ncolor stargate_eventhorizon, 93,114,162;\r\ncolor stargate_chevron, 250,162, 54;\r\ncolor iris_color, 192,192,192;\r\n\r\ncolor black,0,0,0;\r\n\r\nvector2f center,256,256;\r\n\r\nvector2f iris1,-44,0;\r\nvector2f iris2,44,175;\r\n\r\nvector2f chevcenter,-16,-256;\r\nvector2f chevsize,32,32;\r\n\r\nalloc eventhorizon_radius;\r\nalloc iris_status;\r\n\r\n//raw chevron poly data\r\n//format: \r\nchevron_polygon: //n=4\r\ndb -16,-251;\r\ndb 16,-251;\r\ndb 10,-230;\r\ndb -10,-230;\r\n","gpuchip/examples/sprite.txt":"// Author: Drunkie\r\n// Description: A very simple sprite example\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n // Enable vertex mode\r\n glVertexMode( 1 );\r\n \r\n // Draw to sprite buffer\r\n glSetRenderTarget( GL_BUFFER_BACK );\r\n glClear( 0, 255, 0 );\r\n \r\n // Draw to vertex buffer (world)\r\n glSetRenderTarget( GL_BUFFER_VERTEX );\r\n glEnable( GL_VERTEX_TEXTURING );\r\n \r\n // Sample from sprite 0\r\n glTextureSize( 256 );\r\n glTexture( 0 );\r\n glClear( 0, 255, 0 );\r\n glRectWH( 128, 128, 256, 256 );\r\n \r\n glSetRenderTarget( GL_BUFFER_FRONT );\r\n \r\n glExit();\r\n}\r\n","gpuchip/examples/cube.txt":"//timer EAX;// div EAX,8;\r\n//fsin EAX,EAX;\r\n//mul EAX,512;\r\n//fabs EAX,EAX;\r\n//neg EAX;\r\n//add EAX,512;\r\n\r\ndcvxpipe 3; //-1..1 (opengl screen)\r\ndvxpipe 5; //matrix projection\r\n\r\n//Initialize transform\r\nmperspective mProjectionMatrix,vPerspective;\r\n\r\n//Render starts\r\ndclrscr bg_color;\r\nmlookat mViewMatrix,vLookAt; //View matrix\r\n\r\ntimer eax;\r\nmov #vRotate.w,eax;\r\n\r\n//Rotate translate\r\nmrotate mRotateMatrix,vRotate;\r\nmtranslate mTranslateMatrix,vTranslate;\r\n\r\n//Create model matrix\r\nmmov mModelMatrix,mTranslateMatrix;\r\nmmul mModelMatrix,mRotateMatrix;\r\n\r\n//modelViewMatrix = ViewMatrix * modelMatrx\r\nmmov mModelViewMatrix,mViewMatrix;\r\nmmul mModelViewMatrix,mModelMatrix;\r\n\r\n//load matrix\r\nmload mModelViewMatrix;\r\nmloadproj mProjectionMatrix;\r\n\r\n//setup light\r\ndsetlight 0,lightdata;\r\n\r\n//setup buffer\r\ndenable 0; //Vertex buffer\r\ndenable 1; //ZSorting\r\ndenable 2; //Lighting\r\ndenable 3; //Face culling\r\n\r\n//render cube\r\ndcolor fg_color;\r\ndvxdata_3f cube2,12;\r\ndvxflush;\r\n\r\nddisable 0; //Disable everything!\r\nddisable 1;\r\nddisable 2;\r\nddisable 3;\r\n\r\ndcvxpipe 0;\r\ndvxpipe 0;\r\n\r\n//You can write some text here now\r\n//\r\ndexit;\r\n\r\n//========\r\ncube2:\r\ndb -1,-1,-1;\r\ndb 1,-1,-1;\r\ndb 1,1,-1;\r\ncube3:\r\ndb -1,-1,-1;\r\ndb 1,1,-1;\r\ndb -1,1,-1;\r\ncube4:\r\ndb 1,-1,1;\r\ndb -1,-1,1;\r\ndb 1,1,1;\r\ncube5:\r\ndb -1,-1,1;\r\ndb -1,1,1;\r\ndb 1,1,1;\r\ncube6:\r\ndb 1,-1,-1;\r\ndb -1,-1,-1;\r\ndb 1,-1,1;\r\ncube7:\r\ndb -1,-1,-1;\r\ndb -1,-1,1;\r\ndb 1,-1,1;\r\ncube8:\r\ndb -1,1,-1;\r\ndb 1,1,-1;\r\ndb 1,1,1;\r\ncube9:\r\ndb -1,1,1;\r\ndb -1,1,-1;\r\ndb 1,1,1;\r\ncube10:\r\ndb -1,-1,-1;\r\ndb -1,1,-1;\r\ndb -1,1,1;\r\ncube11:\r\ndb -1,-1,1;\r\ndb -1,-1,-1;\r\ndb -1,1,1;\r\ncube12:\r\ndb 1,1,-1;\r\ndb 1,-1,-1;\r\ndb 1,1,1;\r\ncube13:\r\ndb 1,-1,-1;\r\ndb 1,-1,1;\r\ndb 1,1,1;\r\n\r\nlightdata:\r\nvector4f lightpos, 0,50,-50, 0; //x y z \r\ncolor lightcol,255,255,255, 1; //R G B Brightness\r\n//========\r\n\r\nmatrix mRotateMatrix;\r\nmatrix mTranslateMatrix;\r\n\r\nmatrix mProjectionMatrix;\t//This defines our projection to screen\r\nmatrix mViewMatrix;\t\t//This defines our camera transformations\r\n\r\nmatrix mModelMatrix;\t\t//This is our model transformations\r\nmatrix mModelViewMatrix;\t//This is our model relatively to camera transform\r\n\r\n\r\nvector4f vRotate, 1, 1, 1, 0; // \r\nvector4f vTranslate, 0, 0, 0, 0; // <0>\r\nvector4f vPerspective, 30, 1.6, 1, 20; // \r\n\r\nvLookAt:\r\nvector3f vLookAt_Eye, 0, 0, -5; //Where our camera is\r\nvector3f vLookAt_Center, 0, 0, 0; //What we look at\r\nvector3f vLookAt_Up, 0, 1, 0; //Where our matt-hat is\r\n\r\ncolor fg_color,255,255,25;\r\ncolor bg_color,64,32,12;","gpuchip/examples/verynice2.txt":"//Generated by WGUI tool. Get it at wiremod.com\r\n_page_0:\r\ndsetsize 16\r\ndcolor _c_0\r\ndrect _a_1,_a_2\r\ndcolor _c_1\r\ndrect _a_4,_a_5\r\ndcolor _c_2\r\ndrect _a_7,_a_8\r\ndcolor _c_3\r\ndrect _a_10,_a_11\r\ndcolor _c_3\r\ndrect _a_13,_a_14\r\ndcolor _c_2\r\nmov #_f_17,port0\r\ndwrite _a_16,_s_17\r\ndcolor _c_4\r\ndrect _a_19,_a_20\r\ndcolor _c_2\r\nmov #_f_23,port0\r\ndwrite _a_22,_s_23\r\ndcolor _c_4\r\ndwritefmt _a_25,_s_26\r\ndcolor _c_4\r\ndwritefmt _a_28,_s_29\r\ndcolor _c_4\r\ndwritefmt _a_31,_s_32\r\ndcolor _c_4\r\ndwritefmt _a_34,_s_35\r\ndcolor _c_4\r\ndwritefmt _a_37,_s_38\r\ndcolor _c_4\r\ndwritefmt _a_40,_s_41\r\ndcolor _c_4\r\ndwritefmt _a_43,_s_44\r\ndcolor _c_4\r\ndwritefmt _a_46,_s_47\r\ndcolor _c_3\r\ndrect _a_49,_a_50\r\ndcolor _c_2\r\nmov #_f_53,port0\r\ndwrite _a_52,_s_53\r\ndcolor _c_3\r\ndrect _a_55,_a_56\r\ndcolor _c_2\r\nmov #_f_59,port0\r\ndwrite _a_58,_s_59\r\ndcolor _c_2\r\ndwritefmt _a_61,_s_62\r\ndcolor _c_2\r\ndwritefmt _a_64,_s_65\r\ndcolor _c_2\r\ndwritefmt _a_67,_s_68\r\ndcolor _c_2\r\ndwritefmt _a_70,_s_71\r\ndcolor _c_2\r\ndwritefmt _a_73,_s_74\r\ndcolor _c_2\r\ndwritefmt _a_76,_s_77\r\ndexit\r\n\r\ncolor _c_0,0,0,160\r\nvec2f _a_1,8,8\r\nvec2f _a_2,504,504\r\ncolor _c_1,7,51,122\r\nvec2f _a_4,16,16\r\nvec2f _a_5,496,496\r\ncolor _c_2,0,0,0\r\nvec2f _a_7,24,24\r\nvec2f _a_8,488,488\r\ncolor _c_3,192,192,192\r\nvec2f _a_10,32,32\r\nvec2f _a_11,480,216\r\nvec2f _a_13,32,224\r\nvec2f _a_14,480,392\r\nvec2f _a_16,40,40\r\nstring _s_17,'VERYNICE GUI V2.1 Initialized...'\r\nalloc _f_17,0\r\ncolor _c_4,128,128,128\r\nvec2f _a_19,32,64\r\nvec2f _a_20,480,72\r\nvec2f _a_22,40,232\r\nstring _s_23,'Raw data feed:'\r\nalloc _f_23,0\r\nvec2f _a_25,88,256\r\nstring _s_26,'Input port 0: %f'\r\nvec2f _a_28,88,272\r\nstring _s_29,'Input port 1: %f'\r\nvec2f _a_31,88,288\r\nstring _s_32,'Input port 2: %f'\r\nvec2f _a_34,88,304\r\nstring _s_35,'Input port 3: %f'\r\nvec2f _a_37,88,320\r\nstring _s_38,'Input port 4: %f'\r\nvec2f _a_40,88,336\r\nstring _s_41,'Input port 5: %f'\r\nvec2f _a_43,88,352\r\nstring _s_44,'Input port 6: %f'\r\nvec2f _a_46,88,368\r\nstring _s_47,'Input port 7: %f'\r\nvec2f _a_49,32,400\r\nvec2f _a_50,248,480\r\nvec2f _a_52,40,408\r\nstring _s_53,'Vector feed 1:'\r\nalloc _f_53,0\r\nvec2f _a_55,264,400\r\nvec2f _a_56,480,480\r\nvec2f _a_58,272,408\r\nstring _s_59,'Vector feed 2:'\r\nalloc _f_59,0\r\nvec2f _a_61,40,424\r\nstring _s_62,'X: %f'\r\nvec2f _a_64,40,440\r\nstring _s_65,'Y: %f'\r\nvec2f _a_67,40,456\r\nstring _s_68,'Z: %f'\r\nvec2f _a_70,272,424\r\nstring _s_71,'X: %f'\r\nvec2f _a_73,272,440\r\nstring _s_74,'Y: %f'\r\nvec2f _a_76,272,456\r\nstring _s_77,'Z: %f'\r\n\r\n","gpuchip/examples/verynice1.txt":"dcolor c1;\r\ndrect p1,p2;\r\ndcolor c2;\r\ndrect p3,p4;\r\ndcolor c3;\r\ndrect p5,p6;\r\n\r\nmov #textpos1.y,80;\r\n\r\ndcolor c4;\r\ndsetsize 12;\r\ndwrite textpos1,text1;\r\n\r\nmov ecx,0;\r\nport_loop:\r\n add #textpos1.y,18;\r\n mov #textpos2.y,#textpos1.y;\r\n\r\n mov #textpos2.x,#textpos1.x;\r\n add #textpos2.x,90;\r\n dwrite textpos1,text2;\r\n dwritei textpos2,ecx;\r\n\r\n in eax,ecx;\r\n\r\n mov #textpos2.x,#textpos1.x;\r\n add #textpos2.x,192;\r\n dwritef textpos2,eax;\r\n\r\n inc ecx;\r\n cmp ecx,18;\r\n jl port_loop;\r\n\r\ndexit;\r\n\r\nstring text1,'VERYNICE HUD SYSTEM INITIALIZED... VER 1.0';\r\nstring text2,'INPUT PORT VALUE';\r\n\r\nvec2f textpos1,80,80;\r\nvec2f textpos2,80,80;\r\n\r\ncolor c1,0,0,255;\r\ncolor c2,0,0,127;\r\ncolor c3,0,0,64;\r\ncolor c4,255,255,255;\r\n\r\nvec2f p1,50,50;\r\nvec2f p2,450,450;\r\n\r\nvec2f p3,60,60;\r\nvec2f p4,430,430;\r\n\r\nvec2f p5,70,70;\r\nvec2f p6,440,440;","gpuchip/examples/trig.txt":"// Author: Jasongamer\r\n// Description: A tool for helping people learn trig\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glClear( 0, 0, 0 ); // Clear screen\r\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe (-1 to 1 mode)\r\n\r\n timer R0; // Set time to curtime()\r\n R0 = -R0 * 1;\r\n\r\n glColor( 255, 255, 255 ); // Set draw color\r\n glCircle( *orig.x, *orig.y, 0.66, 40 ); // Draw circle (x, y, radius, quality)\r\n \r\n glColor( 0, 0, 0 );\r\n glCircle( *orig.x, *orig.y, 0.64, 40 );\r\n\r\n // Set the points for the trig\r\n fcos *cos,R0;\r\n fsin *sin,R0;\r\n\r\n *PosR.x = *cos;\r\n *PosR.x *= 0.65;\r\n *PosR.x += *orig.x;\r\n \r\n *PosR.y = *sin;\r\n *PosR.y *= 0.65;\r\n *PosR.y += *orig.y;\r\n\r\n *PosX.x = *PosR.x;\r\n \r\n glLineWidth( 0.01 ); // Set line width\r\n glFontSize( 24 ); // Set font size\r\n\r\n // X part of triangle\r\n glColor( 0, 0, 255 );\r\n glLine( *orig.x, *orig.y, *PosX.x, *PosX.y ); // Draw line\r\n glWriteFmt( -0.95, -0.95, sCos ) // Write formatted string\r\n\r\n // Y part of triangle\r\n glColor( 255, 0, 0 );\r\n glLine( *PosR.x, *PosR.y, *PosX.x, *PosX.y );\r\n *sin *= -1; // Negate\r\n glWriteFmt( -0.95, -0.85, sSin );\r\n \r\n glColor( 255, 255, 255 );\r\n glLine( *orig.x, *orig.y, *PosR.x, *PosR.y ); // Draw line\r\n \r\n glExit(); // Exit\r\n}\r\n\r\nvec2f orig,0,0;\r\nvec2f PosR,0,0;\r\nvec2f PosX,0,0;\r\n\r\nstring sCos,\"Cosine = %f\";\r\nalloc cos;\r\n\r\nstring sSin,\"Sine = %f\";\r\nalloc sin;\r\n","gpuchip/examples/3d_letter_a.txt":"// Author: Drunkie\r\n// Description: Draws a 3D model of the letter A\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glSleep( 40 ); // Sleep for 40 milliseconds (reduces fps lag)\r\n glClear( 100, 149, 237 ); // Clear screen\r\n \r\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode \r\n glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation\r\n\r\n glLightPos( 0, 0, -50 ); // Set the light position\r\n glLightColor( 255, 255, 255, 1 ); // Set the light color\r\n\r\n glLookAt(\r\n 0, 0, -2.8, // Camera pos\r\n 0, 0, 0, // Camera target\r\n 0, 1, 0 // Camera up\r\n ); \r\n \r\n // Create variable to hold curtime\r\n float time;\r\n timer time;\r\n \r\n // Create perspective and matrix transformations\r\n glPerspective( 30, 1, 1, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR\r\n glRotate( 0, 1, 0, time ); // AXIS X, Y, Z, ANGLE W\r\n glTranslate( 0, -0.1, 0, 0 ); // TRANSLATION X, Y, Z\r\n glScale( 1, 1, 1, 0 ); // SCALE X, Y, Z\r\n\r\n glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer \r\n glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting\r\n glEnable( GL_VERTEX_LIGHTING ); // Enable vertex lighting\r\n glEnable( GL_VERTEX_CULLING ); // Enable face culling\r\n \r\n // Solid 3D polygon\r\n glFillMode( GL_FILL_SOLID ); // Set fillmode as solid\r\n glColor4( 255, 255, 255, 255 ); // Set draw color with alpha\r\n glPoly3D( vertexBuffer, 30 ); // Draw 3D polygon \r\n glFlush(); // Flush the vertex buffer to the screen\r\n \r\n glExit(); // Exit\r\n}\r\n\r\n// The vertex data for our model\r\nvertexBuffer:\r\ndb 1,1,0; db 0.75,1,0; db 0.25,-1,0;\r\ndb 0.75,1,0; db 0,-1,0; db 0.25,-1,0;\r\ndb -1,1,0; db -0.25,-1,0; db -0.75,1,0;\r\ndb -0.75,1,0; db -0.25,-1,0; db 0,-1,0;\r\ndb 1,1,0.25; db 0.25,-1,0.25; db 0.75,1,0.25;\r\ndb 0.75,1,0.25; db 0.25,-1,0.25; db 0,-1,0.25;\r\ndb -1,1,0.25; db -0.75,1,0.25; db -0.25,-1,0.25;\r\ndb -0.75,1,0.25; db 0,-1,0.25; db -0.25,-1,0.25;\r\ndb 0.25,-1,0; db -0.25,-1,0; db 0.25,-1,0.25;\r\ndb -0.25,-1,0; db -0.25,-1,0.25; db 0.25,-1,0.25;\r\ndb -1,1,0; db -1,1,0.25; db -0.25,-1,0;\r\ndb -1,1,0.25; db -0.25,-1,0.25; db -0.25,-1,0;\r\ndb 1,1,0.25; db 1,1,0; db 0.25,-1,0;\r\ndb 1,1,0.25; db 0.25,-1,0; db 0.25,-1,0.25;\r\ndb -0.75,1,0; db 0,-1,0; db -0.75,1,0.25;\r\ndb -0.75,1,0.25; db 0,-1,0; db 0,-1,0.25;\r\ndb 0.75,1,0; db 0.75,1,0.25; db 0,-1,0;\r\ndb 0.75,1,0.25; db 0,-1,0.25; db 0,-1,0;\r\ndb -0.47,0.25,0; db -0.38,0.01,0; db 0.38,0.01,0;\r\ndb 0.38,0.01,0; db 0.47,0.25,0; db -0.47,0.25,0;\r\ndb -0.47,0.25,0.25; db 0.38,0.01,0.25; db -0.38,0.01,0.25;\r\ndb 0.38,0.01,0.25; db -0.47,0.25,0.25; db 0.47,0.25,0.25;\r\ndb -0.38,0.01,0; db -0.38,0.01,0.25; db 0.38,0.01,0;\r\ndb 0.38,0.01,0; db -0.38,0.01,0.25; db 0.38,0.01,0.25; \r\ndb -0.47,0.25,0; db 0.47,0.25,0; db -0.47,0.25,0.25;\r\ndb -0.47,0.25,0.25; db 0.47,0.25,0; db 0.47,0.25,0.25;\r\ndb -1,1,0; db -0.75,1,0; db -1,1,0.25;\r\ndb -0.75,1,0; db -0.75,1,0.25; db -1,1,0.25;\r\ndb 1,1,0; db 1,1,0.25; db 0.75,1,0;\r\ndb 0.75,1,0; db 1,1,0.25; db 0.75,1,0.25;\r\n","gpuchip/examples/texture.txt":"// Author: Drunkie\r\n// Description: A very simple texture example\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glVertexMode( 1 );\r\n glColor( 255, 255, 255, 255 );\r\n\r\n glBindTexture( 'brick/brick_model' );\r\n glColor( 255, 255, 255, 255 );\r\n glRectWH( 128, 128, 256, 256 );\r\n \r\n glExit(); \r\n}\r\n\r\n// ZASM version\r\n\r\n//mov #regVertexMode,1;\r\n//dcolor white;\r\n//dxtexture tex;\r\n//drectwh pos,size;\r\n//dexit;\r\n//color white,255,255,255;\r\n//string tex,'brick/brick_model';\r\n//vec2f pos,128,128;\r\n//vec2f size,256,256;\r\n","gpuchip/examples/foxlogo.txt":"//Fox game console logo (also example on how to work with polygons)\r\n\r\ndclrscr chassis;\r\n\r\ndcolor fox1c;\r\ndvxdata_2f fox1a,16; //16 max!!\r\ndvxdata_2f fox2a,3;\r\ndvxdata_2f fox3a,3;\r\ndvxdata_2f fox4a,3;\r\ndvxdata_2f fox5a,3;\r\ndvxdata_2f fox6a,3;\r\ndvxdata_2f fox7a,6;\r\ndvxdata_2f fox8a,3;\r\n\r\ndcolor fox2c;\r\ndvxdata_2f fox2,4;\r\n\r\ndexit;\r\n\r\n//===========================================\r\ncolor chassis,0,0,0;\r\n\r\ncolor fox1c,60,60,60;\r\ncolor fox2c,100,100,100;\r\n//===========================================\r\nfox1a: //N=16\r\ndb 60,218\r\ndb 62,173\r\ndb 32,36\r\ndb 214,119\r\ndb 268,128\r\ndb 318,168\r\ndb 352,233\r\ndb 494,243\r\ndb 499,254\r\ndb 496,266\r\ndb 478,321\r\ndb 335,374\r\ndb 265,408\r\ndb 223,419\r\ndb 95,430\r\ndb 109,408\r\n\r\nfox2a: //N = 3\r\ndb 109,408\r\ndb 57,432\r\ndb 69,376\r\nfox3a:\r\ndb 69,376\r\ndb 33,394\r\ndb 59,327\r\nfox4a:\r\ndb 59,327\r\ndb 24,348\r\ndb 54,273\r\nfox5a:\r\ndb 54,273\r\ndb 29,286\r\ndb 57,240\r\nfox6a:\r\ndb 57,240\r\ndb 26,245\r\ndb 60,218\r\n\r\nfox7a: //N=6\r\ndb 109,408\r\ndb 69,376\r\ndb 59,327\r\ndb 54,273\r\ndb 57,240\r\ndb 60,218\r\n\r\nfox8a: //N=3\r\ndb 177,150;\r\ndb 269,150;\r\ndb 190,47;\r\n\r\n//===========================================\r\nfox2: //N=4\r\ndb 340,238\r\ndb 286,257\r\ndb 274,203\r\ndb 311,213\r\n//===========================================","gpuchip/examples/table.txt":"// Author: Drunkie\r\n// Description: Draws a table; useful for calendars or spreadsheets!\r\n\r\nMain();\r\n\r\n#include \r\n\r\nfloat rows = 6;\r\nfloat cols = 5;\r\nfloat sizex = 476;\r\nfloat sizey = 400;\r\nfloat linewidth = 3;\r\n\r\nfloat i, j, day;\r\n\r\nvoid Main()\r\n{\r\n dentrypoint 0,DrawThread; \r\n dentrypoint 4,AsyncThread;\r\n \r\n *regHWClear = 0\r\n *regAsyncFreq = 200000;\r\n *regAsyncClk = 1;\r\n}\r\n\r\nvoid DrawThread()\r\n{\r\n dexit;\r\n}\r\n\r\nvoid AsyncThread()\r\n{\r\n glBegin();\r\n \r\n glClear( 35, 35, 35 ); // Clear screen color\r\n \r\n glColor( 255, 255, 255 ); // Set draw color\r\n glFont( GL_FONT_ARIAL ); // Set font type\r\n glFontSize( 36 ); // Set font size\r\n glWriteString( 16, 6, 'Simple-Calendar 1.0');\r\n \r\n glColor( 120, 120, 120 );\r\n glOffset( 16, 64 ); // Set screen offset\r\n glRectWH( 0, 0, sizex + linewidth, sizey + linewidth); // Draw rectangle\r\n \r\n glFont( GL_FONT_TREBUCHET );\r\n glFontSize( 14 );\r\n \r\n // Calculate rectangle size\r\n float sx = (sizex / rows) - linewidth;\r\n float sy = (sizey / cols) - linewidth;\r\n \r\n // Loop through rows\r\n for (i = 0; i < rows; i++)\r\n {\r\n // Loop through columns\r\n for (j = 0; j < cols; j++)\r\n {\r\n // Calculate x,y coordinate to draw at\r\n float x = i * (sizex / rows);\r\n float y = j * (sizey / cols);\r\n \r\n glColor( 200, 200, 200 ); // Set draw color\r\n glRectWH( x + linewidth, y + linewidth, sx, sy ); // Draw rectangle\r\n \r\n glColor( 0, 0, 0 ); // Set draw color\r\n \r\n // Write integer to screen\r\n day = i + (j * rows)\r\n glWriteInt( x + linewidth + 2, y + linewidth + 2, day + 1 ); \r\n }\r\n }\r\n \r\n glEnd();\r\n}\r\n\r\n\r\n","gpuchip/examples/bounce.txt":"//////////////////////////////////\r\n// BOUNCING BALL GPU EXAMPLE //\r\n//////////////////////////////////\r\ndentrypoint 0,_draw;\t\t// Set draw start entrypoint to \"_draw\"\r\n\t\t\t\t//\r\nrand #ball.x;\t\t\t// Set random ball start point\r\nrand #ball.y;\t\t\t//\r\n\t\t\t\t//\r\ndexit;\t\t\t\t// Exit the initialization routine...\r\n//////////////////////////////////\r\n_draw:\t\t\t\t// Entrypoint for the drawing function\r\n\t\t\t\t//\r\ndcvxpipe 2;\t\t\t// Set coordinate pipe to 2 (to use coordinates 0...1)\r\ndclrscr bg_color;\t\t// Clear screen with background color\r\n\t\t\t\t//\r\ndmuldt eax,#d.x;\t\t// EAX = Direction Vector * Delta (change of coords per frame)\r\nadd #ball.x,eax;\t\t// Move the ball\r\ndmuldt eax,#d.y;\t\t//\r\nadd #ball.y,eax;\t\t//\r\n\t\t\t\t//\r\ncmp #ball.x,0.9;\t\t// Check hits against walls\r\ncge bounce.x;\t\t\t// Call bounce routine...\r\ncmp #ball.x,0.0;\t\t//\r\ncle bounce.x;\t\t\t//\r\n\t\t\t\t//\r\ncmp #ball.y,0.9;\t\t// Bounce on other axis\r\ncge bounce.y;\t\t\t//\r\ncmp #ball.y,0.0;\t\t//\r\ncle bounce.y;\t\t\t//\r\n\t\t\t\t//\r\ndcolor ball_color;\t\t// Set color to color of ball\r\ndrectwh ball,ball_wh;\t\t// Draw the ball\r\n\t\t\t\t//\r\ndsetsize 24;\t\t\t// Set font size\r\ndwrite textpos,text;\r\n\t\t\t\t//\r\ndexit;\t\t\t\t// Exit the draw function\r\n//////////////////////////////////\r\nbounce.x:\t\t\t// Bounce function (change X speed)\r\n neg #d.x; \t\t\t//\r\n min #ball.x,0.9;\t\t//\r\n max #ball.x,0.0;\t\t//\r\nret\t\t\t\t//\r\n\t\t\t\t//\r\nbounce.y:\t\t\t// Bounce function (change Y speed)\r\n neg #d.y;\t\t\t//\r\n min #ball.y,0.9;\t\t//\r\n max #ball.y,0.0;\t\t//\r\nret\t\t\t\t//\r\n//////////////////////////////////\r\n// Data and resources\t\t//\r\n//////////////////////////////////\r\n\t\t\t\t//\r\ncolor ball_color,255,255,255;\t// Ball color (white)\r\ncolor bg_color, 64, 32,128;\t// Background color (neon violet)\r\n\t\t\t\t//\r\nvector2f ball;\t\t\t// Ball position\r\nvector2f ball_wh,0.1,0.1;\t// Ball width/height\r\n\t\t\t\t//\r\nvector2f textpos,0.1,0.1;\t// Text position\r\n\t\t\t\t//\r\nvector2f d,1.0,1.0;\t\t// Movement direction & speed\r\n\t\t\t\t//\r\nstring text,'Bouncing ball!';\t// \"Bouncing ball!\"\r\n//////////////////////////////////","gpuchip/examples/3d_cube.txt":"// Author: Drunkie\r\n// Description: 3D Cube\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glClear( 0, 0, 0 ); // Clear screen\r\n \r\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode \r\n glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation\r\n \r\n glLightPos( 0, 0, -20 ); // Set the light position\r\n glLightColor( 255, 255, 255, 1 ); // Set the light color\r\n\r\n glLookAt(\r\n 0, 0, -5, // Camera pos\r\n 0, 0, 0, // Camera target\r\n 0, 1, 0 // Camera up\r\n ); \r\n\r\n // Create variable to hold curtime\r\n float time;\r\n timer time;\r\n\r\n // Create perspective and matrix transformations\r\n glPerspective( 30, 1, 1, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR\r\n glRotate( 1, 1, 0, time ); // AXIS X, Y, Z, ANGLE W\r\n glTranslate( 0, 0, 0 ); // TRANSLATION X, Y, Z\r\n glScale( 1, 1, 1 ); // SCALE X, Y, Z\r\n\r\n glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer \r\n glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting\r\n\r\n // Solid 3D polygon\r\n glFillMode( GL_FILL_SOLID ); // Set fillmode as solid\r\n glColor4( 100, 149, 237, 180 ); // Set draw color with alpha\r\n glPoly3D( vertexBuffer, 12 ); // Draw 3D polygon \r\n glFlush(); // Flush the vertex buffer to the screen\r\n \r\n // Wireframe 3D polygon\r\n glLineWidth( 1 ); // Set line width\r\n glFillMode( GL_FILL_WIREFRAME ); // Set fillmode as solid\r\n glColor4( 255, 255, 255, 255 ); // Set draw color with alpha\r\n glPoly3D( vertexBuffer, 12 ); // Draw 3D polygon \r\n glFlush(); // Flush the vertex buffer to the screen\r\n \r\n glExit(); // Exit\r\n}\r\n\r\n// The vertex data for our model\r\nvertexBuffer:\r\ndb -1,-1,-1; db 1,-1,-1; db 1,1,-1;\r\ndb -1,-1,-1; db 1,1,-1; db -1,1,-1;\r\ndb 1,-1,1; db -1,-1,1; db 1,1,1;\r\ndb -1,-1,1; db -1,1,1; db 1,1,1;\r\ndb 1,-1,-1; db -1,-1,-1; db 1,-1,1;\r\ndb -1,-1,-1; db -1,-1,1; db 1,-1,1;\r\ndb -1,1,-1; db 1,1,-1; db 1,1,1;\r\ndb -1,1,1; db -1,1,-1; db 1,1,1;\r\ndb -1,-1,-1; db -1,1,-1; db -1,1,1;\r\ndb -1,-1,1; db -1,-1,-1; db -1,1,1;\r\ndb 1,1,-1; db 1,-1,-1; db 1,1,1;\r\ndb 1,-1,-1; db 1,-1,1; db 1,1,1;\r\n","gpuchip/examples/3d_tunnel.txt":"// Author: Drunkie\r\n// Description: Draws a never ending tunnel in 3D!\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glSleep( 60 ); // Sleep for 60 milliseconds (reduces fps lag)\r\n glClear( 0, 0, 0 ); // Clear screen\r\n \r\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode \r\n glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation\r\n\r\n glLightPos( -1, -1, -1 ); // Set the light position\r\n glLightColor( 255, 255, 255, 1.25 ); // Set the light color\r\n\r\n glLookAt(\r\n 0, 0, -25, // Camera pos\r\n 0, 0, 0, // Camera target\r\n 0, 1, 0 // Camera up\r\n ); \r\n\r\n // Loop and draw 4 models\r\n for (i = 0; i < 4; i++)\r\n {\r\n // Set translations for each model\r\n timer zTranslate;\r\n zTranslate *= -16;\r\n mod zTranslate,16;\r\n zTranslate += (i * 16);\r\n \r\n // Create perspective and matrix transformations\r\n glPerspective( 8, 1, 0.4, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR\r\n glRotate( 0, 0, 0, 0 ); // AXIS X, Y, Z, ANGLE W\r\n glTranslate( 0, 0, zTranslate ); // TRANSLATION X, Y, Z\r\n glScale( 1.2, 1, 8 ); // SCALE X, Y, Z\r\n \r\n glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer \r\n glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting\r\n glEnable( GL_VERTEX_LIGHTING ); // Enable vertex lighting\r\n glEnable( GL_VERTEX_CULLING ); // Enable face culling\r\n\r\n // Solid 3D polygon\r\n glFillMode( GL_FILL_SOLID ); // Set fillmode as solid\r\n glColor4( 255, 255, 255, 150 ); // Set the draw color with alpha\r\n glPoly3D( VertexBuffer, 12 ); // Draw 3D polygon\r\n glFlush(); // Send our vertex buffer to screen\r\n \r\n // Wireframe 3D polygon\r\n glLineWidth( 1 ); // Set line width of wireframe\r\n glFillMode( GL_FILL_WIREFRAME ); // Set fillmode to wireframe\r\n glColor4( 255, 255, 255, 255 ); // Set the draw color with alpha\r\n glPoly3D( vertexBuffer, 8 ); // Draw 3D polygon\r\n glFlush(); // Send our vertex buffer to screen\r\n }\r\n\r\n glExit(); // Exit\r\n}\r\n\r\nfloat i;\r\nfloat zTranslate;\r\n\r\nvertexBuffer:\r\ndb 1,1,-1; db -1,1,-1; db 1,1,1;\r\ndb -1,1,-1; db -1,1,1; db 1,1,1;\r\ndb 1,1,-1; db 1,1,1; db 1,-1,-1;\r\ndb 1,-1,-1; db 1,1,1; db 1,-1,1;\r\ndb -1,1,-1; db -1,-1,-1; db -1,1,1;\r\ndb -1,-1,-1; db -1,-1,1; db -1,1,1; \r\ndb 1,-1,-1; db 1,-1,1; db -1,-1,-1;\r\ndb -1,-1,-1; db 1,-1,1; db -1,-1,1;\r\n","gpuchip/examples/line_graph.txt":"// Author: Drunkie\r\n// Description: A fake lag-o-meter that plots points on a grid\r\n\r\nMain();\r\n\r\n#include \r\n\r\nfloat i;\r\nfloat x, y;\r\nfloat ox = 0, oy = 256;\r\nfloat lines = 10;\r\nfloat lineWidth = 1\r\nfloat frameWidth = 510;\r\nfloat frameHeight = 300;\r\n\r\nvoid Main()\r\n{\r\n glVertexMode( 1 ); // Enable vertex mode\r\n glColor( 255, 255, 255 ); // Set draw color\r\n \r\n // Set texture as background\r\n glBindTexture( \"phoenix_storms/lag_sign\" );\r\n glClearTexture();\r\n glBindTexture( 0 ); // Discard texture\r\n \r\n glFont( GL_FONT_AKBAR ); // Set font type\r\n glFontSize( 36 ); // Set font size\r\n glWriteString( 2, 2, \"LAG-O-METER\" ); // Write string to screen\r\n \r\n glOffset( lineWidth, 90 ); // Offset the screen coordinates\r\n \r\n glColor4( 0, 0, 0, 160 ); // Set draw color with alpha\r\n glRectWH( 0, 0, frameWidth, frameHeight ); // Draw rectangle\r\n \r\n glColor( 255, 255, 255 ); \r\n glLineWidth( lineWidth ); // Set line width\r\n glORectWH( 0, 0, frameWidth, frameHeight ); // Draw outlined rectangle\r\n \r\n glLineWidth( 1 ); // Set line width to 1\r\n \r\n // Loop and make a bunch of connected lines\r\n for (i = 0; i < lines; i++)\r\n {\r\n if (i == 0) {\r\n ox = 0;\r\n rand oy;\r\n oy *= frameHeight;\r\n }\r\n else {\r\n ox = x; oy = y;\r\n }\r\n x = ((i+1) / lines) * frameWidth;\r\n rand y;\r\n y *= frameHeight;\r\n glLine( ox, oy, x, y ); // Draw line on graph\r\n }\r\n \r\n glOffset( 0, 0 ); // Set screen offset back to 0,0\r\n glWriteString( 2, 400, \"INTENSE LAG DETECTED\" );\r\n \r\n glExit(); // Exit\r\n}\r\n","gpuchip/examples/mt2.txt":"dcvxpipe 3;\r\nmov #regHWClear,0; //Stop hardware clearing\r\ndsetwidth 0.05;\r\n\r\ntimer EAX;\r\nmov EDX,EAX; sub EDX,#PrevTime; //EDX = Delta time\r\nmov #PrevTime,EAX;\r\n\r\nmov EBP,0.4; //Speed of rotation\r\n\r\nmov ECX,8;\r\nDrawLoop:\r\n mov EAX,#Angle; mul EAX,1;\r\n fsin #EndPoint.X,EAX; mul EAX,2;\r\n fcos #EndPoint.Y,EAX;\r\n\r\n //HSL coloring\r\n fsin #HSL.R,EAX; mul #HSL.R,127; add #HSL.R,128; add EAX,1.57;// mul EAX,2;\r\n fsin #HSL.G,EAX; mul #HSL.G,127; add #HSL.G,128; add EAX,1.57;// mul EAX,2;\r\n fsin #HSL.B,EAX; mul #HSL.B,127; add #HSL.B,128;\r\n \r\n dcolor HSL;\r\n\r\n //Looks very nice\r\n dline StartPoint1,EndPoint;\r\n dline StartPoint2,EndPoint;\r\n dline StartPoint3,EndPoint;\r\n dline StartPoint4,EndPoint;\r\n \r\n mul EDX,EBP;\r\n add #Angle,EDX;\r\nloop DrawLoop;\r\n\r\ndexit;\r\n\r\nalloc Angle;\r\nalloc PrevTime;\r\n\r\ncolor HSL;\r\n\r\nvector2f EndPoint,0,0;\r\nvector2f StartPoint0,0,0;\r\nvector2f StartPoint1,1,1;\r\nvector2f StartPoint2,1,-1;\r\nvector2f StartPoint3,-1,-1;\r\nvector2f StartPoint4,-1,1;\r\n","gpuchip/examples/mt3.txt":"//== 3D Graphics begin here ====================================================\r\n dvxpipe 3;\r\n dcvxpipe 3;\r\n\r\n //Calc depth here\r\n mov #Background.MinDepth, 0.8; //Near distance\r\n mov #Background.MaxDepth, 6.0; //Far distance\r\n mov #Background.ShadeStart,1.0;\r\n mov #Background.DepthStep ,0.3; //Depth step. The lower, the higher quality is\r\n\r\n timer #Time; mul #Time,3;\r\n\r\n mov EAX,#Time; mod EAX,#Background.DepthStep;\r\n\r\n sub #Background.MinDepth,EAX;\r\n sub #Background.MaxDepth,EAX;\r\n\r\n //Initialize depth range\r\n mov #Background.deltaDepth,#Background.MaxDepth;\r\n sub #Background.deltaDepth,#Background.MinDepth;\r\n\r\n //Compute background stuff\r\n mov #Background.ShadeStep,#Background.deltaDepth;\r\n div #Background.ShadeStep,#Background.DepthStep;\r\n frnd #Background.ShadeStep;\r\n finv #Background.ShadeStep;\r\n mul #Background.ShadeStep,#Background.ShadeStepMul;\r\n\r\n //Brightness too\r\n mov EAX,#Time; mod EAX,#Background.ShadeStep;\r\n sub #Background.ShadeStart,EAX;\r\n\r\n mov #_rect.color.r,200;\r\n mov #_rect.color.b,200;\r\n\r\n// Uncomment this for trippy camera\r\n// timer EAX; div EAX,8; fsin EBX,EAX; mul EBX,2;\r\n// drotatescale EAX,EBX; mul EBX,2;\r\n\r\n dsetwidth 0.8;\r\n call Draw.Background; \r\ndexit;\r\n\r\nalloc Time;\r\n\r\n//==============================================================================\r\nDraw.Background:\r\n //Draw all the rectangles\r\n mov EAX,#Background.MinDepth; mov ECX,#Background.ShadeStart;\r\n BackgroundLoop:\r\n mov EDX,#Time; add EDX,EAX; \r\n mov EBP,#Time; div EBP,6.28; fcos EBP,EBP;\r\n\r\n fsin EDI,EDX; mul EDI,EBP; mul EDI,0.8; sub EDI,1;\r\n mov #_rect.offset.x,EDI;\r\n\r\n fcos ESI,EDX; mul ESI,EBP; mul ESI,0.4; sub ESI,1;\r\n mov #_rect.offset.y,ESI;\r\n\r\n mov EDX,ECX; fpwr EDX,2;\r\n mov #regZOffset,EAX;\r\n \r\n dcolor _rect.color; \r\n// Uncomment this for trippy HSL color\r\n// mov ESI,#Time; add ESI,EAX;\r\n// fsin #HSL.R,ESI; mul #HSL.R,127; add #HSL.R,128; add ESI,1.57;// mul EAX,2;\r\n// fsin #HSL.G,ESI; mul #HSL.G,127; add #HSL.G,128; add ESI,1.57;// mul EAX,2;\r\n// fsin #HSL.B,ESI; mul #HSL.B,127; add #HSL.B,128;\r\n//\r\n// dcolor HSL;\r\n dshade EDX;\r\n dorectwh _rect.offset,_rect.wh;\r\n\r\n sub ECX,#Background.ShadeStep;\r\n add EAX,#Background.DepthStep;\r\n\r\n cmp EAX,#Background.MaxDepth;\r\n jl BackgroundLoop;\r\nret\r\n\r\n//==============================================================================\r\n//Drawing parameters\r\nscalar Background.MinDepth;\r\nscalar Background.MaxDepth;\r\nscalar Background.deltaDepth;\r\nscalar Background.DepthStep;\r\nscalar Background.ShadeStart;\r\nscalar Background.ShadeStep;\r\nscalar Background.ShadeStepMul,0.5;\r\n\r\ncolor HSL;\r\n\r\n//Generic rectangle\r\nvector2f _rect.offset,-1,-1;\r\nvector2f _rect.wh,2,2;\r\n\r\nvector2f _pad1.offset;\r\nvector2f _pad2.offset;\r\nvector2f _pad.wh;\r\n\r\n//Color scheme\r\ncolor _rect.color, 200,200,200;\r\ncolor _rect.color2,200,200,000;\r\n\r\ncolor _pad1.color, 000,200,000;\r\ncolor _pad2.color, 200,000,000;\r\n","gpuchip/examples/hud_engine.txt":"//mov #65522,1;\r\n//mov #65525,0.66;\r\n//port0 & port1 - engine left/right throttle (0..1)\r\n//port2 & port3 - delta (not used)\r\n\r\n//This displays engine window in PhoenixWings airplane\r\n\r\nmov #65485,16; //set circle quality\r\n\r\ndclrscr hud_border;\r\n\r\ndcolor hud_text;\r\ndcircle hud_engine1gauge,68;\r\ndcircle hud_engine2gauge,68;\r\ndcolor hud_border;\r\ndcircle hud_engine1gauge,64;\r\ndcircle hud_engine2gauge,64;\r\n\r\ndcolor hud_text;\r\ndsetwidth 1;\r\ndline hud_engine1gauge_start,hud_engine1gauge;\r\ndline hud_engine2gauge_start,hud_engine2gauge;\r\n\r\ndsetwidth 2;\r\n\r\n//===\r\nmov eax,port0; mul eax,100;\r\nmul eax,0.1;\r\nmul #left_power,1.9;\r\nadd #left_power,eax;\r\ndiv #left_power,2;\r\n\r\nmov eax,#left_power; div eax,100;\r\nmul eax,6.00;\r\nadd eax,1.57;\r\n\r\ndrotatescale eax,1;\r\ndmove hud_engine1gauge;\r\n\r\ndline gauge_base,gauge_needle;\r\n//==\r\nmov #right_power,#left_power; //comment this and..\r\n//uncomment if your left/right engines are not synchronized\r\n//mov eax,port1; mul eax,100;\r\n//mul eax,0.1;\r\n//mul #right_power,1.9;\r\n//add #right_power,eax;\r\n//div #right_power,2;\r\n\r\n//mov eax,#right_power; div eax,100;\r\n//mul eax,6.00;\r\n//add eax,1.57;\r\n\r\ndrotatescale eax,1;\r\ndmove hud_engine2gauge;\r\n\r\ndline gauge_base,gauge_needle;\r\n//==\r\n\r\n//use this for whatever you wanna\r\n//mov #left_delta,port2; sub #left_delta,7.6; mul #left_delta,10;\r\n//mov #right_delta,port3; sub #right_delta,7.6; mul #right_delta,10;\r\n\r\ndrotatescale 0,1; //reset!\r\ndmove 0;\r\n\r\ndsetfont 4;\r\ndsetsize 28;\r\ndwritefmt hud_text1pos,hud_text1;\r\ndwritefmt hud_text2pos,hud_text2;\r\n\r\ncmp port4,1;\r\ndcolor hud_yellow;\r\nje _nsh;\r\n dshade 0.25;\r\n_nsh:\r\ndwrite hud_text3pos,hud_text3;\r\ndexit;\r\n\r\nvector2f hud_text1pos,70,212;\r\nvector2f hud_text2pos,310,212;\r\nvector2f hud_text3pos,20,460;\r\n\r\nstring hud_text1,'Left Engine',10,10,'N1 = %i%%',10,'Delta = %i%%';\r\nalloc left_power; alloc left_delta;\r\nstring hud_text2,'Right Engine',10,10,'N1 = %i%%',10,'Delta = %i%%';\r\nalloc right_power; alloc right_delta;\r\nstring hud_text3,'';\r\n\r\nvector2f hud_engine1gauge,128,128;\r\nvector2f hud_engine1gauge_start,128,64;\r\n\r\nvector2f hud_engine2gauge,384,128;\r\nvector2f hud_engine2gauge_start,384,64;\r\n\r\nvector2f gauge_base,0,0;\r\nvector2f gauge_needle,0,-48;\r\n\r\ncolor hud_text,64,255,64;\r\ncolor hud_yellow,255,255,64;\r\ncolor hud_border,30,30,30;\r\n","gpuchip/examples/plasma.txt":"//Plasma fractals\r\n//Converted by dlb from http://bocoup.com/processing-js/docs/index.php?page=Plasma%20Fractals\r\n//Which was converted by F1LT3R @ Hyper-Metrix.com from original at http://www.ic.sunysb.edu/Stu/jseyster/plasma/\r\n\r\nmov #regHWClear,0; //Stop GPU clearing itself\r\n\r\ndentrypoint 0,_draw; //Set the entry point for the draw loop\r\ndentrypoint 4,_async; //Set the enty point for the async loop\r\n\r\nmov #regAsyncFreq,2000000; //Make async run as fast as it can\r\nmov #regAsyncClk,1; //Start async\r\n\r\ndexit; //End init\r\n_draw: //Start draw\r\ndexit; //End draw\r\n\r\n//Setup variables\r\ncolor col;\r\nvec2f pos;\r\nvec2f size;\r\nfloat gridSize, edge1, edge2, edge3, edge4, midPoint, newWidth, newHeight, width, height, noise;\r\n\r\n_async: //Enter async\r\n\r\nmain(); //Run main function\r\n\r\nwhile(1){idle} //Infinatly loop\r\n\r\nvoid main(){ //Main function\r\n dsetbuf_spr; //Use sprite buffer\r\n \r\n setColor(255,255,255); //Set the colour to white\r\n rect(0,0,512,512); //Draw a large rectangle\r\n\r\n gridSize = 4; //How big each rectangle will be\r\n width = 512; //GPU Width\r\n height = 512; //GPU Height\r\n noise = 5; //How noisy it will be\r\n \r\n //Give initial corner values\r\n R1 = random(1);\r\n R2 = random(1);\r\n R3 = random(1);\r\n R4 = random(1);\r\n \r\n plasma(0,0,width,height,R1,R2,R3,R4) //Start recursive function\r\n}\r\n\r\nvoid plasma(float x, y, width, height, c1, c2, c3, c4){ //Plasma function\r\n \r\n //Setup local variables\r\n float edge1, edge2, edge3, edge4, midPoint;\r\n \r\n //Work out the size of the next segments\r\n float newWidth = width / 2;\r\n float newHeight = height / 2;\r\n \r\n if((width > gridSize)||(height > gridSize)){ //If it is still bigger than the rectangle size\r\n \r\n midPoint = (c1 + c2 + c3 + c4) / 4 + displace(newWidth + newHeight); //Randomly change the midpoint\r\n \r\n //Calculate edges by averaging the corners\r\n edge1 = (c1 + c2) / 2; \r\n edge2 = (c2 + c3) / 2; \r\n edge3 = (c3 + c4) / 2; \r\n edge4 = (c4 + c1) / 2; \r\n \r\n //Make sure it doesn't displace too far\r\n max midPoint,0;\r\n min midPoint,1;\r\n \r\n //Run on the newly calculated segments\r\n plasma(x, y, newWidth, newHeight, c1, edge1, midPoint, edge4);\r\n plasma(x + newWidth, y, newWidth, newHeight, edge1, c2, edge2, midPoint); \r\n plasma(x + newWidth, y + newHeight, newWidth, newHeight, midPoint, edge2, c3, edge3); \r\n plasma(x, y + newHeight, newWidth, newHeight, edge4, midPoint, edge3, c4);\r\n }else{ //Woo! It's the right size\r\n float c = (c1 + c2 + c3 + c4) / 4; //Average the corners\r\n \r\n float grey = c*255; //Multiply the corners by 255 to get a valid color\r\n \r\n setColor(grey,grey,grey); //Set the color to your new color based on the \"height\"\r\n rect(x,y,gridSize,gridSize); //Draw your rectangle\r\n }\r\n}\r\n\r\nfloat displace(float num){ //Displace function, it just works\r\n float m = num / (width + height) * (1/noise); \r\n R1 = random(1); \r\n return (R1-0.5) * m; \r\n}\r\n\r\nfloat random(float x){ //C version of the ASM rand opcode\r\n preserve EAX;\r\n rand EAX;\r\n return EAX*x;\r\n}\r\n\r\nvoid setColor(float r,float g,float b){ //C version of the dcolor opcode\r\n mov #col.r,r;\r\n mov #col.g,g;\r\n mov #col.b,b;\r\n \r\n dcolor col;\r\n}\r\n\r\nvoid rect(float x, float y, float width, float height){ //C version of the drectwh opcode\r\n mov #pos.x,x;\r\n mov #pos.y,y;\r\n \r\n mov #size.x,width;\r\n mov #size.y,height;\r\n \r\n drectwh pos, size;\r\n dswap; //dswap to make it show since we're drawing to the sprite buffer\r\n}"},"gpuchip/lib/":{"gpuchip/lib/drivers/":{"gpuchip/lib/drivers/drv_gl.txt":"// [Author] - Drunkie\r\n// [Description] - A graphics driver that provides C-style functions for GPU\r\n// [Documentation] - http://goo.gl/DHhYb\r\n\r\n\r\n#define GL\r\n\r\n// Font\r\n#define GL_FONT_LUCIDA_CONSOLE 0\r\n#define GL_FONT_COURIER_NEW 1\r\n#define GL_FONT_TREBUCHET 2\r\n#define GL_FONT_ARIAL 3\r\n#define GL_FONT_TIMES_NEW_ROMAN 4\r\n#define GL_FONT_COOLVETICA 5\r\n#define GL_FONT_AKBAR 6\r\n#define GL_FONT_CSD 7\r\n\r\n// Buffer\r\n#define GL_BUFFER_FRONT 0\r\n#define GL_BUFFER_BACK 1\r\n#define GL_BUFFER_SPRITE 1\r\n#define GL_BUFFER_VERTEX 2\r\n\r\n// Coordinate pipe\r\n#define GL_CPIPE_DIRECT 0\r\n#define GL_CPIPE_RESOLUTION 1\r\n#define GL_CPIPE_0_1 2\r\n#define GL_CPIPE_N1_1 3\r\n#define GL_CPIPE_N256_256 4\r\n\r\n// Vertex pipe\r\n#define GL_VPIPE_XY 0\r\n#define GL_VPIPE_YZ 1\r\n#define GL_VPIPE_XZ 2\r\n#define GL_VPIPE_XYZPROJ 3\r\n#define GL_VPIPE_XYTRANSFORM 4\r\n#define GL_VPIPE_XYZTRANSFORM 5\r\n\r\n// denable / ddisable\r\n#define GL_VERTEX_BUFFER 0\r\n#define GL_VERTEX_ZSORT 1\r\n#define GL_VERTEX_LIGHTING 2\r\n#define GL_VERTEX_CULLING 3\r\n#define GL_VERTEX_DCULLING 4\r\n#define GL_VERTEX_TEXTURING 5\r\n\r\n// Fillmode\r\n#define GL_FILL_SOLID 0\r\n#define GL_FILL_WIREFRAME 1\r\n#define GL_FILL_TEXTURE 2\r\n\r\n// Cullmode\r\n#define GL_CULL_FRONT 0\r\n#define GL_CULL_BACK 1\r\n\r\n// Lightmode\r\n#define GL_LIGHT_FRONT 1\r\n#define GL_LIGHT_BACK -1\r\n\r\n// Horizontal font\r\n#define GL_ALIGN_LEFT 0\r\n#define GL_ALIGN_CENTER 1\r\n#define GL_ALIGN_RIGHT 2\r\n\r\n// Vertical font\r\n#define GL_VALIGN_TOP 0\r\n#define GL_VALIGN_MIDDLE 1\r\n#define GL_VALIGN_BOTTOM 2\r\n\r\n// Compatibility\r\n#define glSetTexture glBindTexture\r\n#define glWriteFmt glWriteFormat\r\n#define glFontHAlign glFontAlign\r\n\r\n\r\n// Clear\r\nvoid glClear( float r, float g, float b ) {\r\n mov #GL_BG.r,r; mov #GL_BG.g,g; mov #GL_BG.b,b; mov #GL_BG.a,255;\r\n dclrscr GL_BG;\r\n}\r\nvoid glClear4( float r, float g, float b, float a ) {\r\n mov #GL_BG.r,r; mov #GL_BG.g,g; mov #GL_BG.b,b; mov #GL_BG.a,a;\r\n dclrscr GL_BG;\r\n}\r\nvoid glClearTexture() {\r\n dclrtex;\r\n}\r\nvoid glHWClear( float n ) {\r\n mov #regHWClear,n;\r\n}\r\n\r\n// Color\r\nvoid glColor( float r, float g, float b ) {\r\n mov #GL_FG.r,r; mov #GL_FG.g,g; mov #GL_FG.b,b; mov #GL_FG.a,255;\r\n dcolor GL_FG;\r\n}\r\nvoid glColor4( float r, float g, float b, float a ) {\r\n mov #GL_FG.r,r; mov #GL_FG.g,g; mov #GL_FG.b,b; mov #GL_FG.a,a;\r\n dcolor GL_FG;\r\n}\r\nvoid glBrightness( float r, float g, float b, float a ) {\r\n mov #regBrightnessR,r;\r\n mov #regBrightnessG,g;\r\n mov #regBrightnessB,b;\r\n mov #regBrightnessW,a;\r\n}\r\nvoid glContrast( float r, float g, float b, float a ) {\r\n mov #regContrastR,r;\r\n mov #regContrastG,g;\r\n mov #regContrastB,b;\r\n mov #regContrastW,a;\r\n}\r\nvoid glShade( float n ) {\r\n dshade n;\r\n}\r\nvoid glShadeNorm( float n ) {\r\n dshadenorm n;\r\n}\r\n\r\n// Texture\r\nvoid glBindTexture( char* str ) {\r\n dxtexture str;\r\n}\r\nvoid glTexture( float id ) {\r\n dtexture id;\r\n}\r\nvoid glTextureSize( float n ) {\r\n mov #regTexSize,n;\r\n}\r\nvoid glTextureDataPtr( float n ) {\r\n mov #regTexDataPtr,n;\r\n}\r\nvoid glTextureDataSize( float n ) {\r\n mov #regTexDataSz,n;\r\n}\r\nvoid glTextureRotation( float n ) {\r\n mov #regTexRotation,n;\r\n}\r\nvoid glTextureScale( float n ) {\r\n mov #regTexScale,n;\r\n}\r\nvoid glTextureCenterUV( float u, float v ) {\r\n mov #regTexCenterU,u;\r\n mov #regTexCenterV,v;\r\n}\r\nvoid glTextureOffsetUV( float u, float v ) {\r\n mov #regTexOffsetU,u;\r\n mov #regTexOffsetV,v;\r\n}\r\n\r\n// Frame\r\nvoid glSleep( float ms ) {\r\n div ms,1000;\r\n timer #GL_CURTIME; \r\n sub #GL_CURTIME,#GL_TIMESTAMP;\r\n if (*GL_CURTIME <= ms) {\r\n mov #regHWClear,0;\r\n dexit;\r\n }\r\n timer #GL_TIMESTAMP; \r\n}\r\nvoid glExit() {\r\n dexit;\r\n}\r\n\r\n// Pipeline\r\nvoid glCoordPipe( float c ) {\r\n dcpipe c;\r\n}\r\nvoid glVertexPipe( float v ) {\r\n dvxpipe v;\r\n}\r\n\r\n// Hardware\r\nvoid glReset( float n ) {\r\n mov #regReset,n;\r\n}\r\nvoid glHalt( float n ) {\r\n mov #regHalt,n;\r\n}\r\nvoid glRAMReset( float n ) {\r\n mov #regRAMReset,n;\r\n}\r\nvoid glHScale( float n ) {\r\n mov #regHScale,n;\r\n}\r\nvoid glVScale( float n ) {\r\n mov #regVScale,n;\r\n}\r\nvoid glHWScale( float n ) {\r\n mov #regHWScale,n;\r\n}\r\nvoid glHWRotate( float n ) {\r\n mov #regRotation,n;\r\n}\r\n\r\n// Offset\r\nvoid glOffset( float x, float y ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dmove GL_V1;\r\n}\r\nfloat glOffsetX() {\r\n preserve eax;\r\n mov eax,#regOffsetX;\r\n}\r\nfloat glOffsetY() {\r\n preserve eax;\r\n mov eax,#regOffsetY;\r\n}\r\nvoid glCenter( float x, float y ) {\r\n mov #regCenterX,x;\r\n mov #regCenterY,y;\r\n}\r\n\r\n// Async\r\nvoid glAsyncReset( float n ) {\r\n mov #regAsyncReset,n;\r\n}\r\nvoid glAsyncClk( float n ) {\r\n mov #regAsyncClk,n;\r\n}\r\nvoid glAsyncFreq( float n ) {\r\n mov #regAsyncFreq,n;\r\n}\r\nvoid glEntryPoint( float idx, float ptr ) {\r\n dentrypoint idx,ptr;\r\n}\r\nvoid glBegin() {\r\n dbegin;\r\n}\r\nvoid glEnd() {\r\n dend;\r\n}\r\nvoid glSwap() {\r\n dswap;\r\n}\r\nvoid glSync() {\r\n dvsync;\r\n}\r\n\r\n// Cursor\r\nvoid glCursor( float n ) {\r\n mov #regCursor,n;\r\n}\r\nfloat glCursorX() {\r\n preserve eax;\r\n mov eax,#regCursorX;\r\n}\r\nfloat glCursorY() {\r\n preserve eax;\r\n mov eax,#regCursorY;\r\n}\r\n\r\n// Circle\r\nvoid glCircleQuality( float n ) {\r\n mov #regCircleQuality,n;\r\n}\r\nvoid glCircleStart( float n ) {\r\n mov #regCircleStart,n;\r\n}\r\nvoid glCircleEnd( float n ) {\r\n mov #regCircleEnd,n;\r\n}\r\n\r\n// Screen scaling\r\nvoid glScreenScale( float n ) {\r\n mov #regScale,n;\r\n}\r\nvoid glScreenScaleX( float x ) {\r\n mov #regScaleX,x;\r\n}\r\nvoid glScreenScaleY( float y ) {\r\n mov #regScaleY,y;\r\n}\r\n\r\n// 2D graphics\r\nvoid glCircle( float x, float y, float radius ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dcircle GL_V1,radius;\r\n}\r\nvoid glRect( float x, float y, float dx, float dy ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n mov #GL_V2.x,dx; mov #GL_V2.y,dy;\r\n drect GL_V1,GL_V2;\r\n}\r\nvoid glRectWH( float x, float y, float w, float h ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n mov #GL_V2.x,w; mov #GL_V2.y,h;\r\n drectwh GL_V1,GL_V2;\r\n}\r\nvoid glORect( float x, float y, float dx, float dy ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n mov #GL_V2.x,dx; mov #GL_V2.y,dy;\r\n dorect GL_V1,GL_V2;\r\n}\r\nvoid glORectWH( float x, float y, float w, float h ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n mov #GL_V2.x,w; mov #GL_V2.y,h;\r\n dorectwh GL_V1,GL_V2;\r\n}\r\nvoid glPixel( float x, float y ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dpixel GL_V1,GL_FG;\r\n}\r\nvoid glLine( float x, float y, float dx, float dy ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n mov #GL_V2.x,dx; mov #GL_V2.y,dy;\r\n dline GL_V1,GL_V2;\r\n}\r\nvoid glLineWidth( float w ) {\r\n dsetwidth w;\r\n}\r\nvoid glPoly2D( float* buffer, float count ) {\r\n dvxdata_2f buffer,count;\r\n}\r\n\r\n\r\n// Text\r\nvoid glFont( float id ) {\r\n dsetfont id;\r\n}\r\nvoid glFontAlign( float n ) {\r\n mov #regFontHalign,n;\r\n}\r\nvoid glFontVAlign( float n ) {\r\n mov #regFontValign,n;\r\n}\r\nvoid glFontSize( float n ) {\r\n dsetsize n;\r\n}\r\nfloat glTextWidth( char* str ) {\r\n preserve eax;\r\n dtextwidth eax,str;\r\n}\r\nfloat glTextHeight( char* str ) {\r\n preserve eax;\r\n dtextheight eax,str;\r\n}\r\nvoid glWriteString( float x, float y, char* str ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dwrite GL_V1,str;\r\n}\r\nvoid glWriteFloat( float x, float y, float n ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dwritef GL_V1,n;\r\n}\r\nvoid glWriteInt( float x, float y, float n ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dwritei GL_V1,n;\r\n}\r\nvoid glWriteFormat( float x, float y, char* str ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dwritefmt GL_V1,str;\r\n}\r\nfloat glParamList() {\r\n preserve eax;\r\n mov eax,#regParamList;\r\n}\r\n\r\n\r\n// 3D graphics\r\nvoid glPoly3D( float* buffer, float count ) {\r\n \r\n if (*GL_MUPDATE == 1) {\r\n mov #GL_MUPDATE,0;\r\n mrotate GL_MROTATEMATRIX,GL_VROTATE;\r\n mtranslate GL_MTRANSLATEMATRIX,GL_VTRANSLATE;\r\n mscale GL_MSCALEMATRIX,GL_VSCALE;\r\n mmov GL_MMODELMATRIX,GL_MTRANSLATEMATRIX;\r\n mmul GL_MMODELMATRIX,GL_MROTATEMATRIX;\r\n mmul GL_MMODELMATRIX,GL_MSCALEMATRIX;\r\n mmov GL_MMODELVIEWMATRIX,GL_MVIEWMATRIX;\r\n mmul GL_MMODELVIEWMATRIX,GL_MMODELMATRIX;\r\n mload GL_MMODELVIEWMATRIX; \r\n mloadproj GL_MPROJECTIONMATRIX;\r\n }\r\n \r\n if (*GL_FILLMODE == GL_FILL_SOLID) {\r\n dvxdata_3f buffer,count;\r\n }\r\n else if (*GL_FILLMODE == GL_FILL_WIREFRAME) {\r\n dvxdata_3f_wf buffer,count;\r\n }\r\n else if (*GL_FILLMODE == GL_FILL_TEXTURE) {\r\n dvxdata_3f_tex buffer,count\r\n }\r\n}\r\nvoid glFlush() {\r\n dvxflush;\r\n}\r\nvoid glEnable( float n ) {\r\n denable n;\r\n}\r\nvoid glDisable( float n ) {\r\n ddisable n;\r\n}\r\nvoid glLightPos( float x, float y, float z ) {\r\n mov #GL_LIGHTPOS.x,x; mov #GL_LIGHTPOS.y,y; mov #GL_LIGHTPOS.z,z;\r\n dsetlight 0,GL_LIGHTDATA;\r\n}\r\nvoid glLightColor( float r, float g, float b, float a ) {\r\n mov #GL_LIGHTCOL.r,r; mov #GL_LIGHTCOL.g,g;\r\n mov #GL_LIGHTCOL.b,b; mov #GL_LIGHTCOL.a,a;\r\n dsetlight 0,GL_LIGHTDATA;\r\n}\r\nvoid glFillMode( float n ) {\r\n mov #GL_FILLMODE,n;\r\n}\r\nvoid glLookAt( float x, float y, float z, float tx, float ty, float tz, float ux, float uy, float uz ) {\r\n mov #GL_VLOOKAT_POS.x,x; mov #GL_VLOOKAT_POS.y,y; mov #GL_VLOOKAT_POS.z,z;\r\n mov #GL_VLOOKAT_TARG.x,tx; mov #GL_VLOOKAT_TARG.y,ty; mov #GL_VLOOKAT_TARG.z,tz;\r\n mov #GL_VLOOKAT_UP.x,ux; mov #GL_VLOOKAT_UP.y,uy; mov #GL_VLOOKAT_UP.z,uz;\r\n mlookat GL_MVIEWMATRIX,GL_VLOOKAT;\r\n mov #GL_MUPDATE,1;\r\n}\r\nvoid glPerspective( float fov, float asp, float znear, float zfar ) {\r\n mov #GL_VPERSPECTIVE.x,fov; mov #GL_VPERSPECTIVE.y,asp;\r\n mov #GL_VPERSPECTIVE.z,znear; mov #GL_VPERSPECTIVE.w,zfar;\r\n mperspective GL_MPROJECTIONMATRIX,GL_VPERSPECTIVE;\r\n mov #GL_MUPDATE,1;\r\n}\r\nvoid glRotate( float x, float y, float z, float w ) {\r\n mov #GL_VROTATE.x,x; mov #GL_VROTATE.y,y; mov #GL_VROTATE.z,z; mov #GL_VROTATE.w,w; \r\n mov #GL_MUPDATE,1;\r\n}\r\nvoid glTranslate( float x, float y, float z ) {\r\n mov #GL_VTRANSLATE.x,x; mov #GL_VTRANSLATE.y,y; mov #GL_VTRANSLATE.z,z;\r\n mov #GL_MUPDATE,1;\r\n}\r\nvoid glScale( float x, float y, float z ) {\r\n mov #GL_VSCALE.x,x; mov #GL_VSCALE.y,y; mov #GL_VSCALE.z,z;\r\n mov #GL_MUPDATE,1;\r\n}\r\nvoid glZOffset( float n ) {\r\n mov #regZOffset,n;\r\n}\r\nvoid glCullDistance( float n ) {\r\n mov #regCullDistance,n;\r\n}\r\nvoid glCullMode( float n ) {\r\n mov #regCullMode,n;\r\n}\r\nvoid glLightMode( float n ) {\r\n mov #regLightMode,n;\r\n}\r\nvoid glVertexArray( float n ) {\r\n mov #regVertexArray,n;\r\n}\r\n\r\n// Other\r\nvoid glVertexMode( float n ) {\r\n mov #regVertexMode,n;\r\n}\r\nvoid glSetRenderTarget( float n ) {\r\n if (n == GL_BUFFER_FRONT) {\r\n dsetbuf_fbo;\r\n }\r\n else if (n == GL_BUFFER_BACK) {\r\n dsetbuf_spr;\r\n }\r\n else if (n == GL_BUFFER_VERTEX) {\r\n dsetbuf_vx;\r\n }\r\n}\r\nfloat glIndex() {\r\n preserve eax;\r\n mov eax,#regIndex;\r\n}\r\n\r\n\r\n// Allocated variables for GL\r\ncolor GL_FG,255,255,255;\r\ncolor GL_BG;\r\nvec4f GL_V1;\r\nvec4f GL_V2;\r\n\r\nalloc GL_TIMESTAMP;\r\nalloc GL_CURTIME;\r\nalloc GL_FILLMODE;\r\n\r\nGL_LIGHTDATA:\r\nvec4f GL_LIGHTPOS,0,0,-10;\r\ncolor GL_LIGHTCOL,255,255,255,1;\r\n\r\nGL_VLOOKAT:\r\nvec3f GL_VLOOKAT_POS,0,0,-10;\r\nvec3f GL_VLOOKAT_TARG,0,0,0;\r\nvec3f GL_VLOOKAT_UP,0,1,0;\r\n\r\nmatrix GL_MROTATEMATRIX;\r\nmatrix GL_MTRANSLATEMATRIX;\r\nmatrix GL_MSCALEMATRIX;\r\nmatrix GL_MPROJECTIONMATRIX;\r\nmatrix GL_MVIEWMATRIX;\r\nmatrix GL_MMODELMATRIX;\r\nmatrix GL_MMODELVIEWMATRIX;\r\nalloc GL_MUPDATE,1;\r\n\r\nvec4f GL_VROTATE;\r\nvec4f GL_VTRANSLATE;\r\nvec4f GL_VPERSPECTIVE;\r\nvec4f GL_VSCALE,1,1,1,0;\r\n\r\n\r\n","gpuchip/lib/drivers/drv_gl_toolkit.txt":"#ifndef GL\r\n#include \r\n#endif\r\n\r\n#ifndef GLT\r\n\r\n#define GLT\r\n#define GLT_MAX_TRIANGLES 32\r\n\r\nfloat __GLT_VERTBUFF[(GLT_MAX_TRIANGLES * 3) * 3];\r\nfloat __GLT_VERTCNT = 0;\r\n\r\nvoid gltVertex(float x, float y, float z)\r\n{\r\n if ((__GLT_VERTCNT / 3) >= GLT_MAX_TRIANGLES)\r\n \treturn;\r\n \r\n float* ptr = __GLT_VERTBUFF;\r\n ptr += (__GLT_VERTCNT * 3);\r\n \r\n *ptr = x;\r\n *(++ptr) = y;\r\n *(++ptr) = z;\r\n \r\n __GLT_VERTCNT++;\r\n}\r\n\r\nvoid gltTriangle(float x1, float y1, float z1,\r\n float x2, float y2, float z2,\r\n float x3, float y3, float z3)\r\n{\r\n gltVertex(x1, y1, z1);\r\n gltVertex(x2, y2, z2);\r\n gltVertex(x3, y3, z3);\r\n}\r\n\r\nvoid gltQuad(float tlx, float tly, float tlz,\r\n float trx, float try, float trz,\r\n float brx, float bry, float brz,\r\n float blx, float bly, float blz)\r\n{\r\n gltTriangle(\r\n trx, try, trz,\r\n tlx, tly, tlz,\r\n blx, bly, blz\r\n );\r\n \r\n gltTriangle(\r\n brx, bry, brz,\r\n trx, try, trz,\r\n blx, bly, blz\r\n );\r\n}\r\n\r\nvoid gltCube(float cex, float cey, float cez, float size)\r\n{\r\n float s2 = size / 2;\r\n \r\n gltQuad(\r\n cex - s2, cey + s2, cez - s2,\r\n cex + s2, cey + s2, cez - s2,\r\n cex + s2, cey - s2, cez - s2,\r\n cex - s2, cey - s2, cez - s2\r\n );\r\n \r\n gltQuad(\r\n cex + s2, cey + s2, cez + s2,\r\n cex - s2, cey + s2, cez + s2,\r\n cex - s2, cey - s2, cez + s2,\r\n cex + s2, cey - s2, cez + s2\r\n );\r\n \r\n gltQuad(\r\n cex - s2, cey + s2, cez + s2,\r\n cex - s2, cey + s2, cez - s2,\r\n cex - s2, cey - s2, cez - s2,\r\n cex - s2, cey - s2, cez + s2\r\n );\r\n \r\n gltQuad(\r\n cex + s2, cey + s2, cez - s2,\r\n cex + s2, cey + s2, cez + s2,\r\n cex + s2, cey - s2, cez + s2,\r\n cex + s2, cey - s2, cez - s2\r\n );\r\n \r\n gltQuad(\r\n cex - s2, cey + s2, cez + s2,\r\n cex + s2, cey + s2, cez + s2,\r\n cex + s2, cey + s2, cez - s2,\r\n cex - s2, cey + s2, cez - s2\r\n );\r\n \r\n gltQuad(\r\n cex - s2, cey - s2, cez - s2,\r\n cex + s2, cey - s2, cez - s2,\r\n cex + s2, cey - s2, cez + s2,\r\n cex - s2, cey - s2, cez + s2\r\n );\r\n}\r\n\r\nvoid gltClearBuffer()\r\n{\r\n __GLT_VERTCNT = 0;\r\n}\r\n\r\nvoid gltFlushBuffer()\r\n{\r\n if (__GLT_VERTCNT <= 3)\r\n return;\r\n \r\n float vcnt = __GLT_VERTCNT;\r\n float tcnt = (vcnt / 3) - (vcnt % 3);\r\n \r\n if (tcnt > GLT_MAX_TRIANGLES)\r\n tcnt = GLT_MAX_TRIANGLES;\r\n \r\n glPoly3D(__GLT_VERTBUFF, tcnt);\r\n glFlush();\r\n}\r\n\r\n#endif\r\n"}}},"spuchip/examples/":{"spuchip/examples/mario_theme.txt":"// Author: Jasongamer\r\n// Song: Mario Underwater Theme\r\n\r\n// Set track wave to channel 0 and start\r\nwset 0,trackwave;\r\nchwave 0,0;\r\nchvolume 0,0.2;\r\nchstart 0;\r\n\r\n// Set track wave to channel 1 and start\r\nwset 1,trackwave;\r\nchwave 1,1;\r\nchvolume 1,0.2;\r\nchstart 1;\r\n\r\n// Set bass wave to channel 2 and start\r\nwset 2,basswave;\r\nchwave 2,1;\r\nchvolume 2,0.3;\r\nchstart 2;\r\n\r\n// Get track length\r\ntracklen = strlen(trackA);\r\n\r\nvoid main()\r\n{\r\n // Tempo\r\n if ((i > 120) && (i <= 230))\r\n tempo( 1000 );\r\n else\r\n tempo( 864 );\r\n\r\n // Track A\r\n note = 2;\r\n fpwr note,(trackA[i]/12);\r\n note /= 100;\r\n chpitch 0,note;\r\n \r\n // Track B\r\n note = 2;\r\n fpwr note,(trackB[i]/12);\r\n note /= 100;\r\n chpitch 1,note;\r\n \r\n // Bass\r\n note = 2;\r\n fpwr note,(bass[i]/12);\r\n note /= 100;\r\n chpitch 2,note;\r\n \r\n // Index\r\n i++; mod i,tracklen;\r\n \r\n // Repeat\r\n jmp main;\r\n}\r\n\r\n// Accurate tempo function for beats-per-minute\r\nvoid tempo( float bpm )\r\n{\r\n timer timestamp;\r\n while ((time - timestamp) < (60 / bpm)) { timer time; }\r\n}\r\n\r\n// Returns the length of a string\r\nfloat strlen(char* str)\r\n{\r\n char* strptr = str;\r\n while (*strptr++);\r\n return (strptr - str);\r\n}\r\n\r\nfloat note, i;\r\nfloat tracklen;\r\nfloat time, timestamp;\r\n\r\nstring trackwave,\"synth/square.wav\";\r\nstring basswave,\"synth/tri.wav\";\r\n\r\ntrackA:\r\n\r\n// Intro\r\ndb 73,73,73,73, 75,75,75,75, 77,77,77,77, 78,78,78,78, 80,80,80,80, 81,81,81,81;\r\ndb 82,-1,82,-1, 82,82,82,-1, 82,82,82,-1, 82,82,82,82, 82,82,82,-1, -1,-1,78,78;\r\n\r\n// Part 1\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, 86,86,86,86, 86,86,86,86, 86,86,86,-1;\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, -1,-1,78,78, 80,80,82,82, 83,83,85,85;\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, 86,86,86,86, 86,86,86,-1, 88,88,88,-1;\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,78,78;\r\ndb 85,85,85,85, 85,85,85,85, 85,85,85,-1, 84,84,84,84, 84,84,84,84, 84,84,84,-1;\r\ndb 85,85,85,85, 85,85,85,85, 85,85,85,-1, -1,-1,78,78, 80,80,82,82, 83,83,84,84;\r\ndb 85,85,85,85, 85,85,85,85, 85,85,85,-1, 78,78,78,78, 78,78,78,-1, 88,88,88,-1;\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,78,78;\r\n\r\n// Part 2\r\ndb 90,90,90,90, 90,90,90,90, 90,90,90,-1, 90,90,90,90, 90,90,90,90, 90,90,90,-1;\r\ndb 90,90,90,90, 90,90,90,90, 90,90,90,-1, 90,90,90,-1, 92,92,-1,-1, -1,-1,90,90;\r\ndb 88,88,88,88, 88,88,88,88, 88,88,88,-1, 88,88,88,88, 88,88,88,88, 88,88,88,-1; \r\ndb 88,88,88,88, 88,88,88,88, 88,88,88,-1, 88,88,88,-1, 90,90,-1,-1, -1,-1,88,88; \r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, 80,80,80,-1, 82,82,82,-1, 88,88,88,-1; \r\ndb 87,-1,87,-1, 87,87,87,87, 87,-1,82,82, 83,83,83,83, 83,83,83,83, 83,83,83,-1;\r\n\r\ndb 0; // End string\r\n\r\ntrackB:\r\n\r\n// Intro\r\ndb 73,73,73,73, 72,72,72,72, 71,71,71,71, 70,70,70,70, 71,71,71,71, 72,72,72,72; \r\ndb 73,-1,73,-1, 73,73,73,-1, 75,75,75,-1, 76,76,76,76, 76,76,76,-1, -1,-1,-1,-1;\r\n\r\n// Part 1\r\ndb 78,78,78,78, 78,78,78,78, 78,78,78,-1, 77,77,77,77, 77,77,77,77, 77,77,77,-1;\r\ndb 78,78,78,78, 78,78,78,78, 78,78,78,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb 78,78,78,78, 78,78,78,78, 78,78,78,-1, 77,77,77,77, 77,77,77,-1, 80,80,80,-1;\r\ndb 78,78,78,78, 78,78,78,78, 78,78,78,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb 76,76,76,76, 76,76,76,76, 76,76,76,-1, 75,75,75,75, 75,75,75,75, 75,75,75,-1;\r\ndb 76,76,76,76, 76,76,76,76, 76,76,76,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb 76,76,76,76, 76,76,76,76, 76,76,76,-1, 70,70,70,70, 70,70,70,-1, 80,80,80,-1;\r\ndb 78,78,78,78, 78,78,78,78, 78,78,78,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\n\r\n// Part 2\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, 85,85,85,85, 85,85,85,85, 85,85,85,-1;\r\ndb 84,84,84,84, 84,84,84,84, 84,84,84,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb 85,85,85,85, 85,85,85,85, 85,85,85,-1, 84,84,84,84, 84,84,84,84, 84,84,84,-1;\r\ndb 83,83,83,83, 83,83,83,83, 83,83,83,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb 71,71,71,71, 71,71,71,71, 71,71,71,-1, 76,76,76,-1, 78,78,78,-1, 82,82,82,-1;\r\ndb 82,-1,82,-1, 82,82,82,-1, -1,-1,76,76, 75,75,75,75, 75,75,75,75, 75,75,75,-1;\r\n\r\ndb 0; // End string\r\n\r\nbass: \r\n\r\n// Intro\r\ndb -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb -1,-1,-1,-1, -1,-1,-1,-1, 66,66,66,-1, 66,66,66,66, 66,66,66,66, 66,66,66,-1;\r\n\r\n// Part 1\r\ndb 59,59,59,-1, 66,66,66,-1, 71,71,71,-1, 58,58,58,-1, 66,66,66,-1, 70,70,70,-1;\r\ndb 59,59,59,-1, 66,66,66,-1, 71,71,71,-1, 63,63,63,-1, 66,66,66,-1, 71,71,71,-1;\r\ndb 59,59,59,-1, 66,66,66,-1, 71,71,71,-1, 58,58,58,-1, 66,66,66,-1, 70,70,70,-1;\r\ndb 59,59,59,-1, 66,66,66,-1, 71,71,71,-1, 63,63,63,-1, 66,66,66,-1, 71,71,71,-1;\r\ndb 61,61,61,-1, 66,66,66,-1, 70,70,70,-1, 60,60,60,-1, 65,65,65,-1, 69,69,69,-1;\r\ndb 61,61,61,-1, 66,66,66,-1, 70,70,70,-1, 58,58,58,-1, 66,66,66,-1, 70,70,70,-1;\r\ndb 61,61,61,-1, 66,66,66,-1, 70,70,70,-1, 58,58,58,-1, 66,66,66,-1, 70,70,70,-1;\r\ndb 59,59,59,-1, 66,66,66,-1, 71,71,71,-1, 54,54,54,-1, 66,66,66,-1, 71,71,71,-1;\r\n\r\n// Part 2\r\ndb 59,59,59,-1, 66,66,66,-1, 75,75,75,-1, 58,58,58,-1, 66,66,66,-1, 73,73,73,-1;\r\ndb 57,57,57,-1, 66,66,66,-1, 72,72,72,-1, 60,60,60,-1, 66,66,66,-1, 75,75,75,-1;\r\ndb 61,61,61,-1, 68,68,68,-1, 76,76,76,-1, 60,60,60,-1, 68,68,68,-1, 76,76,76,-1;\r\ndb 59,59,59,-1, 68,68,68,-1, 76,76,76,-1, 58,58,58,-1, 66,66,66,-1, 76,76,76,-1;\r\ndb 47,47,47,-1, 66,66,66,-1, 75,75,75,-1, 54,54,54,-1, 66,66,66,-1, 66,66,66,-1;\r\ndb 64,-1,64,-1, 64,64,64,-1, -1,-1,58,58, 59,59,59,59, 59,59,59,59, 59,59,59,-1;\r\n\r\ndb 0; // End string\r\n\r\n","spuchip/examples/beatbox.txt":"wset 4,inst1;\r\nchwave 1,4;\r\nchpitch 1,2.55;\r\n\r\nchwave 2,0;\r\nchvolume 2,0.5;\r\nchstart 2;\r\nchpitch 2,0;\r\n\r\nmainloop:\r\n timer r0;\r\n mul r0,6;\r\n mov r1,r0;\r\n\r\n fint r0;\r\n mod r0,16;\r\n add r0,0;\r\n mod r1,1;\r\n currentTick = r0;\r\n currentTickTime = r1;\r\n\r\n instr1 = patternData1[currentTick];\r\n instr2 = patternData2[currentTick];\r\n instr3 = patternData3[currentTick];\r\n\r\n if ((pinstr1 == 0) && (instr1 == 1)) {\r\n chstart 0;\r\n } else {\r\n chstop 0;\r\n }\r\n\r\n if ((pinstr2 == 0) && (instr2 == 1)) {\r\n chstart 1;\r\n } else {\r\n chstop 1;\r\n }\r\n\r\n mov r0,currentTickTime; neg r0; add r0,1; fpwr r0,4;\r\n mul r0,0.6; // add r0,0.64;\r\n chpitch 0,r0;\r\n\r\n mov r0,instr3;\r\n mul r0,0.1;\r\n add r0,0.2;\r\n chpitch 2,r0;\r\njmp mainloop;\r\n\r\nfloat currentTick,currentTickTime;\r\nfloat instr1,instr2,instr3;\r\nfloat pinstr1,pinstr2;\r\n\r\npatternData1: db 1,1,0,0, 1,0,0,0, 1,0,0,1, 0,1,0,0, 1,1,0,0, 1,1,0,0, 1,1,0,1, 1,0,1,0;\r\npatternData2: db 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,1,0;\r\npatternData3: db 0,1,0,2, 0,1,2,2, 0,0,1,1, 1,2,1,2, 2,2,1,2, 2,2,1,1, 1,1,0,0, 0,0,1,2;\r\n\r\nstring inst1,\"synth/pink_noise.wav\";\r\n"},"prevhash.txt":"4243da411622f01ce0b720176ba036a752129755\r\n","adv_duplicator/":{"adv_duplicator/wireman.txt":"[Info]\r\nType:AdvDupe File\r\nCreator:\"Maso\"\r\nDate:05/01/11\r\nDescription:\"none\"\r\nEntities:8\r\nConstraints:31\r\n[More Information]\r\nFileVersion:0.84\r\nAdvDupeVersion:1.85\r\nAdvDupeToolVersion:1.9\r\nAdvDupeSharedVersion:1.72\r\nSerialiserVersion:1.4\r\nWireVersion:2435 (EXPORTED)\r\nTime:05:28 AM\r\nHead:188\r\nHoldAngle:0,-157.54,0\r\nHoldPos:59.9271,1.05281,0.728333\r\nStartPos:9809.35,-670.248,8.03125\r\n[Save]\r\nEntities:19BB9E48{;}197CE8F0{Y:12=T:18F29AA0;}1B88A158{;}1B74B110{;}1917E4C8{Y:3=A:89.5833,-6.53094,180.117;Y:4=V:-31.7705,2.54797,46.933;Y:6=B:f;}H19B2B218{N:189=T:1B72EC10;N:242=T:18FC0620;N:197=T:1C085C88;N:266=T:19014EC0;N:191=T:1AC73D38;N:188=T:1C22F948;N:268=T:168D3A80;N:267=T:18F4D870;}1B74B0E0{Y:28=T:1B74B110;}1C9B2C68{N:0=T:1C9B2C98;}1ADB32B8{N:0=T:1BE418D0;}1C085C88{Y:3=A:89.5833,-6.53094,-179.883;Y:4=V:-31.7705,2.54797,46.933;Y:5=N:0;Y:7=T:1917E498;Y:9=Y:8;Y:2=Y:17;}18FC0620{Y:2=Y:14;Y:3=A:0.000332517,173.62,-0.000518799;Y:4=V:-16.4063,0.997742,45.4449;Y:5=N:0;Y:7=T:19F37CE8;Y:9=Y:8;Y:13=T:1D7F8B78;}19AB7118{T:1B88A128;T:1B88A158;}18F29AA0{Y:11=Y:10;}19F37D18{Y:3=A:0.000332517,173.62,359.999;Y:4=V:-16.4063,0.997742,45.4449;Y:6=B:t;}19BB9DE8{T:19BB9E18;T:19BB9E48;}192FF7B8{Y:3=A:-0.294498,-6.38357,180.031;Y:4=V:-15.6973,14.6041,44.1504;Y:6=B:f;}19F37CE8{N:0=T:19F37D18;}1B7B2298{Y:15=N:50;}1A5D0438{Y:29=T:1B74B0E0;}1B88A128{;}18EC6B08{N:0=T:18EC6B38;}1917E498{N:0=T:1917E4C8;}18F4D870{Y:3=A:-0.00354703,173.62,-0.000518799;Y:4=V:-7.63672,-10.4395,81.5085;Y:5=N:0;Y:7=T:18EC6B08;Y:9=Y:8;Y:2=Y:18;}18EC6B38{Y:3=A:-0.00354703,173.62,359.999;Y:4=V:-7.63672,-10.4395,81.5085;Y:6=B:f;}168D3A80{Y:2=Y:1;Y:3=A:-0.356212,-6.67777,-179.956;Y:4=V:-17.5264,-12.4753,44.1833;Y:5=N:0;Y:7=T:169A4588;Y:9=Y:8;Y:13=T:17F0D510;}192FF788{N:0=T:192FF7B8;}169A45B8{Y:3=A:-0.356212,-6.67777,180.044;Y:4=V:-17.5264,-12.4753,44.1833;Y:6=B:f;}169A4588{N:0=T:169A45B8;}19014EC0{Y:3=A:-0.00345482,173.62,-0.000518799;Y:4=V:-5.36621,9.82532,81.5081;Y:5=N:0;Y:7=T:1C9B2C68;Y:9=Y:8;Y:2=Y:18;}17F0D510{Y:12=T:1BB4F010;}1BB4F010{Y:11=Y:10;}16AA7618{N:0=T:16AA7648;}1D7F8B78{Y:16=T:1B7B2298;}1C22F948{Y:7=T:1ADB32B8;Y:9=Y:20;Y:3=A:89.6399,-5.53999,1.19965;Y:21=T:19BB9DE8;Y:22=T:19AB7118;Y:24=Y:23;Y:4=V:-1.22168,-0.923706,59.9212;Y:2=Y:25;Y:27=Y:26;Y:13=T:1A5D0438;Y:30=T:18FB23A0;Y:5=N:0;}1AC73D38{Y:3=A:-0.0362574,81.479,-91.1042;Y:4=V:-31.6016,2.5882,72.2405;Y:5=N:0;Y:7=T:16AA7618;Y:9=Y:8;Y:2=Y:19;}19BB9E18{;}1BE418D0{Y:3=A:89.6399,-5.53999,1.19965;Y:4=V:-1.22168,-0.923706,59.9212;Y:6=B:f;}18FB23A0{;}1C9B2C98{Y:3=A:-0.00345482,173.62,359.999;Y:4=V:-5.36621,9.82532,81.5081;Y:6=B:f;}1B72EC10{Y:2=Y:1;Y:3=A:-0.294498,-6.38357,-179.969;Y:4=V:-15.6973,14.6041,44.1504;Y:5=N:0;Y:7=T:192FF788;Y:9=Y:8;Y:13=T:197CE8F0;}16AA7648{Y:3=A:-0.0362574,81.479,268.896;Y:4=V:-31.6016,2.5882,72.2405;Y:6=B:f;}\r\nConstraints:1A790460{Y:31=N:242;Y:32=N:0;}1926A480{Y:33=T:18FACDC8;Y:35=Y:34;}1BF200A0{Y:33=T:1AE0AAB0;Y:35=Y:34;}1A3475D0{Y:36=B:t;Y:37=N:0;Y:33=T:1A347600;Y:38=B:t;Y:35=Y:39;}18463E50{Y:33=T:18463EA8;Y:35=Y:34;}1990A7D8{T:1990A838;T:19174B18;}1A3F1790{T:1959F900;T:1959F930;}1BF8D7F8{Y:33=T:1B876C20;Y:35=Y:34;}19264F50{Y:31=N:191;Y:32=N:0;}1C27D280{Y:33=T:1C27D2D8;Y:35=Y:34;}18FACDC8{T:18FACE28;T:1BF20048;}1AA19F28{Y:31=N:197;Y:32=N:0;}0DC038F0{Y:31=N:191;Y:32=N:0;}1990A838{Y:31=N:242;Y:32=N:0;}1BF20048{Y:31=N:267;Y:32=N:0;}1CD1CE98{Y:33=T:1990A7D8;Y:35=Y:34;}191EE670{Y:31=N:189;Y:32=N:0;}18FACE28{Y:31=N:266;Y:32=N:0;}1A330960{Y:33=T:1A4427A8;Y:35=Y:34;}1AA19F58{Y:31=N:191;Y:32=N:0;}1D6991E8{Y:31=N:268;Y:32=N:0;}1959F900{Y:31=N:267;Y:32=N:0;}175D6690{Y:33=T:175D66E8;Y:35=Y:34;}175D66E8{T:1768DC48;T:1768DC78;}1768DC48{Y:31=N:197;Y:32=N:0;}19B3B058{Y:31=N:189;Y:32=N:0;}19256CE0{Y:31=N:191;Y:32=N:0;}19174B18{Y:31=N:268;Y:32=N:0;}1B6D74A0{Y:31=N:268;Y:32=N:0;}1923B508{Y:33=T:1923B560;Y:35=Y:34;}18D92A30{Y:31=N:242;Y:32=N:0;}1BBE43E0{Y:31=N:189;Y:32=N:0;}197AEE78{Y:31=N:242;Y:32=N:0;}19F08CC8{Y:33=T:1A4319B8;Y:35=Y:34;}194C60C0{Y:31=N:242;Y:32=N:0;}18463EA8{T:1BBE43E0;T:1BBE4410;}1D699188{T:1D6991E8;T:1C36CF98;}19174B48{Y:33=T:1D699188;Y:35=Y:34;}18A09CD8{Y:31=N:189;Y:32=N:0;}19B3B088{S:\"Ang\"=A:-0.459895,-134.973,180.006;Y:35=Y:40;Y:33=T:18A09C78;Y:41=N:100000;}185934F8{Y:31=N:268;Y:32=N:0;}18B99330{Y:31=N:197;Y:32=N:0;}1916DDB0{Y:31=N:242;Y:32=N:0;}1A6D2950{Y:31=N:189;Y:32=N:0;}1A330930{Y:31=N:242;Y:32=N:0;}1959F930{Y:31=N:191;Y:32=N:0;}191EE540{Y:33=T:191EE570;Y:35=Y:34;}1AC56190{Y:31=N:267;Y:32=N:0;}1B876C20{T:1B876C80;T:19B3B058;}19319C60{Y:31=N:267;Y:32=N:0;}1A4319B8{T:18DE61D0;T:18DE6200;}19C5D490{Y:33=T:1916DD50;Y:35=Y:34;}1AE0AAB0{T:1B6D74A0;T:1B6D74D0;}1A3F1738{Y:33=T:1A3F1790;Y:35=Y:34;}1B6D74D0{Y:31=N:266;Y:32=N:0;}192A1980{Y:31=N:242;Y:32=N:0;}1912FFF8{Y:31=N:189;Y:32=N:0;}1BBE4410{Y:31=N:266;Y:32=N:0;}191E4AD0{T:1A6D2950;T:1A6D2980;}18F2BAC0{Y:33=T:1912FF98;Y:35=Y:34;}19434350{Y:31=N:242;Y:32=N:0;}1916DD50{T:1916DDB0;T:18B99330;}1D5A5A10{Y:31=N:189;Y:32=N:0;}19E7E308{Y:31=N:191;Y:32=N:0;}19576620{Y:31=N:242;Y:32=N:0;}1A6D2980{Y:31=N:268;Y:32=N:0;}192ADB98{Y:31=N:242;Y:32=N:0;}191EE570{T:1D5A5A10;T:1D5A5A40;}1C39D2C8{T:1A790430;T:1A790460;}1A347600{T:192ADB68;T:192ADB98;}194C60F0{Y:31=N:189;Y:32=N:0;}1BF21E50{T:19E7E2D8;T:19E7E308;}190AFDC0{Y:33=T:18D929D0;Y:35=Y:34;}19EB4CA8{T:194C60C0;T:194C60F0;}17509828{T:192A1950;T:192A1980;}19EB4C78{Y:33=T:19EB4CA8;Y:35=Y:39;Y:37=N:0;}18DE6200{Y:31=N:266;Y:32=N:0;}18B99388{Y:33=T:1C39D2C8;Y:35=Y:39;Y:37=N:0;}19CF3F20{Y:33=T:1AC56130;Y:35=Y:39;Y:37=N:0;}19BA27B0{Y:31=N:267;Y:32=N:0;}1AC56130{T:1AC56190;T:1A330930;}175097D0{Y:33=T:17509828;Y:35=Y:39;Y:37=N:0;}1A429D00{T:19C5D460;}19E7E2D8{Y:31=N:266;Y:32=N:0;}1A429CA8{S:\"Ang\"=A:-0.355103,-135.268,180.042;Y:35=Y:40;Y:33=T:1A429D00;Y:41=N:100000;}19319CB8{Y:33=T:191E4AD0;Y:35=Y:34;}19BA2780{Y:31=N:197;Y:32=N:0;}1923B560{T:19BA2780;T:19BA27B0;}1926A450{Y:31=N:266;Y:32=N:0;}19529848{Y:31=N:197;Y:32=N:0;}194342F0{T:19434350;T:185934F8;}1A442808{Y:31=N:242;Y:32=N:0;}195297E8{T:19529848;T:1926A450;}19264EF0{T:19264F50;T:197AEE78;}1927D100{T:1AA19F28;T:1AA19F58;}1912FF98{T:1912FFF8;T:0DC038F0;}18D929D0{T:18D92A30;T:19256CE0;}197AEED0{Y:33=T:1927D100;Y:35=Y:34;}1C36CF98{Y:31=N:191;Y:32=N:0;}18DE61D0{Y:31=N:242;Y:32=N:0;}19C5D460{Y:31=N:268;Y:32=N:0;}18A09C78{T:18A09CD8;}1A98C800{Y:33=T:195297E8;Y:35=Y:34;}192A1950{Y:31=N:266;Y:32=N:0;}1C27D2D8{T:191EE640;T:191EE670;}191EE640{Y:31=N:197;Y:32=N:0;}1A347920{Y:31=N:268;Y:32=N:0;}1956EB60{T:19576620;}192ADB68{Y:31=N:188;Y:32=N:0;}18B391F0{S:\"Ang\"=A:-0.000781828,45.0297,360;Y:35=Y:40;Y:33=T:1956EB60;Y:41=N:100000;}0DC03920{Y:33=T:19264EF0;Y:35=Y:39;Y:37=N:0;}19256D38{Y:33=T:1BF21E50;Y:35=Y:34;}1A3478C0{T:1A347920;T:19319C60;}1B876C80{Y:31=N:242;Y:32=N:0;}18593528{Y:33=T:1A3478C0;Y:35=Y:34;}18B39198{Y:31=N:267;Y:32=N:0;}1D5A5A40{Y:31=N:267;Y:32=N:0;}1A4427A8{T:1A442808;T:18B39198;}1A790430{Y:31=N:197;Y:32=N:0;}19BF1458{Y:33=T:194342F0;Y:35=Y:39;Y:37=N:0;}H1969BED8{T:1A330960;T:19174B48;T:1BF8D7F8;T:1A3475D0;T:19319CB8;T:18B391F0;T:19CF3F20;T:1A429CA8;T:18B99388;T:1CD1CE98;T:1926A480;T:1C27D280;T:19256D38;T:175097D0;T:18593528;T:19BF1458;T:1A3F1738;T:19F08CC8;T:197AEED0;T:18463E50;T:1A98C800;T:1923B508;T:19EB4C78;T:191EE540;T:0DC03920;T:18F2BAC0;T:1BF200A0;T:19C5D490;T:19B3B088;T:190AFDC0;T:175D6690;}1768DC78{Y:31=N:268;Y:32=N:0;}\r\n[Dict]\r\n1:\"models/cyborgmatt/capacitor_large.mdl\"\r\n2:\"Model\"\r\n3:\"LocalAngle\"\r\n4:\"LocalPos\"\r\n5:\"Skin\"\r\n6:\"Frozen\"\r\n7:\"PhysicsObjects\"\r\n8:\"prop_physics\"\r\n9:\"Class\"\r\n10:\"beer/wiremod/gate_wirelogo\"\r\n11:\"MaterialOverride\"\r\n12:\"material\"\r\n13:\"EntityMods\"\r\n14:\"models/bull/various/subwoofer.mdl\"\r\n15:\"Mass\"\r\n16:\"mass\"\r\n17:\"models/bull/gates/microcontroller1.mdl\"\r\n18:\"models/bull/various/speaker.mdl\"\r\n19:\"models/bull/gates/resistor.mdl\"\r\n20:\"gmod_wire_expression2\"\r\n21:\"_outputs\"\r\n22:\"_inputs\"\r\n23:\"Wireman\"\r\n24:\"_name\"\r\n25:\"models/bull/gates/processor.mdl\"\r\n26:\"@name Wireman�@inputs �@outputs �@persist �@trigger ��if(first()|duped()) {� entity():soundPlay(0,0,�npc/zombie_poison/pz_breathe_loop2.wav�)�}�interval(500)�entity():isWeldedTo():applyForce(vec(0,0,-25000))�\"\r\n27:\"_original\"\r\n28:\"Wires\"\r\n29:\"WireDupeInfo\"\r\n30:\"_vars\"\r\n31:\"Index\"\r\n32:\"Bone\"\r\n33:\"Entity\"\r\n34:\"NoCollide\"\r\n35:\"Type\"\r\n36:\"nocollide\"\r\n37:\"forcelimit\"\r\n38:\"deleteonbreak\"\r\n39:\"Weld\"\r\n40:\"Keepupright\"\r\n41:\"angularlimit\"\r\nSaved:291"},"cpuchip/":{"cpuchip/examples/":{"cpuchip/examples/udh_test.txt":"//------------------------------------------------------------------------------\r\n// Universal Device Host driver test application\r\n//------------------------------------------------------------------------------\r\n#pragma CRT ZCRT\r\n\r\n//Include drivers for console screen and device host\r\n#include \r\n#include \r\n\r\nvoid main() {\r\n float i;\r\n udhSetBusAddress(65536);\r\n \r\n cscrInitialize(0);\r\n\r\n udhQueryDevices();\r\n\r\n for (i = 0; i < MAX_CONSOLE_SCREENS; i++) {\r\n cscrSelect(i);\r\n cscrSetActive(1);\r\n cscrClear();\r\n \r\n cscrSetCursor(0,0);\r\n cscrPrintLine(\"Screen \",930);\r\n cscrPrintNumber(i,930); \r\n }\r\n\r\n cscrSelect(0);\r\n cscrSetCursor(0,2);\r\n cscrPrintLine(\"UDH driver test\\n\",039);\r\n for (i = 0; i < 8; i++) {\r\n cscrPrintLine(\"DEVICE \",999);\r\n cscrPrintNumber(i,999);\r\n cscrPrintLine(\": \",999);\r\n cscrPrintLine(udhGetDeviceName(i),666);\r\n cscrPrintLine(\"\\n\",999);\r\n }\r\n}\r\n","cpuchip/examples/helloworld.txt":"//Wired Hello World!\r\n//Connect CPU membus input to console screen\r\n//Connect CPUs CLK input to button (toggle)\r\n//Notice how you can store your \r\n//subroutines/calls in DATA area\r\njmp _code;\r\nmessage:\r\n db 'Hello World!',0;\r\nWriteString: //ESI - String pointer, EDX - Param\r\n mov eax,65536;\r\n AWriteLoop:\r\n cmp #esi,0; //Terminate on char 0\r\n je AEnd;\r\n mov #eax,#esi; //Output char\r\n inc eax;\r\n mov #eax,edx; //Output char param\r\n inc eax;\r\n inc esi;\r\n jmp AWriteLoop;\r\n AEnd:\r\nret //Return from call\r\n\r\n_code:\r\n mov esi,message;\r\n mov edx,000999; //White foreground on black background\r\n call WriteString;\r\n\r\n//More about colors:\r\n//Lower 3 digits are foreground, \r\n//and higher 3 digits are background\r\n//Each of 3 digits shows amount of\r\n//RED, GREEN, and BLUE (in order)\r\n//Each color has 10 shades - from 0 to 9\r\n//\r\n//For example, 999044 will be dark yellow (044) on\r\n//a white background (999)\r\n//\r\n//Experiment with colors!\r\n//\r\n//Also, the 7th digit (if its not equal to 0) will\r\n//cause the character to blink by changing foreground and\r\n//background places (actual data in memory wont change)\r\n"},"cpuchip/lib/":{"cpuchip/lib/drivers/":{"cpuchip/lib/drivers/drv_udh.txt":"//------------------------------------------------------------------------------\r\n// ZCPU standard library and drivers set (C) 2011 by Black Phoenix\r\n//\r\n// Universal device host driver. Only supports 8 devices right now\r\n//------------------------------------------------------------------------------\r\n\r\n#define UDH_DRIVER\r\n\r\n//Maximum number of devices supported\r\n#define MAX_UDH_DEVICES 8\r\n\r\n//Address range of a single device\r\n#define MAX_UDH_ADDRESS_RANGE 4*1024\r\n\r\n//Maximum number of drivers that may register with UDH\r\n#define MAX_UDH_DRIVERS 8\r\n\r\n//Device name/string data\r\nstring udhDeviceString0,\"None\";\r\nstring udhDeviceString1,\"Unknown\";\r\nstring udhDeviceString2,\"Extended bus\";\r\nstring udhDeviceString3,\"Address bus\";\r\nstring udhDeviceString4,\"Zyelios CPU\";\r\nstring udhDeviceString5,\"Zyelios GPU\";\r\nstring udhDeviceString6,\"Zyelios SPU\";\r\nstring udhDeviceString7,\"Flash EEPROM\";\r\nstring udhDeviceString8,\"ROM\";\r\nstring udhDeviceString9,\"Data bus\";\r\nstring udhDeviceString10,\"CD Ray\";\r\nstring udhDeviceString11,\"Console screen\";\r\nstring udhDeviceString12,\"Digital screen\";\r\nstring udhDeviceString13,\"Data plug\";\r\nstring udhDeviceString14,\"Data socket\";\r\nstring udhDeviceString15,\"Keyboard\";\r\nstring udhDeviceString16,\"Oscilloscope\";\r\nstring udhDeviceString17,\"Sound emitter\";\r\nstring udhDeviceString18,\"Constant value\";\r\nstring udhDeviceString19,\"Data port\";\r\nstring udhDeviceString20,\"RAM\";\r\nudhDeviceName: \r\n db udhDeviceString0, udhDeviceString1, udhDeviceString2;\r\n db udhDeviceString3, udhDeviceString4, udhDeviceString5;\r\n db udhDeviceString6, udhDeviceString7, udhDeviceString8;\r\n db udhDeviceString9, udhDeviceString10,udhDeviceString11;\r\n db udhDeviceString12,udhDeviceString13,udhDeviceString14;\r\n db udhDeviceString15,udhDeviceString16,udhDeviceString17;\r\n db udhDeviceString18,udhDeviceString19,udhDeviceString20;\r\n\r\n//Extended bus offset\r\nchar* udhBusOffset;\r\n\r\n//List of callbacks to call when querying devices\r\nvoid* udhQueryCallback[MAX_UDH_DRIVERS];\r\nfloat udhQueryCallbackCount = 0;\r\n\r\nfloat udhSetBusAddress(char* extOffset) {\r\n udhBusOffset = extOffset;\r\n udhQueryDevices();\r\n}\r\n\r\nvoid udhQueryDevices() {\r\n float i;\r\n\r\n //Run the query\r\n udhBusOffset[16] = 32+MAX_UDH_DEVICES;\r\n udhBusOffset[17] = 1; \r\n\r\n //Reconfigure all devices\r\n //FIXME: only supports single extended bus right now\r\n for (i = 0; i < 8; i++) {\r\n udhBusOffset[i*2+0] = (4*1024)*i;\r\n udhBusOffset[i*2+1] = (4*1024)*i+((4*1024)-1);\r\n }\r\n\r\n //Update all drivers\r\n for (i = 0; i < udhQueryCallbackCount; i++) {\r\n void* functionPtr = udhQueryCallback[i];\r\n functionPtr();\r\n }\r\n}\r\n\r\nvoid udhRegisterDriver(void* queryDeviceFunction) {\r\n udhQueryCallback[udhQueryCallbackCount] = queryDeviceFunction;\r\n if (udhQueryCallbackCount < MAX_UDH_DRIVERS) udhQueryCallbackCount++;\r\n}\r\n\r\nfloat udhGetDeviceType(float busIndex) {\r\n return udhBusOffset[32+busIndex];\r\n}\r\n\r\nfloat udhGetDeviceOffset(float busIndex) {\r\n return 65536+32+MAX_UDH_DEVICES+udhBusOffset[busIndex*2];\r\n}\r\n\r\nchar* udhGetDeviceName(float busIndex) {\r\n float deviceType = udhGetDeviceType(busIndex);\r\n if ((deviceType >= 0) && (deviceType <= 20)) {\r\n return udhDeviceName[deviceType]; \r\n } else {\r\n return udhDeviceName[1];\r\n }\r\n}\r\n\r\nvoid udhSetDeviceOffsetSize(float busIndex, char* offst, char* size) {\r\n udhBusOffset[busIndex*2+0] = offst;\r\n udhBusOffset[busIndex*2+1] = offst+size-1;\r\n}\r\n\r\nfloat udhGetNumDevices() {\r\n return MAX_UDH_DEVICES; \r\n}\r\n\r\nfloat udhGetDevices(float type, float maxCount, char* deviceList) {\r\n float i,devPtr,n;\r\n \r\n devPtr = deviceList;\r\n n = 0;\r\n for (i = 0; i < MAX_UDH_DEVICES; i++) {\r\n if ((udhGetDeviceType(i) == type) && (n < maxCount)) {\r\n n++;\r\n *devPtr++ = i; \r\n }\r\n }\r\n\r\n return n;\r\n}","cpuchip/lib/drivers/drv_cscr.txt":"//------------------------------------------------------------------------------\r\n// ZCPU standard library and drivers set (C) 2011 by Black Phoenix\r\n//\r\n// UDH-enabled console screen highspeed driver\r\n//------------------------------------------------------------------------------\r\n\r\n//Define to check if console screen driver is available\r\n#define CSCR_DRIVER\r\n\r\n//Maximum number of console screens supported\r\n#define MAX_CONSOLE_SCREENS 8\r\n\r\n//Console screen registers\r\n#define CURSOR_RATE 2043\r\n#define CURSOR_SIZE 2044\r\n#define CURSOR_POSITION 2045\r\n#define CURSOR_VISIBLE 2046\r\n#define LOW_SHIFT_COL 2031\r\n#define HIGH_SHIFT_COL 2032\r\n#define LOW_SHIFT_ROW 2033\r\n#define HIGH_SHIFT_ROW 2034\r\n#define SHIFT_ROWS 2038\r\n#define SHIFT_CELLS 2037\r\n#define CLEAR_SCREEN 2041\r\n#define BACKGROUND_COLOR 2042\r\n#define SCREEN_ACTIVE 2047\r\n#define SCREEN_ROTATION 2024\r\n#define SCREEN_BRIGHTNESS 2036\r\n\r\n//Driver data\r\nchar* cscrOffsets[MAX_CONSOLE_SCREENS];\r\nfloat cscrDevices[MAX_CONSOLE_SCREENS];\r\nchar* cscrCharacterPointer[MAX_CONSOLE_SCREENS];\r\nfloat cscrSelectedScreen;\r\n\r\n#ifdef UDH_DRIVER\r\n//Update console screen offsets\r\nvoid cscrUDHQueryFunction() {\r\n float i,n;\r\n n = udhGetDevices(11,MAX_CONSOLE_SCREENS,cscrDevices); \r\n for (i = 0; i < n; i++) {\r\n cscrOffsets[i] = udhGetDeviceOffset(cscrDevices[i]);\r\n }\r\n}\r\n#endif\r\n\r\n//Initialize console screen driver. screenOffset may be 0 if using UDH\r\nvoid cscrInitialize(char* screenOffset) {\r\n float i;\r\n\r\n for (i = 0; i < MAX_CONSOLE_SCREENS; i++) {\r\n cscrOffsets[i] = screenOffset;\r\n }\r\n\r\n#ifdef UDH_DRIVER\r\n if (!screenOffset) {\r\n udhRegisterDriver(cscrUDHQueryFunction);\r\n cscrUDHQueryFunction();\r\n }\r\n#endif\r\n cscrSelectedScreen = 0;\r\n}\r\n\r\nfloat cscrPresent(float screen) {\r\n return cscrOffsets[cscrSelectedScreen] != 0;\r\n}\r\n\r\nvoid cscrSelect(float screen) {\r\n cscrSelectedScreen = screen;\r\n max cscrSelectedScreen,0;\r\n min cscrSelectedScreen,MAX_CONSOLE_SCREENS;\r\n}\r\n\r\nvoid cscrSetActive(float clk) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return;\r\n *(cscrOffsets[cscrSelectedScreen]+SCREEN_ACTIVE) = clk;\r\n}\r\n\r\nvoid cscrClear() {\r\n if (!cscrOffsets[cscrSelectedScreen]) return;\r\n *(cscrOffsets[cscrSelectedScreen]+CLEAR_SCREEN) = 1;\r\n cscrCharacterPointer[cscrSelectedScreen] = 0;\r\n}\r\n\r\nvoid cscrSetBackground(float col) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return; \r\n *(cscrOffsets[cscrSelectedScreen]+BACKGROUND_COLOR) = col;\r\n}\r\n\r\nvoid cscrSetRotation(float rot) {\r\n *(cscrOffsets[cscrSelectedScreen]+SCREEN_ROTATION) = rot; \r\n}\r\n\r\nvoid cscrSetBrightness(float bright) {\r\n *(cscrOffsets[cscrSelectedScreen]+SCREEN_BRIGHTNESS) = bright;\r\n}\r\n\r\nvoid cscrLoadImage(char* imgdata) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return; \r\n\r\n preserve ESI,EDI;\r\n ESI = imgdata;\r\n EDI = cscrOffsets[cscrSelectedScreen];\r\n mcopy 30*18*2;\r\n}\r\n\r\nvoid cscrPutLine(char* scrptr, float col, char* str) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return; \r\n char* curptr = scrptr;\r\n\r\n while (*str) {\r\n *(cscrOffsets[cscrSelectedScreen]+curptr*2+0) = *str;\r\n *(cscrOffsets[cscrSelectedScreen]+curptr*2+1) = col;\r\n\r\n str++;\r\n curptr++;\r\n }\r\n}\r\n\r\nvoid cscrPutChar(char* scrptr, float col, char ch) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return; \r\n\r\n *(cscrOffsets[cscrSelectedScreen]+scrptr*2+0) = ch;\r\n *(cscrOffsets[cscrSelectedScreen]+scrptr*2+1) = col;\r\n}\r\n\r\nvoid cscrNewLine() {\r\n if (!cscrOffsets[cscrSelectedScreen]) return;\r\n\r\n cscrCharacterPointer[cscrSelectedScreen] /= 30;\r\n fint cscrCharacterPointer[cscrSelectedScreen];\r\n cscrCharacterPointer[cscrSelectedScreen] = (cscrCharacterPointer[cscrSelectedScreen]+1)*30;\r\n\r\n if (cscrCharacterPointer[cscrSelectedScreen] >= 30*18) {\r\n cscrCharacterPointer[cscrSelectedScreen] = cscrCharacterPointer[cscrSelectedScreen] - 30;\r\n *(cscrOffsets[cscrSelectedScreen]+SHIFT_ROWS) = 1;\r\n }\r\n}\r\n\r\nvoid cscrPrintLine(char* str, float col) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return;\r\n\r\n while (*str) {\r\n if (*str == '\\n') {\r\n cscrNewLine();\r\n str++;\r\n if (*str == 0) return;\r\n }\r\n \r\n *(cscrOffsets[cscrSelectedScreen]+cscrCharacterPointer[cscrSelectedScreen]*2+0) = *str;\r\n *(cscrOffsets[cscrSelectedScreen]+cscrCharacterPointer[cscrSelectedScreen]*2+1) = col;\r\n \r\n cscrCharacterPointer[cscrSelectedScreen]++; \r\n if (cscrCharacterPointer[cscrSelectedScreen] >= 30*18) cscrNewLine(); \r\n str++;\r\n }\r\n}\r\n\r\nvoid cscrPrintNumber(float num, float col) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return;\r\n \r\n float ndig,a;\r\n a = num;\r\n ndig = 0;\r\n while (a > 0) {\r\n ndig++;\r\n a /= 10;\r\n fint a; \r\n }\r\n max ndig,1;\r\n a = num;\r\n\r\n cscrCharacterPointer[cscrSelectedScreen] = cscrCharacterPointer[cscrSelectedScreen] + ndig;\r\n char* charPtr = cscrCharacterPointer[cscrSelectedScreen] - 1;\r\n while (ndig > 0) {\r\n preserve EDX;\r\n mov EDX,a;\r\n mod EDX,10;\r\n add EDX,48;\r\n \r\n *(cscrOffsets[cscrSelectedScreen]+charPtr*2+0) = EDX;\r\n *(cscrOffsets[cscrSelectedScreen]+charPtr*2+1) = col;\r\n charPtr--;\r\n \r\n a /= 10;\r\n fint a;\r\n \r\n ndig--;\r\n }\r\n}\r\n\r\nvoid cscrSetCursor(float x, y) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return; \r\n cscrCharacterPointer[cscrSelectedScreen] = x+y*30;\r\n}"},"cpuchip/lib/zcrt/":{"cpuchip/lib/zcrt/string.txt":"//------------------------------------------------------------------------------\r\n// ZCPU CRT sourcecode (for HL-ZASM compiler) (C) 2011 by Black Phoenix\r\n//\r\n// String library. Contains functions to work with C strings (C89-compatible)\r\n//------------------------------------------------------------------------------\r\n\r\n#define NULL 0\r\n\r\n//copies n bytes between two memory areas; if there is overlap, the behavior is undefined\r\nvoid *memcpy(void *dest, void *src, float n) {\r\n preserve esi,edi;\r\n register float rem;\r\n \r\n esi = src;\r\n edi = dest;\r\n rem = n;\r\n while (rem) {\r\n register float count = rem;\r\n min count,8192;\r\n mcopy count;\r\n rem = rem - count;\r\n }\r\n return dest;\r\n}\r\n\r\n//copies n bytes between two memory areas; unlike with memcpy the areas may overlap\r\n//void *memmove(void *dest, void *src, float n);\r\n#define memmove memcpy\r\n\r\n//returns a pointer to the first occurrence of c in the first n bytes of s, or NULL if not found\r\nvoid* memchr(void *s, float c, float n) {\r\n register void *r = s;\r\n register float rem = n;\r\n\r\n while (rem) {\r\n if (*r == c) {\r\n return r;\r\n }\r\n ++r;\r\n --rem;\r\n }\r\n\r\n return NULL;\r\n}\r\n\r\n//compares the first n bytes of two memory areas\r\n//int memcmp(const void *s1, const void *s2, float n);\r\n#define memcmp strcmp\r\n\r\n//overwrites a memory area with n copies of c\r\nvoid* memset(void *ptr, float c, float n) {\r\n register void *p = ptr;\r\n register float rem = n;\r\n register float ch = c;\r\n\r\n while (rem) {\r\n *p++ = ch;\r\n --rem;\r\n }\r\n\r\n return ptr;\r\n}\r\n\r\n//appends the string src to dest\r\nchar* strcat(char *src, *dest) {\r\n register char *srcptr, *destptr;\r\n \r\n srcptr = src;\r\n while (*++srcptr) ;\r\n\r\n destptr = dest;\r\n while (*srcptr++ = *destptr++) ;\r\n return src;\r\n}\r\n\r\n//appends at most n bytes of the string src to dest\r\nchar* strncat(char *src, *dest, float n) {\r\n register char *srcptr, *destptr;\r\n register float i;\r\n \r\n srcptr = src;\r\n srcptr--;\r\n while (*++srcptr) ;\r\n\r\n destptr = dest;\r\n i = n;\r\n while (i--) {\r\n if (*srcptr++ = *destptr++) continue;\r\n }\r\n *srcptr = 0;\r\n return src;\r\n}\r\n\r\n//locates character c in a string, searching from the beginning\r\nchar* strchr(char *str, c) {\r\n register char *strptr, ch;\r\n strptr = str;\r\n ch = c;\r\n while(*strptr) {\r\n if (*strptr == ch) return strptr;\r\n ++strptr;\r\n }\r\n return 0;\r\n}\r\n\r\n//locates character c in a string, searching from the end\r\nchar* strrchr(char *str, c) {\r\n register char *strptr, ch;\r\n register char *findptr;\r\n \r\n findptr = 0;\r\n strptr = str;\r\n ch = c;\r\n while (*strptr) {\r\n if (*strptr == ch) findptr = strptr;\r\n ++strptr;\r\n }\r\n return findptr;\r\n}\r\n\r\n//compares two strings lexicographically\r\nfloat strcmp(char *src, *dest) {\r\n register char *srcptr, *destptr;\r\n\r\n srcptr = src;\r\n destptr = dest;\r\n while (*srcptr == *destptr) {\r\n if (*srcptr == 0) return 0;\r\n ++srcptr; ++destptr;\r\n }\r\n return (*srcptr - *destptr);\r\n}\r\n\r\n//compares up to the first n bytes of two strings lexicographically\r\nfloat strncmp(char *src, *dest, float n) {\r\n register char *srcptr, *destptr;\r\n register float i;\r\n \r\n srcptr = src;\r\n destptr = dest;\r\n i = n;\r\n\r\n while (i && (*srcptr == *destptr)) {\r\n if (*srcptr == 0) return 0;\r\n ++srcptr; ++destptr; --i;\r\n }\r\n if (i) return (*srcptr - *destptr);\r\n return 0;\r\n}\r\n\r\n//copies a string from one location to another\r\nchar* strcpy(char *dest, *src) {\r\n register char *srcptr, *destptr;\r\n\r\n destptr = dest;\r\n srcptr = src;\r\n while (*destptr++ = *srcptr++) ;\r\n return dest;\r\n}\r\n\r\n\r\n//write exactly n bytes to dest, copying from src or add 0's\r\nchar* strncpy(char *dest, *src, float n) {\r\n register char *srcptr, *destptr;\r\n register float i;\r\n\r\n destptr = dest;\r\n srcptr = src;\r\n i = n;\r\n \r\n while (i-- > 0) {\r\n if (*destptr++ = *srcptr++) continue;\r\n while (i-- > 0) *destptr++ = 0;\r\n }\r\n *destptr = 0;\r\n return dest;\r\n}\r\n\r\n//returns the string representation of an error number e.g. errno\r\n//char *strerror(int);\r\n\r\n//finds the length of a C string\r\nfloat strlen(char* str) {\r\n register char* strptr;\r\n register float n;\r\n \r\n strptr = str;\r\n n = 0;\r\n while (*strptr++) n++;\r\n return n;\r\n}\r\n\r\n//determines the length of the maximal initial substring consisting entirely of characters in accept\r\nfloat strspn(char *str, *accept) {\r\n register char *s = str;\r\n register char *p = accept;\r\n\r\n while (*p) {\r\n if (*p++ == *s) {\r\n ++s;\r\n p = accept;\r\n }\r\n }\r\n return s - str;\r\n}\r\n\r\n//determines the length of the maximal initial substring consisting entirely of characters not in reject\r\nfloat strcspn(char *str, char *reject) {\r\n register char *s, *p;\r\n \r\n for (s=str; *s; s++) {\r\n for (p=reject; *p; p++) {\r\n if (*p == *s) goto done;\r\n }\r\n }\r\n done:\r\n return s - str;\r\n}\r\n\r\n//finds the first occurrence of any character in accept\r\nchar* strpbrk(char *str, char *accept) {\r\n register char *s;\r\n register char *p;\r\n\r\n for (s=str; *s; s++) {\r\n for (p=accept; *p; p++) {\r\n if (*p == *s) return s;\r\n }\r\n }\r\n return NULL;\r\n}\r\n\r\n//finds the first occurrence of the string \"needle\" in the longer string \"haystack\"\r\nchar *strstr(char *haystack, char *needle) {\r\n register char *s = haystack;\r\n register char *p = needle;\r\n\r\n while (1) {\r\n if (!*p) {\r\n return haystack;\r\n }\r\n if (*p == *s) {\r\n ++p;\r\n ++s;\r\n } else {\r\n p = needle;\r\n if (!*s) {\r\n return NULL;\r\n }\r\n s = ++haystack;\r\n }\r\n }\r\n}\r\n\r\n//parses a string into a sequence of tokens; non-thread safe in the spec, non-reentrant\r\n//char *strtok(char *, const char * delim);\r\n\r\n//transforms src into a collating form, such that the numerical sort order of the transformed string is equivalent to the collating order of src\r\n//float strxfrm(char *dest, const char *src, float n);\r\n","cpuchip/lib/zcrt/ctype.txt":"//------------------------------------------------------------------------------\r\n// ZCPU CRT sourcecode (for HL-ZASM compiler) (C) 2011 by Black Phoenix\r\n//\r\n// Character classification functions.\r\n//------------------------------------------------------------------------------\r\n\r\n#define _CONTROL 1\r\n#define _SPACE 2\r\n#define _BLANK 4\r\n#define _DIGIT 8\r\n#define _HEX 16\r\n#define _PUNCT 32\r\n#define _UPPER 64\r\n#define _LOWER 128\r\n#define _GRAPH 256\r\n\r\n#define _MAXCHARS 0x83\r\n\r\n//test for alphanumeric character\r\nfloat isalnum(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n \r\n band eax,_LOWER+_UPPER+_DIGIT;\r\n}\r\n\r\n//test for alphabetic character\r\nfloat isalpha(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_LOWER+_UPPER;\r\n}\r\n\r\n//test for blank character\r\nfloat isblank(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_BLANK;\r\n}\r\n\r\n//test for control character\r\nfloat iscontrol(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_CONTROL;\r\n}\r\n\r\n//test for digit\r\nfloat isdigit(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_DIGIT;\r\n}\r\n\r\n//test for graphic character, excluding the space character\r\nfloat isgraph(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_GRAPH;\r\n}\r\n\r\n//test for lowercase character\r\nfloat islower(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_LOWER;\r\n}\r\n\r\n//test for printable character, including the space character.\r\nfloat isprint(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_LOWER+_UPPER+_DIGIT+_PUNCT+_BLANK+_GRAPH;\r\n}\r\n\r\n//test for punctuation character\r\nfloat ispunct(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_PUNCT;\r\n}\r\n\r\n//test for any whitespace character\r\nfloat isspace(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_SPACE;\r\n}\r\n\r\n//test for uppercase character\r\nfloat isupper(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_UPPER;\r\n}\r\n\r\n//test for hexadecimal digit. Not locale-specific.\r\nfloat isxdigit(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_HEX;\r\n}\r\n\r\n//convert character to lowercase\r\nchar tolower(char c) {\r\n if (islower(c)) return c - 0x20;\r\n return c;\r\n}\r\n\r\n//convert character to uppercase\r\nchar toupper(char c) {\r\n if (isupper(c)) return c + 0x20;\r\n return c;\r\n}\r\n\r\n__ctype_characters:\r\n db _CONTROL, //00 (NUL)\r\n db _CONTROL; //01 (SOH)\r\n db _CONTROL; //02 (STX)\r\n db _CONTROL; //03 (ETX)\r\n db _CONTROL; //04 (EOT)\r\n db _CONTROL; //05 (ENQ)\r\n db _CONTROL; //06 (ACK)\r\n db _CONTROL; //07 (BEL)\r\n db _CONTROL; //08 (BS)\r\n db _SPACE+_CONTROL; //09 (HT)\r\n db _SPACE+_CONTROL; //0A (LF)\r\n db _SPACE+_CONTROL; //0B (VT)\r\n db _SPACE+_CONTROL; //0C (FF)\r\n db _SPACE+_CONTROL; //0D (CR)\r\n db _CONTROL; //0E (SI)\r\n db _CONTROL; //0F (SO)\r\n db _CONTROL; //10 (DLE)\r\n db _CONTROL; //11 (DC1)\r\n db _CONTROL; //12 (DC2)\r\n db _CONTROL; //13 (DC3)\r\n db _CONTROL; //14 (DC4)\r\n db _CONTROL; //15 (NAK)\r\n db _CONTROL; //16 (SYN)\r\n db _CONTROL; //17 (ETB)\r\n db _CONTROL; //18 (CAN)\r\n db _CONTROL; //19 (EM)\r\n db _CONTROL; //1A (SUB)\r\n db _CONTROL; //1B (ESC)\r\n db _CONTROL; //1C (FS)\r\n db _CONTROL; //1D (GS)\r\n db _CONTROL; //1E (RS)\r\n db _CONTROL; //1F (US)\r\n db _SPACE+_BLANK; //20 SPACE\r\n db _PUNCT; //21 !\r\n db _PUNCT; //22 \"\r\n db _PUNCT; //23 #\r\n db _PUNCT; //24 $\r\n db _PUNCT; //25 %\r\n db _PUNCT; //26 &\r\n db _PUNCT; //27 '\r\n db _PUNCT; //28 (\r\n db _PUNCT; //29 )\r\n db _PUNCT; //2A *\r\n db _PUNCT; //2B +\r\n db _PUNCT; //2C ;\r\n db _PUNCT; //2D -\r\n db _PUNCT; //2E .\r\n db _PUNCT; //2F /\r\n db _DIGIT+_HEX; //30 0\r\n db _DIGIT+_HEX; //31 1\r\n db _DIGIT+_HEX; //32 2\r\n db _DIGIT+_HEX; //33 3\r\n db _DIGIT+_HEX; //34 4\r\n db _DIGIT+_HEX; //35 5\r\n db _DIGIT+_HEX; //36 6\r\n db _DIGIT+_HEX; //37 7\r\n db _DIGIT+_HEX; //38 8\r\n db _DIGIT+_HEX; //39 9\r\n db _PUNCT; //3A :\r\n db _PUNCT; //3B ;\r\n db _PUNCT; //3C <\r\n db _PUNCT; //3D =\r\n db _PUNCT; //3E >\r\n db _PUNCT; //3F ?\r\n db _PUNCT; //40 @\r\n db _UPPER+_HEX; //41 A\r\n db _UPPER+_HEX; //42 B\r\n db _UPPER+_HEX; //43 C\r\n db _UPPER+_HEX; //44 D\r\n db _UPPER+_HEX; //45 E\r\n db _UPPER+_HEX; //46 F\r\n db _UPPER; //47 G\r\n db _UPPER; //48 H\r\n db _UPPER; //49 I\r\n db _UPPER; //4A J\r\n db _UPPER; //4B K\r\n db _UPPER; //4C L\r\n db _UPPER; //4D M\r\n db _UPPER; //4E N\r\n db _UPPER; //4F O\r\n db _UPPER; //50 P\r\n db _UPPER; //51 Q\r\n db _UPPER; //52 R\r\n db _UPPER; //53 S\r\n db _UPPER; //54 T\r\n db _UPPER; //55 U\r\n db _UPPER; //56 V\r\n db _UPPER; //57 W\r\n db _UPPER; //58 X\r\n db _UPPER; //59 Y\r\n db _UPPER; //5A Z\r\n db _PUNCT; //5B [\r\n db _PUNCT; //5C \\\r\n db _PUNCT; //5D ]\r\n db _PUNCT; //5E ^\r\n db _PUNCT; //5F _\r\n db _PUNCT; //60 `\r\n db _LOWER+_HEX; //61 a\r\n db _LOWER+_HEX; //62 b\r\n db _LOWER+_HEX; //63 c\r\n db _LOWER+_HEX; //64 d\r\n db _LOWER+_HEX; //65 e\r\n db _LOWER+_HEX; //66 f\r\n db _LOWER; //67 g\r\n db _LOWER; //68 h\r\n db _LOWER; //69 i\r\n db _LOWER; //6A j\r\n db _LOWER; //6B k\r\n db _LOWER; //6C l\r\n db _LOWER; //6D m\r\n db _LOWER; //6E n\r\n db _LOWER; //6F o\r\n db _LOWER; //70 p\r\n db _LOWER; //71 q\r\n db _LOWER; //72 r\r\n db _LOWER; //73 s\r\n db _LOWER; //74 t\r\n db _LOWER; //75 u\r\n db _LOWER; //76 v\r\n db _LOWER; //77 w\r\n db _LOWER; //78 x\r\n db _LOWER; //79 y\r\n db _LOWER; //7A z\r\n db _PUNCT; //7B {\r\n db _PUNCT; //7C |\r\n db _PUNCT; //7D }\r\n db _PUNCT; //7E ~\r\n db _CONTROL; //7F (DEL)\r\n \r\n db _GRAPH; //80\r\n db _GRAPH; //81\r\n db _GRAPH; //82\r\n db _GRAPH; //83","cpuchip/lib/zcrt/init.txt":"//------------------------------------------------------------------------------\r\n// ZCPU CRT sourcecode (for HL-ZASM compiler) (C) 2011 by Black Phoenix\r\n//\r\n// C runtime library initialization\r\n//------------------------------------------------------------------------------\r\n\r\n#ifdef ZCRT_EXTENDED_MODE\r\n // Initialize extended mode\r\n mov edi,&zcrtInterruptTable; //Need \"&\" because array is defined below\r\n mov esi,&zcrtInterruptTable; add esi,1024;\r\n @InitTable:\r\n mov #edi,zcrtErrorHandler; inc edi;\r\n mov #edi,0; inc edi;\r\n mov #edi,0; inc edi;\r\n mov #edi,32; inc edi;\r\n cmp edi,esi;\r\n jl @InitTable;\r\n\r\n lidtr zcrtInterruptTable;\r\n stef;\r\n#endif\r\n\r\n// Call main function\r\nmain();\r\n\r\n// Stop the processor execution\r\n#ifdef ZCRT_EXTENDED_MODE\r\n clef;\r\n#endif\r\nint 1;\r\n\r\n//------------------------------------------------------------------------------\r\n// Allocate the interrupt table\r\n#ifdef ZCRT_EXTENDED_MODE\r\n float zcrtInterruptTable[1024];\r\n char* zcrtInterruptEntrypoint;\r\n \r\n // Default interrupt handlers\r\n zcrtErrorHandler:\r\n //Execute handler if required\r\n if (zcrtInterruptEntrypoint) {\r\n float errorNo,errorCode;\r\n cpuget errorNo,28;\r\n cpuget errorCode,27;\r\n\r\n zcrtInterruptEntrypoint(errorNo,errorCode);\r\n }\r\n iret\r\n#endif\r\n"}},"cpuchip/programs/":[]}} \ No newline at end of file +//{"expression2/":{"expression2/_helloworld_.txt":"@name Hello World\r\n@inputs A B\r\n@outputs Add Sub Mul Div\r\n@outputs GreaterThan Highest Lowest\r\n@outputs Vector:vector\r\n@persist D\r\n@trigger all\r\n\r\nAdd = A + B\r\nSub = A - B\r\nMul = A * B\r\nDiv = A / B\r\n\r\nGreaterThan = A > B\r\n\r\nif(A > B) {\r\n Highest = A, Lowest = B\r\n} else {\r\n Highest = B, Lowest = A\r\n}\r\n\r\nVector = vec(A, B, 0)\r\nVector = Vector + vec(0, 0, A + B)\r\nVector = Vector:normalized()"},"soundlists/":{"soundlists/common_sounds.txt":"AlyxEMP.Charge | property\r\nAlyxEMP.Discharge | property\r\nAlyxEMP.Stop | property\r\nBaseExplosionEffect.Sound | property\r\nBaseGrenade.BounceSound | property\r\nBaseGrenade.Explode | property\r\nBaseGrenade.StopSounds | property\r\nBullets.DefaultNearmiss | property\r\nBullets.GunshipNearmiss | property\r\nBullets.StriderNearmiss | property\r\nFX_RicochetSound.Ricochet | property\r\nFuncTank.Fire | property\r\nFunc_Tank.BeginUse | property\r\nGenericNPC.GunSound | property\r\nGrenade.Blip | property\r\nGrenadeBeam.HitSound | property\r\nGrenadeBottle.Detonate | property\r\nGrenadeBugBait.Splat | property\r\nGrenadeHomer.StopSounds | property\r\nGrenadePathfollower.StopSounds | property\r\nGrenadeScanner.StopSound | property\r\nGrenade_Molotov.Detonate | property\r\nTripwireGrenade.ShootRope | property\r\nWaterExplosionEffect.Sound | property\r\nWeaponFrag.Roll | property\r\nWeaponFrag.Throw | property\r\nWeapon_357.OpenLoader | property\r\nWeapon_357.Reload | property\r\nWeapon_357.RemoveLoader | property\r\nWeapon_357.ReplaceLoader | property\r\nWeapon_357.Single | property\r\nWeapon_357.Spin | property\r\nWeapon_AR2.Double | property\r\nWeapon_AR2.Empty | property\r\nWeapon_AR2.NPC_Double | property\r\nWeapon_AR2.NPC_Reload | property\r\nWeapon_AR2.NPC_Single | property\r\nWeapon_AR2.Reload | property\r\nWeapon_AR2.Reload_Push | property\r\nWeapon_AR2.Reload_Rotate | property\r\nWeapon_AR2.Single | property\r\nWeapon_AR2.Special1 | property\r\nWeapon_AR2.Special2 | property\r\nWeapon_Binoculars.Reload | property\r\nWeapon_Binoculars.Special1 | property\r\nWeapon_Binoculars.Special2 | property\r\nWeapon_Brickbat.Special1 | property\r\nWeapon_Bugbait.Splat | property\r\nWeapon_CombineGuard.Special1 | property\r\nWeapon_Crossbow.BoltElectrify | property\r\nWeapon_Crossbow.BoltFly | property\r\nWeapon_Crossbow.BoltHitBody | property\r\nWeapon_Crossbow.BoltHitWorld | property\r\nWeapon_Crossbow.BoltSkewer | property\r\nWeapon_Crossbow.Reload | property\r\nWeapon_Crossbow.Single | property\r\nWeapon_Crowbar.Melee_Hit | property\r\nWeapon_Crowbar.Melee_HitWorld | property\r\nWeapon_Crowbar.Single | property\r\nWeapon_Extinguisher.Double | property\r\nWeapon_Extinguisher.Empty | property\r\nWeapon_Extinguisher.NPC_Double | property\r\nWeapon_Extinguisher.NPC_Reload | property\r\nWeapon_Extinguisher.NPC_Single | property\r\nWeapon_Extinguisher.Reload | property\r\nWeapon_Extinguisher.Single | property\r\nWeapon_Extinguisher.Special1 | property\r\nWeapon_FlareGun.Burn | property\r\nWeapon_FlareGun.Reload | property\r\nWeapon_FlareGun.Single | property\r\nWeapon_Gauss.ChargeLoop | property\r\nWeapon_IRifle.Empty | property\r\nWeapon_IRifle.Single | property\r\nWeapon_MegaPhysCannon.Charge | property\r\nWeapon_MegaPhysCannon.ChargeZap | property\r\nWeapon_MegaPhysCannon.Drop | property\r\nWeapon_MegaPhysCannon.DryFire | property\r\nWeapon_MegaPhysCannon.HoldSound | property\r\nWeapon_MegaPhysCannon.Launch | property\r\nWeapon_MegaPhysCannon.Pickup | property\r\nWeapon_Mortar.Impact | property\r\nWeapon_Mortar.Incomming | property\r\nWeapon_Mortar.Single | property\r\nWeapon_PhysCannon.Charge | property\r\nWeapon_PhysCannon.CloseClaws | property\r\nWeapon_PhysCannon.Drop | property\r\nWeapon_PhysCannon.DryFire | property\r\nWeapon_PhysCannon.HoldSound | property\r\nWeapon_PhysCannon.Launch | property\r\nWeapon_PhysCannon.OpenClaws | property\r\nWeapon_PhysCannon.Pickup | property\r\nWeapon_PhysCannon.TooHeavy | property\r\nWeapon_Physgun.HeavyObject | property\r\nWeapon_Physgun.LightObject | property\r\nWeapon_Physgun.LockedOn | property\r\nWeapon_Physgun.Off | property\r\nWeapon_Physgun.On | property\r\nWeapon_Physgun.Scanning | property\r\nWeapon_Physgun.Special1 | property\r\nWeapon_Pistol.Burst | property\r\nWeapon_Pistol.Empty | property\r\nWeapon_Pistol.NPC_Reload | property\r\nWeapon_Pistol.NPC_Single | property\r\nWeapon_Pistol.Reload | property\r\nWeapon_Pistol.Single | property\r\nWeapon_Pistol.Special1 | property\r\nWeapon_Pistol.Special2 | property\r\nWeapon_RPG.LaserOff | property\r\nWeapon_RPG.LaserOn | property\r\nWeapon_RPG.NPC_Single | property\r\nWeapon_RPG.Single | property\r\nWeapon_SMG1.Burst | property\r\nWeapon_SMG1.Double | property\r\nWeapon_SMG1.Empty | property\r\nWeapon_SMG1.NPC_Reload | property\r\nWeapon_SMG1.NPC_Single | property\r\nWeapon_SMG1.Reload | property\r\nWeapon_SMG1.Single | property\r\nWeapon_SMG1.Special1 | property\r\nWeapon_SMG1.Special2 | property\r\nWeapon_Shotgun.Double | property\r\nWeapon_Shotgun.Empty | property\r\nWeapon_Shotgun.NPC_Reload | property\r\nWeapon_Shotgun.NPC_Single | property\r\nWeapon_Shotgun.Reload | property\r\nWeapon_Shotgun.Single | property\r\nWeapon_Shotgun.Special1 | property\r\nWeapon_SniperRifle.NPC_Reload | property\r\nWeapon_SniperRifle.NPC_Single | property\r\nWeapon_SniperRifle.Reload | property\r\nWeapon_SniperRifle.Single | property\r\nWeapon_SniperRifle.Special1 | property\r\nWeapon_SniperRifle.Special2 | property\r\nWeapon_StunStick.Activate | property\r\nWeapon_StunStick.Deactivate | property\r\nWeapon_StunStick.Melee_Hit | property\r\nWeapon_StunStick.Melee_HitWorld | property\r\nWeapon_StunStick.Melee_Miss | property\r\nWeapon_StunStick.Swing | property\r\nWeapon_functank.Single | property\r\n"},"wire_version.txt":"gm13-401-gf291c42\r\n","gpuchip/":{"gpuchip/examples/":{"gpuchip/examples/3d_icosahedron.txt":"// Author: Drunkie\r\n// Description: Draws a 3D icosahedron model (solid and wireframe)\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glSleep( 40 ); // Sleep for 40 milliseconds (Reduces fps lag)\r\n glClear( 0, 0, 0 ); // Clear screen\r\n \r\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode \r\n glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation\r\n\r\n glLightPos( 0, 0, -50 ); // Set the light position\r\n glLightColor( 255, 255, 255, 1 ); // Set the light color\r\n \r\n glLookAt(\r\n 0, 0, -2.25, // Camera pos\r\n 0, 0, 0, // Camera target\r\n 0, 1, 0 // Camera up\r\n ); \r\n \r\n // Create variable to hold curtime\r\n float time;\r\n timer time;\r\n \r\n // Create perspective and matrix transformations\r\n glPerspective( 30, 1, 1, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR\r\n glRotate( 1, 1, 0, time ); // AXIS X, Y, Z, ANGLE W\r\n glTranslate( 0, 0, 0 ); // TRANSLATION X, Y, Z\r\n glScale( 1, 1, 1, 0 ); // SCALE X, Y, Z\r\n \r\n glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer \r\n glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting\r\n glEnable( GL_VERTEX_LIGHTING ); // Enable vertex lighting\r\n //glEnable( GL_VERTEX_CULLING ); // Enable face culling\r\n \r\n // Solid 3D polygon\r\n glFillMode( GL_FILL_SOLID ); // Set fillmode as solid\r\n glColor4( 100, 149, 237, 180 ); // Set the draw color with alpha\r\n glPoly3D( vertexBuffer, 20 ); // Draw 3D polygon\r\n glFlush(); // Flush the vertex buffer to the screen\r\n \r\n glDisable( GL_VERTEX_LIGHTING ); // Enable vertex lighting\r\n \r\n // Wireframe 3D polygon\r\n glLineWidth( 1 ); // Set line width of wireframe\r\n glFillMode( GL_FILL_WIREFRAME ); // Set fillmode as wireframe\r\n glColor4( 255, 255, 255, 255 ); // Set the draw color with alpha\r\n glPoly3D( vertexBuffer, 20 ); // Draw 3D polygon\r\n glFlush(); // Flush the vertex buffer to the screen\r\n \r\n glExit(); // Exit\r\n}\r\n\r\n// The vertex data for our model\r\nvertexBuffer:\r\ndb 0,0,1; db 0,0.9,0.5; db 0.9,0.3,0.4;\r\ndb 0,0,1; db -0.9,0.3,0.4; db 0,0.9,0.5;\r\ndb 0,0,1; db -0.5,-0.7,0.4; db -0.9,0.3,0.4;\r\ndb 0,0,1; db 0.5,-0.7,0.4; db -0.5,-0.7,0.4;\r\ndb 0,0,1; db 0.9,0.3,0.4; db 0.5,-0.7,0.4;\r\ndb 0.9,-0.3,-0.4; db 0.9,0.3,0.4; db 0.5,0.7,-0.4;\r\ndb 0,0.9,0.5; db 0.5,0.7,-0.4; db 0.9,0.3,0.4;\r\ndb 0,0.9,0.5; db -0.5,0.7,-0.4; db 0.5,0.7,-0.4;\r\ndb 0,0.9,0.5; db -0.9,0.3,0.4; db -0.5,0.7,-0.4;\r\ndb -0.9,-0.3,-0.4; db -0.5,0.7,-0.4; db -0.9,0.3,0.4;\r\ndb -0.9,-0.3,-0.4; db -0.9,0.3,0.4; db -0.5,-0.7,0.4;\r\ndb -0.9,-0.3,-0.4; db -0.5,-0.7,0.4; db 0,-0.9,-0.5;\r\ndb 0.5,-0.7,0.4; db 0,-0.9,-0.5; db -0.5,-0.7,0.4;\r\ndb 0.5,-0.7,0.4; db 0.9,-0.3,-0.4; db 0,-0.9,-0.5;\r\ndb 0.5,-0.7,0.4; db 0.9,0.3,0.4; db 0.9,-0.3,-0.4;\r\ndb 0,0,-1; db 0,-0.9,-0.5; db 0.9,-0.3,-0.4;\r\ndb 0,0,-1; db 0.9,-0.3,-0.4; db 0.5,0.7,-0.4;\r\ndb 0,0,-1; db 0.5,0.7,-0.4 db -0.5,0.7,-0.4;\r\ndb 0,0,-1; db -0.5,0.7,-0.4; db -0.9,-0.3,-0.4;\r\ndb 0,0,-1; db -0.9,-0.3,-0.4; db 0,-0.9,-0.5;\r\n","gpuchip/examples/hud_fighter.txt":"//Aircraft hud\r\n//port0 - ROLL\r\n//port1 - PITCH\r\n//port2 - YAW (heading)\r\n//port3 - speed (units/sec)\r\n//port4 - altitude (units)\r\n//port5 - radar altitude (put ranger under your plane, and attach to this)\r\n//port6 - flaps active, 1 or 0\r\n//port7 - go to \"Gates - Time\", and find \"Derivative\". Attach this to derivative, and derivative to altitude (vertical speed)\r\n\r\n//Artiftical horizon\r\nin eax,0; //Roll\r\nin ebx,1; //Pitch\r\n\r\n//mul ebx,0.017453292;\r\nmul eax,0.017453292;\r\nadd eax,1.57;\r\n\r\ndiv ebx,90;\r\nmul ebx,512;\r\nadd ebx,256;\r\n\r\nmov #horizon_moveoffset.y,ebx;\r\n\r\ndrotatescale eax,1;\r\ndmove horizon_moveoffset;\r\n\r\ndcolor art_sky;\r\ndrectwh horizon_sky_offset,horizon_size;\r\ndcolor art_grnd;\r\ndrectwh horizon_grnd_offset,horizon_size;\r\n\r\ndcolor hud_text;\r\ndsetsize 20;\r\nmov eax,-45;\r\n_horizon_text:\r\n mov ebx,eax;\r\n mul ebx,5.68;\r\n sub ebx,10;\r\n mov #horizon_textpos1.y,ebx;\r\n mov #horizon_textpos2.y,ebx; add ebx,9;\r\n mov #horizon_rectpos1.y,ebx; add ebx,2;\r\n mov #horizon_rectpos2.y,ebx;\r\n\r\n drect horizon_rectpos1,horizon_rectpos2;\r\n dwritei horizon_textpos1,eax;\r\n dwritei horizon_textpos2,eax;\r\n\r\n add eax,15;\r\n cmp eax,45;\r\n jle _horizon_text;\r\n\r\n//Reset\r\ndmove 0;\r\ndrotatescale 0,1;\r\n\r\n//Border around art horizon\r\ndcolor border_color;\r\ndrect border_p1,border_p2;\r\ndrect border_p3,border_p4;\r\ndrect border_p5,border_p6;\r\ndrect border_p7,border_p8;\r\ndcolor border_color2;\r\ndrect border_p9,border_p10;\r\n\r\n//Draw hud stuff\r\nmov #roll,port0;\r\nmov #pitch,port1;\r\nmov #hdg,port2; add #hdg,180;\r\nmov #spd,port3; div #spd,17.6;\r\nmov #alt,port4;\r\nadd #alt,12000;\r\ndiv #alt,12;\r\nmov #ralt,port5; div #ralt,12;\r\nmov #vspd,port7; div #vspd,17.6;\r\ndcolor hud_text;\r\ndwritefmt hud_pos1,hud_text1;\r\ndsetsize 16;\r\ndwritefmt hud_pos2,hud_text2;\r\n\r\ndcolor hud_text;\r\nmov eax,port6; mul eax,0.75; add eax,0.25;\r\ndshade eax;\r\ndwritefmt hud_pos3,hud_text3;\r\n\r\n\r\ndexit;\r\n\r\nvec2f hud_pos1,50,20;\r\nstring hud_text1,'ROLL %i %tPITCH %i%tHDG %i';\r\nalloc roll; \r\nalloc pitch;\r\nalloc hdg;\r\n\r\nvec2f hud_pos2,45,120;\r\nstring hud_text2,'SPD',10,'%ikt',10,10,'ALT',10,'%ift',10,10,'RALT',10,'%ift',10,10,'VSPD',10,'%ift/s';\r\nalloc spd;\r\nalloc alt;\r\nalloc ralt;\r\nalloc vspd;\r\n\r\nvec2f hud_pos3,45,400;\r\nstring hud_text3,'FLAPS';\r\n\r\n\r\nvec2f horizon_textpos1,96,0;\r\nvec2f horizon_textpos2,-64,0;\r\nvec2f horizon_rectpos1,-50,0;\r\nvec2f horizon_rectpos2,50,0;\r\ncolor hud_text,64,255,64;\r\n\r\ncolor border_color2,255,255,255;\r\ncolor border_color,30,30,30;\r\nvec2f border_p1,0,0;\r\nvec2f border_p2,128,512;\r\nvec2f border_p3,384,0;\r\nvec2f border_p4,512,512;\r\n\r\nvec2f border_p5,128,0;\r\nvec2f border_p6,384,64;\r\nvec2f border_p7,128,448;\r\nvec2f border_p8,384,512;\r\n\r\nvec2f border_p9,128,254;\r\nvec2f border_p10,384,258;\r\n\r\nvec2f horizon_sky_offset,-256,-512;\r\nvec2f horizon_grnd_offset,-256,0;\r\nvec2f horizon_size,512,512;\r\n\r\nvec2f horizon_moveoffset,256,256;\r\n\r\ncolor art_sky,24,144,255;\r\ncolor art_grnd,192,72,0;\r\n","gpuchip/examples/stargate.txt":"//STARGATE DIAL COMPUTER MAIN DISPLAY (realistic colors)\r\n//\r\n//How to connect:\r\n//GPU IOBus to Data Port\r\n//Port0 to \"Open\"\r\n//Port1 to \"Active\"\r\n//Port2 to \"Chevron\"\r\n//Port3 to \"Inbound\"\r\n//Port4 to iris\r\n//\r\n//That's all!\r\n\r\ndiv #65525,1.33;\r\nmov #65485,16; //65485 is the circle quality register\r\n\r\n//24 means circles have 24 sides\r\n//You can have up to 128 sides, but that LAGS\r\n//32 sides is not even noticable comparing to 128\r\n\r\n//= Misc decorations ==================\r\n\r\ndcolor stargate_out_ring;\r\ndcircle center,250;\r\ndcolor stargate_middle_ring;\r\ndcircle center,240;\r\ndcolor stargate_out_ring;\r\ndcircle center,223;\r\n\r\n//= Rotating ring =====================\r\nmov #65485,12;\r\ndcolor stargate_inner_ring;\r\n\r\nin ecx,2; //This block checks if chevron 7 is engaged\r\ncmp ecx,7; //If yes, dont spin\r\nmov eax,0;\r\njge _norotate;\r\n timer eax;\r\n_norotate:\r\n\r\nin ebx,1; //This one checks if stargate is active\r\nmul eax,ebx;\r\n\r\nin ebx,3; neg ebx; add ebx,1; //This one checks if its inbound\r\nmul eax,ebx; //wormhole\r\n\r\ndrotatescale eax,1; //rotate by EAX radians\r\ndmove center;\r\ndcircle 0,220;\r\n\r\ndrotatescale 0,1; //Reset scale/movment\r\ndmove 0;\r\n\r\n//= Inner ring around EH ==============\r\nmov #65485,24;\r\ndcolor stargate_out_ring;\r\ndcircle center,190;\r\n\r\n\r\n//= EH ================================\r\ndcolor black;\r\ndcircle center,180; //draw black hole instead of event horizon\r\n\r\ndcolor stargate_eventhorizon;\r\n\r\nin ebx,0; //Stargate active?\r\ncmp ebx,0;\r\nmov eax,0;\r\nje _active;\r\n rand eax;\r\n mul eax,0.1;\r\n add eax,0.9;\r\n_active:\r\n\r\nin ebx,0; mul ebx,180;\r\n\r\nmul #eventhorizon_radius,0.99;\r\nmul ebx,1.01;\r\nadd #eventhorizon_radius,ebx;\r\ndiv #eventhorizon_radius,2;\r\n\r\n\r\ndshade eax;\r\ndcircle center,#eventhorizon_radius;\r\n\r\n//= Iris ==============================\r\nmov edx,port4;\r\nneg edx; add edx,1;\r\n\r\nmov eax,#iris_status;\r\nsub eax,edx;\r\nfabs eax,eax;\r\n\r\ndmuldt ecx,8;\r\n\r\ncmp eax,0.02;\r\njl _donothing;\r\n cmp #iris_status,edx;\r\n jl _lower;\r\n sub #iris_status,ecx;\r\n jmp _donothing;\r\n _lower:\r\n add #iris_status,ecx;\r\n_donothing:\r\n\r\nmov #iris1.y,#iris_status;\r\nmul #iris1.y,#iris2.y;\r\n\r\ndmove center;\r\n\r\nmov ecx,12;\r\n_iris:\r\n fsin ebx,ecx; fabs ebx,ebx; div ebx,10; add ebx,0.7;\r\n\r\n mov eax,ecx; mul eax,0.490; add eax,0.01; //0.697\r\n add eax,#iris_status;\r\n\r\n drotatescale eax,1;\r\n\r\n dcolor iris_color;\r\n dshade ebx;\r\n\r\n drect iris1,iris2;\r\nloop _iris;\r\n\r\ndmove 0;\r\n\r\n//= Chevrons ==========================\r\nmov eax,1; //Chevron ID\r\nin ebx,2;\r\ndmove center;\r\n_chevron_loop:\r\n mov edx,eax; //Compute chevron angle in radians\r\n mul edx,0.69815;\r\n sub edx,1.23333;\r\n\r\n drotatescale edx,1; //Rotate chevron polygon\r\n dcolor stargate_chevron;\r\n\r\n mov edx,eax:#chevron_triggers;\r\n\r\n cmp edx,ebx; //Check if chevron is light up\r\n jle _noshade;\r\n dshade 0.25;\r\n _noshade:\r\n\r\n dvxpoly chevron_polygon,4; //draw chevron polygon\r\n\r\n inc eax;\r\n cmp eax,9;\r\n jle _chevron_loop;\r\n\r\n//= Computer text =====================\r\ndrotatescale 0,1; //reset movement and scale\r\ndmove 0;\r\n\r\nin eax,3; //Is inbound?\r\ncmp eax,0;\r\nje _dexit;\r\n\r\n timer eax; mul eax,2; fint eax; mod eax,2;\r\n dcolor sgc_text;\r\n dshade eax;\r\n\r\n dsetsize 64; //draw message\r\n dwrite sgc_inboundpos,sgc_inbound;\r\n\r\n_dexit:\r\ndexit;\r\n\r\n//= Helpers ===========================\r\n\r\nchevron_triggers:\r\ndb 9,4,5,6,7,1,2,3,8;\r\n// 1 2 3 4 5 6 7 8 9\r\n// Order in which chevrons light up\r\n// Only 1-7 are used though\r\n\r\n//=====================================\r\n\r\ncolor sgc_text,255,255,255;\r\n\r\nvector2f sgc_inboundpos,120,215;\r\nstring sgc_inbound,'INBOUND';\r\n\r\ncolor stargate_out_ring, 116,105, 76;\r\ncolor stargate_middle_ring, 93 , 85, 60;\r\ncolor stargate_inner_ring, 138,137,108;\r\ncolor stargate_eventhorizon, 93,114,162;\r\ncolor stargate_chevron, 250,162, 54;\r\ncolor iris_color, 192,192,192;\r\n\r\ncolor black,0,0,0;\r\n\r\nvector2f center,256,256;\r\n\r\nvector2f iris1,-44,0;\r\nvector2f iris2,44,175;\r\n\r\nvector2f chevcenter,-16,-256;\r\nvector2f chevsize,32,32;\r\n\r\nalloc eventhorizon_radius;\r\nalloc iris_status;\r\n\r\n//raw chevron poly data\r\n//format: \r\nchevron_polygon: //n=4\r\ndb -16,-251;\r\ndb 16,-251;\r\ndb 10,-230;\r\ndb -10,-230;\r\n","gpuchip/examples/sprite.txt":"// Author: Drunkie\r\n// Description: A very simple sprite example\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n // Enable vertex mode\r\n glVertexMode( 1 );\r\n \r\n // Draw to sprite buffer\r\n glSetRenderTarget( GL_BUFFER_BACK );\r\n glClear( 0, 255, 0 );\r\n \r\n // Draw to vertex buffer (world)\r\n glSetRenderTarget( GL_BUFFER_VERTEX );\r\n glEnable( GL_VERTEX_TEXTURING );\r\n \r\n // Sample from sprite 0\r\n glTextureSize( 256 );\r\n glTexture( 0 );\r\n glClear( 0, 255, 0 );\r\n glRectWH( 128, 128, 256, 256 );\r\n \r\n glSetRenderTarget( GL_BUFFER_FRONT );\r\n \r\n glExit();\r\n}\r\n","gpuchip/examples/cube.txt":"//timer EAX;// div EAX,8;\r\n//fsin EAX,EAX;\r\n//mul EAX,512;\r\n//fabs EAX,EAX;\r\n//neg EAX;\r\n//add EAX,512;\r\n\r\ndcvxpipe 3; //-1..1 (opengl screen)\r\ndvxpipe 5; //matrix projection\r\n\r\n//Initialize transform\r\nmperspective mProjectionMatrix,vPerspective;\r\n\r\n//Render starts\r\ndclrscr bg_color;\r\nmlookat mViewMatrix,vLookAt; //View matrix\r\n\r\ntimer eax;\r\nmov #vRotate.w,eax;\r\n\r\n//Rotate translate\r\nmrotate mRotateMatrix,vRotate;\r\nmtranslate mTranslateMatrix,vTranslate;\r\n\r\n//Create model matrix\r\nmmov mModelMatrix,mTranslateMatrix;\r\nmmul mModelMatrix,mRotateMatrix;\r\n\r\n//modelViewMatrix = ViewMatrix * modelMatrx\r\nmmov mModelViewMatrix,mViewMatrix;\r\nmmul mModelViewMatrix,mModelMatrix;\r\n\r\n//load matrix\r\nmload mModelViewMatrix;\r\nmloadproj mProjectionMatrix;\r\n\r\n//setup light\r\ndsetlight 0,lightdata;\r\n\r\n//setup buffer\r\ndenable 0; //Vertex buffer\r\ndenable 1; //ZSorting\r\ndenable 2; //Lighting\r\ndenable 3; //Face culling\r\n\r\n//render cube\r\ndcolor fg_color;\r\ndvxdata_3f cube2,12;\r\ndvxflush;\r\n\r\nddisable 0; //Disable everything!\r\nddisable 1;\r\nddisable 2;\r\nddisable 3;\r\n\r\ndcvxpipe 0;\r\ndvxpipe 0;\r\n\r\n//You can write some text here now\r\n//\r\ndexit;\r\n\r\n//========\r\ncube2:\r\ndb -1,-1,-1;\r\ndb 1,-1,-1;\r\ndb 1,1,-1;\r\ncube3:\r\ndb -1,-1,-1;\r\ndb 1,1,-1;\r\ndb -1,1,-1;\r\ncube4:\r\ndb 1,-1,1;\r\ndb -1,-1,1;\r\ndb 1,1,1;\r\ncube5:\r\ndb -1,-1,1;\r\ndb -1,1,1;\r\ndb 1,1,1;\r\ncube6:\r\ndb 1,-1,-1;\r\ndb -1,-1,-1;\r\ndb 1,-1,1;\r\ncube7:\r\ndb -1,-1,-1;\r\ndb -1,-1,1;\r\ndb 1,-1,1;\r\ncube8:\r\ndb -1,1,-1;\r\ndb 1,1,-1;\r\ndb 1,1,1;\r\ncube9:\r\ndb -1,1,1;\r\ndb -1,1,-1;\r\ndb 1,1,1;\r\ncube10:\r\ndb -1,-1,-1;\r\ndb -1,1,-1;\r\ndb -1,1,1;\r\ncube11:\r\ndb -1,-1,1;\r\ndb -1,-1,-1;\r\ndb -1,1,1;\r\ncube12:\r\ndb 1,1,-1;\r\ndb 1,-1,-1;\r\ndb 1,1,1;\r\ncube13:\r\ndb 1,-1,-1;\r\ndb 1,-1,1;\r\ndb 1,1,1;\r\n\r\nlightdata:\r\nvector4f lightpos, 0,50,-50, 0; //x y z \r\ncolor lightcol,255,255,255, 1; //R G B Brightness\r\n//========\r\n\r\nmatrix mRotateMatrix;\r\nmatrix mTranslateMatrix;\r\n\r\nmatrix mProjectionMatrix;\t//This defines our projection to screen\r\nmatrix mViewMatrix;\t\t//This defines our camera transformations\r\n\r\nmatrix mModelMatrix;\t\t//This is our model transformations\r\nmatrix mModelViewMatrix;\t//This is our model relatively to camera transform\r\n\r\n\r\nvector4f vRotate, 1, 1, 1, 0; // \r\nvector4f vTranslate, 0, 0, 0, 0; // <0>\r\nvector4f vPerspective, 30, 1.6, 1, 20; // \r\n\r\nvLookAt:\r\nvector3f vLookAt_Eye, 0, 0, -5; //Where our camera is\r\nvector3f vLookAt_Center, 0, 0, 0; //What we look at\r\nvector3f vLookAt_Up, 0, 1, 0; //Where our matt-hat is\r\n\r\ncolor fg_color,255,255,25;\r\ncolor bg_color,64,32,12;","gpuchip/examples/verynice2.txt":"//Generated by WGUI tool. Get it at wiremod.com\r\n_page_0:\r\ndsetsize 16\r\ndcolor _c_0\r\ndrect _a_1,_a_2\r\ndcolor _c_1\r\ndrect _a_4,_a_5\r\ndcolor _c_2\r\ndrect _a_7,_a_8\r\ndcolor _c_3\r\ndrect _a_10,_a_11\r\ndcolor _c_3\r\ndrect _a_13,_a_14\r\ndcolor _c_2\r\nmov #_f_17,port0\r\ndwrite _a_16,_s_17\r\ndcolor _c_4\r\ndrect _a_19,_a_20\r\ndcolor _c_2\r\nmov #_f_23,port0\r\ndwrite _a_22,_s_23\r\ndcolor _c_4\r\ndwritefmt _a_25,_s_26\r\ndcolor _c_4\r\ndwritefmt _a_28,_s_29\r\ndcolor _c_4\r\ndwritefmt _a_31,_s_32\r\ndcolor _c_4\r\ndwritefmt _a_34,_s_35\r\ndcolor _c_4\r\ndwritefmt _a_37,_s_38\r\ndcolor _c_4\r\ndwritefmt _a_40,_s_41\r\ndcolor _c_4\r\ndwritefmt _a_43,_s_44\r\ndcolor _c_4\r\ndwritefmt _a_46,_s_47\r\ndcolor _c_3\r\ndrect _a_49,_a_50\r\ndcolor _c_2\r\nmov #_f_53,port0\r\ndwrite _a_52,_s_53\r\ndcolor _c_3\r\ndrect _a_55,_a_56\r\ndcolor _c_2\r\nmov #_f_59,port0\r\ndwrite _a_58,_s_59\r\ndcolor _c_2\r\ndwritefmt _a_61,_s_62\r\ndcolor _c_2\r\ndwritefmt _a_64,_s_65\r\ndcolor _c_2\r\ndwritefmt _a_67,_s_68\r\ndcolor _c_2\r\ndwritefmt _a_70,_s_71\r\ndcolor _c_2\r\ndwritefmt _a_73,_s_74\r\ndcolor _c_2\r\ndwritefmt _a_76,_s_77\r\ndexit\r\n\r\ncolor _c_0,0,0,160\r\nvec2f _a_1,8,8\r\nvec2f _a_2,504,504\r\ncolor _c_1,7,51,122\r\nvec2f _a_4,16,16\r\nvec2f _a_5,496,496\r\ncolor _c_2,0,0,0\r\nvec2f _a_7,24,24\r\nvec2f _a_8,488,488\r\ncolor _c_3,192,192,192\r\nvec2f _a_10,32,32\r\nvec2f _a_11,480,216\r\nvec2f _a_13,32,224\r\nvec2f _a_14,480,392\r\nvec2f _a_16,40,40\r\nstring _s_17,'VERYNICE GUI V2.1 Initialized...'\r\nalloc _f_17,0\r\ncolor _c_4,128,128,128\r\nvec2f _a_19,32,64\r\nvec2f _a_20,480,72\r\nvec2f _a_22,40,232\r\nstring _s_23,'Raw data feed:'\r\nalloc _f_23,0\r\nvec2f _a_25,88,256\r\nstring _s_26,'Input port 0: %f'\r\nvec2f _a_28,88,272\r\nstring _s_29,'Input port 1: %f'\r\nvec2f _a_31,88,288\r\nstring _s_32,'Input port 2: %f'\r\nvec2f _a_34,88,304\r\nstring _s_35,'Input port 3: %f'\r\nvec2f _a_37,88,320\r\nstring _s_38,'Input port 4: %f'\r\nvec2f _a_40,88,336\r\nstring _s_41,'Input port 5: %f'\r\nvec2f _a_43,88,352\r\nstring _s_44,'Input port 6: %f'\r\nvec2f _a_46,88,368\r\nstring _s_47,'Input port 7: %f'\r\nvec2f _a_49,32,400\r\nvec2f _a_50,248,480\r\nvec2f _a_52,40,408\r\nstring _s_53,'Vector feed 1:'\r\nalloc _f_53,0\r\nvec2f _a_55,264,400\r\nvec2f _a_56,480,480\r\nvec2f _a_58,272,408\r\nstring _s_59,'Vector feed 2:'\r\nalloc _f_59,0\r\nvec2f _a_61,40,424\r\nstring _s_62,'X: %f'\r\nvec2f _a_64,40,440\r\nstring _s_65,'Y: %f'\r\nvec2f _a_67,40,456\r\nstring _s_68,'Z: %f'\r\nvec2f _a_70,272,424\r\nstring _s_71,'X: %f'\r\nvec2f _a_73,272,440\r\nstring _s_74,'Y: %f'\r\nvec2f _a_76,272,456\r\nstring _s_77,'Z: %f'\r\n\r\n","gpuchip/examples/verynice1.txt":"dcolor c1;\r\ndrect p1,p2;\r\ndcolor c2;\r\ndrect p3,p4;\r\ndcolor c3;\r\ndrect p5,p6;\r\n\r\nmov #textpos1.y,80;\r\n\r\ndcolor c4;\r\ndsetsize 12;\r\ndwrite textpos1,text1;\r\n\r\nmov ecx,0;\r\nport_loop:\r\n add #textpos1.y,18;\r\n mov #textpos2.y,#textpos1.y;\r\n\r\n mov #textpos2.x,#textpos1.x;\r\n add #textpos2.x,90;\r\n dwrite textpos1,text2;\r\n dwritei textpos2,ecx;\r\n\r\n in eax,ecx;\r\n\r\n mov #textpos2.x,#textpos1.x;\r\n add #textpos2.x,192;\r\n dwritef textpos2,eax;\r\n\r\n inc ecx;\r\n cmp ecx,18;\r\n jl port_loop;\r\n\r\ndexit;\r\n\r\nstring text1,'VERYNICE HUD SYSTEM INITIALIZED... VER 1.0';\r\nstring text2,'INPUT PORT VALUE';\r\n\r\nvec2f textpos1,80,80;\r\nvec2f textpos2,80,80;\r\n\r\ncolor c1,0,0,255;\r\ncolor c2,0,0,127;\r\ncolor c3,0,0,64;\r\ncolor c4,255,255,255;\r\n\r\nvec2f p1,50,50;\r\nvec2f p2,450,450;\r\n\r\nvec2f p3,60,60;\r\nvec2f p4,430,430;\r\n\r\nvec2f p5,70,70;\r\nvec2f p6,440,440;","gpuchip/examples/trig.txt":"// Author: Jasongamer\r\n// Description: A tool for helping people learn trig\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glClear( 0, 0, 0 ); // Clear screen\r\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe (-1 to 1 mode)\r\n\r\n timer R0; // Set time to curtime()\r\n R0 = -R0 * 1;\r\n\r\n glColor( 255, 255, 255 ); // Set draw color\r\n glCircle( *orig.x, *orig.y, 0.66, 40 ); // Draw circle (x, y, radius, quality)\r\n \r\n glColor( 0, 0, 0 );\r\n glCircle( *orig.x, *orig.y, 0.64, 40 );\r\n\r\n // Set the points for the trig\r\n fcos *cos,R0;\r\n fsin *sin,R0;\r\n\r\n *PosR.x = *cos;\r\n *PosR.x *= 0.65;\r\n *PosR.x += *orig.x;\r\n \r\n *PosR.y = *sin;\r\n *PosR.y *= 0.65;\r\n *PosR.y += *orig.y;\r\n\r\n *PosX.x = *PosR.x;\r\n \r\n glLineWidth( 0.01 ); // Set line width\r\n glFontSize( 24 ); // Set font size\r\n\r\n // X part of triangle\r\n glColor( 0, 0, 255 );\r\n glLine( *orig.x, *orig.y, *PosX.x, *PosX.y ); // Draw line\r\n glWriteFmt( -0.95, -0.95, sCos ) // Write formatted string\r\n\r\n // Y part of triangle\r\n glColor( 255, 0, 0 );\r\n glLine( *PosR.x, *PosR.y, *PosX.x, *PosX.y );\r\n *sin *= -1; // Negate\r\n glWriteFmt( -0.95, -0.85, sSin );\r\n \r\n glColor( 255, 255, 255 );\r\n glLine( *orig.x, *orig.y, *PosR.x, *PosR.y ); // Draw line\r\n \r\n glExit(); // Exit\r\n}\r\n\r\nvec2f orig,0,0;\r\nvec2f PosR,0,0;\r\nvec2f PosX,0,0;\r\n\r\nstring sCos,\"Cosine = %f\";\r\nalloc cos;\r\n\r\nstring sSin,\"Sine = %f\";\r\nalloc sin;\r\n","gpuchip/examples/3d_letter_a.txt":"// Author: Drunkie\r\n// Description: Draws a 3D model of the letter A\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glSleep( 40 ); // Sleep for 40 milliseconds (reduces fps lag)\r\n glClear( 100, 149, 237 ); // Clear screen\r\n \r\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode \r\n glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation\r\n\r\n glLightPos( 0, 0, -50 ); // Set the light position\r\n glLightColor( 255, 255, 255, 1 ); // Set the light color\r\n\r\n glLookAt(\r\n 0, 0, -2.8, // Camera pos\r\n 0, 0, 0, // Camera target\r\n 0, 1, 0 // Camera up\r\n ); \r\n \r\n // Create variable to hold curtime\r\n float time;\r\n timer time;\r\n \r\n // Create perspective and matrix transformations\r\n glPerspective( 30, 1, 1, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR\r\n glRotate( 0, 1, 0, time ); // AXIS X, Y, Z, ANGLE W\r\n glTranslate( 0, -0.1, 0, 0 ); // TRANSLATION X, Y, Z\r\n glScale( 1, 1, 1, 0 ); // SCALE X, Y, Z\r\n\r\n glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer \r\n glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting\r\n glEnable( GL_VERTEX_LIGHTING ); // Enable vertex lighting\r\n glEnable( GL_VERTEX_CULLING ); // Enable face culling\r\n \r\n // Solid 3D polygon\r\n glFillMode( GL_FILL_SOLID ); // Set fillmode as solid\r\n glColor4( 255, 255, 255, 255 ); // Set draw color with alpha\r\n glPoly3D( vertexBuffer, 30 ); // Draw 3D polygon \r\n glFlush(); // Flush the vertex buffer to the screen\r\n \r\n glExit(); // Exit\r\n}\r\n\r\n// The vertex data for our model\r\nvertexBuffer:\r\ndb 1,1,0; db 0.75,1,0; db 0.25,-1,0;\r\ndb 0.75,1,0; db 0,-1,0; db 0.25,-1,0;\r\ndb -1,1,0; db -0.25,-1,0; db -0.75,1,0;\r\ndb -0.75,1,0; db -0.25,-1,0; db 0,-1,0;\r\ndb 1,1,0.25; db 0.25,-1,0.25; db 0.75,1,0.25;\r\ndb 0.75,1,0.25; db 0.25,-1,0.25; db 0,-1,0.25;\r\ndb -1,1,0.25; db -0.75,1,0.25; db -0.25,-1,0.25;\r\ndb -0.75,1,0.25; db 0,-1,0.25; db -0.25,-1,0.25;\r\ndb 0.25,-1,0; db -0.25,-1,0; db 0.25,-1,0.25;\r\ndb -0.25,-1,0; db -0.25,-1,0.25; db 0.25,-1,0.25;\r\ndb -1,1,0; db -1,1,0.25; db -0.25,-1,0;\r\ndb -1,1,0.25; db -0.25,-1,0.25; db -0.25,-1,0;\r\ndb 1,1,0.25; db 1,1,0; db 0.25,-1,0;\r\ndb 1,1,0.25; db 0.25,-1,0; db 0.25,-1,0.25;\r\ndb -0.75,1,0; db 0,-1,0; db -0.75,1,0.25;\r\ndb -0.75,1,0.25; db 0,-1,0; db 0,-1,0.25;\r\ndb 0.75,1,0; db 0.75,1,0.25; db 0,-1,0;\r\ndb 0.75,1,0.25; db 0,-1,0.25; db 0,-1,0;\r\ndb -0.47,0.25,0; db -0.38,0.01,0; db 0.38,0.01,0;\r\ndb 0.38,0.01,0; db 0.47,0.25,0; db -0.47,0.25,0;\r\ndb -0.47,0.25,0.25; db 0.38,0.01,0.25; db -0.38,0.01,0.25;\r\ndb 0.38,0.01,0.25; db -0.47,0.25,0.25; db 0.47,0.25,0.25;\r\ndb -0.38,0.01,0; db -0.38,0.01,0.25; db 0.38,0.01,0;\r\ndb 0.38,0.01,0; db -0.38,0.01,0.25; db 0.38,0.01,0.25; \r\ndb -0.47,0.25,0; db 0.47,0.25,0; db -0.47,0.25,0.25;\r\ndb -0.47,0.25,0.25; db 0.47,0.25,0; db 0.47,0.25,0.25;\r\ndb -1,1,0; db -0.75,1,0; db -1,1,0.25;\r\ndb -0.75,1,0; db -0.75,1,0.25; db -1,1,0.25;\r\ndb 1,1,0; db 1,1,0.25; db 0.75,1,0;\r\ndb 0.75,1,0; db 1,1,0.25; db 0.75,1,0.25;\r\n","gpuchip/examples/texture.txt":"// Author: Drunkie\r\n// Description: A very simple texture example\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glVertexMode( 1 );\r\n glColor( 255, 255, 255, 255 );\r\n\r\n glBindTexture( 'brick/brick_model' );\r\n glColor( 255, 255, 255, 255 );\r\n glRectWH( 128, 128, 256, 256 );\r\n \r\n glExit(); \r\n}\r\n\r\n// ZASM version\r\n\r\n//mov #regVertexMode,1;\r\n//dcolor white;\r\n//dxtexture tex;\r\n//drectwh pos,size;\r\n//dexit;\r\n//color white,255,255,255;\r\n//string tex,'brick/brick_model';\r\n//vec2f pos,128,128;\r\n//vec2f size,256,256;\r\n","gpuchip/examples/foxlogo.txt":"//Fox game console logo (also example on how to work with polygons)\r\n\r\ndclrscr chassis;\r\n\r\ndcolor fox1c;\r\ndvxdata_2f fox1a,16; //16 max!!\r\ndvxdata_2f fox2a,3;\r\ndvxdata_2f fox3a,3;\r\ndvxdata_2f fox4a,3;\r\ndvxdata_2f fox5a,3;\r\ndvxdata_2f fox6a,3;\r\ndvxdata_2f fox7a,6;\r\ndvxdata_2f fox8a,3;\r\n\r\ndcolor fox2c;\r\ndvxdata_2f fox2,4;\r\n\r\ndexit;\r\n\r\n//===========================================\r\ncolor chassis,0,0,0;\r\n\r\ncolor fox1c,60,60,60;\r\ncolor fox2c,100,100,100;\r\n//===========================================\r\nfox1a: //N=16\r\ndb 60,218\r\ndb 62,173\r\ndb 32,36\r\ndb 214,119\r\ndb 268,128\r\ndb 318,168\r\ndb 352,233\r\ndb 494,243\r\ndb 499,254\r\ndb 496,266\r\ndb 478,321\r\ndb 335,374\r\ndb 265,408\r\ndb 223,419\r\ndb 95,430\r\ndb 109,408\r\n\r\nfox2a: //N = 3\r\ndb 109,408\r\ndb 57,432\r\ndb 69,376\r\nfox3a:\r\ndb 69,376\r\ndb 33,394\r\ndb 59,327\r\nfox4a:\r\ndb 59,327\r\ndb 24,348\r\ndb 54,273\r\nfox5a:\r\ndb 54,273\r\ndb 29,286\r\ndb 57,240\r\nfox6a:\r\ndb 57,240\r\ndb 26,245\r\ndb 60,218\r\n\r\nfox7a: //N=6\r\ndb 109,408\r\ndb 69,376\r\ndb 59,327\r\ndb 54,273\r\ndb 57,240\r\ndb 60,218\r\n\r\nfox8a: //N=3\r\ndb 177,150;\r\ndb 269,150;\r\ndb 190,47;\r\n\r\n//===========================================\r\nfox2: //N=4\r\ndb 340,238\r\ndb 286,257\r\ndb 274,203\r\ndb 311,213\r\n//===========================================","gpuchip/examples/table.txt":"// Author: Drunkie\r\n// Description: Draws a table; useful for calendars or spreadsheets!\r\n\r\nMain();\r\n\r\n#include \r\n\r\nfloat rows = 6;\r\nfloat cols = 5;\r\nfloat sizex = 476;\r\nfloat sizey = 400;\r\nfloat linewidth = 3;\r\n\r\nfloat i, j, day;\r\n\r\nvoid Main()\r\n{\r\n dentrypoint 0,DrawThread; \r\n dentrypoint 4,AsyncThread;\r\n \r\n *regHWClear = 0\r\n *regAsyncFreq = 200000;\r\n *regAsyncClk = 1;\r\n}\r\n\r\nvoid DrawThread()\r\n{\r\n dexit;\r\n}\r\n\r\nvoid AsyncThread()\r\n{\r\n glBegin();\r\n \r\n glClear( 35, 35, 35 ); // Clear screen color\r\n \r\n glColor( 255, 255, 255 ); // Set draw color\r\n glFont( GL_FONT_ARIAL ); // Set font type\r\n glFontSize( 36 ); // Set font size\r\n glWriteString( 16, 6, 'Simple-Calendar 1.0');\r\n \r\n glColor( 120, 120, 120 );\r\n glOffset( 16, 64 ); // Set screen offset\r\n glRectWH( 0, 0, sizex + linewidth, sizey + linewidth); // Draw rectangle\r\n \r\n glFont( GL_FONT_TREBUCHET );\r\n glFontSize( 14 );\r\n \r\n // Calculate rectangle size\r\n float sx = (sizex / rows) - linewidth;\r\n float sy = (sizey / cols) - linewidth;\r\n \r\n // Loop through rows\r\n for (i = 0; i < rows; i++)\r\n {\r\n // Loop through columns\r\n for (j = 0; j < cols; j++)\r\n {\r\n // Calculate x,y coordinate to draw at\r\n float x = i * (sizex / rows);\r\n float y = j * (sizey / cols);\r\n \r\n glColor( 200, 200, 200 ); // Set draw color\r\n glRectWH( x + linewidth, y + linewidth, sx, sy ); // Draw rectangle\r\n \r\n glColor( 0, 0, 0 ); // Set draw color\r\n \r\n // Write integer to screen\r\n day = i + (j * rows)\r\n glWriteInt( x + linewidth + 2, y + linewidth + 2, day + 1 ); \r\n }\r\n }\r\n \r\n glEnd();\r\n}\r\n\r\n\r\n","gpuchip/examples/bounce.txt":"//////////////////////////////////\r\n// BOUNCING BALL GPU EXAMPLE //\r\n//////////////////////////////////\r\ndentrypoint 0,_draw;\t\t// Set draw start entrypoint to \"_draw\"\r\n\t\t\t\t//\r\nrand #ball.x;\t\t\t// Set random ball start point\r\nrand #ball.y;\t\t\t//\r\n\t\t\t\t//\r\ndexit;\t\t\t\t// Exit the initialization routine...\r\n//////////////////////////////////\r\n_draw:\t\t\t\t// Entrypoint for the drawing function\r\n\t\t\t\t//\r\ndcvxpipe 2;\t\t\t// Set coordinate pipe to 2 (to use coordinates 0...1)\r\ndclrscr bg_color;\t\t// Clear screen with background color\r\n\t\t\t\t//\r\ndmuldt eax,#d.x;\t\t// EAX = Direction Vector * Delta (change of coords per frame)\r\nadd #ball.x,eax;\t\t// Move the ball\r\ndmuldt eax,#d.y;\t\t//\r\nadd #ball.y,eax;\t\t//\r\n\t\t\t\t//\r\ncmp #ball.x,0.9;\t\t// Check hits against walls\r\ncge bounce.x;\t\t\t// Call bounce routine...\r\ncmp #ball.x,0.0;\t\t//\r\ncle bounce.x;\t\t\t//\r\n\t\t\t\t//\r\ncmp #ball.y,0.9;\t\t// Bounce on other axis\r\ncge bounce.y;\t\t\t//\r\ncmp #ball.y,0.0;\t\t//\r\ncle bounce.y;\t\t\t//\r\n\t\t\t\t//\r\ndcolor ball_color;\t\t// Set color to color of ball\r\ndrectwh ball,ball_wh;\t\t// Draw the ball\r\n\t\t\t\t//\r\ndsetsize 24;\t\t\t// Set font size\r\ndwrite textpos,text;\r\n\t\t\t\t//\r\ndexit;\t\t\t\t// Exit the draw function\r\n//////////////////////////////////\r\nbounce.x:\t\t\t// Bounce function (change X speed)\r\n neg #d.x; \t\t\t//\r\n min #ball.x,0.9;\t\t//\r\n max #ball.x,0.0;\t\t//\r\nret\t\t\t\t//\r\n\t\t\t\t//\r\nbounce.y:\t\t\t// Bounce function (change Y speed)\r\n neg #d.y;\t\t\t//\r\n min #ball.y,0.9;\t\t//\r\n max #ball.y,0.0;\t\t//\r\nret\t\t\t\t//\r\n//////////////////////////////////\r\n// Data and resources\t\t//\r\n//////////////////////////////////\r\n\t\t\t\t//\r\ncolor ball_color,255,255,255;\t// Ball color (white)\r\ncolor bg_color, 64, 32,128;\t// Background color (neon violet)\r\n\t\t\t\t//\r\nvector2f ball;\t\t\t// Ball position\r\nvector2f ball_wh,0.1,0.1;\t// Ball width/height\r\n\t\t\t\t//\r\nvector2f textpos,0.1,0.1;\t// Text position\r\n\t\t\t\t//\r\nvector2f d,1.0,1.0;\t\t// Movement direction & speed\r\n\t\t\t\t//\r\nstring text,'Bouncing ball!';\t// \"Bouncing ball!\"\r\n//////////////////////////////////","gpuchip/examples/3d_cube.txt":"// Author: Drunkie\r\n// Description: 3D Cube\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glClear( 0, 0, 0 ); // Clear screen\r\n \r\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode \r\n glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation\r\n \r\n glLightPos( 0, 0, -20 ); // Set the light position\r\n glLightColor( 255, 255, 255, 1 ); // Set the light color\r\n\r\n glLookAt(\r\n 0, 0, -5, // Camera pos\r\n 0, 0, 0, // Camera target\r\n 0, 1, 0 // Camera up\r\n ); \r\n\r\n // Create variable to hold curtime\r\n float time;\r\n timer time;\r\n\r\n // Create perspective and matrix transformations\r\n glPerspective( 30, 1, 1, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR\r\n glRotate( 1, 1, 0, time ); // AXIS X, Y, Z, ANGLE W\r\n glTranslate( 0, 0, 0 ); // TRANSLATION X, Y, Z\r\n glScale( 1, 1, 1 ); // SCALE X, Y, Z\r\n\r\n glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer \r\n glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting\r\n\r\n // Solid 3D polygon\r\n glFillMode( GL_FILL_SOLID ); // Set fillmode as solid\r\n glColor4( 100, 149, 237, 180 ); // Set draw color with alpha\r\n glPoly3D( vertexBuffer, 12 ); // Draw 3D polygon \r\n glFlush(); // Flush the vertex buffer to the screen\r\n \r\n // Wireframe 3D polygon\r\n glLineWidth( 1 ); // Set line width\r\n glFillMode( GL_FILL_WIREFRAME ); // Set fillmode as solid\r\n glColor4( 255, 255, 255, 255 ); // Set draw color with alpha\r\n glPoly3D( vertexBuffer, 12 ); // Draw 3D polygon \r\n glFlush(); // Flush the vertex buffer to the screen\r\n \r\n glExit(); // Exit\r\n}\r\n\r\n// The vertex data for our model\r\nvertexBuffer:\r\ndb -1,-1,-1; db 1,-1,-1; db 1,1,-1;\r\ndb -1,-1,-1; db 1,1,-1; db -1,1,-1;\r\ndb 1,-1,1; db -1,-1,1; db 1,1,1;\r\ndb -1,-1,1; db -1,1,1; db 1,1,1;\r\ndb 1,-1,-1; db -1,-1,-1; db 1,-1,1;\r\ndb -1,-1,-1; db -1,-1,1; db 1,-1,1;\r\ndb -1,1,-1; db 1,1,-1; db 1,1,1;\r\ndb -1,1,1; db -1,1,-1; db 1,1,1;\r\ndb -1,-1,-1; db -1,1,-1; db -1,1,1;\r\ndb -1,-1,1; db -1,-1,-1; db -1,1,1;\r\ndb 1,1,-1; db 1,-1,-1; db 1,1,1;\r\ndb 1,-1,-1; db 1,-1,1; db 1,1,1;\r\n","gpuchip/examples/3d_tunnel.txt":"// Author: Drunkie\r\n// Description: Draws a never ending tunnel in 3D!\r\n\r\nMain();\r\n\r\n#include \r\n\r\nvoid Main()\r\n{\r\n glSleep( 60 ); // Sleep for 60 milliseconds (reduces fps lag)\r\n glClear( 0, 0, 0 ); // Clear screen\r\n \r\n glCoordPipe( GL_CPIPE_N1_1 ); // Set coordinate pipe to [-1 to 1] mode \r\n glVertexPipe( GL_VPIPE_XYZTRANSFORM ); // Set vertex pipe to xyz transformation\r\n\r\n glLightPos( -1, -1, -1 ); // Set the light position\r\n glLightColor( 255, 255, 255, 1.25 ); // Set the light color\r\n\r\n glLookAt(\r\n 0, 0, -25, // Camera pos\r\n 0, 0, 0, // Camera target\r\n 0, 1, 0 // Camera up\r\n ); \r\n\r\n // Loop and draw 4 models\r\n for (i = 0; i < 4; i++)\r\n {\r\n // Set translations for each model\r\n timer zTranslate;\r\n zTranslate *= -16;\r\n mod zTranslate,16;\r\n zTranslate += (i * 16);\r\n \r\n // Create perspective and matrix transformations\r\n glPerspective( 8, 1, 0.4, 20 ); // FOV, ASPECT RATIO, ZNEAR, ZFAR\r\n glRotate( 0, 0, 0, 0 ); // AXIS X, Y, Z, ANGLE W\r\n glTranslate( 0, 0, zTranslate ); // TRANSLATION X, Y, Z\r\n glScale( 1.2, 1, 8 ); // SCALE X, Y, Z\r\n \r\n glEnable( GL_VERTEX_BUFFER ); // Enable vertex buffer \r\n glEnable( GL_VERTEX_ZSORT ); // Enable Z sorting\r\n glEnable( GL_VERTEX_LIGHTING ); // Enable vertex lighting\r\n glEnable( GL_VERTEX_CULLING ); // Enable face culling\r\n\r\n // Solid 3D polygon\r\n glFillMode( GL_FILL_SOLID ); // Set fillmode as solid\r\n glColor4( 255, 255, 255, 150 ); // Set the draw color with alpha\r\n glPoly3D( VertexBuffer, 12 ); // Draw 3D polygon\r\n glFlush(); // Send our vertex buffer to screen\r\n \r\n // Wireframe 3D polygon\r\n glLineWidth( 1 ); // Set line width of wireframe\r\n glFillMode( GL_FILL_WIREFRAME ); // Set fillmode to wireframe\r\n glColor4( 255, 255, 255, 255 ); // Set the draw color with alpha\r\n glPoly3D( vertexBuffer, 8 ); // Draw 3D polygon\r\n glFlush(); // Send our vertex buffer to screen\r\n }\r\n\r\n glExit(); // Exit\r\n}\r\n\r\nfloat i;\r\nfloat zTranslate;\r\n\r\nvertexBuffer:\r\ndb 1,1,-1; db -1,1,-1; db 1,1,1;\r\ndb -1,1,-1; db -1,1,1; db 1,1,1;\r\ndb 1,1,-1; db 1,1,1; db 1,-1,-1;\r\ndb 1,-1,-1; db 1,1,1; db 1,-1,1;\r\ndb -1,1,-1; db -1,-1,-1; db -1,1,1;\r\ndb -1,-1,-1; db -1,-1,1; db -1,1,1; \r\ndb 1,-1,-1; db 1,-1,1; db -1,-1,-1;\r\ndb -1,-1,-1; db 1,-1,1; db -1,-1,1;\r\n","gpuchip/examples/line_graph.txt":"// Author: Drunkie\r\n// Description: A fake lag-o-meter that plots points on a grid\r\n\r\nMain();\r\n\r\n#include \r\n\r\nfloat i;\r\nfloat x, y;\r\nfloat ox = 0, oy = 256;\r\nfloat lines = 10;\r\nfloat lineWidth = 1\r\nfloat frameWidth = 510;\r\nfloat frameHeight = 300;\r\n\r\nvoid Main()\r\n{\r\n glVertexMode( 1 ); // Enable vertex mode\r\n glColor( 255, 255, 255 ); // Set draw color\r\n \r\n // Set texture as background\r\n glBindTexture( \"phoenix_storms/lag_sign\" );\r\n glClearTexture();\r\n glBindTexture( 0 ); // Discard texture\r\n \r\n glFont( GL_FONT_AKBAR ); // Set font type\r\n glFontSize( 36 ); // Set font size\r\n glWriteString( 2, 2, \"LAG-O-METER\" ); // Write string to screen\r\n \r\n glOffset( lineWidth, 90 ); // Offset the screen coordinates\r\n \r\n glColor4( 0, 0, 0, 160 ); // Set draw color with alpha\r\n glRectWH( 0, 0, frameWidth, frameHeight ); // Draw rectangle\r\n \r\n glColor( 255, 255, 255 ); \r\n glLineWidth( lineWidth ); // Set line width\r\n glORectWH( 0, 0, frameWidth, frameHeight ); // Draw outlined rectangle\r\n \r\n glLineWidth( 1 ); // Set line width to 1\r\n \r\n // Loop and make a bunch of connected lines\r\n for (i = 0; i < lines; i++)\r\n {\r\n if (i == 0) {\r\n ox = 0;\r\n rand oy;\r\n oy *= frameHeight;\r\n }\r\n else {\r\n ox = x; oy = y;\r\n }\r\n x = ((i+1) / lines) * frameWidth;\r\n rand y;\r\n y *= frameHeight;\r\n glLine( ox, oy, x, y ); // Draw line on graph\r\n }\r\n \r\n glOffset( 0, 0 ); // Set screen offset back to 0,0\r\n glWriteString( 2, 400, \"INTENSE LAG DETECTED\" );\r\n \r\n glExit(); // Exit\r\n}\r\n","gpuchip/examples/mt2.txt":"dcvxpipe 3;\r\nmov #regHWClear,0; //Stop hardware clearing\r\ndsetwidth 0.05;\r\n\r\ntimer EAX;\r\nmov EDX,EAX; sub EDX,#PrevTime; //EDX = Delta time\r\nmov #PrevTime,EAX;\r\n\r\nmov EBP,0.4; //Speed of rotation\r\n\r\nmov ECX,8;\r\nDrawLoop:\r\n mov EAX,#Angle; mul EAX,1;\r\n fsin #EndPoint.X,EAX; mul EAX,2;\r\n fcos #EndPoint.Y,EAX;\r\n\r\n //HSL coloring\r\n fsin #HSL.R,EAX; mul #HSL.R,127; add #HSL.R,128; add EAX,1.57;// mul EAX,2;\r\n fsin #HSL.G,EAX; mul #HSL.G,127; add #HSL.G,128; add EAX,1.57;// mul EAX,2;\r\n fsin #HSL.B,EAX; mul #HSL.B,127; add #HSL.B,128;\r\n \r\n dcolor HSL;\r\n\r\n //Looks very nice\r\n dline StartPoint1,EndPoint;\r\n dline StartPoint2,EndPoint;\r\n dline StartPoint3,EndPoint;\r\n dline StartPoint4,EndPoint;\r\n \r\n mul EDX,EBP;\r\n add #Angle,EDX;\r\nloop DrawLoop;\r\n\r\ndexit;\r\n\r\nalloc Angle;\r\nalloc PrevTime;\r\n\r\ncolor HSL;\r\n\r\nvector2f EndPoint,0,0;\r\nvector2f StartPoint0,0,0;\r\nvector2f StartPoint1,1,1;\r\nvector2f StartPoint2,1,-1;\r\nvector2f StartPoint3,-1,-1;\r\nvector2f StartPoint4,-1,1;\r\n","gpuchip/examples/mt3.txt":"//== 3D Graphics begin here ====================================================\r\n dvxpipe 3;\r\n dcvxpipe 3;\r\n\r\n //Calc depth here\r\n mov #Background.MinDepth, 0.8; //Near distance\r\n mov #Background.MaxDepth, 6.0; //Far distance\r\n mov #Background.ShadeStart,1.0;\r\n mov #Background.DepthStep ,0.3; //Depth step. The lower, the higher quality is\r\n\r\n timer #Time; mul #Time,3;\r\n\r\n mov EAX,#Time; mod EAX,#Background.DepthStep;\r\n\r\n sub #Background.MinDepth,EAX;\r\n sub #Background.MaxDepth,EAX;\r\n\r\n //Initialize depth range\r\n mov #Background.deltaDepth,#Background.MaxDepth;\r\n sub #Background.deltaDepth,#Background.MinDepth;\r\n\r\n //Compute background stuff\r\n mov #Background.ShadeStep,#Background.deltaDepth;\r\n div #Background.ShadeStep,#Background.DepthStep;\r\n frnd #Background.ShadeStep;\r\n finv #Background.ShadeStep;\r\n mul #Background.ShadeStep,#Background.ShadeStepMul;\r\n\r\n //Brightness too\r\n mov EAX,#Time; mod EAX,#Background.ShadeStep;\r\n sub #Background.ShadeStart,EAX;\r\n\r\n mov #_rect.color.r,200;\r\n mov #_rect.color.b,200;\r\n\r\n// Uncomment this for trippy camera\r\n// timer EAX; div EAX,8; fsin EBX,EAX; mul EBX,2;\r\n// drotatescale EAX,EBX; mul EBX,2;\r\n\r\n dsetwidth 0.8;\r\n call Draw.Background; \r\ndexit;\r\n\r\nalloc Time;\r\n\r\n//==============================================================================\r\nDraw.Background:\r\n //Draw all the rectangles\r\n mov EAX,#Background.MinDepth; mov ECX,#Background.ShadeStart;\r\n BackgroundLoop:\r\n mov EDX,#Time; add EDX,EAX; \r\n mov EBP,#Time; div EBP,6.28; fcos EBP,EBP;\r\n\r\n fsin EDI,EDX; mul EDI,EBP; mul EDI,0.8; sub EDI,1;\r\n mov #_rect.offset.x,EDI;\r\n\r\n fcos ESI,EDX; mul ESI,EBP; mul ESI,0.4; sub ESI,1;\r\n mov #_rect.offset.y,ESI;\r\n\r\n mov EDX,ECX; fpwr EDX,2;\r\n mov #regZOffset,EAX;\r\n \r\n dcolor _rect.color; \r\n// Uncomment this for trippy HSL color\r\n// mov ESI,#Time; add ESI,EAX;\r\n// fsin #HSL.R,ESI; mul #HSL.R,127; add #HSL.R,128; add ESI,1.57;// mul EAX,2;\r\n// fsin #HSL.G,ESI; mul #HSL.G,127; add #HSL.G,128; add ESI,1.57;// mul EAX,2;\r\n// fsin #HSL.B,ESI; mul #HSL.B,127; add #HSL.B,128;\r\n//\r\n// dcolor HSL;\r\n dshade EDX;\r\n dorectwh _rect.offset,_rect.wh;\r\n\r\n sub ECX,#Background.ShadeStep;\r\n add EAX,#Background.DepthStep;\r\n\r\n cmp EAX,#Background.MaxDepth;\r\n jl BackgroundLoop;\r\nret\r\n\r\n//==============================================================================\r\n//Drawing parameters\r\nscalar Background.MinDepth;\r\nscalar Background.MaxDepth;\r\nscalar Background.deltaDepth;\r\nscalar Background.DepthStep;\r\nscalar Background.ShadeStart;\r\nscalar Background.ShadeStep;\r\nscalar Background.ShadeStepMul,0.5;\r\n\r\ncolor HSL;\r\n\r\n//Generic rectangle\r\nvector2f _rect.offset,-1,-1;\r\nvector2f _rect.wh,2,2;\r\n\r\nvector2f _pad1.offset;\r\nvector2f _pad2.offset;\r\nvector2f _pad.wh;\r\n\r\n//Color scheme\r\ncolor _rect.color, 200,200,200;\r\ncolor _rect.color2,200,200,000;\r\n\r\ncolor _pad1.color, 000,200,000;\r\ncolor _pad2.color, 200,000,000;\r\n","gpuchip/examples/hud_engine.txt":"//mov #65522,1;\r\n//mov #65525,0.66;\r\n//port0 & port1 - engine left/right throttle (0..1)\r\n//port2 & port3 - delta (not used)\r\n\r\n//This displays engine window in PhoenixWings airplane\r\n\r\nmov #65485,16; //set circle quality\r\n\r\ndclrscr hud_border;\r\n\r\ndcolor hud_text;\r\ndcircle hud_engine1gauge,68;\r\ndcircle hud_engine2gauge,68;\r\ndcolor hud_border;\r\ndcircle hud_engine1gauge,64;\r\ndcircle hud_engine2gauge,64;\r\n\r\ndcolor hud_text;\r\ndsetwidth 1;\r\ndline hud_engine1gauge_start,hud_engine1gauge;\r\ndline hud_engine2gauge_start,hud_engine2gauge;\r\n\r\ndsetwidth 2;\r\n\r\n//===\r\nmov eax,port0; mul eax,100;\r\nmul eax,0.1;\r\nmul #left_power,1.9;\r\nadd #left_power,eax;\r\ndiv #left_power,2;\r\n\r\nmov eax,#left_power; div eax,100;\r\nmul eax,6.00;\r\nadd eax,1.57;\r\n\r\ndrotatescale eax,1;\r\ndmove hud_engine1gauge;\r\n\r\ndline gauge_base,gauge_needle;\r\n//==\r\nmov #right_power,#left_power; //comment this and..\r\n//uncomment if your left/right engines are not synchronized\r\n//mov eax,port1; mul eax,100;\r\n//mul eax,0.1;\r\n//mul #right_power,1.9;\r\n//add #right_power,eax;\r\n//div #right_power,2;\r\n\r\n//mov eax,#right_power; div eax,100;\r\n//mul eax,6.00;\r\n//add eax,1.57;\r\n\r\ndrotatescale eax,1;\r\ndmove hud_engine2gauge;\r\n\r\ndline gauge_base,gauge_needle;\r\n//==\r\n\r\n//use this for whatever you wanna\r\n//mov #left_delta,port2; sub #left_delta,7.6; mul #left_delta,10;\r\n//mov #right_delta,port3; sub #right_delta,7.6; mul #right_delta,10;\r\n\r\ndrotatescale 0,1; //reset!\r\ndmove 0;\r\n\r\ndsetfont 4;\r\ndsetsize 28;\r\ndwritefmt hud_text1pos,hud_text1;\r\ndwritefmt hud_text2pos,hud_text2;\r\n\r\ncmp port4,1;\r\ndcolor hud_yellow;\r\nje _nsh;\r\n dshade 0.25;\r\n_nsh:\r\ndwrite hud_text3pos,hud_text3;\r\ndexit;\r\n\r\nvector2f hud_text1pos,70,212;\r\nvector2f hud_text2pos,310,212;\r\nvector2f hud_text3pos,20,460;\r\n\r\nstring hud_text1,'Left Engine',10,10,'N1 = %i%%',10,'Delta = %i%%';\r\nalloc left_power; alloc left_delta;\r\nstring hud_text2,'Right Engine',10,10,'N1 = %i%%',10,'Delta = %i%%';\r\nalloc right_power; alloc right_delta;\r\nstring hud_text3,'';\r\n\r\nvector2f hud_engine1gauge,128,128;\r\nvector2f hud_engine1gauge_start,128,64;\r\n\r\nvector2f hud_engine2gauge,384,128;\r\nvector2f hud_engine2gauge_start,384,64;\r\n\r\nvector2f gauge_base,0,0;\r\nvector2f gauge_needle,0,-48;\r\n\r\ncolor hud_text,64,255,64;\r\ncolor hud_yellow,255,255,64;\r\ncolor hud_border,30,30,30;\r\n","gpuchip/examples/plasma.txt":"//Plasma fractals\r\n//Converted by dlb from http://bocoup.com/processing-js/docs/index.php?page=Plasma%20Fractals\r\n//Which was converted by F1LT3R @ Hyper-Metrix.com from original at http://www.ic.sunysb.edu/Stu/jseyster/plasma/\r\n\r\nmov #regHWClear,0; //Stop GPU clearing itself\r\n\r\ndentrypoint 0,_draw; //Set the entry point for the draw loop\r\ndentrypoint 4,_async; //Set the enty point for the async loop\r\n\r\nmov #regAsyncFreq,2000000; //Make async run as fast as it can\r\nmov #regAsyncClk,1; //Start async\r\n\r\ndexit; //End init\r\n_draw: //Start draw\r\ndexit; //End draw\r\n\r\n//Setup variables\r\ncolor col;\r\nvec2f pos;\r\nvec2f size;\r\nfloat gridSize, edge1, edge2, edge3, edge4, midPoint, newWidth, newHeight, width, height, noise;\r\n\r\n_async: //Enter async\r\n\r\nmain(); //Run main function\r\n\r\nwhile(1){idle} //Infinatly loop\r\n\r\nvoid main(){ //Main function\r\n dsetbuf_spr; //Use sprite buffer\r\n \r\n setColor(255,255,255); //Set the colour to white\r\n rect(0,0,512,512); //Draw a large rectangle\r\n\r\n gridSize = 4; //How big each rectangle will be\r\n width = 512; //GPU Width\r\n height = 512; //GPU Height\r\n noise = 5; //How noisy it will be\r\n \r\n //Give initial corner values\r\n R1 = random(1);\r\n R2 = random(1);\r\n R3 = random(1);\r\n R4 = random(1);\r\n \r\n plasma(0,0,width,height,R1,R2,R3,R4) //Start recursive function\r\n}\r\n\r\nvoid plasma(float x, y, width, height, c1, c2, c3, c4){ //Plasma function\r\n \r\n //Setup local variables\r\n float edge1, edge2, edge3, edge4, midPoint;\r\n \r\n //Work out the size of the next segments\r\n float newWidth = width / 2;\r\n float newHeight = height / 2;\r\n \r\n if((width > gridSize)||(height > gridSize)){ //If it is still bigger than the rectangle size\r\n \r\n midPoint = (c1 + c2 + c3 + c4) / 4 + displace(newWidth + newHeight); //Randomly change the midpoint\r\n \r\n //Calculate edges by averaging the corners\r\n edge1 = (c1 + c2) / 2; \r\n edge2 = (c2 + c3) / 2; \r\n edge3 = (c3 + c4) / 2; \r\n edge4 = (c4 + c1) / 2; \r\n \r\n //Make sure it doesn't displace too far\r\n max midPoint,0;\r\n min midPoint,1;\r\n \r\n //Run on the newly calculated segments\r\n plasma(x, y, newWidth, newHeight, c1, edge1, midPoint, edge4);\r\n plasma(x + newWidth, y, newWidth, newHeight, edge1, c2, edge2, midPoint); \r\n plasma(x + newWidth, y + newHeight, newWidth, newHeight, midPoint, edge2, c3, edge3); \r\n plasma(x, y + newHeight, newWidth, newHeight, edge4, midPoint, edge3, c4);\r\n }else{ //Woo! It's the right size\r\n float c = (c1 + c2 + c3 + c4) / 4; //Average the corners\r\n \r\n float grey = c*255; //Multiply the corners by 255 to get a valid color\r\n \r\n setColor(grey,grey,grey); //Set the color to your new color based on the \"height\"\r\n rect(x,y,gridSize,gridSize); //Draw your rectangle\r\n }\r\n}\r\n\r\nfloat displace(float num){ //Displace function, it just works\r\n float m = num / (width + height) * (1/noise); \r\n R1 = random(1); \r\n return (R1-0.5) * m; \r\n}\r\n\r\nfloat random(float x){ //C version of the ASM rand opcode\r\n preserve EAX;\r\n rand EAX;\r\n return EAX*x;\r\n}\r\n\r\nvoid setColor(float r,float g,float b){ //C version of the dcolor opcode\r\n mov #col.r,r;\r\n mov #col.g,g;\r\n mov #col.b,b;\r\n \r\n dcolor col;\r\n}\r\n\r\nvoid rect(float x, float y, float width, float height){ //C version of the drectwh opcode\r\n mov #pos.x,x;\r\n mov #pos.y,y;\r\n \r\n mov #size.x,width;\r\n mov #size.y,height;\r\n \r\n drectwh pos, size;\r\n dswap; //dswap to make it show since we're drawing to the sprite buffer\r\n}"},"gpuchip/lib/":{"gpuchip/lib/drivers/":{"gpuchip/lib/drivers/drv_gl.txt":"// [Author] - Drunkie\r\n// [Description] - A graphics driver that provides C-style functions for GPU\r\n// [Documentation] - http://goo.gl/DHhYb\r\n\r\n\r\n#define GL\r\n\r\n// Font\r\n#define GL_FONT_LUCIDA_CONSOLE 0\r\n#define GL_FONT_COURIER_NEW 1\r\n#define GL_FONT_TREBUCHET 2\r\n#define GL_FONT_ARIAL 3\r\n#define GL_FONT_TIMES_NEW_ROMAN 4\r\n#define GL_FONT_COOLVETICA 5\r\n#define GL_FONT_AKBAR 6\r\n#define GL_FONT_CSD 7\r\n\r\n// Buffer\r\n#define GL_BUFFER_FRONT 0\r\n#define GL_BUFFER_BACK 1\r\n#define GL_BUFFER_SPRITE 1\r\n#define GL_BUFFER_VERTEX 2\r\n\r\n// Coordinate pipe\r\n#define GL_CPIPE_DIRECT 0\r\n#define GL_CPIPE_RESOLUTION 1\r\n#define GL_CPIPE_0_1 2\r\n#define GL_CPIPE_N1_1 3\r\n#define GL_CPIPE_N256_256 4\r\n\r\n// Vertex pipe\r\n#define GL_VPIPE_XY 0\r\n#define GL_VPIPE_YZ 1\r\n#define GL_VPIPE_XZ 2\r\n#define GL_VPIPE_XYZPROJ 3\r\n#define GL_VPIPE_XYTRANSFORM 4\r\n#define GL_VPIPE_XYZTRANSFORM 5\r\n\r\n// denable / ddisable\r\n#define GL_VERTEX_BUFFER 0\r\n#define GL_VERTEX_ZSORT 1\r\n#define GL_VERTEX_LIGHTING 2\r\n#define GL_VERTEX_CULLING 3\r\n#define GL_VERTEX_DCULLING 4\r\n#define GL_VERTEX_TEXTURING 5\r\n\r\n// Fillmode\r\n#define GL_FILL_SOLID 0\r\n#define GL_FILL_WIREFRAME 1\r\n#define GL_FILL_TEXTURE 2\r\n\r\n// Cullmode\r\n#define GL_CULL_FRONT 0\r\n#define GL_CULL_BACK 1\r\n\r\n// Lightmode\r\n#define GL_LIGHT_FRONT 1\r\n#define GL_LIGHT_BACK -1\r\n\r\n// Horizontal font\r\n#define GL_ALIGN_LEFT 0\r\n#define GL_ALIGN_CENTER 1\r\n#define GL_ALIGN_RIGHT 2\r\n\r\n// Vertical font\r\n#define GL_VALIGN_TOP 0\r\n#define GL_VALIGN_MIDDLE 1\r\n#define GL_VALIGN_BOTTOM 2\r\n\r\n// Compatibility\r\n#define glSetTexture glBindTexture\r\n#define glWriteFmt glWriteFormat\r\n#define glFontHAlign glFontAlign\r\n\r\n\r\n// Clear\r\nvoid glClear( float r, float g, float b ) {\r\n mov #GL_BG.r,r; mov #GL_BG.g,g; mov #GL_BG.b,b; mov #GL_BG.a,255;\r\n dclrscr GL_BG;\r\n}\r\nvoid glClear4( float r, float g, float b, float a ) {\r\n mov #GL_BG.r,r; mov #GL_BG.g,g; mov #GL_BG.b,b; mov #GL_BG.a,a;\r\n dclrscr GL_BG;\r\n}\r\nvoid glClearTexture() {\r\n dclrtex;\r\n}\r\nvoid glHWClear( float n ) {\r\n mov #regHWClear,n;\r\n}\r\n\r\n// Color\r\nvoid glColor( float r, float g, float b ) {\r\n mov #GL_FG.r,r; mov #GL_FG.g,g; mov #GL_FG.b,b; mov #GL_FG.a,255;\r\n dcolor GL_FG;\r\n}\r\nvoid glColor4( float r, float g, float b, float a ) {\r\n mov #GL_FG.r,r; mov #GL_FG.g,g; mov #GL_FG.b,b; mov #GL_FG.a,a;\r\n dcolor GL_FG;\r\n}\r\nvoid glBrightness( float r, float g, float b, float a ) {\r\n mov #regBrightnessR,r;\r\n mov #regBrightnessG,g;\r\n mov #regBrightnessB,b;\r\n mov #regBrightnessW,a;\r\n}\r\nvoid glContrast( float r, float g, float b, float a ) {\r\n mov #regContrastR,r;\r\n mov #regContrastG,g;\r\n mov #regContrastB,b;\r\n mov #regContrastW,a;\r\n}\r\nvoid glShade( float n ) {\r\n dshade n;\r\n}\r\nvoid glShadeNorm( float n ) {\r\n dshadenorm n;\r\n}\r\n\r\n// Texture\r\nvoid glBindTexture( char* str ) {\r\n dxtexture str;\r\n}\r\nvoid glTexture( float id ) {\r\n dtexture id;\r\n}\r\nvoid glTextureSize( float n ) {\r\n mov #regTexSize,n;\r\n}\r\nvoid glTextureDataPtr( float n ) {\r\n mov #regTexDataPtr,n;\r\n}\r\nvoid glTextureDataSize( float n ) {\r\n mov #regTexDataSz,n;\r\n}\r\nvoid glTextureRotation( float n ) {\r\n mov #regTexRotation,n;\r\n}\r\nvoid glTextureScale( float n ) {\r\n mov #regTexScale,n;\r\n}\r\nvoid glTextureCenterUV( float u, float v ) {\r\n mov #regTexCenterU,u;\r\n mov #regTexCenterV,v;\r\n}\r\nvoid glTextureOffsetUV( float u, float v ) {\r\n mov #regTexOffsetU,u;\r\n mov #regTexOffsetV,v;\r\n}\r\n\r\n// Frame\r\nvoid glSleep( float ms ) {\r\n div ms,1000;\r\n timer #GL_CURTIME; \r\n sub #GL_CURTIME,#GL_TIMESTAMP;\r\n if (*GL_CURTIME <= ms) {\r\n mov #regHWClear,0;\r\n dexit;\r\n }\r\n timer #GL_TIMESTAMP; \r\n}\r\nvoid glExit() {\r\n dexit;\r\n}\r\n\r\n// Pipeline\r\nvoid glCoordPipe( float c ) {\r\n dcpipe c;\r\n}\r\nvoid glVertexPipe( float v ) {\r\n dvxpipe v;\r\n}\r\n\r\n// Hardware\r\nvoid glReset( float n ) {\r\n mov #regReset,n;\r\n}\r\nvoid glHalt( float n ) {\r\n mov #regHalt,n;\r\n}\r\nvoid glRAMReset( float n ) {\r\n mov #regRAMReset,n;\r\n}\r\nvoid glHScale( float n ) {\r\n mov #regHScale,n;\r\n}\r\nvoid glVScale( float n ) {\r\n mov #regVScale,n;\r\n}\r\nvoid glHWScale( float n ) {\r\n mov #regHWScale,n;\r\n}\r\nvoid glHWRotate( float n ) {\r\n mov #regRotation,n;\r\n}\r\n\r\n// Offset\r\nvoid glOffset( float x, float y ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dmove GL_V1;\r\n}\r\nfloat glOffsetX() {\r\n preserve eax;\r\n mov eax,#regOffsetX;\r\n}\r\nfloat glOffsetY() {\r\n preserve eax;\r\n mov eax,#regOffsetY;\r\n}\r\nvoid glCenter( float x, float y ) {\r\n mov #regCenterX,x;\r\n mov #regCenterY,y;\r\n}\r\n\r\n// Async\r\nvoid glAsyncReset( float n ) {\r\n mov #regAsyncReset,n;\r\n}\r\nvoid glAsyncClk( float n ) {\r\n mov #regAsyncClk,n;\r\n}\r\nvoid glAsyncFreq( float n ) {\r\n mov #regAsyncFreq,n;\r\n}\r\nvoid glEntryPoint( float idx, float ptr ) {\r\n dentrypoint idx,ptr;\r\n}\r\nvoid glBegin() {\r\n dbegin;\r\n}\r\nvoid glEnd() {\r\n dend;\r\n}\r\nvoid glSwap() {\r\n dswap;\r\n}\r\nvoid glSync() {\r\n dvsync;\r\n}\r\n\r\n// Cursor\r\nvoid glCursor( float n ) {\r\n mov #regCursor,n;\r\n}\r\nfloat glCursorX() {\r\n preserve eax;\r\n mov eax,#regCursorX;\r\n}\r\nfloat glCursorY() {\r\n preserve eax;\r\n mov eax,#regCursorY;\r\n}\r\n\r\n// Circle\r\nvoid glCircleQuality( float n ) {\r\n mov #regCircleQuality,n;\r\n}\r\nvoid glCircleStart( float n ) {\r\n mov #regCircleStart,n;\r\n}\r\nvoid glCircleEnd( float n ) {\r\n mov #regCircleEnd,n;\r\n}\r\n\r\n// Screen scaling\r\nvoid glScreenScale( float n ) {\r\n mov #regScale,n;\r\n}\r\nvoid glScreenScaleX( float x ) {\r\n mov #regScaleX,x;\r\n}\r\nvoid glScreenScaleY( float y ) {\r\n mov #regScaleY,y;\r\n}\r\n\r\n// 2D graphics\r\nvoid glCircle( float x, float y, float radius ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dcircle GL_V1,radius;\r\n}\r\nvoid glRect( float x, float y, float dx, float dy ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n mov #GL_V2.x,dx; mov #GL_V2.y,dy;\r\n drect GL_V1,GL_V2;\r\n}\r\nvoid glRectWH( float x, float y, float w, float h ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n mov #GL_V2.x,w; mov #GL_V2.y,h;\r\n drectwh GL_V1,GL_V2;\r\n}\r\nvoid glORect( float x, float y, float dx, float dy ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n mov #GL_V2.x,dx; mov #GL_V2.y,dy;\r\n dorect GL_V1,GL_V2;\r\n}\r\nvoid glORectWH( float x, float y, float w, float h ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n mov #GL_V2.x,w; mov #GL_V2.y,h;\r\n dorectwh GL_V1,GL_V2;\r\n}\r\nvoid glPixel( float x, float y ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dpixel GL_V1,GL_FG;\r\n}\r\nvoid glLine( float x, float y, float dx, float dy ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n mov #GL_V2.x,dx; mov #GL_V2.y,dy;\r\n dline GL_V1,GL_V2;\r\n}\r\nvoid glLineWidth( float w ) {\r\n dsetwidth w;\r\n}\r\nvoid glPoly2D( float* buffer, float count ) {\r\n dvxdata_2f buffer,count;\r\n}\r\n\r\n\r\n// Text\r\nvoid glFont( float id ) {\r\n dsetfont id;\r\n}\r\nvoid glFontAlign( float n ) {\r\n mov #regFontHalign,n;\r\n}\r\nvoid glFontVAlign( float n ) {\r\n mov #regFontValign,n;\r\n}\r\nvoid glFontSize( float n ) {\r\n dsetsize n;\r\n}\r\nfloat glTextWidth( char* str ) {\r\n preserve eax;\r\n dtextwidth eax,str;\r\n}\r\nfloat glTextHeight( char* str ) {\r\n preserve eax;\r\n dtextheight eax,str;\r\n}\r\nvoid glWriteString( float x, float y, char* str ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dwrite GL_V1,str;\r\n}\r\nvoid glWriteFloat( float x, float y, float n ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dwritef GL_V1,n;\r\n}\r\nvoid glWriteInt( float x, float y, float n ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dwritei GL_V1,n;\r\n}\r\nvoid glWriteFormat( float x, float y, char* str ) {\r\n mov #GL_V1.x,x; mov #GL_V1.y,y;\r\n dwritefmt GL_V1,str;\r\n}\r\nfloat glParamList() {\r\n preserve eax;\r\n mov eax,#regParamList;\r\n}\r\n\r\n\r\n// 3D graphics\r\nvoid glPoly3D( float* buffer, float count ) {\r\n \r\n if (*GL_MUPDATE == 1) {\r\n mov #GL_MUPDATE,0;\r\n mrotate GL_MROTATEMATRIX,GL_VROTATE;\r\n mtranslate GL_MTRANSLATEMATRIX,GL_VTRANSLATE;\r\n mscale GL_MSCALEMATRIX,GL_VSCALE;\r\n mmov GL_MMODELMATRIX,GL_MTRANSLATEMATRIX;\r\n mmul GL_MMODELMATRIX,GL_MROTATEMATRIX;\r\n mmul GL_MMODELMATRIX,GL_MSCALEMATRIX;\r\n mmov GL_MMODELVIEWMATRIX,GL_MVIEWMATRIX;\r\n mmul GL_MMODELVIEWMATRIX,GL_MMODELMATRIX;\r\n mload GL_MMODELVIEWMATRIX; \r\n mloadproj GL_MPROJECTIONMATRIX;\r\n }\r\n \r\n if (*GL_FILLMODE == GL_FILL_SOLID) {\r\n dvxdata_3f buffer,count;\r\n }\r\n else if (*GL_FILLMODE == GL_FILL_WIREFRAME) {\r\n dvxdata_3f_wf buffer,count;\r\n }\r\n else if (*GL_FILLMODE == GL_FILL_TEXTURE) {\r\n dvxdata_3f_tex buffer,count\r\n }\r\n}\r\nvoid glFlush() {\r\n dvxflush;\r\n}\r\nvoid glEnable( float n ) {\r\n denable n;\r\n}\r\nvoid glDisable( float n ) {\r\n ddisable n;\r\n}\r\nvoid glLightPos( float x, float y, float z ) {\r\n mov #GL_LIGHTPOS.x,x; mov #GL_LIGHTPOS.y,y; mov #GL_LIGHTPOS.z,z;\r\n dsetlight 0,GL_LIGHTDATA;\r\n}\r\nvoid glLightColor( float r, float g, float b, float a ) {\r\n mov #GL_LIGHTCOL.r,r; mov #GL_LIGHTCOL.g,g;\r\n mov #GL_LIGHTCOL.b,b; mov #GL_LIGHTCOL.a,a;\r\n dsetlight 0,GL_LIGHTDATA;\r\n}\r\nvoid glFillMode( float n ) {\r\n mov #GL_FILLMODE,n;\r\n}\r\nvoid glLookAt( float x, float y, float z, float tx, float ty, float tz, float ux, float uy, float uz ) {\r\n mov #GL_VLOOKAT_POS.x,x; mov #GL_VLOOKAT_POS.y,y; mov #GL_VLOOKAT_POS.z,z;\r\n mov #GL_VLOOKAT_TARG.x,tx; mov #GL_VLOOKAT_TARG.y,ty; mov #GL_VLOOKAT_TARG.z,tz;\r\n mov #GL_VLOOKAT_UP.x,ux; mov #GL_VLOOKAT_UP.y,uy; mov #GL_VLOOKAT_UP.z,uz;\r\n mlookat GL_MVIEWMATRIX,GL_VLOOKAT;\r\n mov #GL_MUPDATE,1;\r\n}\r\nvoid glPerspective( float fov, float asp, float znear, float zfar ) {\r\n mov #GL_VPERSPECTIVE.x,fov; mov #GL_VPERSPECTIVE.y,asp;\r\n mov #GL_VPERSPECTIVE.z,znear; mov #GL_VPERSPECTIVE.w,zfar;\r\n mperspective GL_MPROJECTIONMATRIX,GL_VPERSPECTIVE;\r\n mov #GL_MUPDATE,1;\r\n}\r\nvoid glRotate( float x, float y, float z, float w ) {\r\n mov #GL_VROTATE.x,x; mov #GL_VROTATE.y,y; mov #GL_VROTATE.z,z; mov #GL_VROTATE.w,w; \r\n mov #GL_MUPDATE,1;\r\n}\r\nvoid glTranslate( float x, float y, float z ) {\r\n mov #GL_VTRANSLATE.x,x; mov #GL_VTRANSLATE.y,y; mov #GL_VTRANSLATE.z,z;\r\n mov #GL_MUPDATE,1;\r\n}\r\nvoid glScale( float x, float y, float z ) {\r\n mov #GL_VSCALE.x,x; mov #GL_VSCALE.y,y; mov #GL_VSCALE.z,z;\r\n mov #GL_MUPDATE,1;\r\n}\r\nvoid glZOffset( float n ) {\r\n mov #regZOffset,n;\r\n}\r\nvoid glCullDistance( float n ) {\r\n mov #regCullDistance,n;\r\n}\r\nvoid glCullMode( float n ) {\r\n mov #regCullMode,n;\r\n}\r\nvoid glLightMode( float n ) {\r\n mov #regLightMode,n;\r\n}\r\nvoid glVertexArray( float n ) {\r\n mov #regVertexArray,n;\r\n}\r\n\r\n// Other\r\nvoid glVertexMode( float n ) {\r\n mov #regVertexMode,n;\r\n}\r\nvoid glSetRenderTarget( float n ) {\r\n if (n == GL_BUFFER_FRONT) {\r\n dsetbuf_fbo;\r\n }\r\n else if (n == GL_BUFFER_BACK) {\r\n dsetbuf_spr;\r\n }\r\n else if (n == GL_BUFFER_VERTEX) {\r\n dsetbuf_vx;\r\n }\r\n}\r\nfloat glIndex() {\r\n preserve eax;\r\n mov eax,#regIndex;\r\n}\r\n\r\n\r\n// Allocated variables for GL\r\ncolor GL_FG,255,255,255;\r\ncolor GL_BG;\r\nvec4f GL_V1;\r\nvec4f GL_V2;\r\n\r\nalloc GL_TIMESTAMP;\r\nalloc GL_CURTIME;\r\nalloc GL_FILLMODE;\r\n\r\nGL_LIGHTDATA:\r\nvec4f GL_LIGHTPOS,0,0,-10;\r\ncolor GL_LIGHTCOL,255,255,255,1;\r\n\r\nGL_VLOOKAT:\r\nvec3f GL_VLOOKAT_POS,0,0,-10;\r\nvec3f GL_VLOOKAT_TARG,0,0,0;\r\nvec3f GL_VLOOKAT_UP,0,1,0;\r\n\r\nmatrix GL_MROTATEMATRIX;\r\nmatrix GL_MTRANSLATEMATRIX;\r\nmatrix GL_MSCALEMATRIX;\r\nmatrix GL_MPROJECTIONMATRIX;\r\nmatrix GL_MVIEWMATRIX;\r\nmatrix GL_MMODELMATRIX;\r\nmatrix GL_MMODELVIEWMATRIX;\r\nalloc GL_MUPDATE,1;\r\n\r\nvec4f GL_VROTATE;\r\nvec4f GL_VTRANSLATE;\r\nvec4f GL_VPERSPECTIVE;\r\nvec4f GL_VSCALE,1,1,1,0;\r\n\r\n\r\n","gpuchip/lib/drivers/drv_gl_toolkit.txt":"#ifndef GL\r\n#include \r\n#endif\r\n\r\n#ifndef GLT\r\n\r\n#define GLT\r\n#define GLT_MAX_TRIANGLES 32\r\n\r\nfloat __GLT_VERTBUFF[(GLT_MAX_TRIANGLES * 3) * 3];\r\nfloat __GLT_VERTCNT = 0;\r\n\r\nvoid gltVertex(float x, float y, float z)\r\n{\r\n if ((__GLT_VERTCNT / 3) >= GLT_MAX_TRIANGLES)\r\n \treturn;\r\n \r\n float* ptr = __GLT_VERTBUFF;\r\n ptr += (__GLT_VERTCNT * 3);\r\n \r\n *ptr = x;\r\n *(++ptr) = y;\r\n *(++ptr) = z;\r\n \r\n __GLT_VERTCNT++;\r\n}\r\n\r\nvoid gltTriangle(float x1, float y1, float z1,\r\n float x2, float y2, float z2,\r\n float x3, float y3, float z3)\r\n{\r\n gltVertex(x1, y1, z1);\r\n gltVertex(x2, y2, z2);\r\n gltVertex(x3, y3, z3);\r\n}\r\n\r\nvoid gltQuad(float tlx, float tly, float tlz,\r\n float trx, float try, float trz,\r\n float brx, float bry, float brz,\r\n float blx, float bly, float blz)\r\n{\r\n gltTriangle(\r\n trx, try, trz,\r\n tlx, tly, tlz,\r\n blx, bly, blz\r\n );\r\n \r\n gltTriangle(\r\n brx, bry, brz,\r\n trx, try, trz,\r\n blx, bly, blz\r\n );\r\n}\r\n\r\nvoid gltCube(float cex, float cey, float cez, float size)\r\n{\r\n float s2 = size / 2;\r\n \r\n gltQuad(\r\n cex - s2, cey + s2, cez - s2,\r\n cex + s2, cey + s2, cez - s2,\r\n cex + s2, cey - s2, cez - s2,\r\n cex - s2, cey - s2, cez - s2\r\n );\r\n \r\n gltQuad(\r\n cex + s2, cey + s2, cez + s2,\r\n cex - s2, cey + s2, cez + s2,\r\n cex - s2, cey - s2, cez + s2,\r\n cex + s2, cey - s2, cez + s2\r\n );\r\n \r\n gltQuad(\r\n cex - s2, cey + s2, cez + s2,\r\n cex - s2, cey + s2, cez - s2,\r\n cex - s2, cey - s2, cez - s2,\r\n cex - s2, cey - s2, cez + s2\r\n );\r\n \r\n gltQuad(\r\n cex + s2, cey + s2, cez - s2,\r\n cex + s2, cey + s2, cez + s2,\r\n cex + s2, cey - s2, cez + s2,\r\n cex + s2, cey - s2, cez - s2\r\n );\r\n \r\n gltQuad(\r\n cex - s2, cey + s2, cez + s2,\r\n cex + s2, cey + s2, cez + s2,\r\n cex + s2, cey + s2, cez - s2,\r\n cex - s2, cey + s2, cez - s2\r\n );\r\n \r\n gltQuad(\r\n cex - s2, cey - s2, cez - s2,\r\n cex + s2, cey - s2, cez - s2,\r\n cex + s2, cey - s2, cez + s2,\r\n cex - s2, cey - s2, cez + s2\r\n );\r\n}\r\n\r\nvoid gltClearBuffer()\r\n{\r\n __GLT_VERTCNT = 0;\r\n}\r\n\r\nvoid gltFlushBuffer()\r\n{\r\n if (__GLT_VERTCNT <= 3)\r\n return;\r\n \r\n float vcnt = __GLT_VERTCNT;\r\n float tcnt = (vcnt / 3) - (vcnt % 3);\r\n \r\n if (tcnt > GLT_MAX_TRIANGLES)\r\n tcnt = GLT_MAX_TRIANGLES;\r\n \r\n glPoly3D(__GLT_VERTBUFF, tcnt);\r\n glFlush();\r\n}\r\n\r\n#endif\r\n"}}},"spuchip/examples/":{"spuchip/examples/mario_theme.txt":"// Author: Jasongamer\r\n// Song: Mario Underwater Theme\r\n\r\n// Set track wave to channel 0 and start\r\nwset 0,trackwave;\r\nchwave 0,0;\r\nchvolume 0,0.2;\r\nchstart 0;\r\n\r\n// Set track wave to channel 1 and start\r\nwset 1,trackwave;\r\nchwave 1,1;\r\nchvolume 1,0.2;\r\nchstart 1;\r\n\r\n// Set bass wave to channel 2 and start\r\nwset 2,basswave;\r\nchwave 2,1;\r\nchvolume 2,0.3;\r\nchstart 2;\r\n\r\n// Get track length\r\ntracklen = strlen(trackA);\r\n\r\nvoid main()\r\n{\r\n // Tempo\r\n if ((i > 120) && (i <= 230))\r\n tempo( 1000 );\r\n else\r\n tempo( 864 );\r\n\r\n // Track A\r\n note = 2;\r\n fpwr note,(trackA[i]/12);\r\n note /= 100;\r\n chpitch 0,note;\r\n \r\n // Track B\r\n note = 2;\r\n fpwr note,(trackB[i]/12);\r\n note /= 100;\r\n chpitch 1,note;\r\n \r\n // Bass\r\n note = 2;\r\n fpwr note,(bass[i]/12);\r\n note /= 100;\r\n chpitch 2,note;\r\n \r\n // Index\r\n i++; mod i,tracklen;\r\n \r\n // Repeat\r\n jmp main;\r\n}\r\n\r\n// Accurate tempo function for beats-per-minute\r\nvoid tempo( float bpm )\r\n{\r\n timer timestamp;\r\n while ((time - timestamp) < (60 / bpm)) { timer time; }\r\n}\r\n\r\n// Returns the length of a string\r\nfloat strlen(char* str)\r\n{\r\n char* strptr = str;\r\n while (*strptr++);\r\n return (strptr - str);\r\n}\r\n\r\nfloat note, i;\r\nfloat tracklen;\r\nfloat time, timestamp;\r\n\r\nstring trackwave,\"synth/square.wav\";\r\nstring basswave,\"synth/tri.wav\";\r\n\r\ntrackA:\r\n\r\n// Intro\r\ndb 73,73,73,73, 75,75,75,75, 77,77,77,77, 78,78,78,78, 80,80,80,80, 81,81,81,81;\r\ndb 82,-1,82,-1, 82,82,82,-1, 82,82,82,-1, 82,82,82,82, 82,82,82,-1, -1,-1,78,78;\r\n\r\n// Part 1\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, 86,86,86,86, 86,86,86,86, 86,86,86,-1;\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, -1,-1,78,78, 80,80,82,82, 83,83,85,85;\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, 86,86,86,86, 86,86,86,-1, 88,88,88,-1;\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,78,78;\r\ndb 85,85,85,85, 85,85,85,85, 85,85,85,-1, 84,84,84,84, 84,84,84,84, 84,84,84,-1;\r\ndb 85,85,85,85, 85,85,85,85, 85,85,85,-1, -1,-1,78,78, 80,80,82,82, 83,83,84,84;\r\ndb 85,85,85,85, 85,85,85,85, 85,85,85,-1, 78,78,78,78, 78,78,78,-1, 88,88,88,-1;\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,78,78;\r\n\r\n// Part 2\r\ndb 90,90,90,90, 90,90,90,90, 90,90,90,-1, 90,90,90,90, 90,90,90,90, 90,90,90,-1;\r\ndb 90,90,90,90, 90,90,90,90, 90,90,90,-1, 90,90,90,-1, 92,92,-1,-1, -1,-1,90,90;\r\ndb 88,88,88,88, 88,88,88,88, 88,88,88,-1, 88,88,88,88, 88,88,88,88, 88,88,88,-1; \r\ndb 88,88,88,88, 88,88,88,88, 88,88,88,-1, 88,88,88,-1, 90,90,-1,-1, -1,-1,88,88; \r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, 80,80,80,-1, 82,82,82,-1, 88,88,88,-1; \r\ndb 87,-1,87,-1, 87,87,87,87, 87,-1,82,82, 83,83,83,83, 83,83,83,83, 83,83,83,-1;\r\n\r\ndb 0; // End string\r\n\r\ntrackB:\r\n\r\n// Intro\r\ndb 73,73,73,73, 72,72,72,72, 71,71,71,71, 70,70,70,70, 71,71,71,71, 72,72,72,72; \r\ndb 73,-1,73,-1, 73,73,73,-1, 75,75,75,-1, 76,76,76,76, 76,76,76,-1, -1,-1,-1,-1;\r\n\r\n// Part 1\r\ndb 78,78,78,78, 78,78,78,78, 78,78,78,-1, 77,77,77,77, 77,77,77,77, 77,77,77,-1;\r\ndb 78,78,78,78, 78,78,78,78, 78,78,78,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb 78,78,78,78, 78,78,78,78, 78,78,78,-1, 77,77,77,77, 77,77,77,-1, 80,80,80,-1;\r\ndb 78,78,78,78, 78,78,78,78, 78,78,78,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb 76,76,76,76, 76,76,76,76, 76,76,76,-1, 75,75,75,75, 75,75,75,75, 75,75,75,-1;\r\ndb 76,76,76,76, 76,76,76,76, 76,76,76,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb 76,76,76,76, 76,76,76,76, 76,76,76,-1, 70,70,70,70, 70,70,70,-1, 80,80,80,-1;\r\ndb 78,78,78,78, 78,78,78,78, 78,78,78,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\n\r\n// Part 2\r\ndb 87,87,87,87, 87,87,87,87, 87,87,87,-1, 85,85,85,85, 85,85,85,85, 85,85,85,-1;\r\ndb 84,84,84,84, 84,84,84,84, 84,84,84,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb 85,85,85,85, 85,85,85,85, 85,85,85,-1, 84,84,84,84, 84,84,84,84, 84,84,84,-1;\r\ndb 83,83,83,83, 83,83,83,83, 83,83,83,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb 71,71,71,71, 71,71,71,71, 71,71,71,-1, 76,76,76,-1, 78,78,78,-1, 82,82,82,-1;\r\ndb 82,-1,82,-1, 82,82,82,-1, -1,-1,76,76, 75,75,75,75, 75,75,75,75, 75,75,75,-1;\r\n\r\ndb 0; // End string\r\n\r\nbass: \r\n\r\n// Intro\r\ndb -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1;\r\ndb -1,-1,-1,-1, -1,-1,-1,-1, 66,66,66,-1, 66,66,66,66, 66,66,66,66, 66,66,66,-1;\r\n\r\n// Part 1\r\ndb 59,59,59,-1, 66,66,66,-1, 71,71,71,-1, 58,58,58,-1, 66,66,66,-1, 70,70,70,-1;\r\ndb 59,59,59,-1, 66,66,66,-1, 71,71,71,-1, 63,63,63,-1, 66,66,66,-1, 71,71,71,-1;\r\ndb 59,59,59,-1, 66,66,66,-1, 71,71,71,-1, 58,58,58,-1, 66,66,66,-1, 70,70,70,-1;\r\ndb 59,59,59,-1, 66,66,66,-1, 71,71,71,-1, 63,63,63,-1, 66,66,66,-1, 71,71,71,-1;\r\ndb 61,61,61,-1, 66,66,66,-1, 70,70,70,-1, 60,60,60,-1, 65,65,65,-1, 69,69,69,-1;\r\ndb 61,61,61,-1, 66,66,66,-1, 70,70,70,-1, 58,58,58,-1, 66,66,66,-1, 70,70,70,-1;\r\ndb 61,61,61,-1, 66,66,66,-1, 70,70,70,-1, 58,58,58,-1, 66,66,66,-1, 70,70,70,-1;\r\ndb 59,59,59,-1, 66,66,66,-1, 71,71,71,-1, 54,54,54,-1, 66,66,66,-1, 71,71,71,-1;\r\n\r\n// Part 2\r\ndb 59,59,59,-1, 66,66,66,-1, 75,75,75,-1, 58,58,58,-1, 66,66,66,-1, 73,73,73,-1;\r\ndb 57,57,57,-1, 66,66,66,-1, 72,72,72,-1, 60,60,60,-1, 66,66,66,-1, 75,75,75,-1;\r\ndb 61,61,61,-1, 68,68,68,-1, 76,76,76,-1, 60,60,60,-1, 68,68,68,-1, 76,76,76,-1;\r\ndb 59,59,59,-1, 68,68,68,-1, 76,76,76,-1, 58,58,58,-1, 66,66,66,-1, 76,76,76,-1;\r\ndb 47,47,47,-1, 66,66,66,-1, 75,75,75,-1, 54,54,54,-1, 66,66,66,-1, 66,66,66,-1;\r\ndb 64,-1,64,-1, 64,64,64,-1, -1,-1,58,58, 59,59,59,59, 59,59,59,59, 59,59,59,-1;\r\n\r\ndb 0; // End string\r\n\r\n","spuchip/examples/beatbox.txt":"wset 4,inst1;\r\nchwave 1,4;\r\nchpitch 1,2.55;\r\n\r\nchwave 2,0;\r\nchvolume 2,0.5;\r\nchstart 2;\r\nchpitch 2,0;\r\n\r\nmainloop:\r\n timer r0;\r\n mul r0,6;\r\n mov r1,r0;\r\n\r\n fint r0;\r\n mod r0,16;\r\n add r0,0;\r\n mod r1,1;\r\n currentTick = r0;\r\n currentTickTime = r1;\r\n\r\n instr1 = patternData1[currentTick];\r\n instr2 = patternData2[currentTick];\r\n instr3 = patternData3[currentTick];\r\n\r\n if ((pinstr1 == 0) && (instr1 == 1)) {\r\n chstart 0;\r\n } else {\r\n chstop 0;\r\n }\r\n\r\n if ((pinstr2 == 0) && (instr2 == 1)) {\r\n chstart 1;\r\n } else {\r\n chstop 1;\r\n }\r\n\r\n mov r0,currentTickTime; neg r0; add r0,1; fpwr r0,4;\r\n mul r0,0.6; // add r0,0.64;\r\n chpitch 0,r0;\r\n\r\n mov r0,instr3;\r\n mul r0,0.1;\r\n add r0,0.2;\r\n chpitch 2,r0;\r\njmp mainloop;\r\n\r\nfloat currentTick,currentTickTime;\r\nfloat instr1,instr2,instr3;\r\nfloat pinstr1,pinstr2;\r\n\r\npatternData1: db 1,1,0,0, 1,0,0,0, 1,0,0,1, 0,1,0,0, 1,1,0,0, 1,1,0,0, 1,1,0,1, 1,0,1,0;\r\npatternData2: db 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,1,0;\r\npatternData3: db 0,1,0,2, 0,1,2,2, 0,0,1,1, 1,2,1,2, 2,2,1,2, 2,2,1,1, 1,1,0,0, 0,0,1,2;\r\n\r\nstring inst1,\"synth/pink_noise.wav\";\r\n"},"prevhash.txt":"4243da411622f01ce0b720176ba036a752129755\r\n","adv_duplicator/":{"adv_duplicator/wireman.txt":"[Info]\r\nType:AdvDupe File\r\nCreator:\"Maso\"\r\nDate:05/01/11\r\nDescription:\"none\"\r\nEntities:8\r\nConstraints:31\r\n[More Information]\r\nFileVersion:0.84\r\nAdvDupeVersion:1.85\r\nAdvDupeToolVersion:1.9\r\nAdvDupeSharedVersion:1.72\r\nSerialiserVersion:1.4\r\nWireVersion:2435 (EXPORTED)\r\nTime:05:28 AM\r\nHead:188\r\nHoldAngle:0,-157.54,0\r\nHoldPos:59.9271,1.05281,0.728333\r\nStartPos:9809.35,-670.248,8.03125\r\n[Save]\r\nEntities:19BB9E48{;}197CE8F0{Y:12=T:18F29AA0;}1B88A158{;}1B74B110{;}1917E4C8{Y:3=A:89.5833,-6.53094,180.117;Y:4=V:-31.7705,2.54797,46.933;Y:6=B:f;}H19B2B218{N:189=T:1B72EC10;N:242=T:18FC0620;N:197=T:1C085C88;N:266=T:19014EC0;N:191=T:1AC73D38;N:188=T:1C22F948;N:268=T:168D3A80;N:267=T:18F4D870;}1B74B0E0{Y:28=T:1B74B110;}1C9B2C68{N:0=T:1C9B2C98;}1ADB32B8{N:0=T:1BE418D0;}1C085C88{Y:3=A:89.5833,-6.53094,-179.883;Y:4=V:-31.7705,2.54797,46.933;Y:5=N:0;Y:7=T:1917E498;Y:9=Y:8;Y:2=Y:17;}18FC0620{Y:2=Y:14;Y:3=A:0.000332517,173.62,-0.000518799;Y:4=V:-16.4063,0.997742,45.4449;Y:5=N:0;Y:7=T:19F37CE8;Y:9=Y:8;Y:13=T:1D7F8B78;}19AB7118{T:1B88A128;T:1B88A158;}18F29AA0{Y:11=Y:10;}19F37D18{Y:3=A:0.000332517,173.62,359.999;Y:4=V:-16.4063,0.997742,45.4449;Y:6=B:t;}19BB9DE8{T:19BB9E18;T:19BB9E48;}192FF7B8{Y:3=A:-0.294498,-6.38357,180.031;Y:4=V:-15.6973,14.6041,44.1504;Y:6=B:f;}19F37CE8{N:0=T:19F37D18;}1B7B2298{Y:15=N:50;}1A5D0438{Y:29=T:1B74B0E0;}1B88A128{;}18EC6B08{N:0=T:18EC6B38;}1917E498{N:0=T:1917E4C8;}18F4D870{Y:3=A:-0.00354703,173.62,-0.000518799;Y:4=V:-7.63672,-10.4395,81.5085;Y:5=N:0;Y:7=T:18EC6B08;Y:9=Y:8;Y:2=Y:18;}18EC6B38{Y:3=A:-0.00354703,173.62,359.999;Y:4=V:-7.63672,-10.4395,81.5085;Y:6=B:f;}168D3A80{Y:2=Y:1;Y:3=A:-0.356212,-6.67777,-179.956;Y:4=V:-17.5264,-12.4753,44.1833;Y:5=N:0;Y:7=T:169A4588;Y:9=Y:8;Y:13=T:17F0D510;}192FF788{N:0=T:192FF7B8;}169A45B8{Y:3=A:-0.356212,-6.67777,180.044;Y:4=V:-17.5264,-12.4753,44.1833;Y:6=B:f;}169A4588{N:0=T:169A45B8;}19014EC0{Y:3=A:-0.00345482,173.62,-0.000518799;Y:4=V:-5.36621,9.82532,81.5081;Y:5=N:0;Y:7=T:1C9B2C68;Y:9=Y:8;Y:2=Y:18;}17F0D510{Y:12=T:1BB4F010;}1BB4F010{Y:11=Y:10;}16AA7618{N:0=T:16AA7648;}1D7F8B78{Y:16=T:1B7B2298;}1C22F948{Y:7=T:1ADB32B8;Y:9=Y:20;Y:3=A:89.6399,-5.53999,1.19965;Y:21=T:19BB9DE8;Y:22=T:19AB7118;Y:24=Y:23;Y:4=V:-1.22168,-0.923706,59.9212;Y:2=Y:25;Y:27=Y:26;Y:13=T:1A5D0438;Y:30=T:18FB23A0;Y:5=N:0;}1AC73D38{Y:3=A:-0.0362574,81.479,-91.1042;Y:4=V:-31.6016,2.5882,72.2405;Y:5=N:0;Y:7=T:16AA7618;Y:9=Y:8;Y:2=Y:19;}19BB9E18{;}1BE418D0{Y:3=A:89.6399,-5.53999,1.19965;Y:4=V:-1.22168,-0.923706,59.9212;Y:6=B:f;}18FB23A0{;}1C9B2C98{Y:3=A:-0.00345482,173.62,359.999;Y:4=V:-5.36621,9.82532,81.5081;Y:6=B:f;}1B72EC10{Y:2=Y:1;Y:3=A:-0.294498,-6.38357,-179.969;Y:4=V:-15.6973,14.6041,44.1504;Y:5=N:0;Y:7=T:192FF788;Y:9=Y:8;Y:13=T:197CE8F0;}16AA7648{Y:3=A:-0.0362574,81.479,268.896;Y:4=V:-31.6016,2.5882,72.2405;Y:6=B:f;}\r\nConstraints:1A790460{Y:31=N:242;Y:32=N:0;}1926A480{Y:33=T:18FACDC8;Y:35=Y:34;}1BF200A0{Y:33=T:1AE0AAB0;Y:35=Y:34;}1A3475D0{Y:36=B:t;Y:37=N:0;Y:33=T:1A347600;Y:38=B:t;Y:35=Y:39;}18463E50{Y:33=T:18463EA8;Y:35=Y:34;}1990A7D8{T:1990A838;T:19174B18;}1A3F1790{T:1959F900;T:1959F930;}1BF8D7F8{Y:33=T:1B876C20;Y:35=Y:34;}19264F50{Y:31=N:191;Y:32=N:0;}1C27D280{Y:33=T:1C27D2D8;Y:35=Y:34;}18FACDC8{T:18FACE28;T:1BF20048;}1AA19F28{Y:31=N:197;Y:32=N:0;}0DC038F0{Y:31=N:191;Y:32=N:0;}1990A838{Y:31=N:242;Y:32=N:0;}1BF20048{Y:31=N:267;Y:32=N:0;}1CD1CE98{Y:33=T:1990A7D8;Y:35=Y:34;}191EE670{Y:31=N:189;Y:32=N:0;}18FACE28{Y:31=N:266;Y:32=N:0;}1A330960{Y:33=T:1A4427A8;Y:35=Y:34;}1AA19F58{Y:31=N:191;Y:32=N:0;}1D6991E8{Y:31=N:268;Y:32=N:0;}1959F900{Y:31=N:267;Y:32=N:0;}175D6690{Y:33=T:175D66E8;Y:35=Y:34;}175D66E8{T:1768DC48;T:1768DC78;}1768DC48{Y:31=N:197;Y:32=N:0;}19B3B058{Y:31=N:189;Y:32=N:0;}19256CE0{Y:31=N:191;Y:32=N:0;}19174B18{Y:31=N:268;Y:32=N:0;}1B6D74A0{Y:31=N:268;Y:32=N:0;}1923B508{Y:33=T:1923B560;Y:35=Y:34;}18D92A30{Y:31=N:242;Y:32=N:0;}1BBE43E0{Y:31=N:189;Y:32=N:0;}197AEE78{Y:31=N:242;Y:32=N:0;}19F08CC8{Y:33=T:1A4319B8;Y:35=Y:34;}194C60C0{Y:31=N:242;Y:32=N:0;}18463EA8{T:1BBE43E0;T:1BBE4410;}1D699188{T:1D6991E8;T:1C36CF98;}19174B48{Y:33=T:1D699188;Y:35=Y:34;}18A09CD8{Y:31=N:189;Y:32=N:0;}19B3B088{S:\"Ang\"=A:-0.459895,-134.973,180.006;Y:35=Y:40;Y:33=T:18A09C78;Y:41=N:100000;}185934F8{Y:31=N:268;Y:32=N:0;}18B99330{Y:31=N:197;Y:32=N:0;}1916DDB0{Y:31=N:242;Y:32=N:0;}1A6D2950{Y:31=N:189;Y:32=N:0;}1A330930{Y:31=N:242;Y:32=N:0;}1959F930{Y:31=N:191;Y:32=N:0;}191EE540{Y:33=T:191EE570;Y:35=Y:34;}1AC56190{Y:31=N:267;Y:32=N:0;}1B876C20{T:1B876C80;T:19B3B058;}19319C60{Y:31=N:267;Y:32=N:0;}1A4319B8{T:18DE61D0;T:18DE6200;}19C5D490{Y:33=T:1916DD50;Y:35=Y:34;}1AE0AAB0{T:1B6D74A0;T:1B6D74D0;}1A3F1738{Y:33=T:1A3F1790;Y:35=Y:34;}1B6D74D0{Y:31=N:266;Y:32=N:0;}192A1980{Y:31=N:242;Y:32=N:0;}1912FFF8{Y:31=N:189;Y:32=N:0;}1BBE4410{Y:31=N:266;Y:32=N:0;}191E4AD0{T:1A6D2950;T:1A6D2980;}18F2BAC0{Y:33=T:1912FF98;Y:35=Y:34;}19434350{Y:31=N:242;Y:32=N:0;}1916DD50{T:1916DDB0;T:18B99330;}1D5A5A10{Y:31=N:189;Y:32=N:0;}19E7E308{Y:31=N:191;Y:32=N:0;}19576620{Y:31=N:242;Y:32=N:0;}1A6D2980{Y:31=N:268;Y:32=N:0;}192ADB98{Y:31=N:242;Y:32=N:0;}191EE570{T:1D5A5A10;T:1D5A5A40;}1C39D2C8{T:1A790430;T:1A790460;}1A347600{T:192ADB68;T:192ADB98;}194C60F0{Y:31=N:189;Y:32=N:0;}1BF21E50{T:19E7E2D8;T:19E7E308;}190AFDC0{Y:33=T:18D929D0;Y:35=Y:34;}19EB4CA8{T:194C60C0;T:194C60F0;}17509828{T:192A1950;T:192A1980;}19EB4C78{Y:33=T:19EB4CA8;Y:35=Y:39;Y:37=N:0;}18DE6200{Y:31=N:266;Y:32=N:0;}18B99388{Y:33=T:1C39D2C8;Y:35=Y:39;Y:37=N:0;}19CF3F20{Y:33=T:1AC56130;Y:35=Y:39;Y:37=N:0;}19BA27B0{Y:31=N:267;Y:32=N:0;}1AC56130{T:1AC56190;T:1A330930;}175097D0{Y:33=T:17509828;Y:35=Y:39;Y:37=N:0;}1A429D00{T:19C5D460;}19E7E2D8{Y:31=N:266;Y:32=N:0;}1A429CA8{S:\"Ang\"=A:-0.355103,-135.268,180.042;Y:35=Y:40;Y:33=T:1A429D00;Y:41=N:100000;}19319CB8{Y:33=T:191E4AD0;Y:35=Y:34;}19BA2780{Y:31=N:197;Y:32=N:0;}1923B560{T:19BA2780;T:19BA27B0;}1926A450{Y:31=N:266;Y:32=N:0;}19529848{Y:31=N:197;Y:32=N:0;}194342F0{T:19434350;T:185934F8;}1A442808{Y:31=N:242;Y:32=N:0;}195297E8{T:19529848;T:1926A450;}19264EF0{T:19264F50;T:197AEE78;}1927D100{T:1AA19F28;T:1AA19F58;}1912FF98{T:1912FFF8;T:0DC038F0;}18D929D0{T:18D92A30;T:19256CE0;}197AEED0{Y:33=T:1927D100;Y:35=Y:34;}1C36CF98{Y:31=N:191;Y:32=N:0;}18DE61D0{Y:31=N:242;Y:32=N:0;}19C5D460{Y:31=N:268;Y:32=N:0;}18A09C78{T:18A09CD8;}1A98C800{Y:33=T:195297E8;Y:35=Y:34;}192A1950{Y:31=N:266;Y:32=N:0;}1C27D2D8{T:191EE640;T:191EE670;}191EE640{Y:31=N:197;Y:32=N:0;}1A347920{Y:31=N:268;Y:32=N:0;}1956EB60{T:19576620;}192ADB68{Y:31=N:188;Y:32=N:0;}18B391F0{S:\"Ang\"=A:-0.000781828,45.0297,360;Y:35=Y:40;Y:33=T:1956EB60;Y:41=N:100000;}0DC03920{Y:33=T:19264EF0;Y:35=Y:39;Y:37=N:0;}19256D38{Y:33=T:1BF21E50;Y:35=Y:34;}1A3478C0{T:1A347920;T:19319C60;}1B876C80{Y:31=N:242;Y:32=N:0;}18593528{Y:33=T:1A3478C0;Y:35=Y:34;}18B39198{Y:31=N:267;Y:32=N:0;}1D5A5A40{Y:31=N:267;Y:32=N:0;}1A4427A8{T:1A442808;T:18B39198;}1A790430{Y:31=N:197;Y:32=N:0;}19BF1458{Y:33=T:194342F0;Y:35=Y:39;Y:37=N:0;}H1969BED8{T:1A330960;T:19174B48;T:1BF8D7F8;T:1A3475D0;T:19319CB8;T:18B391F0;T:19CF3F20;T:1A429CA8;T:18B99388;T:1CD1CE98;T:1926A480;T:1C27D280;T:19256D38;T:175097D0;T:18593528;T:19BF1458;T:1A3F1738;T:19F08CC8;T:197AEED0;T:18463E50;T:1A98C800;T:1923B508;T:19EB4C78;T:191EE540;T:0DC03920;T:18F2BAC0;T:1BF200A0;T:19C5D490;T:19B3B088;T:190AFDC0;T:175D6690;}1768DC78{Y:31=N:268;Y:32=N:0;}\r\n[Dict]\r\n1:\"models/cyborgmatt/capacitor_large.mdl\"\r\n2:\"Model\"\r\n3:\"LocalAngle\"\r\n4:\"LocalPos\"\r\n5:\"Skin\"\r\n6:\"Frozen\"\r\n7:\"PhysicsObjects\"\r\n8:\"prop_physics\"\r\n9:\"Class\"\r\n10:\"beer/wiremod/gate_wirelogo\"\r\n11:\"MaterialOverride\"\r\n12:\"material\"\r\n13:\"EntityMods\"\r\n14:\"models/bull/various/subwoofer.mdl\"\r\n15:\"Mass\"\r\n16:\"mass\"\r\n17:\"models/bull/gates/microcontroller1.mdl\"\r\n18:\"models/bull/various/speaker.mdl\"\r\n19:\"models/bull/gates/resistor.mdl\"\r\n20:\"gmod_wire_expression2\"\r\n21:\"_outputs\"\r\n22:\"_inputs\"\r\n23:\"Wireman\"\r\n24:\"_name\"\r\n25:\"models/bull/gates/processor.mdl\"\r\n26:\"@name Wireman�@inputs �@outputs �@persist �@trigger ��if(first()|duped()) {� entity():soundPlay(0,0,�npc/zombie_poison/pz_breathe_loop2.wav�)�}�interval(500)�entity():isWeldedTo():applyForce(vec(0,0,-25000))�\"\r\n27:\"_original\"\r\n28:\"Wires\"\r\n29:\"WireDupeInfo\"\r\n30:\"_vars\"\r\n31:\"Index\"\r\n32:\"Bone\"\r\n33:\"Entity\"\r\n34:\"NoCollide\"\r\n35:\"Type\"\r\n36:\"nocollide\"\r\n37:\"forcelimit\"\r\n38:\"deleteonbreak\"\r\n39:\"Weld\"\r\n40:\"Keepupright\"\r\n41:\"angularlimit\"\r\nSaved:291"},"cpuchip/":{"cpuchip/examples/":{"cpuchip/examples/udh_test.txt":"//------------------------------------------------------------------------------\r\n// Universal Device Host driver test application\r\n//------------------------------------------------------------------------------\r\n#pragma CRT ZCRT\r\n\r\n//Include drivers for console screen and device host\r\n#include \r\n#include \r\n\r\nvoid main() {\r\n float i;\r\n udhSetBusAddress(65536);\r\n \r\n cscrInitialize(0);\r\n\r\n udhQueryDevices();\r\n\r\n for (i = 0; i < MAX_CONSOLE_SCREENS; i++) {\r\n cscrSelect(i);\r\n cscrSetActive(1);\r\n cscrClear();\r\n \r\n cscrSetCursor(0,0);\r\n cscrPrintLine(\"Screen \",930);\r\n cscrPrintNumber(i,930); \r\n }\r\n\r\n cscrSelect(0);\r\n cscrSetCursor(0,2);\r\n cscrPrintLine(\"UDH driver test\\n\",039);\r\n for (i = 0; i < 8; i++) {\r\n cscrPrintLine(\"DEVICE \",999);\r\n cscrPrintNumber(i,999);\r\n cscrPrintLine(\": \",999);\r\n cscrPrintLine(udhGetDeviceName(i),666);\r\n cscrPrintLine(\"\\n\",999);\r\n }\r\n}\r\n","cpuchip/examples/helloworld.txt":"//Wired Hello World!\r\n//Connect CPU membus input to console screen\r\n//Connect CPUs CLK input to button (toggle)\r\n//Notice how you can store your \r\n//subroutines/calls in DATA area\r\njmp _code;\r\nmessage:\r\n db 'Hello World!',0;\r\nWriteString: //ESI - String pointer, EDX - Param\r\n mov eax,65536;\r\n AWriteLoop:\r\n cmp #esi,0; //Terminate on char 0\r\n je AEnd;\r\n mov #eax,#esi; //Output char\r\n inc eax;\r\n mov #eax,edx; //Output char param\r\n inc eax;\r\n inc esi;\r\n jmp AWriteLoop;\r\n AEnd:\r\nret //Return from call\r\n\r\n_code:\r\n mov esi,message;\r\n mov edx,000999; //White foreground on black background\r\n call WriteString;\r\n\r\n//More about colors:\r\n//Lower 3 digits are foreground, \r\n//and higher 3 digits are background\r\n//Each of 3 digits shows amount of\r\n//RED, GREEN, and BLUE (in order)\r\n//Each color has 10 shades - from 0 to 9\r\n//\r\n//For example, 999044 will be dark yellow (044) on\r\n//a white background (999)\r\n//\r\n//Experiment with colors!\r\n//\r\n//Also, the 7th digit (if its not equal to 0) will\r\n//cause the character to blink by changing foreground and\r\n//background places (actual data in memory wont change)\r\n"},"cpuchip/lib/":{"cpuchip/lib/drivers/":{"cpuchip/lib/drivers/drv_udh.txt":"//------------------------------------------------------------------------------\r\n// ZCPU standard library and drivers set (C) 2011 by Black Phoenix\r\n//\r\n// Universal device host driver. Only supports 8 devices right now\r\n//------------------------------------------------------------------------------\r\n\r\n#define UDH_DRIVER\r\n\r\n//Maximum number of devices supported\r\n#define MAX_UDH_DEVICES 8\r\n\r\n//Address range of a single device\r\n#define MAX_UDH_ADDRESS_RANGE 4*1024\r\n\r\n//Maximum number of drivers that may register with UDH\r\n#define MAX_UDH_DRIVERS 8\r\n\r\n//Device name/string data\r\nstring udhDeviceString0,\"None\";\r\nstring udhDeviceString1,\"Unknown\";\r\nstring udhDeviceString2,\"Extended bus\";\r\nstring udhDeviceString3,\"Address bus\";\r\nstring udhDeviceString4,\"Zyelios CPU\";\r\nstring udhDeviceString5,\"Zyelios GPU\";\r\nstring udhDeviceString6,\"Zyelios SPU\";\r\nstring udhDeviceString7,\"Flash EEPROM\";\r\nstring udhDeviceString8,\"ROM\";\r\nstring udhDeviceString9,\"Data bus\";\r\nstring udhDeviceString10,\"CD Ray\";\r\nstring udhDeviceString11,\"Console screen\";\r\nstring udhDeviceString12,\"Digital screen\";\r\nstring udhDeviceString13,\"Data plug\";\r\nstring udhDeviceString14,\"Data socket\";\r\nstring udhDeviceString15,\"Keyboard\";\r\nstring udhDeviceString16,\"Oscilloscope\";\r\nstring udhDeviceString17,\"Sound emitter\";\r\nstring udhDeviceString18,\"Constant value\";\r\nstring udhDeviceString19,\"Data port\";\r\nstring udhDeviceString20,\"RAM\";\r\nudhDeviceName: \r\n db udhDeviceString0, udhDeviceString1, udhDeviceString2;\r\n db udhDeviceString3, udhDeviceString4, udhDeviceString5;\r\n db udhDeviceString6, udhDeviceString7, udhDeviceString8;\r\n db udhDeviceString9, udhDeviceString10,udhDeviceString11;\r\n db udhDeviceString12,udhDeviceString13,udhDeviceString14;\r\n db udhDeviceString15,udhDeviceString16,udhDeviceString17;\r\n db udhDeviceString18,udhDeviceString19,udhDeviceString20;\r\n\r\n//Extended bus offset\r\nchar* udhBusOffset;\r\n\r\n//List of callbacks to call when querying devices\r\nvoid* udhQueryCallback[MAX_UDH_DRIVERS];\r\nfloat udhQueryCallbackCount = 0;\r\n\r\nfloat udhSetBusAddress(char* extOffset) {\r\n udhBusOffset = extOffset;\r\n udhQueryDevices();\r\n}\r\n\r\nvoid udhQueryDevices() {\r\n float i;\r\n\r\n //Run the query\r\n udhBusOffset[16] = 32+MAX_UDH_DEVICES;\r\n udhBusOffset[17] = 1; \r\n\r\n //Reconfigure all devices\r\n //FIXME: only supports single extended bus right now\r\n for (i = 0; i < 8; i++) {\r\n udhBusOffset[i*2+0] = (4*1024)*i;\r\n udhBusOffset[i*2+1] = (4*1024)*i+((4*1024)-1);\r\n }\r\n\r\n //Update all drivers\r\n for (i = 0; i < udhQueryCallbackCount; i++) {\r\n void* functionPtr = udhQueryCallback[i];\r\n functionPtr();\r\n }\r\n}\r\n\r\nvoid udhRegisterDriver(void* queryDeviceFunction) {\r\n udhQueryCallback[udhQueryCallbackCount] = queryDeviceFunction;\r\n if (udhQueryCallbackCount < MAX_UDH_DRIVERS) udhQueryCallbackCount++;\r\n}\r\n\r\nfloat udhGetDeviceType(float busIndex) {\r\n return udhBusOffset[32+busIndex];\r\n}\r\n\r\nfloat udhGetDeviceOffset(float busIndex) {\r\n return 65536+32+MAX_UDH_DEVICES+udhBusOffset[busIndex*2];\r\n}\r\n\r\nchar* udhGetDeviceName(float busIndex) {\r\n float deviceType = udhGetDeviceType(busIndex);\r\n if ((deviceType >= 0) && (deviceType <= 20)) {\r\n return udhDeviceName[deviceType]; \r\n } else {\r\n return udhDeviceName[1];\r\n }\r\n}\r\n\r\nvoid udhSetDeviceOffsetSize(float busIndex, char* offst, char* size) {\r\n udhBusOffset[busIndex*2+0] = offst;\r\n udhBusOffset[busIndex*2+1] = offst+size-1;\r\n}\r\n\r\nfloat udhGetNumDevices() {\r\n return MAX_UDH_DEVICES; \r\n}\r\n\r\nfloat udhGetDevices(float type, float maxCount, char* deviceList) {\r\n float i,devPtr,n;\r\n \r\n devPtr = deviceList;\r\n n = 0;\r\n for (i = 0; i < MAX_UDH_DEVICES; i++) {\r\n if ((udhGetDeviceType(i) == type) && (n < maxCount)) {\r\n n++;\r\n *devPtr++ = i; \r\n }\r\n }\r\n\r\n return n;\r\n}","cpuchip/lib/drivers/drv_cscr.txt":"//------------------------------------------------------------------------------\r\n// ZCPU standard library and drivers set (C) 2011 by Black Phoenix\r\n//\r\n// UDH-enabled console screen highspeed driver\r\n//------------------------------------------------------------------------------\r\n\r\n//Define to check if console screen driver is available\r\n#define CSCR_DRIVER\r\n\r\n//Maximum number of console screens supported\r\n#define MAX_CONSOLE_SCREENS 8\r\n\r\n//Console screen registers\r\n#define CURSOR_RATE 2043\r\n#define CURSOR_SIZE 2044\r\n#define CURSOR_POSITION 2045\r\n#define CURSOR_VISIBLE 2046\r\n#define LOW_SHIFT_COL 2031\r\n#define HIGH_SHIFT_COL 2032\r\n#define LOW_SHIFT_ROW 2033\r\n#define HIGH_SHIFT_ROW 2034\r\n#define SHIFT_ROWS 2038\r\n#define SHIFT_CELLS 2037\r\n#define CLEAR_SCREEN 2041\r\n#define BACKGROUND_COLOR 2042\r\n#define SCREEN_ACTIVE 2047\r\n#define SCREEN_ROTATION 2024\r\n#define SCREEN_BRIGHTNESS 2036\r\n\r\n//Driver data\r\nchar* cscrOffsets[MAX_CONSOLE_SCREENS];\r\nfloat cscrDevices[MAX_CONSOLE_SCREENS];\r\nchar* cscrCharacterPointer[MAX_CONSOLE_SCREENS];\r\nfloat cscrSelectedScreen;\r\n\r\n#ifdef UDH_DRIVER\r\n//Update console screen offsets\r\nvoid cscrUDHQueryFunction() {\r\n float i,n;\r\n n = udhGetDevices(11,MAX_CONSOLE_SCREENS,cscrDevices); \r\n for (i = 0; i < n; i++) {\r\n cscrOffsets[i] = udhGetDeviceOffset(cscrDevices[i]);\r\n }\r\n}\r\n#endif\r\n\r\n//Initialize console screen driver. screenOffset may be 0 if using UDH\r\nvoid cscrInitialize(char* screenOffset) {\r\n float i;\r\n\r\n for (i = 0; i < MAX_CONSOLE_SCREENS; i++) {\r\n cscrOffsets[i] = screenOffset;\r\n }\r\n\r\n#ifdef UDH_DRIVER\r\n if (!screenOffset) {\r\n udhRegisterDriver(cscrUDHQueryFunction);\r\n cscrUDHQueryFunction();\r\n }\r\n#endif\r\n cscrSelectedScreen = 0;\r\n}\r\n\r\nfloat cscrPresent(float screen) {\r\n return cscrOffsets[cscrSelectedScreen] != 0;\r\n}\r\n\r\nvoid cscrSelect(float screen) {\r\n cscrSelectedScreen = screen;\r\n max cscrSelectedScreen,0;\r\n min cscrSelectedScreen,MAX_CONSOLE_SCREENS;\r\n}\r\n\r\nvoid cscrSetActive(float clk) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return;\r\n *(cscrOffsets[cscrSelectedScreen]+SCREEN_ACTIVE) = clk;\r\n}\r\n\r\nvoid cscrClear() {\r\n if (!cscrOffsets[cscrSelectedScreen]) return;\r\n *(cscrOffsets[cscrSelectedScreen]+CLEAR_SCREEN) = 1;\r\n cscrCharacterPointer[cscrSelectedScreen] = 0;\r\n}\r\n\r\nvoid cscrSetBackground(float col) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return; \r\n *(cscrOffsets[cscrSelectedScreen]+BACKGROUND_COLOR) = col;\r\n}\r\n\r\nvoid cscrSetRotation(float rot) {\r\n *(cscrOffsets[cscrSelectedScreen]+SCREEN_ROTATION) = rot; \r\n}\r\n\r\nvoid cscrSetBrightness(float bright) {\r\n *(cscrOffsets[cscrSelectedScreen]+SCREEN_BRIGHTNESS) = bright;\r\n}\r\n\r\nvoid cscrLoadImage(char* imgdata) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return; \r\n\r\n preserve ESI,EDI;\r\n ESI = imgdata;\r\n EDI = cscrOffsets[cscrSelectedScreen];\r\n mcopy 30*18*2;\r\n}\r\n\r\nvoid cscrPutLine(char* scrptr, float col, char* str) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return; \r\n char* curptr = scrptr;\r\n\r\n while (*str) {\r\n *(cscrOffsets[cscrSelectedScreen]+curptr*2+0) = *str;\r\n *(cscrOffsets[cscrSelectedScreen]+curptr*2+1) = col;\r\n\r\n str++;\r\n curptr++;\r\n }\r\n}\r\n\r\nvoid cscrPutChar(char* scrptr, float col, char ch) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return; \r\n\r\n *(cscrOffsets[cscrSelectedScreen]+scrptr*2+0) = ch;\r\n *(cscrOffsets[cscrSelectedScreen]+scrptr*2+1) = col;\r\n}\r\n\r\nvoid cscrNewLine() {\r\n if (!cscrOffsets[cscrSelectedScreen]) return;\r\n\r\n cscrCharacterPointer[cscrSelectedScreen] /= 30;\r\n fint cscrCharacterPointer[cscrSelectedScreen];\r\n cscrCharacterPointer[cscrSelectedScreen] = (cscrCharacterPointer[cscrSelectedScreen]+1)*30;\r\n\r\n if (cscrCharacterPointer[cscrSelectedScreen] >= 30*18) {\r\n cscrCharacterPointer[cscrSelectedScreen] = cscrCharacterPointer[cscrSelectedScreen] - 30;\r\n *(cscrOffsets[cscrSelectedScreen]+SHIFT_ROWS) = 1;\r\n }\r\n}\r\n\r\nvoid cscrPrintLine(char* str, float col) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return;\r\n\r\n while (*str) {\r\n if (*str == '\\n') {\r\n cscrNewLine();\r\n str++;\r\n if (*str == 0) return;\r\n }\r\n \r\n *(cscrOffsets[cscrSelectedScreen]+cscrCharacterPointer[cscrSelectedScreen]*2+0) = *str;\r\n *(cscrOffsets[cscrSelectedScreen]+cscrCharacterPointer[cscrSelectedScreen]*2+1) = col;\r\n \r\n cscrCharacterPointer[cscrSelectedScreen]++; \r\n if (cscrCharacterPointer[cscrSelectedScreen] >= 30*18) cscrNewLine(); \r\n str++;\r\n }\r\n}\r\n\r\nvoid cscrPrintNumber(float num, float col) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return;\r\n \r\n float ndig,a;\r\n a = num;\r\n ndig = 0;\r\n while (a > 0) {\r\n ndig++;\r\n a /= 10;\r\n fint a; \r\n }\r\n max ndig,1;\r\n a = num;\r\n\r\n cscrCharacterPointer[cscrSelectedScreen] = cscrCharacterPointer[cscrSelectedScreen] + ndig;\r\n char* charPtr = cscrCharacterPointer[cscrSelectedScreen] - 1;\r\n while (ndig > 0) {\r\n preserve EDX;\r\n mov EDX,a;\r\n mod EDX,10;\r\n add EDX,48;\r\n \r\n *(cscrOffsets[cscrSelectedScreen]+charPtr*2+0) = EDX;\r\n *(cscrOffsets[cscrSelectedScreen]+charPtr*2+1) = col;\r\n charPtr--;\r\n \r\n a /= 10;\r\n fint a;\r\n \r\n ndig--;\r\n }\r\n}\r\n\r\nvoid cscrSetCursor(float x, y) {\r\n if (!cscrOffsets[cscrSelectedScreen]) return; \r\n cscrCharacterPointer[cscrSelectedScreen] = x+y*30;\r\n}"},"cpuchip/lib/zcrt/":{"cpuchip/lib/zcrt/string.txt":"//------------------------------------------------------------------------------\r\n// ZCPU CRT sourcecode (for HL-ZASM compiler) (C) 2011 by Black Phoenix\r\n//\r\n// String library. Contains functions to work with C strings (C89-compatible)\r\n//------------------------------------------------------------------------------\r\n\r\n#define NULL 0\r\n\r\n//copies n bytes between two memory areas; if there is overlap, the behavior is undefined\r\nvoid *memcpy(void *dest, void *src, float n) {\r\n preserve esi,edi;\r\n register float rem;\r\n \r\n esi = src;\r\n edi = dest;\r\n rem = n;\r\n while (rem) {\r\n register float count = rem;\r\n min count,8192;\r\n mcopy count;\r\n rem = rem - count;\r\n }\r\n return dest;\r\n}\r\n\r\n//copies n bytes between two memory areas; unlike with memcpy the areas may overlap\r\n//void *memmove(void *dest, void *src, float n);\r\n#define memmove memcpy\r\n\r\n//returns a pointer to the first occurrence of c in the first n bytes of s, or NULL if not found\r\nvoid* memchr(void *s, float c, float n) {\r\n register void *r = s;\r\n register float rem = n;\r\n\r\n while (rem) {\r\n if (*r == c) {\r\n return r;\r\n }\r\n ++r;\r\n --rem;\r\n }\r\n\r\n return NULL;\r\n}\r\n\r\n//compares the first n bytes of two memory areas\r\n//int memcmp(const void *s1, const void *s2, float n);\r\n#define memcmp strcmp\r\n\r\n//overwrites a memory area with n copies of c\r\nvoid* memset(void *ptr, float c, float n) {\r\n register void *p = ptr;\r\n register float rem = n;\r\n register float ch = c;\r\n\r\n while (rem) {\r\n *p++ = ch;\r\n --rem;\r\n }\r\n\r\n return ptr;\r\n}\r\n\r\n//appends the string src to dest\r\nchar* strcat(char *src, *dest) {\r\n register char *srcptr, *destptr;\r\n \r\n srcptr = src;\r\n while (*++srcptr) ;\r\n\r\n destptr = dest;\r\n while (*srcptr++ = *destptr++) ;\r\n return src;\r\n}\r\n\r\n//appends at most n bytes of the string src to dest\r\nchar* strncat(char *src, *dest, float n) {\r\n register char *srcptr, *destptr;\r\n register float i;\r\n \r\n srcptr = src;\r\n srcptr--;\r\n while (*++srcptr) ;\r\n\r\n destptr = dest;\r\n i = n;\r\n while (i--) {\r\n if (*srcptr++ = *destptr++) continue;\r\n }\r\n *srcptr = 0;\r\n return src;\r\n}\r\n\r\n//locates character c in a string, searching from the beginning\r\nchar* strchr(char *str, c) {\r\n register char *strptr, ch;\r\n strptr = str;\r\n ch = c;\r\n while(*strptr) {\r\n if (*strptr == ch) return strptr;\r\n ++strptr;\r\n }\r\n return 0;\r\n}\r\n\r\n//locates character c in a string, searching from the end\r\nchar* strrchr(char *str, c) {\r\n register char *strptr, ch;\r\n register char *findptr;\r\n \r\n findptr = 0;\r\n strptr = str;\r\n ch = c;\r\n while (*strptr) {\r\n if (*strptr == ch) findptr = strptr;\r\n ++strptr;\r\n }\r\n return findptr;\r\n}\r\n\r\n//compares two strings lexicographically\r\nfloat strcmp(char *src, *dest) {\r\n register char *srcptr, *destptr;\r\n\r\n srcptr = src;\r\n destptr = dest;\r\n while (*srcptr == *destptr) {\r\n if (*srcptr == 0) return 0;\r\n ++srcptr; ++destptr;\r\n }\r\n return (*srcptr - *destptr);\r\n}\r\n\r\n//compares up to the first n bytes of two strings lexicographically\r\nfloat strncmp(char *src, *dest, float n) {\r\n register char *srcptr, *destptr;\r\n register float i;\r\n \r\n srcptr = src;\r\n destptr = dest;\r\n i = n;\r\n\r\n while (i && (*srcptr == *destptr)) {\r\n if (*srcptr == 0) return 0;\r\n ++srcptr; ++destptr; --i;\r\n }\r\n if (i) return (*srcptr - *destptr);\r\n return 0;\r\n}\r\n\r\n//copies a string from one location to another\r\nchar* strcpy(char *dest, *src) {\r\n register char *srcptr, *destptr;\r\n\r\n destptr = dest;\r\n srcptr = src;\r\n while (*destptr++ = *srcptr++) ;\r\n return dest;\r\n}\r\n\r\n\r\n//write exactly n bytes to dest, copying from src or add 0's\r\nchar* strncpy(char *dest, *src, float n) {\r\n register char *srcptr, *destptr;\r\n register float i;\r\n\r\n destptr = dest;\r\n srcptr = src;\r\n i = n;\r\n \r\n while (i-- > 0) {\r\n if (*destptr++ = *srcptr++) continue;\r\n while (i-- > 0) *destptr++ = 0;\r\n }\r\n *destptr = 0;\r\n return dest;\r\n}\r\n\r\n//returns the string representation of an error number e.g. errno\r\n//char *strerror(int);\r\n\r\n//finds the length of a C string\r\nfloat strlen(char* str) {\r\n register char* strptr;\r\n register float n;\r\n \r\n strptr = str;\r\n n = 0;\r\n while (*strptr++) n++;\r\n return n;\r\n}\r\n\r\n//determines the length of the maximal initial substring consisting entirely of characters in accept\r\nfloat strspn(char *str, *accept) {\r\n register char *s = str;\r\n register char *p = accept;\r\n\r\n while (*p) {\r\n if (*p++ == *s) {\r\n ++s;\r\n p = accept;\r\n }\r\n }\r\n return s - str;\r\n}\r\n\r\n//determines the length of the maximal initial substring consisting entirely of characters not in reject\r\nfloat strcspn(char *str, char *reject) {\r\n register char *s, *p;\r\n \r\n for (s=str; *s; s++) {\r\n for (p=reject; *p; p++) {\r\n if (*p == *s) goto done;\r\n }\r\n }\r\n done:\r\n return s - str;\r\n}\r\n\r\n//finds the first occurrence of any character in accept\r\nchar* strpbrk(char *str, char *accept) {\r\n register char *s;\r\n register char *p;\r\n\r\n for (s=str; *s; s++) {\r\n for (p=accept; *p; p++) {\r\n if (*p == *s) return s;\r\n }\r\n }\r\n return NULL;\r\n}\r\n\r\n//finds the first occurrence of the string \"needle\" in the longer string \"haystack\"\r\nchar *strstr(char *haystack, char *needle) {\r\n register char *s = haystack;\r\n register char *p = needle;\r\n\r\n while (1) {\r\n if (!*p) {\r\n return haystack;\r\n }\r\n if (*p == *s) {\r\n ++p;\r\n ++s;\r\n } else {\r\n p = needle;\r\n if (!*s) {\r\n return NULL;\r\n }\r\n s = ++haystack;\r\n }\r\n }\r\n}\r\n\r\n//parses a string into a sequence of tokens; non-thread safe in the spec, non-reentrant\r\n//char *strtok(char *, const char * delim);\r\n\r\n//transforms src into a collating form, such that the numerical sort order of the transformed string is equivalent to the collating order of src\r\n//float strxfrm(char *dest, const char *src, float n);\r\n","cpuchip/lib/zcrt/ctype.txt":"//------------------------------------------------------------------------------\r\n// ZCPU CRT sourcecode (for HL-ZASM compiler) (C) 2011 by Black Phoenix\r\n//\r\n// Character classification functions.\r\n//------------------------------------------------------------------------------\r\n\r\n#define _CONTROL 1\r\n#define _SPACE 2\r\n#define _BLANK 4\r\n#define _DIGIT 8\r\n#define _HEX 16\r\n#define _PUNCT 32\r\n#define _UPPER 64\r\n#define _LOWER 128\r\n#define _GRAPH 256\r\n\r\n#define _MAXCHARS 0x83\r\n\r\n//test for alphanumeric character\r\nfloat isalnum(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n \r\n band eax,_LOWER+_UPPER+_DIGIT;\r\n}\r\n\r\n//test for alphabetic character\r\nfloat isalpha(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_LOWER+_UPPER;\r\n}\r\n\r\n//test for blank character\r\nfloat isblank(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_BLANK;\r\n}\r\n\r\n//test for control character\r\nfloat iscontrol(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_CONTROL;\r\n}\r\n\r\n//test for digit\r\nfloat isdigit(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_DIGIT;\r\n}\r\n\r\n//test for graphic character, excluding the space character\r\nfloat isgraph(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_GRAPH;\r\n}\r\n\r\n//test for lowercase character\r\nfloat islower(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_LOWER;\r\n}\r\n\r\n//test for printable character, including the space character.\r\nfloat isprint(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_LOWER+_UPPER+_DIGIT+_PUNCT+_BLANK+_GRAPH;\r\n}\r\n\r\n//test for punctuation character\r\nfloat ispunct(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_PUNCT;\r\n}\r\n\r\n//test for any whitespace character\r\nfloat isspace(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_SPACE;\r\n}\r\n\r\n//test for uppercase character\r\nfloat isupper(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_UPPER;\r\n}\r\n\r\n//test for hexadecimal digit. Not locale-specific.\r\nfloat isxdigit(char c) {\r\n preserve eax;\r\n eax = c; max eax,0; min eax,_MAXCHARS;\r\n eax = __ctype_characters[eax];\r\n\r\n band eax,_HEX;\r\n}\r\n\r\n//convert character to lowercase\r\nchar tolower(char c) {\r\n if (islower(c)) return c - 0x20;\r\n return c;\r\n}\r\n\r\n//convert character to uppercase\r\nchar toupper(char c) {\r\n if (isupper(c)) return c + 0x20;\r\n return c;\r\n}\r\n\r\n__ctype_characters:\r\n db _CONTROL, //00 (NUL)\r\n db _CONTROL; //01 (SOH)\r\n db _CONTROL; //02 (STX)\r\n db _CONTROL; //03 (ETX)\r\n db _CONTROL; //04 (EOT)\r\n db _CONTROL; //05 (ENQ)\r\n db _CONTROL; //06 (ACK)\r\n db _CONTROL; //07 (BEL)\r\n db _CONTROL; //08 (BS)\r\n db _SPACE+_CONTROL; //09 (HT)\r\n db _SPACE+_CONTROL; //0A (LF)\r\n db _SPACE+_CONTROL; //0B (VT)\r\n db _SPACE+_CONTROL; //0C (FF)\r\n db _SPACE+_CONTROL; //0D (CR)\r\n db _CONTROL; //0E (SI)\r\n db _CONTROL; //0F (SO)\r\n db _CONTROL; //10 (DLE)\r\n db _CONTROL; //11 (DC1)\r\n db _CONTROL; //12 (DC2)\r\n db _CONTROL; //13 (DC3)\r\n db _CONTROL; //14 (DC4)\r\n db _CONTROL; //15 (NAK)\r\n db _CONTROL; //16 (SYN)\r\n db _CONTROL; //17 (ETB)\r\n db _CONTROL; //18 (CAN)\r\n db _CONTROL; //19 (EM)\r\n db _CONTROL; //1A (SUB)\r\n db _CONTROL; //1B (ESC)\r\n db _CONTROL; //1C (FS)\r\n db _CONTROL; //1D (GS)\r\n db _CONTROL; //1E (RS)\r\n db _CONTROL; //1F (US)\r\n db _SPACE+_BLANK; //20 SPACE\r\n db _PUNCT; //21 !\r\n db _PUNCT; //22 \"\r\n db _PUNCT; //23 #\r\n db _PUNCT; //24 $\r\n db _PUNCT; //25 %\r\n db _PUNCT; //26 &\r\n db _PUNCT; //27 '\r\n db _PUNCT; //28 (\r\n db _PUNCT; //29 )\r\n db _PUNCT; //2A *\r\n db _PUNCT; //2B +\r\n db _PUNCT; //2C ;\r\n db _PUNCT; //2D -\r\n db _PUNCT; //2E .\r\n db _PUNCT; //2F /\r\n db _DIGIT+_HEX; //30 0\r\n db _DIGIT+_HEX; //31 1\r\n db _DIGIT+_HEX; //32 2\r\n db _DIGIT+_HEX; //33 3\r\n db _DIGIT+_HEX; //34 4\r\n db _DIGIT+_HEX; //35 5\r\n db _DIGIT+_HEX; //36 6\r\n db _DIGIT+_HEX; //37 7\r\n db _DIGIT+_HEX; //38 8\r\n db _DIGIT+_HEX; //39 9\r\n db _PUNCT; //3A :\r\n db _PUNCT; //3B ;\r\n db _PUNCT; //3C <\r\n db _PUNCT; //3D =\r\n db _PUNCT; //3E >\r\n db _PUNCT; //3F ?\r\n db _PUNCT; //40 @\r\n db _UPPER+_HEX; //41 A\r\n db _UPPER+_HEX; //42 B\r\n db _UPPER+_HEX; //43 C\r\n db _UPPER+_HEX; //44 D\r\n db _UPPER+_HEX; //45 E\r\n db _UPPER+_HEX; //46 F\r\n db _UPPER; //47 G\r\n db _UPPER; //48 H\r\n db _UPPER; //49 I\r\n db _UPPER; //4A J\r\n db _UPPER; //4B K\r\n db _UPPER; //4C L\r\n db _UPPER; //4D M\r\n db _UPPER; //4E N\r\n db _UPPER; //4F O\r\n db _UPPER; //50 P\r\n db _UPPER; //51 Q\r\n db _UPPER; //52 R\r\n db _UPPER; //53 S\r\n db _UPPER; //54 T\r\n db _UPPER; //55 U\r\n db _UPPER; //56 V\r\n db _UPPER; //57 W\r\n db _UPPER; //58 X\r\n db _UPPER; //59 Y\r\n db _UPPER; //5A Z\r\n db _PUNCT; //5B [\r\n db _PUNCT; //5C \\\r\n db _PUNCT; //5D ]\r\n db _PUNCT; //5E ^\r\n db _PUNCT; //5F _\r\n db _PUNCT; //60 `\r\n db _LOWER+_HEX; //61 a\r\n db _LOWER+_HEX; //62 b\r\n db _LOWER+_HEX; //63 c\r\n db _LOWER+_HEX; //64 d\r\n db _LOWER+_HEX; //65 e\r\n db _LOWER+_HEX; //66 f\r\n db _LOWER; //67 g\r\n db _LOWER; //68 h\r\n db _LOWER; //69 i\r\n db _LOWER; //6A j\r\n db _LOWER; //6B k\r\n db _LOWER; //6C l\r\n db _LOWER; //6D m\r\n db _LOWER; //6E n\r\n db _LOWER; //6F o\r\n db _LOWER; //70 p\r\n db _LOWER; //71 q\r\n db _LOWER; //72 r\r\n db _LOWER; //73 s\r\n db _LOWER; //74 t\r\n db _LOWER; //75 u\r\n db _LOWER; //76 v\r\n db _LOWER; //77 w\r\n db _LOWER; //78 x\r\n db _LOWER; //79 y\r\n db _LOWER; //7A z\r\n db _PUNCT; //7B {\r\n db _PUNCT; //7C |\r\n db _PUNCT; //7D }\r\n db _PUNCT; //7E ~\r\n db _CONTROL; //7F (DEL)\r\n \r\n db _GRAPH; //80\r\n db _GRAPH; //81\r\n db _GRAPH; //82\r\n db _GRAPH; //83","cpuchip/lib/zcrt/init.txt":"//------------------------------------------------------------------------------\r\n// ZCPU CRT sourcecode (for HL-ZASM compiler) (C) 2011 by Black Phoenix\r\n//\r\n// C runtime library initialization\r\n//------------------------------------------------------------------------------\r\n\r\n#ifdef ZCRT_EXTENDED_MODE\r\n // Initialize extended mode\r\n mov edi,&zcrtInterruptTable; //Need \"&\" because array is defined below\r\n mov esi,&zcrtInterruptTable; add esi,1024;\r\n @InitTable:\r\n mov #edi,zcrtErrorHandler; inc edi;\r\n mov #edi,0; inc edi;\r\n mov #edi,0; inc edi;\r\n mov #edi,32; inc edi;\r\n cmp edi,esi;\r\n jl @InitTable;\r\n\r\n lidtr zcrtInterruptTable;\r\n stef;\r\n#endif\r\n\r\n// Call main function\r\nmain();\r\n\r\n// Stop the processor execution\r\n#ifdef ZCRT_EXTENDED_MODE\r\n clef;\r\n#endif\r\nint 1;\r\n\r\n//------------------------------------------------------------------------------\r\n// Allocate the interrupt table\r\n#ifdef ZCRT_EXTENDED_MODE\r\n float zcrtInterruptTable[1024];\r\n char* zcrtInterruptEntrypoint;\r\n \r\n // Default interrupt handlers\r\n zcrtErrorHandler:\r\n //Execute handler if required\r\n if (zcrtInterruptEntrypoint) {\r\n float errorNo,errorCode;\r\n cpuget errorNo,28;\r\n cpuget errorCode,27;\r\n\r\n zcrtInterruptEntrypoint(errorNo,errorCode);\r\n }\r\n iret\r\n#endif\r\n"}},"cpuchip/programs/":[]}} diff --git a/lua/wire/gates/string.lua b/lua/wire/gates/string.lua index 6b0629a0..277e45a2 100644 --- a/lua/wire/gates/string.lua +++ b/lua/wire/gates/string.lua @@ -139,14 +139,14 @@ GateActions["string_concat"] = { inputtypes = { "STRING" , "STRING" , "STRING" , "STRING" , "STRING" , "STRING" , "STRING" , "STRING" }, outputtypes = { "STRING" }, output = function(gate, A, B, C, D, E, F, G, H) - if (A and #A or 0) - + (B and #B or 0) - + (C and #C or 0) - + (D and #D or 0) - + (E and #E or 0) - + (F and #F or 0) - + (G and #G or 0) - + (H and #H or 0) > MAX_LEN + if (A and #A or 0) + + (B and #B or 0) + + (C and #C or 0) + + (D and #D or 0) + + (E and #E or 0) + + (F and #F or 0) + + (G and #G or 0) + + (H and #H or 0) > MAX_LEN then return false end @@ -266,9 +266,9 @@ GateActions["string_repeat"] = { output = function(gate, A, B) if !A then A = "" end if !B or B<1 then B = 1 end - + if B * #A > MAX_LEN then return false end - + return string.rep(A,B) end, label = function(Out, A) @@ -307,52 +307,52 @@ GateActions["string_to_memory"] = { inputs = { "A" }, inputtypes = { "STRING" }, outputs = { "Memory" }, - reset = function(gate) + reset = function(gate) gate.stringQueued = false gate.stringChanged = false - gate.currentString = "" + gate.currentString = "" end, output = function(gate, A) if (A ~= gate.currentString) then - if (not gate.stringChanged) then - gate.stringChanged = true - gate.currentString = A - gate.stringQueued = false - else - gate.stringQueued = true - end + if (not gate.stringChanged) then + gate.stringChanged = true + gate.currentString = A + gate.stringQueued = false + else + gate.stringQueued = true + end end - return gate.Outputs["Memory"].Value --This will prevent Wire_TriggerOutput from changing anything + return gate.Outputs["Memory"].Value --This will prevent Wire_TriggerOutput from changing anything end, - ReadCell = function(self, gate, Address) - if (Address == 0) then --Clk - if (gate.stringChanged) then return 1 else return 0 end - elseif (Address == 1) then --String length - return #(gate.currentString) - else --Return string bytes - local index = Address - 1 - if (index > #(gate.currentString)) then -- Check whether requested address is outside the string - return 0 - else - return string.byte(gate.currentString, index) - end - end + ReadCell = function(self, gate, Address) + if (Address == 0) then --Clk + if (gate.stringChanged) then return 1 else return 0 end + elseif (Address == 1) then --String length + return #(gate.currentString) + else --Return string bytes + local index = Address - 1 + if (index > #(gate.currentString)) then -- Check whether requested address is outside the string + return 0 + else + return string.byte(gate.currentString, index) + end + end end, WriteCell = function(self, gate, Address, value) - if (Address == 0) and (value == 0) then --String got accepted - gate.stringChanged = false + if (Address == 0) and (value == 0) then --String got accepted + gate.stringChanged = false if gate.stringQueued then --Get queued string gate.stringQueued = false gate.currentString = gate.Inputs["A"].Value - gate.stringChanged = true + gate.stringChanged = true end return true - else - return false - end + else + return false + end end } @@ -369,22 +369,22 @@ GateActions["string_from_memory"] = { gate.ready = true end, - output = function(gate) - return gate.currentString, gate.Outputs["Memory"].Value + output = function(gate) + return gate.currentString, gate.Outputs["Memory"].Value end, - ReadCell = function(self, gate, address) - if (address == 0) then - return 0 - elseif (address == 1) then - return gate.stringLength - else - return gate.memory[address-1] or 0 -- "or 0" to prevent it from returning nil if index is outside the array - end + ReadCell = function(self, gate, address) + if (address == 0) then + return 0 + elseif (address == 1) then + return gate.stringLength + else + return gate.memory[address-1] or 0 -- "or 0" to prevent it from returning nil if index is outside the array + end end, WriteCell = function(self, gate, address, value) - if (value >= 0) then + if (value >= 0) then if (address == 0) and (value == 1) then -- Clk has been set local maxIndex = gate.stringLength for i=1,gate.stringLength,1 do diff --git a/lua/wire/gpulib.lua b/lua/wire/gpulib.lua index 56f7f8b5..52baecf5 100644 --- a/lua/wire/gpulib.lua +++ b/lua/wire/gpulib.lua @@ -133,7 +133,7 @@ if CLIENT then // // Create basic fonts // - local fontData = + local fontData = { font="lucida console", size=20, @@ -421,7 +421,7 @@ if CLIENT then } local mins, maxs = screen:OBBMins(), screen:OBBMaxs() - + local timerid = "wire_gpulib_updatebounds"..screen:EntIndex() local function setbounds() if not screen:IsValid() then diff --git a/lua/wire/server/modelplug.lua b/lua/wire/server/modelplug.lua index 2e177f4d..64d090a7 100644 --- a/lua/wire/server/modelplug.lua +++ b/lua/wire/server/modelplug.lua @@ -8,7 +8,7 @@ function ModelPlug_Register(category) local packs = file.Find("WireModelPacks/*.txt", "DATA") for _,filename in pairs(packs) do - --resource.AddFile("data/WireModelPacks/" .. filename) + --resource.AddFile("data/WireModelPacks/" .. filename) local packtbl = util.KeyValuesToTable(file.Read("WireModelPacks/" .. filename) or {}) diff --git a/lua/wire/stools/7seg.lua b/lua/wire/stools/7seg.lua index 3f55da66..8229549d 100644 --- a/lua/wire/stools/7seg.lua +++ b/lua/wire/stools/7seg.lua @@ -109,4 +109,4 @@ function TOOL.BuildCPanel(panel) }) panel:CheckBox("#ToolWire7SegTool_worldweld", "wire_7seg_worldweld") -end \ No newline at end of file +end diff --git a/lua/wire/stools/addressbus.lua b/lua/wire/stools/addressbus.lua index c72b6af4..cb828389 100644 --- a/lua/wire/stools/addressbus.lua +++ b/lua/wire/stools/addressbus.lua @@ -50,7 +50,7 @@ end function TOOL.BuildCPanel(panel) WireToolHelpers.MakePresetControl(panel, "wire_addressbus") ModelPlug_AddToCPanel(panel, "gate", "wire_addressbus", nil, 4) - + panel:NumSlider("1 offset", "wire_addressbus_addrspace1st", 0, 16777216, 0) panel:NumSlider("1 size", "wire_addressbus_addrspace1sz", 0, 16777216, 0) panel:NumSlider("2 offset", "wire_addressbus_addrspace2st", 0, 16777216, 0) diff --git a/lua/wire/stools/adv_input.lua b/lua/wire/stools/adv_input.lua index fb34e588..111b7605 100644 --- a/lua/wire/stools/adv_input.lua +++ b/lua/wire/stools/adv_input.lua @@ -18,13 +18,13 @@ WireToolSetup.SetupMax( 20 ) if SERVER then ModelPlug_Register("Numpad") - - function TOOL:GetConVars() + + function TOOL:GetConVars() return self:GetClientNumber( "keymore" ), self:GetClientNumber( "keyless" ), self:GetClientNumber( "toggle" ), self:GetClientNumber( "value_min" ), self:GetClientNumber( "value_max" ), self:GetClientNumber( "value_start" ), self:GetClientNumber( "speed" ) end - + -- Uses default WireToolObj:MakeEnt's WireLib.MakeWireEnt function end diff --git a/lua/wire/stools/button.lua b/lua/wire/stools/button.lua index 65828609..29b8d69c 100644 --- a/lua/wire/stools/button.lua +++ b/lua/wire/stools/button.lua @@ -15,9 +15,9 @@ WireToolSetup.SetupMax( 20 ) if SERVER then ModelPlug_Register("button") - - function TOOL:GetConVars() - return self:GetClientNumber( "toggle" ) ~= 0, self:GetClientNumber( "value_off" ), self:GetClientNumber( "value_on" ), + + function TOOL:GetConVars() + return self:GetClientNumber( "toggle" ) ~= 0, self:GetClientNumber( "value_off" ), self:GetClientNumber( "value_on" ), self:GetClientInfo( "description" ), self:GetClientNumber( "entityout" ) ~= 0 end diff --git a/lua/wire/stools/cam.lua b/lua/wire/stools/cam.lua index a5a67906..4e4ac4c1 100644 --- a/lua/wire/stools/cam.lua +++ b/lua/wire/stools/cam.lua @@ -57,14 +57,14 @@ function TOOL.BuildCPanel(panel) panel:CheckBox("#Tool.wire_cam.autounclip", "wire_cam_autounclip" ) panel:Help( "Automatically prevents the camera from clipping into walls by moving it closer to the parent entity (or cam controller if no parent is specified)." ) panel:CheckBox("#Tool.wire_cam.autounclip_ignorewater", "wire_cam_autounclip_ignorewater" ) - + panel:CheckBox("#Tool.wire_cam.drawplayer", "wire_cam_drawplayer" ) panel:Help( "Enable/disable the player being able to see themselves. Useful if you want to position the camera inside the player's head." ) panel:CheckBox("#Tool.wire_cam.drawparent", "wire_cam_drawparent" ) panel:Help( "Enable/disable the rendering of the parent entity. Useful if you want to position the camera inside the parent." ) - - panel:Help( "As you may have noticed, there are a lot of behaviours that change depending on which checkboxes are checked. For a detailed walk-through of everything, go to http://wiki.wiremod.com/wiki/Cam_Controller") - + + panel:Help( "As you may have noticed, there are a lot of behaviours that change depending on which checkboxes are checked. For a detailed walk-through of everything, go to http://wiki.wiremod.com/wiki/Cam_Controller") + panel:NumSlider( "#Tool.wire_cam.smooth_amount", "wire_cam_smooth_amount", 4, 30, 1 ) panel:Help( "Smooth speed is a client side setting, and is not saved on the cam controller entity. Changing it will immediately affect all cam controllers you use." ) end diff --git a/lua/wire/stools/cd_disk.lua b/lua/wire/stools/cd_disk.lua index d545646e..6c25d9d5 100644 --- a/lua/wire/stools/cd_disk.lua +++ b/lua/wire/stools/cd_disk.lua @@ -17,7 +17,7 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if (SERVER) then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber( "precision" ), self:GetClientNumber( "iradius" ), self:GetClientNumber( "skin" ) end end diff --git a/lua/wire/stools/cd_ray.lua b/lua/wire/stools/cd_ray.lua index 6a7b414b..c00373c8 100644 --- a/lua/wire/stools/cd_ray.lua +++ b/lua/wire/stools/cd_ray.lua @@ -25,7 +25,7 @@ TOOL.ClientConVar[ "Range" ] = "64" TOOL.ClientConVar[ "DefaultZero" ] = "0" if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber("Range"), self:GetClientNumber("DefaultZero") ~= 0 end diff --git a/lua/wire/stools/clutch.lua b/lua/wire/stools/clutch.lua index 84552dac..aa974a3d 100644 --- a/lua/wire/stools/clutch.lua +++ b/lua/wire/stools/clutch.lua @@ -52,7 +52,7 @@ end if CLIENT then local Linked_Ents = {} -- Table of constrained ents, with Ent1 as k and Ent2 as v local Unique_Ents = {} -- Table of entities as keys - + // Receive stage 0 info local function Receive_links( um ) table.Empty( Linked_Ents ) diff --git a/lua/wire/stools/colorer.lua b/lua/wire/stools/colorer.lua index c7171400..beb1a320 100644 --- a/lua/wire/stools/colorer.lua +++ b/lua/wire/stools/colorer.lua @@ -16,7 +16,7 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber( "outColor" ) ~= 0, self:GetClientNumber( "range" ) end end diff --git a/lua/wire/stools/cpu.lua b/lua/wire/stools/cpu.lua index 59a2c61e..2d842611 100644 --- a/lua/wire/stools/cpu.lua +++ b/lua/wire/stools/cpu.lua @@ -204,8 +204,8 @@ if CLIENT then net.Receive("CPULib.ServerUploading", function(netlen) CPULib.ServerUploading = net.ReadBit() ~= 0 end) - - local fontData = + + local fontData = { font = "Lucida Console", size = 30, @@ -215,7 +215,7 @@ if CLIENT then } surface.CreateFont( "ZCPUToolScreenFont", fontData ) fontData.size = 26 - surface.CreateFont( "ZCPUToolScreenFontSmall", fontData ) + surface.CreateFont( "ZCPUToolScreenFontSmall", fontData ) local function outc(text,y,color) draw.DrawText(text or "","ZCPUToolScreenFont",2,32*y,color,0) end local prevStateTime = RealTime() diff --git a/lua/wire/stools/damage_detector.lua b/lua/wire/stools/damage_detector.lua index ae6d4392..039041f2 100644 --- a/lua/wire/stools/damage_detector.lua +++ b/lua/wire/stools/damage_detector.lua @@ -27,4 +27,4 @@ WireToolSetup.SetupLinking() function TOOL.BuildCPanel(panel) ModelPlug_AddToCPanel(panel, "Misc_Tools", "wire_damage_detector") panel:CheckBox("#Tool.wire_damage_detector.includeconstrained","wire_damage_detector_includeconstrained") -end \ No newline at end of file +end diff --git a/lua/wire/stools/data_transferer.lua b/lua/wire/stools/data_transferer.lua index 7c6d4906..c4c3ebbe 100644 --- a/lua/wire/stools/data_transferer.lua +++ b/lua/wire/stools/data_transferer.lua @@ -15,10 +15,10 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber("Range"), self:GetClientNumber("DefaultZero") ~= 0, self:GetClientNumber("IgnoreZero") ~= 0 end - + -- Uses default WireToolObj:MakeEnt's WireLib.MakeWireEnt function end diff --git a/lua/wire/stools/dataplug.lua b/lua/wire/stools/dataplug.lua index dab7fb2e..c5993966 100644 --- a/lua/wire/stools/dataplug.lua +++ b/lua/wire/stools/dataplug.lua @@ -27,7 +27,7 @@ TOOL.ClientConVar["model"] = "models/hammy/pci_slot.mdl" TOOL.ClientConVar["weldforce"] = 5000 TOOL.ClientConVar["attachrange"] = 5 -function TOOL:GetConVars() +function TOOL:GetConVars() return self:GetClientNumber("weldforce"), math.Clamp(self:GetClientNumber("attachrange"), 1, 100) end diff --git a/lua/wire/stools/datarate.lua b/lua/wire/stools/datarate.lua index 7c48c6f8..235f3d6b 100644 --- a/lua/wire/stools/datarate.lua +++ b/lua/wire/stools/datarate.lua @@ -18,5 +18,3 @@ end function TOOL.BuildCPanel(panel) ModelPlug_AddToCPanel(panel, "gate", "wire_datarate", nil, 4) end - - diff --git a/lua/wire/stools/detonator.lua b/lua/wire/stools/detonator.lua index c5631faf..9d611541 100644 --- a/lua/wire/stools/detonator.lua +++ b/lua/wire/stools/detonator.lua @@ -11,10 +11,10 @@ WireToolSetup.SetupMax( 20 ) if SERVER then ModelPlug_Register("detonator") - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber( "damage" ) end - + function TOOL:MakeEnt(ply, model, Ang, trace) local ent = WireToolObj.MakeEnt(self, ply, model, Ang, trace ) ent.target = trace.Entity diff --git a/lua/wire/stools/dhdd.lua b/lua/wire/stools/dhdd.lua index cb7c17c2..579cb64b 100644 --- a/lua/wire/stools/dhdd.lua +++ b/lua/wire/stools/dhdd.lua @@ -11,13 +11,13 @@ if CLIENT then language.Add( "Tool.wire_dhdd.note", "NOTE: The DHDD only saves the first\n512^2 values to prevent\nmassive dupe files and lag." ) TOOL.ClientConVar["model"] = "models/jaanus/wiretool/wiretool_gate.mdl" - + function TOOL.BuildCPanel( panel ) ModelPlug_AddToCPanel(panel, "gate", "wire_dhdd", nil, 4) - + panel:Help("#Tool.wire_dhdd.note") end - + WireToolSetup.setToolMenuIcon( "icon16/database.png" ) end WireToolSetup.BaseLang() diff --git a/lua/wire/stools/digitalscreen.lua b/lua/wire/stools/digitalscreen.lua index 8f3cc909..0def44f4 100644 --- a/lua/wire/stools/digitalscreen.lua +++ b/lua/wire/stools/digitalscreen.lua @@ -27,4 +27,4 @@ function TOOL.BuildCPanel(panel) panel:NumSlider("Width", "wire_digitalscreen_width", 1, 512, 0) panel:NumSlider("Height", "wire_digitalscreen_height", 1, 512, 0) panel:CheckBox("#Create Flat to Surface", "wire_digitalscreen_createflat") -end \ No newline at end of file +end diff --git a/lua/wire/stools/dual_input.lua b/lua/wire/stools/dual_input.lua index 601caa21..6eccd85b 100644 --- a/lua/wire/stools/dual_input.lua +++ b/lua/wire/stools/dual_input.lua @@ -17,8 +17,8 @@ WireToolSetup.SetupMax( 20 ) if SERVER then ModelPlug_Register("Numpad") - - function TOOL:GetConVars() + + function TOOL:GetConVars() return self:GetClientNumber( "keygroup" ), self:GetClientNumber( "keygroup2" ), self:GetClientNumber( "toggle" ), self:GetClientNumber( "value_off" ), self:GetClientNumber( "value_on" ), self:GetClientNumber( "value_on2" ) end @@ -56,4 +56,4 @@ function TOOL.BuildCPanel(panel) panel:NumSlider("#WireDualInputTool_value_on", "wire_dual_input_value_on", -10, 10, 1) panel:NumSlider("#WireDualInputTool_value_off", "wire_dual_input_value_off", -10, 10, 1) panel:NumSlider("#WireDualInputTool_value_on2", "wire_dual_input_value_on2", -10, 10, 1) -end \ No newline at end of file +end diff --git a/lua/wire/stools/dynamic_button.lua b/lua/wire/stools/dynamic_button.lua index aa702971..d478dd49 100644 --- a/lua/wire/stools/dynamic_button.lua +++ b/lua/wire/stools/dynamic_button.lua @@ -18,10 +18,10 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if SERVER then - function TOOL:GetConVars() - return self:GetClientNumber( "toggle" ) ~= 0, self:GetClientNumber( "value_on" ), self:GetClientNumber( "value_off" ), - self:GetClientInfo( "description" ), self:GetClientNumber( "entityout" ) ~= 0, self:GetClientInfo( "material_on" ), self:GetClientInfo( "material_off" ), - self:GetClientNumber( "on_r" ), self:GetClientNumber( "on_g" ), self:GetClientNumber( "on_b" ), + function TOOL:GetConVars() + return self:GetClientNumber( "toggle" ) ~= 0, self:GetClientNumber( "value_on" ), self:GetClientNumber( "value_off" ), + self:GetClientInfo( "description" ), self:GetClientNumber( "entityout" ) ~= 0, self:GetClientInfo( "material_on" ), self:GetClientInfo( "material_off" ), + self:GetClientNumber( "on_r" ), self:GetClientNumber( "on_g" ), self:GetClientNumber( "on_b" ), self:GetClientNumber( "off_r" ), self:GetClientNumber( "off_g" ), self:GetClientNumber( "off_b" ) end @@ -85,4 +85,4 @@ function TOOL.BuildCPanel(panel) panel:CheckBox("#WireDynamicButtonTool_toggle", "wire_dynamic_button_toggle") panel:CheckBox("#WireDynamicButtonTool_entityout", "wire_dynamic_button_entityout") -end \ No newline at end of file +end diff --git a/lua/wire/stools/egp.lua b/lua/wire/stools/egp.lua index 7af86277..bad12321 100644 --- a/lua/wire/stools/egp.lua +++ b/lua/wire/stools/egp.lua @@ -86,7 +86,7 @@ if (SERVER) then ent = SpawnEGP( ply, trace.HitPos, self:GetAngle(trace), model ) if not IsValid(ent) then return end - + self:SetPos(ent, trace) -- Use WireToolObj's pos code elseif (Type == 2) then -- HUD ent = SpawnHUD( ply, trace.HitPos + trace.HitNormal * 0.25, trace.HitNormal:Angle() + Angle(90,0,0) ) @@ -191,13 +191,13 @@ else local Menu = {} local CurEnt - + function refreshRT( ent ) ent.GPU:FreeRT() ent.GPU = GPULib.WireGPU( ent ) ent:EGP_Update() end - + function refreshObjects( ent ) if ent then RunConsoleCommand("EGP_Request_Reload",ent:EntIndex()) @@ -236,9 +236,9 @@ else btn:SetSize( w, h ) function btn:DoClick() pnl:SetVisible( false ) - + refreshRT( CurEnt ) - + LocalPlayer():ChatPrint("[EGP] RenderTarget reloaded.") end @@ -248,9 +248,9 @@ else btn2:SetSize( w, h ) function btn2:DoClick() pnl:SetVisible( false ) - + refreshObjects( CurEnt ) - + LocalPlayer():ChatPrint("[EGP] Requesting...") end @@ -264,7 +264,7 @@ else LocalPlayer():ChatPrint("[EGP] Entity does not have a RenderTarget") else refreshRT( CurEnt ) - + LocalPlayer():ChatPrint("[EGP] RenderTarget reloaded.") end LocalPlayer():ChatPrint("[EGP] Requesting object reload...") @@ -341,7 +341,7 @@ else if !(EGP) then return end panel:SetSpacing( 10 ) panel:SetName( "E2 Graphics Processor" ) - + WireDermaExts.ModelSelect(panel, "wire_egp_model", list.Get( "WireScreenModels" ), 5) local cbox = {} diff --git a/lua/wire/stools/emarker.lua b/lua/wire/stools/emarker.lua index 9aa52dd7..821171f8 100644 --- a/lua/wire/stools/emarker.lua +++ b/lua/wire/stools/emarker.lua @@ -21,7 +21,7 @@ TOOL.ClientConVar = { if SERVER then -- Uses default WireToolObj:MakeEnt's WireLib.MakeWireEnt function end - + function TOOL:LeftClick(trace) if not trace.HitPos or trace.Entity:IsPlayer() then return false end if ( CLIENT ) then return true end @@ -99,4 +99,4 @@ end function TOOL.BuildCPanel(panel) ModelPlug_AddToCPanel(panel, "Misc_Tools", "wire_emarker") -end \ No newline at end of file +end diff --git a/lua/wire/stools/explosive.lua b/lua/wire/stools/explosive.lua index 10c16c3e..2fe93118 100644 --- a/lua/wire/stools/explosive.lua +++ b/lua/wire/stools/explosive.lua @@ -51,14 +51,14 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber("trigger"), self:GetClientNumber("damage"), self:GetClientNumber("delaytime"), self:GetClientNumber("removeafter")~=0, self:GetClientNumber("radius"), self:GetClientNumber("affectother")~=0, self:GetClientNumber("notaffected")~=0, self:GetClientNumber("delayreloadtime"), self:GetClientNumber("maxhealth"), self:GetClientNumber("bulletproof")~=0, self:GetClientNumber("explosionproof")~=0, self:GetClientNumber("fallproof")~=0, self:GetClientNumber("explodeatzero")~=0, self:GetClientNumber("resetatexplode")~=0, self:GetClientNumber("fireeffect")~=0, self:GetClientNumber("coloreffect")~=0, self:GetClientNumber("invisibleatzero")~=0 end - + -- Uses default WireToolObj:MakeEnt's WireLib.MakeWireEnt function end diff --git a/lua/wire/stools/expression2.lua b/lua/wire/stools/expression2.lua index f4fe1bb7..8a086ea5 100644 --- a/lua/wire/stools/expression2.lua +++ b/lua/wire/stools/expression2.lua @@ -28,11 +28,11 @@ WireToolSetup.BaseLang() if SERVER then CreateConVar('sbox_maxwire_expressions', 20) - + function TOOL:MakeEnt(ply, model, Ang, trace) return MakeWireExpression2(ply, trace.HitPos, Ang, model) end - + function TOOL:PostMake(ent) self:Upload(ent) end @@ -73,7 +73,7 @@ if SERVER then function TOOL:Upload(ent) WireLib.Expression2Upload( self:GetOwner(), ent ) end - + function WireLib.Expression2Upload( ply, target, filepath ) if not IsValid( target ) then error( "Invalid entity specified" ) end net.Start("wire_expression2_tool_upload") @@ -124,7 +124,7 @@ if SERVER then if not includes or not next(includes) then -- There are no includes local datastr = WireLib.von.serialize({ { targetEnt.name, main } }) local numpackets = math.ceil(#datastr / 64000) - + local n = 0 for i = 1, #datastr, 64000 do timer.Simple( n, function() @@ -232,11 +232,11 @@ if SERVER then WireLib.AddNotify(ply, "You are not allowed to upload to the target Expression chip. Upload aborted.", NOTIFY_ERROR, 7, NOTIFYSOUND_DRIP3) return end - + if upload_ents[ply] ~= toent then -- a new upload was started, abort previous uploads[ply] = nil end - + upload_ents[ply] = toent if not uploads[ply] then uploads[ply] = {} end @@ -258,7 +258,7 @@ if SERVER then for k, v in pairs(ret[2]) do includes[k] = v end - + local filepath = ret[3] toent:Setup(code, includes, nil, nil, filepath) @@ -341,27 +341,27 @@ if SERVER then WireLib.ClientError("You do not have permission to reset this E2.", player) end end) - + ------------------------------------------------------ -- Syncing ops for remote uploader (admin only) -- Server part ------------------------------------------------------ - + local players_synced = {} util.AddNetworkString( "wire_expression_sync_ops" ) concommand.Add("wire_expression_ops_sync", function(player,command,args) if not player:IsAdmin() then return end - + local bool = args[1] ~= "0" - + if bool then players_synced[player] = true else players_synced[player] = nil end - + if next( players_synced ) and not timer.Exists( "wire_expression_ops_sync" ) then - + timer.Create( "wire_expression_ops_sync",0.2,0,function() local plys = {} for ply,_ in pairs( players_synced ) do @@ -374,7 +374,7 @@ if SERVER then if not next( players_synced ) then timer.Remove( "wire_expression_ops_sync" ) end - + local E2s = ents.FindByClass("gmod_wire_expression2") net.Start( "wire_expression_sync_ops" ) @@ -391,7 +391,7 @@ if SERVER then elseif not next( players_synced ) and timer.Exists( "wire_expression_ops_sync" ) then timer.Remove( "wire_expression_ops_sync" ) end - + end) elseif CLIENT then ------------------------------------------------------ @@ -406,9 +406,9 @@ elseif CLIENT then local prfbench = net.ReadDouble() local prfcount = net.ReadDouble() local timebench = net.ReadDouble() - + local data = E2:GetOverlayData() or {} - + E2:SetOverlayData( { txt = data.txt or "(generic)", error = data.error or false, @@ -423,19 +423,19 @@ elseif CLIENT then -------------------------------------------------------------- -- Clientside Send -------------------------------------------------------------- - + local queue_max = 0 local queue = {} local sending = false - + local upload_queue - + -- send next E2 local function next_queue() local queue_progress = (queue_max > 1 and (1-((#queue-1) / queue_max)) * 100 or nil) Expression2SetProgress( nil, queue_progress ) table.remove( queue, 1 ) - + -- Clear away all removed E2s from the queue while true do if #queue == 0 then break end @@ -446,7 +446,7 @@ elseif CLIENT then break end end - + timer.Simple( 1, function() -- wait a while before doing anything so stuff doesn't lag if #queue == 0 then Expression2SetProgress() @@ -457,14 +457,14 @@ elseif CLIENT then end end) end - + upload_queue = function(first) local q = queue[1] - + local targetEnt = q.targetEnt local datastr = q.datastr local timeStarted = q.timeStarted - + local queue_progress = (queue_max > 1 and (1-((#queue-1) / queue_max)) * 100 or nil) Expression2SetProgress(1, queue_progress) @@ -485,14 +485,14 @@ elseif CLIENT then return end end - + if packet == numpackets then next_queue() end - + local queue_progress = (queue_max > 1 and (1-((#queue-1) / queue_max)) * 100 or nil) Expression2SetProgress( packet / numpackets * 100, queue_progress ) - + net.Start("wire_expression2_upload") net.WriteUInt(targetEnt, 16) net.WriteUInt(numpackets, 16) @@ -509,7 +509,7 @@ elseif CLIENT then if not IsValid(targetEnt) then return end -- We don't know what entity its going to targetEnt = targetEnt:EntIndex() end - + for i=1,#queue do if queue[i].targetEnt == targetEnt then WireLib.AddNotify("You're already uploading that E2!", NOTIFY_ERROR, 7, NOTIFYSOUND_ERROR1) @@ -546,15 +546,15 @@ elseif CLIENT then else datastr = E2Lib.encode(WireLib.von.serialize({ code, {}, filepath })) end - + queue[#queue+1] = { targetEnt = targetEnt, datastr = datastr, timeStarted = CurTime() } - + queue_max = queue_max + 1 - + if sending then return end sending = true upload_queue(true) // true means its the first packet, suppressing the delay @@ -584,13 +584,13 @@ elseif CLIENT then local current_ent net.Receive("wire_expression2_download", function(len) local ent = net.ReadEntity() - + if IsValid( current_ent ) and IsValid( ent ) and ent ~= current_ent then -- different E2, reset buffer buffer = "" count = 0 end - + local uploadandexit = net.ReadBit() ~= 0 local numpackets = net.ReadUInt(16) @@ -917,7 +917,7 @@ elseif CLIENT then surface.SetFont("Expression2ToolScreenSubFont") local w2, h2 = surface.GetTextSize(" ") - if percent or percent2 then + if percent or percent2 then surface.SetFont("Expression2ToolScreenFont") local w, h = surface.GetTextSize(what) DrawTextOutline(what, "Expression2ToolScreenFont", 128, 128, Color(224, 224, 224, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, Color(0, 0, 0, 255), 4) @@ -1026,4 +1026,4 @@ function TOOL:GetModel() local scriptmodel = self:GetClientInfo("scriptmodel") if scriptmodel and scriptmodel ~= "" and validModelCached(scriptmodel) then return Model(scriptmodel) end return WireToolObj.GetModel(self) -end \ No newline at end of file +end diff --git a/lua/wire/stools/extbus.lua b/lua/wire/stools/extbus.lua index 5c4c8a9c..bda8ab00 100644 --- a/lua/wire/stools/extbus.lua +++ b/lua/wire/stools/extbus.lua @@ -14,4 +14,3 @@ TOOL.ClientConVar[ "model" ] = "models/jaanus/wiretool/wiretool_gate.mdl" function TOOL.BuildCPanel(panel) WireDermaExts.ModelSelect(panel, "wire_extbus_model", list.Get("Wire_gate_Models"), 5) end - diff --git a/lua/wire/stools/eyepod.lua b/lua/wire/stools/eyepod.lua index 37cd0067..a0396320 100644 --- a/lua/wire/stools/eyepod.lua +++ b/lua/wire/stools/eyepod.lua @@ -22,7 +22,7 @@ TOOL.ClientConVar[ "YMin" ] = "0" TOOL.ClientConVar[ "YMax" ] = "0" if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() local DefaultToZero = self:GetClientNumber("DefaultToZero") local CumulativeOutput = self:GetClientNumber("CumulativeOutput") local ShowRateOfChange = (CumulativeOutput ~= 0) and 0 or 1 diff --git a/lua/wire/stools/forcer.lua b/lua/wire/stools/forcer.lua index ed8c837a..53f5a1da 100644 --- a/lua/wire/stools/forcer.lua +++ b/lua/wire/stools/forcer.lua @@ -18,10 +18,10 @@ TOOL.ClientConVar = { } if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber( "multiplier" ), self:GetClientNumber( "length" ), self:GetClientNumber( "beam" )==1, self:GetClientNumber( "reaction" )==1 end - + -- Uses default WireToolObj:MakeEnt's WireLib.MakeWireEnt function end diff --git a/lua/wire/stools/friendslist.lua b/lua/wire/stools/friendslist.lua index 3ac8f02c..61032398 100644 --- a/lua/wire/stools/friendslist.lua +++ b/lua/wire/stools/friendslist.lua @@ -61,7 +61,7 @@ if SERVER then end end) - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber( "save_on_entity" ) ~= 0, friends[self:GetOwner()] or {} end @@ -126,7 +126,7 @@ else net.Receive( "wire_friendslist", function( length ) friends = netReadValues() saveFile( friends ) - + if not IsValid(cpanel_list) then -- They right clicked without opening the cpanel first, just save the values return end diff --git a/lua/wire/stools/fx_emitter.lua b/lua/wire/stools/fx_emitter.lua index 60603af2..3409b097 100644 --- a/lua/wire/stools/fx_emitter.lua +++ b/lua/wire/stools/fx_emitter.lua @@ -20,7 +20,7 @@ TOOL.ClientConVar = { TOOL.GhostMin = "y" if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return math.Clamp(self:GetClientNumber( "Delay" ), 0.05, 20), ComboBox_Wire_FX_Emitter_Options[self:GetClientInfo( "Effect" )] end end diff --git a/lua/wire/stools/gates.lua b/lua/wire/stools/gates.lua index 6b2b343e..2fbf8073 100644 --- a/lua/wire/stools/gates.lua +++ b/lua/wire/stools/gates.lua @@ -43,9 +43,9 @@ if CLIENT then -- Create panels local searchbox = vgui.Create( "DTextEntry" ) - + searchbox:SetValue( "Search..." ) - + local old = searchbox.OnGetFocus function searchbox:OnGetFocus() if self:GetValue() == "Search..." then -- If "Search...", erase it @@ -53,7 +53,7 @@ if CLIENT then end old( self ) end - + -- On lose focus local old = searchbox.OnLoseFocus function searchbox:OnLoseFocus() @@ -62,7 +62,7 @@ if CLIENT then end old( self ) end - + local holder = vgui.Create( "DPanel" ) holder:SetTall( 500 ) @@ -149,7 +149,7 @@ if CLIENT then line:SetSelected(true) -- Select new RunConsoleCommand( "wire_gates_action", line.action ) end - + function searchbox:OnEnter() if #searchlist:GetLines() > 0 then searchlist:OnClickLine( searchlist:GetLine( 1 ) ) @@ -157,7 +157,7 @@ if CLIENT then end panel:AddItem( searchbox ) - + tree:Dock( FILL ) -- Set sizes & other settings @@ -187,9 +187,9 @@ if CLIENT then end tree:InvalidateLayout() end - + local CategoriesSorted = {} - + for gatetype, gatefuncs in pairs( WireGatesSorted ) do local allowed_gates = {} local any_allowed = false @@ -203,13 +203,13 @@ if CLIENT then CategoriesSorted[#CategoriesSorted+1] = { gatetype = gatetype, gatefuncs = allowed_gates } end end - + table.sort( CategoriesSorted, function( a, b ) return a.gatetype < b.gatetype end ) for i=1,#CategoriesSorted do local gatetype = CategoriesSorted[i].gatetype local gatefuncs = CategoriesSorted[i].gatefuncs - + local node = tree:AddNode( gatetype ) node.Icon:SetImage( "icon16/folder.png" ) FillSubTree( tree, node, gatefuncs ) @@ -223,7 +223,7 @@ if CLIENT then -- MISCELLANEOUS PLACEMENT OPTIONS, AND MODEL - + local nocollidebox = panel:CheckBox("#WireGatesTool_noclip", "wire_gates_noclip") local parentbox = panel:CheckBox("#WireGatesTool_parent","wire_gates_parent") @@ -250,10 +250,10 @@ end WireToolSetup.BaseLang() if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientInfo( "action" ), self:GetClientNumber( "noclip" ) == 1 end - + function TOOL:MakeEnt( ply, model, Ang, trace ) return MakeWireGate( ply, trace.HitPos, Ang, model, self:GetConVars() ) end diff --git a/lua/wire/stools/gimbal.lua b/lua/wire/stools/gimbal.lua index f488f355..dc4bce94 100644 --- a/lua/wire/stools/gimbal.lua +++ b/lua/wire/stools/gimbal.lua @@ -22,4 +22,4 @@ TOOL.ReloadSetsModel = true function TOOL.BuildCPanel(panel) ModelPlug_AddToCPanel(panel, "Gimbal", "wire_gimbal", true) -end \ No newline at end of file +end diff --git a/lua/wire/stools/gps.lua b/lua/wire/stools/gps.lua index 3af6971b..0519e8f1 100644 --- a/lua/wire/stools/gps.lua +++ b/lua/wire/stools/gps.lua @@ -23,4 +23,4 @@ TOOL.ClientConVar = { function TOOL.BuildCPanel(panel) WireToolHelpers.MakeModelSizer(panel, "wire_gps_modelsize") ModelPlug_AddToCPanel(panel, "GPS", "wire_gps") -end \ No newline at end of file +end diff --git a/lua/wire/stools/gpulib_switcher.lua b/lua/wire/stools/gpulib_switcher.lua index 7e49c929..4b232333 100644 --- a/lua/wire/stools/gpulib_switcher.lua +++ b/lua/wire/stools/gpulib_switcher.lua @@ -94,4 +94,4 @@ elseif SERVER then end -- if SERVER -WireToolSetup.BaseLang() \ No newline at end of file +WireToolSetup.BaseLang() diff --git a/lua/wire/stools/grabber.lua b/lua/wire/stools/grabber.lua index e0a8896b..4ce9d7bf 100644 --- a/lua/wire/stools/grabber.lua +++ b/lua/wire/stools/grabber.lua @@ -12,7 +12,7 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber("Range"), self:GetClientNumber("Gravity")~=0 end diff --git a/lua/wire/stools/gyroscope.lua b/lua/wire/stools/gyroscope.lua index 8dd47299..388aabab 100644 --- a/lua/wire/stools/gyroscope.lua +++ b/lua/wire/stools/gyroscope.lua @@ -12,8 +12,8 @@ WireToolSetup.SetupMax( 10 ) if SERVER then ModelPlug_Register("GPS") - - function TOOL:GetConVars() + + function TOOL:GetConVars() return self:GetClientNumber("out180")~=0 end end @@ -26,4 +26,4 @@ TOOL.ClientConVar = { function TOOL.BuildCPanel(panel) ModelPlug_AddToCPanel(panel, "gyroscope", "wire_gyroscope") panel:CheckBox("#Tool.wire_gyroscope.out180","wire_gyroscope_out180") -end \ No newline at end of file +end diff --git a/lua/wire/stools/hdd.lua b/lua/wire/stools/hdd.lua index 9acfbb2a..3a721c8f 100644 --- a/lua/wire/stools/hdd.lua +++ b/lua/wire/stools/hdd.lua @@ -12,7 +12,7 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if (SERVER) then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber("driveid"), self:GetClientNumber("drivecap") end diff --git a/lua/wire/stools/hologrid.lua b/lua/wire/stools/hologrid.lua index 86894df8..d7a35b87 100644 --- a/lua/wire/stools/hologrid.lua +++ b/lua/wire/stools/hologrid.lua @@ -68,4 +68,4 @@ end function TOOL.BuildCPanel( panel ) WireDermaExts.ModelSelect(panel, "wire_hologrid_model", list.Get( "Wire_Misc_Tools_Models" ), 1) panel:CheckBox("#Tool_wire_hologrid_usegps", "wire_hologrid_usegps") -end \ No newline at end of file +end diff --git a/lua/wire/stools/hoverball.lua b/lua/wire/stools/hoverball.lua index 7f8e81f8..42a6a196 100644 --- a/lua/wire/stools/hoverball.lua +++ b/lua/wire/stools/hoverball.lua @@ -20,7 +20,7 @@ TOOL.ClientConVar = { if SERVER then function TOOL:GetConVars() - return self:GetClientNumber( "speed" ), math.Clamp(self:GetClientNumber( "resistance" ), 0, 20), + return self:GetClientNumber( "speed" ), math.Clamp(self:GetClientNumber( "resistance" ), 0, 20), math.Clamp(self:GetClientNumber( "strength" ), 0.1, 20), self:GetClientNumber( "starton" ) == 1 end end diff --git a/lua/wire/stools/hudindicator.lua b/lua/wire/stools/hudindicator.lua index 086ae23b..8f7f9146 100644 --- a/lua/wire/stools/hudindicator.lua +++ b/lua/wire/stools/hudindicator.lua @@ -65,8 +65,8 @@ TOOL.ClientConVar[ "fullcircleangle" ] = "0" TOOL.ClientConVar[ "registerdelete" ] = "0" if SERVER then - function TOOL:GetConVars() - return self:GetClientNumber("a"), math.min(self:GetClientNumber("ar"), 255), math.min(self:GetClientNumber("ag"), 255), math.min(self:GetClientNumber("ab"), 255), math.min(self:GetClientNumber("aa"), 255), + function TOOL:GetConVars() + return self:GetClientNumber("a"), math.min(self:GetClientNumber("ar"), 255), math.min(self:GetClientNumber("ag"), 255), math.min(self:GetClientNumber("ab"), 255), math.min(self:GetClientNumber("aa"), 255), self:GetClientNumber("b"), math.min(self:GetClientNumber("br"), 255), math.min(self:GetClientNumber("bg"), 255), math.min(self:GetClientNumber("bb"), 255), math.min(self:GetClientNumber("ba"), 255), self:GetClientInfo( "material" ), self:GetClientNumber( "showinhud" ) ~= 0, self:GetClientInfo( "huddesc" ), self:GetClientNumber( "hudaddname" ) ~= 0, self:GetClientNumber( "hudshowvalue" ), self:GetClientNumber( "hudstyle" ), self:GetClientNumber( "allowhook" ) ~= 0, self:GetClientNumber( "fullcircleangle" ) diff --git a/lua/wire/stools/hydraulic.lua b/lua/wire/stools/hydraulic.lua index cd12a434..ae6eb7eb 100644 --- a/lua/wire/stools/hydraulic.lua +++ b/lua/wire/stools/hydraulic.lua @@ -60,9 +60,9 @@ function TOOL:LeftClick_Update( trace ) -- Make new constraint, at the old constraint's position, but with the new convar settings local const, rope = MakeWireHydraulic( self:GetOwner(), - tbl.Ent1, tbl.Ent2, - tbl.Bone1, tbl.Bone2, - tbl.LPos1, tbl.LPos2, + tbl.Ent1, tbl.Ent2, + tbl.Bone1, tbl.Bone2, + tbl.LPos1, tbl.LPos2, width, material, speed, fixed, stretchonly ) -- Set the new references @@ -110,11 +110,11 @@ function TOOL:LeftClick( trace ) self:SetStage(0) return end - + local controller = self:LeftClick_Make(trace, ply) if isbool(controller) then return controller end self:LeftClick_PostMake(controller, ply, trace) - + if controller then controller:DeleteOnRemove(const) if rope then controller:DeleteOnRemove( rope ) end @@ -179,7 +179,7 @@ function TOOL:RightClick( trace ) tr.filter[2] = trace.Entity end local trace2 = util.TraceLine( tr ) - + if not hook.Run( "CanTool", self:GetOwner(), trace2, "wire_hydraulic" ) then return false end return self:LeftClick(trace) and self:LeftClick(trace2) diff --git a/lua/wire/stools/igniter.lua b/lua/wire/stools/igniter.lua index 10d75c84..a46129e7 100644 --- a/lua/wire/stools/igniter.lua +++ b/lua/wire/stools/igniter.lua @@ -14,9 +14,9 @@ WireToolSetup.SetupMax( 20 ) if SERVER then CreateConVar('sbox_wire_igniters_maxlen', 30) CreateConVar('sbox_wire_igniters_allowtrgply',1) - - function TOOL:GetConVars() - return self:GetClientNumber( "trgply" )~=0, self:GetClientNumber("range") + + function TOOL:GetConVars() + return self:GetClientNumber( "trgply" )~=0, self:GetClientNumber("range") end end diff --git a/lua/wire/stools/indicator.lua b/lua/wire/stools/indicator.lua index 529cb8fa..350f1d2e 100644 --- a/lua/wire/stools/indicator.lua +++ b/lua/wire/stools/indicator.lua @@ -120,4 +120,4 @@ function TOOL.BuildCPanel(panel) }) panel:CheckBox("#ToolWireIndicator_90", "wire_indicator_rotate90") -end \ No newline at end of file +end diff --git a/lua/wire/stools/input.lua b/lua/wire/stools/input.lua index d0c7f45f..2c805f0e 100644 --- a/lua/wire/stools/input.lua +++ b/lua/wire/stools/input.lua @@ -15,10 +15,10 @@ WireToolSetup.SetupMax( 20 ) if SERVER then ModelPlug_Register("Numpad") - - function TOOL:GetConVars() + + function TOOL:GetConVars() return self:GetClientNumber( "keygroup" ), self:GetClientNumber( "toggle" ), self:GetClientNumber( "value_off" ), self:GetClientNumber( "value_on" ) - end + end end TOOL.ClientConVar = { diff --git a/lua/wire/stools/keyboard.lua b/lua/wire/stools/keyboard.lua index b668b2b4..9d5a36b1 100644 --- a/lua/wire/stools/keyboard.lua +++ b/lua/wire/stools/keyboard.lua @@ -11,8 +11,8 @@ WireToolSetup.SetupMax( 20 ) if (SERVER) then ModelPlug_Register("Keyboard") - - function TOOL:GetConVars() + + function TOOL:GetConVars() return self:GetClientNumber( "autobuffer" ) ~= 0, self:GetClientNumber( "sync" ) ~= 0, self:GetClientNumber( "enterkeyascii" ) ~= 0 end end @@ -35,8 +35,8 @@ function TOOL.BuildCPanel(panel) local curlayout = LocalPlayer():GetInfo("wire_keyboard_layout") for k,v in pairs( Wire_Keyboard_Remap ) do languages:AddChoice( k ) - if k == curlayout then - local curindex = #languages.Choices + if k == curlayout then + local curindex = #languages.Choices timer.Simple(0, function() languages:ChooseOptionID(curindex) end) -- This needs to be delayed or it'll set the box to show "0" end end @@ -50,7 +50,7 @@ function TOOL.BuildCPanel(panel) panel:CheckBox("Lock player controls on keyboard", "wire_keyboard_sync") panel:Help( "When on, 'locks' the player into the keyboard, meaning any keys they press will not move their character around. When off, they can walk around while typing. This option is serverside, and will be saved on the keyboard through duplications." ) - + panel:CheckBox("Automatic buffer clear", "wire_keyboard_autobuffer") panel:Help( "When on, automatically removes the key from the buffer when the user releases it.\nWhen off, leaves all keys in the buffer until they are manually removed.\nTo manually remove a key, write any value to cell 0 to remove the first key, or write a specific ascii value to any address other than 0 to remove that specific key. This option is serverside, and will be saved on the keyboard through duplications.") diff --git a/lua/wire/stools/keypad.lua b/lua/wire/stools/keypad.lua index a069704f..9a799622 100644 --- a/lua/wire/stools/keypad.lua +++ b/lua/wire/stools/keypad.lua @@ -12,10 +12,10 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax(10) if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return util.CRC(self:GetClientInfo("password")), self:GetClientNumber("secure") ~= 0 end - + function TOOL:CheckPassword() local password = self:GetClientNumber("password") if password == nil or string.find(password, "0") then @@ -27,11 +27,11 @@ if SERVER then end return true end - + function TOOL:MakeEnt( ply, model, Ang, trace ) return self:CheckPassword() and WireLib.MakeWireEnt( ply, {Class = self.WireClass, Pos=trace.HitPos, Angle=Ang, Model=model}, self:GetConVars() ) end - + function TOOL:LeftClick_Update( trace ) if self:CheckPassword() then trace.Entity:Setup(self:GetConVars()) end end diff --git a/lua/wire/stools/lamp.lua b/lua/wire/stools/lamp.lua index 3c188b98..761aa8c9 100644 --- a/lua/wire/stools/lamp.lua +++ b/lua/wire/stools/lamp.lua @@ -132,13 +132,13 @@ end function TOOL.BuildCPanel(panel) WireToolHelpers.MakePresetControl(panel, "wire_lamp") - + WireDermaExts.ModelSelect(panel, "wire_lamp_model", list.Get( "LampModels" ), 1) panel:NumSlider("#WireLampTool_RopeLength", "wire_lamp_ropelength", 4, 400, 0) panel:NumSlider("#WireLampTool_FOV", "wire_lamp_fov", 10, 170, 2) panel:NumSlider("#WireLampTool_Dist", "wire_lamp_distance", 64, 2048, 0) panel:NumSlider("#WireLampTool_Bright", "wire_lamp_brightness", 0, 8, 2) - + panel:AddControl("ComboBox", { Label = "#WireLampTool_Const", Options = { @@ -147,7 +147,7 @@ function TOOL.BuildCPanel(panel) ["None"] = { wire_lamp_const = "none" }, } }) - + panel:AddControl("Color", { Label = "#WireLampTool_Color", Red = "wire_lamp_r", diff --git a/lua/wire/stools/latch.lua b/lua/wire/stools/latch.lua index 583f8ada..e4eeb3eb 100644 --- a/lua/wire/stools/latch.lua +++ b/lua/wire/stools/latch.lua @@ -37,7 +37,7 @@ function TOOL:LeftClick( trace ) local ply = self:GetOwner() local Ent1, Ent2, Ent3 = self:GetEnt(1), self:GetEnt(2), trace.Entity local const = self.Constraint - + local controller = self:LeftClick_Make( trace, ply ) if isbool(controller) then return controller end if !IsValid(controller) then diff --git a/lua/wire/stools/lever.lua b/lua/wire/stools/lever.lua index 949f80f9..dedce524 100644 --- a/lua/wire/stools/lever.lua +++ b/lua/wire/stools/lever.lua @@ -12,33 +12,33 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber( "min" ), self:GetClientNumber( "max" ) end - + function TOOL:MakeEnt( ply, model, Ang, trace ) //return WireLib.MakeWireEnt( ply, {Class = self.WireClass, Pos=trace.HitPos, Angle=Ang, Model=model}, self:GetConVars() ) - + local ent = WireLib.MakeWireEnt(ply, {Class = self.WireClass, Pos=(trace.HitPos + trace.HitNormal*22), Angle=Ang, Model=model}, self:GetConVars()) // +trace.HitNormal*46 - + local ent2 = ents.Create( "prop_physics" ) - ent2:SetModel("models/props_wasteland/tram_leverbase01.mdl") + ent2:SetModel("models/props_wasteland/tram_leverbase01.mdl") ent2:SetPos(trace.HitPos) // +trace.HitNormal*26 ent2:SetAngles(Ang) ent2:Spawn() ent2:Activate() ent.BaseEnt = ent2 - + constraint.Weld(ent, ent2, 0, 0, 0, true) ent:SetParent(ent2) - + -- Parented + Weld seems more stable than a physical axis --local LPos = ent:WorldToLocal(ent:GetPos() + ent:GetUp() * 10) --local Cons = constraint.Ballsocket( ent2, ent, 0, 0, LPos, 0, 0, 1) --LPos = ent:WorldToLocal(ent:GetPos() + ent:GetUp() * -10) --Cons = constraint.Ballsocket( ent2, ent, 0, 0, LPos, 0, 0, 1) --constraint.Axis(ent, ent2, 0, 0, ent:WorldToLocal(ent2:GetPos()), ent2:GetRight()*0.15) - + return ent2 end -- Uses default WireToolObj:MakeEnt's WireLib.MakeWireEnt function diff --git a/lua/wire/stools/light.lua b/lua/wire/stools/light.lua index c6c13f25..34bf2aab 100644 --- a/lua/wire/stools/light.lua +++ b/lua/wire/stools/light.lua @@ -31,7 +31,7 @@ if SERVER then self:GetClientNumber("g"), self:GetClientNumber("b") end - + function TOOL:LeftClick_PostMake( ent, ply, trace ) if ent == true then return true end if ent == nil or ent == false or not ent:IsValid() then return false end @@ -49,7 +49,7 @@ if SERVER then local length = math.Clamp( self:GetClientNumber( "ropelength" ), 4, 1024 ) local material = "cable/rope" - + local LPos1 = Vector( 0, 0, 0 ) if ent:GetModel() == "models/maxofs2d/light_tubular.mdl" then LPos1 = Vector( 0, 0, 5 ) end @@ -63,7 +63,7 @@ if SERVER then end local constraint, rope = constraint.Rope( ent, trace.Entity, 0, trace.PhysicsBone, LPos1, LPos2, 0, length, 0, 1.5, material, nil ) - + ent:GetPhysicsObject():Wake() undo.Create( self.WireClass ) diff --git a/lua/wire/stools/motor.lua b/lua/wire/stools/motor.lua index ca56d243..b95f4ebc 100644 --- a/lua/wire/stools/motor.lua +++ b/lua/wire/stools/motor.lua @@ -46,9 +46,9 @@ function TOOL:LeftClick_Update( trace ) -- Make new constraint, at the old constraint's position, but with the new convar settings local const, axis = MakeWireMotor( self:GetOwner(), - tbl.Ent1, tbl.Ent2, - tbl.Bone1, tbl.Bone2, - tbl.LPos1, tbl.LPos2, + tbl.Ent1, tbl.Ent2, + tbl.Bone1, tbl.Bone2, + tbl.LPos1, tbl.LPos2, friction, torque, nocollide, forcelimit ) -- Set the new references @@ -68,7 +68,7 @@ function TOOL:LeftClick( trace ) -- If there's no physics object then we can't constraint it! if SERVER and not util.IsValidPhysicsObject( trace.Entity, trace.PhysicsBone ) then return false end - + local iNum = self:NumObjects() local Phys = trace.Entity:GetPhysicsObjectNum( trace.PhysicsBone ) @@ -79,41 +79,41 @@ function TOOL:LeftClick( trace ) end return true end - + -- Don't allow us to choose the world as the first object if iNum == 0 and not IsValid( trace.Entity ) then return end - + -- Don't allow us to choose the same object if iNum == 1 and trace.Entity == self:GetEnt(1) then return end - + self:SetObject( iNum + 1, trace.Entity, trace.HitPos, Phys, trace.PhysicsBone, trace.HitNormal ) - + if iNum > 1 then if CLIENT then self:ClearObjects() return true end - + local ply = self:GetOwner() local Ent1, Ent2, Ent3 = self:GetEnt(1), self:GetEnt(2), trace.Entity local const, axis = self.constraint, self.axis - + if not const or not IsValid( const ) then WireLib.AddNotify(self:GetOwner(), "Wire Motor Invalid!", NOTIFY_GENERIC, 7) self:ClearObjects() self:SetStage(0) return end - + local controller = self:LeftClick_Make(trace, ply) if isbool(controller) then return controller end self:LeftClick_PostMake(controller, ply, trace) - + if controller then controller:DeleteOnRemove( const ) if axis then controller:DeleteOnRemove( axis ) end end - + self:ClearObjects() self:SetStage(0) elseif iNum == 1 then @@ -122,23 +122,23 @@ function TOOL:LeftClick( trace ) self:ReleaseGhostEntity() return true end - + -- Get client's CVars local torque, friction, nocollide, forcelimit = self:GetConVars() - + local Ent1, Ent2 = self:GetEnt(1), self:GetEnt(2) local Bone1, Bone2 = self:GetBone(1), self:GetBone(2) local WPos1, WPos2 = self:GetPos(1), self:GetPos(2) local LPos1, LPos2 = self:GetLocalPos(1), self:GetLocalPos(2) local Norm1, Norm2 = self:GetNormal(1), self:GetNormal(2) local Phys1, Phys2 = self:GetPhys(1), self:GetPhys(2) - + -- Note: To keep stuff ragdoll friendly try to treat things as physics objects rather than entities local Ang1, Ang2 = Norm1:Angle(), (Norm2 * -1):Angle() local TargetAngle = Phys1:AlignAngles( Ang1, Ang2 ) - + Phys1:SetAngles( TargetAngle ) - + -- Move the object so that the hitpos on our object is at the second hitpos local TargetPos = WPos2 + (Phys1:GetPos() - self:GetPos(1)) @@ -156,13 +156,13 @@ function TOOL:LeftClick( trace ) local constraint, axis = MakeWireMotor( self:GetOwner(), Ent1, Ent2, Bone1, Bone2, LPos1, LPos2, friction, torque, nocollide, forcelimit ) self.constraint, self.axis = constraint, axis - + undo.Create("gmod_wire_motor") if axis then undo.AddEntity( axis ) end if constraint then undo.AddEntity( constraint ) end undo.SetPlayer( self:GetOwner() ) undo.Finish() - + if axis then self:GetOwner():AddCleanup( "constraints", axis ) end if constraint then self:GetOwner():AddCleanup( "constraints", constraint ) end @@ -172,7 +172,7 @@ function TOOL:LeftClick( trace ) self:StartGhostEntity( trace.Entity ) self:SetStage( iNum+1 ) end - + return true end @@ -183,7 +183,7 @@ end function TOOL:Reload( trace ) if not IsValid( trace.Entity ) or trace.Entity:IsPlayer() then return false end if CLIENT then return true end - + return constraint.RemoveConstraints( trace.Entity, "WireMotor" ) end @@ -202,9 +202,9 @@ TOOL.ClientConVar = { function TOOL.BuildCPanel(panel) local models = { ["models/jaanus/wiretool/wiretool_siren.mdl"] = true, - ["models/jaanus/wiretool/wiretool_controlchip.mdl"] = true + ["models/jaanus/wiretool/wiretool_controlchip.mdl"] = true } - + WireDermaExts.ModelSelect( panel, "wire_motor_model", models, 1 ) panel:NumSlider( "#WireMotorTool_torque", "wire_motor_torque", 0, 10000, 5 ) panel:NumSlider( "#WireMotorTool_forcelimit", "wire_motor_forcelimit", 0, 50000, 10 ) diff --git a/lua/wire/stools/nailer.lua b/lua/wire/stools/nailer.lua index 5bc20c8b..c85e7689 100644 --- a/lua/wire/stools/nailer.lua +++ b/lua/wire/stools/nailer.lua @@ -10,9 +10,9 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if (SERVER) then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber( "forcelim" ), self:GetClientNumber( "range" ), self:GetClientNumber( "beam" )==1 - end + end end TOOL.ClientConVar = { diff --git a/lua/wire/stools/numpad.lua b/lua/wire/stools/numpad.lua index 9929a7aa..bca169c4 100644 --- a/lua/wire/stools/numpad.lua +++ b/lua/wire/stools/numpad.lua @@ -14,10 +14,10 @@ WireToolSetup.SetupMax( 20 ) if SERVER then ModelPlug_Register("Numpad") - - function TOOL:GetConVars() + + function TOOL:GetConVars() return self:GetClientNumber( "toggle" )==1, self:GetClientNumber( "value_off" ), self:GetClientNumber( "value_on" ) - end + end end TOOL.ClientConVar = { diff --git a/lua/wire/stools/output.lua b/lua/wire/stools/output.lua index 3ba16d81..25f9caf1 100644 --- a/lua/wire/stools/output.lua +++ b/lua/wire/stools/output.lua @@ -12,8 +12,8 @@ WireToolSetup.SetupMax( 10 ) if SERVER then ModelPlug_Register("Numpad") - - function TOOL:GetConVars() + + function TOOL:GetConVars() return self:GetClientNumber( "keygroup" ) end end diff --git a/lua/wire/stools/plug.lua b/lua/wire/stools/plug.lua index 494ea444..1c5996b0 100644 --- a/lua/wire/stools/plug.lua +++ b/lua/wire/stools/plug.lua @@ -70,7 +70,7 @@ end function TOOL:GetAngle( trace ) local Ang - if math.abs(trace.HitNormal.x) < 0.001 and math.abs(trace.HitNormal.y) < 0.001 then + if math.abs(trace.HitNormal.x) < 0.001 and math.abs(trace.HitNormal.y) < 0.001 then return Vector(0,0,trace.HitNormal.z):Angle() + (AngleOffset[self:GetModel()] or Angle(0,0,0)) else return trace.HitNormal:Angle() + (AngleOffset[self:GetModel()] or Angle(0,0,0)) @@ -78,10 +78,10 @@ function TOOL:GetAngle( trace ) end if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber("array") ~= 0, self:GetClientNumber("weldforce"), math.Clamp(self:GetClientNumber("attachrange"), 1, 100) end - + -- Socket creation handled by WireToolObj end diff --git a/lua/wire/stools/radio.lua b/lua/wire/stools/radio.lua index 1dd8e3e0..ed38114c 100644 --- a/lua/wire/stools/radio.lua +++ b/lua/wire/stools/radio.lua @@ -14,7 +14,7 @@ WireToolSetup.SetupMax( 20 ) if (SERVER) then ModelPlug_Register("radio") - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientInfo("channel"), self:GetClientNumber("values"), self:GetClientNumber("secure") ~= 0 end end @@ -29,7 +29,7 @@ TOOL.ClientConVar = { function TOOL.BuildCPanel(panel) WireToolHelpers.MakePresetControl(panel, "wire_radio") WireDermaExts.ModelSelect(panel, "wire_radio_model", list.Get( "Wire_radio_Models" ), 2, true) - + panel:NumSlider("#WireRadioTool_channel","wire_radio_channel",1,30,0) panel:NumSlider("#WireRadioTool_values","wire_radio_values",1,20,0) panel:CheckBox("#WireRadioTool_secure","wire_radio_secure") diff --git a/lua/wire/stools/ranger.lua b/lua/wire/stools/ranger.lua index de26ef01..2a371024 100644 --- a/lua/wire/stools/ranger.lua +++ b/lua/wire/stools/ranger.lua @@ -26,7 +26,7 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber("range"), self:GetClientNumber("default_zero")~=0, self:GetClientNumber("show_beam")~=0, self:GetClientNumber("ignore_world")~=0, self:GetClientNumber("trace_water")~=0, self:GetClientNumber("out_dist")~=0, self:GetClientNumber("out_pos")~=0, self:GetClientNumber("out_vel")~=0, self:GetClientNumber("out_ang")~=0, self:GetClientNumber("out_col")~=0, self:GetClientNumber("out_val")~=0, self:GetClientNumber("out_sid")~=0, @@ -72,4 +72,4 @@ function TOOL.BuildCPanel(panel) panel:CheckBox("#Tool.wire_ranger.out_eid","wire_ranger_out_eid") panel:CheckBox("#Tool.wire_ranger.out_hnrm","wire_ranger_out_hnrm") panel:CheckBox("#Tool.wire_ranger.hires","wire_ranger_hires") -end \ No newline at end of file +end diff --git a/lua/wire/stools/relay.lua b/lua/wire/stools/relay.lua index fc0b3272..c50436e3 100644 --- a/lua/wire/stools/relay.lua +++ b/lua/wire/stools/relay.lua @@ -36,9 +36,9 @@ TOOL.ClientConVar = { } if SERVER then - function TOOL:GetConVars() - return self:GetClientNumber("keygroup1"), self:GetClientNumber("keygroup2"), self:GetClientNumber("keygroup3"), self:GetClientNumber("keygroup4"), self:GetClientNumber("keygroup5"), - self:GetClientNumber("keygroupoff"), self:GetClientNumber("toggle") ~= 0, self:GetClientNumber("normclose"), + function TOOL:GetConVars() + return self:GetClientNumber("keygroup1"), self:GetClientNumber("keygroup2"), self:GetClientNumber("keygroup3"), self:GetClientNumber("keygroup4"), self:GetClientNumber("keygroup5"), + self:GetClientNumber("keygroupoff"), self:GetClientNumber("toggle") ~= 0, self:GetClientNumber("normclose"), self:GetClientNumber("poles"), self:GetClientNumber("throws"), self:GetClientNumber("nokey") ~= 0 end end diff --git a/lua/wire/stools/rom.lua b/lua/wire/stools/rom.lua index abe0a7e1..0dd4dbc9 100644 --- a/lua/wire/stools/rom.lua +++ b/lua/wire/stools/rom.lua @@ -13,10 +13,10 @@ if CLIENT then function TOOL.BuildCPanel( panel ) ModelPlug_AddToCPanel(panel, "gate", "wire_rom", nil, 4) - + panel:Help("#Tool.wire_rom.note") end - + WireToolSetup.setToolMenuIcon( "icon16/database.png" ) end TOOL.MaxLimitName = "wire_dhdds" diff --git a/lua/wire/stools/sensor.lua b/lua/wire/stools/sensor.lua index 7fa9eb4b..4c012c00 100644 --- a/lua/wire/stools/sensor.lua +++ b/lua/wire/stools/sensor.lua @@ -17,9 +17,9 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() return self:GetClientNumber("xyz_mode") ~= 0, self:GetClientNumber("outdist") ~= 0, self:GetClientNumber("outbrng") ~= 0, - self:GetClientNumber("gpscord") ~= 0, self:GetClientNumber("direction_vector") ~= 0, self:GetClientNumber("direction_normalized") ~= 0, + self:GetClientNumber("gpscord") ~= 0, self:GetClientNumber("direction_vector") ~= 0, self:GetClientNumber("direction_normalized") ~= 0, self:GetClientNumber("target_velocity") ~= 0, self:GetClientNumber("velocity_normalized") ~= 0 end diff --git a/lua/wire/stools/simple_explosive.lua b/lua/wire/stools/simple_explosive.lua index c7ff3588..49f9edd3 100644 --- a/lua/wire/stools/simple_explosive.lua +++ b/lua/wire/stools/simple_explosive.lua @@ -19,7 +19,7 @@ WireToolSetup.SetupMax( 20 ) if SERVER then function TOOL:GetConVars() - return self:GetClientNumber( "trigger" ), self:GetClientNumber( "damage" ), self:GetClientNumber( "removeafter" )==1, + return self:GetClientNumber( "trigger" ), self:GetClientNumber( "damage" ), self:GetClientNumber( "removeafter" )==1, self:GetClientNumber( "radius" ) end end @@ -41,4 +41,4 @@ function TOOL.BuildCPanel(panel) panel:NumSlider("#Tool.simple_explosive.damage", "wire_simple_explosive_damage", 0, 500, 0 ) panel:NumSlider("#Tool.simple_explosive.radius", "wire_simple_explosive_radius", 1, 1500, 0 ) panel:CheckBox("#Tool.simple_explosive.removeafter","wire_simple_explosive_removeafter") -end \ No newline at end of file +end diff --git a/lua/wire/stools/soundemitter.lua b/lua/wire/stools/soundemitter.lua index 69e5adc8..91bb5d9c 100644 --- a/lua/wire/stools/soundemitter.lua +++ b/lua/wire/stools/soundemitter.lua @@ -32,7 +32,7 @@ TOOL.ClientConVar = { function TOOL:RightClick( trace ) if SERVER and !game.SinglePlayer() then return false end RunConsoleCommand("wire_sound_browser_open", self:GetClientInfo("sound"), "1") - + return false end diff --git a/lua/wire/stools/speedometer.lua b/lua/wire/stools/speedometer.lua index b6b94354..8d3bb769 100644 --- a/lua/wire/stools/speedometer.lua +++ b/lua/wire/stools/speedometer.lua @@ -12,8 +12,8 @@ WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) if SERVER then - function TOOL:GetConVars() - return tobool(self:GetClientNumber("xyz_mode")), tobool(self:GetClientNumber("angvel")) + function TOOL:GetConVars() + return tobool(self:GetClientNumber("xyz_mode")), tobool(self:GetClientNumber("angvel")) end end diff --git a/lua/wire/stools/spu.lua b/lua/wire/stools/spu.lua index 0f231ea2..6fc663cd 100644 --- a/lua/wire/stools/spu.lua +++ b/lua/wire/stools/spu.lua @@ -59,8 +59,8 @@ if SERVER then self:LeftClick_Update(trace) return ent end - - + + function TOOL:RightClick(trace) net.Start("ZSPU_OpenEditor") net.Send(self:GetOwner()) return true diff --git a/lua/wire/stools/target_finder.lua b/lua/wire/stools/target_finder.lua index 490c5c1d..d071ecee 100644 --- a/lua/wire/stools/target_finder.lua +++ b/lua/wire/stools/target_finder.lua @@ -45,14 +45,14 @@ if SERVER then ModelPlug_Register("Numpad") CreateConVar("wire_target_finders_maxtargets",10) CreateConVar("wire_target_finders_maxbogeys",30) - function TOOL:GetConVars() - return self:GetClientNumber("maxrange"), self:GetClientNumber("players") ~= 0, self:GetClientNumber("npcs") ~= 0, self:GetClientInfo("npcname"), - self:GetClientNumber("beacons") ~= 0, self:GetClientNumber("hoverballs") ~= 0, self:GetClientNumber("thrusters") ~= 0, self:GetClientNumber("props") ~= 0, + function TOOL:GetConVars() + return self:GetClientNumber("maxrange"), self:GetClientNumber("players") ~= 0, self:GetClientNumber("npcs") ~= 0, self:GetClientInfo("npcname"), + self:GetClientNumber("beacons") ~= 0, self:GetClientNumber("hoverballs") ~= 0, self:GetClientNumber("thrusters") ~= 0, self:GetClientNumber("props") ~= 0, self:GetClientInfo("propmodel"), self:GetClientNumber("vehicles") ~= 0, self:GetClientInfo("playername"), self:GetClientNumber("casesen") ~= 0, - self:GetClientNumber("rpgs") ~= 0, self:GetClientNumber("painttarget") ~= 0, self:GetClientNumber("minrange"), self:GetClientNumber("maxtargets"), - self:GetClientNumber("maxbogeys"), self:GetClientNumber("notargetowner") != 0, self:GetClientInfo("entityfil"), self:GetClientNumber("notownersstuff") != 0, - self:GetClientInfo("steamname"), (self:GetClientNumber("colorcheck") ~= 0), (self:GetClientNumber("colortarget") ~= 0), - self:GetClientNumber("pcolR"), self:GetClientNumber("pcolG"), self:GetClientNumber("pcolB"), self:GetClientNumber("pcolA"), + self:GetClientNumber("rpgs") ~= 0, self:GetClientNumber("painttarget") ~= 0, self:GetClientNumber("minrange"), self:GetClientNumber("maxtargets"), + self:GetClientNumber("maxbogeys"), self:GetClientNumber("notargetowner") != 0, self:GetClientInfo("entityfil"), self:GetClientNumber("notownersstuff") != 0, + self:GetClientInfo("steamname"), (self:GetClientNumber("colorcheck") ~= 0), (self:GetClientNumber("colortarget") ~= 0), + self:GetClientNumber("pcolR"), self:GetClientNumber("pcolG"), self:GetClientNumber("pcolB"), self:GetClientNumber("pcolA"), self:GetClientNumber("checkbuddylist") != 0, self:GetClientNumber("onbuddylist") != 0 end end diff --git a/lua/wire/stools/textentry.lua b/lua/wire/stools/textentry.lua index 4ba5a45e..6d2fc700 100644 --- a/lua/wire/stools/textentry.lua +++ b/lua/wire/stools/textentry.lua @@ -33,4 +33,4 @@ function TOOL.BuildCPanel(panel) panel:ControlHelp("Sets how long the string output remains set. 0 for forever.") panel:CheckBox( "#Tool.wire_textentry.disableuse", "wire_textentry_disableuse" ) panel:ControlHelp("Pressing use on the keyboard normally brings up the prompt. This option allows you to disable that. Useful when linked to a vehicle.") -end \ No newline at end of file +end diff --git a/lua/wire/stools/textreceiver.lua b/lua/wire/stools/textreceiver.lua index b33f3e33..a5aa19dd 100644 --- a/lua/wire/stools/textreceiver.lua +++ b/lua/wire/stools/textreceiver.lua @@ -32,7 +32,7 @@ end TOOL.ClientConVar[ "model" ] = "models/jaanus/wiretool/wiretool_range.mdl" if SERVER then - function TOOL:GetConVars() + function TOOL:GetConVars() local matches = {} for i=1,math.Clamp(self:GetClientNumber("num_matches"),0,24) do matches[i] = self:GetClientInfo("match"..i) diff --git a/lua/wire/stools/textscreen.lua b/lua/wire/stools/textscreen.lua index 4a197409..616f0ed4 100644 --- a/lua/wire/stools/textscreen.lua +++ b/lua/wire/stools/textscreen.lua @@ -93,7 +93,7 @@ function TOOL.BuildCPanel(panel) } local Options = {} for k,v in ipairs(Fonts) do Options[v] = { wire_textscreen_tfont = v } end - + WireToolHelpers.MakePresetControl(panel, "wire_textscreen") panel:NumSlider("#Tool_wire_textscreen_tsize", "wire_textscreen_tsize", 1, 15, 0) panel:NumSlider("#Tool_wire_textscreen_tjust", "wire_textscreen_tjust", 0, 2, 0) diff --git a/lua/wire/stools/thruster.lua b/lua/wire/stools/thruster.lua index 47015735..7ab74314 100644 --- a/lua/wire/stools/thruster.lua +++ b/lua/wire/stools/thruster.lua @@ -31,9 +31,9 @@ TOOL.ClientConVar = { } if SERVER then - function TOOL:GetConVars() - return self:GetClientNumber( "force" ), self:GetClientNumber( "force_min" ), self:GetClientNumber( "force_max" ), self:GetClientInfo( "oweffect" ), - self:GetClientInfo( "uweffect" ), self:GetClientNumber( "owater" ) ~= 0, self:GetClientNumber( "uwater" ) ~= 0, self:GetClientNumber( "bidir" ) ~= 0, + function TOOL:GetConVars() + return self:GetClientNumber( "force" ), self:GetClientNumber( "force_min" ), self:GetClientNumber( "force_max" ), self:GetClientInfo( "oweffect" ), + self:GetClientInfo( "uweffect" ), self:GetClientNumber( "owater" ) ~= 0, self:GetClientNumber( "uwater" ) ~= 0, self:GetClientNumber( "bidir" ) ~= 0, self:GetClientInfo( "soundname" ) end end diff --git a/lua/wire/stools/trigger.lua b/lua/wire/stools/trigger.lua index 7ecb8c74..60c504c7 100644 --- a/lua/wire/stools/trigger.lua +++ b/lua/wire/stools/trigger.lua @@ -1,7 +1,7 @@ -- Wire Trigger created by mitterdoo WireToolSetup.setCategory( "Detection" ) WireToolSetup.open( "trigger", "Trigger", "gmod_wire_trigger", nil, "Triggers" ) - + TOOL.ClientConVar = { model = "models/jaanus/wiretool/wiretool_siren.mdl", filter = 0, -- 0: all entities, 1: only players, 2: only props (and stuff that isn't a player) @@ -46,7 +46,7 @@ if CLIENT then RunConsoleCommand( "wire_trigger_offsetx", 0 ) RunConsoleCommand( "wire_trigger_offsety", 0 ) RunConsoleCommand( "wire_trigger_offsetz", 0 ) - + end ) end @@ -62,7 +62,7 @@ local function DrawTriggerOutlines( list ) cam.Start3D( LocalPlayer():EyePos(), LocalPlayer():EyeAngles() ) for k,ent in pairs( list ) do local trig = ent:GetTriggerEntity() - + render.DrawWireframeBox( trig:GetPos(), Angle(0,0,0), trig:OBBMins(), trig:OBBMaxs(), Color( 255, 255, 0 ), true ) render.DrawLine( trig:GetPos(), ent:GetPos(), Color( 255, 255, 0 ) ) end @@ -106,7 +106,7 @@ function TOOL:RightClick( tr ) end end - + function TOOL.BuildCPanel( panel ) ModelPlug_AddToCPanel(panel, "Misc_Tools", "wire_trigger") panel:CheckBox( "#Tool.wire_trigger.alltriggers", "wire_trigger_drawalltriggers" ) diff --git a/lua/wire/stools/turret.lua b/lua/wire/stools/turret.lua index f4ff70c7..aae338e3 100644 --- a/lua/wire/stools/turret.lua +++ b/lua/wire/stools/turret.lua @@ -37,8 +37,8 @@ TOOL.GhostAngle = Angle(-90,0,0) TOOL.GetGhostMin = function() return -2 end if SERVER then - function TOOL:GetConVars() - return self:GetClientNumber("delay"), self:GetClientNumber("damage"), self:GetClientNumber("force"), self:GetClientInfo("sound"), + function TOOL:GetConVars() + return self:GetClientNumber("delay"), self:GetClientNumber("damage"), self:GetClientNumber("force"), self:GetClientInfo("sound"), self:GetClientNumber("numbullets"), self:GetClientNumber("spread"), self:GetClientInfo("tracer"), self:GetClientNumber("tracernum") end end @@ -75,7 +75,7 @@ function TOOL.BuildCPanel( CPanel ) CPanel:AddControl("ComboBox", weaponSounds ) WireDermaExts.ModelSelect(CPanel, "wire_turret_model", list.Get( "WireTurretModels" ), 2) - + -- Tracer local TracerType = {Label = "#Tracer", MenuButton = 0, Options={}, CVars = {}} TracerType["Options"]["#Default"] = { wire_turret_tracer = "Tracer" } diff --git a/lua/wire/stools/value.lua b/lua/wire/stools/value.lua index 974cded2..e5984a1d 100644 --- a/lua/wire/stools/value.lua +++ b/lua/wire/stools/value.lua @@ -44,7 +44,7 @@ if SERVER then net.Receive( "wire_value_values", function( length, ply ) playerValues[ply] = netReadValues() end) - function TOOL:GetConVars() + function TOOL:GetConVars() return playerValues[self:GetOwner()] or {} end @@ -67,7 +67,7 @@ if CLIENT then function TOOL:RightClick(trace) return IsValid(trace.Entity) and trace.Entity:GetClass() == "gmod_wire_value" end - + -- Supported data types local types_lookup = { Number = "NORMAL", @@ -85,7 +85,7 @@ if CLIENT then VECTOR2 = "2D Vector", VECTOR4 = "4D Vector", } - + local types_ordered = { "Number", "String", "Angle", "Vector", "2D Vector", "4D Vector" } local ValuePanels = {} @@ -95,67 +95,67 @@ if CLIENT then local typeGuessCheckbox local itemPanel local resetButton - + local SendUpdate - + -- Saves the values in cookies so that they can be loaded next session local function saveValues( values ) values = values or selectedValues - + local old_amount = cookie.GetNumber( "wire_constant_value_amount", 0 ) - + cookie.Set( "wire_constant_value_amount", #values ) - + if old_amount > #values then for i=#values+1,old_amount do cookie.Delete( "wire_constant_value_value" .. i ) cookie.Delete( "wire_constant_value_type" .. i ) end end - + for k, v in pairs( values ) do cookie.Set( "wire_constant_value_value" .. k, string.sub(v.Value,1,3000) ) cookie.Set( "wire_constant_value_type" .. k, v.DataType ) end end - + -- Loads the values from cookies -- Don't worry about performance, because while garry's cookies are saved in a database, -- they're also saved in Lua tables, which means they're accessed instantly. local function loadValues( dontupdate ) local oldSendUpdate = SendUpdate SendUpdate = function() end -- Don't update now - + local amount = cookie.GetNumber( "wire_constant_value_amount", 0 ) - + slider:SetValue(amount) - + for i=1,amount do local tp = cookie.GetString( "wire_constant_value_type" .. i, "NORMAL" ) local val = cookie.GetString( "wire_constant_value_value" .. i, "0" ) - + tp = types_lookup2[tp] or "Number" - + selectedValues[i].DataType = tp selectedValues[i].Value = val - + panels[i].valueEntry:SetValue( val ) panels[i].typeSelection:SetText( tp ) panels[i].typeSelection:OnSelect( _, tp ) end - + SendUpdate = oldSendUpdate -- okay now it's fine to update again end - + -- Sends the values to the server function SendUpdate() net.Start("wire_value_values") netWriteValues(selectedValues) net.SendToServer() - + saveValues() end - + local validityChecks = { Number = function( val ) return tonumber(val) ~= nil end, ["2D Vector"] = function( val ) local x,y = string.match( val, "^ *([^%s,]+) *, *([^%s,]+) *$" ) return tonumber(x) ~= nil and tonumber(y) ~= nil end, @@ -164,7 +164,7 @@ if CLIENT then String = function( val ) return true end, } validityChecks.Angle = validityChecks.Vector -- it's the same as vectors - + local examples = { Number = "12.34", ["2D Vector"] = "12.34, 12.34", @@ -173,7 +173,7 @@ if CLIENT then String = "Hello World", Angle = "90, 180, 360", } - + -- Check if what the user wrote is a valid value of the specified type local function validateValue( str, tp ) if validityChecks[tp] then @@ -182,7 +182,7 @@ if CLIENT then return false end end - + local typeGuessing = { -- we're not checking angle because it's indistinguishable from vectors -- dropdown position, function {1, validityChecks.Number}, @@ -191,39 +191,39 @@ if CLIENT then {6, validityChecks["4D Vector"]}, {2, validityChecks.String}, } - + -- Guess the type of the value the user wrote local function guessType( str, typeSelection ) for i=1,#typeGuessing do local dropdownPos = typeGuessing[i][1] local func = typeGuessing[i][2] - + if func( str ) then typeSelection:ChooseOptionID( dropdownPos ) return end end end - + -- Add another value panel local function AddValue( panel, id ) local w = panel:GetWide() - + selectedValues[id] = { DataType = "NORMAL", Value = 0, } - + local pnl = vgui.Create( "DCollapsibleCategory", panel ) pnl:SetWide( w ) pnl:SetLabel( "Value " .. id ) pnl:Dock( TOP ) pnl.id = id - + local top_panel = vgui.Create( "DPanel", pnl ) top_panel.Paint = function() end top_panel:Dock( TOP ) - + local _ = vgui.Create( "DPanel", top_panel ) -- this was the only solution I could think of to properly align this shit _:Dock( RIGHT ) _.Paint = function() end @@ -233,13 +233,13 @@ if CLIENT then rem:SizeToContents() rem:SetPos( 0, 4 ) rem:SetToolTip( "Remove this value" ) - + rem.DoClick = function() if #selectedValues == 1 then -- can't remove the last value resetButton:DoClick() -- instead, do a reset return end - + local id = pnl.id panels[id]:Remove() table.remove( panels, id ) @@ -250,19 +250,19 @@ if CLIENT then panels[i]:SetLabel( "Value " .. i ) end end - + local typeSelection = vgui.Create( "DComboBox", top_panel ) typeSelection:Dock( FILL ) typeSelection:DockMargin( 2, 2, 2, 2 ) pnl.typeSelection = typeSelection - + typeSelection.OnSelect = function( panel, index, value ) selectedValues[pnl.id].DataType = types_lookup[value] or "NORMAL" SendUpdate() - + local val, tp = selectedValues[pnl.id].Value, selectedValues[pnl.id].DataType tp = types_lookup2[tp] or "Number" - + if validateValue( val, tp ) then pnl.valueEntry:SetToolTip() pnl.parseIcon:SetImage( "icon16/accept.png" ) @@ -271,22 +271,22 @@ if CLIENT then pnl.parseIcon:SetImage( "icon16/cancel.png" ) end end - + for k,v in pairs( types_ordered ) do typeSelection:AddChoice(v) - end - + end + local valueEntry = vgui.Create( "DTextEntry",pnl ) pnl.valueEntry = valueEntry valueEntry:Dock( TOP ) valueEntry:DockMargin( 2, 2, 2, 2 ) - + valueEntry.OnChange = function( panel ) selectedValues[pnl.id].Value = panel:GetValue() - + local val, tp = selectedValues[pnl.id].Value, selectedValues[pnl.id].DataType tp = types_lookup2[tp] or "Number" - + if typeGuessCheckbox:GetChecked() then guessType( val, typeSelection ) else @@ -299,47 +299,47 @@ if CLIENT then end end end - + local oldLoseFocus = valueEntry.OnLoseFocus valueEntry.OnLoseFocus = function( panel ) selectedValues[pnl.id].Value = panel:GetValue() SendUpdate() oldLoseFocus(panel) -- Otherwise we can't close the spawnmenu! end - + local parseIcon = vgui.Create( "DImage", valueEntry ) pnl.parseIcon = parseIcon parseIcon:Dock( RIGHT ) parseIcon:DockMargin( 2,2,2,2 ) parseIcon:SetImage( "icon16/accept.png" ) parseIcon:SizeToContents() - + typeSelection:ChooseOptionID( 1 ) return pnl end - + -- Receive values from the server (when they right click to copy) net.Receive( "wire_value_values", function( length ) saveValues( netReadValues() ) - + if not IsValid(slider) then -- They right clicked without opening the cpanel first, just save the values return end - + loadValues() end) - + -- Build context menu panel function TOOL.BuildCPanel( panel ) WireToolHelpers.MakeModelSizer(panel, "wire_value_modelsize") ModelPlug_AddToCPanel(panel, "Value", "wire_value", true) - + local reset = panel:Button("Reset Values") resetButton = reset - + typeGuessCheckbox = panel:CheckBox( "Automatically guess types", "wire_value_guesstype" ) - typeGuessCheckbox:SetToolTip( + typeGuessCheckbox:SetToolTip( [[When enabled, the type dropdown will automatically be updated as you type with guessed types. It's unable to guess angles because they look the same as vectors. @@ -351,7 +351,7 @@ to see what's wrong). There will never be an error if auto type guessing is enabled (unless you manually set the type), because it will automatically set the type to a string when all other types fail.]] ) - + local w,_ = panel:GetSize() local valueSlider = vgui.Create( "DNumSlider" ) slider = valueSlider @@ -361,26 +361,26 @@ types fail.]] ) valueSlider:SetMax(20) valueSlider:SetDark( true ) valueSlider:SetDecimals( 0 ) - + local LastValueAmount = 0 reset.DoClick = function( panel ) valueSlider:SetValue(1) - + for k,v in pairs(panels) do v:Remove() panels[k] = nil end - + for k,v in pairs( selectedValues ) do selectedValues[k] = nil end LastValueAmount = 0 - + valueSlider:OnValueChanged( 1 ) SendUpdate() end - + valueSlider.OnValueChanged = function( valueSlider, value ) local value = math.Clamp(math.Round(tonumber(value)),1,20) if value ~= LastValueAmount then @@ -395,35 +395,35 @@ types fail.]] ) panels[i] = nil end end - + itemPanel:SetTall( value * 73 ) LastValueAmount = value SendUpdate() end end - + itemPanel = vgui.Create( "DPanel" ) itemPanel.Paint = function() end panel:AddItem( itemPanel ) itemPanel:SetTall( 73 ) - + loadValues() SendUpdate() - + local pnl = vgui.Create( "DPanel" ) panel:AddItem( pnl ) pnl.Paint = function() end pnl:SetTall( 16 ) - + local add = vgui.Create( "DImageButton", pnl ) add:SetImage( "icon16/add.png" ) add:SizeToContents() add:SetToolTip( "Add a new value" ) - + function pnl.PerformLayout() add:Center() end - + function add.DoClick() slider:SetValue( math.min( slider:GetValue() + 1, 20 ) ) end diff --git a/lua/wire/stools/vthruster.lua b/lua/wire/stools/vthruster.lua index 7ba9fa3a..bb9c857c 100644 --- a/lua/wire/stools/vthruster.lua +++ b/lua/wire/stools/vthruster.lua @@ -29,9 +29,9 @@ TOOL.ClientConVar[ "mode" ] = "0" TOOL.ClientConVar[ "angleinputs" ] = "0" if SERVER then - function TOOL:GetConVars() - return self:GetClientNumber( "force" ), self:GetClientNumber( "force_min" ), self:GetClientNumber( "force_max" ), self:GetClientInfo( "oweffect" ), - self:GetClientInfo( "uweffect" ), self:GetClientNumber( "owater" ) ~= 0, self:GetClientNumber( "uwater" ) ~= 0, self:GetClientNumber( "bidir" ) ~= 0, + function TOOL:GetConVars() + return self:GetClientNumber( "force" ), self:GetClientNumber( "force_min" ), self:GetClientNumber( "force_max" ), self:GetClientInfo( "oweffect" ), + self:GetClientInfo( "uweffect" ), self:GetClientNumber( "owater" ) ~= 0, self:GetClientNumber( "uwater" ) ~= 0, self:GetClientNumber( "bidir" ) ~= 0, self:GetClientInfo( "soundname" ), self:GetClientNumber( "mode" ), self:GetClientNumber( "angleinputs" ) ~= 0 end end @@ -235,7 +235,7 @@ function TOOL.BuildCPanel(panel) ["#XY Local, Z World"] = { wire_vthruster_mode = "2" }, } }) - + panel:CheckBox("#WireVThrusterTool_Angle", "wire_vthruster_angleinputs") end diff --git a/lua/wire/stools/waypoint.lua b/lua/wire/stools/waypoint.lua index 60b68ada..bf77af43 100644 --- a/lua/wire/stools/waypoint.lua +++ b/lua/wire/stools/waypoint.lua @@ -51,7 +51,7 @@ function TOOL:LeftClick(trace) return end - + local ent = self:LeftClick_Make( trace, ply ) if isbool(ent) then return ent end local ret = self:LeftClick_PostMake( ent, ply, trace ) @@ -92,4 +92,3 @@ function TOOL.BuildCPanel(panel) panel:CheckBox("#WireWaypointTool_alink","wire_waypoint_alink") panel:CheckBox("#Create Flat to Surface", "wire_waypoint_createflat") end - diff --git a/lua/wire/stools/weight.lua b/lua/wire/stools/weight.lua index 714c2cdc..fc34e528 100644 --- a/lua/wire/stools/weight.lua +++ b/lua/wire/stools/weight.lua @@ -15,7 +15,7 @@ WireToolSetup.SetupMax( 20 ) if SERVER then ModelPlug_Register("weight") function TOOL:GetConVars() end - + -- Uses default WireToolObj:MakeEnt's WireLib.MakeWireEnt function end @@ -26,4 +26,4 @@ TOOL.ReloadSetsModel = true function TOOL.BuildCPanel(panel) ModelPlug_AddToCPanel(panel, "weight", "wire_weight", true) -end \ No newline at end of file +end diff --git a/lua/wire/stools/wheel.lua b/lua/wire/stools/wheel.lua index 14dbaf30..e895eac1 100644 --- a/lua/wire/stools/wheel.lua +++ b/lua/wire/stools/wheel.lua @@ -22,13 +22,13 @@ TOOL.ClientConVar = { fwd = 1, -- Forward bck = -1, -- Back stop = 0, -- Stop -} +} if SERVER then function TOOL:GetConVars() return self:GetClientNumber( "fwd" ), self:GetClientNumber( "bck" ), self:GetClientNumber( "stop" ), self:GetClientNumber( "torque" ) end - + function TOOL:MakeEnt( ply, model, Ang, trace ) local targetPhys = trace.Entity:GetPhysicsObjectNum( trace.PhysicsBone ) @@ -43,7 +43,7 @@ if SERVER then -- Create the wheel local wheelEnt = WireLib.MakeWireEnt(ply, {Class = self.WireClass, Pos=trace.HitPos, Angle=Ang, Model=model}, fwd, bck, stop, torque ) self:SetPos( wheelEnt, trace ) - + -- Wake up the physics object so that the entity updates wheelEnt:GetPhysicsObject():Wake() @@ -71,10 +71,10 @@ if SERVER then wheelEnt:SetDirection( constraint.direction ) wheelEnt:SetAxis( trace.HitNormal ) wheelEnt:DoDirectionEffect() - + return wheelEnt end - + function TOOL:LeftClick_PostMake(_, _, _) end -- We're handling this in MakeEnt since theres a motor end diff --git a/lua/wire/von.lua b/lua/wire/von.lua index 712ff155..919acc0f 100644 --- a/lua/wire/von.lua +++ b/lua/wire/von.lua @@ -18,7 +18,7 @@ If you disagree with the above, don't use the code. ----------------------------------------------------------------------------------------------------------------------------- - + Thanks to the following people for their contribution: - Divran Suggested improvements for making the code quicker. Suggested an excellent new way of deserializing strings. @@ -26,7 +26,7 @@ - pennerlord Provided some performance tests to help me improve the code. ----------------------------------------------------------------------------------------------------------------------------- - + The value types supported in this release of vON are: - table - number @@ -42,7 +42,7 @@ + Some very common GMod Lua types. ----------------------------------------------------------------------------------------------------------------------------- - + New in this version: - Fixed errors on vector and angle deserializing. - Added Player datatype. @@ -442,7 +442,7 @@ _serialize = { result[#result + 1] = val..":" val, lastType = s_anyVariable(data[keyvals[_i]], lastType, false, false, keyvalsProgress == keyvalsLen and not first, false, 0) - + result[#result + 1] = val end end diff --git a/lua/wire/zvm/zvm_opcodes.lua b/lua/wire/zvm/zvm_opcodes.lua index c95d6430..bfe3ce30 100644 --- a/lua/wire/zvm/zvm_opcodes.lua +++ b/lua/wire/zvm/zvm_opcodes.lua @@ -811,7 +811,7 @@ ZVM.OpcodeTable[110] = function(self) --EXTRET self:Dyn_EmitForceRegisterGlobal("ESP") self:Dyn_Emit("$L V = 0") self:Dyn_EmitState() - + self:Dyn_Emit("V = VM:Pop()") -- IRET CS self:Dyn_EmitInterruptCheck() self:Dyn_Emit("V = VM:Pop()") -- IRET EIP @@ -1178,20 +1178,20 @@ ZVM.OpcodeTable[140] = function(self) --EXTRETA self:Dyn_EmitForceRegisterGlobal("ESP") self:Dyn_Emit("$L V = 0") self:Dyn_EmitState() - + self:Dyn_Emit("V = VM:Pop()") -- IRET CS self:Dyn_EmitInterruptCheck() - + self:Dyn_Emit("V = VM:Pop()") -- IRET EIP self:Dyn_EmitInterruptCheck() - + for i=0,31 do self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.R"..i.." = V") end - + self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("$L IP = V") self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.CMPR = V") - + self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.EAX = V") self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.EBX = V") self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.ECX = V") @@ -1200,7 +1200,7 @@ ZVM.OpcodeTable[140] = function(self) --EXTRETA self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() -- Do not set ESP right now self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.ESI = V") self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.EDI = V") - + self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("$L CS = V") self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() -- Do not set SS right now self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.DS = V") @@ -1210,7 +1210,7 @@ ZVM.OpcodeTable[140] = function(self) --EXTRETA self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.KS = V") self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.LS = V") self:Dyn_Emit("VM:Jump(IP,CS)") - + self:Dyn_EmitBreak() self.PrecompileBreak = true end diff --git a/materials/beer/wiremod/gate_base.vmt b/materials/beer/wiremod/gate_base.vmt index bc8a5973..8fac53b2 100644 --- a/materials/beer/wiremod/gate_base.vmt +++ b/materials/beer/wiremod/gate_base.vmt @@ -2,4 +2,4 @@ { "$basetexture" "beer/wiremod/gate_base" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/gate_blue.vmt b/materials/beer/wiremod/gate_blue.vmt index 433ca191..6c54815d 100644 --- a/materials/beer/wiremod/gate_blue.vmt +++ b/materials/beer/wiremod/gate_blue.vmt @@ -2,4 +2,4 @@ { "$basetexture" "beer/wiremod/gate_blue" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/gate_e2.vmt b/materials/beer/wiremod/gate_e2.vmt index c9cb6e0a..0d4d3059 100644 --- a/materials/beer/wiremod/gate_e2.vmt +++ b/materials/beer/wiremod/gate_e2.vmt @@ -2,4 +2,4 @@ { "$basetexture" "beer/wiremod/gate_e2" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/gate_metal.vmt b/materials/beer/wiremod/gate_metal.vmt index c2a5b86c..d96d3644 100644 --- a/materials/beer/wiremod/gate_metal.vmt +++ b/materials/beer/wiremod/gate_metal.vmt @@ -10,4 +10,4 @@ "$selfillum" 0 "$model" 1 "$HalfLambert" 1 -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/gate_prongs.vmt b/materials/beer/wiremod/gate_prongs.vmt index 40d5ffdd..9c9bd369 100644 --- a/materials/beer/wiremod/gate_prongs.vmt +++ b/materials/beer/wiremod/gate_prongs.vmt @@ -4,4 +4,4 @@ "$basetexture" "beer/wiremod/gate_prongs" "$model" "1" "$nocull" "1" -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/gate_wirelogo.vmt b/materials/beer/wiremod/gate_wirelogo.vmt index 041ce142..100f8f2e 100644 --- a/materials/beer/wiremod/gate_wirelogo.vmt +++ b/materials/beer/wiremod/gate_wirelogo.vmt @@ -2,4 +2,4 @@ { "$basetexture" "beer/wiremod/gate_wirelogo" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/gps.vmt b/materials/beer/wiremod/gps.vmt index d472cd55..6a86ea8f 100644 --- a/materials/beer/wiremod/gps.vmt +++ b/materials/beer/wiremod/gps.vmt @@ -2,4 +2,4 @@ { "$basetexture" "beer/wiremod/gps" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/hydraulic2.vmt b/materials/beer/wiremod/hydraulic2.vmt index 0ddbc1c3..bd830c1a 100644 --- a/materials/beer/wiremod/hydraulic2.vmt +++ b/materials/beer/wiremod/hydraulic2.vmt @@ -6,4 +6,4 @@ $envmap env_cubemap "$model" "1" -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/keyboard.vmt b/materials/beer/wiremod/keyboard.vmt index 005001d0..9b3c05a0 100644 --- a/materials/beer/wiremod/keyboard.vmt +++ b/materials/beer/wiremod/keyboard.vmt @@ -2,4 +2,4 @@ { "$basetexture" "beer/wiremod/keyboard" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/numpad.vmt b/materials/beer/wiremod/numpad.vmt index 4ef64492..22ae1d85 100644 --- a/materials/beer/wiremod/numpad.vmt +++ b/materials/beer/wiremod/numpad.vmt @@ -2,4 +2,4 @@ { "$basetexture" "beer/wiremod/numpad" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/targetfinder.vmt b/materials/beer/wiremod/targetfinder.vmt index c6edc99f..f27ae021 100644 --- a/materials/beer/wiremod/targetfinder.vmt +++ b/materials/beer/wiremod/targetfinder.vmt @@ -2,4 +2,4 @@ { "$basetexture" "beer/wiremod/targetfinder" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/beer/wiremod/watersensor.vmt b/materials/beer/wiremod/watersensor.vmt index a26774b1..1e384918 100644 --- a/materials/beer/wiremod/watersensor.vmt +++ b/materials/beer/wiremod/watersensor.vmt @@ -2,4 +2,4 @@ { "$basetexture" "beer/wiremod/watersensor" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bluredges.vmt b/materials/bluredges.vmt index 40952ccc..8bd48868 100644 --- a/materials/bluredges.vmt +++ b/materials/bluredges.vmt @@ -2,15 +2,15 @@ "Refract" { - "$refractamount" "0.0" - "$bluramount" "1" + "$refractamount" "0.0" + "$bluramount" "1" "$REFRACTTINT" "{110 110 120}" "$scale" "[1 1]" "$dudvmap" "bluredges" "$normalmap" "bluredges" - + "$nocull" 1 "$ignorez" 1 @@ -23,4 +23,4 @@ { "$fallbackmaterial" "null" } -} \ No newline at end of file +} diff --git a/materials/bull/buttons/key_switch.vmt b/materials/bull/buttons/key_switch.vmt index 351bbc90..0b2f9504 100644 --- a/materials/bull/buttons/key_switch.vmt +++ b/materials/bull/buttons/key_switch.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/buttons/key_switch" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/buttons/rocker_switch.vmt b/materials/bull/buttons/rocker_switch.vmt index 90d8c40a..50898561 100644 --- a/materials/bull/buttons/rocker_switch.vmt +++ b/materials/bull/buttons/rocker_switch.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/buttons/rocker_switch" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/buttons/rocker_switch_alpha.vmt b/materials/bull/buttons/rocker_switch_alpha.vmt index 8105ad9b..f8117ade 100644 --- a/materials/bull/buttons/rocker_switch_alpha.vmt +++ b/materials/bull/buttons/rocker_switch_alpha.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/buttons/rocker_switch_alpha" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/buttons/rocker_switch_blue.vmt b/materials/bull/buttons/rocker_switch_blue.vmt index 6b14004b..5685549d 100644 --- a/materials/bull/buttons/rocker_switch_blue.vmt +++ b/materials/bull/buttons/rocker_switch_blue.vmt @@ -4,4 +4,4 @@ $model 1 $selfillum 1 $selfillumtint "[0 0 1]" -} \ No newline at end of file +} diff --git a/materials/bull/buttons/rocker_switch_green.vmt b/materials/bull/buttons/rocker_switch_green.vmt index fe5207bc..dcb20656 100644 --- a/materials/bull/buttons/rocker_switch_green.vmt +++ b/materials/bull/buttons/rocker_switch_green.vmt @@ -4,4 +4,4 @@ $model 1 $selfillum 1 $selfillumtint "[0 1 0]" -} \ No newline at end of file +} diff --git a/materials/bull/buttons/rocker_switch_orange.vmt b/materials/bull/buttons/rocker_switch_orange.vmt index d41e92db..449160d9 100644 --- a/materials/bull/buttons/rocker_switch_orange.vmt +++ b/materials/bull/buttons/rocker_switch_orange.vmt @@ -4,4 +4,4 @@ $model 1 $selfillum 1 $selfillumtint "[1 0.5 0]" -} \ No newline at end of file +} diff --git a/materials/bull/buttons/rocker_switch_red.vmt b/materials/bull/buttons/rocker_switch_red.vmt index 99971c56..85baff01 100644 --- a/materials/bull/buttons/rocker_switch_red.vmt +++ b/materials/bull/buttons/rocker_switch_red.vmt @@ -4,4 +4,4 @@ $model 1 $selfillum 1 $selfillumtint "[1 0 0]" -} \ No newline at end of file +} diff --git a/materials/bull/buttons/toggle_switch.vmt b/materials/bull/buttons/toggle_switch.vmt index 4091a7f0..c70e7a6d 100644 --- a/materials/bull/buttons/toggle_switch.vmt +++ b/materials/bull/buttons/toggle_switch.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/buttons/toggle_switch" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/controller.vmt b/materials/bull/gates/controller.vmt index 814e7586..2dafc7c4 100644 --- a/materials/bull/gates/controller.vmt +++ b/materials/bull/gates/controller.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/controller" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_aperture.vmt b/materials/bull/gates/gate_aperture.vmt index ee2e5f51..27d0a0d6 100644 --- a/materials/bull/gates/gate_aperture.vmt +++ b/materials/bull/gates/gate_aperture.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_aperture" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_and.vmt b/materials/bull/gates/gate_logic_and.vmt index d526a688..cc86add6 100644 --- a/materials/bull/gates/gate_logic_and.vmt +++ b/materials/bull/gates/gate_logic_and.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_and" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_and_aperture.vmt b/materials/bull/gates/gate_logic_and_aperture.vmt index d108d1f6..3c7153e9 100644 --- a/materials/bull/gates/gate_logic_and_aperture.vmt +++ b/materials/bull/gates/gate_logic_and_aperture.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_and_aperture" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_nand.vmt b/materials/bull/gates/gate_logic_nand.vmt index 41603aa3..afa759d8 100644 --- a/materials/bull/gates/gate_logic_nand.vmt +++ b/materials/bull/gates/gate_logic_nand.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_nand" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_nand_aperture.vmt b/materials/bull/gates/gate_logic_nand_aperture.vmt index f986fa2e..0a6b9968 100644 --- a/materials/bull/gates/gate_logic_nand_aperture.vmt +++ b/materials/bull/gates/gate_logic_nand_aperture.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_nand_aperture" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_nor.vmt b/materials/bull/gates/gate_logic_nor.vmt index 5f489e23..fe5c3540 100644 --- a/materials/bull/gates/gate_logic_nor.vmt +++ b/materials/bull/gates/gate_logic_nor.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_nor" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_nor_aperture.vmt b/materials/bull/gates/gate_logic_nor_aperture.vmt index e6585e57..69bcc5e4 100644 --- a/materials/bull/gates/gate_logic_nor_aperture.vmt +++ b/materials/bull/gates/gate_logic_nor_aperture.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_nor_aperture" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_not.vmt b/materials/bull/gates/gate_logic_not.vmt index dadf332b..70952589 100644 --- a/materials/bull/gates/gate_logic_not.vmt +++ b/materials/bull/gates/gate_logic_not.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_not" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_not_aperture.vmt b/materials/bull/gates/gate_logic_not_aperture.vmt index ac000f79..291569ab 100644 --- a/materials/bull/gates/gate_logic_not_aperture.vmt +++ b/materials/bull/gates/gate_logic_not_aperture.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_not_aperture" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_or.vmt b/materials/bull/gates/gate_logic_or.vmt index 292f9364..10559dc4 100644 --- a/materials/bull/gates/gate_logic_or.vmt +++ b/materials/bull/gates/gate_logic_or.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_or" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_or_aperture.vmt b/materials/bull/gates/gate_logic_or_aperture.vmt index d54d5c70..64fa28ab 100644 --- a/materials/bull/gates/gate_logic_or_aperture.vmt +++ b/materials/bull/gates/gate_logic_or_aperture.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_or_aperture" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_xnor.vmt b/materials/bull/gates/gate_logic_xnor.vmt index db01d04e..05b54886 100644 --- a/materials/bull/gates/gate_logic_xnor.vmt +++ b/materials/bull/gates/gate_logic_xnor.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_xnor" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_xnor_aperture.vmt b/materials/bull/gates/gate_logic_xnor_aperture.vmt index f676d6ea..9a556827 100644 --- a/materials/bull/gates/gate_logic_xnor_aperture.vmt +++ b/materials/bull/gates/gate_logic_xnor_aperture.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_xnor_aperture" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_xor.vmt b/materials/bull/gates/gate_logic_xor.vmt index 7afed68a..496838c5 100644 --- a/materials/bull/gates/gate_logic_xor.vmt +++ b/materials/bull/gates/gate_logic_xor.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_xor" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_logic_xor_aperture.vmt b/materials/bull/gates/gate_logic_xor_aperture.vmt index b04ac0c6..2fcc3ceb 100644 --- a/materials/bull/gates/gate_logic_xor_aperture.vmt +++ b/materials/bull/gates/gate_logic_xor_aperture.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_logic_xor_aperture" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/gate_orange.vmt b/materials/bull/gates/gate_orange.vmt index 64480e17..0822269c 100644 --- a/materials/bull/gates/gate_orange.vmt +++ b/materials/bull/gates/gate_orange.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/gate_orange" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/gates/standard_gate.vmt b/materials/bull/gates/standard_gate.vmt index c10994e1..d2ee07e0 100644 --- a/materials/bull/gates/standard_gate.vmt +++ b/materials/bull/gates/standard_gate.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/gates/standard_gate" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/various/capacitor.vmt b/materials/bull/various/capacitor.vmt index 5127b7f6..aa1b32b6 100644 --- a/materials/bull/various/capacitor.vmt +++ b/materials/bull/various/capacitor.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/various/capacitor" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/various/gyroscope.vmt b/materials/bull/various/gyroscope.vmt index 8a8b473b..86049aab 100644 --- a/materials/bull/various/gyroscope.vmt +++ b/materials/bull/various/gyroscope.vmt @@ -3,4 +3,4 @@ "$basetexture" "bull/various/gyroscope" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/various/oldwire_base.vmt b/materials/bull/various/oldwire_base.vmt index 4dbf88a2..602401df 100644 --- a/materials/bull/various/oldwire_base.vmt +++ b/materials/bull/various/oldwire_base.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/various/oldwire_base" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/various/resistor_aperture.vmt b/materials/bull/various/resistor_aperture.vmt index 5a29e309..48a34097 100644 --- a/materials/bull/various/resistor_aperture.vmt +++ b/materials/bull/various/resistor_aperture.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/various/resistor_aperture" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/various/resistor_wiremod.vmt b/materials/bull/various/resistor_wiremod.vmt index 9b07e420..af91f90e 100644 --- a/materials/bull/various/resistor_wiremod.vmt +++ b/materials/bull/various/resistor_wiremod.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/various/resistor_wiremod" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/various/siren.vmt b/materials/bull/various/siren.vmt index d072a87b..8b1e1dd6 100644 --- a/materials/bull/various/siren.vmt +++ b/materials/bull/various/siren.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/various/siren" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/various/speedometer.vmt b/materials/bull/various/speedometer.vmt index 3b14211e..61585492 100644 --- a/materials/bull/various/speedometer.vmt +++ b/materials/bull/various/speedometer.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/various/speedometer" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/various/subwoofer.vmt b/materials/bull/various/subwoofer.vmt index ff79a5d5..c1c71e2e 100644 --- a/materials/bull/various/subwoofer.vmt +++ b/materials/bull/various/subwoofer.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/various/subwoofer" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/various/usb_socket.vmt b/materials/bull/various/usb_socket.vmt index be8b9ffd..c30d531c 100644 --- a/materials/bull/various/usb_socket.vmt +++ b/materials/bull/various/usb_socket.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/various/usb_socket" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/bull/various/usb_stick.vmt b/materials/bull/various/usb_stick.vmt index 53dbb02b..77202f7a 100644 --- a/materials/bull/various/usb_stick.vmt +++ b/materials/bull/various/usb_stick.vmt @@ -2,4 +2,4 @@ { "$basetexture" "bull/various/usb_stick" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/dummy_texture.vmt b/materials/dummy_texture.vmt index 0d3e99b3..bdd85194 100644 --- a/materials/dummy_texture.vmt +++ b/materials/dummy_texture.vmt @@ -5,4 +5,4 @@ "$vertexcolor" 1 "$vertexalpha" 1 "$nolod" 1 -} \ No newline at end of file +} diff --git a/materials/egon_middlebeam.vmt b/materials/egon_middlebeam.vmt index f29a5c53..5f6b8715 100644 --- a/materials/egon_middlebeam.vmt +++ b/materials/egon_middlebeam.vmt @@ -1,7 +1,7 @@ "UnlitGeneric" { - "$basetexture" "sprites/physbeam" + "$basetexture" "sprites/physbeam" "$additive" 1 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/egon_ringbeam.vmt b/materials/egon_ringbeam.vmt index 40eb1728..62cf785b 100644 --- a/materials/egon_ringbeam.vmt +++ b/materials/egon_ringbeam.vmt @@ -1,12 +1,12 @@ "Refract" { - "$refractamount" "0.03" - "$bluramount" "0" + "$refractamount" "0.03" + "$bluramount" "0" "$scale" "[1 1]" "$normalmap" "egon_refract" - + "$nocull" 1 "$ignorez" 0 diff --git a/materials/hudindicator/hi_fullcircle.vmt b/materials/hudindicator/hi_fullcircle.vmt index 4695cd33..f4dfc867 100644 --- a/materials/hudindicator/hi_fullcircle.vmt +++ b/materials/hudindicator/hi_fullcircle.vmt @@ -2,4 +2,4 @@ { "$basetexture" "hudindicator/hi_fullcircle" "$alpha" 0.75 -} \ No newline at end of file +} diff --git a/materials/hudindicator/hi_semicircle.vmt b/materials/hudindicator/hi_semicircle.vmt index 41b31219..30dbdc17 100644 --- a/materials/hudindicator/hi_semicircle.vmt +++ b/materials/hudindicator/hi_semicircle.vmt @@ -2,4 +2,4 @@ { "$basetexture" "hudindicator/hi_semicircle" "$alpha" 0.75 -} \ No newline at end of file +} diff --git a/materials/kobilica/blackground.vmt b/materials/kobilica/blackground.vmt index 973118cc..c3da71f6 100644 --- a/materials/kobilica/blackground.vmt +++ b/materials/kobilica/blackground.vmt @@ -3,4 +3,4 @@ "$basetexture" "kobilica/blackground" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/kobilica/kobilica_capacitor.vmt b/materials/kobilica/kobilica_capacitor.vmt index 52694702..8f7a7db9 100644 --- a/materials/kobilica/kobilica_capacitor.vmt +++ b/materials/kobilica/kobilica_capacitor.vmt @@ -3,4 +3,4 @@ "$basetexture" "kobilica/kobilica_capacitor" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/kobilica/relayblue.vmt b/materials/kobilica/relayblue.vmt index 01a28155..0ccab24d 100644 --- a/materials/kobilica/relayblue.vmt +++ b/materials/kobilica/relayblue.vmt @@ -3,4 +3,4 @@ "$basetexture" "kobilica/relayblue" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/kobilica/transistor.vmt b/materials/kobilica/transistor.vmt index 398cf619..4d3e63b6 100644 --- a/materials/kobilica/transistor.vmt +++ b/materials/kobilica/transistor.vmt @@ -3,4 +3,4 @@ "$basetexture" "kobilica/transistor" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/kobilica/value_body.vmt b/materials/kobilica/value_body.vmt index c450b79a..3fc02036 100644 --- a/materials/kobilica/value_body.vmt +++ b/materials/kobilica/value_body.vmt @@ -3,4 +3,4 @@ "$basetexture" "kobilica/value_body" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/kobilica/value_pin.vmt b/materials/kobilica/value_pin.vmt index 081a1226..13a454d7 100644 --- a/materials/kobilica/value_pin.vmt +++ b/materials/kobilica/value_pin.vmt @@ -3,4 +3,4 @@ "$basetexture" "kobilica/value_pin" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/kobilica/wire_monitor.vmt b/materials/kobilica/wire_monitor.vmt index f6ee6606..799f9ef9 100644 --- a/materials/kobilica/wire_monitor.vmt +++ b/materials/kobilica/wire_monitor.vmt @@ -5,4 +5,4 @@ "$nodecal" "1" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/models/segment/segment_skin.vmt b/materials/models/segment/segment_skin.vmt index ec9d386c..e9426baa 100644 --- a/materials/models/segment/segment_skin.vmt +++ b/materials/models/segment/segment_skin.vmt @@ -2,4 +2,4 @@ { $basetexture "models/segment/segment_skin" $model 1 -} \ No newline at end of file +} diff --git a/materials/refract_ring.vmt b/materials/refract_ring.vmt index e5e41275..c7d438a1 100644 --- a/materials/refract_ring.vmt +++ b/materials/refract_ring.vmt @@ -1,13 +1,13 @@ "Refract" { - "$refractamount" "0.0" - "$bluramount" "0" + "$refractamount" "0.0" + "$bluramount" "0" "$scale" "[1 1]" "$dudvmap" "refract_ring" "$normalmap" "refract_ring" - + "$nocull" 1 "$ignorez" 0 @@ -20,4 +20,4 @@ { "$fallbackmaterial" "null" } -} \ No newline at end of file +} diff --git a/materials/sprites/gmdm_pickups/base.vmt b/materials/sprites/gmdm_pickups/base.vmt index f5ff4a58..7a86ce2d 100644 --- a/materials/sprites/gmdm_pickups/base.vmt +++ b/materials/sprites/gmdm_pickups/base.vmt @@ -3,4 +3,4 @@ { "$basetexture" "sprites/gmdm_pickups/base" "$nocull" 1 -} \ No newline at end of file +} diff --git a/materials/sprites/gmdm_pickups/base_r.vmt b/materials/sprites/gmdm_pickups/base_r.vmt index d8f570bf..1d17cec2 100644 --- a/materials/sprites/gmdm_pickups/base_r.vmt +++ b/materials/sprites/gmdm_pickups/base_r.vmt @@ -1,14 +1,14 @@ "Refract" { - "$refractamount" "1" - "$bluramount" "0" + "$refractamount" "1" + "$bluramount" "0" "$REFRACTTINT" "{255 255 255}" "$scale" "[1 1]" "$dudvmap" "sprites/gmdm_pickups/base_r" "$normalmap" "sprites/gmdm_pickups/base_r" - + "$nocull" 1 "$ignorez" 1 @@ -21,4 +21,4 @@ { "$fallbackmaterial" "sprites/gmdm_pickups/base" } -} \ No newline at end of file +} diff --git a/materials/sprites/gmdm_pickups/light.vmt b/materials/sprites/gmdm_pickups/light.vmt index 079c49d9..37aff8fb 100644 --- a/materials/sprites/gmdm_pickups/light.vmt +++ b/materials/sprites/gmdm_pickups/light.vmt @@ -5,4 +5,4 @@ "$additive" 1 "$vertexalpha" 1 "$vertexcolor" 1 -} \ No newline at end of file +} diff --git a/materials/sprites/gmdm_pickups/name.vmt b/materials/sprites/gmdm_pickups/name.vmt index 5708be08..9872431f 100644 --- a/materials/sprites/gmdm_pickups/name.vmt +++ b/materials/sprites/gmdm_pickups/name.vmt @@ -5,4 +5,4 @@ "$translucent" 1 "$vertexalpha" 1 "$vertexcolor" 1 -} \ No newline at end of file +} diff --git a/materials/sprites/gmdm_pickups/over.vmt b/materials/sprites/gmdm_pickups/over.vmt index 23dfbd00..194d5993 100644 --- a/materials/sprites/gmdm_pickups/over.vmt +++ b/materials/sprites/gmdm_pickups/over.vmt @@ -4,4 +4,4 @@ "$basetexture" "sprites/gmdm_pickups/over" "$nocull" 1 "$translucent" 1 -} \ No newline at end of file +} diff --git a/materials/sprites/light_ignorez.vmt b/materials/sprites/light_ignorez.vmt index b4d9bfab..9e961507 100644 --- a/materials/sprites/light_ignorez.vmt +++ b/materials/sprites/light_ignorez.vmt @@ -6,4 +6,4 @@ "$vertexalpha" 1 "$vertexcolor" 1 "$ignorez" 1 -} \ No newline at end of file +} diff --git a/materials/sprites/magic.vmt b/materials/sprites/magic.vmt index b0c1feed..a54cbcbb 100644 --- a/materials/sprites/magic.vmt +++ b/materials/sprites/magic.vmt @@ -16,4 +16,4 @@ "animatedtextureframerate" 20 } } -} \ No newline at end of file +} diff --git a/materials/sprites/soul.vmt b/materials/sprites/soul.vmt index 16039078..94e62569 100644 --- a/materials/sprites/soul.vmt +++ b/materials/sprites/soul.vmt @@ -6,4 +6,4 @@ "$vertexcolor" 1 "$ignorez" 0 "$additive" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/candy.vmt b/materials/thrusteraddon/candy.vmt index d6ac8975..2b2ab77d 100644 --- a/materials/thrusteraddon/candy.vmt +++ b/materials/thrusteraddon/candy.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/feather.vmt b/materials/thrusteraddon/feather.vmt index 38f6c251..897d7f3a 100644 --- a/materials/thrusteraddon/feather.vmt +++ b/materials/thrusteraddon/feather.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/feather1.vmt b/materials/thrusteraddon/feather1.vmt index 63529e08..a4703dda 100644 --- a/materials/thrusteraddon/feather1.vmt +++ b/materials/thrusteraddon/feather1.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/feather2.vmt b/materials/thrusteraddon/feather2.vmt index 465c5f3e..419ff804 100644 --- a/materials/thrusteraddon/feather2.vmt +++ b/materials/thrusteraddon/feather2.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/feather3.vmt b/materials/thrusteraddon/feather3.vmt index 6791a2ff..f67dd414 100644 --- a/materials/thrusteraddon/feather3.vmt +++ b/materials/thrusteraddon/feather3.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/feather4.vmt b/materials/thrusteraddon/feather4.vmt index cc129005..3d22ac6f 100644 --- a/materials/thrusteraddon/feather4.vmt +++ b/materials/thrusteraddon/feather4.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/goldstar.vmt b/materials/thrusteraddon/goldstar.vmt index 047a6b64..593a6322 100644 --- a/materials/thrusteraddon/goldstar.vmt +++ b/materials/thrusteraddon/goldstar.vmt @@ -5,4 +5,4 @@ "$vertexcolor" 1 "$vertexalpha" 1 "$selfillum" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/goo.vmt b/materials/thrusteraddon/goo.vmt index 9008c024..6a658797 100644 --- a/materials/thrusteraddon/goo.vmt +++ b/materials/thrusteraddon/goo.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/goo2.vmt b/materials/thrusteraddon/goo2.vmt index 314f3c74..08bfd929 100644 --- a/materials/thrusteraddon/goo2.vmt +++ b/materials/thrusteraddon/goo2.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/money1.vmt b/materials/thrusteraddon/money1.vmt index eb076bc5..96a70674 100644 --- a/materials/thrusteraddon/money1.vmt +++ b/materials/thrusteraddon/money1.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/money2.vmt b/materials/thrusteraddon/money2.vmt index b3aab3ac..382c0a4d 100644 --- a/materials/thrusteraddon/money2.vmt +++ b/materials/thrusteraddon/money2.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/money3.vmt b/materials/thrusteraddon/money3.vmt index 663e7532..8ccd0c3a 100644 --- a/materials/thrusteraddon/money3.vmt +++ b/materials/thrusteraddon/money3.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/thrusteraddon/sperm.vmt b/materials/thrusteraddon/sperm.vmt index b33c113c..03abef03 100644 --- a/materials/thrusteraddon/sperm.vmt +++ b/materials/thrusteraddon/sperm.vmt @@ -4,4 +4,4 @@ "$additive" 0 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/tripmine_laser.vmt b/materials/tripmine_laser.vmt index 22ecf6a7..2ea503dd 100644 --- a/materials/tripmine_laser.vmt +++ b/materials/tripmine_laser.vmt @@ -1,7 +1,7 @@ "UnlitGeneric" { - "$basetexture" "laser" + "$basetexture" "laser" "$additive" 1 "$vertexcolor" 1 "$vertexalpha" 1 -} \ No newline at end of file +} diff --git a/materials/venompapa/wirecd/wirecd.vmt b/materials/venompapa/wirecd/wirecd.vmt index 7ec00be2..3a177956 100644 --- a/materials/venompapa/wirecd/wirecd.vmt +++ b/materials/venompapa/wirecd/wirecd.vmt @@ -4,8 +4,8 @@ "$surfaceprop" "plastic" "$phong" "1" "$halflambert" 1 - "$phongexponent" "60" - "$phongboost" "2" - "$phongfresnelranges" "[.5 .8 1]" + "$phongexponent" "60" + "$phongboost" "2" + "$phongfresnelranges" "[.5 .8 1]" "$model" 1 } diff --git a/materials/venompapa/wirecd/wirecd2.vmt b/materials/venompapa/wirecd/wirecd2.vmt index 479d6700..a8316318 100644 --- a/materials/venompapa/wirecd/wirecd2.vmt +++ b/materials/venompapa/wirecd/wirecd2.vmt @@ -4,8 +4,8 @@ "$surfaceprop" "plastic" "$phong" "1" "$halflambert" 1 - "$phongexponent" "60" - "$phongboost" "2" - "$phongfresnelranges" "[.5 .8 1]" + "$phongexponent" "60" + "$phongboost" "2" + "$phongfresnelranges" "[.5 .8 1]" "$model" 1 } diff --git a/materials/venompapa/wirecd/wirecd3.vmt b/materials/venompapa/wirecd/wirecd3.vmt index 4a3d4e13..e56a97c1 100644 --- a/materials/venompapa/wirecd/wirecd3.vmt +++ b/materials/venompapa/wirecd/wirecd3.vmt @@ -4,8 +4,8 @@ "$surfaceprop" "plastic" "$phong" "1" "$halflambert" 1 - "$phongexponent" "60" - "$phongboost" "2" - "$phongfresnelranges" "[.5 .8 1]" + "$phongexponent" "60" + "$phongboost" "2" + "$phongfresnelranges" "[.5 .8 1]" "$model" 1 } diff --git a/materials/venompapa/wirecd/wirecd4.vmt b/materials/venompapa/wirecd/wirecd4.vmt index c45e85af..9adbcf15 100644 --- a/materials/venompapa/wirecd/wirecd4.vmt +++ b/materials/venompapa/wirecd/wirecd4.vmt @@ -4,8 +4,8 @@ "$surfaceprop" "plastic" "$phong" "1" "$halflambert" 1 - "$phongexponent" "60" - "$phongboost" "2" - "$phongfresnelranges" "[.5 .8 1]" + "$phongexponent" "60" + "$phongboost" "2" + "$phongfresnelranges" "[.5 .8 1]" "$model" 1 } diff --git a/materials/venompapa/wirecd/wirecd5.vmt b/materials/venompapa/wirecd/wirecd5.vmt index 1b1353a8..abe7b868 100644 --- a/materials/venompapa/wirecd/wirecd5.vmt +++ b/materials/venompapa/wirecd/wirecd5.vmt @@ -4,8 +4,8 @@ "$surfaceprop" "plastic" "$phong" "1" "$halflambert" 1 - "$phongexponent" "60" - "$phongboost" "2" - "$phongfresnelranges" "[.5 .8 1]" + "$phongexponent" "60" + "$phongboost" "2" + "$phongfresnelranges" "[.5 .8 1]" "$model" 1 } diff --git a/materials/venompapa/wirecd/wirecd6.vmt b/materials/venompapa/wirecd/wirecd6.vmt index fe688b01..c6ce0f5e 100644 --- a/materials/venompapa/wirecd/wirecd6.vmt +++ b/materials/venompapa/wirecd/wirecd6.vmt @@ -4,8 +4,8 @@ "$surfaceprop" "plastic" "$phong" "1" "$halflambert" 1 - "$phongexponent" "60" - "$phongboost" "2" - "$phongfresnelranges" "[.5 .8 1]" + "$phongexponent" "60" + "$phongboost" "2" + "$phongfresnelranges" "[.5 .8 1]" "$model" 1 } diff --git a/materials/venompapa/wirecd/wirecd7.vmt b/materials/venompapa/wirecd/wirecd7.vmt index 1c7cefa0..e07b467c 100644 --- a/materials/venompapa/wirecd/wirecd7.vmt +++ b/materials/venompapa/wirecd/wirecd7.vmt @@ -4,8 +4,8 @@ "$surfaceprop" "plastic" "$phong" "1" "$halflambert" 1 - "$phongexponent" "60" - "$phongboost" "2" - "$phongfresnelranges" "[.5 .8 1]" + "$phongexponent" "60" + "$phongboost" "2" + "$phongfresnelranges" "[.5 .8 1]" "$model" 1 } diff --git a/materials/venompapa/wirecd/wirecd_blank.vmt b/materials/venompapa/wirecd/wirecd_blank.vmt index ba7a72b3..6c717546 100644 --- a/materials/venompapa/wirecd/wirecd_blank.vmt +++ b/materials/venompapa/wirecd/wirecd_blank.vmt @@ -4,8 +4,8 @@ "$surfaceprop" "plastic" "$phong" "1" "$halflambert" 1 - "$phongexponent" "60" - "$phongboost" "2" - "$phongfresnelranges" "[.5 .8 1]" + "$phongexponent" "60" + "$phongboost" "2" + "$phongfresnelranges" "[.5 .8 1]" "$model" 1 } diff --git a/materials/venompapa/wirecd/wirecd_blank2.vmt b/materials/venompapa/wirecd/wirecd_blank2.vmt index 2f11c941..4bb637c3 100644 --- a/materials/venompapa/wirecd/wirecd_blank2.vmt +++ b/materials/venompapa/wirecd/wirecd_blank2.vmt @@ -4,8 +4,8 @@ "$surfaceprop" "plastic" "$phong" "1" "$halflambert" 1 - "$phongexponent" "60" - "$phongboost" "2" - "$phongfresnelranges" "[.5 .8 1]" + "$phongexponent" "60" + "$phongboost" "2" + "$phongfresnelranges" "[.5 .8 1]" "$model" 1 } diff --git a/materials/venompapa/wirecd/wirecdlock.vmt b/materials/venompapa/wirecd/wirecdlock.vmt index b95e8bb8..a7fb3cea 100644 --- a/materials/venompapa/wirecd/wirecdlock.vmt +++ b/materials/venompapa/wirecd/wirecdlock.vmt @@ -4,13 +4,13 @@ "$surfaceprop" "plastic" "$phong" "1" "$halflambert" 1 - "$phongexponent" "60" - "$phongboost" "2" - "$phongfresnelranges" "[.5 .8 1]" + "$phongexponent" "60" + "$phongboost" "2" + "$phongfresnelranges" "[.5 .8 1]" "$model" 1 - "$reflecttexture" "_rt_WaterReflection" + "$reflecttexture" "_rt_WaterReflection" "$reflectentities" 1 "$envmap" "env_cubemap" "$envmaptint" "[ 0.4 0.4 0.4 ]" diff --git a/materials/vgui/e2logo.vmt b/materials/vgui/e2logo.vmt index cac1d780..235dc75a 100644 --- a/materials/vgui/e2logo.vmt +++ b/materials/vgui/e2logo.vmt @@ -5,5 +5,5 @@ "$vertexcolor" 1 "$vertexalpha" 1 "$nolod" 1 - + } diff --git a/materials/vgui/entities/laserpointer.vmt b/materials/vgui/entities/laserpointer.vmt index d45c9a9b..33ee6be0 100644 --- a/materials/vgui/entities/laserpointer.vmt +++ b/materials/vgui/entities/laserpointer.vmt @@ -1,8 +1,8 @@ //Added by aVoN -"UnlitGeneric" -{ - "$basetexture" "vgui/entities/laserPointer" - "$vertexcolor" 1 - "$vertexalpha" 1 - "$nolod" 1 -} +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/laserPointer" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/materials/vgui/entities/sent_deployableballoons.vmt b/materials/vgui/entities/sent_deployableballoons.vmt index c44d300e..9356d7f1 100644 --- a/materials/vgui/entities/sent_deployableballoons.vmt +++ b/materials/vgui/entities/sent_deployableballoons.vmt @@ -1,7 +1,7 @@ -"UnlitGeneric" -{ - "$basetexture" "vgui/entities/sent_deployableballoons" - "$vertexcolor" 1 - "$vertexalpha" 1 - "$nolod" 1 -} +"UnlitGeneric" +{ + "$basetexture" "vgui/entities/sent_deployableballoons" + "$vertexcolor" 1 + "$vertexalpha" 1 + "$nolod" 1 +} diff --git a/materials/wingf0x/ethernet_copper.vmt b/materials/wingf0x/ethernet_copper.vmt index 16938d3e..d4eeeb4f 100644 --- a/materials/wingf0x/ethernet_copper.vmt +++ b/materials/wingf0x/ethernet_copper.vmt @@ -4,4 +4,4 @@ $alphatest 1 "$model" "1" -} \ No newline at end of file +} diff --git a/materials/wingf0x/ethernet_cover.vmt b/materials/wingf0x/ethernet_cover.vmt index 00834415..cf0695e7 100644 --- a/materials/wingf0x/ethernet_cover.vmt +++ b/materials/wingf0x/ethernet_cover.vmt @@ -3,4 +3,4 @@ "$basetexture" "wingf0x/ethernet_cover" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/wingf0x/ethernet_wires.vmt b/materials/wingf0x/ethernet_wires.vmt index d1302250..52b63161 100644 --- a/materials/wingf0x/ethernet_wires.vmt +++ b/materials/wingf0x/ethernet_wires.vmt @@ -3,4 +3,4 @@ "$basetexture" "wingf0x/ethernet_wires" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/wingf0x/hdmi_plast.vmt b/materials/wingf0x/hdmi_plast.vmt index 014b2b11..2c4f003f 100644 --- a/materials/wingf0x/hdmi_plast.vmt +++ b/materials/wingf0x/hdmi_plast.vmt @@ -3,4 +3,4 @@ "$basetexture" "wingf0x/hdmi_plast" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/wingf0x/hdmi_plug.vmt b/materials/wingf0x/hdmi_plug.vmt index 8028c1e1..9a906103 100644 --- a/materials/wingf0x/hdmi_plug.vmt +++ b/materials/wingf0x/hdmi_plug.vmt @@ -3,4 +3,4 @@ "$basetexture" "wingf0x/hdmi_plug" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/wingf0x/isa_plug.vmt b/materials/wingf0x/isa_plug.vmt index 87a056e9..1cc845ff 100644 --- a/materials/wingf0x/isa_plug.vmt +++ b/materials/wingf0x/isa_plug.vmt @@ -3,4 +3,4 @@ "$basetexture" "wingf0x/isa_plug" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/wingf0x/isa_slot.vmt b/materials/wingf0x/isa_slot.vmt index 14175c30..148b74a4 100644 --- a/materials/wingf0x/isa_slot.vmt +++ b/materials/wingf0x/isa_slot.vmt @@ -3,4 +3,4 @@ "$basetexture" "wingf0x/isa_slot" "$model" "1" -} \ No newline at end of file +} diff --git a/materials/wingf0x/seethrough_plastic.vmt b/materials/wingf0x/seethrough_plastic.vmt index ca34f0b0..db9e6c40 100644 --- a/materials/wingf0x/seethrough_plastic.vmt +++ b/materials/wingf0x/seethrough_plastic.vmt @@ -5,4 +5,4 @@ $halflambert 1 "$model" "1" -} \ No newline at end of file +} diff --git a/wiremod.fgd b/wiremod.fgd index 5a2cb0aa..606f5936 100644 --- a/wiremod.fgd +++ b/wiremod.fgd @@ -329,7 +329,7 @@ input Deactivate(void) : "Disallow the triggering from wire inputs and the updating of wire outputs." input Toggle(void) : "Toggle the status." - + // Spawnflags spawnflags(flags) = [