rename to only use js instead of jso

This commit is contained in:
John Alanbrook 2024-09-25 20:51:20 -05:00
parent 1e4a142030
commit f95249f147
7 changed files with 41 additions and 42 deletions

View file

@ -294,3 +294,7 @@ TAGINC != find . -name "*.[chj]"
tags: $(TAGINC) tags: $(TAGINC)
@echo Making tags. @echo Making tags.
@etags $(TAGINC) @etags $(TAGINC)
MYFILES != (ls scripts/*.js* source/engine/*.[ch] source/engine/sound/*.[ch])
pretty:
clang-format -i $(MYFILES)

View file

@ -232,7 +232,7 @@ var editor = {
Object.dainty_assign(this.desktop, this.stash); Object.dainty_assign(this.desktop, this.stash);
} }
this.selectlist = []; this.selectlist = [];
editor.camera = world.spawn("scripts/camera2d.jso"); editor.camera = world.spawn("scripts/camera2d");
editor.camera._ed.selectable = false; editor.camera._ed.selectable = false;
game.camera = editor.camera; game.camera = editor.camera;
}, },

View file

@ -728,6 +728,7 @@ var ur_from_file = function(file) {
} }
game.loadurs = function() { game.loadurs = function() {
return;
ur = {}; ur = {};
ur._list = []; ur._list = [];
/* FIND ALL URS IN A PROJECT */ /* FIND ALL URS IN A PROJECT */

View file

@ -12,8 +12,7 @@
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) {
{
var series = []; var series = [];
for (var i = 0; i < times; i++) { for (var i = 0; i < times; i++) {
@ -169,10 +168,7 @@ function get_line(file, line) {
return text.trim(); return text.trim();
} }
profile.stop_cpu_instr = function() profile.stop_cpu_instr = function () { return; }
{
return;
}
profile.best_t = function (t) { profile.best_t = function (t) {
var qq = 0; var qq = 0;
@ -185,11 +181,13 @@ profile.best_t = function (t) {
return `${t.toPrecision(4)} ${t_units[qq]}`; return `${t.toPrecision(4)} ${t_units[qq]}`;
}; };
profile.report = function (start, msg = "[undefined report]") { console.info(`${msg} in ${profile.best_t(profile.now() - start)}`); }; profile.report = function (start, msg = "[undefined report]") {
console.info(`${msg} in ${profile.best_t(profile.now() - start)}`);
};
/* /*
Frame averages are an instrumented profiling technique. Place frame() calls in your code to get a call graph for things you are interested in. Frame averages are an instrumented profiling technique. Place frame() calls
in your code to get a call graph for things you are interested in.
*/ */
var frame_avg = false; var frame_avg = false;
@ -315,7 +313,8 @@ function addreport(group, line, start) {
}; };
function printreport (cache, name) { function printreport (cache, name) {
var report = `==${name}==` + "\n"; var report = `==${name}==` +
"\n";
var reports = []; var reports = [];
for (var i in cache) { for (var i in cache) {
@ -333,7 +332,8 @@ function printreport(cache, name) {
}); });
for (var rep of reports) for (var rep of reports)
report += `${rep.name} ${profile.best_t(rep.avg)} (${rep.hits} hits) (total ${profile.best_t(rep.time)})\n`; report += `${rep.name} ${profile.best_t(rep.avg)} (${
rep.hits} hits) (total ${profile.best_t(rep.time)})\n`;
return report; return report;
}; };
@ -341,12 +341,10 @@ function printreport(cache, name) {
profile.data = {}; profile.data = {};
profile.curframe = 0; profile.curframe = 0;
function prof_add_stats(obj, stat) function prof_add_stats (obj, stat) {
{
for (var i in stat) { for (var i in stat) {
obj[i] ??= []; obj[i] ??= [];
if (obj[i].last() !== stat[i]) if (obj[i].last() !== stat[i]) obj[i][profile.curframe] = stat[i];
obj[i][profile.curframe] = stat[i];
} }
} }

View file

@ -401,9 +401,7 @@ var Event = {
global.mixin("scripts/spline"); global.mixin("scripts/spline");
global.mixin("scripts/components"); global.mixin("scripts/components");
global.mixin("scripts/actor"); global.mixin("scripts/actor");
global.mixin("scripts/entity"); global.mixin("scripts/entity");
function world_start() { function world_start() {

View file

@ -1,2 +0,0 @@
this.phys = physics.static;
this.add_component(component.sprite);