(level.lua) Smaller output

master
KikooDX 3 years ago
parent 5a4870e333
commit f5596360de
  1. 15
      levels.lua

@ -1,9 +1,8 @@
io.write([[#include "levels.h"
#include <gint/std/string.h>
void set_level(int level_id, char level[], unsigned int *coin_id) {
switch (level_id)
{
]])
io.write("void set_level(int level_id, char level[], unsigned int *coin_id){")
io.write("switch (level_id){")
current = 0
for i = 0, 9999, 1 do
file = io.open("../up-editor/screens/"..i..".scr")
@ -22,13 +21,13 @@ for i = 0, 9999, 1 do
end
end
file:close()
io.write(" case "..i..":\n memcpy(level, \""..
formated_file.."\", "..#formated_file..");\n")
io.write("case "..i..":memcpy(level,\""..
formated_file.."\","..#formated_file..");")
if file_content and string.find(file_content, 'c') then
io.write(" *coin_id = "..current..";\n")
io.write("*coin_id = "..current..";")
current = current + 1
end
io.write(" break;\n")
io.write("break;")
end
end
io.write(" }\n}\n")
io.write("}}")

Loading…
Cancel
Save