From ad029752ef5ef4f2e4a24ba8dd13520b51829ab4 Mon Sep 17 00:00:00 2001 From: Nicole Collings <100Toby1@gmail.com> Date: Sun, 26 Jul 2020 19:59:03 -0700 Subject: [PATCH] Reorganize filesystem. --- assets/base/script/init.lua | 1 + assets/base/script/modules/entity.lua | 7 + src/CMakeLists.txt | 634 +++++++++--------- src/def/LocalSubgame.h | 2 +- src/def/ServerSubgame.h | 2 +- src/game/hud/GuiBuilder.h | 2 +- src/game/hud/SerialGui.h | 2 +- src/game/inventory/InventoryList.cpp | 2 +- src/game/inventory/ItemStack.cpp | 2 +- src/game/inventory/ServerInventoryList.cpp | 2 +- src/game/scene/ConnectScene.cpp | 2 +- src/game/scene/menu/MenuSandbox.cpp | 13 +- src/game/scene/world/LocalWorld.cpp | 4 +- src/lua/{parser => }/LocalLuaParser.cpp | 45 +- src/lua/{parser => }/LocalLuaParser.h | 4 +- src/lua/{parser => }/LocalModHandler.cpp | 0 src/lua/{parser => }/LocalModHandler.h | 2 +- src/lua/LuaKeybindHandler.cpp | 2 +- src/lua/LuaMod.h | 22 +- src/lua/LuaModConfig.h | 15 - src/lua/LuaModFile.h | 13 - src/lua/LuaParser.h | 2 +- src/lua/{parser => }/ServerLuaParser.cpp | 43 +- src/lua/{parser => }/ServerLuaParser.h | 2 +- src/lua/{parser => }/ServerModHandler.cpp | 8 +- src/lua/{parser => }/ServerModHandler.h | 2 +- src/lua/api/functions/trigger_event.h | 14 - src/lua/api/functions/update_entities.h | 21 - src/lua/{api => }/modules/BaseModule.cpp | 0 src/lua/{api => }/modules/BaseModule.h | 0 src/lua/{api => }/modules/Block.cpp | 10 +- src/lua/{api => }/modules/Block.h | 0 src/lua/{api => }/modules/Entity.cpp | 14 +- src/lua/{api => }/modules/Entity.h | 0 src/lua/{api => }/modules/Register.cpp | 2 +- src/lua/{api => }/modules/Register.h | 0 src/lua/{api => }/modules/SubgameModule.cpp | 4 +- src/lua/{api => }/modules/SubgameModule.h | 0 src/lua/{api => }/modules/Time.cpp | 2 +- src/lua/{api => }/modules/Time.h | 2 +- src/lua/{api => }/modules/create_structure.h | 2 +- src/lua/{api/menu => modules}/mSetGui.h | 4 +- src/lua/{api/menu => modules}/mStartGame.h | 4 +- .../LocalLuaAnimationManager.cpp | 6 +- .../LocalLuaAnimationManager.h | 2 +- .../class => usertype}/LocalLuaEntity.cpp | 12 +- .../{api/class => usertype}/LocalLuaEntity.h | 4 +- .../class => usertype}/LocalLuaInventory.cpp | 0 .../class => usertype}/LocalLuaInventory.h | 4 +- .../LocalLuaInventoryList.cpp | 4 +- .../LocalLuaInventoryList.h | 2 +- .../class => usertype}/LocalLuaPlayer.cpp | 2 +- .../{api/class => usertype}/LocalLuaPlayer.h | 0 .../{api/class => usertype}/LuaGuiElement.cpp | 2 +- .../{api/class => usertype}/LuaGuiElement.h | 4 +- .../{api/class => usertype}/LuaItemStack.cpp | 8 +- .../{api/class => usertype}/LuaItemStack.h | 0 .../ServerLocalLuaEntity.cpp | 10 +- .../class => usertype}/ServerLocalLuaEntity.h | 2 +- .../class => usertype}/ServerLuaEntity.cpp | 8 +- .../{api/class => usertype}/ServerLuaEntity.h | 4 +- .../class => usertype}/ServerLuaInventory.cpp | 0 .../class => usertype}/ServerLuaInventory.h | 2 +- .../ServerLuaInventoryList.cpp | 4 +- .../ServerLuaInventoryList.h | 2 +- .../class => usertype}/ServerLuaPlayer.cpp | 4 +- .../{api/class => usertype}/ServerLuaPlayer.h | 4 +- .../{api => }/usertype/cAnimationManager.h | 2 +- src/lua/{api => }/usertype/cInventoryRef.h | 6 +- src/lua/{api => }/usertype/cItemStack.h | 4 +- src/lua/{api => }/usertype/cLuaEntity.h | 6 +- src/lua/{api => }/usertype/sInventoryRef.h | 6 +- src/lua/{api => }/usertype/sLuaEntity.h | 4 +- src/net/server/Server.cpp | 4 +- src/net/server/config/ServerConfig.cpp | 2 +- src/net/server/conn/ClientList.cpp | 2 +- src/net/server/world/ServerWorld.cpp | 2 +- src/world/LocalDimension.cpp | 4 +- src/world/ServerDimension.cpp | 2 +- .../zeus/menu/textures/particle_group.png | Bin 0 -> 1727 bytes 80 files changed, 499 insertions(+), 549 deletions(-) create mode 100644 assets/base/script/modules/entity.lua rename src/lua/{parser => }/LocalLuaParser.cpp (85%) rename src/lua/{parser => }/LocalLuaParser.h (94%) rename src/lua/{parser => }/LocalModHandler.cpp (100%) rename src/lua/{parser => }/LocalModHandler.h (94%) delete mode 100644 src/lua/LuaModConfig.h delete mode 100644 src/lua/LuaModFile.h rename src/lua/{parser => }/ServerLuaParser.cpp (88%) rename src/lua/{parser => }/ServerLuaParser.h (97%) rename src/lua/{parser => }/ServerModHandler.cpp (98%) rename src/lua/{parser => }/ServerModHandler.h (97%) delete mode 100644 src/lua/api/functions/trigger_event.h delete mode 100644 src/lua/api/functions/update_entities.h rename src/lua/{api => }/modules/BaseModule.cpp (100%) rename src/lua/{api => }/modules/BaseModule.h (100%) rename src/lua/{api => }/modules/Block.cpp (77%) rename src/lua/{api => }/modules/Block.h (100%) rename src/lua/{api => }/modules/Entity.cpp (93%) rename src/lua/{api => }/modules/Entity.h (100%) rename src/lua/{api => }/modules/Register.cpp (98%) rename src/lua/{api => }/modules/Register.h (100%) rename src/lua/{api => }/modules/SubgameModule.cpp (74%) rename src/lua/{api => }/modules/SubgameModule.h (100%) rename src/lua/{api => }/modules/Time.cpp (96%) rename src/lua/{api => }/modules/Time.h (91%) rename src/lua/{api => }/modules/create_structure.h (96%) rename src/lua/{api/menu => modules}/mSetGui.h (84%) rename src/lua/{api/menu => modules}/mStartGame.h (88%) rename src/lua/{api/class => usertype}/LocalLuaAnimationManager.cpp (92%) rename src/lua/{api/class => usertype}/LocalLuaAnimationManager.h (95%) rename src/lua/{api/class => usertype}/LocalLuaEntity.cpp (90%) rename src/lua/{api/class => usertype}/LocalLuaEntity.h (94%) rename src/lua/{api/class => usertype}/LocalLuaInventory.cpp (100%) rename src/lua/{api/class => usertype}/LocalLuaInventory.h (80%) rename src/lua/{api/class => usertype}/LocalLuaInventoryList.cpp (97%) rename src/lua/{api/class => usertype}/LocalLuaInventoryList.h (95%) rename src/lua/{api/class => usertype}/LocalLuaPlayer.cpp (98%) rename src/lua/{api/class => usertype}/LocalLuaPlayer.h (100%) rename src/lua/{api/class => usertype}/LuaGuiElement.cpp (99%) rename src/lua/{api/class => usertype}/LuaGuiElement.h (97%) rename src/lua/{api/class => usertype}/LuaItemStack.cpp (84%) rename src/lua/{api/class => usertype}/LuaItemStack.h (100%) rename src/lua/{api/class => usertype}/ServerLocalLuaEntity.cpp (86%) rename src/lua/{api/class => usertype}/ServerLocalLuaEntity.h (93%) rename src/lua/{api/class => usertype}/ServerLuaEntity.cpp (93%) rename src/lua/{api/class => usertype}/ServerLuaEntity.h (93%) rename src/lua/{api/class => usertype}/ServerLuaInventory.cpp (100%) rename src/lua/{api/class => usertype}/ServerLuaInventory.h (91%) rename src/lua/{api/class => usertype}/ServerLuaInventoryList.cpp (97%) rename src/lua/{api/class => usertype}/ServerLuaInventoryList.h (95%) rename src/lua/{api/class => usertype}/ServerLuaPlayer.cpp (98%) rename src/lua/{api/class => usertype}/ServerLuaPlayer.h (97%) rename src/lua/{api => }/usertype/cAnimationManager.h (90%) rename src/lua/{api => }/usertype/cInventoryRef.h (96%) rename src/lua/{api => }/usertype/cItemStack.h (89%) rename src/lua/{api => }/usertype/cLuaEntity.h (94%) rename src/lua/{api => }/usertype/sInventoryRef.h (96%) rename src/lua/{api => }/usertype/sLuaEntity.h (96%) create mode 100644 subgames/zeus/menu/textures/particle_group.png diff --git a/assets/base/script/init.lua b/assets/base/script/init.lua index 44c7d5eb..e1233249 100644 --- a/assets/base/script/init.lua +++ b/assets/base/script/init.lua @@ -5,6 +5,7 @@ runfile(_PATH .. "modules/math") runfile(_PATH .. "modules/table") runfile(_PATH .. "modules/after") runfile(_PATH .. "modules/vector") +runfile(_PATH .. "modules/entity") runfile(_PATH .. "modules/callbacks") -- Register base models (if not on main menu) diff --git a/assets/base/script/modules/entity.lua b/assets/base/script/modules/entity.lua new file mode 100644 index 00000000..7ed02a90 --- /dev/null +++ b/assets/base/script/modules/entity.lua @@ -0,0 +1,7 @@ +zepha.entities = {} + +function zepha.__builtin.update_entities(delta) + for k, v in pairs(zepha.entities) do + if type(v.on_update) == "function" then v:on_update(delta) end + end +end \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 82e18f9f..f550dd14 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,323 +1,329 @@ set(ZEPHA_SRC - game/graph/meshtypes/ChunkMesh.cpp - game/graph/meshtypes/ChunkMesh.h - game/entity/Entity.cpp - game/entity/Entity.h - game/graph/shader/Shader.cpp - game/graph/shader/Shader.h - game/graph/window/Window.cpp - game/graph/window/Window.h - game/graph/Camera.cpp - game/graph/Camera.h - game/graph/Texture.cpp - game/graph/Texture.h - game/scene/world/graph/ChunkMeshGenerator.cpp - game/scene/world/graph/ChunkMeshGenerator.h - util/Timer.cpp - util/Timer.h - def/LocalDefinitionAtlas.cpp - def/LocalDefinitionAtlas.h - def/item/MeshPart.cpp - def/item/MeshPart.h - def/item/ShaderMod.h - def/item/BlockModelVertex.h - game/scene/world/LocalWorld.cpp - game/scene/world/LocalWorld.h - world/chunk/Chunk.cpp - world/chunk/Chunk.h - game/scene/world/graph/MeshChunk.cpp - game/scene/world/graph/MeshChunk.h - game/scene/GameScene.cpp - game/scene/GameScene.h - game/graph/Renderer.cpp - game/graph/Renderer.h - lua/parser/LocalLuaParser.cpp - lua/parser/LocalLuaParser.h - game/hud/components/basic/GuiText.cpp - game/hud/components/basic/GuiText.h - game/hud/DebugGui.cpp - game/hud/DebugGui.h - game/scene/world/Player.cpp - game/scene/world/Player.h - util/Ray.cpp - util/Ray.h - game/Client.cpp - game/Client.h - game/graph/scene/SceneManager.cpp - game/graph/scene/SceneManager.h - game/graph/scene/Scene.h - game/ClientState.h - game/scene/MainMenuScene.cpp - game/scene/MainMenuScene.h - net/server/Server.cpp - net/server/Server.h - net/Packet.cpp - net/Packet.h - net/client/ClientNetworkInterpreter.cpp - net/client/ClientNetworkInterpreter.h - def/gen/MapGen.cpp - def/gen/MapGen.h - net/NetHandler.cpp - net/NetHandler.h - game/hud/GameGui.cpp - game/hud/GameGui.h - net/server/conn/ClientList.cpp - net/server/conn/ClientList.h - net/server/conn/ServerClient.h - net/PacketChannel.h - game/entity/engine/PlayerEntity.h - game/hud/components/basic/GuiRect.cpp - game/hud/components/basic/GuiRect.h - game/hud/components/basic/GuiGraph.cpp - game/hud/components/basic/GuiGraph.h - util/Interp.h - def/gen/NoiseSample.cpp - def/gen/NoiseSample.h - game/graph/frustum/Frustum.cpp - game/graph/frustum/Frustum.h - game/graph/frustum/FrustumPlane.cpp - game/graph/frustum/FrustumPlane.h - game/graph/frustum/FrustumAABB.cpp - game/graph/frustum/FrustumAABB.h - net/server/world/ServerWorld.cpp - net/server/world/ServerWorld.h - net/server/world/ServerGenStream.cpp - net/server/world/ServerGenStream.h - game/scene/world/WorldInterpolationStream.cpp - game/scene/world/WorldInterpolationStream.h - util/Space.h - game/scene/world/MeshGenStream.cpp - game/scene/world/MeshGenStream.h - util/Vec.h - world/LocalDimension.cpp - world/LocalDimension.h - world/chunk/Region.h - game/entity/engine/WireframeEntity.cpp - game/entity/engine/WireframeEntity.h - def/item/SelectionBox.h - game/graph/drawable/Drawable.h - game/graph/drawable/DrawableGroup.cpp - game/graph/drawable/DrawableGroup.h - game/graph/window/Input.cpp - game/graph/window/Input.h - game/entity/engine/BlockCrackEntity.cpp - game/entity/engine/BlockCrackEntity.h - def/texture/TextureAtlas.cpp - def/texture/TextureAtlas.h - def/texture/AtlasRef.h - world/chunk/MapBlock.h - def/LocalSubgame.cpp - def/LocalSubgame.h - world/chunk/Region.cpp - world/chunk/MapBlock.cpp - util/Util.h - world/PointedThing.h - game/hud/components/compound/GuiLabelledGraph.cpp - game/hud/components/compound/GuiLabelledGraph.cpp - game/entity/engine/ParticleEntity.cpp - game/entity/engine/ParticleEntity.h - def/ServerSubgame.cpp - def/ServerSubgame.h - def/ServerDefinitionAtlas.cpp - def/ServerDefinitionAtlas.h - def/item/BlockDef.cpp - def/item/BlockDef.h - def/DefinitionAtlas.h - lua/LuaParser.cpp - lua/LuaParser.h - lua/parser/ServerLuaParser.cpp - lua/parser/ServerLuaParser.h - util/Log.h - lua/Callback.h - game/graph/shader/GuiUniforms.h - game/graph/meshtypes/EntityMesh.cpp - game/graph/meshtypes/EntityMesh.h - net/server/conn/ServerClient.cpp - net/server/config/ServerConfig.cpp - net/server/config/ServerConfig.h - net/PacketType.h - net/NetState.h - game/scene/ConnectScene.cpp - game/scene/ConnectScene.h - net/Address.h - net/client/ServerConnection.cpp - net/client/ServerConnection.h - game/scene/world/ChunkMeshDetails.h - game/hud/components/GuiComponent.cpp - game/hud/components/GuiComponent.h - game/hud/components/basic/GuiContainer.cpp - game/hud/components/basic/GuiContainer.h - lua/LuaModFile.h - lua/LuaMod.h - lua/LuaModConfig.h - net/server/asset/ServerTexture.h - net/server/asset/AssetStorage.h - lua/LuaMod.cpp - def/ItemDef.h - def/DefinitionAtlas.cpp - def/item/BlockModel.h - def/texture/Font.cpp - def/texture/Font.h - game/entity/Model.cpp - game/entity/Model.h - game/graph/meshtypes/EntityVertex.h - game/graph/meshtypes/ChunkVertex.h - game/graph/meshtypes/Mesh.cpp - game/graph/meshtypes/Mesh.h - util/Mat4Conv.h - game/entity/ModelBone.cpp - game/entity/ModelBone.h - game/entity/ModelAnimation.cpp - game/entity/ModelAnimation.h - game/entity/AnimChannel.cpp - game/entity/AnimChannel.h - game/entity/AnimationState.cpp - game/entity/AnimationState.h - game/entity/AnimationSegment.h - lua/api/usertype/cLuaEntity.h - StartGame.h - game/graph/shader/SSAOShader.cpp - game/graph/shader/SSAOShader.h - game/graph/shader/BlurShader.cpp - game/graph/shader/BlurShader.h - game/graph/shader/LightingShader.cpp - game/graph/shader/LightingShader.h - game/graph/shader/WorldGeometryShader.cpp - game/graph/shader/WorldGeometryShader.h - game/graph/shader/EntityGeometryShader.cpp - game/graph/shader/EntityGeometryShader.h - game/scene/world/graph/ChunkRenderElem.h - world/ServerDimension.cpp - world/ServerDimension.h - def/item/CraftItemDef.cpp - def/item/CraftItemDef.h - lua/api/class/LocalLuaEntity.cpp - lua/api/class/LocalLuaEntity.h - def/model/SerializedModel.h - net/server/asset/AssetType.h - def/model/ModelStore.h - lua/api/functions/update_entities.h - lua/LuaKeybindHandler.cpp - lua/LuaKeybindHandler.h - lua/api/class/LocalLuaPlayer.cpp - lua/api/class/LocalLuaPlayer.h - game/entity/Collidable.cpp - game/entity/Collidable.h - game/hud/components/compound/GuiInventoryList.cpp - game/hud/components/compound/GuiInventoryList.h - game/hud/components/basic/GuiInventoryItem.cpp - game/hud/components/basic/GuiInventoryItem.h - game/inventory/ServerInventoryList.cpp - game/inventory/ServerInventoryList.h - game/inventory/ItemStack.h - net/server/LocalServerInstance.cpp - net/server/LocalServerInstance.h - game/hud/SerialGui.h - util/Voronoi3D.cpp - util/Voronoi3D.h - def/gen/BiomeDef.cpp - def/gen/BiomeDef.h - def/gen/BiomeAtlas.cpp - def/gen/BiomeAtlas.h - def/gen/ServerBiomeAtlas.cpp - def/gen/ServerBiomeAtlas.h - def/gen/LocalBiomeAtlas.cpp + def/DefinitionAtlas.cpp + def/DefinitionAtlas.h + def/gen/BiomeAtlas.cpp + def/gen/BiomeAtlas.h + def/gen/BiomeDef.cpp + def/gen/BiomeDef.h + def/gen/LocalBiomeAtlas.cpp def/gen/LocalBiomeAtlas.h - world/DimensionBase.cpp - world/DimensionBase.h - def/texture/RawTexData.h - game/hud/components/compound/GuiImageButton.cpp - game/hud/components/compound/GuiImageButton.h - game/ClientState.cpp - game/scene/menu/SubgameDef.h - game/scene/menu/SubgameConfig.h - game/scene/menu/MenuSandbox.cpp - game/scene/menu/MenuSandbox.h - lua/api/menu/mSetGui.h - game/hud/GuiBuilder.cpp - game/hud/GuiBuilder.h - game/hud/GameGuiBuilder.cpp - game/hud/GameGuiBuilder.h - lua/api/menu/mStartGame.h - lua/api/class/ServerLuaInventoryList.cpp - lua/api/class/ServerLuaInventoryList.h - lua/api/class/ServerLuaInventory.cpp - lua/api/class/ServerLuaInventory.h - game/inventory/Inventory.cpp - game/inventory/Inventory.h - lua/api/class/LuaItemStack.cpp - lua/api/class/LuaItemStack.h - game/inventory/ItemStack.cpp - lua/api/usertype/cInventoryRef.h - lua/api/usertype/cItemStack.h - game/hud/components/basic/GuiModel.cpp - game/hud/components/basic/GuiModel.h - net/server/world/ServerEntity.cpp - net/server/world/ServerEntity.h - lua/api/class/ServerLuaEntity.cpp - lua/api/class/ServerLuaEntity.h - game/scene/LuaErrorScene.cpp - game/scene/LuaErrorScene.h - lua/api/usertype/sLuaEntity.h - net/Serializer.h - net/Deserializer.h - lua/api/class/ServerLocalLuaEntity.cpp - lua/api/class/ServerLocalLuaEntity.h - game/scene/world/World.cpp - game/scene/world/World.h - lua/register/RegisterBiomes.h - lua/register/RegisterBlocks.h - lua/register/RegisterItems.h - lua/register/RegisterKeybinds.h - lua/api/class/LocalLuaAnimationManager.cpp - lua/api/class/LocalLuaAnimationManager.h - lua/api/usertype/cAnimationManager.h - game/scene/world/Schematic.cpp - game/scene/world/Schematic.h - lua/ErrorFormatter.cpp - lua/ErrorFormatter.h - util/RIE.h - lua/api/class/ServerLuaPlayer.cpp - lua/api/class/ServerLuaPlayer.h - lua/api/functions/trigger_event.h - lua/parser/ServerModHandler.cpp - lua/parser/ServerModHandler.h - lua/parser/LocalModHandler.cpp - lua/parser/LocalModHandler.h - net/client/NetPlayerField.h - game/inventory/LocalInventoryRefs.cpp - game/inventory/LocalInventoryRefs.h - game/inventory/LocalInventory.cpp - game/inventory/LocalInventory.h - lua/api/class/LocalLuaInventory.cpp - lua/api/class/LocalLuaInventory.h - lua/api/class/LocalLuaInventoryList.cpp - lua/api/class/LocalLuaInventoryList.h - game/inventory/InventoryRefs.cpp - game/inventory/InventoryRefs.h - game/inventory/InventoryList.cpp - game/inventory/InventoryList.h - net/PacketView.cpp - net/PacketView.h - lua/api/modules/create_structure.h - util/Any.h + def/gen/MapGen.cpp + def/gen/MapGen.h def/gen/MapGenProps.cpp def/gen/MapGenProps.h - lua/api/class/LuaGuiElement.cpp - lua/api/class/LuaGuiElement.h - world/Dimension.cpp - world/Dimension.h - world/fs/FileManipulator.cpp - world/fs/FileManipulator.h + def/gen/NoiseSample.cpp + def/gen/NoiseSample.h + def/gen/ServerBiomeAtlas.cpp + def/gen/ServerBiomeAtlas.h + def/item/BlockDef.cpp + def/item/BlockDef.h def/item/BlockModel.cpp - net/server/world/ServerPacketStream.cpp - net/server/world/ServerPacketStream.h + def/item/BlockModel.h + def/item/BlockModelVertex.h + def/item/CraftItemDef.cpp + def/item/CraftItemDef.h + def/item/MeshPart.cpp + def/item/MeshPart.h + def/item/SelectionBox.h + def/item/ShaderMod.h + def/ItemDef.h + def/LocalDefinitionAtlas.cpp + def/LocalDefinitionAtlas.h + def/LocalSubgame.cpp + def/LocalSubgame.h + def/model/ModelStore.h + def/model/SerializedModel.h + def/ServerDefinitionAtlas.cpp + def/ServerDefinitionAtlas.h + def/ServerSubgame.cpp + def/ServerSubgame.h + def/Subgame.h + def/texture/AtlasRef.h + def/texture/Font.cpp + def/texture/Font.h + def/texture/RawTexData.h + def/texture/TextureAtlas.cpp + def/texture/TextureAtlas.h + game/Client.cpp + game/Client.h + game/ClientState.cpp + game/ClientState.h + game/entity/AnimationSegment.h + game/entity/AnimationState.cpp + game/entity/AnimationState.h + game/entity/AnimChannel.cpp + game/entity/AnimChannel.h + game/entity/Collidable.cpp + game/entity/Collidable.h + game/entity/engine/BlockCrackEntity.cpp + game/entity/engine/BlockCrackEntity.h + game/entity/engine/ParticleEntity.cpp + game/entity/engine/ParticleEntity.h + game/entity/engine/PlayerEntity.h + game/entity/engine/WireframeEntity.cpp + game/entity/engine/WireframeEntity.h + game/entity/Entity.cpp + game/entity/Entity.h + game/entity/Model.cpp + game/entity/Model.h + game/entity/ModelAnimation.cpp + game/entity/ModelAnimation.h + game/entity/ModelBone.cpp + game/entity/ModelBone.h + game/graph/Camera.cpp + game/graph/Camera.h + game/graph/drawable/Drawable.h + game/graph/drawable/DrawableGroup.cpp + game/graph/drawable/DrawableGroup.h + game/graph/frustum/Frustum.cpp + game/graph/frustum/Frustum.h + game/graph/frustum/FrustumAABB.cpp + game/graph/frustum/FrustumAABB.h + game/graph/frustum/FrustumPlane.cpp + game/graph/frustum/FrustumPlane.h + game/graph/meshtypes/ChunkMesh.cpp + game/graph/meshtypes/ChunkMesh.h + game/graph/meshtypes/ChunkVertex.h + game/graph/meshtypes/EntityMesh.cpp + game/graph/meshtypes/EntityMesh.h + game/graph/meshtypes/EntityVertex.h + game/graph/meshtypes/Mesh.cpp + game/graph/meshtypes/Mesh.h + game/graph/Renderer.cpp + game/graph/Renderer.h + game/graph/scene/Scene.h + game/graph/scene/SceneManager.cpp + game/graph/scene/SceneManager.h + game/graph/shader/BlurShader.cpp + game/graph/shader/BlurShader.h + game/graph/shader/EntityGeometryShader.cpp + game/graph/shader/EntityGeometryShader.h + game/graph/shader/GuiUniforms.h + game/graph/shader/LightingShader.cpp + game/graph/shader/LightingShader.h + game/graph/shader/Shader.cpp + game/graph/shader/Shader.h + game/graph/shader/SSAOShader.cpp + game/graph/shader/SSAOShader.h + game/graph/shader/WorldGeometryShader.cpp + game/graph/shader/WorldGeometryShader.h + game/graph/Texture.cpp + game/graph/Texture.h + game/graph/window/Input.cpp + game/graph/window/Input.h + game/graph/window/Window.cpp + game/graph/window/Window.h + game/hud/components/basic/GuiContainer.cpp + game/hud/components/basic/GuiContainer.h + game/hud/components/basic/GuiGraph.cpp + game/hud/components/basic/GuiGraph.h + game/hud/components/basic/GuiInventoryItem.cpp + game/hud/components/basic/GuiInventoryItem.h + game/hud/components/basic/GuiModel.cpp + game/hud/components/basic/GuiModel.h + game/hud/components/basic/GuiRect.cpp + game/hud/components/basic/GuiRect.h + game/hud/components/basic/GuiText.cpp + game/hud/components/basic/GuiText.h + game/hud/components/compound/GuiImageButton.cpp + game/hud/components/compound/GuiImageButton.h + game/hud/components/compound/GuiInventoryList.cpp + game/hud/components/compound/GuiInventoryList.h + game/hud/components/compound/GuiLabelledGraph.cpp + game/hud/components/compound/GuiLabelledGraph.cpp + game/hud/components/GuiComponent.cpp + game/hud/components/GuiComponent.h + game/hud/DebugGui.cpp + game/hud/DebugGui.h + game/hud/GameGui.cpp + game/hud/GameGui.h + game/hud/GameGuiBuilder.cpp + game/hud/GameGuiBuilder.h + game/hud/GuiBuilder.cpp + game/hud/GuiBuilder.h + game/hud/SerialGui.h + game/inventory/Inventory.cpp + game/inventory/Inventory.h + game/inventory/InventoryList.cpp + game/inventory/InventoryList.h + game/inventory/InventoryRefs.cpp + game/inventory/InventoryRefs.h + game/inventory/ItemStack.cpp + game/inventory/ItemStack.h + game/inventory/LocalInventory.cpp + game/inventory/LocalInventory.h + game/inventory/LocalInventoryRefs.cpp + game/inventory/LocalInventoryRefs.h + game/inventory/ServerInventoryList.cpp + game/inventory/ServerInventoryList.h + game/scene/ConnectScene.cpp + game/scene/ConnectScene.h + game/scene/GameScene.cpp + game/scene/GameScene.h + game/scene/LuaErrorScene.cpp + game/scene/LuaErrorScene.h + game/scene/MainMenuScene.cpp + game/scene/MainMenuScene.h + game/scene/menu/MenuSandbox.cpp + game/scene/menu/MenuSandbox.h + game/scene/menu/SubgameConfig.h + game/scene/menu/SubgameDef.h + game/scene/world/ChunkMeshDetails.h + game/scene/world/graph/ChunkMeshGenerator.cpp + game/scene/world/graph/ChunkMeshGenerator.h + game/scene/world/graph/ChunkRenderElem.h + game/scene/world/graph/MeshChunk.cpp + game/scene/world/graph/MeshChunk.h + game/scene/world/LocalWorld.cpp + game/scene/world/LocalWorld.h + game/scene/world/MeshGenStream.cpp + game/scene/world/MeshGenStream.h + game/scene/world/Player.cpp + game/scene/world/Player.h + game/scene/world/Schematic.cpp + game/scene/world/Schematic.h + game/scene/world/World.cpp + game/scene/world/World.h + game/scene/world/WorldInterpolationStream.cpp + game/scene/world/WorldInterpolationStream.h + lua/Callback.h + lua/customization/vec3.hpp + lua/ErrorFormatter.cpp + lua/ErrorFormatter.h + lua/LocalLuaParser.cpp + lua/LocalLuaParser.h + lua/LocalModHandler.cpp + lua/LocalModHandler.h + lua/LuaKeybindHandler.cpp + lua/LuaKeybindHandler.h + lua/LuaMod.cpp + lua/LuaMod.h + lua/LuaParser.cpp + lua/LuaParser.h + lua/modules/BaseModule.cpp + lua/modules/BaseModule.h + lua/modules/Block.cpp + lua/modules/Block.h + lua/modules/create_structure.h + lua/modules/Entity.cpp + lua/modules/Entity.h + lua/modules/mSetGui.h + lua/modules/mStartGame.h + lua/modules/Register.cpp + lua/modules/Register.h + lua/modules/SubgameModule.cpp + lua/modules/SubgameModule.h + lua/modules/Time.cpp + lua/modules/Time.h lua/register/CreateBlockModel.cpp lua/register/CreateBlockModel.h - lua/customization/vec3.hpp - lua/api/modules/SubgameModule.h - lua/api/modules/Register.cpp - lua/api/modules/Register.h - def/Subgame.h lua/api/modules/SubgameModule.cpp lua/api/modules/Block.cpp lua/api/modules/Block.h lua/api/modules/Entity.cpp lua/api/modules/Entity.h lua/api/modules/Time.cpp lua/api/modules/Time.h lua/api/modules/BaseModule.cpp lua/api/modules/BaseModule.h) + lua/register/RegisterBiomes.h + lua/register/RegisterBlocks.h + lua/register/RegisterItems.h + lua/register/RegisterKeybinds.h + lua/ServerLuaParser.cpp + lua/ServerLuaParser.h + lua/ServerModHandler.cpp + lua/ServerModHandler.h + lua/usertype/cAnimationManager.h + lua/usertype/cInventoryRef.h + lua/usertype/cItemStack.h + lua/usertype/cLuaEntity.h + lua/usertype/LocalLuaAnimationManager.cpp + lua/usertype/LocalLuaAnimationManager.h + lua/usertype/LocalLuaEntity.cpp + lua/usertype/LocalLuaEntity.h + lua/usertype/LocalLuaInventory.cpp + lua/usertype/LocalLuaInventory.h + lua/usertype/LocalLuaInventoryList.cpp + lua/usertype/LocalLuaInventoryList.h + lua/usertype/LocalLuaPlayer.cpp + lua/usertype/LocalLuaPlayer.h + lua/usertype/LuaGuiElement.cpp + lua/usertype/LuaGuiElement.h + lua/usertype/LuaItemStack.cpp + lua/usertype/LuaItemStack.h + lua/usertype/ServerLocalLuaEntity.cpp + lua/usertype/ServerLocalLuaEntity.h + lua/usertype/ServerLuaEntity.cpp + lua/usertype/ServerLuaEntity.h + lua/usertype/ServerLuaInventory.cpp + lua/usertype/ServerLuaInventory.h + lua/usertype/ServerLuaInventoryList.cpp + lua/usertype/ServerLuaInventoryList.h + lua/usertype/ServerLuaPlayer.cpp + lua/usertype/ServerLuaPlayer.h + lua/usertype/sLuaEntity.h + net/Address.h + net/client/ClientNetworkInterpreter.cpp + net/client/ClientNetworkInterpreter.h + net/client/NetPlayerField.h + net/client/ServerConnection.cpp + net/client/ServerConnection.h + net/Deserializer.h + net/NetHandler.cpp + net/NetHandler.h + net/NetState.h + net/Packet.cpp + net/Packet.h + net/PacketChannel.h + net/PacketType.h + net/PacketView.cpp + net/PacketView.h + net/Serializer.h + net/server/asset/AssetStorage.h + net/server/asset/AssetType.h + net/server/asset/ServerTexture.h + net/server/config/ServerConfig.cpp + net/server/config/ServerConfig.h + net/server/conn/ClientList.cpp + net/server/conn/ClientList.h + net/server/conn/ServerClient.cpp + net/server/conn/ServerClient.h + net/server/LocalServerInstance.cpp + net/server/LocalServerInstance.h + net/server/Server.cpp + net/server/Server.h + net/server/world/ServerEntity.cpp + net/server/world/ServerEntity.h + net/server/world/ServerGenStream.cpp + net/server/world/ServerGenStream.h + net/server/world/ServerPacketStream.cpp + net/server/world/ServerPacketStream.h + net/server/world/ServerWorld.cpp + net/server/world/ServerWorld.h + StartGame.h + util/Any.h + util/Interp.h + util/Log.h + util/Mat4Conv.h + util/Ray.cpp + util/Ray.h + util/RIE.h + util/Space.h + util/Timer.cpp + util/Timer.h + util/Util.h + util/Vec.h + util/Voronoi3D.cpp + util/Voronoi3D.h + world/chunk/Chunk.cpp + world/chunk/Chunk.h + world/chunk/MapBlock.cpp + world/chunk/MapBlock.h + world/chunk/Region.cpp + world/chunk/Region.h + world/Dimension.cpp + world/Dimension.h + world/DimensionBase.cpp + world/DimensionBase.h + world/fs/FileManipulator.cpp + world/fs/FileManipulator.h + world/LocalDimension.cpp + world/LocalDimension.h + world/PointedThing.h + world/ServerDimension.cpp + world/ServerDimension.h +) add_library (Zepha_Core ${ZEPHA_SRC}) \ No newline at end of file diff --git a/src/def/LocalSubgame.h b/src/def/LocalSubgame.h index e5d96085..f792a7d7 100644 --- a/src/def/LocalSubgame.h +++ b/src/def/LocalSubgame.h @@ -13,7 +13,7 @@ #include "gen/LocalBiomeAtlas.h" #include "LocalDefinitionAtlas.h" #include "texture/TextureAtlas.h" -#include "../lua/parser/LocalLuaParser.h" +#include "../lua/LocalLuaParser.h" class Player; class LocalWorld; diff --git a/src/def/ServerSubgame.h b/src/def/ServerSubgame.h index 3855b84a..6a843415 100644 --- a/src/def/ServerSubgame.h +++ b/src/def/ServerSubgame.h @@ -10,7 +10,7 @@ #include "../def/gen/ServerBiomeAtlas.h" #include "../def/ServerDefinitionAtlas.h" -#include "../lua/parser/ServerLuaParser.h" +#include "../lua/ServerLuaParser.h" #include "../net/server/asset/AssetStorage.h" class ServerWorld; diff --git a/src/game/hud/GuiBuilder.h b/src/game/hud/GuiBuilder.h index 9ffa08f7..4456387b 100644 --- a/src/game/hud/GuiBuilder.h +++ b/src/game/hud/GuiBuilder.h @@ -7,7 +7,7 @@ #include "SerialGui.h" #include "components/GuiComponent.h" #include "../../def/LocalSubgame.h" -#include "../../lua/api/class/LuaGuiElement.h" +#include "../../lua/usertype/LuaGuiElement.h" class GuiContainer; diff --git a/src/game/hud/SerialGui.h b/src/game/hud/SerialGui.h index debe8bca..b45bf3c2 100644 --- a/src/game/hud/SerialGui.h +++ b/src/game/hud/SerialGui.h @@ -17,7 +17,7 @@ #include #include "../../util/Any.h" -#include "../../lua/api/class/LuaGuiElement.h" +#include "../../lua/usertype/LuaGuiElement.h" namespace SerialGui { const float SCALE_MODIFIER = 3; diff --git a/src/game/inventory/InventoryList.cpp b/src/game/inventory/InventoryList.cpp index 5cadcffc..7656788a 100644 --- a/src/game/inventory/InventoryList.cpp +++ b/src/game/inventory/InventoryList.cpp @@ -6,7 +6,7 @@ #include "../../def/ItemDef.h" #include "../../def/DefinitionAtlas.h" -#include "../../lua/api/class/LuaItemStack.h" +#include "../../lua/usertype/LuaItemStack.h" InventoryList::InventoryList(DefinitionAtlas &defs) : defs(defs) { initialize(); diff --git a/src/game/inventory/ItemStack.cpp b/src/game/inventory/ItemStack.cpp index bd997e2c..1d582ddd 100644 --- a/src/game/inventory/ItemStack.cpp +++ b/src/game/inventory/ItemStack.cpp @@ -6,7 +6,7 @@ #include "../../def/ItemDef.h" #include "../../def/DefinitionAtlas.h" -#include "../../lua/api/class/LuaItemStack.h" +#include "../../lua/usertype/LuaItemStack.h" ItemStack::ItemStack(LuaItemStack &stack, const DefinitionAtlas &atlas) : id((stack.get_count() == 0) ? DefinitionAtlas::AIR : atlas.fromStr(stack.get_name()).index), diff --git a/src/game/inventory/ServerInventoryList.cpp b/src/game/inventory/ServerInventoryList.cpp index a4c3df4c..fab50ba7 100644 --- a/src/game/inventory/ServerInventoryList.cpp +++ b/src/game/inventory/ServerInventoryList.cpp @@ -8,7 +8,7 @@ #include "../../net/Packet.h" #include "../../net/Serializer.h" -#include "../../lua/api/class/LuaItemStack.h" +#include "../../lua/usertype/LuaItemStack.h" #include "../../net/server/conn/ClientList.h" ServerInventoryList::ServerInventoryList(DefinitionAtlas& defs, ClientList* list, diff --git a/src/game/scene/ConnectScene.cpp b/src/game/scene/ConnectScene.cpp index 5764e779..2df7a0f3 100644 --- a/src/game/scene/ConnectScene.cpp +++ b/src/game/scene/ConnectScene.cpp @@ -17,7 +17,7 @@ #include "../../def/LocalDefinitionAtlas.h" #include "../hud/components/basic/GuiText.h" #include "../hud/components/basic/GuiRect.h" -#include "../../lua/parser/LocalLuaParser.h" +#include "../../lua/LocalLuaParser.h" #include "../../net/server/asset/AssetType.h" ConnectScene::ConnectScene(ClientState &state, Address addr) : Scene(state), diff --git a/src/game/scene/menu/MenuSandbox.cpp b/src/game/scene/menu/MenuSandbox.cpp index ee025dac..fb7856b7 100644 --- a/src/game/scene/menu/MenuSandbox.cpp +++ b/src/game/scene/menu/MenuSandbox.cpp @@ -8,14 +8,15 @@ #include "MenuSandbox.h" #include "SubgameDef.h" +#include "../../../lua/LuaMod.h" #include "../../../lua/ErrorFormatter.h" #include "../../hud/components/basic/GuiText.h" #include "../../hud/components/basic/GuiContainer.h" // Modules -#include "../../../lua/api/modules/Time.h" -#include "../../../lua/api/menu/mSetGui.h" -#include "../../../lua/api/menu/mStartGame.h" +#include "../../../lua/modules/Time.h" +#include "../../../lua/modules/mSetGui.h" +#include "../../../lua/modules/mStartGame.h" MenuSandbox::MenuSandbox(glm::ivec2 &win, ClientState& state, std::shared_ptr container) : LuaParser(state.defs), win(win), @@ -78,7 +79,7 @@ void MenuSandbox::update(double delta) { } sol::protected_function_result MenuSandbox::runFileSandboxed(const std::string& file) { - for (LuaModFile& f : mod.files) { + for (LuaMod::File& f : mod.files) { if (f.path != file) continue; sol::environment env(lua, sol::create, lua.globals()); @@ -142,7 +143,7 @@ void MenuSandbox::loadAndRunMod(const std::string &modPath) { std::ifstream t(file); std::string fileStr((std::istreambuf_iterator(t)), std::istreambuf_iterator()); - LuaModFile f {modPath, fileStr}; + LuaMod::File f {modPath, fileStr}; mod.files.push_back(f); } @@ -188,7 +189,7 @@ sol::protected_function_result MenuSandbox::errorCallback(sol::protected_functio std::string fileName = errString.substr(0, lineNumStart); int lineNum = std::stoi(errString.substr(lineNumStart + 1, lineNumEnd - lineNumStart - 1)); - for (LuaModFile &f : mod.files) + for (LuaMod::File& f : mod.files) if (f.path == fileName) throw std::runtime_error(ErrorFormatter::formatError(fileName, lineNum, errString, f.file)); diff --git a/src/game/scene/world/LocalWorld.cpp b/src/game/scene/world/LocalWorld.cpp index c080f35f..99ccf563 100644 --- a/src/game/scene/world/LocalWorld.cpp +++ b/src/game/scene/world/LocalWorld.cpp @@ -11,10 +11,10 @@ #include "../../../def/item/BlockDef.h" #include "../../../def/gen/LocalBiomeAtlas.h" #include "../../../def/LocalDefinitionAtlas.h" -#include "../../../lua/parser/LocalLuaParser.h" +#include "../../../lua/LocalLuaParser.h" #include "../../entity/engine/ParticleEntity.h" #include "../../entity/engine/BlockCrackEntity.h" -#include "../../../lua/api/class/LocalLuaPlayer.h" +#include "../../../lua/usertype/LocalLuaPlayer.h" #include "../../../net/client/ClientNetworkInterpreter.h" LocalWorld::LocalWorld(LocalSubgame& defs, ClientNetworkInterpreter* server) : diff --git a/src/lua/parser/LocalLuaParser.cpp b/src/lua/LocalLuaParser.cpp similarity index 85% rename from src/lua/parser/LocalLuaParser.cpp rename to src/lua/LocalLuaParser.cpp index fbcd54af..ed489582 100644 --- a/src/lua/parser/LocalLuaParser.cpp +++ b/src/lua/LocalLuaParser.cpp @@ -4,32 +4,30 @@ #include "LocalLuaParser.h" -#include "../ErrorFormatter.h" -#include "../../game/ClientState.h" -#include "../../game/graph/Renderer.h" -#include "../register/RegisterItems.h" -#include "../register/RegisterBlocks.h" -#include "../register/RegisterBiomes.h" -#include "../register/RegisterKeybinds.h" +#include "ErrorFormatter.h" +#include "../game/ClientState.h" +#include "../game/graph/Renderer.h" +#include "register/RegisterItems.h" +#include "register/RegisterBlocks.h" +#include "register/RegisterBiomes.h" +#include "register/RegisterKeybinds.h" // Usertypes -#include "../api/class/LuaGuiElement.h" -#include "../api/usertype/cItemStack.h" -#include "../api/class/LocalLuaPlayer.h" -#include "../api/usertype/cLuaEntity.h" -#include "../api/usertype/cInventoryRef.h" -#include "../api/usertype/cAnimationManager.h" +#include "usertype/LuaGuiElement.h" +#include "usertype/cItemStack.h" +#include "usertype/LocalLuaPlayer.h" +#include "usertype/cLuaEntity.h" +#include "usertype/cInventoryRef.h" +#include "usertype/cAnimationManager.h" // Modules -#include "../api/modules/Time.h" -#include "../api/modules/Block.h" -#include "../api/modules/Entity.h" -#include "../api/modules/Register.h" +#include "modules/Time.h" +#include "modules/Block.h" +#include "modules/Entity.h" +#include "modules/Register.h" -#include "../api/modules/create_structure.h" - -// Functions -#include "../api/functions/update_entities.h" +#include "modules/create_structure.h" +#include "LuaMod.h" LocalLuaParser::LocalLuaParser(LocalSubgame& game): LuaParser(game), game(game), keybinds(this) {} @@ -83,9 +81,6 @@ void LocalLuaParser::loadApi(LocalSubgame &defs, LocalWorld &world, Player& play Api::create_structure (lua, core); - // Functions - Api::update_entities(lua); - // Create sandboxed runfile() lua["dofile"] = lua["loadfile"] = sol::nil; lua.set_function("runfile", &LocalLuaParser::runFileSandboxed, this); @@ -143,7 +138,7 @@ sol::protected_function_result LocalLuaParser::runFileSandboxed(const std::strin for (const LuaMod& mod : handler.cGetMods()) { if (modname != mod.config.name) continue; - for (const LuaModFile& f : mod.files) { + for (const LuaMod::File& f : mod.files) { if (f.path != file) continue; sol::environment env(lua, sol::create, lua.globals()); diff --git a/src/lua/parser/LocalLuaParser.h b/src/lua/LocalLuaParser.h similarity index 94% rename from src/lua/parser/LocalLuaParser.h rename to src/lua/LocalLuaParser.h index df6ed422..11be9336 100644 --- a/src/lua/parser/LocalLuaParser.h +++ b/src/lua/LocalLuaParser.h @@ -4,10 +4,10 @@ #pragma once -#include "../LuaParser.h" +#include "LuaParser.h" #include "LocalModHandler.h" -#include "../LuaKeybindHandler.h" +#include "LuaKeybindHandler.h" class Player; class LocalWorld; diff --git a/src/lua/parser/LocalModHandler.cpp b/src/lua/LocalModHandler.cpp similarity index 100% rename from src/lua/parser/LocalModHandler.cpp rename to src/lua/LocalModHandler.cpp diff --git a/src/lua/parser/LocalModHandler.h b/src/lua/LocalModHandler.h similarity index 94% rename from src/lua/parser/LocalModHandler.h rename to src/lua/LocalModHandler.h index d2c4b882..e260c979 100644 --- a/src/lua/parser/LocalModHandler.h +++ b/src/lua/LocalModHandler.h @@ -6,7 +6,7 @@ #include -#include "../LuaMod.h" +#include "LuaMod.h" class LocalModHandler { public: diff --git a/src/lua/LuaKeybindHandler.cpp b/src/lua/LuaKeybindHandler.cpp index 77d1e73b..5f84d203 100644 --- a/src/lua/LuaKeybindHandler.cpp +++ b/src/lua/LuaKeybindHandler.cpp @@ -4,7 +4,7 @@ #include "LuaKeybindHandler.h" -#include "parser/LocalLuaParser.h" +#include "LocalLuaParser.h" LuaKeybindHandler::LuaKeybindHandler(LocalLuaParser* parser): parser(parser) { for (auto &callback : callbacksDown) callback = {}; diff --git a/src/lua/LuaMod.h b/src/lua/LuaMod.h index 7aca334d..e8c9e783 100644 --- a/src/lua/LuaMod.h +++ b/src/lua/LuaMod.h @@ -5,18 +5,28 @@ #pragma once #include - -#include "LuaModFile.h" -#include "LuaModConfig.h" +#include class PacketView; class LuaMod { public: - std::vector files {}; - LuaModConfig config {}; + struct File { + std::string path; + std::string file; + }; + + struct Config { + std::string name; + std::string description; + std::string version; + std::vector depends; + }; + + std::vector files {}; + Config config {}; std::string modPath; std::string serialized; static LuaMod fromPacket(PacketView& p); -}; +}; \ No newline at end of file diff --git a/src/lua/LuaModConfig.h b/src/lua/LuaModConfig.h deleted file mode 100644 index 7ad7ccc3..00000000 --- a/src/lua/LuaModConfig.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Created by aurailus on 03/08/19. -// - -#pragma once - -#include -#include - -struct LuaModConfig { - std::string name; - std::string description; - std::string version; - std::vector depends; -}; diff --git a/src/lua/LuaModFile.h b/src/lua/LuaModFile.h deleted file mode 100644 index e9905033..00000000 --- a/src/lua/LuaModFile.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// Created by aurailus on 03/08/19. -// - -#pragma once - -#include - -struct LuaModFile { - std::string path; - std::string file; -}; - diff --git a/src/lua/LuaParser.h b/src/lua/LuaParser.h index 4e98878f..e4446598 100644 --- a/src/lua/LuaParser.h +++ b/src/lua/LuaParser.h @@ -9,7 +9,7 @@ #include #include -#include "api/modules/SubgameModule.h" +#include "modules/SubgameModule.h" #include "Lua.h" diff --git a/src/lua/parser/ServerLuaParser.cpp b/src/lua/ServerLuaParser.cpp similarity index 88% rename from src/lua/parser/ServerLuaParser.cpp rename to src/lua/ServerLuaParser.cpp index 5e028083..660a74b4 100644 --- a/src/lua/parser/ServerLuaParser.cpp +++ b/src/lua/ServerLuaParser.cpp @@ -7,30 +7,27 @@ #include "ServerLuaParser.h" -#include "../ErrorFormatter.h" -#include "../../net/Serializer.h" -#include "../register/RegisterItems.h" -#include "../register/RegisterBiomes.h" -#include "../register/RegisterBlocks.h" -#include "../../net/server/world/ServerWorld.h" +#include "ErrorFormatter.h" +#include "../net/Serializer.h" +#include "register/RegisterItems.h" +#include "register/RegisterBiomes.h" +#include "register/RegisterBlocks.h" +#include "../net/server/world/ServerWorld.h" // Usertypes -#include "../api/class/ServerLuaPlayer.h" -#include "../api/usertype/sLuaEntity.h" -#include "../api/usertype/sInventoryRef.h" -#include "../api/usertype/cItemStack.h" +#include "usertype/ServerLuaPlayer.h" +#include "usertype/sLuaEntity.h" +#include "usertype/sInventoryRef.h" +#include "usertype/cItemStack.h" // Modules -#include "../api/modules/Time.h" -#include "../api/modules/Block.h" -#include "../api/modules/Entity.h" -#include "../api/modules/Register.h" +#include "modules/Time.h" +#include "modules/Block.h" +#include "modules/Entity.h" +#include "modules/Register.h" -#include "../api/modules/create_structure.h" - -// Functions -#include "../api/functions/trigger_event.h" -#include "../api/functions/update_entities.h" +#include "modules/create_structure.h" +#include "LuaMod.h" ServerLuaParser::ServerLuaParser(ServerSubgame& game) : LuaParser(game), game(game) {} @@ -110,13 +107,9 @@ void ServerLuaParser::loadApi(ServerSubgame &defs, ServerWorld &world) { modules.emplace_back(std::make_unique(Api::State::SERVER, core, game, world)); modules.emplace_back(std::make_unique(Api::State::SERVER, core, game, world)); - bindModules(); - Api::create_structure (lua, core); - // Functions - Api::trigger_event (lua); - Api::update_entities(lua); + bindModules(); // Create sandboxed runfile() lua["dofile"] = lua["loadfile"] = sol::nil; @@ -174,7 +167,7 @@ sol::protected_function_result ServerLuaParser::runFileSandboxed(const std::stri for (const LuaMod& mod : handler.cGetMods()) { if (modname != mod.config.name) continue; - for (const LuaModFile& f : mod.files) { + for (const LuaMod::File& f : mod.files) { if (f.path != file) continue; sol::environment env(lua, sol::create, lua.globals()); diff --git a/src/lua/parser/ServerLuaParser.h b/src/lua/ServerLuaParser.h similarity index 97% rename from src/lua/parser/ServerLuaParser.h rename to src/lua/ServerLuaParser.h index b32de448..c43b61d1 100644 --- a/src/lua/parser/ServerLuaParser.h +++ b/src/lua/ServerLuaParser.h @@ -6,7 +6,7 @@ #include -#include "../LuaParser.h" +#include "LuaParser.h" #include "ServerModHandler.h" diff --git a/src/lua/parser/ServerModHandler.cpp b/src/lua/ServerModHandler.cpp similarity index 98% rename from src/lua/parser/ServerModHandler.cpp rename to src/lua/ServerModHandler.cpp index 7213606e..7d449659 100644 --- a/src/lua/parser/ServerModHandler.cpp +++ b/src/lua/ServerModHandler.cpp @@ -11,8 +11,8 @@ #include "ServerModHandler.h" -#include "../../def/ServerSubgame.h" -#include "../../net/Serializer.h" +#include "../net/Serializer.h" +#include "../def/ServerSubgame.h" void ServerModHandler::loadMods(ServerSubgame& defs, const std::string &path) { auto modDirs = findModDirectories(path); @@ -151,7 +151,7 @@ std::vector ServerModHandler::initializeLuaMods(const std::list& mods) { s.append(depends); - for (LuaModFile& file : mod.files) { + for (LuaMod::File& file : mod.files) { s.append(file.path).append(file.file); } diff --git a/src/lua/parser/ServerModHandler.h b/src/lua/ServerModHandler.h similarity index 97% rename from src/lua/parser/ServerModHandler.h rename to src/lua/ServerModHandler.h index 7437dfec..c2847e3d 100644 --- a/src/lua/parser/ServerModHandler.h +++ b/src/lua/ServerModHandler.h @@ -7,7 +7,7 @@ #include #include -#include "../LuaMod.h" +#include "LuaMod.h" class ServerSubgame; diff --git a/src/lua/api/functions/trigger_event.h b/src/lua/api/functions/trigger_event.h deleted file mode 100644 index 20f51887..00000000 --- a/src/lua/api/functions/trigger_event.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// Created by aurailus on 2020-02-18. -// - -#pragma once - -#include "../../Lua.h" - -namespace Api { - static void trigger_event(sol::state& lua) { - lua.script(R"( - )"); - } -} \ No newline at end of file diff --git a/src/lua/api/functions/update_entities.h b/src/lua/api/functions/update_entities.h deleted file mode 100644 index 99bcd654..00000000 --- a/src/lua/api/functions/update_entities.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// Created by aurailus on 11/10/19. -// - -#pragma once - -#include "../../Lua.h" - -namespace Api { - static void update_entities(sol::state& lua) { - lua.script(R"( - zepha.__builtin.update_entities = function(delta) - for k, v in pairs(zepha.entities) do - if (type(v.on_update) == "function") then - v:on_update(delta) - end - end - end - )"); - } -} \ No newline at end of file diff --git a/src/lua/api/modules/BaseModule.cpp b/src/lua/modules/BaseModule.cpp similarity index 100% rename from src/lua/api/modules/BaseModule.cpp rename to src/lua/modules/BaseModule.cpp diff --git a/src/lua/api/modules/BaseModule.h b/src/lua/modules/BaseModule.h similarity index 100% rename from src/lua/api/modules/BaseModule.h rename to src/lua/modules/BaseModule.h diff --git a/src/lua/api/modules/Block.cpp b/src/lua/modules/Block.cpp similarity index 77% rename from src/lua/api/modules/Block.cpp rename to src/lua/modules/Block.cpp index 19d7252d..0ff8de76 100644 --- a/src/lua/api/modules/Block.cpp +++ b/src/lua/modules/Block.cpp @@ -4,11 +4,11 @@ #include "Block.h" -#include "../../Lua.h" -#include "../../../def/ItemDef.h" -#include "../../../def/Subgame.h" -#include "../../../def/DefinitionAtlas.h" -#include "../../../game/scene/world/World.h" +#include "../Lua.h" +#include "../../def/ItemDef.h" +#include "../../def/Subgame.h" +#include "../../def/DefinitionAtlas.h" +#include "../../game/scene/world/World.h" void Api::Module::Block::bind() { core.set_function("get_block", Util::bind_this(this, &Block::getBlock)); diff --git a/src/lua/api/modules/Block.h b/src/lua/modules/Block.h similarity index 100% rename from src/lua/api/modules/Block.h rename to src/lua/modules/Block.h diff --git a/src/lua/api/modules/Entity.cpp b/src/lua/modules/Entity.cpp similarity index 93% rename from src/lua/api/modules/Entity.cpp rename to src/lua/modules/Entity.cpp index e3516748..66870049 100644 --- a/src/lua/api/modules/Entity.cpp +++ b/src/lua/modules/Entity.cpp @@ -4,13 +4,13 @@ #include "Entity.h" -#include "../../Lua.h" -#include "../class/LocalLuaEntity.h" -#include "../class/ServerLuaEntity.h" -#include "../../../def/LocalSubgame.h" -#include "../../../def/ServerSubgame.h" -#include "../../../game/scene/world/LocalWorld.h" -#include "../../../net/server/world/ServerWorld.h" +#include "../Lua.h" +#include "../usertype/LocalLuaEntity.h" +#include "../usertype/ServerLuaEntity.h" +#include "../../def/LocalSubgame.h" +#include "../../def/ServerSubgame.h" +#include "../../game/scene/world/LocalWorld.h" +#include "../../net/server/world/ServerWorld.h" void Api::Module::Entity::bind() { core["entities"] = lua.create_table(); diff --git a/src/lua/api/modules/Entity.h b/src/lua/modules/Entity.h similarity index 100% rename from src/lua/api/modules/Entity.h rename to src/lua/modules/Entity.h diff --git a/src/lua/api/modules/Register.cpp b/src/lua/modules/Register.cpp similarity index 98% rename from src/lua/api/modules/Register.cpp rename to src/lua/modules/Register.cpp index 28170363..6592940b 100644 --- a/src/lua/api/modules/Register.cpp +++ b/src/lua/modules/Register.cpp @@ -4,7 +4,7 @@ #include "Register.h" -#include "../../Lua.h" +#include "../Lua.h" void Api::Module::Register::bind() { diff --git a/src/lua/api/modules/Register.h b/src/lua/modules/Register.h similarity index 100% rename from src/lua/api/modules/Register.h rename to src/lua/modules/Register.h diff --git a/src/lua/api/modules/SubgameModule.cpp b/src/lua/modules/SubgameModule.cpp similarity index 74% rename from src/lua/api/modules/SubgameModule.cpp rename to src/lua/modules/SubgameModule.cpp index 3d8ad2b3..e4893fb7 100644 --- a/src/lua/api/modules/SubgameModule.cpp +++ b/src/lua/modules/SubgameModule.cpp @@ -4,8 +4,8 @@ #include "SubgameModule.h" -#include "../../../def/Subgame.h" -#include "../../../lua/LuaParser.h" +#include "../../def/Subgame.h" +#include "../LuaParser.h" Api::Module::SubgameModule::SubgameModule(State state, sol::table& core, Subgame& game, World& world) : BaseModule(state, game.getParser().lua, core), game(game), world(world) {} \ No newline at end of file diff --git a/src/lua/api/modules/SubgameModule.h b/src/lua/modules/SubgameModule.h similarity index 100% rename from src/lua/api/modules/SubgameModule.h rename to src/lua/modules/SubgameModule.h diff --git a/src/lua/api/modules/Time.cpp b/src/lua/modules/Time.cpp similarity index 96% rename from src/lua/api/modules/Time.cpp rename to src/lua/modules/Time.cpp index fbbf9a8a..c07a386f 100644 --- a/src/lua/api/modules/Time.cpp +++ b/src/lua/modules/Time.cpp @@ -4,7 +4,7 @@ #include "Time.h" -#include "../../Lua.h" +#include "../Lua.h" void Api::Module::Time::bind() { auto time = lua.create_table(); diff --git a/src/lua/api/modules/Time.h b/src/lua/modules/Time.h similarity index 91% rename from src/lua/api/modules/Time.h rename to src/lua/modules/Time.h index c63a42f9..72bb5efb 100644 --- a/src/lua/api/modules/Time.h +++ b/src/lua/modules/Time.h @@ -7,7 +7,7 @@ #include #include "SubgameModule.h" -#include "../../../util/Timer.h" +#include "../../util/Timer.h" namespace Api::Module { class Time : public Api::Module::BaseModule { diff --git a/src/lua/api/modules/create_structure.h b/src/lua/modules/create_structure.h similarity index 96% rename from src/lua/api/modules/create_structure.h rename to src/lua/modules/create_structure.h index fd3a6c0a..7b3af64c 100644 --- a/src/lua/api/modules/create_structure.h +++ b/src/lua/modules/create_structure.h @@ -4,7 +4,7 @@ #pragma once -#include "../../../game/scene/world/Schematic.h" +#include "../../game/scene/world/Schematic.h" namespace Api { static void create_structure(sol::state& lua, sol::table& core) { diff --git a/src/lua/api/menu/mSetGui.h b/src/lua/modules/mSetGui.h similarity index 84% rename from src/lua/api/menu/mSetGui.h rename to src/lua/modules/mSetGui.h index a11cbc87..ac6c1da0 100644 --- a/src/lua/api/menu/mSetGui.h +++ b/src/lua/modules/mSetGui.h @@ -4,8 +4,8 @@ #pragma once -#include "../../Lua.h" -#include "../../../game/hud/GuiBuilder.h" +#include "../Lua.h" +#include "../../game/hud/GuiBuilder.h" class LuaGuiElement; diff --git a/src/lua/api/menu/mStartGame.h b/src/lua/modules/mStartGame.h similarity index 88% rename from src/lua/api/menu/mStartGame.h rename to src/lua/modules/mStartGame.h index 21f7d4fd..46459417 100644 --- a/src/lua/api/menu/mStartGame.h +++ b/src/lua/modules/mStartGame.h @@ -4,8 +4,8 @@ #pragma once -#include "../../Lua.h" -#include "../../../game/ClientState.h" +#include "../Lua.h" +#include "../../game/ClientState.h" namespace MenuApi { void start_game(ClientState& state, sol::table& core) { diff --git a/src/lua/api/class/LocalLuaAnimationManager.cpp b/src/lua/usertype/LocalLuaAnimationManager.cpp similarity index 92% rename from src/lua/api/class/LocalLuaAnimationManager.cpp rename to src/lua/usertype/LocalLuaAnimationManager.cpp index 82df0dc4..c397a71e 100644 --- a/src/lua/api/class/LocalLuaAnimationManager.cpp +++ b/src/lua/usertype/LocalLuaAnimationManager.cpp @@ -4,9 +4,9 @@ #include "LocalLuaAnimationManager.h" -#include "../../Lua.h" -#include "../../../game/entity/Entity.h" -#include "../../../game/entity/AnimationSegment.h" +#include "../Lua.h" +#include "../../game/entity/Entity.h" +#include "../../game/entity/AnimationSegment.h" LocalLuaAnimationManager::LocalLuaAnimationManager(Entity &entity) : entity(entity) {} diff --git a/src/lua/api/class/LocalLuaAnimationManager.h b/src/lua/usertype/LocalLuaAnimationManager.h similarity index 95% rename from src/lua/api/class/LocalLuaAnimationManager.h rename to src/lua/usertype/LocalLuaAnimationManager.h index fbf31a12..dae45223 100644 --- a/src/lua/api/class/LocalLuaAnimationManager.h +++ b/src/lua/usertype/LocalLuaAnimationManager.h @@ -4,7 +4,7 @@ #pragma once -#include "../../Lua.h" +#include "../Lua.h" class Entity; diff --git a/src/lua/api/class/LocalLuaEntity.cpp b/src/lua/usertype/LocalLuaEntity.cpp similarity index 90% rename from src/lua/api/class/LocalLuaEntity.cpp rename to src/lua/usertype/LocalLuaEntity.cpp index c0c2333a..4f53e2ad 100644 --- a/src/lua/api/class/LocalLuaEntity.cpp +++ b/src/lua/usertype/LocalLuaEntity.cpp @@ -4,12 +4,12 @@ #include "LocalLuaEntity.h" -#include "../../Lua.h" -#include "../../LuaParser.h" -#include "../../../def/LocalSubgame.h" -#include "../../../def/item/BlockDef.h" -#include "../../../def/item/CraftItemDef.h" -#include "../../../def/LocalDefinitionAtlas.h" +#include "../Lua.h" +#include "../LuaParser.h" +#include "../../def/LocalSubgame.h" +#include "../../def/item/BlockDef.h" +#include "../../def/item/CraftItemDef.h" +#include "../../def/LocalDefinitionAtlas.h" void LocalLuaEntity::snap_pos(glm::vec3 pos) { entity->setPos(pos); diff --git a/src/lua/api/class/LocalLuaEntity.h b/src/lua/usertype/LocalLuaEntity.h similarity index 94% rename from src/lua/api/class/LocalLuaEntity.h rename to src/lua/usertype/LocalLuaEntity.h index 29714a47..955fd52c 100644 --- a/src/lua/api/class/LocalLuaEntity.h +++ b/src/lua/usertype/LocalLuaEntity.h @@ -4,9 +4,9 @@ #pragma once -#include "../../Lua.h" +#include "../Lua.h" #include "LocalLuaAnimationManager.h" -#include "../../../game/entity/Entity.h" +#include "../../game/entity/Entity.h" class LocalSubgame; diff --git a/src/lua/api/class/LocalLuaInventory.cpp b/src/lua/usertype/LocalLuaInventory.cpp similarity index 100% rename from src/lua/api/class/LocalLuaInventory.cpp rename to src/lua/usertype/LocalLuaInventory.cpp diff --git a/src/lua/api/class/LocalLuaInventory.h b/src/lua/usertype/LocalLuaInventory.h similarity index 80% rename from src/lua/api/class/LocalLuaInventory.h rename to src/lua/usertype/LocalLuaInventory.h index e04691b4..84e9d748 100644 --- a/src/lua/api/class/LocalLuaInventory.h +++ b/src/lua/usertype/LocalLuaInventory.h @@ -4,8 +4,8 @@ #pragma once -#include "../../Lua.h" -#include "../../../game/inventory/LocalInventory.h" +#include "../Lua.h" +#include "../../game/inventory/LocalInventory.h" class LocalLuaInventory { public: diff --git a/src/lua/api/class/LocalLuaInventoryList.cpp b/src/lua/usertype/LocalLuaInventoryList.cpp similarity index 97% rename from src/lua/api/class/LocalLuaInventoryList.cpp rename to src/lua/usertype/LocalLuaInventoryList.cpp index 44c24f91..b36ab3b9 100644 --- a/src/lua/api/class/LocalLuaInventoryList.cpp +++ b/src/lua/usertype/LocalLuaInventoryList.cpp @@ -5,8 +5,8 @@ #include "LocalLuaInventoryList.h" #include "LuaItemStack.h" -#include "../../../def/ItemDef.h" -#include "../../../def/DefinitionAtlas.h" +#include "../../def/ItemDef.h" +#include "../../def/DefinitionAtlas.h" int LocalLuaInventoryList::get_length() { return list.getLength(); diff --git a/src/lua/api/class/LocalLuaInventoryList.h b/src/lua/usertype/LocalLuaInventoryList.h similarity index 95% rename from src/lua/api/class/LocalLuaInventoryList.h rename to src/lua/usertype/LocalLuaInventoryList.h index 604b76d9..bbf6f951 100644 --- a/src/lua/api/class/LocalLuaInventoryList.h +++ b/src/lua/usertype/LocalLuaInventoryList.h @@ -4,7 +4,7 @@ #pragma once -#include "../../../game/inventory/LocalInventoryList.h" +#include "../../game/inventory/LocalInventoryList.h" class LocalLuaInventoryList { public: diff --git a/src/lua/api/class/LocalLuaPlayer.cpp b/src/lua/usertype/LocalLuaPlayer.cpp similarity index 98% rename from src/lua/api/class/LocalLuaPlayer.cpp rename to src/lua/usertype/LocalLuaPlayer.cpp index 3a6bde2c..209af2e7 100644 --- a/src/lua/api/class/LocalLuaPlayer.cpp +++ b/src/lua/usertype/LocalLuaPlayer.cpp @@ -8,7 +8,7 @@ #include "LuaItemStack.h" #include "LocalLuaInventoryList.h" -#include "../../../game/scene/world/Player.h" +#include "../../game/scene/world/Player.h" glm::vec3 LocalLuaPlayer::get_pos() { return player.getPos(); diff --git a/src/lua/api/class/LocalLuaPlayer.h b/src/lua/usertype/LocalLuaPlayer.h similarity index 100% rename from src/lua/api/class/LocalLuaPlayer.h rename to src/lua/usertype/LocalLuaPlayer.h diff --git a/src/lua/api/class/LuaGuiElement.cpp b/src/lua/usertype/LuaGuiElement.cpp similarity index 99% rename from src/lua/api/class/LuaGuiElement.cpp rename to src/lua/usertype/LuaGuiElement.cpp index e09da110..0b003474 100644 --- a/src/lua/api/class/LuaGuiElement.cpp +++ b/src/lua/usertype/LuaGuiElement.cpp @@ -7,7 +7,7 @@ #include "LuaGuiElement.h" -#include "../../../game/hud/SerialGui.h" +#include "../../game/hud/SerialGui.h" std::shared_ptr LuaGuiElement::create(const std::string& type, sol::table data) { auto elem = std::make_shared(); diff --git a/src/lua/api/class/LuaGuiElement.h b/src/lua/usertype/LuaGuiElement.h similarity index 97% rename from src/lua/api/class/LuaGuiElement.h rename to src/lua/usertype/LuaGuiElement.h index e53bf330..4960e160 100644 --- a/src/lua/api/class/LuaGuiElement.h +++ b/src/lua/usertype/LuaGuiElement.h @@ -6,8 +6,8 @@ #include -#include "../../Lua.h" -#include "../../../util/Any.h" +#include "../Lua.h" +#include "../../util/Any.h" class LuaGuiElement { public: diff --git a/src/lua/api/class/LuaItemStack.cpp b/src/lua/usertype/LuaItemStack.cpp similarity index 84% rename from src/lua/api/class/LuaItemStack.cpp rename to src/lua/usertype/LuaItemStack.cpp index fe5af670..3ec18be4 100644 --- a/src/lua/api/class/LuaItemStack.cpp +++ b/src/lua/usertype/LuaItemStack.cpp @@ -4,10 +4,10 @@ #include "LuaItemStack.h" -#include "../../Lua.h" -#include "../../../def/ItemDef.h" -#include "../../../def/DefinitionAtlas.h" -#include "../../../game/inventory/ItemStack.h" +#include "../Lua.h" +#include "../../def/ItemDef.h" +#include "../../def/DefinitionAtlas.h" +#include "../../game/inventory/ItemStack.h" LuaItemStack::LuaItemStack(const ItemStack &stack, const DefinitionAtlas &defs) : name((stack.count == 0 ? "" : defs.fromId(stack.id).identifier)), diff --git a/src/lua/api/class/LuaItemStack.h b/src/lua/usertype/LuaItemStack.h similarity index 100% rename from src/lua/api/class/LuaItemStack.h rename to src/lua/usertype/LuaItemStack.h diff --git a/src/lua/api/class/ServerLocalLuaEntity.cpp b/src/lua/usertype/ServerLocalLuaEntity.cpp similarity index 86% rename from src/lua/api/class/ServerLocalLuaEntity.cpp rename to src/lua/usertype/ServerLocalLuaEntity.cpp index db5e6386..d6110aab 100644 --- a/src/lua/api/class/ServerLocalLuaEntity.cpp +++ b/src/lua/usertype/ServerLocalLuaEntity.cpp @@ -6,11 +6,11 @@ #include "ServerLocalLuaEntity.h" -#include "../../../def/ItemDef.h" -#include "../../../def/LocalSubgame.h" -#include "../../../def/item/BlockDef.h" -#include "../../../def/item/CraftItemDef.h" -#include "../../../def/LocalDefinitionAtlas.h" +#include "../../def/ItemDef.h" +#include "../../def/LocalSubgame.h" +#include "../../def/item/BlockDef.h" +#include "../../def/item/CraftItemDef.h" +#include "../../def/LocalDefinitionAtlas.h" ServerLocalLuaEntity::ServerLocalLuaEntity(unsigned int id, LocalSubgame &defs, const std::string &appearance, const std::string &arg1, const std::string &arg2) : diff --git a/src/lua/api/class/ServerLocalLuaEntity.h b/src/lua/usertype/ServerLocalLuaEntity.h similarity index 93% rename from src/lua/api/class/ServerLocalLuaEntity.h rename to src/lua/usertype/ServerLocalLuaEntity.h index e66bde97..e273580b 100644 --- a/src/lua/api/class/ServerLocalLuaEntity.h +++ b/src/lua/usertype/ServerLocalLuaEntity.h @@ -6,7 +6,7 @@ #include -#include "../../../game/entity/Entity.h" +#include "../../game/entity/Entity.h" class LocalSubgame; diff --git a/src/lua/api/class/ServerLuaEntity.cpp b/src/lua/usertype/ServerLuaEntity.cpp similarity index 93% rename from src/lua/api/class/ServerLuaEntity.cpp rename to src/lua/usertype/ServerLuaEntity.cpp index e0d6a945..6ec541c9 100644 --- a/src/lua/api/class/ServerLuaEntity.cpp +++ b/src/lua/usertype/ServerLuaEntity.cpp @@ -4,10 +4,10 @@ #include "ServerLuaEntity.h" -#include "../../LuaParser.h" -#include "../../../def/ItemDef.h" -#include "../../../def/ServerSubgame.h" -#include "../../../def/ServerDefinitionAtlas.h" +#include "../LuaParser.h" +#include "../../def/ItemDef.h" +#include "../../def/ServerSubgame.h" +#include "../../def/ServerDefinitionAtlas.h" void ServerLuaEntity::snap_pos(glm::vec3 pos) { entity->setPos(pos); diff --git a/src/lua/api/class/ServerLuaEntity.h b/src/lua/usertype/ServerLuaEntity.h similarity index 93% rename from src/lua/api/class/ServerLuaEntity.h rename to src/lua/usertype/ServerLuaEntity.h index 73cf757c..b9520f68 100644 --- a/src/lua/api/class/ServerLuaEntity.h +++ b/src/lua/usertype/ServerLuaEntity.h @@ -6,8 +6,8 @@ #include -#include "../../Lua.h" -#include "../../../net/server/world/ServerEntity.h" +#include "../Lua.h" +#include "../../net/server/world/ServerEntity.h" class ServerSubgame; diff --git a/src/lua/api/class/ServerLuaInventory.cpp b/src/lua/usertype/ServerLuaInventory.cpp similarity index 100% rename from src/lua/api/class/ServerLuaInventory.cpp rename to src/lua/usertype/ServerLuaInventory.cpp diff --git a/src/lua/api/class/ServerLuaInventory.h b/src/lua/usertype/ServerLuaInventory.h similarity index 91% rename from src/lua/api/class/ServerLuaInventory.h rename to src/lua/usertype/ServerLuaInventory.h index bc7e5e3f..8241a76d 100644 --- a/src/lua/api/class/ServerLuaInventory.h +++ b/src/lua/usertype/ServerLuaInventory.h @@ -4,7 +4,7 @@ #pragma once -#include "../../../game/inventory/Inventory.h" +#include "../../game/inventory/Inventory.h" class ServerLuaInventory { public: diff --git a/src/lua/api/class/ServerLuaInventoryList.cpp b/src/lua/usertype/ServerLuaInventoryList.cpp similarity index 97% rename from src/lua/api/class/ServerLuaInventoryList.cpp rename to src/lua/usertype/ServerLuaInventoryList.cpp index ca950021..cbc077fa 100644 --- a/src/lua/api/class/ServerLuaInventoryList.cpp +++ b/src/lua/usertype/ServerLuaInventoryList.cpp @@ -4,8 +4,8 @@ #include "ServerLuaInventoryList.h" -#include "../../../def/ItemDef.h" -#include "../../../def/DefinitionAtlas.h" +#include "../../def/ItemDef.h" +#include "../../def/DefinitionAtlas.h" void ServerLuaInventoryList::set_length(int length) { list.setLength(length); diff --git a/src/lua/api/class/ServerLuaInventoryList.h b/src/lua/usertype/ServerLuaInventoryList.h similarity index 95% rename from src/lua/api/class/ServerLuaInventoryList.h rename to src/lua/usertype/ServerLuaInventoryList.h index 82fa202d..2bee7d39 100644 --- a/src/lua/api/class/ServerLuaInventoryList.h +++ b/src/lua/usertype/ServerLuaInventoryList.h @@ -5,7 +5,7 @@ #pragma once #include "LuaItemStack.h" -#include "../../../game/inventory/ServerInventoryList.h" +#include "../../game/inventory/ServerInventoryList.h" class ServerLuaInventoryList { public: diff --git a/src/lua/api/class/ServerLuaPlayer.cpp b/src/lua/usertype/ServerLuaPlayer.cpp similarity index 98% rename from src/lua/api/class/ServerLuaPlayer.cpp rename to src/lua/usertype/ServerLuaPlayer.cpp index ca9161ab..62ca6176 100644 --- a/src/lua/api/class/ServerLuaPlayer.cpp +++ b/src/lua/usertype/ServerLuaPlayer.cpp @@ -4,8 +4,8 @@ #include "ServerLuaPlayer.h" -#include "../../LuaParser.h" -#include "../../../net/NetHandler.h" +#include "../LuaParser.h" +#include "../../net/NetHandler.h" #include "ServerLuaInventoryList.h" std::string ServerLuaPlayer::get_name() { diff --git a/src/lua/api/class/ServerLuaPlayer.h b/src/lua/usertype/ServerLuaPlayer.h similarity index 97% rename from src/lua/api/class/ServerLuaPlayer.h rename to src/lua/usertype/ServerLuaPlayer.h index 5e6c478d..9fdb5e27 100644 --- a/src/lua/api/class/ServerLuaPlayer.h +++ b/src/lua/usertype/ServerLuaPlayer.h @@ -4,9 +4,9 @@ #pragma once -#include "../../Lua.h" +#include "../Lua.h" #include "ServerLuaInventory.h" -#include "../../../net/server/conn/ServerClient.h" +#include "../../net/server/conn/ServerClient.h" class ServerLuaPlayer { public: diff --git a/src/lua/api/usertype/cAnimationManager.h b/src/lua/usertype/cAnimationManager.h similarity index 90% rename from src/lua/api/usertype/cAnimationManager.h rename to src/lua/usertype/cAnimationManager.h index 7a02a84d..0d04a5f5 100644 --- a/src/lua/api/usertype/cAnimationManager.h +++ b/src/lua/usertype/cAnimationManager.h @@ -4,7 +4,7 @@ #pragma once -#include "../class/LocalLuaAnimationManager.h" +#include "LocalLuaAnimationManager.h" namespace ClientApi { void animation_manager(sol::state& lua) { diff --git a/src/lua/api/usertype/cInventoryRef.h b/src/lua/usertype/cInventoryRef.h similarity index 96% rename from src/lua/api/usertype/cInventoryRef.h rename to src/lua/usertype/cInventoryRef.h index 3fdb5075..a0be9267 100644 --- a/src/lua/api/usertype/cInventoryRef.h +++ b/src/lua/usertype/cInventoryRef.h @@ -4,9 +4,9 @@ #pragma once -#include "../../Lua.h" -#include "../class/LocalLuaInventory.h" -#include "../class/LocalLuaInventoryList.h" +#include "../Lua.h" +#include "LocalLuaInventory.h" +#include "LocalLuaInventoryList.h" namespace ClientApi { static void inventory(sol::state& lua) { diff --git a/src/lua/api/usertype/cItemStack.h b/src/lua/usertype/cItemStack.h similarity index 89% rename from src/lua/api/usertype/cItemStack.h rename to src/lua/usertype/cItemStack.h index 676144f8..75ed12ad 100644 --- a/src/lua/api/usertype/cItemStack.h +++ b/src/lua/usertype/cItemStack.h @@ -4,8 +4,8 @@ #pragma once -#include "../../Lua.h" -#include "../class/LuaItemStack.h" +#include "../Lua.h" +#include "LuaItemStack.h" namespace ClientApi { static void item_stack(sol::state& lua) { diff --git a/src/lua/api/usertype/cLuaEntity.h b/src/lua/usertype/cLuaEntity.h similarity index 94% rename from src/lua/api/usertype/cLuaEntity.h rename to src/lua/usertype/cLuaEntity.h index a8f502f7..714d874f 100644 --- a/src/lua/api/usertype/cLuaEntity.h +++ b/src/lua/usertype/cLuaEntity.h @@ -4,9 +4,9 @@ #pragma once -#include "../../Lua.h" -#include "../class/LocalLuaEntity.h" -#include "../../../game/scene/world/LocalWorld.h" +#include "../Lua.h" +#include "LocalLuaEntity.h" +#include "../../game/scene/world/LocalWorld.h" namespace ClientApi { void entity(sol::state& lua) { diff --git a/src/lua/api/usertype/sInventoryRef.h b/src/lua/usertype/sInventoryRef.h similarity index 96% rename from src/lua/api/usertype/sInventoryRef.h rename to src/lua/usertype/sInventoryRef.h index a4342a80..7d2667b1 100644 --- a/src/lua/api/usertype/sInventoryRef.h +++ b/src/lua/usertype/sInventoryRef.h @@ -4,9 +4,9 @@ #pragma once -#include "../../Lua.h" -#include "../class/ServerLuaInventory.h" -#include "../class/ServerLuaInventoryList.h" +#include "../Lua.h" +#include "ServerLuaInventory.h" +#include "ServerLuaInventoryList.h" namespace ServerApi { static void inventory(sol::state& lua) { diff --git a/src/lua/api/usertype/sLuaEntity.h b/src/lua/usertype/sLuaEntity.h similarity index 96% rename from src/lua/api/usertype/sLuaEntity.h rename to src/lua/usertype/sLuaEntity.h index 7b200cff..f5b9c2a6 100644 --- a/src/lua/api/usertype/sLuaEntity.h +++ b/src/lua/usertype/sLuaEntity.h @@ -4,8 +4,8 @@ #pragma once -#include "../../Lua.h" -#include "../class/ServerLuaEntity.h" +#include "../Lua.h" +#include "ServerLuaEntity.h" namespace ServerApi { void entity(sol::state& lua) { diff --git a/src/net/server/Server.cpp b/src/net/server/Server.cpp index 815fbd63..01378bd1 100644 --- a/src/net/server/Server.cpp +++ b/src/net/server/Server.cpp @@ -14,8 +14,8 @@ #include "../PacketChannel.h" #include "../../def/item/BlockDef.h" #include "../../def/ServerDefinitionAtlas.h" -#include "../../lua/parser/ServerLuaParser.h" -#include "../../lua/api/class/ServerLuaPlayer.h" +#include "../../lua/ServerLuaParser.h" +#include "../../lua/usertype/ServerLuaPlayer.h" Server::Server(unsigned short port, const std::string& subgame) : seed(69), diff --git a/src/net/server/config/ServerConfig.cpp b/src/net/server/config/ServerConfig.cpp index dd240fcb..cda7fdee 100644 --- a/src/net/server/config/ServerConfig.cpp +++ b/src/net/server/config/ServerConfig.cpp @@ -13,7 +13,7 @@ #include "../../../def/gen/BiomeDef.h" #include "../../../def/gen/ServerBiomeAtlas.h" #include "../../../def/ServerDefinitionAtlas.h" -#include "../../../lua/parser/ServerLuaParser.h" +#include "../../../lua/ServerLuaParser.h" ServerConfig::ServerConfig(ServerSubgame &defs) : game(defs) {} diff --git a/src/net/server/conn/ClientList.cpp b/src/net/server/conn/ClientList.cpp index cae572ca..bf8e3a54 100644 --- a/src/net/server/conn/ClientList.cpp +++ b/src/net/server/conn/ClientList.cpp @@ -11,7 +11,7 @@ #include "../../../util/Log.h" #include "../../../def/ServerSubgame.h" #include "../../client/NetPlayerField.h" -#include "../../../lua/parser/ServerLuaParser.h" +#include "../../../lua/ServerLuaParser.h" ClientList::ClientList(ServerSubgame& defs) : defs(defs) {} diff --git a/src/net/server/world/ServerWorld.cpp b/src/net/server/world/ServerWorld.cpp index 0d38ce6f..34960ede 100644 --- a/src/net/server/world/ServerWorld.cpp +++ b/src/net/server/world/ServerWorld.cpp @@ -20,7 +20,7 @@ #include "../../../world/chunk/MapBlock.h" #include "../../../world/fs/FileManipulator.h" #include "../../../def/ServerDefinitionAtlas.h" -#include "../../../lua/api/class/ServerLuaEntity.h" +#include "../../../lua/usertype/ServerLuaEntity.h" ServerWorld::ServerWorld(unsigned int seed, ServerSubgame& game, ClientList& clients) : clientList(clients), diff --git a/src/world/LocalDimension.cpp b/src/world/LocalDimension.cpp index 5f535c7c..7749c0c9 100644 --- a/src/world/LocalDimension.cpp +++ b/src/world/LocalDimension.cpp @@ -10,11 +10,11 @@ #include "../game/graph/Renderer.h" #include "../world/chunk/MapBlock.h" #include "../def/LocalDefinitionAtlas.h" -#include "../lua/api/class/LocalLuaEntity.h" +#include "../lua/usertype/LocalLuaEntity.h" #include "../game/scene/world/MeshGenStream.h" #include "../game/scene/world/graph/MeshChunk.h" #include "../game/scene/world/ChunkMeshDetails.h" -#include "../lua/api/class/ServerLocalLuaEntity.h" +#include "../lua/usertype/ServerLocalLuaEntity.h" LocalDimension::LocalDimension(LocalSubgame &game) : Dimension(*game.defs), meshGenStream(std::make_shared(game, *this)), diff --git a/src/world/ServerDimension.cpp b/src/world/ServerDimension.cpp index e3610522..40ec518f 100644 --- a/src/world/ServerDimension.cpp +++ b/src/world/ServerDimension.cpp @@ -12,7 +12,7 @@ #include "../def/ServerDefinitionAtlas.h" #include "../net/server/conn/ServerClient.h" #include "../net/server/world/ServerWorld.h" -#include "../lua/api/class/ServerLuaEntity.h" +#include "../lua/usertype/ServerLuaEntity.h" ServerDimension::ServerDimension(ServerSubgame &game) : Dimension(*game.defs), game(game) {} diff --git a/subgames/zeus/menu/textures/particle_group.png b/subgames/zeus/menu/textures/particle_group.png new file mode 100644 index 0000000000000000000000000000000000000000..bb448ae9f4d19485a15c3aea10cd6055d4a5b4c9 GIT binary patch literal 1727 zcmV;w20;0VP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00t*XL_t(|+U;FoZyPrZeRP$$ zX|uIkF>L!VVA%ivS^F{!Ymqcg?Zz(mp>*MT3!1y5BuaV@2!bSsSVuikJo1SL5ClOG z1VIo4F&3oO2dnBc0M7wj0C)hf6_Ep{WB>xFY69>RfS&kAA4N_ zNcQ7FM0Q^PJ5?IoHGtm${0`t1fLj2U0JZ?$amv5g_PN>W=qUxjgR1TTY(!*JjR128 zr>bJB{uO{<0sLaC{~drAs(K?LpE&t?Z8rK2zzYCt`_qGY%qvw*B63rl080iZBC4vN z0PJnWZ|wUXzyW}A@^x+Y{Sm-xTWD)rWFO6D7k2GIMDB_az-e%Iw(2hd{B!d2dl69w z1GXMuUfbe2+WC81XaZmd;JC2%0Jf^SnQOOHX>j)d{xq^&nFn}lzt0k2s%jGfrjd7T zV}EJ(J=%F?iv_mW?v3bcvteEWcn!`7ajU8u0M9IVJUFhNmIKUWUl%s+wcXPj`@NWL zFYTI(C9zzpIXIj2gX8MyA;8qk*DoSK(ZNklYV;9c9&Ef1=1I5aSy#5e?rdAz*)@Cn zDnfvwgPV!00cHUbA5?W~p7hS{L(Hx)+uqvWjs)KoAwcQD%|x~UvmiDnPcg^G>(fW= zjRo89E$5=8JV4RG&D{nv2AHMpVW+A$wz&4Tz%EaouI|mgw@Y#Wz|2~Js=l-wz%dc@ z*x+tJEKLZVXIsC-HzKmwt4ZX+5ntstjvn_QA|KtnP2|BfFfrMxbj7wCuCG}W|G$MW z3wT|sbS1M+#I(sTQl%pS;s#|!s&phkOcblqkpS^lf6*!(2@um(#j129KtLyu`TD1L zAa{`q3Gj4OD}?0~xsU))O_PJsl7oKpZhk%SHchsr6` z#;W7hf1XqL!@j?^oWhFJ-!TE~iGewV!M6bB6lw&4Q4UNnr%;#xQ4dTor%+%Ehc9jEFl~SB?!ZLh7^Pa!oSgngcLyd4O?>uVz$FL}x^r0I z$qx}Udk~<7&SB9eKTOcPm;jA*4vU5`L9^Fh9J+Iua;A)XU2kwZpO+zMo=wh_aj)wN-skh2gXY=fOu6>Dj)~x= zE$|AOmyk1M-s^~hLGv7P$|F%Fb#$YU?;Dw=Fgm&(I&(KgfIvx@ZaQ;EL<&CnU3KOr z0j5npg{Fgh018b;t{^Z*o^7DCk1!4#Sf?g1z?9hm?Wn$iOR0feR_G?+?Jja6G{ zI*KqRMK)Gtq3IC9m=xVuHH4-k31d<##wsZ^9Z49IXskyugfJ%2SdSvxOBzBway#ys zU8;zBZ!je^Rv(zFm=c<<`H5eom|_L3?a5!Pm?8n%oqQL?6baBSToh9zK)X*SE{Z7< zpiQ_brufo?MxB7y_4EL3!c8$n0yGFu#S{t9E?g8-BtW}fz(p~|RB)Wfx><5MO9-8( zf}gCI5*o4kxLsauIae{2I+^^I1)MH&y19y}USfbI1)LGIhpP@&f3t50jqq~I<~=|M zn#8Jdx?Z+`mNki0wTE3i1@xdvtR<(Dg@X>&xht0ud+tysGYv9C=dKa%GtDr{5S_b5 zxz9AwC_{Aa8mU9sR1Yvp=dNKol%)x)Vu;RNqje}t6R#bibJtKE%BBpwTIa69mA;`m zluaQ(mCjuiDt$wBD0?yiDt7KFTIn0DL)p~5t7zx0isjNFUWGfE0Hr&3)vEN3@G9K7 z9-v0&t}2zj0bYgs`92*2w5*-GB2@Z%dljx50V*VD*nNZ`2!bF8f*=TjAP8b6{sqsH V_C)rR_|*Ua002ovPDHLkV1m8g`jG$t literal 0 HcmV?d00001