summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <quaker66@gmail.com>2014-02-17 16:39:17 +0000
committerDaniel Kolesa <quaker66@gmail.com>2014-02-17 16:39:17 +0000
commit66e4b81171d9b426d2046ab5407a2891db1dec47 (patch)
treec649381840c17d640c4351c5c8442930df7647d8
parentbe58d66d1812ae05a7dd80dc166fbfc78d6544a3 (diff)
get rid of the math library usage, instead use custom util functions (can be replaced with custom impls later, for now uses C math lib)
-rw-r--r--tests/image_blend_many_smooth_same_scaled.lua2
-rw-r--r--tests/image_blend_occlude.lua2
-rw-r--r--tests/image_blend_scaled.lua2
-rw-r--r--tests/image_blend_unscaled.lua2
-rw-r--r--tests/image_map_rotate.lua2
-rw-r--r--tests/line_blend.lua6
-rw-r--r--tests/poly_blend.lua2
-rw-r--r--tests/proxy_image.lua2
-rw-r--r--tests/proxy_text_fixed.lua2
-rw-r--r--tests/proxy_text_random.lua2
-rw-r--r--tests/rect.lua4
-rw-r--r--tests/text.lua2
-rw-r--r--tests/text_change.lua2
-rw-r--r--tests/textblock_auto_align.lua2
-rw-r--r--tests/textblock_basic.lua2
-rw-r--r--tests/textblock_intl.lua2
-rw-r--r--ui.lua2
-rw-r--r--util.lua20
18 files changed, 38 insertions, 22 deletions
diff --git a/tests/image_blend_many_smooth_same_scaled.lua b/tests/image_blend_many_smooth_same_scaled.lua
index 7b2ba07..c82e7d7 100644
--- a/tests/image_blend_many_smooth_same_scaled.lua
+++ b/tests/image_blend_many_smooth_same_scaled.lua
@@ -3,7 +3,7 @@ local ffi_new = ffi.new
3local util = require("util") 3local util = require("util")
4local levas = util.get_lib("evas") 4local levas = util.get_lib("evas")
5 5
6local sin, cos = math.sin, math.cos 6local sin, cos = util.sin, util.cos
7 7
8return function(ui, variant) 8return function(ui, variant)
9 return "blend.png", "Image Blend Many Smooth Down Scaled", 10.000, 9 return "blend.png", "Image Blend Many Smooth Down Scaled", 10.000,
diff --git a/tests/image_blend_occlude.lua b/tests/image_blend_occlude.lua
index 7c12293..8268634 100644
--- a/tests/image_blend_occlude.lua
+++ b/tests/image_blend_occlude.lua
@@ -17,7 +17,7 @@ local variants = {
17 "Image Blend Occlude 3 Very Many" 17 "Image Blend Occlude 3 Very Many"
18} 18}
19 19
20local sin, cos = math.sin, math.cos 20local sin, cos = util.sin, util.cos
21local rsh = bit.rshift 21local rsh = bit.rshift
22local band = bit.band 22local band = bit.band
23 23
diff --git a/tests/image_blend_scaled.lua b/tests/image_blend_scaled.lua
index a86b74c..52b3b6f 100644
--- a/tests/image_blend_scaled.lua
+++ b/tests/image_blend_scaled.lua
@@ -17,7 +17,7 @@ local variants = {
17 "Image Blend Border Recolor" 17 "Image Blend Border Recolor"
18} 18}
19 19
20local sin, cos = math.sin, math.cos 20local sin, cos = util.sin, util.cos
21 21
22local images = { 22local images = {
23 "logo.png", "image.png", "logo.png", "image.png", "logo.png", "image.png", 23 "logo.png", "image.png", "logo.png", "image.png", "logo.png", "image.png",
diff --git a/tests/image_blend_unscaled.lua b/tests/image_blend_unscaled.lua
index 1cec9e9..22fce6b 100644
--- a/tests/image_blend_unscaled.lua
+++ b/tests/image_blend_unscaled.lua
@@ -14,7 +14,7 @@ local variants = {
14 "Image Blend Solid Fade Power 2 Unscaled" 14 "Image Blend Solid Fade Power 2 Unscaled"
15} 15}
16 16
17local sin, cos = math.sin, math.cos 17local sin, cos = util.sin, util.cos
18 18
19local lsh = bit.lshift 19local lsh = bit.lshift
20 20
diff --git a/tests/image_map_rotate.lua b/tests/image_map_rotate.lua
index 2ba771f..7046ccb 100644
--- a/tests/image_map_rotate.lua
+++ b/tests/image_map_rotate.lua
@@ -17,7 +17,7 @@ local variants = {
17 "Image Map Color Alpha Nearest Solid Rotate" 17 "Image Map Color Alpha Nearest Solid Rotate"
18} 18}
19 19
20local sin, cos = math.sin, math.cos 20local sin, cos = util.sin, util.cos
21 21
22local images = { 22local images = {
23 "logo.png", "image.png", "logo.png", "image.png", "logo.png", "image.png", 23 "logo.png", "image.png", "logo.png", "image.png", "logo.png", "image.png",
diff --git a/tests/line_blend.lua b/tests/line_blend.lua
index 63662bd..aec086b 100644
--- a/tests/line_blend.lua
+++ b/tests/line_blend.lua
@@ -3,10 +3,10 @@ local ffi_new = ffi.new
3local util = require("util") 3local util = require("util")
4local levas = util.get_lib("evas") 4local levas = util.get_lib("evas")
5 5
6local sin, cos = math.sin, math.cos 6local sin, cos = util.sin, util.cos
7local sqrt, atan = math.sqrt, math.atan 7local sqrt, atan = util.sqrt, util.atan
8local band = bit.band 8local band = bit.band
9local floor = math.floor 9local floor = util.floor
10 10
11local PI = 3.141592654 11local PI = 3.141592654
12 12
diff --git a/tests/poly_blend.lua b/tests/poly_blend.lua
index bf41faa..e9905c5 100644
--- a/tests/poly_blend.lua
+++ b/tests/poly_blend.lua
@@ -3,7 +3,7 @@ local ffi_new = ffi.new
3local util = require("util") 3local util = require("util")
4local levas = util.get_lib("evas") 4local levas = util.get_lib("evas")
5 5
6local sin, cos = math.sin, math.cos 6local sin, cos = util.sin, util.cos
7 7
8local cases = { 8local cases = {
9 function(o, x, y) -- triangle 9 function(o, x, y) -- triangle
diff --git a/tests/proxy_image.lua b/tests/proxy_image.lua
index 556e941..289096b 100644
--- a/tests/proxy_image.lua
+++ b/tests/proxy_image.lua
@@ -2,7 +2,7 @@ local ffi = require("ffi")
2local util = require("util") 2local util = require("util")
3local levas = util.get_lib("evas") 3local levas = util.get_lib("evas")
4 4
5local sin, cos = math.sin, math.cos 5local sin, cos = util.sin, util.cos
6 6
7return function(ui) 7return function(ui)
8 return "blend.png", "Image Blend Unscaled Proxy", 1.000, function() 8 return "blend.png", "Image Blend Unscaled Proxy", 1.000, function()
diff --git a/tests/proxy_text_fixed.lua b/tests/proxy_text_fixed.lua
index 742c264..08e9d51 100644
--- a/tests/proxy_text_fixed.lua
+++ b/tests/proxy_text_fixed.lua
@@ -3,7 +3,7 @@ local ffi_new = ffi.new
3local util = require("util") 3local util = require("util")
4local levas = util.get_lib("evas") 4local levas = util.get_lib("evas")
5 5
6local sin, cos = math.sin, math.cos 6local sin, cos = util.sin, util.cos
7 7
8return function(ui) 8return function(ui)
9 return "text.png", "Proxy Text Fixed", 10.000, function() 9 return "text.png", "Proxy Text Fixed", 10.000, function()
diff --git a/tests/proxy_text_random.lua b/tests/proxy_text_random.lua
index 83507e4..a85625b 100644
--- a/tests/proxy_text_random.lua
+++ b/tests/proxy_text_random.lua
@@ -3,7 +3,7 @@ local ffi_new = ffi.new
3local util = require("util") 3local util = require("util")
4local levas = util.get_lib("evas") 4local levas = util.get_lib("evas")
5 5
6local sin, cos = math.sin, math.cos 6local sin, cos = util.sin, util.cos
7 7
8local strs = { 8local strs = {
9 "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I", "Am", 9 "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I", "Am",
diff --git a/tests/rect.lua b/tests/rect.lua
index 0a4cdd4..8747400 100644
--- a/tests/rect.lua
+++ b/tests/rect.lua
@@ -3,9 +3,9 @@ local ffi_cast = ffi.cast
3local util = require("util") 3local util = require("util")
4local levas = util.get_lib("evas") 4local levas = util.get_lib("evas")
5 5
6local sin, cos = math.sin, math.cos 6local sin, cos = util.sin, util.cos
7local lsh = bit.lshift 7local lsh = bit.lshift
8local floor = math.floor 8local floor = util.floor
9 9
10local names = { 10local names = {
11 "Rect Blend", "Rect Blend Power 2", "Rect Solid", "Rect Blend Few", 11 "Rect Blend", "Rect Blend Power 2", "Rect Solid", "Rect Blend Few",
diff --git a/tests/text.lua b/tests/text.lua
index fc84c20..a0a3545 100644
--- a/tests/text.lua
+++ b/tests/text.lua
@@ -13,7 +13,7 @@ local strs = {
13 "Family", "Lair", "Monkeys", "Magazine" 13 "Family", "Lair", "Monkeys", "Magazine"
14} 14}
15 15
16local sin, cos = math.sin, math.cos 16local sin, cos = util.sin, util.cos
17 17
18local weights = { 18local weights = {
19 10.4611, 19 10.4611,
diff --git a/tests/text_change.lua b/tests/text_change.lua
index 2b20611..94c2850 100644
--- a/tests/text_change.lua
+++ b/tests/text_change.lua
@@ -9,7 +9,7 @@ local strs = {
9 "Family", "Lair", "Monkeys", "Magazine" 9 "Family", "Lair", "Monkeys", "Magazine"
10} 10}
11 11
12local sin, cos = math.sin, math.cos 12local sin, cos = util.sin, util.cos
13 13
14return function(ui) 14return function(ui)
15 return "text.png", "Text Change", 18.6459, function() 15 return "text.png", "Text Change", 18.6459, function()
diff --git a/tests/textblock_auto_align.lua b/tests/textblock_auto_align.lua
index eebb509..ca6138c 100644
--- a/tests/textblock_auto_align.lua
+++ b/tests/textblock_auto_align.lua
@@ -3,7 +3,7 @@ local ffi_new = ffi.new
3local util = require("util") 3local util = require("util")
4local levas = util.get_lib("evas") 4local levas = util.get_lib("evas")
5 5
6local sin, abs = math.sin, math.abs 6local sin, abs = util.sin, util.abs
7 7
8return function(ui, variant) 8return function(ui, variant)
9 return "text.png", "Textblock auto align", 11.5449, function() 9 return "text.png", "Textblock auto align", 11.5449, function()
diff --git a/tests/textblock_basic.lua b/tests/textblock_basic.lua
index 14bc23b..bc7131d 100644
--- a/tests/textblock_basic.lua
+++ b/tests/textblock_basic.lua
@@ -2,7 +2,7 @@ local ffi = require("ffi")
2local util = require("util") 2local util = require("util")
3local levas = util.get_lib("evas") 3local levas = util.get_lib("evas")
4 4
5local sin, cos = math.sin, math.cos 5local sin, cos = util.sin, util.cos
6 6
7return function(ui, variant) 7return function(ui, variant)
8 return "text.png", "Textblock Basic", 37.4608, function() 8 return "text.png", "Textblock Basic", 37.4608, function()
diff --git a/tests/textblock_intl.lua b/tests/textblock_intl.lua
index 00facf3..1f08683 100644
--- a/tests/textblock_intl.lua
+++ b/tests/textblock_intl.lua
@@ -3,7 +3,7 @@ local ffi_new = ffi.new
3local util = require("util") 3local util = require("util")
4local levas = util.get_lib("evas") 4local levas = util.get_lib("evas")
5 5
6local sin, cos = math.sin, math.cos 6local sin, cos = util.sin, util.cos
7 7
8return function(ui, variant) 8return function(ui, variant)
9 return "text.png", "Textblock Intl", 32.4417, function() 9 return "text.png", "Textblock Intl", 32.4417, function()
diff --git a/ui.lua b/ui.lua
index 54bc603..7313bc9 100644
--- a/ui.lua
+++ b/ui.lua
@@ -46,7 +46,7 @@ local levas = util.get_lib("evas")
46local ffi_new = ffi.new 46local ffi_new = ffi.new
47local ffi_cast = ffi.cast 47local ffi_cast = ffi.cast
48local ffi_str = ffi.string 48local ffi_str = ffi.string
49local sin, cos = math.sin, math.cos 49local sin, cos = util.sin, util.cos
50 50
51local evas 51local evas
52 52
diff --git a/util.lua b/util.lua
index 4160e0f..ad6edfb 100644
--- a/util.lua
+++ b/util.lua
@@ -1125,11 +1125,11 @@ Where ENGINE can be one of:
1125]]) 1125]])
1126 1126
1127 for i = 1, #engines do 1127 for i = 1, #engines do
1128 M.write_err(" ", engines[i][1]) 1128 M.write_err(" " .. engines[i][1])
1129 end 1129 end
1130 M.write_err("\nWhere PROFILE can be one of:\n") 1130 M.write_err("\nWhere PROFILE can be one of:\n")
1131 for i = 1, #resolutions do 1131 for i = 1, #resolutions do
1132 M.write_err(" ", resolutions[i][1]) 1132 M.write_err(" " .. resolutions[i][1])
1133 end 1133 end
1134 M.write_err("\n") 1134 M.write_err("\n")
1135 M.exit(-1) 1135 M.exit(-1)
@@ -1295,4 +1295,20 @@ M.del_objs = function(...)
1295 end 1295 end
1296end 1296end
1297 1297
1298ffi.cdef [[
1299 double sin(double x);
1300 double cos(double x);
1301 double abs(double x);
1302 double atan(double x);
1303 double sqrt(double x);
1304 double floor(double x);
1305]]
1306
1307M.sin = C.sin
1308M.cos = C.cos
1309M.abs = C.abs
1310M.atan = C.atan
1311M.sqrt = C.sqrt
1312M.floor = C.floor
1313
1298return M \ No newline at end of file 1314return M \ No newline at end of file