This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c6240000000000001a53000000000000,PowerA,a:b0,b:b1,x:b2,y:b3,back:b9,start:b8,leftstick:b6,rightstick:b7,leftshoulder:b4,rightshoulder:b5,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Mac OS X, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A cooperative-"multithreading" JavaScript routine to allow asynchronous rendering and | |
// display without the cost of WebWorker serialization. -- @CasualEffects | |
var updateImageData = ctx.createImageData(screenWidth, screenHeight); | |
var updateImage = document.createElement('canvas'); | |
updateImage.width = screenWidth; | |
updateImage.height = screenHeight; | |
var makeRenderLoop = function*() { | |
while (true) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @CasualEffects & @pervognsen | |
var shift = ((border !== TRANSPARENT) && (border !== fill)) ? 0.5 : 0; | |
// For each non-horizontal edge, store: | |
// | |
// [startX, startY, dx/dy slope, vertical height]. | |
// | |
// These are the values needed for the edge-intersection test. Add edges so that the | |
// start Y coordinate is less than the end one. | |
var edgeArray = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var [rnd, srand] = (function() { | |
/* Based on https://github.com/AndreasMadsen/xorshift/blob/master/xorshift.js | |
Copyright (c) 2014 Andreas Madsen & Emil Bay | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
software and associated documentation files (the "Software"), to deal in the Software | |
without restriction, including without limitation the rights to use, copy, modify, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Applies arithmetic vector op to all elements of a and b. | |
If one is an object, then the result is also an object | |
*/ | |
function _ch_vecApply(opname, op, a, b) { | |
var c, i, p; | |
var noB = arguments.length <= 3; | |
if (isNumber(a)) { | |
if (noB || isNumber(b)) { |