forked from PAK9/PicoWorldRace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tokens and characters optimizations.
- Loading branch information
Showing
10 changed files
with
1,261 additions
and
1,309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.