summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjules <jules@okfoc.us>2013-12-17 10:06:37 -0500
committerjules <jules@okfoc.us>2013-12-17 10:06:37 -0500
commitf4eee2184b439c4e60edd3215441a212bf2bae58 (patch)
tree67f89e36bb67556d9324a169893f3d5c09d65759
parent3ed9546b8671c277011085c649986d48208a8a35 (diff)
weird ish when loading gif still
-rw-r--r--js/util.js2
-rw-r--r--shader-gif.html7
2 files changed, 7 insertions, 2 deletions
diff --git a/js/util.js b/js/util.js
index 3a03f55..fb15fb5 100644
--- a/js/util.js
+++ b/js/util.js
@@ -40,7 +40,7 @@ function randint(n){ return rand(n)|0 }
function choice(a){ return a[randint(a.length)] }
function deg(n){ return n*180/PI }
function rad(n){ return n*PI/180 }
-function pixel(x,y){ return 4*(y*w+x) }
+function pixel(x,y){ return 4*(mod(y,h)*w+mod(x,w)) }
function rgbpixel(d,x,y){
var p = pixel(x,y)
r = d[p]
diff --git a/shader-gif.html b/shader-gif.html
index 9f7e398..59d2add 100644
--- a/shader-gif.html
+++ b/shader-gif.html
@@ -189,7 +189,12 @@ function draw(t) {
var frame, img_frame;
function giveFrame(t){
if (window.gif) {
- return gif.frames[gif.currentFrame(t)]
+ if (gif.currentFrame) {
+ return gif.frames[gif.currentFrame(t)]
+ }
+ else {
+ return gif.frames[0]
+ }
}
else if (window.img) {
return img_frame