add render
This commit is contained in:
parent
f82c54d3b2
commit
af6824e6db
|
@ -349,3 +349,14 @@ if (!profile.enabled)
|
||||||
use = stripped_use;
|
use = stripped_use;
|
||||||
|
|
||||||
Object.assign(globalThis, use("scripts/prosperon.js"));
|
Object.assign(globalThis, use("scripts/prosperon.js"));
|
||||||
|
|
||||||
|
|
||||||
|
app.interval(_ => {
|
||||||
|
profile.frame("hotreload");
|
||||||
|
actor.hotreload();
|
||||||
|
render.hotreload();
|
||||||
|
game.tex_hotreload();
|
||||||
|
repl.hotreload();
|
||||||
|
profile.endframe();
|
||||||
|
}, 1);
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
/*
|
||||||
|
TYPES OF PROFILING
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
var t_units = ["ns", "us", "ms", "s", "ks", "Ms"];
|
var t_units = ["ns", "us", "ms", "s", "ks", "Ms"];
|
||||||
|
|
||||||
function calc_cpu(fn, times, diff=0)
|
function calc_cpu(fn, times, diff=0)
|
||||||
|
@ -37,7 +42,6 @@ profile.ms = function(t) { return profile.secs(t)*1000; }
|
||||||
|
|
||||||
var callgraph = {};
|
var callgraph = {};
|
||||||
profile.cpu_cg = callgraph;
|
profile.cpu_cg = callgraph;
|
||||||
var st = profile.now();
|
|
||||||
|
|
||||||
function add_callgraph(fn, line, time) {
|
function add_callgraph(fn, line, time) {
|
||||||
var cc = callgraph[line];
|
var cc = callgraph[line];
|
||||||
|
@ -63,6 +67,7 @@ profile.start_cpu_gather = function(gathertime = 5) // gather cpu frames for 'ti
|
||||||
{
|
{
|
||||||
if (cpu_start) return;
|
if (cpu_start) return;
|
||||||
cpu_start = profile.now();
|
cpu_start = profile.now();
|
||||||
|
var st = cpu_start;
|
||||||
|
|
||||||
profile.gather(hittar, function() {
|
profile.gather(hittar, function() {
|
||||||
var time = profile.now()-st;
|
var time = profile.now()-st;
|
||||||
|
|
|
@ -183,15 +183,13 @@ game.tex_hotreload = function()
|
||||||
{
|
{
|
||||||
for (var path in game.texture.cache) {
|
for (var path in game.texture.cache) {
|
||||||
if (io.mod(path) > game.texture.time_cache[path]) {
|
if (io.mod(path) > game.texture.time_cache[path]) {
|
||||||
say(`HOT SWAPPING IMAGE ${path}`);
|
|
||||||
var tex = game.texture.cache[path];
|
var tex = game.texture.cache[path];
|
||||||
game.texture.time_cache[path] = io.mod(path);
|
game.texture.time_cache[path] = io.mod(path);
|
||||||
os.texture_swap(path, game.texture.cache[path]);
|
os.texture_swap(path, game.texture.cache[path]);
|
||||||
for (var sprite of Object.values(allsprites)) {
|
for (var sprite of Object.values(allsprites)) {
|
||||||
if (sprite.texture == tex) {
|
if (sprite.texture == tex) {
|
||||||
say('syncing a sprite ...');
|
sprite.tex_sync();
|
||||||
sprite.tex_sync();
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1147,13 +1147,6 @@ prosperon.process = function process() {
|
||||||
var dt = profile.secs(profile.now()) - frame_t;
|
var dt = profile.secs(profile.now()) - frame_t;
|
||||||
frame_t = profile.secs(profile.now());
|
frame_t = profile.secs(profile.now());
|
||||||
|
|
||||||
profile.frame("hotreload");
|
|
||||||
actor.hotreload();
|
|
||||||
render.hotreload();
|
|
||||||
game.tex_hotreload();
|
|
||||||
repl.hotreload();
|
|
||||||
profile.endframe();
|
|
||||||
|
|
||||||
/* debugging: check for gc */
|
/* debugging: check for gc */
|
||||||
profile.print_gc();
|
profile.print_gc();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue