From 9934fb853e503ee1d0e7b5ab3d242f07741b3e53 Mon Sep 17 00:00:00 2001 From: underscorediscovery Date: Wed, 17 Jul 2013 14:03:40 -0230 Subject: [PATCH] Updating the random indexes to work on mobile. Todo:Try all the shaders and find the best ones. --- examples/HerokuShaders/src/Main.hx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/examples/HerokuShaders/src/Main.hx b/examples/HerokuShaders/src/Main.hx index f200423fd..ca96cf12d 100644 --- a/examples/HerokuShaders/src/Main.hx +++ b/examples/HerokuShaders/src/Main.hx @@ -80,7 +80,11 @@ class Main { #end //if !mobile //The maximum time to spend on a shader example before cycling + #if !mobile private static var maxTime = 2; + #else + private static var maxTime = 5; + #end //The current active shader example in the list private var currentIndex:Int; @@ -114,12 +118,16 @@ class Main { var time = haxe.Timer.stamp() - startTime; if (time > maxTime && fragmentShaders.length > 1) { - //Pick a random example to show - if( include_slow_expensive_examples ) { + #if !mobile + //Pick a random example to show + if( include_slow_expensive_examples ) { + currentIndex = Std.random( fragmentShaders.length - 1 ); + } else { + currentIndex = slow_end_index + next ; + } + #else currentIndex = Std.random( fragmentShaders.length - 1 ); - } else { - currentIndex = slow_end_index + Std.random( (fragmentShaders.length - slow_end_index - 1) ); - } + #end compile ();