diff options
| -rw-r--r-- | API.md | 2 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | ReiLua_API.lua | 2 | ||||
| -rw-r--r-- | examples/resources/lib/matrix.lua | 33 | ||||
| -rw-r--r-- | src/text.c | 2 |
5 files changed, 19 insertions, 22 deletions
@@ -6739,7 +6739,7 @@ Load font from file into GPU memory (VRAM) --- -> font = RL.LoadFontEx( string fileName, int fontSize, int{} codepoints ) +> font = RL.LoadFontEx( string fileName, int fontSize, int{}|nil codepoints ) Load font from file with extended parameters, use NULL for codepoints to load the default character set @@ -10,7 +10,7 @@ Reilua means fair in finnish. ## Status -ReiLua is WIP and some planned raylib functionality is still missing but it already has over 800 functions and should include all functions to make most 2D and 3D games. Current Raylib version 5.0. +ReiLua is WIP and some planned raylib functionality is still missing but it already has over 900. Current Raylib version 5.0. Included submodules. diff --git a/ReiLua_API.lua b/ReiLua_API.lua index 3c076f3..1ee0846 100644 --- a/ReiLua_API.lua +++ b/ReiLua_API.lua @@ -3919,7 +3919,7 @@ function RL.LoadFont( fileName ) end ---- Success return Font ---@param fileName string ---@param fontSize integer ----@param codepoints table +---@param codepoints table|nil ---@return any font function RL.LoadFontEx( fileName, fontSize, codepoints ) end diff --git a/examples/resources/lib/matrix.lua b/examples/resources/lib/matrix.lua index 28d4305..1dc128f 100644 --- a/examples/resources/lib/matrix.lua +++ b/examples/resources/lib/matrix.lua @@ -3,23 +3,20 @@ if table.unpack == nil then table.unpack = unpack end -local function deepCopy( orig ) - local copy +local function copyMatrix( orig ) + local copy = RL.MatrixIdentity() - if type( orig ) == "table" then - copy = {} + if orig ~= nil then + for y = 1, 4 do + for x = 1, 4 do + if orig[x][y] ~= nil then + copy[x][y] = orig[x][y] + end + end + end + end - for origKey, origValue in next, orig, nil do - -- If object has clone method, use that. - copy[ deepCopy( origKey ) ] = deepCopy( origValue ) - end - - -- setmetatable( copy, utillib.deepCopy( getmetatable( orig ) ) ) - else -- number, string, boolean, etc. - copy = orig - end - - return copy + return copy end local Matrix = {} @@ -50,17 +47,17 @@ Matrix.meta = { function Matrix:new( m ) local object = setmetatable( {}, Matrix.meta ) - object.m = deepCopy( m ) + object.m = copyMatrix( m ) return object end function Matrix:set( m ) - self.m = deepCopy( m ) + self.m = copyMatrix( m ) end function Matrix:clone() - return Matrix:new( self ) + return Matrix:new( self.m ) end function Matrix:determinant() @@ -211,7 +211,7 @@ int ltextLoadFont( lua_State* L ) { } /* -> font = RL.LoadFontEx( string fileName, int fontSize, int{} codepoints ) +> font = RL.LoadFontEx( string fileName, int fontSize, int{}|nil codepoints ) Load font from file with extended parameters, use NULL for codepoints to load the default character set |
