Matrix lib clone fix.
This commit is contained in:
2
API.md
2
API.md
@@ -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
|
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
|
## 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.
|
Included submodules.
|
||||||
|
|
||||||
|
|||||||
@@ -3919,7 +3919,7 @@ function RL.LoadFont( fileName ) end
|
|||||||
---- Success return Font
|
---- Success return Font
|
||||||
---@param fileName string
|
---@param fileName string
|
||||||
---@param fontSize integer
|
---@param fontSize integer
|
||||||
---@param codepoints table
|
---@param codepoints table|nil
|
||||||
---@return any font
|
---@return any font
|
||||||
function RL.LoadFontEx( fileName, fontSize, codepoints ) end
|
function RL.LoadFontEx( fileName, fontSize, codepoints ) end
|
||||||
|
|
||||||
|
|||||||
@@ -3,20 +3,17 @@ if table.unpack == nil then
|
|||||||
table.unpack = unpack
|
table.unpack = unpack
|
||||||
end
|
end
|
||||||
|
|
||||||
local function deepCopy( orig )
|
local function copyMatrix( orig )
|
||||||
local copy
|
local copy = RL.MatrixIdentity()
|
||||||
|
|
||||||
if type( orig ) == "table" then
|
if orig ~= nil then
|
||||||
copy = {}
|
for y = 1, 4 do
|
||||||
|
for x = 1, 4 do
|
||||||
for origKey, origValue in next, orig, nil do
|
if orig[x][y] ~= nil then
|
||||||
-- If object has clone method, use that.
|
copy[x][y] = orig[x][y]
|
||||||
copy[ deepCopy( origKey ) ] = deepCopy( origValue )
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- setmetatable( copy, utillib.deepCopy( getmetatable( orig ) ) )
|
|
||||||
else -- number, string, boolean, etc.
|
|
||||||
copy = orig
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return copy
|
return copy
|
||||||
@@ -50,17 +47,17 @@ Matrix.meta = {
|
|||||||
function Matrix:new( m )
|
function Matrix:new( m )
|
||||||
local object = setmetatable( {}, Matrix.meta )
|
local object = setmetatable( {}, Matrix.meta )
|
||||||
|
|
||||||
object.m = deepCopy( m )
|
object.m = copyMatrix( m )
|
||||||
|
|
||||||
return object
|
return object
|
||||||
end
|
end
|
||||||
|
|
||||||
function Matrix:set( m )
|
function Matrix:set( m )
|
||||||
self.m = deepCopy( m )
|
self.m = copyMatrix( m )
|
||||||
end
|
end
|
||||||
|
|
||||||
function Matrix:clone()
|
function Matrix:clone()
|
||||||
return Matrix:new( self )
|
return Matrix:new( self.m )
|
||||||
end
|
end
|
||||||
|
|
||||||
function Matrix:determinant()
|
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
|
Load font from file with extended parameters, use NULL for codepoints to load the default character set
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user