- Opció per a recarregar textures 'en calent' des de l'editor

This commit is contained in:
2023-02-03 16:09:59 +01:00
parent 316fbfe33e
commit bfe85d7eb3

View File

@@ -17,10 +17,24 @@ editor={
{"SAVE MAP", function() if mapa.name~=nil then editor.save(mapa.name) else textbox.show("FILENAME TO SAVE:",editor.save, mapa.name) end end}, {"SAVE MAP", function() if mapa.name~=nil then editor.save(mapa.name) else textbox.show("FILENAME TO SAVE:",editor.save, mapa.name) end end},
{mapa.front_layer and "DISABLE FRONT LAYER" or "ENABLE FRONT LAYER", editor.toggle_front_layer}, {mapa.front_layer and "DISABLE FRONT LAYER" or "ENABLE FRONT LAYER", editor.toggle_front_layer},
{"RESIZE MAP", editor.resize}, {"RESIZE MAP", editor.resize},
{"RELOAD TEXTURES", editor.reload_textures},
{"EXIT", main_init}, {"EXIT", main_init},
}, function()editor.paused=false end) }, function()editor.paused=false end)
end, end,
reload_textures=function()
freesurf(sprites)
freesurf(objectes)
freesurf(tiles)
sprites=loadsurf("sprites.gif")
objectes=loadsurf("objects.gif")
tiles=loadsurf("tiles.gif")
setsource(tiles)
local pal=loadpal("tiles.gif")
setpal(pal)
editor.paused=false
end,
toggle_front_layer=function() toggle_front_layer=function()
if not mapa.front_layer then if not mapa.front_layer then
mapa.front_layer=newsurf(mapa.w,mapa.h) mapa.front_layer=newsurf(mapa.w,mapa.h)