Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9aaa2786b6 | |||
| e3bb138cb2 | |||
| 040d919b69 | |||
| 1a92ac64d7 | |||
| 145a1b323f | |||
| 2e33adf4a9 | |||
| c67a805bd7 | |||
| cb234f64f0 | |||
| 5ab98c9a0a | |||
| 37bba7866c | |||
| ebbbd181e3 | |||
| ba7d0ca27e | |||
| 13fc189ee8 | |||
| af5473f6e3 | |||
| 526b38eb4f | |||
| 295b7354d9 | |||
| b31b242775 | |||
| 7c6562719f | |||
| 00339aa6c2 | |||
| 2b8e222d7c | |||
| 7c5a6435bb | |||
| fe77100612 | |||
| 985e4de77d | |||
| b1ba23f9c0 | |||
| 884db4877e | |||
| 38569b18a7 | |||
| aa8e5c0782 | |||
| 6680e4689b | |||
| a2dc31f49c | |||
| fc9a4bdc47 | |||
| 4922305921 | |||
| 14c07f8750 | |||
| 2f5a970a4e | |||
| 6667a57585 | |||
| 9da4a5e852 | |||
| 871d7c8265 | |||
| 3352f2afa7 | |||
| 715955ef6a | |||
| 90a43254f3 | |||
| f1db564fb3 | |||
| 97b5483cc9 | |||
| ad056fa2a8 | |||
| 1bdcd5cd1b | |||
| 467b357620 | |||
| 0368276fbf | |||
| 9515b18d1e | |||
| d131c78a59 | |||
| 56389b5dee | |||
| 389cde97c2 | |||
| 0e41fb0ec9 | |||
| e4836174b4 | |||
| 284e282679 | |||
| 4b47346208 | |||
| a3d80256f5 | |||
| 29db39910c | |||
| 2346625afb | |||
| e9d906ce72 | |||
| aee0704fe7 | |||
| f3039f22ed | |||
| 76fdd3c76e | |||
| 7fc4b08808 | |||
| de05631608 | |||
| f875580197 |
15
.gitattributes
vendored
@@ -1,3 +1,18 @@
|
||||
enginecustom/assets/Model/OBJ/*.obj filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/assets/Model/OBJ/*.mtl filter=lfs diff=lfs merge=lfs -text
|
||||
doxygen_docs/** filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/include/Lua/Lib/lua54.lib filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/x64/Debug/lua54.dll filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/x64/Release/lua54.dll filter=lfs diff=lfs merge=lfs -text
|
||||
x64/Debug/lua54.dll filter=lfs diff=lfs merge=lfs -text
|
||||
x64/Release/lua54.dll filter=lfs diff=lfs merge=lfs -text
|
||||
x64/Debug/config.txt filter=lfs diff=lfs merge=lfs -text
|
||||
x64/Release/config.txt filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/assets/Skybox/*.png filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/assets/sounds/*.mp3 filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/assets/sounds/*.opus filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/assets/Texture/*.png filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/assets/Texture/*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/assets/Texture/*.tga filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/assets/Model/TXT/* filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/assets/Model/OBJ/* filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
2
.gitignore
vendored
@@ -434,3 +434,5 @@ FodyWeavers.xsd
|
||||
# Additional files built by Visual Studio
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/visualstudio,c++
|
||||
|
||||
.idea/
|
||||
|
||||
1
.idea/.idea.KhaoticEngineReborn/.idea/.name
generated
@@ -1 +0,0 @@
|
||||
KhaoticEngineReborn
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="RiderAndroidProjectSystem" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AgentMigrationStateService">
|
||||
<option name="migrationStatus" value="COMPLETED" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EditMigrationStateService">
|
||||
<option name="migrationStatus" value="COMPLETED" />
|
||||
</component>
|
||||
</project>
|
||||
14
.idea/.idea.KhaoticEngineReborn/.idea/discord.xml
generated
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="PROJECT_FILES" />
|
||||
<option name="description" value="" />
|
||||
<option name="applicationTheme" value="default" />
|
||||
<option name="iconsTheme" value="default" />
|
||||
<option name="button1Title" value="" />
|
||||
<option name="button1Url" value="" />
|
||||
<option name="button2Title" value="" />
|
||||
<option name="button2Url" value="" />
|
||||
<option name="customApplicationId" value="" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/enginecustom/src/src/system/application_class.cpp" charset="windows-1252" />
|
||||
<file url="file://$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" charset="windows-1252" />
|
||||
<file url="PROJECT" charset="windows-1252" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxBlameSettings">
|
||||
<option name="version" value="2" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationEnabledOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,7 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="LanguageDetectionInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ReassignedToPlainText" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MaterialThemeProjectNewConfig">
|
||||
<option name="metadata">
|
||||
<MTProjectMetadataState>
|
||||
<option name="migrated" value="true" />
|
||||
<option name="pristineConfig" value="false" />
|
||||
<option name="userId" value="4025287c:194ad69ad19:-7ff7" />
|
||||
</MTProjectMetadataState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RiderProjectSettingsUpdater">
|
||||
<option name="singleClickDiffPreview" value="1" />
|
||||
<option name="unhandledExceptionsIgnoreList" value="1" />
|
||||
<option name="vcsConfiguration" value="3" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.KhaoticEngineReborn/.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
332
.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
generated
@@ -1,332 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/camera_class.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/camera_class.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/ecs/component.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/ecs/component.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/ecs/components/audio_component.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/ecs/components/audio_component.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/ecs/components/transform_component.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/ecs/components/transform_component.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/ecs/entity.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/ecs/entity.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/ecs/entity_manager.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/ecs/entity_manager.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/application_class.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/application_class.cpp" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="DpaMonitoringSettings">
|
||||
<option name="firstShow" value="false" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="file://C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um/d3d11.h" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um/dinput.h" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/include/memory" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/include/Inc/VertexTypes.h" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/include/Vulkan/Include/vulkan/vulkan_core.h" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/ComponentFactory.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/component.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/components/identity_component.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/components/model_path_component.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/components/physics_component.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/components/render_component.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/components/shader_component.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/components/transform_component.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/entity.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/entity_manager.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/systems/render_system.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/inc/system/ecs/systems/types.h" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/../../IDE_VS/VC/Tools/MSVC/14.38.33130/include/type_traits" root0="SKIP_HIGHLIGHTING" />
|
||||
</component>
|
||||
<component name="KubernetesApiPersistence">{}</component>
|
||||
<component name="KubernetesApiProvider">{
|
||||
"isMigrated": true
|
||||
}</component>
|
||||
<component name="MetaFilesCheckinStateConfiguration" checkMetaFiles="true" />
|
||||
<component name="ProblemsViewState">
|
||||
<option name="selectedTabId" value="CurrentFile" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 6
|
||||
}</component>
|
||||
<component name="ProjectId" id="2sGIWDeT5ixyzDQ0he4A3RFpG9W" />
|
||||
<component name="ProjectLevelVcsManager">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"C++ Project.enginecustom.executor": "Run",
|
||||
"C/C++ Project.KhaoticDemo.executor": "Run",
|
||||
"C/C++ Project.enginecustom.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"ignore.virus.scanning.warn.message": "true",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</component>
|
||||
<component name="RunManager" selected="C/C++ Project.enginecustom">
|
||||
<configuration name="KhaoticDemo" type="CppProject" factoryName="C++ Project">
|
||||
<configuration_1 setup="1">
|
||||
<option name="CONFIGURATION" value="Debug" />
|
||||
<option name="PLATFORM" value="x64" />
|
||||
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||
<option name="EXE_PATH" value="$(LocalDebuggerCommand)" />
|
||||
<option name="PROGRAM_PARAMETERS" value="$(LocalDebuggerCommandArguments)" />
|
||||
<option name="WORKING_DIRECTORY" value="$(LocalDebuggerWorkingDirectory)" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||
</configuration_1>
|
||||
<option name="DEFAULT_PROJECT_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||
<option name="AUTO_SELECT_PRIORITY" value="0" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="enginecustom" type="CppProject" factoryName="C++ Project">
|
||||
<configuration_1 setup="1">
|
||||
<option name="CONFIGURATION" value="Debug" />
|
||||
<option name="PLATFORM" value="x64" />
|
||||
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||
<option name="EXE_PATH" value="$(LocalDebuggerCommand)" />
|
||||
<option name="PROGRAM_PARAMETERS" value="$(LocalDebuggerCommandArguments)" />
|
||||
<option name="WORKING_DIRECTORY" value="$(LocalDebuggerWorkingDirectory)" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
</configuration_1>
|
||||
<configuration_2 setup="1">
|
||||
<option name="CONFIGURATION" value="Release" />
|
||||
<option name="PLATFORM" value="x64" />
|
||||
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||
<option name="EXE_PATH" value="$(TargetPath)" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$(ProjectDir)" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
</configuration_2>
|
||||
<option name="DEFAULT_PROJECT_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
<option name="AUTO_SELECT_PRIORITY" value="0" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="" />
|
||||
<created>1738075515913</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1738075515913</updated>
|
||||
<workItem from="1738075517746" duration="553000" />
|
||||
<workItem from="1738076088229" duration="80000" />
|
||||
<workItem from="1738076192788" duration="19000" />
|
||||
<workItem from="1738076222547" duration="6131000" />
|
||||
<workItem from="1738171504772" duration="876000" />
|
||||
<workItem from="1738172392786" duration="67000" />
|
||||
<workItem from="1738173151768" duration="2361000" />
|
||||
<workItem from="1738175535254" duration="279000" />
|
||||
<workItem from="1738178991872" duration="2736000" />
|
||||
<workItem from="1738244577624" duration="3000" />
|
||||
<workItem from="1738321399968" duration="689000" />
|
||||
<workItem from="1738358054789" duration="9000" />
|
||||
<workItem from="1738358091089" duration="6675000" />
|
||||
<workItem from="1738364887298" duration="2275000" />
|
||||
<workItem from="1738515031789" duration="14018000" />
|
||||
<workItem from="1741705445392" duration="138000" />
|
||||
<workItem from="1741706018301" duration="5499000" />
|
||||
<workItem from="1742198713923" duration="31000" />
|
||||
<workItem from="1742198792655" duration="4618000" />
|
||||
<workItem from="1742203643675" duration="600000" />
|
||||
<workItem from="1742206836574" duration="258000" />
|
||||
<workItem from="1742207107802" duration="5340000" />
|
||||
<workItem from="1742228751298" duration="38000" />
|
||||
<workItem from="1742228870107" duration="1198000" />
|
||||
<workItem from="1742314944369" duration="79000" />
|
||||
<workItem from="1742318452773" duration="2258000" />
|
||||
<workItem from="1742331065936" duration="3030000" />
|
||||
<workItem from="1742371397157" duration="13355000" />
|
||||
<workItem from="1742425863119" duration="231000" />
|
||||
<workItem from="1742474596806" duration="67000" />
|
||||
<workItem from="1742474683111" duration="689000" />
|
||||
<workItem from="1742574318953" duration="552000" />
|
||||
<workItem from="1742581210996" duration="681000" />
|
||||
<workItem from="1742651501885" duration="47000" />
|
||||
<workItem from="1742664377329" duration="746000" />
|
||||
<workItem from="1742665243312" duration="310000" />
|
||||
<workItem from="1742667326806" duration="95000" />
|
||||
<workItem from="1743185728805" duration="15000" />
|
||||
<workItem from="1743185754182" duration="815000" />
|
||||
<workItem from="1743355100472" duration="708000" />
|
||||
<workItem from="1743355837694" duration="1514000" />
|
||||
<workItem from="1743370106270" duration="901000" />
|
||||
<workItem from="1743505399891" duration="2361000" />
|
||||
<workItem from="1746106963725" duration="5888000" />
|
||||
<workItem from="1746112904421" duration="75000" />
|
||||
<workItem from="1746113092234" duration="1477000" />
|
||||
<workItem from="1746117455914" duration="5976000" />
|
||||
<workItem from="1746126812110" duration="180000" />
|
||||
<workItem from="1746188920194" duration="1870000" />
|
||||
<workItem from="1746274246641" duration="89000" />
|
||||
<workItem from="1746274352144" duration="8039000" />
|
||||
<workItem from="1746444660572" duration="7742000" />
|
||||
<workItem from="1746456965664" duration="13000" />
|
||||
<workItem from="1746469494034" duration="799000" />
|
||||
<workItem from="1746526901276" duration="2023000" />
|
||||
<workItem from="1746536290167" duration="1908000" />
|
||||
<workItem from="1746538260893" duration="5781000" />
|
||||
<workItem from="1746546014271" duration="1814000" />
|
||||
<workItem from="1746619988287" duration="12282000" />
|
||||
<workItem from="1746711806997" duration="6736000" />
|
||||
<workItem from="1746719840054" duration="991000" />
|
||||
<workItem from="1746795732153" duration="33000" />
|
||||
<workItem from="1746795828588" duration="592000" />
|
||||
<workItem from="1747049871967" duration="9350000" />
|
||||
<workItem from="1747136509645" duration="3939000" />
|
||||
<workItem from="1747258663152" duration="835000" />
|
||||
<workItem from="1747826758888" duration="3587000" />
|
||||
<workItem from="1747830379222" duration="7954000" />
|
||||
<workItem from="1748254142068" duration="10499000" />
|
||||
<workItem from="1748267553700" duration="654000" />
|
||||
<workItem from="1748429087202" duration="7421000" />
|
||||
<workItem from="1748521606678" duration="5300000" />
|
||||
<workItem from="1748859894056" duration="1431000" />
|
||||
<workItem from="1748861785837" duration="357000" />
|
||||
<workItem from="1748865625274" duration="797000" />
|
||||
<workItem from="1748869642637" duration="3049000" />
|
||||
<workItem from="1748954607174" duration="14202000" />
|
||||
<workItem from="1748969487337" duration="402000" />
|
||||
<workItem from="1750187491423" duration="4397000" />
|
||||
<workItem from="1750191969842" duration="162000" />
|
||||
<workItem from="1750248915365" duration="442000" />
|
||||
<workItem from="1750335650897" duration="2051000" />
|
||||
<workItem from="1750344288223" duration="1751000" />
|
||||
<workItem from="1750351735497" duration="9648000" />
|
||||
<workItem from="1750417484899" duration="2384000" />
|
||||
<workItem from="1750420267631" duration="148000" />
|
||||
<workItem from="1750592598277" duration="332000" />
|
||||
<workItem from="1750699146323" duration="10385000" />
|
||||
<workItem from="1750763086646" duration="4874000" />
|
||||
<workItem from="1750770680795" duration="13425000" />
|
||||
<workItem from="1750964683511" duration="27000" />
|
||||
<workItem from="1750964770914" duration="2126000" />
|
||||
<workItem from="1753700140931" duration="918000" />
|
||||
<workItem from="1753701507863" duration="7153000" />
|
||||
<workItem from="1753713925469" duration="1739000" />
|
||||
<workItem from="1754572996727" duration="224000" />
|
||||
<workItem from="1755617169013" duration="222000" />
|
||||
<workItem from="1757101936080" duration="185000" />
|
||||
<workItem from="1757158576637" duration="2501000" />
|
||||
<workItem from="1757167799006" duration="45000" />
|
||||
<workItem from="1757167889796" duration="7081000" />
|
||||
<workItem from="1757175031271" duration="2289000" />
|
||||
<workItem from="1757177353935" duration="676000" />
|
||||
<workItem from="1757182479393" duration="1386000" />
|
||||
<workItem from="1757427950015" duration="2864000" />
|
||||
<workItem from="1757431548883" duration="986000" />
|
||||
<workItem from="1757449929378" duration="1107000" />
|
||||
<workItem from="1757456559331" duration="2094000" />
|
||||
<workItem from="1757458683204" duration="3628000" />
|
||||
<workItem from="1757938327874" duration="2045000" />
|
||||
<workItem from="1757952605657" duration="117000" />
|
||||
<workItem from="1757952791669" duration="4499000" />
|
||||
<workItem from="1757959923169" duration="1930000" />
|
||||
<workItem from="1757961888820" duration="8937000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
|
||||
<option name="closed" value="true" />
|
||||
<created>1738175474520</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1738175474520</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="Patch update - add menu button">
|
||||
<option name="closed" value="true" />
|
||||
<created>1738181617050</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1738181617050</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="3" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="UnityCheckinConfiguration" checkUnsavedScenes="true" />
|
||||
<component name="UnityProjectConfiguration" hasMinimizedUI="false" />
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
|
||||
<MESSAGE value="Minor update - viewport window tweak" />
|
||||
<MESSAGE value="Patch update - add menu button" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Patch update - add menu button" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<breakpoint enabled="true" type="DotNet_Exception_Breakpoints">
|
||||
<properties exception="System.OperationCanceledException" breakIfHandledByOtherCode="false" displayValue="System.OperationCanceledException" />
|
||||
<option name="timeStamp" value="1" />
|
||||
</breakpoint>
|
||||
<breakpoint enabled="true" type="DotNet_Exception_Breakpoints">
|
||||
<properties exception="System.Threading.Tasks.TaskCanceledException" breakIfHandledByOtherCode="false" displayValue="System.Threading.Tasks.TaskCanceledException" />
|
||||
<option name="timeStamp" value="2" />
|
||||
</breakpoint>
|
||||
<breakpoint enabled="true" type="DotNet_Exception_Breakpoints">
|
||||
<properties exception="System.Threading.ThreadAbortException" breakIfHandledByOtherCode="false" displayValue="System.Threading.ThreadAbortException" />
|
||||
<option name="timeStamp" value="3" />
|
||||
</breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
<watches-manager>
|
||||
<configuration name="CppProject">
|
||||
<watch expression="((class ModelClass &) (*(*(*this).m_Application).m_object[0]))" />
|
||||
</configuration>
|
||||
</watches-manager>
|
||||
</component>
|
||||
<component name="XSLT-Support.FileAssociations.UIState">
|
||||
<expand />
|
||||
<select />
|
||||
</component>
|
||||
</project>
|
||||
136
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
pipeline {
|
||||
agent { label 'windows' }
|
||||
|
||||
parameters {
|
||||
string(name: 'DISCORD_USER_ID', defaultValue: '378262266723696651', description: 'ID Discord pour recevoir le DM')
|
||||
choice(name: 'BUILD_TYPE', choices: ['Both', 'Debug', 'Release'], description: 'Type de build à exécuter')
|
||||
}
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
disableConcurrentBuilds()
|
||||
timeout(time: 30, unit: 'MINUTES')
|
||||
}
|
||||
|
||||
triggers {
|
||||
pollSCM('')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
parallel {
|
||||
stage('Build Debug') {
|
||||
when { expression { params.BUILD_TYPE in ['Both', 'Debug'] } }
|
||||
steps {
|
||||
echo 'Building Debug...'
|
||||
bat """
|
||||
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe" ^
|
||||
"%WORKSPACE%\\KhaoticEngineReborn.sln" ^
|
||||
/p:Configuration=Debug ^
|
||||
/p:Platform=x64 ^
|
||||
/m ^
|
||||
/verbosity:minimal
|
||||
"""
|
||||
}
|
||||
}
|
||||
stage('Build Release') {
|
||||
when { expression { params.BUILD_TYPE in ['Both', 'Release'] } }
|
||||
steps {
|
||||
echo 'Building Release...'
|
||||
bat """
|
||||
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe" ^
|
||||
"%WORKSPACE%\\KhaoticEngineReborn.sln" ^
|
||||
/p:Configuration=Release ^
|
||||
/p:Platform=x64 ^
|
||||
/m ^
|
||||
/verbosity:minimal
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Package') {
|
||||
parallel {
|
||||
stage('Package Debug') {
|
||||
when { expression { params.BUILD_TYPE in ['Both', 'Debug'] } }
|
||||
steps {
|
||||
echo 'Packaging Debug into ZIP'
|
||||
bat 'if not exist "%WORKSPACE%\\builds" mkdir "%WORKSPACE%\\builds"'
|
||||
bat """
|
||||
powershell -Command "Compress-Archive -Path '%WORKSPACE%\\**\\Debug\\*' -DestinationPath '%WORKSPACE%\\builds\\KhaoticEngineReborn_Debug.zip' -Force"
|
||||
"""
|
||||
}
|
||||
}
|
||||
stage('Package Release') {
|
||||
when { expression { params.BUILD_TYPE in ['Both', 'Release'] } }
|
||||
steps {
|
||||
echo 'Packaging Release into ZIP'
|
||||
bat 'if not exist "%WORKSPACE%\\builds" mkdir "%WORKSPACE%\\builds"'
|
||||
bat """
|
||||
powershell -Command "Compress-Archive -Path '%WORKSPACE%\\**\\Release\\*' -DestinationPath '%WORKSPACE%\\builds\\KhaoticEngineReborn_Release.zip' -Force"
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Archive Artifacts') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: 'builds/*.zip', fingerprint: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
def urlsList = []
|
||||
if (params.BUILD_TYPE in ['Both', 'Debug']) {
|
||||
urlsList << "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Debug.zip"
|
||||
}
|
||||
if (params.BUILD_TYPE in ['Both', 'Release']) {
|
||||
urlsList << "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Release.zip"
|
||||
}
|
||||
|
||||
def data = [
|
||||
userId: params.DISCORD_USER_ID,
|
||||
status: 'success',
|
||||
urls: urlsList
|
||||
]
|
||||
def jsonFile = "${env.WORKSPACE}\\payload.json"
|
||||
writeFile file: jsonFile, text: groovy.json.JsonOutput.toJson(data)
|
||||
|
||||
bat """
|
||||
curl -X POST http://192.168.1.131:2500/ci-notify ^
|
||||
-H "Content-Type: application/json" ^
|
||||
--data @${jsonFile}
|
||||
"""
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
def data = [
|
||||
userId: params.DISCORD_USER_ID,
|
||||
status: 'failure',
|
||||
urls: []
|
||||
]
|
||||
def jsonFile = "${env.WORKSPACE}\\payload-fail.json"
|
||||
writeFile file: jsonFile, text: groovy.json.JsonOutput.toJson(data)
|
||||
|
||||
bat """
|
||||
curl -X POST http://192.168.1.131:2500/ci-notify ^
|
||||
-H "Content-Type: application/json" ^
|
||||
--data @${jsonFile}
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
8
enginecustom/DemoScene_V13.6.0.ker
Normal file
@@ -0,0 +1,8 @@
|
||||
Entity:0:86
|
||||
IdentityComponent:0:86:Unknown
|
||||
TransformComponent:0:50:0:0:-0:0:1:1:1
|
||||
RenderComponent:HasModel:1:assets/Texture/Bricks2K.png:1:assets/Texture/BricksNRM2K.png:1:assets/Texture/BricksGLOSS2K.png:0:
|
||||
ShaderComponent:LIGHTING
|
||||
ModelPathComponent:Content/Assets/Kobject/86.obj
|
||||
AudioComponent:F:\Github_Repo\khaotic-engine-Reborn\x64\Release\assets\sounds\default.mp3;1:0:1:1:0:0:128:1:0
|
||||
EndEntity
|
||||
6014
enginecustom/DemoScene_V14.7.0.ker
Normal file
BIN
enginecustom/assets/Model/TXT/bath.txt
(Stored with Git LFS)
BIN
enginecustom/assets/Model/TXT/chunk.txt
(Stored with Git LFS)
BIN
enginecustom/assets/Model/TXT/cube.txt
(Stored with Git LFS)
BIN
enginecustom/assets/Model/TXT/ground.txt
(Stored with Git LFS)
BIN
enginecustom/assets/Model/TXT/plane.txt
(Stored with Git LFS)
BIN
enginecustom/assets/Model/TXT/square.txt
(Stored with Git LFS)
BIN
enginecustom/assets/Model/TXT/wall.txt
(Stored with Git LFS)
BIN
enginecustom/assets/Model/TXT/water.txt
(Stored with Git LFS)
|
Before Width: | Height: | Size: 11 MiB After Width: | Height: | Size: 133 B |
|
Before Width: | Height: | Size: 331 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 273 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 493 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 510 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 498 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 422 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 7.5 MiB After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 8.4 MiB After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 588 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 599 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 917 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 934 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 131 B |
@@ -123,6 +123,7 @@
|
||||
<ClInclude Include="src\inc\system\ecs\ComponentFactory.h" />
|
||||
<ClInclude Include="src\inc\system\ecs\components\audio_component.h" />
|
||||
<ClInclude Include="src\inc\system\ecs\components\identity_component.h" />
|
||||
<ClInclude Include="src\inc\system\ecs\components\lua_script_component.h" />
|
||||
<ClInclude Include="src\inc\system\ecs\components\model_path_component.h" />
|
||||
<ClInclude Include="src\inc\system\ecs\components\physics_component.h" />
|
||||
<ClInclude Include="src\inc\system\ecs\components\render_component.h" />
|
||||
@@ -140,6 +141,7 @@
|
||||
<ClInclude Include="src\inc\system\input_class.h" />
|
||||
<ClInclude Include="src\inc\system\light_class.h" />
|
||||
<ClInclude Include="src\inc\system\Logger.h" />
|
||||
<ClInclude Include="src\inc\system\macro.h" />
|
||||
<ClInclude Include="src\inc\system\model_class.h" />
|
||||
<ClInclude Include="src\inc\system\Modellistclass.h" />
|
||||
<ClInclude Include="src\inc\system\object.h" />
|
||||
@@ -155,6 +157,7 @@
|
||||
<ClInclude Include="src\inc\system\text_class.h" />
|
||||
<ClInclude Include="src\inc\system\texture_class.h" />
|
||||
<ClInclude Include="src\inc\system\timer_class.h" />
|
||||
<ClInclude Include="src\inc\system\version.h" />
|
||||
<ClInclude Include="src\inc\system\vulkan.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -682,14 +685,14 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;$(SolutionDir)enginecustom\src\inc\shader;$(SolutionDir)enginecustom\src\inc\system;$(SolutionDir)enginecustom\include\Vulkan\Include;$(SolutionDir)enginecustom\include\Fmod;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;$(SolutionDir)enginecustom\src\inc\shader;$(SolutionDir)enginecustom\src\inc\system;$(SolutionDir)enginecustom\include\Vulkan\Include;$(SolutionDir)enginecustom\include\Lua;$(SolutionDir)enginecustom\include\Fmod;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)enginecustom\include\Vulkan\Lib;$(SolutionDir)enginecustom\include\GLFW\lib-vc2022;$(SolutionDir)enginecustom\include\Fmod\core\lib\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>fmodL_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)enginecustom\include\Vulkan\Lib;$(SolutionDir)enginecustom\include\GLFW\lib-vc2022;$(SolutionDir)enginecustom\include\Lua\Lib;$(SolutionDir)enginecustom\include\Fmod\core\lib\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>fmodL_vc.lib;lua54.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@@ -701,15 +704,15 @@
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;$(SolutionDir)enginecustom\src\inc\shader;$(SolutionDir)enginecustom\src\inc\system;$(SolutionDir)enginecustom\include\Vulkan\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;$(SolutionDir)enginecustom\src\inc\shader;$(SolutionDir)enginecustom\src\inc\system;$(SolutionDir)enginecustom\include\Vulkan\Include;$(SolutionDir)enginecustom\include\Lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)enginecustom\include\Vulkan\Lib;$(SolutionDir)enginecustom\include\GLFW\lib-vc2022;$(SolutionDir)enginecustom\include\Fmod\core\lib\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>fmod_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)enginecustom\include\Vulkan\Lib;$(SolutionDir)enginecustom\include\GLFW\lib-vc2022;$(SolutionDir)enginecustom\include\Lua\Lib;$(SolutionDir)enginecustom\include\Fmod\core\lib\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>fmod_vc.lib;lua54.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[Window][DockSpace]
|
||||
Pos=0,0
|
||||
Size=1584,861
|
||||
Size=1536,793
|
||||
Collapsed=0
|
||||
|
||||
[Window][Debug##Default]
|
||||
@@ -12,25 +12,25 @@ Collapsed=0
|
||||
Pos=1267,19
|
||||
Size=317,842
|
||||
Collapsed=0
|
||||
DockId=0x00000005,0
|
||||
DockId=0x00000006,0
|
||||
|
||||
[Window][render Stats]
|
||||
Pos=0,630
|
||||
Size=1584,231
|
||||
Pos=0,562
|
||||
Size=1217,231
|
||||
Collapsed=0
|
||||
DockId=0x00000009,0
|
||||
|
||||
[Window][Objects]
|
||||
Pos=0,19
|
||||
Size=234,842
|
||||
Size=15,22
|
||||
Collapsed=0
|
||||
DockId=0x0000000B,0
|
||||
|
||||
[Window][Terrain]
|
||||
Pos=0,19
|
||||
Size=266,842
|
||||
Size=15,22
|
||||
Collapsed=0
|
||||
DockId=0x00000007,0
|
||||
DockId=0x0000000B,1
|
||||
|
||||
[Window][Log Window]
|
||||
Pos=0,630
|
||||
@@ -45,23 +45,27 @@ Collapsed=0
|
||||
DockId=0x0000000B,0
|
||||
|
||||
[Window][Engine Settings]
|
||||
Pos=1267,462
|
||||
Size=317,166
|
||||
Pos=1219,19
|
||||
Size=317,774
|
||||
Collapsed=0
|
||||
DockId=0x00000006,0
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,842 Split=Y
|
||||
DockNode ID=0x00000003 Parent=0xCCBD8CF7 SizeRef=1584,609 Split=X
|
||||
DockNode ID=0x0000000B Parent=0x00000003 SizeRef=234,842 Selected=0x031DC75C
|
||||
DockNode ID=0x0000000C Parent=0x00000003 SizeRef=1348,842 Split=X
|
||||
DockNode ID=0x00000007 Parent=0x0000000C SizeRef=266,842 Selected=0x393905AB
|
||||
DockNode ID=0x00000008 Parent=0x0000000C SizeRef=1316,842 Split=X
|
||||
DockNode ID=0x00000001 Parent=0x00000008 SizeRef=1265,842 CentralNode=1
|
||||
DockNode ID=0x00000002 Parent=0x00000008 SizeRef=317,842 Split=Y Selected=0x9F035453
|
||||
DockNode ID=0x00000005 Parent=0x00000002 SizeRef=317,441 Selected=0x9F035453
|
||||
DockNode ID=0x00000006 Parent=0x00000002 SizeRef=317,166 Selected=0x0B098C4B
|
||||
DockNode ID=0x00000004 Parent=0xCCBD8CF7 SizeRef=1584,231 Split=X Selected=0xF5D1BB37
|
||||
DockNode ID=0x00000009 Parent=0x00000004 SizeRef=792,231 Selected=0xF5D1BB37
|
||||
DockNode ID=0x0000000A Parent=0x00000004 SizeRef=790,231 Selected=0xAB74BEE9
|
||||
[Window][Inspector]
|
||||
Pos=1352,19
|
||||
Size=232,842
|
||||
Collapsed=0
|
||||
DockId=0x00000002,0
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1536,774 Split=X
|
||||
DockNode ID=0x00000001 Parent=0xCCBD8CF7 SizeRef=1350,842 Split=X
|
||||
DockNode ID=0x00000005 Parent=0x00000001 SizeRef=1265,842 Split=Y
|
||||
DockNode ID=0x00000003 Parent=0x00000005 SizeRef=1584,609 Split=X
|
||||
DockNode ID=0x0000000B Parent=0x00000003 SizeRef=251,842 Selected=0x031DC75C
|
||||
DockNode ID=0x0000000C Parent=0x00000003 SizeRef=964,842 CentralNode=1
|
||||
DockNode ID=0x00000004 Parent=0x00000005 SizeRef=1584,231 Split=X Selected=0xF5D1BB37
|
||||
DockNode ID=0x00000009 Parent=0x00000004 SizeRef=792,231 Selected=0xF5D1BB37
|
||||
DockNode ID=0x0000000A Parent=0x00000004 SizeRef=790,231 Selected=0xAB74BEE9
|
||||
DockNode ID=0x00000006 Parent=0x00000001 SizeRef=317,842 Selected=0x0B098C4B
|
||||
DockNode ID=0x00000002 Parent=0xCCBD8CF7 SizeRef=232,842 Selected=0x36DC96AB
|
||||
|
||||
|
||||
BIN
enginecustom/include/Lua/Lib/lua54.lib
(Stored with Git LFS)
Normal file
276
enginecustom/include/Lua/lauxlib.h
Normal file
@@ -0,0 +1,276 @@
|
||||
/*
|
||||
** $Id: lauxlib.h $
|
||||
** Auxiliary functions for building Lua libraries
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
||||
|
||||
#ifndef lauxlib_h
|
||||
#define lauxlib_h
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "lua.h"
|
||||
|
||||
|
||||
/* global table */
|
||||
#define LUA_GNAME "_G"
|
||||
|
||||
|
||||
typedef struct luaL_Buffer luaL_Buffer;
|
||||
|
||||
|
||||
/* extra error code for 'luaL_loadfilex' */
|
||||
#define LUA_ERRFILE (LUA_ERRERR+1)
|
||||
|
||||
|
||||
/* key, in the registry, for table of loaded modules */
|
||||
#define LUA_LOADED_TABLE "_LOADED"
|
||||
|
||||
|
||||
/* key, in the registry, for table of preloaded loaders */
|
||||
#define LUA_PRELOAD_TABLE "_PRELOAD"
|
||||
|
||||
|
||||
typedef struct luaL_Reg {
|
||||
const char *name;
|
||||
lua_CFunction func;
|
||||
} luaL_Reg;
|
||||
|
||||
|
||||
#define LUAL_NUMSIZES (sizeof(lua_Integer)*16 + sizeof(lua_Number))
|
||||
|
||||
LUALIB_API void (luaL_checkversion_) (lua_State *L, lua_Number ver, size_t sz);
|
||||
#define luaL_checkversion(L) \
|
||||
luaL_checkversion_(L, LUA_VERSION_NUM, LUAL_NUMSIZES)
|
||||
|
||||
LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
|
||||
LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
|
||||
LUALIB_API const char *(luaL_tolstring) (lua_State *L, int idx, size_t *len);
|
||||
LUALIB_API int (luaL_argerror) (lua_State *L, int arg, const char *extramsg);
|
||||
LUALIB_API int (luaL_typeerror) (lua_State *L, int arg, const char *tname);
|
||||
LUALIB_API const char *(luaL_checklstring) (lua_State *L, int arg,
|
||||
size_t *l);
|
||||
LUALIB_API const char *(luaL_optlstring) (lua_State *L, int arg,
|
||||
const char *def, size_t *l);
|
||||
LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int arg);
|
||||
LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int arg, lua_Number def);
|
||||
|
||||
LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int arg);
|
||||
LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int arg,
|
||||
lua_Integer def);
|
||||
|
||||
LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);
|
||||
LUALIB_API void (luaL_checktype) (lua_State *L, int arg, int t);
|
||||
LUALIB_API void (luaL_checkany) (lua_State *L, int arg);
|
||||
|
||||
LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname);
|
||||
LUALIB_API void (luaL_setmetatable) (lua_State *L, const char *tname);
|
||||
LUALIB_API void *(luaL_testudata) (lua_State *L, int ud, const char *tname);
|
||||
LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
|
||||
|
||||
LUALIB_API void (luaL_where) (lua_State *L, int lvl);
|
||||
LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
|
||||
|
||||
LUALIB_API int (luaL_checkoption) (lua_State *L, int arg, const char *def,
|
||||
const char *const lst[]);
|
||||
|
||||
LUALIB_API int (luaL_fileresult) (lua_State *L, int stat, const char *fname);
|
||||
LUALIB_API int (luaL_execresult) (lua_State *L, int stat);
|
||||
|
||||
|
||||
/* predefined references */
|
||||
#define LUA_NOREF (-2)
|
||||
#define LUA_REFNIL (-1)
|
||||
|
||||
LUALIB_API int (luaL_ref) (lua_State *L, int t);
|
||||
LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
|
||||
|
||||
LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename,
|
||||
const char *mode);
|
||||
|
||||
#define luaL_loadfile(L,f) luaL_loadfilex(L,f,NULL)
|
||||
|
||||
LUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz,
|
||||
const char *name, const char *mode);
|
||||
LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);
|
||||
|
||||
LUALIB_API lua_State *(luaL_newstate) (void);
|
||||
|
||||
LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx);
|
||||
|
||||
LUALIB_API void luaL_addgsub (luaL_Buffer *b, const char *s,
|
||||
const char *p, const char *r);
|
||||
LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s,
|
||||
const char *p, const char *r);
|
||||
|
||||
LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
|
||||
|
||||
LUALIB_API int (luaL_getsubtable) (lua_State *L, int idx, const char *fname);
|
||||
|
||||
LUALIB_API void (luaL_traceback) (lua_State *L, lua_State *L1,
|
||||
const char *msg, int level);
|
||||
|
||||
LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname,
|
||||
lua_CFunction openf, int glb);
|
||||
|
||||
/*
|
||||
** ===============================================================
|
||||
** some useful macros
|
||||
** ===============================================================
|
||||
*/
|
||||
|
||||
|
||||
#define luaL_newlibtable(L,l) \
|
||||
lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1)
|
||||
|
||||
#define luaL_newlib(L,l) \
|
||||
(luaL_checkversion(L), luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))
|
||||
|
||||
#define luaL_argcheck(L, cond,arg,extramsg) \
|
||||
((void)((cond) || luaL_argerror(L, (arg), (extramsg))))
|
||||
|
||||
#define luaL_argexpected(L,cond,arg,tname) \
|
||||
((void)((cond) || luaL_typeerror(L, (arg), (tname))))
|
||||
|
||||
#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
|
||||
#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
|
||||
|
||||
#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i)))
|
||||
|
||||
#define luaL_dofile(L, fn) \
|
||||
(luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
|
||||
|
||||
#define luaL_dostring(L, s) \
|
||||
(luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
|
||||
|
||||
#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
|
||||
|
||||
#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
|
||||
|
||||
#define luaL_loadbuffer(L,s,sz,n) luaL_loadbufferx(L,s,sz,n,NULL)
|
||||
|
||||
|
||||
/* push the value used to represent failure/error */
|
||||
#define luaL_pushfail(L) lua_pushnil(L)
|
||||
|
||||
|
||||
/*
|
||||
** {======================================================
|
||||
** Generic Buffer manipulation
|
||||
** =======================================================
|
||||
*/
|
||||
|
||||
struct luaL_Buffer {
|
||||
char *b; /* buffer address */
|
||||
size_t size; /* buffer size */
|
||||
size_t n; /* number of characters in buffer */
|
||||
lua_State *L;
|
||||
union {
|
||||
LUAI_MAXALIGN; /* ensure maximum alignment for buffer */
|
||||
char b[LUAL_BUFFERSIZE]; /* initial buffer */
|
||||
} init;
|
||||
};
|
||||
|
||||
|
||||
#define luaL_bufflen(bf) ((bf)->n)
|
||||
#define luaL_buffaddr(bf) ((bf)->b)
|
||||
|
||||
|
||||
#define luaL_addchar(B,c) \
|
||||
((void)((B)->n < (B)->size || luaL_prepbuffsize((B), 1)), \
|
||||
((B)->b[(B)->n++] = (c)))
|
||||
|
||||
#define luaL_addsize(B,s) ((B)->n += (s))
|
||||
|
||||
#define luaL_buffsub(B,s) ((B)->n -= (s))
|
||||
|
||||
LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);
|
||||
LUALIB_API char *(luaL_prepbuffsize) (luaL_Buffer *B, size_t sz);
|
||||
LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);
|
||||
LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);
|
||||
LUALIB_API void (luaL_addvalue) (luaL_Buffer *B);
|
||||
LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
|
||||
LUALIB_API void (luaL_pushresultsize) (luaL_Buffer *B, size_t sz);
|
||||
LUALIB_API char *(luaL_buffinitsize) (lua_State *L, luaL_Buffer *B, size_t sz);
|
||||
|
||||
#define luaL_prepbuffer(B) luaL_prepbuffsize(B, LUAL_BUFFERSIZE)
|
||||
|
||||
/* }====================================================== */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** {======================================================
|
||||
** File handles for IO library
|
||||
** =======================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
** A file handle is a userdata with metatable 'LUA_FILEHANDLE' and
|
||||
** initial structure 'luaL_Stream' (it may contain other fields
|
||||
** after that initial structure).
|
||||
*/
|
||||
|
||||
#define LUA_FILEHANDLE "FILE*"
|
||||
|
||||
|
||||
typedef struct luaL_Stream {
|
||||
FILE *f; /* stream (NULL for incompletely created streams) */
|
||||
lua_CFunction closef; /* to close stream (NULL for closed streams) */
|
||||
} luaL_Stream;
|
||||
|
||||
/* }====================================================== */
|
||||
|
||||
/*
|
||||
** {==================================================================
|
||||
** "Abstraction Layer" for basic report of messages and errors
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
/* print a string */
|
||||
#if !defined(lua_writestring)
|
||||
#define lua_writestring(s,l) fwrite((s), sizeof(char), (l), stdout)
|
||||
#endif
|
||||
|
||||
/* print a newline and flush the output */
|
||||
#if !defined(lua_writeline)
|
||||
#define lua_writeline() (lua_writestring("\n", 1), fflush(stdout))
|
||||
#endif
|
||||
|
||||
/* print an error message */
|
||||
#if !defined(lua_writestringerror)
|
||||
#define lua_writestringerror(s,p) \
|
||||
(fprintf(stderr, (s), (p)), fflush(stderr))
|
||||
#endif
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
/*
|
||||
** {============================================================
|
||||
** Compatibility with deprecated conversions
|
||||
** =============================================================
|
||||
*/
|
||||
#if defined(LUA_COMPAT_APIINTCASTS)
|
||||
|
||||
#define luaL_checkunsigned(L,a) ((lua_Unsigned)luaL_checkinteger(L,a))
|
||||
#define luaL_optunsigned(L,a,d) \
|
||||
((lua_Unsigned)luaL_optinteger(L,a,(lua_Integer)(d)))
|
||||
|
||||
#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
|
||||
#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
|
||||
|
||||
#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n)))
|
||||
#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d)))
|
||||
|
||||
#endif
|
||||
/* }============================================================ */
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
517
enginecustom/include/Lua/lua.h
Normal file
@@ -0,0 +1,517 @@
|
||||
/*
|
||||
** $Id: lua.h $
|
||||
** Lua - A Scripting Language
|
||||
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
|
||||
** See Copyright Notice at the end of this file
|
||||
*/
|
||||
|
||||
|
||||
#ifndef lua_h
|
||||
#define lua_h
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
#include "luaconf.h"
|
||||
|
||||
|
||||
#define LUA_VERSION_MAJOR "5"
|
||||
#define LUA_VERSION_MINOR "4"
|
||||
#define LUA_VERSION_RELEASE "2"
|
||||
|
||||
#define LUA_VERSION_NUM 504
|
||||
#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 0)
|
||||
|
||||
#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
|
||||
#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE
|
||||
#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2020 Lua.org, PUC-Rio"
|
||||
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
|
||||
|
||||
|
||||
/* mark for precompiled code ('<esc>Lua') */
|
||||
#define LUA_SIGNATURE "\x1bLua"
|
||||
|
||||
/* option for multiple returns in 'lua_pcall' and 'lua_call' */
|
||||
#define LUA_MULTRET (-1)
|
||||
|
||||
|
||||
/*
|
||||
** Pseudo-indices
|
||||
** (-LUAI_MAXSTACK is the minimum valid index; we keep some free empty
|
||||
** space after that to help overflow detection)
|
||||
*/
|
||||
#define LUA_REGISTRYINDEX (-LUAI_MAXSTACK - 1000)
|
||||
#define lua_upvalueindex(i) (LUA_REGISTRYINDEX - (i))
|
||||
|
||||
|
||||
/* thread status */
|
||||
#define LUA_OK 0
|
||||
#define LUA_YIELD 1
|
||||
#define LUA_ERRRUN 2
|
||||
#define LUA_ERRSYNTAX 3
|
||||
#define LUA_ERRMEM 4
|
||||
#define LUA_ERRERR 5
|
||||
|
||||
|
||||
typedef struct lua_State lua_State;
|
||||
|
||||
|
||||
/*
|
||||
** basic types
|
||||
*/
|
||||
#define LUA_TNONE (-1)
|
||||
|
||||
#define LUA_TNIL 0
|
||||
#define LUA_TBOOLEAN 1
|
||||
#define LUA_TLIGHTUSERDATA 2
|
||||
#define LUA_TNUMBER 3
|
||||
#define LUA_TSTRING 4
|
||||
#define LUA_TTABLE 5
|
||||
#define LUA_TFUNCTION 6
|
||||
#define LUA_TUSERDATA 7
|
||||
#define LUA_TTHREAD 8
|
||||
|
||||
#define LUA_NUMTYPES 9
|
||||
|
||||
|
||||
|
||||
/* minimum Lua stack available to a C function */
|
||||
#define LUA_MINSTACK 20
|
||||
|
||||
|
||||
/* predefined values in the registry */
|
||||
#define LUA_RIDX_MAINTHREAD 1
|
||||
#define LUA_RIDX_GLOBALS 2
|
||||
#define LUA_RIDX_LAST LUA_RIDX_GLOBALS
|
||||
|
||||
|
||||
/* type of numbers in Lua */
|
||||
typedef LUA_NUMBER lua_Number;
|
||||
|
||||
|
||||
/* type for integer functions */
|
||||
typedef LUA_INTEGER lua_Integer;
|
||||
|
||||
/* unsigned integer type */
|
||||
typedef LUA_UNSIGNED lua_Unsigned;
|
||||
|
||||
/* type for continuation-function contexts */
|
||||
typedef LUA_KCONTEXT lua_KContext;
|
||||
|
||||
|
||||
/*
|
||||
** Type for C functions registered with Lua
|
||||
*/
|
||||
typedef int (*lua_CFunction) (lua_State *L);
|
||||
|
||||
/*
|
||||
** Type for continuation functions
|
||||
*/
|
||||
typedef int (*lua_KFunction) (lua_State *L, int status, lua_KContext ctx);
|
||||
|
||||
|
||||
/*
|
||||
** Type for functions that read/write blocks when loading/dumping Lua chunks
|
||||
*/
|
||||
typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz);
|
||||
|
||||
typedef int (*lua_Writer) (lua_State *L, const void *p, size_t sz, void *ud);
|
||||
|
||||
|
||||
/*
|
||||
** Type for memory-allocation functions
|
||||
*/
|
||||
typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
|
||||
|
||||
|
||||
/*
|
||||
** Type for warning functions
|
||||
*/
|
||||
typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** generic extra include file
|
||||
*/
|
||||
#if defined(LUA_USER_H)
|
||||
#include LUA_USER_H
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** RCS ident string
|
||||
*/
|
||||
extern const char lua_ident[];
|
||||
|
||||
|
||||
/*
|
||||
** state manipulation
|
||||
*/
|
||||
LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
|
||||
LUA_API void (lua_close) (lua_State *L);
|
||||
LUA_API lua_State *(lua_newthread) (lua_State *L);
|
||||
LUA_API int (lua_resetthread) (lua_State *L);
|
||||
|
||||
LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
|
||||
|
||||
|
||||
LUA_API lua_Number (lua_version) (lua_State *L);
|
||||
|
||||
|
||||
/*
|
||||
** basic stack manipulation
|
||||
*/
|
||||
LUA_API int (lua_absindex) (lua_State *L, int idx);
|
||||
LUA_API int (lua_gettop) (lua_State *L);
|
||||
LUA_API void (lua_settop) (lua_State *L, int idx);
|
||||
LUA_API void (lua_pushvalue) (lua_State *L, int idx);
|
||||
LUA_API void (lua_rotate) (lua_State *L, int idx, int n);
|
||||
LUA_API void (lua_copy) (lua_State *L, int fromidx, int toidx);
|
||||
LUA_API int (lua_checkstack) (lua_State *L, int n);
|
||||
|
||||
LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n);
|
||||
|
||||
|
||||
/*
|
||||
** access functions (stack -> C)
|
||||
*/
|
||||
|
||||
LUA_API int (lua_isnumber) (lua_State *L, int idx);
|
||||
LUA_API int (lua_isstring) (lua_State *L, int idx);
|
||||
LUA_API int (lua_iscfunction) (lua_State *L, int idx);
|
||||
LUA_API int (lua_isinteger) (lua_State *L, int idx);
|
||||
LUA_API int (lua_isuserdata) (lua_State *L, int idx);
|
||||
LUA_API int (lua_type) (lua_State *L, int idx);
|
||||
LUA_API const char *(lua_typename) (lua_State *L, int tp);
|
||||
|
||||
LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum);
|
||||
LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum);
|
||||
LUA_API int (lua_toboolean) (lua_State *L, int idx);
|
||||
LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len);
|
||||
LUA_API lua_Unsigned (lua_rawlen) (lua_State *L, int idx);
|
||||
LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx);
|
||||
LUA_API void *(lua_touserdata) (lua_State *L, int idx);
|
||||
LUA_API lua_State *(lua_tothread) (lua_State *L, int idx);
|
||||
LUA_API const void *(lua_topointer) (lua_State *L, int idx);
|
||||
|
||||
|
||||
/*
|
||||
** Comparison and arithmetic functions
|
||||
*/
|
||||
|
||||
#define LUA_OPADD 0 /* ORDER TM, ORDER OP */
|
||||
#define LUA_OPSUB 1
|
||||
#define LUA_OPMUL 2
|
||||
#define LUA_OPMOD 3
|
||||
#define LUA_OPPOW 4
|
||||
#define LUA_OPDIV 5
|
||||
#define LUA_OPIDIV 6
|
||||
#define LUA_OPBAND 7
|
||||
#define LUA_OPBOR 8
|
||||
#define LUA_OPBXOR 9
|
||||
#define LUA_OPSHL 10
|
||||
#define LUA_OPSHR 11
|
||||
#define LUA_OPUNM 12
|
||||
#define LUA_OPBNOT 13
|
||||
|
||||
LUA_API void (lua_arith) (lua_State *L, int op);
|
||||
|
||||
#define LUA_OPEQ 0
|
||||
#define LUA_OPLT 1
|
||||
#define LUA_OPLE 2
|
||||
|
||||
LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2);
|
||||
LUA_API int (lua_compare) (lua_State *L, int idx1, int idx2, int op);
|
||||
|
||||
|
||||
/*
|
||||
** push functions (C -> stack)
|
||||
*/
|
||||
LUA_API void (lua_pushnil) (lua_State *L);
|
||||
LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n);
|
||||
LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n);
|
||||
LUA_API const char *(lua_pushlstring) (lua_State *L, const char *s, size_t len);
|
||||
LUA_API const char *(lua_pushstring) (lua_State *L, const char *s);
|
||||
LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
|
||||
va_list argp);
|
||||
LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);
|
||||
LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
|
||||
LUA_API void (lua_pushboolean) (lua_State *L, int b);
|
||||
LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p);
|
||||
LUA_API int (lua_pushthread) (lua_State *L);
|
||||
|
||||
|
||||
/*
|
||||
** get functions (Lua -> stack)
|
||||
*/
|
||||
LUA_API int (lua_getglobal) (lua_State *L, const char *name);
|
||||
LUA_API int (lua_gettable) (lua_State *L, int idx);
|
||||
LUA_API int (lua_getfield) (lua_State *L, int idx, const char *k);
|
||||
LUA_API int (lua_geti) (lua_State *L, int idx, lua_Integer n);
|
||||
LUA_API int (lua_rawget) (lua_State *L, int idx);
|
||||
LUA_API int (lua_rawgeti) (lua_State *L, int idx, lua_Integer n);
|
||||
LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p);
|
||||
|
||||
LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
|
||||
LUA_API void *(lua_newuserdatauv) (lua_State *L, size_t sz, int nuvalue);
|
||||
LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
|
||||
LUA_API int (lua_getiuservalue) (lua_State *L, int idx, int n);
|
||||
|
||||
|
||||
/*
|
||||
** set functions (stack -> Lua)
|
||||
*/
|
||||
LUA_API void (lua_setglobal) (lua_State *L, const char *name);
|
||||
LUA_API void (lua_settable) (lua_State *L, int idx);
|
||||
LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k);
|
||||
LUA_API void (lua_seti) (lua_State *L, int idx, lua_Integer n);
|
||||
LUA_API void (lua_rawset) (lua_State *L, int idx);
|
||||
LUA_API void (lua_rawseti) (lua_State *L, int idx, lua_Integer n);
|
||||
LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p);
|
||||
LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
|
||||
LUA_API int (lua_setiuservalue) (lua_State *L, int idx, int n);
|
||||
|
||||
|
||||
/*
|
||||
** 'load' and 'call' functions (load and run Lua code)
|
||||
*/
|
||||
LUA_API void (lua_callk) (lua_State *L, int nargs, int nresults,
|
||||
lua_KContext ctx, lua_KFunction k);
|
||||
#define lua_call(L,n,r) lua_callk(L, (n), (r), 0, NULL)
|
||||
|
||||
LUA_API int (lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
|
||||
lua_KContext ctx, lua_KFunction k);
|
||||
#define lua_pcall(L,n,r,f) lua_pcallk(L, (n), (r), (f), 0, NULL)
|
||||
|
||||
LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
|
||||
const char *chunkname, const char *mode);
|
||||
|
||||
LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data, int strip);
|
||||
|
||||
|
||||
/*
|
||||
** coroutine functions
|
||||
*/
|
||||
LUA_API int (lua_yieldk) (lua_State *L, int nresults, lua_KContext ctx,
|
||||
lua_KFunction k);
|
||||
LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg,
|
||||
int *nres);
|
||||
LUA_API int (lua_status) (lua_State *L);
|
||||
LUA_API int (lua_isyieldable) (lua_State *L);
|
||||
|
||||
#define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL)
|
||||
|
||||
|
||||
/*
|
||||
** Warning-related functions
|
||||
*/
|
||||
LUA_API void (lua_setwarnf) (lua_State *L, lua_WarnFunction f, void *ud);
|
||||
LUA_API void (lua_warning) (lua_State *L, const char *msg, int tocont);
|
||||
|
||||
|
||||
/*
|
||||
** garbage-collection function and options
|
||||
*/
|
||||
|
||||
#define LUA_GCSTOP 0
|
||||
#define LUA_GCRESTART 1
|
||||
#define LUA_GCCOLLECT 2
|
||||
#define LUA_GCCOUNT 3
|
||||
#define LUA_GCCOUNTB 4
|
||||
#define LUA_GCSTEP 5
|
||||
#define LUA_GCSETPAUSE 6
|
||||
#define LUA_GCSETSTEPMUL 7
|
||||
#define LUA_GCISRUNNING 9
|
||||
#define LUA_GCGEN 10
|
||||
#define LUA_GCINC 11
|
||||
|
||||
LUA_API int (lua_gc) (lua_State *L, int what, ...);
|
||||
|
||||
|
||||
/*
|
||||
** miscellaneous functions
|
||||
*/
|
||||
|
||||
LUA_API int (lua_error) (lua_State *L);
|
||||
|
||||
LUA_API int (lua_next) (lua_State *L, int idx);
|
||||
|
||||
LUA_API void (lua_concat) (lua_State *L, int n);
|
||||
LUA_API void (lua_len) (lua_State *L, int idx);
|
||||
|
||||
LUA_API size_t (lua_stringtonumber) (lua_State *L, const char *s);
|
||||
|
||||
LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);
|
||||
LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
|
||||
|
||||
LUA_API void (lua_toclose) (lua_State *L, int idx);
|
||||
|
||||
|
||||
/*
|
||||
** {==============================================================
|
||||
** some useful macros
|
||||
** ===============================================================
|
||||
*/
|
||||
|
||||
#define lua_getextraspace(L) ((void *)((char *)(L) - LUA_EXTRASPACE))
|
||||
|
||||
#define lua_tonumber(L,i) lua_tonumberx(L,(i),NULL)
|
||||
#define lua_tointeger(L,i) lua_tointegerx(L,(i),NULL)
|
||||
|
||||
#define lua_pop(L,n) lua_settop(L, -(n)-1)
|
||||
|
||||
#define lua_newtable(L) lua_createtable(L, 0, 0)
|
||||
|
||||
#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
|
||||
|
||||
#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
|
||||
|
||||
#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION)
|
||||
#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE)
|
||||
#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
|
||||
#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL)
|
||||
#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN)
|
||||
#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD)
|
||||
#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE)
|
||||
#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0)
|
||||
|
||||
#define lua_pushliteral(L, s) lua_pushstring(L, "" s)
|
||||
|
||||
#define lua_pushglobaltable(L) \
|
||||
((void)lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS))
|
||||
|
||||
#define lua_tostring(L,i) lua_tolstring(L, (i), NULL)
|
||||
|
||||
|
||||
#define lua_insert(L,idx) lua_rotate(L, (idx), 1)
|
||||
|
||||
#define lua_remove(L,idx) (lua_rotate(L, (idx), -1), lua_pop(L, 1))
|
||||
|
||||
#define lua_replace(L,idx) (lua_copy(L, -1, (idx)), lua_pop(L, 1))
|
||||
|
||||
/* }============================================================== */
|
||||
|
||||
|
||||
/*
|
||||
** {==============================================================
|
||||
** compatibility macros
|
||||
** ===============================================================
|
||||
*/
|
||||
#if defined(LUA_COMPAT_APIINTCASTS)
|
||||
|
||||
#define lua_pushunsigned(L,n) lua_pushinteger(L, (lua_Integer)(n))
|
||||
#define lua_tounsignedx(L,i,is) ((lua_Unsigned)lua_tointegerx(L,i,is))
|
||||
#define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL)
|
||||
|
||||
#endif
|
||||
|
||||
#define lua_newuserdata(L,s) lua_newuserdatauv(L,s,1)
|
||||
#define lua_getuservalue(L,idx) lua_getiuservalue(L,idx,1)
|
||||
#define lua_setuservalue(L,idx) lua_setiuservalue(L,idx,1)
|
||||
|
||||
#define LUA_NUMTAGS LUA_NUMTYPES
|
||||
|
||||
/* }============================================================== */
|
||||
|
||||
/*
|
||||
** {======================================================================
|
||||
** Debug API
|
||||
** =======================================================================
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
** Event codes
|
||||
*/
|
||||
#define LUA_HOOKCALL 0
|
||||
#define LUA_HOOKRET 1
|
||||
#define LUA_HOOKLINE 2
|
||||
#define LUA_HOOKCOUNT 3
|
||||
#define LUA_HOOKTAILCALL 4
|
||||
|
||||
|
||||
/*
|
||||
** Event masks
|
||||
*/
|
||||
#define LUA_MASKCALL (1 << LUA_HOOKCALL)
|
||||
#define LUA_MASKRET (1 << LUA_HOOKRET)
|
||||
#define LUA_MASKLINE (1 << LUA_HOOKLINE)
|
||||
#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT)
|
||||
|
||||
typedef struct lua_Debug lua_Debug; /* activation record */
|
||||
|
||||
|
||||
/* Functions to be called by the debugger in specific events */
|
||||
typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
|
||||
|
||||
|
||||
LUA_API int (lua_getstack) (lua_State *L, int level, lua_Debug *ar);
|
||||
LUA_API int (lua_getinfo) (lua_State *L, const char *what, lua_Debug *ar);
|
||||
LUA_API const char *(lua_getlocal) (lua_State *L, const lua_Debug *ar, int n);
|
||||
LUA_API const char *(lua_setlocal) (lua_State *L, const lua_Debug *ar, int n);
|
||||
LUA_API const char *(lua_getupvalue) (lua_State *L, int funcindex, int n);
|
||||
LUA_API const char *(lua_setupvalue) (lua_State *L, int funcindex, int n);
|
||||
|
||||
LUA_API void *(lua_upvalueid) (lua_State *L, int fidx, int n);
|
||||
LUA_API void (lua_upvaluejoin) (lua_State *L, int fidx1, int n1,
|
||||
int fidx2, int n2);
|
||||
|
||||
LUA_API void (lua_sethook) (lua_State *L, lua_Hook func, int mask, int count);
|
||||
LUA_API lua_Hook (lua_gethook) (lua_State *L);
|
||||
LUA_API int (lua_gethookmask) (lua_State *L);
|
||||
LUA_API int (lua_gethookcount) (lua_State *L);
|
||||
|
||||
LUA_API int (lua_setcstacklimit) (lua_State *L, unsigned int limit);
|
||||
|
||||
struct lua_Debug {
|
||||
int event;
|
||||
const char *name; /* (n) */
|
||||
const char *namewhat; /* (n) 'global', 'local', 'field', 'method' */
|
||||
const char *what; /* (S) 'Lua', 'C', 'main', 'tail' */
|
||||
const char *source; /* (S) */
|
||||
size_t srclen; /* (S) */
|
||||
int currentline; /* (l) */
|
||||
int linedefined; /* (S) */
|
||||
int lastlinedefined; /* (S) */
|
||||
unsigned char nups; /* (u) number of upvalues */
|
||||
unsigned char nparams;/* (u) number of parameters */
|
||||
char isvararg; /* (u) */
|
||||
char istailcall; /* (t) */
|
||||
unsigned short ftransfer; /* (r) index of first value transferred */
|
||||
unsigned short ntransfer; /* (r) number of transferred values */
|
||||
char short_src[LUA_IDSIZE]; /* (S) */
|
||||
/* private part */
|
||||
struct CallInfo *i_ci; /* active function */
|
||||
};
|
||||
|
||||
/* }====================================================================== */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Copyright (C) 1994-2020 Lua.org, PUC-Rio.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#endif
|
||||
9
enginecustom/include/Lua/lua.hpp
Normal file
@@ -0,0 +1,9 @@
|
||||
// lua.hpp
|
||||
// Lua header files for C++
|
||||
// <<extern "C">> not supplied automatically because Lua also compiles as C++
|
||||
|
||||
extern "C" {
|
||||
#include "lua.h"
|
||||
#include "lualib.h"
|
||||
#include "lauxlib.h"
|
||||
}
|
||||
763
enginecustom/include/Lua/luaconf.h
Normal file
@@ -0,0 +1,763 @@
|
||||
/*
|
||||
** $Id: luaconf.h $
|
||||
** Configuration file for Lua
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
||||
|
||||
#ifndef luaconf_h
|
||||
#define luaconf_h
|
||||
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** General Configuration File for Lua
|
||||
**
|
||||
** Some definitions here can be changed externally, through the
|
||||
** compiler (e.g., with '-D' options). Those are protected by
|
||||
** '#if !defined' guards. However, several other definitions should
|
||||
** be changed directly here, either because they affect the Lua
|
||||
** ABI (by making the changes here, you ensure that all software
|
||||
** connected to Lua, such as C libraries, will be compiled with the
|
||||
** same configuration); or because they are seldom changed.
|
||||
**
|
||||
** Search for "@@" to find all configurable definitions.
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
** {====================================================================
|
||||
** System Configuration: macros to adapt (if needed) Lua to some
|
||||
** particular platform, for instance restricting it to C89.
|
||||
** =====================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ LUA_USE_C89 controls the use of non-ISO-C89 features.
|
||||
** Define it if you want Lua to avoid the use of a few C99 features
|
||||
** or Windows-specific features on Windows.
|
||||
*/
|
||||
/* #define LUA_USE_C89 */
|
||||
|
||||
|
||||
/*
|
||||
** By default, Lua on Windows use (some) specific Windows features
|
||||
*/
|
||||
#if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE)
|
||||
#define LUA_USE_WINDOWS /* enable goodies for regular Windows */
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(LUA_USE_WINDOWS)
|
||||
#define LUA_DL_DLL /* enable support for DLL */
|
||||
#define LUA_USE_C89 /* broadly, Windows is C89 */
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(LUA_USE_LINUX)
|
||||
#define LUA_USE_POSIX
|
||||
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(LUA_USE_MACOSX)
|
||||
#define LUA_USE_POSIX
|
||||
#define LUA_USE_DLOPEN /* MacOS does not need -ldl */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits.
|
||||
*/
|
||||
#define LUAI_IS32INT ((UINT_MAX >> 30) >= 3)
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** {==================================================================
|
||||
** Configuration for Number types.
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats.
|
||||
*/
|
||||
/* #define LUA_32BITS */
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for
|
||||
** C89 ('long' and 'double'); Windows always has '__int64', so it does
|
||||
** not need to use this case.
|
||||
*/
|
||||
#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS)
|
||||
#define LUA_C89_NUMBERS
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_INT_TYPE defines the type for Lua integers.
|
||||
@@ LUA_FLOAT_TYPE defines the type for Lua floats.
|
||||
** Lua should work fine with any mix of these options supported
|
||||
** by your C compiler. The usual configurations are 64-bit integers
|
||||
** and 'double' (the default), 32-bit integers and 'float' (for
|
||||
** restricted platforms), and 'long'/'double' (for C compilers not
|
||||
** compliant with C99, which may not have support for 'long long').
|
||||
*/
|
||||
|
||||
/* predefined options for LUA_INT_TYPE */
|
||||
#define LUA_INT_INT 1
|
||||
#define LUA_INT_LONG 2
|
||||
#define LUA_INT_LONGLONG 3
|
||||
|
||||
/* predefined options for LUA_FLOAT_TYPE */
|
||||
#define LUA_FLOAT_FLOAT 1
|
||||
#define LUA_FLOAT_DOUBLE 2
|
||||
#define LUA_FLOAT_LONGDOUBLE 3
|
||||
|
||||
#if defined(LUA_32BITS) /* { */
|
||||
/*
|
||||
** 32-bit integers and 'float'
|
||||
*/
|
||||
#if LUAI_IS32INT /* use 'int' if big enough */
|
||||
#define LUA_INT_TYPE LUA_INT_INT
|
||||
#else /* otherwise use 'long' */
|
||||
#define LUA_INT_TYPE LUA_INT_LONG
|
||||
#endif
|
||||
#define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT
|
||||
|
||||
#elif defined(LUA_C89_NUMBERS) /* }{ */
|
||||
/*
|
||||
** largest types available for C89 ('long' and 'double')
|
||||
*/
|
||||
#define LUA_INT_TYPE LUA_INT_LONG
|
||||
#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE
|
||||
|
||||
#endif /* } */
|
||||
|
||||
|
||||
/*
|
||||
** default configuration for 64-bit Lua ('long long' and 'double')
|
||||
*/
|
||||
#if !defined(LUA_INT_TYPE)
|
||||
#define LUA_INT_TYPE LUA_INT_LONGLONG
|
||||
#endif
|
||||
|
||||
#if !defined(LUA_FLOAT_TYPE)
|
||||
#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE
|
||||
#endif
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** {==================================================================
|
||||
** Configuration for Paths.
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
** LUA_PATH_SEP is the character that separates templates in a path.
|
||||
** LUA_PATH_MARK is the string that marks the substitution points in a
|
||||
** template.
|
||||
** LUA_EXEC_DIR in a Windows path is replaced by the executable's
|
||||
** directory.
|
||||
*/
|
||||
#define LUA_PATH_SEP ";"
|
||||
#define LUA_PATH_MARK "?"
|
||||
#define LUA_EXEC_DIR "!"
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
|
||||
** Lua libraries.
|
||||
@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
|
||||
** C libraries.
|
||||
** CHANGE them if your machine has a non-conventional directory
|
||||
** hierarchy or if you want to install your libraries in
|
||||
** non-conventional directories.
|
||||
*/
|
||||
|
||||
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
|
||||
#if defined(_WIN32) /* { */
|
||||
/*
|
||||
** In Windows, any exclamation mark ('!') in the path is replaced by the
|
||||
** path of the directory of the executable file of the current process.
|
||||
*/
|
||||
#define LUA_LDIR "!\\lua\\"
|
||||
#define LUA_CDIR "!\\"
|
||||
#define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\"
|
||||
|
||||
#if !defined(LUA_PATH_DEFAULT)
|
||||
#define LUA_PATH_DEFAULT \
|
||||
LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
|
||||
LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \
|
||||
LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \
|
||||
".\\?.lua;" ".\\?\\init.lua"
|
||||
#endif
|
||||
|
||||
#if !defined(LUA_CPATH_DEFAULT)
|
||||
#define LUA_CPATH_DEFAULT \
|
||||
LUA_CDIR"?.dll;" \
|
||||
LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \
|
||||
LUA_CDIR"loadall.dll;" ".\\?.dll;" \
|
||||
LUA_CDIR"?54.dll;" ".\\?54.dll"
|
||||
#endif
|
||||
|
||||
#else /* }{ */
|
||||
|
||||
#define LUA_ROOT "/usr/local/"
|
||||
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
|
||||
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
|
||||
|
||||
#if !defined(LUA_PATH_DEFAULT)
|
||||
#define LUA_PATH_DEFAULT \
|
||||
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
|
||||
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
|
||||
"./?.lua;" "./?/init.lua"
|
||||
#endif
|
||||
|
||||
#if !defined(LUA_CPATH_DEFAULT)
|
||||
#define LUA_CPATH_DEFAULT \
|
||||
LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so;" \
|
||||
LUA_CDIR"lib?54.so;" "./lib?54.so"
|
||||
#endif
|
||||
|
||||
#endif /* } */
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_DIRSEP is the directory separator (for submodules).
|
||||
** CHANGE it if your machine does not use "/" as the directory separator
|
||||
** and is not Windows. (On Windows Lua automatically uses "\".)
|
||||
*/
|
||||
#if !defined(LUA_DIRSEP)
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define LUA_DIRSEP "\\"
|
||||
#else
|
||||
#define LUA_DIRSEP "/"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
/*
|
||||
** {==================================================================
|
||||
** Marks for exported symbols in the C code
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ LUA_API is a mark for all core API functions.
|
||||
@@ LUALIB_API is a mark for all auxiliary library functions.
|
||||
@@ LUAMOD_API is a mark for all standard library opening functions.
|
||||
** CHANGE them if you need to define those functions in some special way.
|
||||
** For instance, if you want to create one Windows DLL with the core and
|
||||
** the libraries, you may want to use the following definition (define
|
||||
** LUA_BUILD_AS_DLL to get it).
|
||||
*/
|
||||
#if defined(LUA_BUILD_AS_DLL) /* { */
|
||||
|
||||
#if defined(LUA_CORE) || defined(LUA_LIB) /* { */
|
||||
#define LUA_API __declspec(dllexport)
|
||||
#else /* }{ */
|
||||
#define LUA_API __declspec(dllimport)
|
||||
#endif /* } */
|
||||
|
||||
#else /* }{ */
|
||||
|
||||
#define LUA_API extern
|
||||
|
||||
#endif /* } */
|
||||
|
||||
|
||||
/*
|
||||
** More often than not the libs go together with the core.
|
||||
*/
|
||||
#define LUALIB_API LUA_API
|
||||
#define LUAMOD_API LUA_API
|
||||
|
||||
|
||||
/*
|
||||
@@ LUAI_FUNC is a mark for all extern functions that are not to be
|
||||
** exported to outside modules.
|
||||
@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables,
|
||||
** none of which to be exported to outside modules (LUAI_DDEF for
|
||||
** definitions and LUAI_DDEC for declarations).
|
||||
** CHANGE them if you need to mark them in some special way. Elf/gcc
|
||||
** (versions 3.2 and later) mark them as "hidden" to optimize access
|
||||
** when Lua is compiled as a shared library. Not all elf targets support
|
||||
** this attribute. Unfortunately, gcc does not offer a way to check
|
||||
** whether the target offers that support, and those without support
|
||||
** give a warning about it. To avoid these warnings, change to the
|
||||
** default definition.
|
||||
*/
|
||||
#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
|
||||
defined(__ELF__) /* { */
|
||||
#define LUAI_FUNC __attribute__((visibility("internal"))) extern
|
||||
#else /* }{ */
|
||||
#define LUAI_FUNC extern
|
||||
#endif /* } */
|
||||
|
||||
#define LUAI_DDEC(dec) LUAI_FUNC dec
|
||||
#define LUAI_DDEF /* empty */
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
/*
|
||||
** {==================================================================
|
||||
** Compatibility with previous versions
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ LUA_COMPAT_5_3 controls other macros for compatibility with Lua 5.3.
|
||||
** You can define it to get all options, or change specific options
|
||||
** to fit your specific needs.
|
||||
*/
|
||||
#if defined(LUA_COMPAT_5_3) /* { */
|
||||
|
||||
/*
|
||||
@@ LUA_COMPAT_MATHLIB controls the presence of several deprecated
|
||||
** functions in the mathematical library.
|
||||
** (These functions were already officially removed in 5.3;
|
||||
** nevertheless they are still available here.)
|
||||
*/
|
||||
#define LUA_COMPAT_MATHLIB
|
||||
|
||||
/*
|
||||
@@ LUA_COMPAT_APIINTCASTS controls the presence of macros for
|
||||
** manipulating other integer types (lua_pushunsigned, lua_tounsigned,
|
||||
** luaL_checkint, luaL_checklong, etc.)
|
||||
** (These macros were also officially removed in 5.3, but they are still
|
||||
** available here.)
|
||||
*/
|
||||
#define LUA_COMPAT_APIINTCASTS
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_COMPAT_LT_LE controls the emulation of the '__le' metamethod
|
||||
** using '__lt'.
|
||||
*/
|
||||
#define LUA_COMPAT_LT_LE
|
||||
|
||||
|
||||
/*
|
||||
@@ The following macros supply trivial compatibility for some
|
||||
** changes in the API. The macros themselves document how to
|
||||
** change your code to avoid using them.
|
||||
** (Once more, these macros were officially removed in 5.3, but they are
|
||||
** still available here.)
|
||||
*/
|
||||
#define lua_strlen(L,i) lua_rawlen(L, (i))
|
||||
|
||||
#define lua_objlen(L,i) lua_rawlen(L, (i))
|
||||
|
||||
#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ)
|
||||
#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT)
|
||||
|
||||
#endif /* } */
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** {==================================================================
|
||||
** Configuration for Numbers.
|
||||
** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_*
|
||||
** satisfy your needs.
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ LUA_NUMBER is the floating-point type used by Lua.
|
||||
@@ LUAI_UACNUMBER is the result of a 'default argument promotion'
|
||||
@@ over a floating number.
|
||||
@@ l_floatatt(x) corrects float attribute 'x' to the proper float type
|
||||
** by prefixing it with one of FLT/DBL/LDBL.
|
||||
@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats.
|
||||
@@ LUA_NUMBER_FMT is the format for writing floats.
|
||||
@@ lua_number2str converts a float to a string.
|
||||
@@ l_mathop allows the addition of an 'l' or 'f' to all math operations.
|
||||
@@ l_floor takes the floor of a float.
|
||||
@@ lua_str2number converts a decimal numeral to a number.
|
||||
*/
|
||||
|
||||
|
||||
/* The following definitions are good for most cases here */
|
||||
|
||||
#define l_floor(x) (l_mathop(floor)(x))
|
||||
|
||||
#define lua_number2str(s,sz,n) \
|
||||
l_sprintf((s), sz, LUA_NUMBER_FMT, (LUAI_UACNUMBER)(n))
|
||||
|
||||
/*
|
||||
@@ lua_numbertointeger converts a float number with an integral value
|
||||
** to an integer, or returns 0 if float is not within the range of
|
||||
** a lua_Integer. (The range comparisons are tricky because of
|
||||
** rounding. The tests here assume a two-complement representation,
|
||||
** where MININTEGER always has an exact representation as a float;
|
||||
** MAXINTEGER may not have one, and therefore its conversion to float
|
||||
** may have an ill-defined value.)
|
||||
*/
|
||||
#define lua_numbertointeger(n,p) \
|
||||
((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \
|
||||
(n) < -(LUA_NUMBER)(LUA_MININTEGER) && \
|
||||
(*(p) = (LUA_INTEGER)(n), 1))
|
||||
|
||||
|
||||
/* now the variable definitions */
|
||||
|
||||
#if LUA_FLOAT_TYPE == LUA_FLOAT_FLOAT /* { single float */
|
||||
|
||||
#define LUA_NUMBER float
|
||||
|
||||
#define l_floatatt(n) (FLT_##n)
|
||||
|
||||
#define LUAI_UACNUMBER double
|
||||
|
||||
#define LUA_NUMBER_FRMLEN ""
|
||||
#define LUA_NUMBER_FMT "%.7g"
|
||||
|
||||
#define l_mathop(op) op##f
|
||||
|
||||
#define lua_str2number(s,p) strtof((s), (p))
|
||||
|
||||
|
||||
#elif LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE /* }{ long double */
|
||||
|
||||
#define LUA_NUMBER long double
|
||||
|
||||
#define l_floatatt(n) (LDBL_##n)
|
||||
|
||||
#define LUAI_UACNUMBER long double
|
||||
|
||||
#define LUA_NUMBER_FRMLEN "L"
|
||||
#define LUA_NUMBER_FMT "%.19Lg"
|
||||
|
||||
#define l_mathop(op) op##l
|
||||
|
||||
#define lua_str2number(s,p) strtold((s), (p))
|
||||
|
||||
#elif LUA_FLOAT_TYPE == LUA_FLOAT_DOUBLE /* }{ double */
|
||||
|
||||
#define LUA_NUMBER double
|
||||
|
||||
#define l_floatatt(n) (DBL_##n)
|
||||
|
||||
#define LUAI_UACNUMBER double
|
||||
|
||||
#define LUA_NUMBER_FRMLEN ""
|
||||
#define LUA_NUMBER_FMT "%.14g"
|
||||
|
||||
#define l_mathop(op) op
|
||||
|
||||
#define lua_str2number(s,p) strtod((s), (p))
|
||||
|
||||
#else /* }{ */
|
||||
|
||||
#error "numeric float type not defined"
|
||||
|
||||
#endif /* } */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_INTEGER is the integer type used by Lua.
|
||||
**
|
||||
@@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER.
|
||||
**
|
||||
@@ LUAI_UACINT is the result of a 'default argument promotion'
|
||||
@@ over a LUA_INTEGER.
|
||||
@@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers.
|
||||
@@ LUA_INTEGER_FMT is the format for writing integers.
|
||||
@@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER.
|
||||
@@ LUA_MININTEGER is the minimum value for a LUA_INTEGER.
|
||||
@@ LUA_MAXUNSIGNED is the maximum value for a LUA_UNSIGNED.
|
||||
@@ LUA_UNSIGNEDBITS is the number of bits in a LUA_UNSIGNED.
|
||||
@@ lua_integer2str converts an integer to a string.
|
||||
*/
|
||||
|
||||
|
||||
/* The following definitions are good for most cases here */
|
||||
|
||||
#define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d"
|
||||
|
||||
#define LUAI_UACINT LUA_INTEGER
|
||||
|
||||
#define lua_integer2str(s,sz,n) \
|
||||
l_sprintf((s), sz, LUA_INTEGER_FMT, (LUAI_UACINT)(n))
|
||||
|
||||
/*
|
||||
** use LUAI_UACINT here to avoid problems with promotions (which
|
||||
** can turn a comparison between unsigneds into a signed comparison)
|
||||
*/
|
||||
#define LUA_UNSIGNED unsigned LUAI_UACINT
|
||||
|
||||
|
||||
#define LUA_UNSIGNEDBITS (sizeof(LUA_UNSIGNED) * CHAR_BIT)
|
||||
|
||||
|
||||
/* now the variable definitions */
|
||||
|
||||
#if LUA_INT_TYPE == LUA_INT_INT /* { int */
|
||||
|
||||
#define LUA_INTEGER int
|
||||
#define LUA_INTEGER_FRMLEN ""
|
||||
|
||||
#define LUA_MAXINTEGER INT_MAX
|
||||
#define LUA_MININTEGER INT_MIN
|
||||
|
||||
#define LUA_MAXUNSIGNED UINT_MAX
|
||||
|
||||
#elif LUA_INT_TYPE == LUA_INT_LONG /* }{ long */
|
||||
|
||||
#define LUA_INTEGER long
|
||||
#define LUA_INTEGER_FRMLEN "l"
|
||||
|
||||
#define LUA_MAXINTEGER LONG_MAX
|
||||
#define LUA_MININTEGER LONG_MIN
|
||||
|
||||
#define LUA_MAXUNSIGNED ULONG_MAX
|
||||
|
||||
#elif LUA_INT_TYPE == LUA_INT_LONGLONG /* }{ long long */
|
||||
|
||||
/* use presence of macro LLONG_MAX as proxy for C99 compliance */
|
||||
#if defined(LLONG_MAX) /* { */
|
||||
/* use ISO C99 stuff */
|
||||
|
||||
#define LUA_INTEGER long long
|
||||
#define LUA_INTEGER_FRMLEN "ll"
|
||||
|
||||
#define LUA_MAXINTEGER LLONG_MAX
|
||||
#define LUA_MININTEGER LLONG_MIN
|
||||
|
||||
#define LUA_MAXUNSIGNED ULLONG_MAX
|
||||
|
||||
#elif defined(LUA_USE_WINDOWS) /* }{ */
|
||||
/* in Windows, can use specific Windows types */
|
||||
|
||||
#define LUA_INTEGER __int64
|
||||
#define LUA_INTEGER_FRMLEN "I64"
|
||||
|
||||
#define LUA_MAXINTEGER _I64_MAX
|
||||
#define LUA_MININTEGER _I64_MIN
|
||||
|
||||
#define LUA_MAXUNSIGNED _UI64_MAX
|
||||
|
||||
#else /* }{ */
|
||||
|
||||
#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
|
||||
or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"
|
||||
|
||||
#endif /* } */
|
||||
|
||||
#else /* }{ */
|
||||
|
||||
#error "numeric integer type not defined"
|
||||
|
||||
#endif /* } */
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
/*
|
||||
** {==================================================================
|
||||
** Dependencies with C99 and other C details
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ l_sprintf is equivalent to 'snprintf' or 'sprintf' in C89.
|
||||
** (All uses in Lua have only one format item.)
|
||||
*/
|
||||
#if !defined(LUA_USE_C89)
|
||||
#define l_sprintf(s,sz,f,i) snprintf(s,sz,f,i)
|
||||
#else
|
||||
#define l_sprintf(s,sz,f,i) ((void)(sz), sprintf(s,f,i))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ lua_strx2number converts a hexadecimal numeral to a number.
|
||||
** In C99, 'strtod' does that conversion. Otherwise, you can
|
||||
** leave 'lua_strx2number' undefined and Lua will provide its own
|
||||
** implementation.
|
||||
*/
|
||||
#if !defined(LUA_USE_C89)
|
||||
#define lua_strx2number(s,p) lua_str2number(s,p)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ lua_pointer2str converts a pointer to a readable string in a
|
||||
** non-specified way.
|
||||
*/
|
||||
#define lua_pointer2str(buff,sz,p) l_sprintf(buff,sz,"%p",p)
|
||||
|
||||
|
||||
/*
|
||||
@@ lua_number2strx converts a float to a hexadecimal numeral.
|
||||
** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that.
|
||||
** Otherwise, you can leave 'lua_number2strx' undefined and Lua will
|
||||
** provide its own implementation.
|
||||
*/
|
||||
#if !defined(LUA_USE_C89)
|
||||
#define lua_number2strx(L,b,sz,f,n) \
|
||||
((void)L, l_sprintf(b,sz,f,(LUAI_UACNUMBER)(n)))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** 'strtof' and 'opf' variants for math functions are not valid in
|
||||
** C89. Otherwise, the macro 'HUGE_VALF' is a good proxy for testing the
|
||||
** availability of these variants. ('math.h' is already included in
|
||||
** all files that use these macros.)
|
||||
*/
|
||||
#if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF))
|
||||
#undef l_mathop /* variants not available */
|
||||
#undef lua_str2number
|
||||
#define l_mathop(op) (lua_Number)op /* no variant */
|
||||
#define lua_str2number(s,p) ((lua_Number)strtod((s), (p)))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation
|
||||
** functions. It must be a numerical type; Lua will use 'intptr_t' if
|
||||
** available, otherwise it will use 'ptrdiff_t' (the nearest thing to
|
||||
** 'intptr_t' in C89)
|
||||
*/
|
||||
#define LUA_KCONTEXT ptrdiff_t
|
||||
|
||||
#if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \
|
||||
__STDC_VERSION__ >= 199901L
|
||||
#include <stdint.h>
|
||||
#if defined(INTPTR_MAX) /* even in C99 this type is optional */
|
||||
#undef LUA_KCONTEXT
|
||||
#define LUA_KCONTEXT intptr_t
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ lua_getlocaledecpoint gets the locale "radix character" (decimal point).
|
||||
** Change that if you do not want to use C locales. (Code using this
|
||||
** macro must include the header 'locale.h'.)
|
||||
*/
|
||||
#if !defined(lua_getlocaledecpoint)
|
||||
#define lua_getlocaledecpoint() (localeconv()->decimal_point[0])
|
||||
#endif
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
/*
|
||||
** {==================================================================
|
||||
** Language Variations
|
||||
** =====================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ LUA_NOCVTN2S/LUA_NOCVTS2N control how Lua performs some
|
||||
** coercions. Define LUA_NOCVTN2S to turn off automatic coercion from
|
||||
** numbers to strings. Define LUA_NOCVTS2N to turn off automatic
|
||||
** coercion from strings to numbers.
|
||||
*/
|
||||
/* #define LUA_NOCVTN2S */
|
||||
/* #define LUA_NOCVTS2N */
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_USE_APICHECK turns on several consistency checks on the C API.
|
||||
** Define it as a help when debugging C code.
|
||||
*/
|
||||
#if defined(LUA_USE_APICHECK)
|
||||
#include <assert.h>
|
||||
#define luai_apicheck(l,e) assert(e)
|
||||
#endif
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
/*
|
||||
** {==================================================================
|
||||
** Macros that affect the API and must be stable (that is, must be the
|
||||
** same when you compile Lua and when you compile code that links to
|
||||
** Lua).
|
||||
** =====================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ LUAI_MAXSTACK limits the size of the Lua stack.
|
||||
** CHANGE it if you need a different limit. This limit is arbitrary;
|
||||
** its only purpose is to stop Lua from consuming unlimited stack
|
||||
** space (and to reserve some numbers for pseudo-indices).
|
||||
** (It must fit into max(size_t)/32.)
|
||||
*/
|
||||
#if LUAI_IS32INT
|
||||
#define LUAI_MAXSTACK 1000000
|
||||
#else
|
||||
#define LUAI_MAXSTACK 15000
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_EXTRASPACE defines the size of a raw memory area associated with
|
||||
** a Lua state with very fast access.
|
||||
** CHANGE it if you need a different size.
|
||||
*/
|
||||
#define LUA_EXTRASPACE (sizeof(void *))
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_IDSIZE gives the maximum size for the description of the source
|
||||
@@ of a function in debug information.
|
||||
** CHANGE it if you want a different size.
|
||||
*/
|
||||
#define LUA_IDSIZE 60
|
||||
|
||||
|
||||
/*
|
||||
@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
|
||||
*/
|
||||
#define LUAL_BUFFERSIZE ((int)(16 * sizeof(void*) * sizeof(lua_Number)))
|
||||
|
||||
|
||||
/*
|
||||
@@ LUAI_MAXALIGN defines fields that, when used in a union, ensure
|
||||
** maximum alignment for the other items in that union.
|
||||
*/
|
||||
#define LUAI_MAXALIGN lua_Number n; double u; void *s; lua_Integer i; long l
|
||||
|
||||
/* }================================================================== */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* =================================================================== */
|
||||
|
||||
/*
|
||||
** Local configuration. You can use this space to add your redefinitions
|
||||
** without modifying the main part of the file.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
58
enginecustom/include/Lua/lualib.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
** $Id: lualib.h $
|
||||
** Lua standard libraries
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
||||
|
||||
#ifndef lualib_h
|
||||
#define lualib_h
|
||||
|
||||
#include "lua.h"
|
||||
|
||||
|
||||
/* version suffix for environment variable names */
|
||||
#define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR
|
||||
|
||||
|
||||
LUAMOD_API int (luaopen_base) (lua_State *L);
|
||||
|
||||
#define LUA_COLIBNAME "coroutine"
|
||||
LUAMOD_API int (luaopen_coroutine) (lua_State *L);
|
||||
|
||||
#define LUA_TABLIBNAME "table"
|
||||
LUAMOD_API int (luaopen_table) (lua_State *L);
|
||||
|
||||
#define LUA_IOLIBNAME "io"
|
||||
LUAMOD_API int (luaopen_io) (lua_State *L);
|
||||
|
||||
#define LUA_OSLIBNAME "os"
|
||||
LUAMOD_API int (luaopen_os) (lua_State *L);
|
||||
|
||||
#define LUA_STRLIBNAME "string"
|
||||
LUAMOD_API int (luaopen_string) (lua_State *L);
|
||||
|
||||
#define LUA_UTF8LIBNAME "utf8"
|
||||
LUAMOD_API int (luaopen_utf8) (lua_State *L);
|
||||
|
||||
#define LUA_MATHLIBNAME "math"
|
||||
LUAMOD_API int (luaopen_math) (lua_State *L);
|
||||
|
||||
#define LUA_DBLIBNAME "debug"
|
||||
LUAMOD_API int (luaopen_debug) (lua_State *L);
|
||||
|
||||
#define LUA_LOADLIBNAME "package"
|
||||
LUAMOD_API int (luaopen_package) (lua_State *L);
|
||||
|
||||
|
||||
/* open all previous libraries */
|
||||
LUALIB_API void (luaL_openlibs) (lua_State *L);
|
||||
|
||||
|
||||
|
||||
#if !defined(lua_assert)
|
||||
#define lua_assert(x) ((void)0)
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,6 @@
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
Texture2D shaderTexture : register(t0);
|
||||
SamplerState SampleType : register(s0);
|
||||
|
||||
//////////////
|
||||
// TYPEDEFS //
|
||||
@@ -10,7 +8,6 @@ SamplerState SampleType : register(s0);
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -14,13 +14,11 @@ cbuffer MatrixBuffer
|
||||
struct VertexInputType
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
@@ -40,8 +38,5 @@ PixelInputType DepthVertexShader(VertexInputType input)
|
||||
output.position = mul(output.position, viewMatrix);
|
||||
output.position = mul(output.position, projectionMatrix);
|
||||
|
||||
// Store the texture coordinates for the pixel shader.
|
||||
output.tex = input.tex;
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
@@ -34,14 +35,14 @@ public:
|
||||
|
||||
bool initialize(ID3D11Device*, HWND);
|
||||
void shutdown();
|
||||
bool render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*);
|
||||
bool render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX);
|
||||
|
||||
private:
|
||||
bool initialize_shader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void shutdown_shader();
|
||||
void output_shader_error_message(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool set_shader_parameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*);
|
||||
bool set_shader_parameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX);
|
||||
void render_shader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
@@ -49,7 +50,6 @@ private:
|
||||
ID3D11PixelShader* pixel_shader_;
|
||||
ID3D11InputLayout* layout_;
|
||||
ID3D11Buffer* matrix_buffer_;
|
||||
ID3D11SamplerState* sample_state_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ constexpr int num_lights = 4;
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <d3d11.h>
|
||||
#include <DirectXMath.h>
|
||||
#include <string>
|
||||
#include "macro.h"
|
||||
|
||||
|
||||
class master_shader
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "skybox_shader_class.h"
|
||||
#include "sunlight_shader_class.h"
|
||||
#include "depth_shader_class.h"
|
||||
#include "macro.h"
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
@@ -53,8 +54,7 @@ public:
|
||||
int indexCount,
|
||||
XMMATRIX worldMatrix,
|
||||
XMMATRIX viewMatrix,
|
||||
XMMATRIX projectionMatrix,
|
||||
ID3D11ShaderResourceView* texture
|
||||
XMMATRIX projectionMatrix
|
||||
);
|
||||
|
||||
private:
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "camera_class.h"
|
||||
#include "light_class.h"
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
#include "Fmod/core/inc/fmod.hpp"
|
||||
|
||||
#include "bitmap_class.h"
|
||||
@@ -61,8 +63,6 @@
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
constexpr bool full_screen = false;
|
||||
constexpr float screen_depth = 1000.0f;
|
||||
constexpr float screen_near = 0.3f;
|
||||
|
||||
static std::map<std::string, std::shared_ptr<model_class>> g_model_cache;
|
||||
|
||||
@@ -381,7 +381,7 @@ public:
|
||||
* Construct the frustum for culling.
|
||||
* This function will calculate the frustum based on the current camera view and projection matrices.
|
||||
*/
|
||||
void construct_frustum();
|
||||
void construct_frustum(frustum& frustum, float screen_depth, XMMATRIX projectionMatrix, XMMATRIX viewMatrix);
|
||||
|
||||
/**
|
||||
* Get the number of objects rendered in the current frame.
|
||||
@@ -450,6 +450,50 @@ public:
|
||||
* @return A reference to the global model cache as a map of strings to shared pointers of model_class.
|
||||
*/
|
||||
std::map<std::string, std::shared_ptr<model_class>>& get_model_cache() { return g_model_cache; }
|
||||
|
||||
/**
|
||||
* Get the sky entity ID.
|
||||
* @return The sky entity ID as an integer.
|
||||
*/
|
||||
int get_sky_id() const { return sky_id_; }
|
||||
|
||||
/** Get the Sky entity as a shared pointer.
|
||||
* @return A shared pointer to the sky entity.
|
||||
*/
|
||||
std::shared_ptr<ecs::Entity> get_sky_entity_shared_ptr() const { return sky_entity_; }
|
||||
|
||||
/**
|
||||
* Update the screen depth.
|
||||
*/
|
||||
bool update_screen_depth(float new_screen_depth);
|
||||
|
||||
/**
|
||||
* Update the screen near.
|
||||
*/
|
||||
bool update_screen_near(float new_screen_near);
|
||||
|
||||
/**
|
||||
* Get the screen depth.
|
||||
* @return The screen depth as a float.
|
||||
*/
|
||||
float get_screen_depth() const { return screen_depth; }
|
||||
/**
|
||||
* Get the screen near.
|
||||
* @return The screen near as a float.
|
||||
*/
|
||||
float get_screen_near() const { return screen_near; }
|
||||
|
||||
/**
|
||||
* Get the target fps for the application.
|
||||
* @return The target fps as an integer.
|
||||
*/
|
||||
int get_target_fps() const { return target_fps_; };
|
||||
/**
|
||||
* Set the target fps for the application.
|
||||
* @param target_fps The new target fps as an integer.
|
||||
*/
|
||||
void set_target_fps(int target_fps) { target_fps_ = target_fps; };
|
||||
|
||||
|
||||
private:
|
||||
/**
|
||||
@@ -500,6 +544,13 @@ private:
|
||||
* @return True if the refraction was rendered to the texture successfully, false otherwise.
|
||||
*/
|
||||
bool render_refraction_to_texture();
|
||||
|
||||
/**
|
||||
* Render the shadow map texture for the scene.
|
||||
* @return True if the shadow map was rendered successfully, false otherwise.
|
||||
*/
|
||||
bool render_shadow_map();
|
||||
|
||||
/**
|
||||
* Render the reflection of the scene to a texture.
|
||||
* This function will render the reflection effects, such as water or mirrors, to a texture.
|
||||
@@ -530,6 +581,16 @@ private:
|
||||
* The thread function for culling objects in the scene.
|
||||
*/
|
||||
void culling_thread_function();
|
||||
|
||||
/**
|
||||
* A thread function to handle culling of objects no visible by sun light.
|
||||
*/
|
||||
void sun_culling_thread_function();
|
||||
|
||||
/**
|
||||
* Create the skysphere entity.
|
||||
*/
|
||||
bool create_skysphere();
|
||||
|
||||
public :
|
||||
std::vector<ID3D11ShaderResourceView*> textures;
|
||||
@@ -540,6 +601,11 @@ private :
|
||||
std::thread culling_thread_;
|
||||
std::atomic<bool> culling_active_;
|
||||
std::mutex objects_mutex_;
|
||||
|
||||
// Thread de culling pour les shadows
|
||||
std::thread culling_sun_thread_;
|
||||
std::atomic<bool> culling_sun_active_;
|
||||
std::mutex objects_sun_mutex_;
|
||||
|
||||
std::mutex terrain_mutex_;
|
||||
std::vector<std::tuple<float, float, float, std::string, int>> terrain_generation_data_;
|
||||
@@ -559,12 +625,15 @@ private :
|
||||
HWND hwnd_;
|
||||
bool windowed_;
|
||||
|
||||
float screen_depth = 1000.0f;
|
||||
float screen_near = 0.3f;
|
||||
|
||||
// ------------------------------------- //
|
||||
// ------------- RENDERING ------------- //
|
||||
// ------------------------------------- //
|
||||
|
||||
XMMATRIX base_view_matrix_;
|
||||
render_texture_class* render_texture_, * refraction_texture_, * reflection_texture_;
|
||||
render_texture_class* render_texture_, * refraction_texture_, * reflection_texture_,* shadow_texture_ ;
|
||||
render_texture_class* scene_texture_;
|
||||
display_plane_class* display_plane_;
|
||||
int screen_width_, screen_height_;
|
||||
@@ -587,7 +656,9 @@ private :
|
||||
float speed_ = 0.1f; // speed for the demo spinning object
|
||||
std::vector<object*> imported_object_;
|
||||
int object_id_ = 0;
|
||||
std::vector<object*> skybox_;
|
||||
|
||||
int sky_id_ = -1;
|
||||
std::shared_ptr<ecs::Entity> sky_entity_;
|
||||
|
||||
// ----------------------------------- //
|
||||
// ------------- LIGHTS -------------- //
|
||||
@@ -647,12 +718,14 @@ private :
|
||||
ID3D11ShaderResourceView* back_buffer_srv_;
|
||||
|
||||
stats* stats_;
|
||||
int target_fps_ = 60;
|
||||
|
||||
// ------------------------------------------------- //
|
||||
// ------------------- Culling --------------------- //
|
||||
// ------------------------------------------------- //
|
||||
|
||||
frustum frustum_culling_;
|
||||
frustum sun_culling_;
|
||||
int render_count_;
|
||||
float frustum_culling_tolerance_ = 5.f;
|
||||
|
||||
@@ -662,6 +735,14 @@ private :
|
||||
|
||||
input inputs_;
|
||||
bool tab_was_pressed_;
|
||||
std::shared_ptr<CameraInput> camera_input_;
|
||||
|
||||
// ------------------------------------------------- //
|
||||
// ------------------- SOUND ----------------------- //
|
||||
// ------------------------------------------------- //
|
||||
|
||||
// shared pointer to the FMOD system
|
||||
FMOD::System* sound_system_;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -13,6 +13,7 @@ using namespace DirectX;
|
||||
// MY CLASS INCLUDES //
|
||||
///////////////////////
|
||||
#include "texture_class.h"
|
||||
#include "macro.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include <directxmath.h>
|
||||
|
||||
#include "input_class.h"
|
||||
#include "macro.h"
|
||||
using namespace DirectX;
|
||||
|
||||
|
||||
@@ -69,6 +72,10 @@ public:
|
||||
*/
|
||||
XMMATRIX get_view_matrix(XMMATRIX& view_matrix) const;
|
||||
|
||||
/**
|
||||
* Update the camera's view matrix without
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Renders the reflection of the scene from the camera's perspective.
|
||||
*
|
||||
@@ -82,6 +89,12 @@ public:
|
||||
*/
|
||||
void get_reflection_view_matrix(XMMATRIX&) const;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Calculates and returns the forward direction vector of the camera based on its rotation.
|
||||
* This vector points in the direction the camera is facing.
|
||||
* @return A normalized 3D vector representing the camera's forward direction.
|
||||
*/
|
||||
XMFLOAT3 get_forward() const {
|
||||
float pitch = XMConvertToRadians(rotation_x_);
|
||||
float yaw = XMConvertToRadians(rotation_y_);
|
||||
@@ -93,7 +106,11 @@ public:
|
||||
return forwardVec;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Calculates and returns the right direction vector of the camera based on its rotation.
|
||||
* This vector points to the right side of the camera.
|
||||
* @return A normalized 3D vector representing the camera's right direction.
|
||||
*/
|
||||
XMFLOAT3 get_up() const {
|
||||
// Construire matrice rotation <20> partir des angles
|
||||
XMMATRIX rot = XMMatrixRotationRollPitchYaw(
|
||||
@@ -110,7 +127,40 @@ public:
|
||||
return upF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move the camera
|
||||
* @param std::vector<bool> inputs : forward, backward, left, right, up, down, scrollUp, scrollDown, rightClick
|
||||
* @param float deltaTime : time since last frame
|
||||
* @return void
|
||||
*/
|
||||
void move(float deltatime, float delta_x, float delta_y);
|
||||
|
||||
/**
|
||||
* Rotate the camera
|
||||
* @param float delta_x : mouse delta x
|
||||
* @param float delta_y : mouse delta y
|
||||
* @return void
|
||||
*/
|
||||
void rotate(float delta_x, float delta_y);
|
||||
|
||||
/**
|
||||
* Update the camera input states based on the provided input_class instance.
|
||||
* This method updates the internal state of the camera's input handling.
|
||||
* @param imputs A pointer to an input_class instance containing the current input states.
|
||||
*/
|
||||
void update_camera_inputs_states(input_class* imputs);
|
||||
|
||||
/**
|
||||
* Set the camera inputs structure.
|
||||
* @param inputs A shared pointer to a CameraInput structure containing the input states.
|
||||
*/
|
||||
void set_camera_inputs(std::shared_ptr<CameraInput> inputs) { inputs_ = inputs; }
|
||||
|
||||
/**
|
||||
* Get the camera inputs structure.
|
||||
* @return A shared pointer to the CameraInput structure containing the input states.
|
||||
*/
|
||||
std::shared_ptr<CameraInput> get_camera_inputs() { return inputs_; }
|
||||
|
||||
private:
|
||||
float position_x_, position_y_, position_z_;
|
||||
@@ -118,6 +168,9 @@ private:
|
||||
XMMATRIX view_matrix_;
|
||||
XMMATRIX reflection_view_matrix_;
|
||||
|
||||
float camera_speed_;
|
||||
std::shared_ptr<CameraInput> inputs_;
|
||||
float camera_sensitivity_ = 0.1f;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "font_shader_class.h"
|
||||
#include "font_class.h"
|
||||
#include "text_class.h"
|
||||
#include "macro.h"
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
@@ -74,20 +75,20 @@ public:
|
||||
*
|
||||
* @return Pointer to the ID3D11Device interface.
|
||||
*/
|
||||
ID3D11Device* get_device();
|
||||
ID3D11Device* get_device() const { return device_; };
|
||||
/**
|
||||
* @brief Gets the Direct3D device context.
|
||||
*
|
||||
* @return Pointer to the ID3D11DeviceContext interface.
|
||||
*/
|
||||
ID3D11DeviceContext* get_device_context();
|
||||
ID3D11DeviceContext* get_device_context() const { return device_context_; };
|
||||
//XMMATRIX get_projection_matrix(XMMATRIX& projectionMatrix);
|
||||
IDXGISwapChain* swap_chain;
|
||||
/**
|
||||
* Get the swap chain associated with the Direct3D device.
|
||||
* @return Pointer to the IDXGISwapChain interface.
|
||||
*/
|
||||
IDXGISwapChain* get_swap_chain();
|
||||
IDXGISwapChain* get_swap_chain() const { return swap_chain; };
|
||||
/**
|
||||
* Resizes the swap chain to the specified width and height.
|
||||
* @param width New width of the swap chain.
|
||||
@@ -99,7 +100,7 @@ public:
|
||||
*
|
||||
* @param vsync True to enable vertical sync, false to disable.
|
||||
*/
|
||||
void set_vsync(bool vsync);
|
||||
void set_vsync(bool vsync) { vsync_enabled_ = vsync; };
|
||||
|
||||
/**
|
||||
* Get the projection matrix.
|
||||
@@ -134,7 +135,10 @@ public:
|
||||
/**
|
||||
* Resets the viewport to the default settings.
|
||||
*/
|
||||
void reset_viewport();
|
||||
void reset_viewport() const
|
||||
{
|
||||
device_context_->RSSetViewports(1, &viewport_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Release all Direct3D resources.
|
||||
@@ -150,11 +154,17 @@ public:
|
||||
/**
|
||||
* Turn on the Z-buffer to enable depth.
|
||||
*/
|
||||
void turn_z_buffer_on();
|
||||
void turn_z_buffer_on()const
|
||||
{
|
||||
device_context_->OMSetDepthStencilState(depth_stencil_state_, 1);
|
||||
}
|
||||
/**
|
||||
* Turn off the Z-buffer to disable depth.
|
||||
*/
|
||||
void turn_z_buffer_off();
|
||||
void turn_z_buffer_off() const
|
||||
{
|
||||
device_context_->OMSetDepthStencilState(depth_disabled_stencil_state_, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn on alpha blending for transparency effects.
|
||||
@@ -165,6 +175,16 @@ public:
|
||||
*/
|
||||
void disable_alpha_blending();
|
||||
|
||||
/**
|
||||
* Set new projection parameters.
|
||||
* @param width The new width for the projection matrix.
|
||||
* @param height The new height for the projection matrix.
|
||||
* @param screenDepth The new screen depth.
|
||||
* @param screenNear The new near clipping plane distance.
|
||||
* @return True if the projection parameters were set successfully, false otherwise.
|
||||
*/
|
||||
bool set_projection_params(int width,int height,float screenDepth, float screenNear);
|
||||
|
||||
private:
|
||||
bool vsync_enabled_;
|
||||
int video_card_memory_;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// MY CLASS INCLUDES //
|
||||
///////////////////////
|
||||
#include "d_3d_class.h"
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: display_plane_class
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "component.h"
|
||||
#include "components/audio_component.h"
|
||||
#include "components/identity_component.h"
|
||||
#include "components/lua_script_component.h"
|
||||
#include "components/render_component.h"
|
||||
#include "components/transform_component.h"
|
||||
#include "components/physics_component.h"
|
||||
@@ -52,5 +53,6 @@ inline void EnregistrerTousLesComposants() {
|
||||
factory.EnregistrerComposant<ecs::IdentityComponent>("IdentityComponent");
|
||||
factory.EnregistrerComposant<ecs::RenderComponent>("RenderComponent");
|
||||
factory.EnregistrerComposant<ecs::AudioComponent>("AudioComponent");
|
||||
factory.EnregistrerComposant<ecs::LuaScriptComponent>("LuaScriptComponent");
|
||||
// Ajouter d'autres composants ici
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <imgui.h>
|
||||
#include "entity.h"
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
/**
|
||||
* namespace for the Entity-Component-System (ECS)
|
||||
*/
|
||||
@@ -30,6 +32,11 @@ public:
|
||||
*/
|
||||
virtual void Initialize() {}
|
||||
|
||||
/**
|
||||
*Virtual function to shutdown the component.
|
||||
*/
|
||||
virtual void Shutdown() {}
|
||||
|
||||
/**
|
||||
* Virtual function to update the component.
|
||||
* @param deltaTime Time since the last update.
|
||||
@@ -48,7 +55,7 @@ public:
|
||||
* @param data The string data to deserialize from.
|
||||
* @return True if deserialization was successful, otherwise false.
|
||||
*/
|
||||
virtual bool Deserialize(const std::string& data) { return false;}
|
||||
virtual bool Deserialize(const std::string& data) { R_FALSE}
|
||||
|
||||
/**
|
||||
* Virtual function to render ImGui controls for the component.
|
||||
|
||||
@@ -16,50 +16,78 @@
|
||||
namespace ecs {
|
||||
class AudioComponent : public Component {
|
||||
public:
|
||||
AudioComponent() : m_system(nullptr), m_sound(nullptr), m_channel(nullptr) {}
|
||||
AudioComponent() : m_sound(nullptr), m_channel(nullptr) {}
|
||||
~AudioComponent() override {
|
||||
// stop the sound if it's playing
|
||||
if (m_channel) {
|
||||
bool isPlaying = false;
|
||||
m_channel->isPlaying(&isPlaying);
|
||||
if (isPlaying) {
|
||||
m_channel->stop();
|
||||
}
|
||||
}
|
||||
if (m_sound) m_sound->release();
|
||||
// Ne pas lib<69>rer m_system ici car il peut <20>tre partag<61>
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown the audio component by releasing the sound and channel.
|
||||
* This method is called when the component is removed from an entity or when the entity is destroyed.
|
||||
*/
|
||||
void Shutdown() override {
|
||||
if (m_channel) {
|
||||
bool isPlaying = false;
|
||||
m_channel->isPlaying(&isPlaying);
|
||||
if (isPlaying) {
|
||||
m_channel->stop();
|
||||
}
|
||||
m_channel = nullptr;
|
||||
}
|
||||
if (m_sound) {
|
||||
m_sound->release();
|
||||
m_sound = nullptr;
|
||||
}
|
||||
m_system = nullptr; // Ne pas lib<69>rer m_system ici car il peut <20>tre partag<61>
|
||||
m_camera = nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the audio component by setting up the FMOD system and camera from the parent entity.
|
||||
* This method is called when the component is added to an entity.
|
||||
*/
|
||||
void Initialize() override
|
||||
{
|
||||
// create FMOD system if not already created
|
||||
if (!m_system)
|
||||
{
|
||||
FMOD_RESULT result = FMOD::System_Create(&m_system);
|
||||
if (result != FMOD_OK) {
|
||||
m_lastError = "<EFBFBD>chec de la cr<63>ation du syst<73>me FMOD: " + std::to_string(result);
|
||||
return;
|
||||
}
|
||||
|
||||
result = m_system->init(512, FMOD_INIT_NORMAL | FMOD_INIT_3D_RIGHTHANDED, nullptr);
|
||||
if (result != FMOD_OK) {
|
||||
m_lastError = "<EFBFBD>chec de l'initialisation du syst<73>me FMOD: " + std::to_string(result);
|
||||
m_system->release();
|
||||
m_system = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
auto parent = GetParent();
|
||||
if (parent && parent->GetCamera())
|
||||
{
|
||||
SetCamera(parent->GetCamera());
|
||||
SetSoundSystem(parent->GetSoundSystem());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load an audio file from the specified path.
|
||||
* If the FMOD system is not initialized, it will be initialized first.
|
||||
* Creates a sound object with appropriate settings based on the component's properties.
|
||||
* @param path The file path to load the audio from.
|
||||
* @return True if the audio file was loaded successfully, otherwise false.
|
||||
*/
|
||||
bool Load(const std::string& path) {
|
||||
if (!m_system) {
|
||||
Initialize();
|
||||
if (!m_system) return false;
|
||||
if (!m_system) R_FALSE
|
||||
}
|
||||
|
||||
LOG_INFO("Loading audio file: " + path);
|
||||
|
||||
m_soundPath = path;
|
||||
|
||||
if (!std::filesystem::exists(path)) {
|
||||
m_lastError = "Fichier non trouv<75>: " + path;
|
||||
return false;
|
||||
LOG_ERROR(m_lastError);
|
||||
R_FALSE
|
||||
}
|
||||
|
||||
if (m_sound) {
|
||||
@@ -81,12 +109,18 @@ public:
|
||||
if (result != FMOD_OK) {
|
||||
m_lastError = "<EFBFBD>chec du chargement du son: " + std::to_string(result) +
|
||||
" (chemin: " + absolutePath.string() + ")";
|
||||
return false;
|
||||
LOG_ERROR(m_lastError);
|
||||
R_FALSE
|
||||
}
|
||||
|
||||
return true;
|
||||
R_TRUE
|
||||
}
|
||||
|
||||
/**
|
||||
* Play the loaded audio sound.
|
||||
* If the sound is already playing, it will be stopped and restarted.
|
||||
* The channel properties such as volume, pan, pitch, mute, priority, and paused state are applied.
|
||||
*/
|
||||
void Play() {
|
||||
if (m_system && m_sound) {
|
||||
bool isPlaying = false;
|
||||
@@ -111,6 +145,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pause the currently playing audio sound.
|
||||
* If the sound is not playing, this method has no effect.
|
||||
*/
|
||||
void Pause() {
|
||||
if (m_channel) {
|
||||
m_paused = true;
|
||||
@@ -118,6 +156,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resume the paused audio sound.
|
||||
* If the sound is not paused, this method has no effect.
|
||||
*/
|
||||
void Resume() {
|
||||
if (m_channel) {
|
||||
m_paused = false;
|
||||
@@ -125,13 +167,26 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the currently playing audio sound.
|
||||
* If the sound is not playing, this method has no effect.
|
||||
*/
|
||||
void Stop() {
|
||||
if (m_channel)
|
||||
m_channel->stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the camera to be used for 3D audio spatialization.
|
||||
* This camera is used to update the listener attributes in FMOD.
|
||||
* @param camera Pointer to the camera_class instance.
|
||||
*/
|
||||
void SetCamera(camera_class* camera) {m_camera = camera; }
|
||||
|
||||
/**
|
||||
* Update the audio component.
|
||||
* @param deltaTime Time since the last update.
|
||||
*/
|
||||
void Update(float deltaTime) override {
|
||||
if (!m_spatialized) return;
|
||||
|
||||
@@ -186,7 +241,12 @@ public:
|
||||
m_system->update();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ImGui Widget to control the audio component properties.
|
||||
* Allows loading/changing/removing audio files, and adjusting properties like volume, pan, pitch, looping, spatialization, etc.
|
||||
* Displays error messages if loading fails.
|
||||
* This method is called during the ImGui rendering phase.
|
||||
*/
|
||||
void OnImGuiRender() override {
|
||||
if (!m_sound) {
|
||||
ImGui::Text("No audio file loaded");
|
||||
@@ -238,6 +298,7 @@ public:
|
||||
|
||||
if (!m_lastError.empty()) {
|
||||
ImGui::TextColored(ImVec4(1, 0, 0, 1), "Error: %s", m_lastError.c_str());
|
||||
LOG_ERROR(m_lastError);
|
||||
}
|
||||
} else {
|
||||
ImGui::Text("Loaded: %s", m_soundPath.c_str());
|
||||
@@ -392,7 +453,80 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the FMOD system to be used by this audio component.
|
||||
* This method allows sharing the FMOD system instance across multiple audio components.
|
||||
* @param system Pointer to the FMOD::System instance.
|
||||
*/
|
||||
void SetSoundSystem(FMOD::System* system) {
|
||||
m_system = system;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize the audio component's state to a string.
|
||||
* This includes properties like sound path, volume, pan, pitch, looping, muted, paused, priority, spatialization, and use of velocity.
|
||||
* This method is useful for saving the component's state or debugging.
|
||||
* @return A string representation of the audio component's state.
|
||||
*/
|
||||
std::string Serialize() const override {
|
||||
std::stringstream ss;
|
||||
ss << "AudioComponent:"
|
||||
<< m_soundPath << ";"
|
||||
<< m_volume << ":"
|
||||
<< m_pan << ":"
|
||||
<< m_pitch << ":"
|
||||
<< m_looping << ":"
|
||||
<< m_muted << ":"
|
||||
<< m_paused << ":"
|
||||
<< m_priority << ":"
|
||||
<< m_spatialized << ":"
|
||||
<< m_use_velocity;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserialize the audio component's state from a string.
|
||||
* This method parses the string and sets the component's properties accordingly.
|
||||
* If the sound path is valid, it attempts to load the audio file.
|
||||
* @param data The string representation of the audio component's state.
|
||||
* @return True if deserialization was successful, otherwise false.
|
||||
*/
|
||||
bool Deserialize(const std::string& data) override {
|
||||
std::stringstream ss(data);
|
||||
std::string type;
|
||||
std::getline(ss, type, ':');
|
||||
if (type != "AudioComponent") R_FALSE
|
||||
|
||||
std::string s_volume, s_pan, s_pitch, s_looping, s_muted, s_paused, s_priority, s_spatialized, s_use_velocity;
|
||||
|
||||
std::getline(ss, m_soundPath, ';');
|
||||
std::getline(ss, s_volume, ':');
|
||||
std::getline(ss, s_pan, ':');
|
||||
std::getline(ss, s_pitch, ':');
|
||||
std::getline(ss, s_looping, ':');
|
||||
std::getline(ss, s_muted, ':');
|
||||
std::getline(ss, s_paused, ':');
|
||||
std::getline(ss, s_priority, ':');
|
||||
std::getline(ss, s_spatialized, ':');
|
||||
std::getline(ss, s_use_velocity, ':');
|
||||
|
||||
m_volume = std::stof(s_volume);
|
||||
m_pan = std::stof(s_pan);
|
||||
m_pitch = std::stof(s_pitch);
|
||||
m_looping = (s_looping == "1");
|
||||
m_muted = (s_muted == "1");
|
||||
m_paused = (s_paused == "1");
|
||||
m_priority = std::stoi(s_priority);
|
||||
m_spatialized = (s_spatialized == "1");
|
||||
m_use_velocity = (s_use_velocity == "1");
|
||||
|
||||
// Recharger le son si le chemin existe (optional: ou laisser le chargement manuel)
|
||||
if (!m_soundPath.empty() && m_system) {
|
||||
Load(m_soundPath);
|
||||
}
|
||||
|
||||
R_TRUE
|
||||
}
|
||||
|
||||
private:
|
||||
FMOD::System* m_system;
|
||||
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
std::string type;
|
||||
std::getline(ss, type, ':');
|
||||
|
||||
if (type != "IdentityComponent") return false;
|
||||
if (type != "IdentityComponent") R_FALSE
|
||||
|
||||
std::string token, name, objectTypeStr;
|
||||
int id;
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
SetId(id);
|
||||
SetName(name);
|
||||
SetType(StringToObjectType(objectTypeStr));
|
||||
return true;
|
||||
R_TRUE
|
||||
}
|
||||
|
||||
void OnImGuiRender() override {
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
#pragma once
|
||||
#include "../component.h"
|
||||
#include "Lua/lua.hpp"
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <imgui.h>
|
||||
#include <filesystem>
|
||||
|
||||
namespace ecs {
|
||||
|
||||
class LuaScriptComponent : public Component {
|
||||
public:
|
||||
LuaScriptComponent() : scriptCreated(false), popupOpen(true) {
|
||||
L = luaL_newstate();
|
||||
luaL_openlibs(L);
|
||||
}
|
||||
|
||||
~LuaScriptComponent() override {
|
||||
if (L) {
|
||||
lua_close(L);
|
||||
L = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void OnImGuiRender() override {
|
||||
if (popupOpen) {
|
||||
ImGui::OpenPopup("Nouveau Script Lua");
|
||||
if (ImGui::BeginPopupModal("Nouveau Script Lua", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||
|
||||
ImGui::InputText("Nom du Script", scriptNameBuffer, sizeof(scriptNameBuffer));
|
||||
|
||||
if (ImGui::Button("Annuler")) {
|
||||
scriptCreated = false;
|
||||
popupOpen = false;
|
||||
// Signal pour retirer ce component (<28> g<>rer par l'entity)
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Valider")) {
|
||||
if (CreateScriptFile()) {
|
||||
scriptCreated = true;
|
||||
popupOpen = false;
|
||||
} else {
|
||||
// Gestion d'erreur possible (imprimer popup message)
|
||||
}
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
}
|
||||
|
||||
if (scriptCreated) {
|
||||
ImGui::TextWrapped("Script associe: %s", scriptName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
bool HasScript() const { return scriptCreated; }
|
||||
const std::string& GetScriptName() const { return scriptName; }
|
||||
|
||||
private:
|
||||
lua_State* L = nullptr;
|
||||
char scriptNameBuffer[128] = {0};
|
||||
std::string scriptName;
|
||||
bool scriptCreated = false;
|
||||
bool popupOpen = false;
|
||||
|
||||
bool CreateScriptFile() {
|
||||
if (strlen(scriptNameBuffer) == 0)
|
||||
R_FALSE
|
||||
|
||||
scriptName = scriptNameBuffer;
|
||||
if (scriptName.length() < 4 || scriptName.substr(scriptName.length() - 4) != ".lua") {
|
||||
scriptName += ".lua";
|
||||
}
|
||||
|
||||
// Dossier standard des scripts
|
||||
std::string execFolder = std::filesystem::current_path().string();
|
||||
std::string scriptFolder = execFolder + "/assets/Script/";
|
||||
|
||||
// Cr<43>er dossiers s'ils manquent
|
||||
std::error_code ec;
|
||||
std::filesystem::create_directories(scriptFolder, ec);
|
||||
if (ec) {
|
||||
// Log erreur
|
||||
R_FALSE
|
||||
}
|
||||
|
||||
std::string fullPath = scriptFolder + scriptName;
|
||||
|
||||
// Cr<43>er un fichier script vide ou template simple
|
||||
std::ofstream ofs(fullPath);
|
||||
if (!ofs) R_FALSE
|
||||
|
||||
ofs << "-- Script Lua vide pour ECS\n\nfunction on_update(dt)\n -- Code ici\nend\n";
|
||||
ofs.close();
|
||||
|
||||
R_TRUE
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace ecs
|
||||
@@ -46,13 +46,13 @@ public:
|
||||
std::string type;
|
||||
std::getline(ss, type, ':');
|
||||
|
||||
if (type != "ModelPathComponent") return false;
|
||||
if (type != "ModelPathComponent") R_FALSE
|
||||
|
||||
std::string modelPath;
|
||||
std::getline(ss, modelPath);
|
||||
|
||||
SetPath(std::wstring(modelPath.begin(), modelPath.end()));
|
||||
return true;
|
||||
R_TRUE
|
||||
}
|
||||
|
||||
void OnImGuiRender() override {
|
||||
|
||||