aboutsummaryrefslogtreecommitdiffstats
path: root/Lua/src/lua/ULuaUtils.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-23 14:08:58 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-23 14:08:58 +0000
commit1bcf5d3ab366002e8000656b566340c3efd756af (patch)
tree8ed312dd7c2c5860f723825aa7283474d456a481 /Lua/src/lua/ULuaUtils.pas
parentc32c264f7ed302d40a84aa56028256b583c678b2 (diff)
downloadusdx-1bcf5d3ab366002e8000656b566340c3efd756af.tar.gz
usdx-1bcf5d3ab366002e8000656b566340c3efd756af.tar.xz
usdx-1bcf5d3ab366002e8000656b566340c3efd756af.zip
new ULuaUtils procedure: lua_PushBinInt
new functions in ScreenSing lua module ScreenSing.GetSettings ScreenSing.SetSettings 3 new settings in UScreenSing that needs to be implemented LyrcsVisible, NotesVisible and PlayerEnabled git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1769 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Lua/src/lua/ULuaUtils.pas')
-rw-r--r--Lua/src/lua/ULuaUtils.pas31
1 files changed, 31 insertions, 0 deletions
diff --git a/Lua/src/lua/ULuaUtils.pas b/Lua/src/lua/ULuaUtils.pas
index de3bd15f..4ac1d80a 100644
--- a/Lua/src/lua/ULuaUtils.pas
+++ b/Lua/src/lua/ULuaUtils.pas
@@ -42,6 +42,13 @@ uses ULua, ULuaCore;
does not pop anything }
function Lua_ToBinInt(L: PLua_State; idx: Integer): Integer;
+{ converts an integer with the value:
+ 0b11001
+ to a lua table with a structure like:
+ * = 1 , * = 4 , * = 5
+ and pushed the table onto the stack }
+procedure Lua_PushBinInt(L: PLua_State; BinInt: Integer);
+
{ returns plugin that is the owner of the given state
may raise a lua error if the parent id is not found
in states registry, if state owner does not exists
@@ -88,6 +95,30 @@ begin
end;
end;
+{ converts an integer with the value:
+ 0b11001
+ to a lua table with a structure like:
+ * = 1 , * = 4 , * = 5
+ and pushed the table onto the stack }
+procedure Lua_PushBinInt(L: PLua_State; BinInt: Integer);
+var
+ I, Index: Integer;
+begin
+ lua_newTable(L);
+
+
+ Index := 1; //< lua starts w/ index 1
+ for I := 0 to 31 do
+ if (BinInt and (1 shl I) <> 0) then
+ begin
+ lua_pushInteger(L, Index);
+ lua_pushInteger(L, I);
+ lua_settable(L, -3);
+
+ Inc(Index);
+ end;
+end;
+
{ returns plugin that is the owner of the given state
may raise a lua error if the parent id is not found
in states registry, if state owner does not exists