Skip to content

Commit

Permalink
Tokens and characters optimizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRoboZ committed Mar 7, 2022
1 parent c58b228 commit 904cbfa
Show file tree
Hide file tree
Showing 10 changed files with 1,261 additions and 1,309 deletions.
46 changes: 24 additions & 22 deletions debug.lua
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
-- Debug.lua ---------------------------------------

--Current stats - Tokens:7957 Chars:49248 Compressed:15305

local DEBUG_PRINT = {}
local DEBUG_PRINT_I = 1

function DebugPrint(n)
DEBUG_PRINT[DEBUG_PRINT_I] = n
DEBUG_PRINT_I += 1
DEBUG_PRINT[DEBUG_PRINT_I] = n
DEBUG_PRINT_I += 1
end

function DebugUpdate()
DEBUG_PRINT_I = 1
for i = 1,#DEBUG_PRINT do
DEBUG_PRINT[i] = "-"
end
DEBUG_PRINT_I = 1
for i = 1,#DEBUG_PRINT do
DEBUG_PRINT[i] = "-"
end
end

function ProfileRender()
if #proftms > 0 then

for i = 1,#proftms do
RenderTextOutlined( tostr(i)..". ".. tostr(proftms[i]),24,2 + (i-1) * 6, 0, 6 )
--print(tostr(i)..". ".. tostr(proftms[i]),24,2 + (i-1) * 6, 0, 6 )
proftms[i]=0
end
if #proftms > 0 then

for i = 1,#proftms do
RenderTextOutlined( tostr(i)..". ".. tostr(proftms[i]),24,2 + (i-1) * 6, 0, 6 )
--print(tostr(i)..". ".. tostr(proftms[i]),24,2 + (i-1) * 6, 0, 6 )
proftms[i]=0
end
end
end

function DebugRender()
fillp(0)
for i = 1,#DEBUG_PRINT do
RenderTextOutlined(tostr(DEBUG_PRINT[i]),2,2 + (i-1) * 6, 0,6)
end
RenderTextOutlined( flr(stat(1)*100).."%", 98,2,0,6 )
--ProfileRender
fillp(0)
for i = 1,#DEBUG_PRINT do
RenderTextOutlined(tostr(DEBUG_PRINT[i]),2,2 + (i-1) * 6, 0,6)
end
RenderTextOutlined( flr(stat(1)*100).."%", 98,2,0,6 )

--ProfileRender

end

proftms={0,0,0,0,0,0,0,0}
profstrt={}

function ProfileStart( id )
profstrt[id]=stat(1)
profstrt[id]=stat(1)
end

function ProfileEnd( id )
proftms[id]=proftms[id]+(stat(1)-profstrt[id])
proftms[id]=proftms[id]+(stat(1)-profstrt[id])
end
Loading

0 comments on commit 904cbfa

Please sign in to comment.