summaryrefslogtreecommitdiff
path: root/examples/resources/lib/utillib.lua
diff options
context:
space:
mode:
Diffstat (limited to 'examples/resources/lib/utillib.lua')
-rw-r--r--examples/resources/lib/utillib.lua19
1 files changed, 13 insertions, 6 deletions
diff --git a/examples/resources/lib/utillib.lua b/examples/resources/lib/utillib.lua
index a661f60..4054006 100644
--- a/examples/resources/lib/utillib.lua
+++ b/examples/resources/lib/utillib.lua
@@ -7,11 +7,6 @@ end
local utillib = {}
--- Does not work with dictionaries.
-function utillib.arrayClone( org )
- return { table.unpack( org ) }
-end
-
function utillib.deepCopy( orig )
local copy
@@ -156,7 +151,8 @@ function utillib.colorLerp( a, b, f )
return {
utillib.round( utillib.lerp( a[1], b[1], f ) ),
utillib.round( utillib.lerp( a[2], b[2], f ) ),
- utillib.round( utillib.lerp( a[3], b[3], f ) ) }
+ utillib.round( utillib.lerp( a[3], b[3], f ) )
+ }
end
-- Move secuence of elements inside table.
@@ -176,4 +172,15 @@ function utillib.randomFloat( min, max )
return min + math.random() * ( max - min );
end
+function utillib.printBin( v )
+ for i = 31, 0, -1 do
+ if RL.BitGet( v, i ) then
+ io.write( "1" )
+ else
+ io.write( "0" )
+ end
+ end
+ print()
+end
+
return utillib