rm push/pop

This commit is contained in:
2026-02-26 08:13:27 -06:00
parent ef7e3e6449
commit ce6b0ddb3a
31 changed files with 251 additions and 255 deletions

View File

@@ -21,8 +21,8 @@ graphics.Image = function(surfaceData) {
img.cpu = surfaceData || null;
img.texture = 0;
img.surface = img.cpu;
img.width = surfaceData?.width || 0;
img.height = surfaceData?.height || 0;
img.width = surfaceData.width || 0;
img.height = surfaceData.height || 0;
img.rect = {x:0, y:0, width:img.width, height:img.height};
img[LOADING] = false;
img[LASTUSE] = time.number();
@@ -157,7 +157,7 @@ function decode_aseprite(decoded) {
function create_image(path){
def bytes = io.slurp(path);
var ext = pop(array(path, '.'))
var ext = array(path, '.')[]
var raw = decode_image(bytes, ext);
var anims = null
var keys = null
@@ -367,7 +367,7 @@ graphics.texture = function texture(path) {
}
graphics.tex_hotreload = function tex_hotreload(file) {
var basename = array(pop(array(file, '/')), '.')[0]
var basename = array(array(file, '/')[], '.')[0]
// Check if this basename exists in our cache
if (!(basename in cache)) return
@@ -479,10 +479,10 @@ graphics.snapshot = function() {
info.frame_count = length(entry.frames)
info.type = 'animation'
}
push(images, info)
images[] = info
})
arrfor(array(fontcache), function(k) {
push(fonts, k)
fonts[] = k
})
return {images: images, fonts: fonts}
}