[tekui-devel] tekui: Improved and faster plasma demo; reverted vgroup demo to ...

hg-notify at neoscientists.org hg-notify at neoscientists.org
Tue Feb 5 02:46:02 CET 2008


details:   http://hg.teklib.org/tekui/rev/1557f491f8f7
changeset: 352:1557f491f8f7
user:      Timm S. Mueller <tmueller at neoscientists.org>
date:      Sun Feb 03 20:52:06 2008 +0100
description:
Improved and faster plasma demo; reverted vgroup demo to previous version;
improved Area:rethinkLayout() now recalculates offsets, therefore removed
Frame:rethinkLayout(); added relayout(); Area:layout() no longer causes
copy-refreshes in Canvases; using more robust font defaults in Theme class

diffs (truncated from 330 to 100 lines):

diff -r 177b5ac4a826 -r 1557f491f8f7 tek/app/plasma.lua
--- a/tek/app/plasma.lua	Sat Feb 02 22:53:03 2008 +0100
+++ b/tek/app/plasma.lua	Sun Feb 03 20:52:06 2008 +0100
@@ -9,10 +9,10 @@ local MAX = math.max
 local MAX = math.max
 local FLOOR = math.floor
 
-local WIDTH = 160
-local HEIGHT = 120
-local PIXWIDTH = 4
-local PIXHEIGHT = 4
+local WIDTH = 80
+local HEIGHT = 60
+local PIXWIDTH = 6
+local PIXHEIGHT = 6
 
 local WW = WIDTH * PIXWIDTH
 local WH = HEIGHT * PIXHEIGHT
@@ -53,35 +53,31 @@ for i = 0, 1023 do
 	sintab[i] = SIN(i / 1024 * PI * 2)
 end
 
-
 --
 --	effect
 --
 
-local xp1, xp2, xp3 = 0, 0, 0
+local xp1, xp2 = 0, 0
 local yp1, yp2, yp3 = 0, 0, 0
 
 function effect()
 
-	local palettescale = #palette / 12
+	local palettescale = #palette / 10
 	local yc1, yc2, yc3 = yp1, yp2, yp3
 	local i = 0
 
 	for y = 0, HEIGHT - 1 do
 
-		local xc1, xc2, xc3 = xp1, xp2, xp3
-		local ysin = sintab[yc1] + sintab[yc2] + sintab[yc3]
+		local xc1, xc2 = xp1, xp2
+		local ysin = sintab[yc1] + sintab[yc2] + sintab[yc3] + 5
 
 		for x = 0, WIDTH - 1 do
 
-			local cv = sintab[xc1] + sintab[xc2] + sintab[xc3] + ysin
-			cv = FLOOR((cv + 6) * palettescale)
-			screen[i] = palette[cv]
+			local c = sintab[xc1] + sintab[xc2] + ysin
+			screen[i] = palette[FLOOR(c * palettescale)]
 			i = i + 1
-
-			xc1 = (xc1 - 6) % 1024
-			xc2 = (xc2 - 9) % 1024
-			xc3 = (xc3 + 14) % 1024
+			xc1 = (xc1 - 12) % 1024
+			xc2 = (xc2 + 13) % 1024
 
 		end
 
@@ -97,10 +93,8 @@ function effect()
 
 	xp1 = (xp1 + 7) % 1024
 	xp2 = (xp2 - 2) % 1024
-	xp3 = (xp3 - 5) % 1024
 
 end
-
 
 --
 --	main loop
diff -r 177b5ac4a826 -r 1557f491f8f7 tek/app/ui/vgroup.lua
--- a/tek/app/ui/vgroup.lua	Sat Feb 02 22:53:03 2008 +0100
+++ b/tek/app/ui/vgroup.lua	Sun Feb 03 20:52:06 2008 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/env lua
 
-require "tek.lib.debug".level = 3
+require "tek.lib.debug".level = 5
 local ui = require "tek.lib.ui"
 -- ui.DEBUG = true
 
@@ -17,16 +17,20 @@ ui.application:new
 					Legend = "Virtual Group",
 					Width = 500,
 					Height = 500,
+					GridW = 2,
 					Children = {
 						ui.Button:new { HMax = true, VMax = true, Label = "foo" },
-						ui.Handle:new { },
+						ui.Button:new { HMax = true, VMax = true, Label = "foo" },
+						ui.Button:new { HMax = true, VMax = true, Label = "foo" },
 						ui.ScrollGroup:new {
 							Legend = "Virtual Group",
 							Width = 500,
 							Height = 500,
+							GridW = 2,
 							Children = {


More information about the tekui-devel mailing list