From e1a2d941dfa4a8d464d31c56e83b11b1ba662198 Mon Sep 17 00:00:00 2001 From: Jonathan Hoffstadt Date: Tue, 29 Apr 2025 22:34:14 -0500 Subject: [PATCH] chore: update for PL changes --- .gitignore | 2 ++ README.md | 9 ++++----- scripts/gen_build.py | 24 ++++++++---------------- scripts/setup.py | 4 ++-- src/app.c | 3 ++- 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 6426e71..5a7bfe9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ .vs/ .vscode/ .idea/ +out/ +out-temp/ # python scripts/__pycache__/ diff --git a/README.md b/README.md index 7d10718..301a3dc 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,7 @@ binary template will be created. ## Build -As a first step, clone and build **Pilot Light**. Here we are assuming it is adjacent to this repo. If not, pass the -correct relative location to **gen_build.py**. +As a first step, clone and build **Pilot Light**. Here we are assuming it is adjacent to this repo. ### Windows @@ -24,7 +23,7 @@ cd .. git clone https://git.pilotlight.tech/pilotlight/pl-template cd pl-template/scripts python setup.py -python gen_build.py ../../pilotlight +python gen_build.py cd ../src build.bat ``` @@ -44,7 +43,7 @@ cd .. git clone https://git.pilotlight.tech/pilotlight/pl-template cd pl-template/scripts python3 setup.py -python3 gen_build.py ../../pilotlight +python3 gen_build.py cd ../src chmod +x build.sh ./build.sh @@ -65,7 +64,7 @@ cd .. git clone https://git.pilotlight.tech/pilotlight/pl-template cd pl-template/scripts python3 setup.py -python3 gen_build.py ../../pilotlight +python3 gen_build.py cd ../src chmod +x build.sh ./build.sh diff --git a/scripts/gen_build.py b/scripts/gen_build.py index c8d15bf..b0ca50a 100644 --- a/scripts/gen_build.py +++ b/scripts/gen_build.py @@ -11,12 +11,7 @@ import os import sys import platform as plat -pilotlight_location = "../../pilotlight" - -if len(sys.argv) > 1: - pilotlight_location = sys.argv[1] - -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/" + pilotlight_location) +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../pilotlight") import build.core as pl import build.backend_win32 as win32 @@ -27,27 +22,24 @@ import build.backend_macos as apple # [SECTION] project #----------------------------------------------------------------------------- - - - # where to output build scripts working_directory = os.path.dirname(os.path.abspath(__file__)) + "/../src" with pl.project("game"): # used to decide hot reloading - pl.set_hot_reload_target(pilotlight_location + "/out/pilot_light") + pl.set_hot_reload_target("../../pilotlight/out/pilot_light") # project wide settings - pl.set_output_directory(pilotlight_location + "/out") - pl.add_link_directories(pilotlight_location + "/out") + pl.set_output_directory("../out") + pl.add_link_directories("../out") pl.add_include_directories( "../src", "../extensions", - pilotlight_location + "/src", - pilotlight_location + "/libs", - pilotlight_location + "/extensions", - pilotlight_location + "/dependencies/stb") + "../../pilotlight/src", + "../../pilotlight/libs", + "../../pilotlight/extensions", + "../../pilotlight/dependencies/stb") #----------------------------------------------------------------------------- # [SECTION] profiles diff --git a/scripts/setup.py b/scripts/setup.py index 551e2ec..5c1ee06 100644 --- a/scripts/setup.py +++ b/scripts/setup.py @@ -23,7 +23,7 @@ includes = [ "${workspaceFolder}/**", "${workspaceFolder}/src", "${workspaceFolder}/extensions", - "${workspaceFolder}/../pilotlight/sandbox", + "${workspaceFolder}/../pilotlight/editor", "${workspaceFolder}/../pilotlight/src", "${workspaceFolder}/../pilotlight/libs", "${workspaceFolder}/../pilotlight/extensions", @@ -65,7 +65,7 @@ with open('../.vscode/launch.json', 'w') as file: lines.append(' "program": "${workspaceFolder}/../pilotlight/out/pilot_light",') lines.append(' "request": "launch",') - lines.append(' "args": ["-a", "template_app"],') + lines.append(' "args": ["-a", "../../pl-template/out/template_app"],') lines.append(' "stopAtEntry": false,') lines.append(' "cwd": "${workspaceFolder}/../pilotlight/out/",') lines.append(' "environment": []') diff --git a/src/app.c b/src/app.c index 02c792f..bb185d1 100644 --- a/src/app.c +++ b/src/app.c @@ -163,7 +163,8 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData) // * second & third argument is the load/unload functions names (use NULL for the default of "pl_load_ext" & // "pl_unload_ext") // * fourth argument indicates if the extension is reloadable (should we check for changes and reload if changed) - ptExtensionRegistry->load("pl_unity_ext", NULL, NULL, true); + ptExtensionRegistry->add_path("../../pl-template/out"); + ptExtensionRegistry->load("pl_unity_ext", NULL, NULL, false); ptExtensionRegistry->load("pl_platform_ext", NULL, NULL, false); // provides the file API used by the drawing ext ptExtensionRegistry->load("pl_example_ext", NULL, NULL, true);