Skip to content

Commit

Permalink
fix: ecs script debug issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan hoffstadt committed Nov 21, 2024
1 parent 9da89b6 commit a6e1e25
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
if not exist ../out/example_9.dll exit 1
if not exist ../out/pilot_light.exe exit 1
if not exist ../out/pl_unity_ext.dll exit 1
if not exist ../out/pl_script_camera.dll exit 1
if not exist ../out/pl_script_camerad.dll exit 1
cd ..
- name: Prep 2
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
test -f ./out/example_8.dylib || exit 1
test -f ./out/example_9.dylib || exit 1
test -f ./out/pl_unity_ext.dylib || exit 1
test -f ./out/pl_script_camera.dylib || exit 1
test -f ./out/pl_script_camerad.dylib || exit 1
- name: Prep 2
run: |
Expand Down Expand Up @@ -325,7 +325,7 @@ jobs:
test -f ./out/example_8.so || exit 1
test -f ./out/example_9.so || exit 1
test -f ./out/pl_unity_ext.so || exit 1
test -f ./out/pl_script_camera.so || exit 1
test -f ./out/pl_script_camerad.so || exit 1
- name: Prep 2
run: |
Expand Down
6 changes: 5 additions & 1 deletion sandbox/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plEditorData* ptEditorData)
ptEditorData->tMainCamera = gptEcs->create_perspective_camera(ptMainComponentLibrary, "main camera", (plVec3){-9.6f, 2.096f, 0.86f}, PL_PI_3, ptIO->tMainViewportSize.x / ptIO->tMainViewportSize.y, 0.1f, 48.0f, &ptMainCamera);
gptCamera->set_pitch_yaw(ptMainCamera, -0.245f, 1.816f);
gptCamera->update(ptMainCamera);
gptEcs->attach_script(ptMainComponentLibrary, "pl_script_camera", PL_SCRIPT_FLAG_PLAYING, ptEditorData->tMainCamera, NULL);
#ifdef PL_CONFIG_DEBUG
gptEcs->attach_script(ptMainComponentLibrary, "pl_script_camerad", PL_SCRIPT_FLAG_PLAYING, ptEditorData->tMainCamera, NULL);
#else
gptEcs->attach_script(ptMainComponentLibrary, "pl_script_camera", PL_SCRIPT_FLAG_PLAYING, ptEditorData->tMainCamera, NULL);
#endif

// create cull camera
plCameraComponent* ptCullCamera = NULL;
Expand Down
8 changes: 7 additions & 1 deletion scripts/gen_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,13 @@
with pl.target("pl_script_camera", pl.TargetType.DYNAMIC_LIBRARY, True):

pl.add_source_files("../extensions/pl_script_camera.c")
pl.set_output_binary("pl_script_camera")


# default config
with pl.configuration("debug"):

pl.set_output_binary("pl_script_camerad")

# win32
with pl.platform("Windows"):
with pl.compiler("msvc"):
Expand All @@ -206,6 +208,8 @@
# release
with pl.configuration("release"):

pl.set_output_binary("pl_script_camera")

# win32
with pl.platform("Windows"):
with pl.compiler("msvc"):
Expand All @@ -224,6 +228,8 @@
# vulkan on macos
with pl.configuration("vulkan"):

pl.set_output_binary("pl_script_camera")

# macos
with pl.platform("Darwin"):
with pl.compiler("clang"):
Expand Down
6 changes: 3 additions & 3 deletions src/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ else
PL_HOT_RELOAD_STATUS=0
rm -f ../out/pl_unity_ext.so
rm -f ../out/pl_unity_ext_*.so
rm -f ../out/pl_script_camera.so
rm -f ../out/pl_script_camera_*.so
rm -f ../out/pl_script_camerad.so
rm -f ../out/pl_script_camerad_*.so
rm -f ../out/app.so
rm -f ../out/app_*.so
rm -f ../out/pilot_light
Expand Down Expand Up @@ -127,7 +127,7 @@ echo
echo ${YELLOW}Step: pl_script_camera${NC}
echo ${YELLOW}~~~~~~~~~~~~~~~~~~~${NC}
echo ${CYAN}Compiling and Linking...${NC}
gcc -shared $PL_SOURCES $PL_INCLUDE_DIRECTORIES $PL_DEFINES $PL_COMPILER_FLAGS $PL_INCLUDE_DIRECTORIES $PL_LINK_DIRECTORIES $PL_LINKER_FLAGS $PL_STATIC_LINK_LIBRARIES $PL_DYNAMIC_LINK_LIBRARIES -o "./../out/pl_script_camera.so"
gcc -shared $PL_SOURCES $PL_INCLUDE_DIRECTORIES $PL_DEFINES $PL_COMPILER_FLAGS $PL_INCLUDE_DIRECTORIES $PL_LINK_DIRECTORIES $PL_LINKER_FLAGS $PL_STATIC_LINK_LIBRARIES $PL_DYNAMIC_LINK_LIBRARIES -o "./../out/pl_script_camerad.so"

