Skip to content

Commit

Permalink
refac: remove script "d" appending for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Dec 16, 2024
1 parent 34dd949 commit 9d49bc5
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 51 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_camerad.dll exit 1
if not exist ../out/pl_script_camera.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_camerad.dylib || exit 1
test -f ./out/pl_script_camera.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_camerad.so || exit 1
test -f ./out/pl_script_camera.so || exit 1
- name: Prep 2
run: |
Expand Down
3 changes: 1 addition & 2 deletions extensions/pl_draw_backend_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ pl_cleanup_draw_backend(void)
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->atBufferInfo[i].tVertexBuffer);
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->at3DBufferInfo[i].tVertexBuffer);
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->atLineBufferInfo[i].tVertexBuffer);
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->atIndexBuffer[i]);
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->atIndexBuffer[i]);
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->atIndexBuffer[i]);
}

gptGfx->cleanup_bind_group_pool(gptDrawBackendCtx->ptBindGroupPool);
Expand Down
2 changes: 1 addition & 1 deletion extensions/pl_ecs_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ pl_ecs_remove_entity(plComponentLibrary* ptLibrary, plEntity tEntity)
{
plEntity tLastEntity = pl_sb_back(ptLibrary->_ptManagers[i]->sbtEntities);
pl_hm_remove(ptLibrary->_ptManagers[i]->ptHashmap, tLastEntity.uIndex);
pl_hm_get_free_index(ptLibrary->_ptManagers[i]->ptHashmap); // burn slot
uint64_t _unUsed = pl_hm_get_free_index(ptLibrary->_ptManagers[i]->ptHashmap); // burn slot
pl_hm_insert(ptLibrary->_ptManagers[i]->ptHashmap, tLastEntity.uIndex, uEntityValue);
}

Expand Down
15 changes: 2 additions & 13 deletions extensions/pl_script_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,7 @@ pl_load_script(plApiRegistryI* ptApiRegistry, bool bReload)
.run = pl_script_run
};

#ifdef PL_CONFIG_DEBUG
ptApiRegistry->set_api("pl_script_camerad", plScriptI_version, &tApi, sizeof(plScriptI));
#endif
#ifdef PL_CONFIG_RELEASE
ptApiRegistry->set_api("pl_script_camera", plScriptI_version, &tApi, sizeof(plScriptI));
#endif
ptApiRegistry->set_api("pl_script_camera", plScriptI_version, &tApi, sizeof(plScriptI));
}

PL_EXPORT void
Expand All @@ -108,12 +103,6 @@ pl_unload_script(plApiRegistryI* ptApiRegistry, bool bReload)
if(bReload)
return;


#ifdef PL_CONFIG_DEBUG
const plScriptI* ptApi = ptApiRegistry->get_api("pl_script_camerad", plScriptI_version);
#endif
#ifdef PL_CONFIG_RELEASE
const plScriptI* ptApi = ptApiRegistry->get_api("pl_script_camera", plScriptI_version);
#endif
const plScriptI* ptApi = ptApiRegistry->get_api("pl_script_camera", plScriptI_version);
ptApiRegistry->remove_api(ptApi);
}
6 changes: 1 addition & 5 deletions sandbox/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,7 @@ 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);
#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
gptEcs->attach_script(ptMainComponentLibrary, "pl_script_camera", PL_SCRIPT_FLAG_PLAYING, ptEditorData->tMainCamera, NULL);

// create cull camera
plCameraComponent* ptCullCamera = NULL;
Expand Down
7 changes: 1 addition & 6 deletions scripts/gen_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,12 @@
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 @@ -208,8 +207,6 @@
# release
with pl.configuration("release"):

pl.set_output_binary("pl_script_camera")

# win32
with pl.platform("Windows"):
with pl.compiler("msvc"):
Expand All @@ -228,8 +225,6 @@
# 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
15 changes: 4 additions & 11 deletions scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,16 @@
# copy scripts
for script in scripts:
if platform.system() == "Windows":
if debug_package:
shutil.move("../out/" + script + "d.dll", target_directory + "/bin/")
else:
shutil.move("../out/" + script + ".dll", target_directory + "/bin/")
shutil.move("../out/" + script + ".dll", target_directory + "/bin/")
for file in glob.glob("../out/" + script + "d_*.pdb"):
shutil.move(file, target_directory + "/bin/")
elif platform.system() == "Darwin":
shutil.move("../out/" + script + ".dylib", target_directory + "/bin/")
if debug_package:
shutil.move("../out/" + script + "d.dylib", target_directory + "/bin/")
shutil.copytree("../out/" + script + "d.dylib.dSYM", target_directory + "/bin/" + script + "d.dylib.dSYM")
else:
shutil.move("../out/" + script + ".dylib", target_directory + "/bin/")

elif platform.system() == "Linux":
if debug_package:
shutil.move("../out/" + script + "d.so", target_directory + "/bin/")
else:
shutil.move("../out/" + script + ".so", target_directory + "/bin/")
shutil.move("../out/" + script + ".so", target_directory + "/bin/")

# copy libs & executable
if platform.system() == "Windows":
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_camerad.so
rm -f ../out/pl_script_camerad_*.so
rm -f ../out/pl_script_camera.so
rm -f ../out/pl_script_camera_*.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_camerad.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_camera.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_camerad.dylib
rm -f ../out/pl_script_camerad_*.dylib
rm -f ../out/pl_script_camera.dylib
rm -f ../out/pl_script_camera_*.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_camerad.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_camera.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_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/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/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_camerad.dll" -Fo"../out/" -LD -link %PL_LINKER_FLAGS% -PDB:"../out/pl_script_camerad_%random%.pdb" %PL_LINK_DIRECTORIES%
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%

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

0 comments on commit 9d49bc5

Please sign in to comment.