Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
New version that auto compiles for speed improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
robthomson committed Jul 18, 2024
1 parent bcc55c3 commit 7d92f0e
Show file tree
Hide file tree
Showing 7 changed files with 1,335 additions and 1,254 deletions.
35 changes: 35 additions & 0 deletions scripts/rf2ethos/compile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
compile = {}


local arg={...}
local config = arg[1]
local toolDir = config.toolDir

function compile.file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end

function compile.loadScript(script)


if config.useCompiler == true then
local cachefile
cachefile = toolDir .. "compiled/" .. script:gsub( "/", "_") .. "c"
if compile.file_exists(cachefile) ~= true then
system.compile(script)
os.rename(script .. 'c', cachefile)
end
print(cachefile)
return loadfile(cachefile)
else
print(script)
return loadfile(script)
end


end



return compile
7 changes: 7 additions & 0 deletions scripts/rf2ethos/compiled/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This folder stores compiled cache files.

Please do not delete it.

--

To force a recompile of the app; simply delete all the files ending in .luac
267 changes: 0 additions & 267 deletions scripts/rf2ethos/lib/rf2ethos.lua

This file was deleted.

Loading

0 comments on commit 7d92f0e

Please sign in to comment.