updated readme and fixed folder selection
This commit is contained in:
parent
94f674e9e3
commit
4af9000c40
@ -15,6 +15,9 @@ Discord - https://discord.gg/KMDeFebk
|
||||
The repo is based entirely on the brilliant framework here:
|
||||
https://github.com/floooh/sokol
|
||||
|
||||
The sokol api has been built into dll's (this may change in the future) and it is executed in the best (imho) runtime system there is using its amazing ffi module:
|
||||
https://luajit.org/
|
||||
|
||||
sdf exmample
|
||||

|
||||
|
||||
|
||||
BIN
bin/linux/libluajit.so
Normal file
BIN
bin/linux/libluajit.so
Normal file
Binary file not shown.
BIN
bin/linux/luajit
BIN
bin/linux/luajit
Binary file not shown.
BIN
bin/macos/libluajit.so
Normal file
BIN
bin/macos/libluajit.so
Normal file
Binary file not shown.
BIN
bin/macos/luajit
Normal file
BIN
bin/macos/luajit
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/win64/luajit.lib
Normal file
BIN
bin/win64/luajit.lib
Normal file
Binary file not shown.
@ -95,8 +95,7 @@ local folder_select = {
|
||||
if(bhit) then
|
||||
udata.hit = bhit
|
||||
if(bhit[2] == "..") then
|
||||
udata.folder_path = udata.folder_path:match("(.-)[^\\]-$")
|
||||
print(udata.folder_path)
|
||||
udata.folder_path = dirtools.get_folder(udata.folder_path)
|
||||
if(udata.folder_path == nil or udata.folder_path == "") then udata.folder_path = "." end
|
||||
else
|
||||
udata.folder_path = udata.folder_path.."\\"..udata.hit[2]
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
local ffi = require("ffi")
|
||||
local ffi = require("ffi")
|
||||
|
||||
local dirtools = {}
|
||||
local dirtools = {}
|
||||
|
||||
local tinsert = table.insert
|
||||
local tconcat = table.concat
|
||||
|
||||
---------------------------------------------------------------------------------------
|
||||
|
||||
@ -22,6 +25,19 @@ dirtools.add_default_paths = function(path)
|
||||
package.path = package.path..";"..path.."/?.lua"
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------------------------
|
||||
-- Much safer way to build folder than pattern match (very unstable)
|
||||
dirtools.get_folder = function(path)
|
||||
local parts = {}
|
||||
local sep = "\\"
|
||||
local patt = "(.-)[\\]"
|
||||
if(ffi.os ~= "Windows") then patt = "(.-)[/]"; sep = "/" end
|
||||
for pseg in string.gmatch(path, patt) do
|
||||
tinsert(parts, pseg)
|
||||
end
|
||||
return tconcat(parts, sep)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------------------------
|
||||
|
||||
dirtools.get_app_path = function( expected_root_folder )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user