# check build status
if [ $? -ne 0 ]
Expand Down
6 changes: 3 additions & 3 deletions src/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ else
PL_HOT_RELOAD_STATUS=0
rm -f ../out/pl_unity_ext.dylib
rm -f ../out/pl_unity_ext_*.dylib
rm -f ../out/pl_script_camera.dylib
rm -f ../out/pl_script_camera_*.dylib
rm -f ../out/pl_script_camerad.dylib
rm -f ../out/pl_script_camerad_*.dylib
rm -f ../out/app.dylib
rm -f ../out/app_*.dylib
rm -f ../out/pilot_light
Expand Down Expand Up @@ -146,7 +146,7 @@ echo
echo ${YELLOW}Step: pl_script_camera${NC}
echo ${YELLOW}~~~~~~~~~~~~~~~~~~~${NC}
echo ${CYAN}Compiling and Linking...${NC}
clang -shared $PL_SOURCES $PL_INCLUDE_DIRECTORIES $PL_DEFINES $PL_COMPILER_FLAGS $PL_INCLUDE_DIRECTORIES $PL_LINK_DIRECTORIES $PL_LINKER_FLAGS $PL_STATIC_LINK_LIBRARIES $PL_DYNAMIC_LINK_LIBRARIES $PL_LINK_FRAMEWORKS -o "./../out/pl_script_camera.dylib"
clang -shared $PL_SOURCES $PL_INCLUDE_DIRECTORIES $PL_DEFINES $PL_COMPILER_FLAGS $PL_INCLUDE_DIRECTORIES $PL_LINK_DIRECTORIES $PL_LINKER_FLAGS $PL_STATIC_LINK_LIBRARIES $PL_DYNAMIC_LINK_LIBRARIES $PL_LINK_FRAMEWORKS -o "./../out/pl_script_camerad.dylib"

# check build status
if [ $? -ne 0 ]
Expand Down
8 changes: 4 additions & 4 deletions src/build_win32.bat
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
@if exist "../out/pl_unity_ext.dll" del "..\out\pl_unity_ext.dll"
@if exist "../out/pl_unity_ext_*.dll" del "..\out\pl_unity_ext_*.dll"
@if exist "../out/pl_unity_ext_*.pdb" del "..\out\pl_unity_ext_*.pdb"
@if exist "../out/pl_script_camera.dll" del "..\out\pl_script_camera.dll"
@if exist "../out/pl_script_camera_*.dll" del "..\out\pl_script_camera_*.dll"
@if exist "../out/pl_script_camera_*.pdb" del "..\out\pl_script_camera_*.pdb"
@if exist "../out/pl_script_camerad.dll" del "..\out\pl_script_camerad.dll"
@if exist "../out/pl_script_camerad_*.dll" del "..\out\pl_script_camerad_*.dll"
@if exist "../out/pl_script_camerad_*.pdb" del "..\out\pl_script_camerad_*.pdb"
@if exist "../out/app.dll" del "..\out\app.dll"
@if exist "../out/app_*.dll" del "..\out\app_*.dll"
@if exist "../out/app_*.pdb" del "..\out\app_*.pdb"
Expand Down Expand Up @@ -132,7 +132,7 @@ cl %PL_INCLUDE_DIRECTORIES% %PL_DEFINES% %PL_COMPILER_FLAGS% %PL_SOURCES% -Fe"..
@echo Step: pl_script_camera
@echo ~~~~~~~~~~~~~~~~~~~~~~
@echo Compiling and Linking...
cl %PL_INCLUDE_DIRECTORIES% %PL_DEFINES% %PL_COMPILER_FLAGS% %PL_SOURCES% -Fe"../out/pl_script_camera.dll" -Fo"../out/" -LD -link %PL_LINKER_FLAGS% -PDB:"../out/pl_script_camera_%random%.pdb" %PL_LINK_DIRECTORIES%
cl %PL_INCLUDE_DIRECTORIES% %PL_DEFINES% %PL_COMPILER_FLAGS% %PL_SOURCES% -Fe"../out/pl_script_camerad.dll" -Fo"../out/" -LD -link %PL_LINKER_FLAGS% -PDB:"../out/pl_script_camerad_%random%.pdb" %PL_LINK_DIRECTORIES%

:: check build status
@set PL_BUILD_STATUS=%ERRORLEVEL%
Expand Down

0 comments on commit a6e1e25

Please sign in to comment.