Embed Switch game assets in RomFS
This commit is contained in:
@@ -35,7 +35,6 @@ if is_plat("windows") then
|
||||
target("Frostbite2DGame")
|
||||
set_kind("binary")
|
||||
add_files("game/src/**.cpp")
|
||||
remove_files("game/src/switch_game_main.cpp")
|
||||
add_deps("Frostbite2D")
|
||||
add_packages("libsdl2")
|
||||
add_packages("libsdl2_image")
|
||||
@@ -56,7 +55,6 @@ if is_plat("switch") then
|
||||
set_kind("binary")
|
||||
set_filename("Frostbite2DGame.elf")
|
||||
add_files("game/src/**.cpp")
|
||||
remove_files("game/src/main.cpp")
|
||||
add_deps("Frostbite2D")
|
||||
add_cxflags("-D__SWITCH__", "-fPIE", {public = true})
|
||||
add_ldflags("-specs=" .. path.join(os.getenv("DEVKITPRO") or "C:/devkitPro", "libnx/switch.specs"), "-fPIE", {force = true})
|
||||
@@ -71,13 +69,19 @@ if is_plat("switch") then
|
||||
local libnx = path.join(devkitpro, "libnx")
|
||||
local nacp = path.join(outdir, "control.nacp")
|
||||
local nro = path.join(outdir, "NSUnknownGame.nro")
|
||||
local romfsdir = path.join(outdir, "romfs")
|
||||
os.rm(romfsdir)
|
||||
os.mkdir(romfsdir)
|
||||
os.cp(path.join(os.projectdir(), "game/assets"),
|
||||
path.join(romfsdir, "assets"))
|
||||
os.execv(path.join(tools, "nacptool.exe"), {
|
||||
"--create", "NS Unknown Game", "Frostbite2D", "1.0.0", nacp
|
||||
})
|
||||
os.execv(path.join(tools, "elf2nro.exe"), {
|
||||
target:targetfile(), nro,
|
||||
"--nacp=" .. nacp,
|
||||
"--icon=" .. path.join(libnx, "default_icon.jpg")
|
||||
"--icon=" .. path.join(libnx, "default_icon.jpg"),
|
||||
"--romfsdir=" .. romfsdir
|
||||
})
|
||||
end)
|
||||
target_end()
|
||||
|
||||
Reference in New Issue
Block a user