From 95c01afa0146920a4a73f5522a1403d3d423ed0d Mon Sep 17 00:00:00 2001 From: h4570 Date: Mon, 18 Jul 2022 21:49:38 +0200 Subject: [PATCH] dynamic pipeline base --- .../3d/pipeline/dynamic/dynamic_pipeline.hpp | 37 ++++++ .../3d/pipeline/dynamic/dynpip_options.hpp | 21 ++++ .../core/bag/packaging/stapip_bag_package.hpp | 14 +-- .../bag/packaging/stapip_bag_packager.hpp | 16 +-- .../packaging/stapip_bag_packages_bbox.hpp | 8 +- .../pipeline/static/core/bag/stapip_bag.hpp | 16 +-- .../static/core/bag/stapip_color_bag.hpp | 6 +- .../static/core/bag/stapip_info_bag.hpp | 8 +- .../static/core/bag/stapip_lighting_bag.hpp | 10 +- .../static/core/bag/stapip_texture_bag.hpp | 6 +- .../as_is/stapip_as_is_c_vu1_program.hpp | 8 +- .../as_is/stapip_as_is_d_vu1_program.hpp | 8 +- .../as_is/stapip_as_is_tc_vu1_program.hpp | 8 +- .../as_is/stapip_as_is_td_vu1_program.hpp | 8 +- .../cull/stapip_cull_c_vu1_program.hpp | 8 +- .../cull/stapip_cull_d_vu1_program.hpp | 8 +- .../cull/stapip_cull_tc_vu1_program.hpp | 8 +- .../cull/stapip_cull_td_vu1_program.hpp | 8 +- .../pipeline/static/core/stapip_clipper.hpp | 10 +- .../static/core/stapip_program_name.hpp | 18 +-- .../static/core/stapip_program_type.hpp | 10 +- .../core/stapip_programs_repository.hpp | 24 ++-- .../pipeline/static/core/stapip_qbuffer.hpp | 22 ++-- .../static/core/stapip_qbuffer_renderer.hpp | 40 +++--- .../static/core/stapip_vu1_program.hpp | 16 +-- .../static/core/static_pipeline_core.hpp | 18 +-- .../static/stapip_lighting_options.hpp | 6 +- .../3d/pipeline/static/stapip_options.hpp | 10 +- .../pipeline/static/stapip_shading_type.hpp | 6 +- .../3d/pipeline/static/static_pipeline.hpp | 28 ++--- .../3d/pipeline/dynamic/dynamic_pipeline.cpp | 25 ++++ .../core/bag/packaging/stapip_bag_package.cpp | 12 +- .../bag/packaging/stapip_bag_packager.cpp | 24 ++-- .../packaging/stapip_bag_packages_bbox.cpp | 24 ++-- .../pipeline/static/core/bag/stapip_bag.cpp | 16 +-- .../static/core/bag/stapip_color_bag.cpp | 4 +- .../static/core/bag/stapip_info_bag.cpp | 6 +- .../static/core/bag/stapip_lighting_bag.cpp | 28 ++--- .../static/core/bag/stapip_texture_bag.cpp | 4 +- .../programs/as_is/stapip_as_is_c_vu1.vclpp | 4 +- .../as_is/stapip_as_is_c_vu1_program.cpp | 18 +-- .../programs/as_is/stapip_as_is_d_vu1.vclpp | 4 +- .../as_is/stapip_as_is_d_vu1_program.cpp | 18 +-- .../programs/as_is/stapip_as_is_tc_vu1.vclpp | 4 +- .../as_is/stapip_as_is_tc_vu1_program.cpp | 18 +-- .../programs/as_is/stapip_as_is_td_vu1.vclpp | 4 +- .../as_is/stapip_as_is_td_vu1_program.cpp | 18 +-- .../programs/cull/stapip_cull_c_vu1.vclpp | 4 +- .../cull/stapip_cull_c_vu1_program.cpp | 18 +-- .../programs/cull/stapip_cull_d_vu1.vclpp | 4 +- .../cull/stapip_cull_d_vu1_program.cpp | 18 +-- .../programs/cull/stapip_cull_tc_vu1.vclpp | 4 +- .../cull/stapip_cull_tc_vu1_program.cpp | 18 +-- .../programs/cull/stapip_cull_td_vu1.vclpp | 4 +- .../cull/stapip_cull_td_vu1_program.cpp | 18 +-- .../pipeline/static/core/stapip_clipper.cpp | 18 +-- .../core/stapip_programs_repository.cpp | 24 ++-- .../pipeline/static/core/stapip_qbuffer.cpp | 34 ++--- .../static/core/stapip_qbuffer_renderer.cpp | 118 +++++++++--------- .../static/core/stapip_vu1_program.cpp | 18 +-- .../static/core/static_pipeline_core.cpp | 24 ++-- .../3d/pipeline/static/static_pipeline.cpp | 62 ++++----- samples/h4570/inc/h4570.hpp | 4 +- samples/h4570/src/h4570.cpp | 10 +- samples/wellinator/inc/wellinator.hpp | 4 +- samples/wellinator/src/wellinator.cpp | 10 +- 66 files changed, 571 insertions(+), 488 deletions(-) create mode 100644 engine/inc/renderer/3d/pipeline/dynamic/dynamic_pipeline.hpp create mode 100644 engine/inc/renderer/3d/pipeline/dynamic/dynpip_options.hpp create mode 100644 engine/src/renderer/3d/pipeline/dynamic/dynamic_pipeline.cpp diff --git a/engine/inc/renderer/3d/pipeline/dynamic/dynamic_pipeline.hpp b/engine/inc/renderer/3d/pipeline/dynamic/dynamic_pipeline.hpp new file mode 100644 index 0000000..d86ecdb --- /dev/null +++ b/engine/inc/renderer/3d/pipeline/dynamic/dynamic_pipeline.hpp @@ -0,0 +1,37 @@ +/* +# ______ ____ ___ +# | \/ ____| |___| +# | | | \ | | +#----------------------------------------------------------------------- +# Copyright 2022, tyra - https://github.com/h4570/tyra +# Licenced under Apache License 2.0 +# Sandro Sobczyński +*/ + +#pragma once + +#include +#include "../renderer_3d_pipeline.hpp" +#include "./dynpip_options.hpp" +#include "renderer/core/renderer_core.hpp" +#include "renderer/3d/mesh/dynamic/dynamic_mesh.hpp" + +namespace Tyra { + +class DynamicPipeline : public Renderer3DPipeline { + public: + DynamicPipeline(); + ~DynamicPipeline(); + + void init(RendererCore* core); + + void onUse(); + + /** + * Render 3D data via "meshes". + * This render() method is a bridge to core.render() method. + */ + void render(DynamicMesh* mesh, const DynPipOptions* options = nullptr); +}; + +} // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/dynamic/dynpip_options.hpp b/engine/inc/renderer/3d/pipeline/dynamic/dynpip_options.hpp new file mode 100644 index 0000000..f355b0d --- /dev/null +++ b/engine/inc/renderer/3d/pipeline/dynamic/dynpip_options.hpp @@ -0,0 +1,21 @@ +/* +# ______ ____ ___ +# | \/ ____| |___| +# | | | \ | | +#----------------------------------------------------------------------- +# Copyright 2022, tyra - https://github.com/h4570/tyra +# Licenced under Apache License 2.0 +# Sandro Sobczyński +*/ + +#pragma once + +namespace Tyra { + +class DynPipOptions { + public: + DynPipOptions() {} + ~DynPipOptions() {} +}; + +} // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.hpp b/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.hpp index 5225c05..0ab35e3 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.hpp @@ -15,12 +15,12 @@ namespace Tyra { -class StapipBagPackage { +class StaPipBagPackage { public: - StapipBagPackage(); - ~StapipBagPackage(); + StaPipBagPackage(); + ~StaPipBagPackage(); - StapipBag* bag; + StaPipBag* bag; Vec4* vertices; Vec4* sts; @@ -32,12 +32,12 @@ class StapipBagPackage { CoreBBoxFrustum isInFrustum; /** - * We are creating StapipBagPackagesBBox which checks CoreBBoxBBox for every + * We are creating StaPipBagPackagesBBox which checks CoreBBoxBBox for every * maxVertCount / 3. So this variable is index of starting - * StapipBagPackagesBBox's CoreBBoxBBox. If package have <= maxVertCount / 3 + * StaPipBagPackagesBBox's CoreBBoxBBox. If package have <= maxVertCount / 3 * verts, we will need only single (starting) bbox. if package have * maxVertCount verts, we will calculate CoreBBoxBBox from 3 - * StapipBagPackagesBBox's bboxes. + * StaPipBagPackagesBBox's bboxes. */ u32 indexOf1By3BBox; diff --git a/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packager.hpp b/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packager.hpp index 9b90f9c..848bb9c 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packager.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packager.hpp @@ -19,13 +19,13 @@ namespace Tyra { -class StapipBagPackager { +class StaPipBagPackager { public: - StapipBagPackager(); - ~StapipBagPackager(); + StaPipBagPackager(); + ~StaPipBagPackager(); void init(Renderer3DFrustumPlanes* frustumPlanes); - void setRenderBBox(StapipBagPackagesBBox* bbox) { renderBBox = bbox; } + void setRenderBBox(StaPipBagPackagesBBox* bbox) { renderBBox = bbox; } void setMaxVertCount(const u32& count); /** @@ -33,20 +33,20 @@ class StapipBagPackager { * * @param size Max maxVertCount verts (VU1 buffer size) */ - StapipBagPackage* create(u16* o_size, StapipBag* data, u16 size); + StaPipBagPackage* create(u16* o_size, StaPipBag* data, u16 size); /** * @brief Split render package to smaller packages * * @param size Max maxVertCount verts (VU1 buffer size) */ - StapipBagPackage* create(u16* o_size, const StapipBagPackage& pkg, u16 size); + StaPipBagPackage* create(u16* o_size, const StaPipBagPackage& pkg, u16 size); - CoreBBoxFrustum checkFrustum(const StapipBagPackage& pkg); + CoreBBoxFrustum checkFrustum(const StaPipBagPackage& pkg); private: u32 maxVertCount; Renderer3DFrustumPlanes* frustumPlanes; - StapipBagPackagesBBox* renderBBox; + StaPipBagPackagesBBox* renderBBox; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.hpp b/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.hpp index 9356690..94ddd1f 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.hpp @@ -18,13 +18,13 @@ namespace Tyra { * Splits all 3D input vertices into 16vert parts and creates child bboxes for * it */ -class StapipBagPackagesBBox { +class StaPipBagPackagesBBox { public: - StapipBagPackagesBBox(Vec4* t_vertices, u32* t_faces, const u32& t_facesCount, + StaPipBagPackagesBBox(Vec4* t_vertices, u32* t_faces, const u32& t_facesCount, const u32& t_maxVertCount); - StapipBagPackagesBBox(Vec4* t_vertices, const u32& t_counts, + StaPipBagPackagesBBox(Vec4* t_vertices, const u32& t_counts, const u32& t_maxVertCount); - ~StapipBagPackagesBBox(); + ~StaPipBagPackagesBBox(); void setMaxVertCount(const u32& count); diff --git a/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_bag.hpp b/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_bag.hpp index fd8be94..c3cc7af 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_bag.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_bag.hpp @@ -25,16 +25,16 @@ namespace Tyra { * Supports frustum culling, clipping, lighting, * texture and single color / many colors. */ -class StapipBag { +class StaPipBag { public: - StapipBag(); - ~StapipBag(); + StaPipBag(); + ~StaPipBag(); /** Mandatory. Object info. */ - StapipInfoBag* info; + StaPipInfoBag* info; /** Mandatory. Object color(s). */ - StapipColorBag* color; + StaPipColorBag* color; /** Mandatory. Vertex count. */ u32 count; @@ -43,15 +43,15 @@ class StapipBag { Vec4* vertices; /** Optional. Texture coordinates and image. */ - StapipTextureBag* texture; + StaPipTextureBag* texture; /** Optional. Object lighting. */ - StapipLightingBag* lighting; + StaPipLightingBag* lighting; /** * @param maxVertCount This parameter is available in renderer API. */ - StapipBagPackagesBBox calculateBbox(const u32& maxVertCount); + StaPipBagPackagesBBox calculateBbox(const u32& maxVertCount); void print() const; void print(const char* name) const; diff --git a/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_color_bag.hpp b/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_color_bag.hpp index e17761b..4106cd4 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_color_bag.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_color_bag.hpp @@ -17,10 +17,10 @@ namespace Tyra { /** * @brief Color data. At least one color data is required (single/many). */ -class StapipColorBag { +class StaPipColorBag { public: - StapipColorBag(); - ~StapipColorBag(); + StaPipColorBag(); + ~StaPipColorBag(); /** Optional. Single color for all vertices. */ Color* single; diff --git a/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_info_bag.hpp b/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_info_bag.hpp index 5afaa30..ba79e59 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_info_bag.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_info_bag.hpp @@ -17,15 +17,15 @@ namespace Tyra { -class StapipInfoBag { +class StaPipInfoBag { public: - StapipInfoBag(); - ~StapipInfoBag(); + StaPipInfoBag(); + ~StaPipInfoBag(); /** Mandatory. Model matrix */ M4x4* model; - StapipShadingType shadingType; + StaPipShadingType shadingType; bool blendingEnabled; bool antiAliasingEnabled; bool noClipChecks; diff --git a/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_lighting_bag.hpp b/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_lighting_bag.hpp index 5c9444b..1eebdb5 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_lighting_bag.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_lighting_bag.hpp @@ -16,12 +16,12 @@ namespace Tyra { -enum StapipLightingBagMode { Auto, Manual }; +enum StaPipLightingBagMode { Auto, Manual }; -class StapipLightingBag { +class StaPipLightingBag { public: - explicit StapipLightingBag(const bool& manual = false); - ~StapipLightingBag(); + explicit StaPipLightingBag(const bool& manual = false); + ~StaPipLightingBag(); Vec4* normals; M4x4* lightMatrix; @@ -47,7 +47,7 @@ class StapipLightingBag { void deallocate(); void forceDeallocate(); u8 isAllocated; - StapipLightingBagMode mode; + StaPipLightingBagMode mode; Vec4* lightColors; Vec4* lightDirections; diff --git a/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_texture_bag.hpp b/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_texture_bag.hpp index 4f73dde..b940fe7 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_texture_bag.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/bag/stapip_texture_bag.hpp @@ -15,10 +15,10 @@ namespace Tyra { -class StapipTextureBag { +class StaPipTextureBag { public: - StapipTextureBag(); - ~StapipTextureBag(); + StaPipTextureBag(); + ~StaPipTextureBag(); /** Mandatory. Texture coordinates per vertex. */ Vec4* coordinates; diff --git a/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1_program.hpp b/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1_program.hpp index 79a5d77..1b7d45c 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1_program.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1_program.hpp @@ -16,15 +16,15 @@ namespace Tyra { -class StapipAsIsCVU1Program : public StapipVU1Program { +class StaPipAsIsCVU1Program : public StaPipVU1Program { public: - StapipAsIsCVU1Program(); - ~StapipAsIsCVU1Program(); + StaPipAsIsCVU1Program(); + ~StaPipAsIsCVU1Program(); std::string getStringName() const; void addProgramQBufferDataToPacket(packet2_t* packet, - StapipQBuffer* qbuffer) const; + StaPipQBuffer* qbuffer) const; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1_program.hpp b/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1_program.hpp index f1af9d1..59aa838 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1_program.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1_program.hpp @@ -16,14 +16,14 @@ namespace Tyra { -class StapipAsIsDVU1Program : public StapipVU1Program { +class StaPipAsIsDVU1Program : public StaPipVU1Program { public: - StapipAsIsDVU1Program(); - ~StapipAsIsDVU1Program(); + StaPipAsIsDVU1Program(); + ~StaPipAsIsDVU1Program(); std::string getStringName() const; void addProgramQBufferDataToPacket(packet2_t* packet, - StapipQBuffer* qbuffer) const; + StaPipQBuffer* qbuffer) const; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1_program.hpp b/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1_program.hpp index b2827d0..b026174 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1_program.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1_program.hpp @@ -16,14 +16,14 @@ namespace Tyra { -class StapipAsIsTCVU1Program : public StapipVU1Program { +class StaPipAsIsTCVU1Program : public StaPipVU1Program { public: - StapipAsIsTCVU1Program(); - ~StapipAsIsTCVU1Program(); + StaPipAsIsTCVU1Program(); + ~StaPipAsIsTCVU1Program(); std::string getStringName() const; void addProgramQBufferDataToPacket(packet2_t* packet, - StapipQBuffer* qbuffer) const; + StaPipQBuffer* qbuffer) const; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1_program.hpp b/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1_program.hpp index c1e4147..2d98e3b 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1_program.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1_program.hpp @@ -16,14 +16,14 @@ namespace Tyra { -class StapipAsIsTDVU1Program : public StapipVU1Program { +class StaPipAsIsTDVU1Program : public StaPipVU1Program { public: - StapipAsIsTDVU1Program(); - ~StapipAsIsTDVU1Program(); + StaPipAsIsTDVU1Program(); + ~StaPipAsIsTDVU1Program(); std::string getStringName() const; void addProgramQBufferDataToPacket(packet2_t* packet, - StapipQBuffer* qbuffer) const; + StaPipQBuffer* qbuffer) const; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1_program.hpp b/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1_program.hpp index 5cb6489..ff4bb4a 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1_program.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1_program.hpp @@ -16,14 +16,14 @@ namespace Tyra { -class StapipCullCVU1Program : public StapipVU1Program { +class StaPipCullCVU1Program : public StaPipVU1Program { public: - StapipCullCVU1Program(); - ~StapipCullCVU1Program(); + StaPipCullCVU1Program(); + ~StaPipCullCVU1Program(); std::string getStringName() const; void addProgramQBufferDataToPacket(packet2_t* packet, - StapipQBuffer* qbuffer) const; + StaPipQBuffer* qbuffer) const; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1_program.hpp b/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1_program.hpp index 7463374..c1d35d7 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1_program.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1_program.hpp @@ -16,14 +16,14 @@ namespace Tyra { -class StapipCullDVU1Program : public StapipVU1Program { +class StaPipCullDVU1Program : public StaPipVU1Program { public: - StapipCullDVU1Program(); - ~StapipCullDVU1Program(); + StaPipCullDVU1Program(); + ~StaPipCullDVU1Program(); std::string getStringName() const; void addProgramQBufferDataToPacket(packet2_t* packet, - StapipQBuffer* qbuffer) const; + StaPipQBuffer* qbuffer) const; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1_program.hpp b/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1_program.hpp index 6419e0c..b8d35d3 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1_program.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1_program.hpp @@ -16,14 +16,14 @@ namespace Tyra { -class StapipCullTCVU1Program : public StapipVU1Program { +class StaPipCullTCVU1Program : public StaPipVU1Program { public: - StapipCullTCVU1Program(); - ~StapipCullTCVU1Program(); + StaPipCullTCVU1Program(); + ~StaPipCullTCVU1Program(); std::string getStringName() const; void addProgramQBufferDataToPacket(packet2_t* packet, - StapipQBuffer* qbuffer) const; + StaPipQBuffer* qbuffer) const; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1_program.hpp b/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1_program.hpp index 1007c90..cc0406d 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1_program.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1_program.hpp @@ -16,14 +16,14 @@ namespace Tyra { -class StapipCullTDVU1Program : public StapipVU1Program { +class StaPipCullTDVU1Program : public StaPipVU1Program { public: - StapipCullTDVU1Program(); - ~StapipCullTDVU1Program(); + StaPipCullTDVU1Program(); + ~StaPipCullTDVU1Program(); std::string getStringName() const; void addProgramQBufferDataToPacket(packet2_t* packet, - StapipQBuffer* qbuffer) const; + StaPipQBuffer* qbuffer) const; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/stapip_clipper.hpp b/engine/inc/renderer/3d/pipeline/static/core/stapip_clipper.hpp index 79a03ac..79f9a4a 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/stapip_clipper.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/stapip_clipper.hpp @@ -25,11 +25,11 @@ namespace Tyra { * To be honest clipping algorithm should be moved to VU1 and "AsIs" VU1 program * should be renamed to "Clip" - I don't want to do it now, too much time. */ -class StapipClipper { +class StaPipClipper { public: - StapipClipper(); - ~StapipClipper(); - void clip(StapipQBuffer* buffer); + StaPipClipper(); + ~StaPipClipper(); + void clip(StaPipQBuffer* buffer); void init(const RendererSettings& settings); void setMaxVertCount(const u32& count); void setMVP(M4x4* mvp); @@ -41,7 +41,7 @@ class StapipClipper { void perspectiveDivide(std::vector* vertices); void moveDataToBuffer(const std::vector& vertices, - StapipQBuffer* buffer); + StaPipQBuffer* buffer); }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/stapip_program_name.hpp b/engine/inc/renderer/3d/pipeline/static/core/stapip_program_name.hpp index 1927a3b..363463e 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/stapip_program_name.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/stapip_program_name.hpp @@ -12,20 +12,20 @@ namespace Tyra { -enum StapipProgramName { +enum StaPipProgramName { StdipUndefinedProgram, - StapipCullColor, - StapipAsIsColor, + StaPipCullColor, + StaPipAsIsColor, - StapipCullDirLights, - StapipAsIsDirLights, + StaPipCullDirLights, + StaPipAsIsDirLights, - StapipCullTextureDirLights, - StapipAsIsTextureDirLights, + StaPipCullTextureDirLights, + StaPipAsIsTextureDirLights, - StapipCullTextureColor, - StapipAsIsTextureColor, + StaPipCullTextureColor, + StaPipAsIsTextureColor, }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/stapip_program_type.hpp b/engine/inc/renderer/3d/pipeline/static/core/stapip_program_type.hpp index 55bb7b2..cde8d83 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/stapip_program_type.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/stapip_program_type.hpp @@ -12,11 +12,11 @@ namespace Tyra { -enum StapipProgramType { - StapipVU1Color, - StapipVU1DirLights, - StapipVU1TextureDirLights, - StapipVU1TextureColor, +enum StaPipProgramType { + StaPipVU1Color, + StaPipVU1DirLights, + StaPipVU1TextureDirLights, + StaPipVU1TextureColor, }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/stapip_programs_repository.hpp b/engine/inc/renderer/3d/pipeline/static/core/stapip_programs_repository.hpp index 35a36f6..92550e1 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/stapip_programs_repository.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/stapip_programs_repository.hpp @@ -27,22 +27,22 @@ namespace Tyra { -class StapipProgramsRepository { +class StaPipProgramsRepository { public: - StapipProgramsRepository(); - ~StapipProgramsRepository(); + StaPipProgramsRepository(); + ~StaPipProgramsRepository(); - StapipVU1Program* getProgram(const StapipProgramName& name); + StaPipVU1Program* getProgram(const StaPipProgramName& name); private: - StapipAsIsCVU1Program asIsColor; - StapipCullCVU1Program cullColor; - StapipAsIsDVU1Program asIsLightingColor; - StapipCullDVU1Program cullLightingColor; - StapipAsIsTDVU1Program asIsLightingTextureColor; - StapipCullTDVU1Program cullLightingTextureColor; - StapipAsIsTCVU1Program asIsTextureColor; - StapipCullTCVU1Program cullTextureColor; + StaPipAsIsCVU1Program asIsColor; + StaPipCullCVU1Program cullColor; + StaPipAsIsDVU1Program asIsLightingColor; + StaPipCullDVU1Program cullLightingColor; + StaPipAsIsTDVU1Program asIsLightingTextureColor; + StaPipCullTDVU1Program cullLightingTextureColor; + StaPipAsIsTCVU1Program asIsTextureColor; + StaPipCullTCVU1Program cullTextureColor; VU1DrawFinish drawFinish; }; diff --git a/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer.hpp b/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer.hpp index e1a7e16..e873e63 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer.hpp @@ -18,10 +18,10 @@ namespace Tyra { -class StapipQBuffer { +class StaPipQBuffer { public: - StapipQBuffer(); - ~StapipQBuffer(); + StaPipQBuffer(); + ~StaPipQBuffer(); void setMaxVertCount(const u32& count); @@ -29,27 +29,27 @@ class StapipQBuffer { * @brief Dont allocate any dynamic data in buffer. * Just copy pointers to input data. */ - void fillByPointer(const StapipBagPackage& pkg); + void fillByPointer(const StaPipBagPackage& pkg); /** * @brief Allocate dynamic data in buffer * And copy input data to it. */ - void fillByCopyMax(const StapipBagPackage& pkg1, const StapipBagPackage& pkg2, - const StapipBagPackage& pkg3); + void fillByCopyMax(const StaPipBagPackage& pkg1, const StaPipBagPackage& pkg2, + const StaPipBagPackage& pkg3); /** * @brief Allocate dynamic data in buffer * And copy input data to it. */ - void fillByCopy1By2(const StapipBagPackage& pkg1, - const StapipBagPackage& pkg2); + void fillByCopy1By2(const StaPipBagPackage& pkg1, + const StaPipBagPackage& pkg2); /** * @brief Allocate dynamic data in buffer * And copy input data to it. */ - void fillByCopy1By3(const StapipBagPackage& pkg); + void fillByCopy1By3(const StaPipBagPackage& pkg); /** * @brief Deallocate dynamic data if it was allocated and allocate new data @@ -60,7 +60,7 @@ class StapipQBuffer { bool any() const; - StapipBag* bag; + StaPipBag* bag; Vec4* vertices; Vec4* sts; @@ -76,7 +76,7 @@ class StapipQBuffer { private: u32 maxVertCount; void deallocateDynamicData(); - void allocateDynamicData(u16 size, StapipBag* bag); + void allocateDynamicData(u16 size, StaPipBag* bag); u8 _isDynamicallyAllocated, _stAllocated, _colorAllocated, _normalAllocated; }; diff --git a/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer_renderer.hpp b/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer_renderer.hpp index 6d0a41e..1dfba35 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer_renderer.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer_renderer.hpp @@ -28,10 +28,10 @@ namespace Tyra { -class StapipQBufferRenderer { +class StaPipQBufferRenderer { public: - StapipQBufferRenderer(); - ~StapipQBufferRenderer(); + StaPipQBufferRenderer(); + ~StaPipQBufferRenderer(); void init(RendererCore* t_core); @@ -39,26 +39,26 @@ class StapipQBufferRenderer { void setClipperMVP(M4x4* mvp) { clipper.setMVP(mvp); } - StapipQBuffer* getBuffer(); + StaPipQBuffer* getBuffer(); - void sendObjectData(StapipBag* bag, M4x4* mvp, + void sendObjectData(StaPipBag* bag, M4x4* mvp, RendererCoreTextureBuffers* texBuffers) const; void setMaxVertCount(const u32& count); - void setInfo(StapipInfoBag* bag); + void setInfo(StaPipInfoBag* bag); /** Fast render with culling */ - void cull(StapipQBuffer* buffer); + void cull(StaPipQBuffer* buffer); /** Slower render with clipping */ - void clip(StapipQBuffer* buffer); + void clip(StaPipQBuffer* buffer); void clearLastProgramName(); - StapipVU1Program* getCullProgramByBag(const StapipBag* bag); + StaPipVU1Program* getCullProgramByBag(const StaPipBag* bag); - StapipVU1Program* getCullProgramByParams(const bool& isLightingEnabled, + StaPipVU1Program* getCullProgramByParams(const bool& isLightingEnabled, const bool& isTextureEnabled); const u16& getBufferSize() { return bufferSize; } @@ -69,27 +69,27 @@ class StapipQBufferRenderer { void uploadPrograms(); void setDoubleBuffer(); - StapipVU1Program* getProgramByName(const StapipProgramName& name); - void addBufferDataToPacket(StapipVU1Program* program, StapipQBuffer* buffer); + StaPipVU1Program* getProgramByName(const StaPipProgramName& name); + void addBufferDataToPacket(StaPipVU1Program* program, StaPipQBuffer* buffer); void sendPacket(); - StapipVU1Program* getAsIsProgramByBag(const StapipBag* bag); - StapipVU1Program* getCullProgramByType(const StapipProgramType& programType); - StapipProgramType getDrawProgramTypeByBag(const StapipBag* bag) const; - StapipProgramType getDrawProgramTypeByParams( + StaPipVU1Program* getAsIsProgramByBag(const StaPipBag* bag); + StaPipVU1Program* getCullProgramByType(const StaPipProgramType& programType); + StaPipProgramType getDrawProgramTypeByBag(const StaPipBag* bag) const; + StaPipProgramType getDrawProgramTypeByParams( const bool& isLightingEnabled, const bool& isTextureEnabled) const; packet2_t* packets[2]; packet2_t* programsPacket; - StapipQBuffer buffers[2]; + StaPipQBuffer buffers[2]; packet2_t* currentPacket; packet2_t* staticDataPacket; packet2_t* objectDataPacket; RendererCore* rendererCore; - StapipProgramName lastProgramName; + StaPipProgramName lastProgramName; Path1* path1; - StapipClipper clipper; - StapipProgramsRepository repository; + StaPipClipper clipper; + StaPipProgramsRepository repository; u16 bufferSize; u8 context; diff --git a/engine/inc/renderer/3d/pipeline/static/core/stapip_vu1_program.hpp b/engine/inc/renderer/3d/pipeline/static/core/stapip_vu1_program.hpp index 5842e52..b4b5eb4 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/stapip_vu1_program.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/stapip_vu1_program.hpp @@ -17,33 +17,33 @@ namespace Tyra { -class StapipVU1Program : public VU1Program { +class StaPipVU1Program : public VU1Program { public: - StapipVU1Program(const StapipProgramName& name, u32* start, u32* end, + StaPipVU1Program(const StaPipProgramName& name, u32* start, u32* end, const u32& t_reglist, const u8& t_reglistCount, const u8& t_elementsPerVertex); - ~StapipVU1Program(); + ~StaPipVU1Program(); u32& getReglist(); - const StapipProgramName& getName() const; + const StaPipProgramName& getName() const; u16 getMaxVertCount(const bool& singleColorEnabled, const u16& vu1DBufferSize) const; - void addBufferDataToPacket(packet2_t* packet, StapipQBuffer* buffer, + void addBufferDataToPacket(packet2_t* packet, StaPipQBuffer* buffer, prim_t* prim); protected: - StapipProgramName name; + StaPipProgramName name; u8 reglistCount, elementsPerVertex; u32 destinationAddress, reglist; virtual void addProgramQBufferDataToPacket(packet2_t* packet, - StapipQBuffer* qbuffer) const = 0; + StaPipQBuffer* qbuffer) const = 0; private: - void addStandardBufferDataToPacket(packet2_t* packet, StapipQBuffer* buffer, + void addStandardBufferDataToPacket(packet2_t* packet, StaPipQBuffer* buffer, prim_t* prim); }; diff --git a/engine/inc/renderer/3d/pipeline/static/core/static_pipeline_core.hpp b/engine/inc/renderer/3d/pipeline/static/core/static_pipeline_core.hpp index 3079ceb..6cfb27b 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/static_pipeline_core.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/static_pipeline_core.hpp @@ -19,15 +19,15 @@ namespace Tyra { -class StapipelineCore { +class StaPipelineCore { public: - StapipelineCore(); - ~StapipelineCore(); + StaPipelineCore(); + ~StaPipelineCore(); void init(RendererCore* t_core); /** Render 3D data via "bags" */ - void render(StapipBag* data, StapipBagPackagesBBox* bbox = nullptr); + void render(StaPipBag* data, StaPipBagPackagesBBox* bbox = nullptr); /** Get max vert count of VU1 qbuffer (for optimizations) */ u32 getMaxVertCountByParams(const bool& isSingleColor, @@ -35,7 +35,7 @@ class StapipelineCore { const bool& isTextureEnabled); /** Get max vert count of VU1 qbuffer (for optimizations) */ - u32 getMaxVertCountByBag(const StapipBag* bag); + u32 getMaxVertCountByBag(const StaPipBag* bag); /** * - Uploads standard VU1 programs. @@ -50,10 +50,10 @@ class StapipelineCore { RendererCore* rendererCore; void setMaxVertCount(const u32& count); - StapipBagPackager packager; - StapipQBufferRenderer qbufferRenderer; - void renderPkgs(StapipBagPackage* packages, u16 count); - void renderSubpkgs(StapipBagPackage* packages, u16 count); + StaPipBagPackager packager; + StaPipQBufferRenderer qbufferRenderer; + void renderPkgs(StaPipBagPackage* packages, u16 count); + void renderSubpkgs(StaPipBagPackage* packages, u16 count); }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/stapip_lighting_options.hpp b/engine/inc/renderer/3d/pipeline/static/stapip_lighting_options.hpp index 0bc1e4a..039e681 100644 --- a/engine/inc/renderer/3d/pipeline/static/stapip_lighting_options.hpp +++ b/engine/inc/renderer/3d/pipeline/static/stapip_lighting_options.hpp @@ -15,10 +15,10 @@ namespace Tyra { -class StapipLightingOptions { +class StaPipLightingOptions { public: - StapipLightingOptions() {} - ~StapipLightingOptions() {} + StaPipLightingOptions() {} + ~StaPipLightingOptions() {} /** * Mandatory. diff --git a/engine/inc/renderer/3d/pipeline/static/stapip_options.hpp b/engine/inc/renderer/3d/pipeline/static/stapip_options.hpp index 13d2797..2630ce0 100644 --- a/engine/inc/renderer/3d/pipeline/static/stapip_options.hpp +++ b/engine/inc/renderer/3d/pipeline/static/stapip_options.hpp @@ -15,18 +15,18 @@ namespace Tyra { -class StapipOptions { +class StaPipOptions { public: - StapipOptions() {} - ~StapipOptions() {} + StaPipOptions() {} + ~StaPipOptions() {} - StapipShadingType shadingType; + StaPipShadingType shadingType; bool blendingEnabled; bool antiAliasingEnabled; bool noClipChecks; /** Optional */ - StapipLightingOptions* lighting; + StaPipLightingOptions* lighting; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/stapip_shading_type.hpp b/engine/inc/renderer/3d/pipeline/static/stapip_shading_type.hpp index 6068900..544242b 100644 --- a/engine/inc/renderer/3d/pipeline/static/stapip_shading_type.hpp +++ b/engine/inc/renderer/3d/pipeline/static/stapip_shading_type.hpp @@ -12,9 +12,9 @@ namespace Tyra { -enum StapipShadingType { - StapipShadingFlat, - StapipShadingGouraud, +enum StaPipShadingType { + StaPipShadingFlat, + StaPipShadingGouraud, }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/static_pipeline.hpp b/engine/inc/renderer/3d/pipeline/static/static_pipeline.hpp index 070e3a6..6647910 100644 --- a/engine/inc/renderer/3d/pipeline/static/static_pipeline.hpp +++ b/engine/inc/renderer/3d/pipeline/static/static_pipeline.hpp @@ -19,10 +19,10 @@ namespace Tyra { -class Stapipeline : public Renderer3DPipeline { +class StaticPipeline : public Renderer3DPipeline { public: - Stapipeline(); - ~Stapipeline(); + StaticPipeline(); + ~StaticPipeline(); void init(RendererCore* core); @@ -30,30 +30,30 @@ class Stapipeline : public Renderer3DPipeline { /** * Render 3D data via "meshes". - * This render() method is a bridge to core.renderer3D.render() method. + * This render() method is a bridge to core.render() method. */ - void render(DynamicMesh* mesh, const StapipOptions* options = nullptr); + void render(DynamicMesh* mesh, const StaPipOptions* options = nullptr); private: - StapipelineCore core; + StaPipelineCore core; RendererCore* rendererCore; Vec4* colorsCache; - void addVertices(DynamicMesh* mesh, MeshMaterial* material, StapipBag* bag, + void addVertices(DynamicMesh* mesh, MeshMaterial* material, StaPipBag* bag, MeshFrame* frameFrom, MeshFrame* frameTo) const; - StapipInfoBag* getInfoBag(DynamicMesh* mesh, const StapipOptions* options, + StaPipInfoBag* getInfoBag(DynamicMesh* mesh, const StaPipOptions* options, M4x4* model) const; - StapipColorBag* getColorBag(DynamicMesh* mesh, MeshMaterial* material, + StaPipColorBag* getColorBag(DynamicMesh* mesh, MeshMaterial* material, MeshFrame* frameFrom, MeshFrame* frameTo) const; - StapipTextureBag* getTextureBag(DynamicMesh* mesh, MeshMaterial* material, + StaPipTextureBag* getTextureBag(DynamicMesh* mesh, MeshMaterial* material, MeshFrame* frameFrom, MeshFrame* frameTo); - StapipLightingBag* getLightingBag(DynamicMesh* mesh, MeshMaterial* material, + StaPipLightingBag* getLightingBag(DynamicMesh* mesh, MeshMaterial* material, M4x4* model, MeshFrame* frameFrom, MeshFrame* frameTo, - const StapipOptions* options) const; - void deallocDrawBags(StapipBag* bag, MeshMaterial* material) const; + const StaPipOptions* options) const; + void deallocDrawBags(StaPipBag* bag, MeshMaterial* material) const; - void setLightingColorsCache(StapipLightingOptions* lightingOptions); + void setLightingColorsCache(StaPipLightingOptions* lightingOptions); }; } // namespace Tyra diff --git a/engine/src/renderer/3d/pipeline/dynamic/dynamic_pipeline.cpp b/engine/src/renderer/3d/pipeline/dynamic/dynamic_pipeline.cpp new file mode 100644 index 0000000..8b74c7a --- /dev/null +++ b/engine/src/renderer/3d/pipeline/dynamic/dynamic_pipeline.cpp @@ -0,0 +1,25 @@ +/* +# ______ ____ ___ +# | \/ ____| |___| +# | | | \ | | +#----------------------------------------------------------------------- +# Copyright 2022, tyra - https://github.com/h4570/tyra +# Licenced under Apache License 2.0 +# Sandro Sobczyński +*/ + +#include "renderer/3d/pipeline/dynamic/dynamic_pipeline.hpp" + +namespace Tyra { + +DynamicPipeline::DynamicPipeline() {} + +DynamicPipeline::~DynamicPipeline() {} + +void DynamicPipeline::init(RendererCore* t_core) {} + +void DynamicPipeline::onUse() {} + +void DynamicPipeline::render(DynamicMesh* mesh, const DynPipOptions* options) {} + +} // namespace Tyra diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.cpp index 3c9e834..1f953f8 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.cpp @@ -16,7 +16,7 @@ namespace Tyra { -StapipBagPackage::StapipBagPackage() { +StaPipBagPackage::StaPipBagPackage() { size = 0; bag = nullptr; vertices = nullptr; @@ -24,24 +24,24 @@ StapipBagPackage::StapipBagPackage() { normals = nullptr; colors = nullptr; } -StapipBagPackage::~StapipBagPackage() {} +StaPipBagPackage::~StaPipBagPackage() {} -void StapipBagPackage::print() const { +void StaPipBagPackage::print() const { auto text = getPrint(nullptr); printf("%s\n", text.c_str()); } -void StapipBagPackage::print(const char* name) const { +void StaPipBagPackage::print(const char* name) const { auto text = getPrint(name); printf("%s\n", text.c_str()); } -std::string StapipBagPackage::getPrint(const char* name) const { +std::string StaPipBagPackage::getPrint(const char* name) const { std::stringstream res; if (name) { res << name << "("; } else { - res << "StapipBagPackage("; + res << "StaPipBagPackage("; } res << std::fixed << std::setprecision(2); res << std::endl; diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packager.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packager.cpp index 6cb0af3..f484702 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packager.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packager.cpp @@ -15,10 +15,10 @@ namespace Tyra { -StapipBagPackager::StapipBagPackager() {} -StapipBagPackager::~StapipBagPackager() {} +StaPipBagPackager::StaPipBagPackager() {} +StaPipBagPackager::~StaPipBagPackager() {} -void StapipBagPackager::init(Renderer3DFrustumPlanes* t_frustumPlanes) { +void StaPipBagPackager::init(Renderer3DFrustumPlanes* t_frustumPlanes) { frustumPlanes = t_frustumPlanes; } @@ -27,13 +27,13 @@ void StapipBagPackager::init(Renderer3DFrustumPlanes* t_frustumPlanes) { * * @param size Max maxVertCount verts (VU1 buffer size) */ -StapipBagPackage* StapipBagPackager::create(u16* o_size, StapipBag* data, +StaPipBagPackage* StaPipBagPackager::create(u16* o_size, StaPipBag* data, u16 size) { - TYRA_ASSERT(size <= maxVertCount, "StapipBagPackage can have max ", + TYRA_ASSERT(size <= maxVertCount, "StaPipBagPackage can have max ", maxVertCount, " verts. Provided \"", size, "\""); *o_size = ceil(data->count / static_cast(size)); - StapipBagPackage* result = new StapipBagPackage[*o_size]; + StaPipBagPackage* result = new StaPipBagPackage[*o_size]; for (u16 i = 0; i < *o_size; i++) { result[i].bag = data; @@ -65,14 +65,14 @@ StapipBagPackage* StapipBagPackager::create(u16* o_size, StapipBag* data, * * @param size Max maxVertCount verts (VU1 buffer size) */ -StapipBagPackage* StapipBagPackager::create(u16* o_count, - const StapipBagPackage& pkg, +StaPipBagPackage* StaPipBagPackager::create(u16* o_count, + const StaPipBagPackage& pkg, u16 size) { - TYRA_ASSERT(size <= maxVertCount, "StapipBagPackage can have max ", + TYRA_ASSERT(size <= maxVertCount, "StaPipBagPackage can have max ", maxVertCount, " verts. Provided \"", size, "\""); *o_count = ceil(pkg.size / static_cast(size)); - auto* result = new StapipBagPackage[*o_count]; + auto* result = new StaPipBagPackage[*o_count]; for (u16 i = 0; i < *o_count; i++) { result[i].bag = pkg.bag; @@ -99,7 +99,7 @@ StapipBagPackage* StapipBagPackager::create(u16* o_count, return result; } -CoreBBoxFrustum StapipBagPackager::checkFrustum(const StapipBagPackage& pkg) { +CoreBBoxFrustum StaPipBagPackager::checkFrustum(const StaPipBagPackage& pkg) { if (pkg.size <= (maxVertCount / 3)) { // Is subpackage auto& bbox = renderBBox->getChildBBox1By3(pkg.indexOf1By3BBox); return bbox.clipIsInFrustum(frustumPlanes->getAll(), *pkg.bag->info->model); @@ -112,7 +112,7 @@ CoreBBoxFrustum StapipBagPackager::checkFrustum(const StapipBagPackage& pkg) { } } -void StapipBagPackager::setMaxVertCount(const u32& count) { +void StaPipBagPackager::setMaxVertCount(const u32& count) { maxVertCount = count; } diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.cpp index ec269c4..c802719 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.cpp @@ -18,7 +18,7 @@ namespace Tyra { -StapipBagPackagesBBox::StapipBagPackagesBBox(Vec4* t_vertices, u32* t_faces, +StaPipBagPackagesBBox::StaPipBagPackagesBBox(Vec4* t_vertices, u32* t_faces, const u32& t_facesCount, const u32& t_maxVertCount) { u32 splitPartSize = t_maxVertCount / 3; @@ -35,7 +35,7 @@ StapipBagPackagesBBox::StapipBagPackagesBBox(Vec4* t_vertices, u32* t_faces, mainBBox = new RenderBBox(*bboxParts, 0, partsCount); } -StapipBagPackagesBBox::StapipBagPackagesBBox(Vec4* t_vertices, +StaPipBagPackagesBBox::StaPipBagPackagesBBox(Vec4* t_vertices, const u32& t_count, const u32& t_maxVertCount) { u32 splitPartSize = t_maxVertCount / 3; @@ -52,40 +52,40 @@ StapipBagPackagesBBox::StapipBagPackagesBBox(Vec4* t_vertices, mainBBox = new RenderBBox(*bboxParts, 0, partsCount); } -const RenderBBox& StapipBagPackagesBBox::getChildBBox1By3( +const RenderBBox& StaPipBagPackagesBBox::getChildBBox1By3( const u32& index) const { TYRA_ASSERT(index < partsCount, "Index out of range. Provided index: ", index); return static_cast(bboxParts->at(index)); } -RenderBBox* StapipBagPackagesBBox::getMainBBox() { return mainBBox; } +RenderBBox* StaPipBagPackagesBBox::getMainBBox() { return mainBBox; } -const u32& StapipBagPackagesBBox::getPartsCount() const { return partsCount; } +const u32& StaPipBagPackagesBBox::getPartsCount() const { return partsCount; } -const u32& StapipBagPackagesBBox::getVertexCount() const { return vertexCount; } +const u32& StaPipBagPackagesBBox::getVertexCount() const { return vertexCount; } -RenderBBox StapipBagPackagesBBox::createChildBBox(const u32& index, +RenderBBox StaPipBagPackagesBBox::createChildBBox(const u32& index, const u16& partsSize) const { return RenderBBox(*bboxParts, index, partsSize); } -void StapipBagPackagesBBox::print() const { +void StaPipBagPackagesBBox::print() const { auto text = getPrint(nullptr); printf("%s\n", text.c_str()); } -void StapipBagPackagesBBox::print(const char* name) const { +void StaPipBagPackagesBBox::print(const char* name) const { auto text = getPrint(name); printf("%s\n", text.c_str()); } -std::string StapipBagPackagesBBox::getPrint(const char* name) const { +std::string StaPipBagPackagesBBox::getPrint(const char* name) const { std::stringstream res; if (name) { res << name << "("; } else { - res << "StapipBagPackagesBBox("; + res << "StaPipBagPackagesBBox("; } res << std::fixed << std::setprecision(2); res << std::endl; @@ -106,7 +106,7 @@ std::string StapipBagPackagesBBox::getPrint(const char* name) const { return res.str(); } -StapipBagPackagesBBox::~StapipBagPackagesBBox() { +StaPipBagPackagesBBox::~StaPipBagPackagesBBox() { delete bboxParts; delete mainBBox; } diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_bag.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_bag.cpp index 051caf0..fe989fd 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_bag.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_bag.cpp @@ -14,37 +14,37 @@ namespace Tyra { -StapipBag::StapipBag() { +StaPipBag::StaPipBag() { info = nullptr; color = nullptr; texture = nullptr; lighting = nullptr; } -StapipBag::~StapipBag() {} +StaPipBag::~StaPipBag() {} -StapipBagPackagesBBox StapipBag::calculateBbox(const u32& maxVertCount) { +StaPipBagPackagesBBox StaPipBag::calculateBbox(const u32& maxVertCount) { TYRA_ASSERT(vertices != nullptr, "Vertices are required to calculate bbox"); TYRA_ASSERT(count > 0, "Count must be greater than 0 to calculate bbox"); - return StapipBagPackagesBBox(vertices, count, maxVertCount); + return StaPipBagPackagesBBox(vertices, count, maxVertCount); } -void StapipBag::print() const { +void StaPipBag::print() const { auto text = getPrint(nullptr); printf("%s\n", text.c_str()); } -void StapipBag::print(const char* name) const { +void StaPipBag::print(const char* name) const { auto text = getPrint(name); printf("%s\n", text.c_str()); } -std::string StapipBag::getPrint(const char* name) const { +std::string StaPipBag::getPrint(const char* name) const { std::stringstream res; if (name) { res << name << "("; } else { - res << "StapipBag("; + res << "StaPipBag("; } res << std::fixed << std::setprecision(4); res << std::endl; diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_color_bag.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_color_bag.cpp index 470f120..e428735 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_color_bag.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_color_bag.cpp @@ -12,11 +12,11 @@ namespace Tyra { -StapipColorBag::StapipColorBag() { +StaPipColorBag::StaPipColorBag() { single = nullptr; many = nullptr; } -StapipColorBag::~StapipColorBag() {} +StaPipColorBag::~StaPipColorBag() {} } // namespace Tyra diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_info_bag.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_info_bag.cpp index 4f55491..9dd6b34 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_info_bag.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_info_bag.cpp @@ -12,13 +12,13 @@ namespace Tyra { -StapipInfoBag::StapipInfoBag() { - shadingType = StapipShadingFlat; +StaPipInfoBag::StaPipInfoBag() { + shadingType = StaPipShadingFlat; blendingEnabled = true; antiAliasingEnabled = false; model = nullptr; } -StapipInfoBag::~StapipInfoBag() {} +StaPipInfoBag::~StaPipInfoBag() {} } // namespace Tyra diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_lighting_bag.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_lighting_bag.cpp index 126156a..4f56e2e 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_lighting_bag.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_lighting_bag.cpp @@ -13,7 +13,7 @@ namespace Tyra { -StapipLightingBag::StapipLightingBag(const bool& manual) { +StaPipLightingBag::StaPipLightingBag(const bool& manual) { isAllocated = false; mode = Auto; normals = nullptr; @@ -27,24 +27,24 @@ StapipLightingBag::StapipLightingBag(const bool& manual) { } } -StapipLightingBag::~StapipLightingBag() { deallocate(); } +StaPipLightingBag::~StaPipLightingBag() { deallocate(); } -void StapipLightingBag::setAmbientColor(const Color& color) { +void StaPipLightingBag::setAmbientColor(const Color& color) { TYRA_ASSERT(mode != Manual, "Ambient color cannot be set in manual mode"); lightColors[3].set(reinterpret_cast(color)); } -void StapipLightingBag::setDirectionalLightColors(Color* colors, +void StaPipLightingBag::setDirectionalLightColors(Color* colors, const u8& count) { for (u8 i = 0; i < count; i++) setDirectionalLightColor(colors[i], i); } -void StapipLightingBag::setDirectionalLightDirections(Vec4* directions, +void StaPipLightingBag::setDirectionalLightDirections(Vec4* directions, const u8& count) { for (u8 i = 0; i < count; i++) setDirectionalLightDirection(directions[i], i); } -void StapipLightingBag::setDirectionalLightColor(const Color& color, +void StaPipLightingBag::setDirectionalLightColor(const Color& color, const u8& index) { TYRA_ASSERT(mode != Manual, "Directional lights cannot be set in manual mode"); @@ -52,7 +52,7 @@ void StapipLightingBag::setDirectionalLightColor(const Color& color, lightColors[index].set(reinterpret_cast(color)); } -void StapipLightingBag::setDirectionalLightDirection(const Vec4& direction, +void StaPipLightingBag::setDirectionalLightDirection(const Vec4& direction, const u8& index) { TYRA_ASSERT(mode != Manual, "Directional lights cannot be set in manual mode"); @@ -61,19 +61,19 @@ void StapipLightingBag::setDirectionalLightDirection(const Vec4& direction, lightDirections[index].set(direction); } -void StapipLightingBag::setLightsManually(Vec4* colors, Vec4* directions) { +void StaPipLightingBag::setLightsManually(Vec4* colors, Vec4* directions) { deallocate(); lightColors = colors; lightDirections = directions; mode = Manual; } -void StapipLightingBag::disableManualMode() { +void StaPipLightingBag::disableManualMode() { allocate(); mode = Auto; } -void StapipLightingBag::allocate() { +void StaPipLightingBag::allocate() { if (isAllocated) return; lightColors = new Vec4[4]; @@ -92,27 +92,27 @@ void StapipLightingBag::allocate() { isAllocated = true; } -void StapipLightingBag::deallocate() { +void StaPipLightingBag::deallocate() { if (!isAllocated) return; forceDeallocate(); } -void StapipLightingBag::forceDeallocate() { +void StaPipLightingBag::forceDeallocate() { forceDeallocateColors(); forceDeallocateDirections(); isAllocated = false; } -void StapipLightingBag::forceDeallocateColors() { +void StaPipLightingBag::forceDeallocateColors() { if (lightColors != nullptr) { delete[] lightColors; lightColors = nullptr; } } -void StapipLightingBag::forceDeallocateDirections() { +void StaPipLightingBag::forceDeallocateDirections() { if (lightDirections != nullptr) { delete[] lightDirections; lightDirections = nullptr; diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_texture_bag.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_texture_bag.cpp index 0826b5b..b643c48 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_texture_bag.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_texture_bag.cpp @@ -12,11 +12,11 @@ namespace Tyra { -StapipTextureBag::StapipTextureBag() { +StaPipTextureBag::StaPipTextureBag() { coordinates = nullptr; texture = nullptr; } -StapipTextureBag::~StapipTextureBag() {} +StaPipTextureBag::~StaPipTextureBag() {} } // namespace Tyra diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1.vclpp b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1.vclpp index 6267f3f..ea6ced3 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1.vclpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1.vclpp @@ -13,7 +13,7 @@ ;--------------------------------------------------------------- .syntax new -.name StapipVU1As_Is_C +.name StaPipVU1As_Is_C .vu .init_vf_all .init_vi_all @@ -28,7 +28,7 @@ --enter --endenter -#vuprog StapipVU1AsIsC +#vuprog StaPipVU1AsIsC LoadTyraStaticData{ gifSetTag } LoadTyraSingleColor{ singleColor, singleColorEnabled, VU1_SINGLE_COLOR_ADDR, VU1_OPTIONS_ADDR } diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1_program.cpp b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1_program.cpp index 245fa43..608a3c8 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1_program.cpp @@ -11,25 +11,25 @@ #include "debug/debug.hpp" #include "renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_c_vu1_program.hpp" -extern u32 StapipVU1As_Is_C_CodeStart __attribute__((section(".vudata"))); -extern u32 StapipVU1As_Is_C_CodeEnd __attribute__((section(".vudata"))); +extern u32 StaPipVU1As_Is_C_CodeStart __attribute__((section(".vudata"))); +extern u32 StaPipVU1As_Is_C_CodeEnd __attribute__((section(".vudata"))); namespace Tyra { -StapipAsIsCVU1Program::StapipAsIsCVU1Program() - : StapipVU1Program(StapipAsIsColor, &StapipVU1As_Is_C_CodeStart, - &StapipVU1As_Is_C_CodeEnd, +StaPipAsIsCVU1Program::StaPipAsIsCVU1Program() + : StaPipVU1Program(StaPipAsIsColor, &StaPipVU1As_Is_C_CodeStart, + &StaPipVU1As_Is_C_CodeEnd, ((u64)GIF_REG_RGBAQ) << 0 | ((u64)GIF_REG_XYZ2) << 4, 2, 2) {} -StapipAsIsCVU1Program::~StapipAsIsCVU1Program() {} +StaPipAsIsCVU1Program::~StaPipAsIsCVU1Program() {} -std::string StapipAsIsCVU1Program::getStringName() const { +std::string StaPipAsIsCVU1Program::getStringName() const { return std::string("As is - C"); } -void StapipAsIsCVU1Program::addProgramQBufferDataToPacket( - packet2_t* packet, StapipQBuffer* qbuffer) const { +void StaPipAsIsCVU1Program::addProgramQBufferDataToPacket( + packet2_t* packet, StaPipQBuffer* qbuffer) const { u32 addr = VU1_VERT_DATA_ADDR; // Add vertices diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1.vclpp b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1.vclpp index 43a2a5d..9e6a540 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1.vclpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1.vclpp @@ -13,7 +13,7 @@ ;--------------------------------------------------------------- .syntax new -.name StapipVU1As_Is_D +.name StaPipVU1As_Is_D .vu .init_vf_all .init_vi_all @@ -28,7 +28,7 @@ --enter --endenter -#vuprog StapipVU1AsIsD +#vuprog StaPipVU1AsIsD LoadTyraStaticData{ gifSetTag } LoadTyraDirectionalLights{ lightMatrix, lightDirections, lightColors, ambientColor, VU1_LIGHTS_DIRS_ADDR, VU1_LIGHTS_COLORS_ADDR, VU1_LIGHTS_MATRIX_ADDR } diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1_program.cpp b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1_program.cpp index 8f8a81b..b348ff4 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1_program.cpp @@ -11,25 +11,25 @@ #include "debug/debug.hpp" #include "renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_d_vu1_program.hpp" -extern u32 StapipVU1As_Is_D_CodeStart __attribute__((section(".vudata"))); -extern u32 StapipVU1As_Is_D_CodeEnd __attribute__((section(".vudata"))); +extern u32 StaPipVU1As_Is_D_CodeStart __attribute__((section(".vudata"))); +extern u32 StaPipVU1As_Is_D_CodeEnd __attribute__((section(".vudata"))); namespace Tyra { -StapipAsIsDVU1Program::StapipAsIsDVU1Program() - : StapipVU1Program(StapipAsIsDirLights, &StapipVU1As_Is_D_CodeStart, - &StapipVU1As_Is_D_CodeEnd, +StaPipAsIsDVU1Program::StaPipAsIsDVU1Program() + : StaPipVU1Program(StaPipAsIsDirLights, &StaPipVU1As_Is_D_CodeStart, + &StaPipVU1As_Is_D_CodeEnd, ((u64)GIF_REG_RGBAQ) << 0 | ((u64)GIF_REG_XYZ2) << 4, 2, 3) {} -StapipAsIsDVU1Program::~StapipAsIsDVU1Program() {} +StaPipAsIsDVU1Program::~StaPipAsIsDVU1Program() {} -std::string StapipAsIsDVU1Program::getStringName() const { +std::string StaPipAsIsDVU1Program::getStringName() const { return std::string("As is - LC"); } -void StapipAsIsDVU1Program::addProgramQBufferDataToPacket( - packet2_t* packet, StapipQBuffer* qbuffer) const { +void StaPipAsIsDVU1Program::addProgramQBufferDataToPacket( + packet2_t* packet, StaPipQBuffer* qbuffer) const { u32 addr = VU1_VERT_DATA_ADDR; // Add vertices diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1.vclpp b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1.vclpp index 2355a16..f21145b 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1.vclpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1.vclpp @@ -13,7 +13,7 @@ ;--------------------------------------------------------------- .syntax new -.name StapipVU1As_Is_TC +.name StaPipVU1As_Is_TC .vu .init_vf_all .init_vi_all @@ -29,7 +29,7 @@ --enter --endenter -#vuprog StapipVU1AsIsTC +#vuprog StaPipVU1AsIsTC LoadTyraStaticData{ gifSetTag } LoadTyraSingleColor{ singleColor, singleColorEnabled, VU1_SINGLE_COLOR_ADDR, VU1_OPTIONS_ADDR } diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1_program.cpp b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1_program.cpp index 1bf94d7..ccc8970 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1_program.cpp @@ -11,26 +11,26 @@ #include "debug/debug.hpp" #include "renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_tc_vu1_program.hpp" -extern u32 StapipVU1As_Is_TC_CodeStart __attribute__((section(".vudata"))); -extern u32 StapipVU1As_Is_TC_CodeEnd __attribute__((section(".vudata"))); +extern u32 StaPipVU1As_Is_TC_CodeStart __attribute__((section(".vudata"))); +extern u32 StaPipVU1As_Is_TC_CodeEnd __attribute__((section(".vudata"))); namespace Tyra { -StapipAsIsTCVU1Program::StapipAsIsTCVU1Program() - : StapipVU1Program(StapipAsIsTextureColor, &StapipVU1As_Is_TC_CodeStart, - &StapipVU1As_Is_TC_CodeEnd, +StaPipAsIsTCVU1Program::StaPipAsIsTCVU1Program() + : StaPipVU1Program(StaPipAsIsTextureColor, &StaPipVU1As_Is_TC_CodeStart, + &StaPipVU1As_Is_TC_CodeEnd, ((u64)GIF_REG_ST) << 0 | ((u64)GIF_REG_RGBAQ) << 4 | ((u64)GIF_REG_XYZ2) << 8, 3, 3) {} -StapipAsIsTCVU1Program::~StapipAsIsTCVU1Program() {} +StaPipAsIsTCVU1Program::~StaPipAsIsTCVU1Program() {} -std::string StapipAsIsTCVU1Program::getStringName() const { +std::string StaPipAsIsTCVU1Program::getStringName() const { return std::string("As is - TC"); } -void StapipAsIsTCVU1Program::addProgramQBufferDataToPacket( - packet2_t* packet, StapipQBuffer* qbuffer) const { +void StaPipAsIsTCVU1Program::addProgramQBufferDataToPacket( + packet2_t* packet, StaPipQBuffer* qbuffer) const { u32 addr = VU1_VERT_DATA_ADDR; // Add vertices diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1.vclpp b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1.vclpp index 758df0d..b6fe30f 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1.vclpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1.vclpp @@ -13,7 +13,7 @@ ;--------------------------------------------------------------- .syntax new -.name StapipVU1As_Is_TD +.name StaPipVU1As_Is_TD .vu .init_vf_all .init_vi_all @@ -29,7 +29,7 @@ --enter --endenter -#vuprog StapipVU1AsIsTD +#vuprog StaPipVU1AsIsTD LoadTyraStaticData{ gifSetTag } LoadTyraDirectionalLights{ lightMatrix, lightDirections, lightColors, ambientColor, VU1_LIGHTS_DIRS_ADDR, VU1_LIGHTS_COLORS_ADDR, VU1_LIGHTS_MATRIX_ADDR } diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1_program.cpp b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1_program.cpp index 4e47a2c..9127976 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1_program.cpp @@ -11,26 +11,26 @@ #include "debug/debug.hpp" #include "renderer/3d/pipeline/static/core/programs/as_is/stapip_as_is_td_vu1_program.hpp" -extern u32 StapipVU1As_Is_TD_CodeStart __attribute__((section(".vudata"))); -extern u32 StapipVU1As_Is_TD_CodeEnd __attribute__((section(".vudata"))); +extern u32 StaPipVU1As_Is_TD_CodeStart __attribute__((section(".vudata"))); +extern u32 StaPipVU1As_Is_TD_CodeEnd __attribute__((section(".vudata"))); namespace Tyra { -StapipAsIsTDVU1Program::StapipAsIsTDVU1Program() - : StapipVU1Program(StapipAsIsTextureDirLights, &StapipVU1As_Is_TD_CodeStart, - &StapipVU1As_Is_TD_CodeEnd, +StaPipAsIsTDVU1Program::StaPipAsIsTDVU1Program() + : StaPipVU1Program(StaPipAsIsTextureDirLights, &StaPipVU1As_Is_TD_CodeStart, + &StaPipVU1As_Is_TD_CodeEnd, ((u64)GIF_REG_ST) << 0 | ((u64)GIF_REG_RGBAQ) << 4 | ((u64)GIF_REG_XYZ2) << 8, 3, 4) {} -StapipAsIsTDVU1Program::~StapipAsIsTDVU1Program() {} +StaPipAsIsTDVU1Program::~StaPipAsIsTDVU1Program() {} -std::string StapipAsIsTDVU1Program::getStringName() const { +std::string StaPipAsIsTDVU1Program::getStringName() const { return std::string("As is - LTC"); } -void StapipAsIsTDVU1Program::addProgramQBufferDataToPacket( - packet2_t* packet, StapipQBuffer* qbuffer) const { +void StaPipAsIsTDVU1Program::addProgramQBufferDataToPacket( + packet2_t* packet, StaPipQBuffer* qbuffer) const { u32 addr = VU1_VERT_DATA_ADDR; // Add vertices diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1.vclpp b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1.vclpp index 247f84a..63c7d1e 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1.vclpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1.vclpp @@ -13,7 +13,7 @@ ;--------------------------------------------------------------- .syntax new -.name StapipVU1Cull_C +.name StaPipVU1Cull_C .vu .init_vf_all .init_vi_all @@ -28,7 +28,7 @@ --enter --endenter -#vuprog StapipVU1CullC +#vuprog StaPipVU1CullC ResetClipFlags{ } LoadTyraStaticData{ gifSetTag } diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1_program.cpp b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1_program.cpp index b7c781a..1870679 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1_program.cpp @@ -11,24 +11,24 @@ #include "debug/debug.hpp" #include "renderer/3d/pipeline/static/core/programs/cull/stapip_cull_c_vu1_program.hpp" -extern u32 StapipVU1Cull_C_CodeStart __attribute__((section(".vudata"))); -extern u32 StapipVU1Cull_C_CodeEnd __attribute__((section(".vudata"))); +extern u32 StaPipVU1Cull_C_CodeStart __attribute__((section(".vudata"))); +extern u32 StaPipVU1Cull_C_CodeEnd __attribute__((section(".vudata"))); namespace Tyra { -StapipCullCVU1Program::StapipCullCVU1Program() - : StapipVU1Program( - StapipCullColor, &StapipVU1Cull_C_CodeStart, &StapipVU1Cull_C_CodeEnd, +StaPipCullCVU1Program::StaPipCullCVU1Program() + : StaPipVU1Program( + StaPipCullColor, &StaPipVU1Cull_C_CodeStart, &StaPipVU1Cull_C_CodeEnd, ((u64)GIF_REG_RGBAQ) << 0 | ((u64)GIF_REG_XYZ2) << 4, 2, 2) {} -StapipCullCVU1Program::~StapipCullCVU1Program() {} +StaPipCullCVU1Program::~StaPipCullCVU1Program() {} -std::string StapipCullCVU1Program::getStringName() const { +std::string StaPipCullCVU1Program::getStringName() const { return std::string("Cull - C"); } -void StapipCullCVU1Program::addProgramQBufferDataToPacket( - packet2_t* packet, StapipQBuffer* qbuffer) const { +void StaPipCullCVU1Program::addProgramQBufferDataToPacket( + packet2_t* packet, StaPipQBuffer* qbuffer) const { u32 addr = VU1_VERT_DATA_ADDR; // Add vertices diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1.vclpp b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1.vclpp index ed49143..0e40535 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1.vclpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1.vclpp @@ -13,7 +13,7 @@ ;--------------------------------------------------------------- .syntax new -.name StapipVU1Cull_D +.name StaPipVU1Cull_D .vu .init_vf_all .init_vi_all @@ -28,7 +28,7 @@ --enter --endenter -#vuprog StapipVU1CullD +#vuprog StaPipVU1CullD ResetClipFlags{ } LoadTyraStaticData{ gifSetTag } diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1_program.cpp b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1_program.cpp index bac5d8f..68782d5 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1_program.cpp @@ -11,25 +11,25 @@ #include "debug/debug.hpp" #include "renderer/3d/pipeline/static/core/programs/cull/stapip_cull_d_vu1_program.hpp" -extern u32 StapipVU1Cull_D_CodeStart __attribute__((section(".vudata"))); -extern u32 StapipVU1Cull_D_CodeEnd __attribute__((section(".vudata"))); +extern u32 StaPipVU1Cull_D_CodeStart __attribute__((section(".vudata"))); +extern u32 StaPipVU1Cull_D_CodeEnd __attribute__((section(".vudata"))); namespace Tyra { -StapipCullDVU1Program::StapipCullDVU1Program() - : StapipVU1Program(StapipCullDirLights, &StapipVU1Cull_D_CodeStart, - &StapipVU1Cull_D_CodeEnd, +StaPipCullDVU1Program::StaPipCullDVU1Program() + : StaPipVU1Program(StaPipCullDirLights, &StaPipVU1Cull_D_CodeStart, + &StaPipVU1Cull_D_CodeEnd, ((u64)GIF_REG_RGBAQ) << 0 | ((u64)GIF_REG_XYZ2) << 4, 2, 3) {} -StapipCullDVU1Program::~StapipCullDVU1Program() {} +StaPipCullDVU1Program::~StaPipCullDVU1Program() {} -std::string StapipCullDVU1Program::getStringName() const { +std::string StaPipCullDVU1Program::getStringName() const { return std::string("Cull - LC"); } -void StapipCullDVU1Program::addProgramQBufferDataToPacket( - packet2_t* packet, StapipQBuffer* qbuffer) const { +void StaPipCullDVU1Program::addProgramQBufferDataToPacket( + packet2_t* packet, StaPipQBuffer* qbuffer) const { u32 addr = VU1_VERT_DATA_ADDR; // Add vertices diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1.vclpp b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1.vclpp index f1a9b2a..d67c796 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1.vclpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1.vclpp @@ -13,7 +13,7 @@ ;--------------------------------------------------------------- .syntax new -.name StapipVU1Cull_TC +.name StaPipVU1Cull_TC .vu .init_vf_all .init_vi_all @@ -29,7 +29,7 @@ --enter --endenter -#vuprog StapipVU1CullTC +#vuprog StaPipVU1CullTC ResetClipFlags{ } LoadTyraStaticData{ gifSetTag } diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1_program.cpp b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1_program.cpp index d64d609..fb14961 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1_program.cpp @@ -11,26 +11,26 @@ #include "debug/debug.hpp" #include "renderer/3d/pipeline/static/core/programs/cull/stapip_cull_tc_vu1_program.hpp" -extern u32 StapipVU1Cull_TC_CodeStart __attribute__((section(".vudata"))); -extern u32 StapipVU1Cull_TC_CodeEnd __attribute__((section(".vudata"))); +extern u32 StaPipVU1Cull_TC_CodeStart __attribute__((section(".vudata"))); +extern u32 StaPipVU1Cull_TC_CodeEnd __attribute__((section(".vudata"))); namespace Tyra { -StapipCullTCVU1Program::StapipCullTCVU1Program() - : StapipVU1Program(StapipCullTextureColor, &StapipVU1Cull_TC_CodeStart, - &StapipVU1Cull_TC_CodeEnd, +StaPipCullTCVU1Program::StaPipCullTCVU1Program() + : StaPipVU1Program(StaPipCullTextureColor, &StaPipVU1Cull_TC_CodeStart, + &StaPipVU1Cull_TC_CodeEnd, ((u64)GIF_REG_ST) << 0 | ((u64)GIF_REG_RGBAQ) << 4 | ((u64)GIF_REG_XYZ2) << 8, 3, 3) {} -StapipCullTCVU1Program::~StapipCullTCVU1Program() {} +StaPipCullTCVU1Program::~StaPipCullTCVU1Program() {} -std::string StapipCullTCVU1Program::getStringName() const { +std::string StaPipCullTCVU1Program::getStringName() const { return std::string("Cull - TC"); } -void StapipCullTCVU1Program::addProgramQBufferDataToPacket( - packet2_t* packet, StapipQBuffer* qbuffer) const { +void StaPipCullTCVU1Program::addProgramQBufferDataToPacket( + packet2_t* packet, StaPipQBuffer* qbuffer) const { u32 addr = VU1_VERT_DATA_ADDR; // Add vertices diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1.vclpp b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1.vclpp index cf82eed..5377998 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1.vclpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1.vclpp @@ -13,7 +13,7 @@ ;--------------------------------------------------------------- .syntax new -.name StapipVU1Cull_TD +.name StaPipVU1Cull_TD .vu .init_vf_all .init_vi_all @@ -29,7 +29,7 @@ --enter --endenter -#vuprog StapipVU1CullTD +#vuprog StaPipVU1CullTD ResetClipFlags{ } LoadTyraStaticData{ gifSetTag } diff --git a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1_program.cpp b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1_program.cpp index c217f6d..9faa4f5 100644 --- a/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1_program.cpp @@ -11,26 +11,26 @@ #include "debug/debug.hpp" #include "renderer/3d/pipeline/static/core/programs/cull/stapip_cull_td_vu1_program.hpp" -extern u32 StapipVU1Cull_TD_CodeStart __attribute__((section(".vudata"))); -extern u32 StapipVU1Cull_TD_CodeEnd __attribute__((section(".vudata"))); +extern u32 StaPipVU1Cull_TD_CodeStart __attribute__((section(".vudata"))); +extern u32 StaPipVU1Cull_TD_CodeEnd __attribute__((section(".vudata"))); namespace Tyra { -StapipCullTDVU1Program::StapipCullTDVU1Program() - : StapipVU1Program(StapipCullTextureDirLights, &StapipVU1Cull_TD_CodeStart, - &StapipVU1Cull_TD_CodeEnd, +StaPipCullTDVU1Program::StaPipCullTDVU1Program() + : StaPipVU1Program(StaPipCullTextureDirLights, &StaPipVU1Cull_TD_CodeStart, + &StaPipVU1Cull_TD_CodeEnd, ((u64)GIF_REG_ST) << 0 | ((u64)GIF_REG_RGBAQ) << 4 | ((u64)GIF_REG_XYZ2) << 8, 3, 4) {} -StapipCullTDVU1Program::~StapipCullTDVU1Program() {} +StaPipCullTDVU1Program::~StaPipCullTDVU1Program() {} -std::string StapipCullTDVU1Program::getStringName() const { +std::string StaPipCullTDVU1Program::getStringName() const { return std::string("Cull - LTC"); } -void StapipCullTDVU1Program::addProgramQBufferDataToPacket( - packet2_t* packet, StapipQBuffer* qbuffer) const { +void StaPipCullTDVU1Program::addProgramQBufferDataToPacket( + packet2_t* packet, StaPipQBuffer* qbuffer) const { u32 addr = VU1_VERT_DATA_ADDR; // Add vertices diff --git a/engine/src/renderer/3d/pipeline/static/core/stapip_clipper.cpp b/engine/src/renderer/3d/pipeline/static/core/stapip_clipper.cpp index 1a4de98..447d966 100644 --- a/engine/src/renderer/3d/pipeline/static/core/stapip_clipper.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/stapip_clipper.cpp @@ -12,18 +12,18 @@ namespace Tyra { -StapipClipper::StapipClipper() {} -StapipClipper::~StapipClipper() {} +StaPipClipper::StaPipClipper() {} +StaPipClipper::~StaPipClipper() {} -void StapipClipper::setMVP(M4x4* t_mvp) { mvp = t_mvp; } +void StaPipClipper::setMVP(M4x4* t_mvp) { mvp = t_mvp; } -void StapipClipper::init(const RendererSettings& settings) { +void StaPipClipper::init(const RendererSettings& settings) { algorithm.init(settings); } -void StapipClipper::setMaxVertCount(const u32& count) { maxVertCount = count; } +void StaPipClipper::setMaxVertCount(const u32& count) { maxVertCount = count; } -void StapipClipper::clip(StapipQBuffer* buffer) { +void StaPipClipper::clip(StaPipQBuffer* buffer) { TYRA_ASSERT(buffer->size <= maxVertCount / 3, "Buffer should have max ", maxVertCount / 3, " verts if we want to clip it."); @@ -64,14 +64,14 @@ void StapipClipper::clip(StapipQBuffer* buffer) { moveDataToBuffer(clippedVertices, buffer); } -void StapipClipper::perspectiveDivide(std::vector* vertices) { +void StaPipClipper::perspectiveDivide(std::vector* vertices) { for (u32 i = 0; i < vertices->size(); i++) { (*vertices)[i].position /= (*vertices)[i].position.w; } } -void StapipClipper::moveDataToBuffer( - const std::vector& vertices, StapipQBuffer* buffer) { +void StaPipClipper::moveDataToBuffer( + const std::vector& vertices, StaPipQBuffer* buffer) { buffer->reallocateManually(vertices.size()); for (u32 i = 0; i < vertices.size(); i++) { diff --git a/engine/src/renderer/3d/pipeline/static/core/stapip_programs_repository.cpp b/engine/src/renderer/3d/pipeline/static/core/stapip_programs_repository.cpp index faf4439..1d30ebe 100644 --- a/engine/src/renderer/3d/pipeline/static/core/stapip_programs_repository.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/stapip_programs_repository.cpp @@ -12,31 +12,31 @@ namespace Tyra { -StapipProgramsRepository::StapipProgramsRepository() {} +StaPipProgramsRepository::StaPipProgramsRepository() {} -StapipProgramsRepository::~StapipProgramsRepository() {} +StaPipProgramsRepository::~StaPipProgramsRepository() {} -StapipVU1Program* StapipProgramsRepository::getProgram( - const StapipProgramName& name) { +StaPipVU1Program* StaPipProgramsRepository::getProgram( + const StaPipProgramName& name) { switch (name) { - case StapipProgramName::StapipAsIsColor: + case StaPipProgramName::StaPipAsIsColor: return &asIsColor; - case StapipProgramName::StapipCullColor: + case StaPipProgramName::StaPipCullColor: return &cullColor; - case StapipProgramName::StapipAsIsDirLights: + case StaPipProgramName::StaPipAsIsDirLights: return &asIsLightingColor; - case StapipProgramName::StapipCullDirLights: + case StaPipProgramName::StaPipCullDirLights: return &cullLightingColor; - case StapipProgramName::StapipAsIsTextureDirLights: + case StaPipProgramName::StaPipAsIsTextureDirLights: return &asIsLightingTextureColor; - case StapipProgramName::StapipCullTextureDirLights: + case StaPipProgramName::StaPipCullTextureDirLights: return &cullLightingTextureColor; - case StapipProgramName::StapipAsIsTextureColor: + case StaPipProgramName::StaPipAsIsTextureColor: return &asIsTextureColor; - case StapipProgramName::StapipCullTextureColor: + case StaPipProgramName::StaPipCullTextureColor: return &cullTextureColor; default: diff --git a/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer.cpp b/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer.cpp index a40a9cf..56ef9ae 100644 --- a/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer.cpp @@ -14,7 +14,7 @@ namespace Tyra { -StapipQBuffer::StapipQBuffer() { +StaPipQBuffer::StaPipQBuffer() { size = 0; _isDynamicallyAllocated = false; _stAllocated = false; @@ -27,11 +27,11 @@ StapipQBuffer::StapipQBuffer() { normals = nullptr; } -StapipQBuffer::~StapipQBuffer() { deallocateDynamicData(); } +StaPipQBuffer::~StaPipQBuffer() { deallocateDynamicData(); } -void StapipQBuffer::setMaxVertCount(const u32& count) { maxVertCount = count; } +void StaPipQBuffer::setMaxVertCount(const u32& count) { maxVertCount = count; } -void StapipQBuffer::fillByPointer(const StapipBagPackage& pkg) { +void StaPipQBuffer::fillByPointer(const StaPipBagPackage& pkg) { TYRA_ASSERT(pkg.size <= maxVertCount, "VU1 buffer supports only ", maxVertCount, " verts. Provided: ", pkg.size); @@ -45,9 +45,9 @@ void StapipQBuffer::fillByPointer(const StapipBagPackage& pkg) { bag = pkg.bag; } -void StapipQBuffer::fillByCopyMax(const StapipBagPackage& pkg1, - const StapipBagPackage& pkg2, - const StapipBagPackage& pkg3) { +void StaPipQBuffer::fillByCopyMax(const StaPipBagPackage& pkg1, + const StaPipBagPackage& pkg2, + const StaPipBagPackage& pkg3) { TYRA_ASSERT(pkg1.size <= maxVertCount / 3, "Wrong package size (1). Provided: ", pkg1.size); TYRA_ASSERT(pkg2.size <= maxVertCount / 3, @@ -97,8 +97,8 @@ void StapipQBuffer::fillByCopyMax(const StapipBagPackage& pkg1, bag = pkg1.bag; } -void StapipQBuffer::fillByCopy1By2(const StapipBagPackage& pkg1, - const StapipBagPackage& pkg2) { +void StaPipQBuffer::fillByCopy1By2(const StaPipBagPackage& pkg1, + const StaPipBagPackage& pkg2) { TYRA_ASSERT(pkg1.size <= maxVertCount / 3, "Wrong package size (1). Provided: ", pkg1.size); TYRA_ASSERT(pkg2.size <= maxVertCount / 3, @@ -133,7 +133,7 @@ void StapipQBuffer::fillByCopy1By2(const StapipBagPackage& pkg1, bag = pkg1.bag; } -void StapipQBuffer::fillByCopy1By3(const StapipBagPackage& pkg) { +void StaPipQBuffer::fillByCopy1By3(const StaPipBagPackage& pkg) { TYRA_ASSERT(pkg.size <= maxVertCount / 3, "Wrong package size (1). Provided: ", pkg.size); @@ -155,13 +155,13 @@ void StapipQBuffer::fillByCopy1By3(const StapipBagPackage& pkg) { bag = pkg.bag; } -void StapipQBuffer::reallocateManually(const u16& t_size) { +void StaPipQBuffer::reallocateManually(const u16& t_size) { deallocateDynamicData(); allocateDynamicData(t_size, bag); size = t_size; } -void StapipQBuffer::deallocateDynamicData() { +void StaPipQBuffer::deallocateDynamicData() { if (_isDynamicallyAllocated) { delete[] vertices; @@ -186,7 +186,7 @@ void StapipQBuffer::deallocateDynamicData() { /** When we not receive maxVertCount vertices, we must align it by ourself. * Too bad - not efficient. */ -void StapipQBuffer::allocateDynamicData(u16 size, StapipBag* bag) { +void StaPipQBuffer::allocateDynamicData(u16 size, StaPipBag* bag) { TYRA_ASSERT(size <= maxVertCount, "Wrong size. Max buffer size in VU1 is ", maxVertCount, ". Provided: ", size); TYRA_ASSERT(!_isDynamicallyAllocated, "Buffer is already allocated"); @@ -211,19 +211,19 @@ void StapipQBuffer::allocateDynamicData(u16 size, StapipBag* bag) { _isDynamicallyAllocated = true; } -bool StapipQBuffer::any() const { return size > 0; } +bool StaPipQBuffer::any() const { return size > 0; } -void StapipQBuffer::print() const { +void StaPipQBuffer::print() const { auto text = getPrint(nullptr); printf("%s\n", text.c_str()); } -void StapipQBuffer::print(const char* name) const { +void StaPipQBuffer::print(const char* name) const { auto text = getPrint(name); printf("%s\n", text.c_str()); } -std::string StapipQBuffer::getPrint(const char* name) const { +std::string StaPipQBuffer::getPrint(const char* name) const { std::stringstream res; if (name) { res << name << "("; diff --git a/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer_renderer.cpp b/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer_renderer.cpp index d8d19ad..704d4a4 100644 --- a/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer_renderer.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer_renderer.cpp @@ -34,14 +34,14 @@ namespace Tyra { * */ -StapipQBufferRenderer::StapipQBufferRenderer() { +StaPipQBufferRenderer::StaPipQBufferRenderer() { context = 0; lastProgramName = StdipUndefinedProgram; staticDataPacket = packet2_create(3, P2_TYPE_NORMAL, P2_MODE_CHAIN, true); objectDataPacket = packet2_create(16, P2_TYPE_NORMAL, P2_MODE_CHAIN, true); programsPacket = nullptr; } -StapipQBufferRenderer::~StapipQBufferRenderer() { +StaPipQBufferRenderer::~StaPipQBufferRenderer() { packet2_free(packets[0]); packet2_free(packets[1]); packet2_free(staticDataPacket); @@ -50,7 +50,7 @@ StapipQBufferRenderer::~StapipQBufferRenderer() { if (programsPacket) packet2_free(programsPacket); } -void StapipQBufferRenderer::init(RendererCore* t_core) { +void StaPipQBufferRenderer::init(RendererCore* t_core) { path1 = t_core->getPath1(); clipper.init(t_core->getSettings()); rendererCore = t_core; @@ -73,16 +73,16 @@ void StapipQBufferRenderer::init(RendererCore* t_core) { TYRA_LOG("Renderer3DQBufferRenderer initialized"); } -void StapipQBufferRenderer::reinitVU1() { +void StaPipQBufferRenderer::reinitVU1() { sendStaticData(); uploadPrograms(); setDoubleBuffer(); } -StapipQBuffer* StapipQBufferRenderer::getBuffer() { return &buffers[context]; } +StaPipQBuffer* StaPipQBufferRenderer::getBuffer() { return &buffers[context]; } -void StapipQBufferRenderer::sendObjectData( - StapipBag* bag, M4x4* mvp, RendererCoreTextureBuffers* texBuffers) const { +void StaPipQBufferRenderer::sendObjectData( + StaPipBag* bag, M4x4* mvp, RendererCoreTextureBuffers* texBuffers) const { packet2_reset(objectDataPacket, false); packet2_utils_vu_add_unpack_data(objectDataPacket, VU1_MVP_MATRIX_ADDR, mvp->data, 4, false); @@ -130,13 +130,13 @@ void StapipQBufferRenderer::sendObjectData( dma_channel_send_packet2(objectDataPacket, DMA_CHANNEL_VIF1, true); } -void StapipQBufferRenderer::setInfo(StapipInfoBag* bag) { +void StaPipQBufferRenderer::setInfo(StaPipInfoBag* bag) { rendererCore->gs.prim.antialiasing = bag->antiAliasingEnabled; rendererCore->gs.prim.blending = bag->blendingEnabled; rendererCore->gs.prim.shading = bag->shadingType; } -void StapipQBufferRenderer::sendStaticData() const { +void StaPipQBufferRenderer::sendStaticData() const { packet2_reset(staticDataPacket, false); packet2_utils_vu_open_unpack(staticDataPacket, VU1_SET_GIFTAG_ADDR, false); { packet2_utils_gif_add_set(staticDataPacket, 1); } @@ -147,27 +147,27 @@ void StapipQBufferRenderer::sendStaticData() const { dma_channel_send_packet2(staticDataPacket, DMA_CHANNEL_VIF1, true); } -void StapipQBufferRenderer::setProgramsCache() { +void StaPipQBufferRenderer::setProgramsCache() { VU1Program** programs = new VU1Program*[8]; - programs[0] = repository.getProgram(StapipCullColor); - programs[1] = repository.getProgram(StapipAsIsColor); - programs[2] = repository.getProgram(StapipCullDirLights); - programs[3] = repository.getProgram(StapipAsIsDirLights); - programs[4] = repository.getProgram(StapipCullTextureDirLights); - programs[5] = repository.getProgram(StapipAsIsTextureDirLights); - programs[6] = repository.getProgram(StapipCullTextureColor); - programs[7] = repository.getProgram(StapipAsIsTextureColor); + programs[0] = repository.getProgram(StaPipCullColor); + programs[1] = repository.getProgram(StaPipAsIsColor); + programs[2] = repository.getProgram(StaPipCullDirLights); + programs[3] = repository.getProgram(StaPipAsIsDirLights); + programs[4] = repository.getProgram(StaPipCullTextureDirLights); + programs[5] = repository.getProgram(StaPipAsIsTextureDirLights); + programs[6] = repository.getProgram(StaPipCullTextureColor); + programs[7] = repository.getProgram(StaPipAsIsTextureColor); programsPacket = path1->createProgramsCache(programs, 8, 0); delete[] programs; } -void StapipQBufferRenderer::uploadPrograms() { +void StaPipQBufferRenderer::uploadPrograms() { dma_channel_wait(DMA_CHANNEL_VIF1, 0); dma_channel_send_packet2(programsPacket, DMA_CHANNEL_VIF1, true); dma_channel_wait(DMA_CHANNEL_VIF1, 0); } -void StapipQBufferRenderer::setDoubleBuffer() { +void StaPipQBufferRenderer::setDoubleBuffer() { u16 startingAddr = VU1_LAST_ITEM_ADDR + 1; const u16 bufferMaxSize = 1000; bufferSize = (bufferMaxSize - startingAddr) / 2; @@ -178,7 +178,7 @@ void StapipQBufferRenderer::setDoubleBuffer() { // buffer, to first addr of second buffer } -void StapipQBufferRenderer::cull(StapipQBuffer* buffer) { +void StaPipQBufferRenderer::cull(StaPipQBuffer* buffer) { if (buffer->size == 0) { return; } @@ -188,8 +188,8 @@ void StapipQBufferRenderer::cull(StapipQBuffer* buffer) { sendPacket(); } -// void StapipQBufferRenderer::sendFinishTag() { -// StapipQBufferRenderer way proposition +// void StaPipQBufferRenderer::sendFinishTag() { +// StaPipQBufferRenderer way proposition // auto program = path1->getProgramByName(Draw_Finish); // addBufferDataToPacket(program, nullptr); // sendPacket(); @@ -206,7 +206,7 @@ void StapipQBufferRenderer::cull(StapipQBuffer* buffer) { // packet2_free(packet2); // } -void StapipQBufferRenderer::clip(StapipQBuffer* buffer) { +void StaPipQBufferRenderer::clip(StaPipQBuffer* buffer) { if (buffer->size == 0) { return; } @@ -220,12 +220,12 @@ void StapipQBufferRenderer::clip(StapipQBuffer* buffer) { } } -void StapipQBufferRenderer::clearLastProgramName() { +void StaPipQBufferRenderer::clearLastProgramName() { lastProgramName = StdipUndefinedProgram; } -void StapipQBufferRenderer::addBufferDataToPacket(StapipVU1Program* program, - StapipQBuffer* buffer) { +void StaPipQBufferRenderer::addBufferDataToPacket(StaPipVU1Program* program, + StaPipQBuffer* buffer) { currentPacket = packets[context]; packet2_reset(currentPacket, false); @@ -241,7 +241,7 @@ void StapipQBufferRenderer::addBufferDataToPacket(StapipVU1Program* program, packet2_utils_vu_add_end_tag(currentPacket); } -void StapipQBufferRenderer::sendPacket() { +void StaPipQBufferRenderer::sendPacket() { dma_channel_wait(DMA_CHANNEL_VIF1, 0); dma_channel_send_packet2(currentPacket, DMA_CHANNEL_VIF1, true); @@ -249,72 +249,72 @@ void StapipQBufferRenderer::sendPacket() { context = !context; } -void StapipQBufferRenderer::setMaxVertCount(const u32& count) { +void StaPipQBufferRenderer::setMaxVertCount(const u32& count) { buffers[0].setMaxVertCount(count); buffers[1].setMaxVertCount(count); clipper.setMaxVertCount(count); } -StapipVU1Program* StapipQBufferRenderer::getAsIsProgramByBag( - const StapipBag* bag) { +StaPipVU1Program* StaPipQBufferRenderer::getAsIsProgramByBag( + const StaPipBag* bag) { auto programType = getDrawProgramTypeByBag(bag); - if (programType == StapipVU1TextureDirLights) - return getProgramByName(StapipAsIsTextureDirLights); - else if (programType == StapipVU1DirLights) - return getProgramByName(StapipAsIsDirLights); - else if (programType == StapipVU1TextureColor) - return getProgramByName(StapipAsIsTextureColor); + if (programType == StaPipVU1TextureDirLights) + return getProgramByName(StaPipAsIsTextureDirLights); + else if (programType == StaPipVU1DirLights) + return getProgramByName(StaPipAsIsDirLights); + else if (programType == StaPipVU1TextureColor) + return getProgramByName(StaPipAsIsTextureColor); else - return getProgramByName(StapipAsIsColor); + return getProgramByName(StaPipAsIsColor); } -StapipVU1Program* StapipQBufferRenderer::getCullProgramByBag( - const StapipBag* bag) { +StaPipVU1Program* StaPipQBufferRenderer::getCullProgramByBag( + const StaPipBag* bag) { auto programType = getDrawProgramTypeByBag(bag); return getCullProgramByType(programType); } -StapipVU1Program* StapipQBufferRenderer::getProgramByName( - const StapipProgramName& name) { +StaPipVU1Program* StaPipQBufferRenderer::getProgramByName( + const StaPipProgramName& name) { return repository.getProgram(name); } -StapipVU1Program* StapipQBufferRenderer::getCullProgramByParams( +StaPipVU1Program* StaPipQBufferRenderer::getCullProgramByParams( const bool& isLightingEnabled, const bool& isTextureEnabled) { auto type = getDrawProgramTypeByParams(isLightingEnabled, isTextureEnabled); return getCullProgramByType(type); } -StapipVU1Program* StapipQBufferRenderer::getCullProgramByType( - const StapipProgramType& programType) { - if (programType == StapipVU1TextureDirLights) - return getProgramByName(StapipCullTextureDirLights); - else if (programType == StapipVU1DirLights) - return getProgramByName(StapipCullDirLights); - else if (programType == StapipVU1TextureColor) - return getProgramByName(StapipCullTextureColor); +StaPipVU1Program* StaPipQBufferRenderer::getCullProgramByType( + const StaPipProgramType& programType) { + if (programType == StaPipVU1TextureDirLights) + return getProgramByName(StaPipCullTextureDirLights); + else if (programType == StaPipVU1DirLights) + return getProgramByName(StaPipCullDirLights); + else if (programType == StaPipVU1TextureColor) + return getProgramByName(StaPipCullTextureColor); else - return getProgramByName(StapipCullColor); + return getProgramByName(StaPipCullColor); } -StapipProgramType StapipQBufferRenderer::getDrawProgramTypeByBag( - const StapipBag* bag) const { +StaPipProgramType StaPipQBufferRenderer::getDrawProgramTypeByBag( + const StaPipBag* bag) const { auto isLightingEnabled = bag->lighting != nullptr; auto isTextureEnabled = bag->texture != nullptr; return getDrawProgramTypeByParams(isLightingEnabled, isTextureEnabled); } -StapipProgramType StapipQBufferRenderer::getDrawProgramTypeByParams( +StaPipProgramType StaPipQBufferRenderer::getDrawProgramTypeByParams( const bool& isLightingEnabled, const bool& isTextureEnabled) const { if (isLightingEnabled && isTextureEnabled) - return StapipVU1TextureDirLights; + return StaPipVU1TextureDirLights; else if (isLightingEnabled) - return StapipVU1DirLights; + return StaPipVU1DirLights; else if (isTextureEnabled) - return StapipVU1TextureColor; + return StaPipVU1TextureColor; else - return StapipVU1Color; + return StaPipVU1Color; } } // namespace Tyra diff --git a/engine/src/renderer/3d/pipeline/static/core/stapip_vu1_program.cpp b/engine/src/renderer/3d/pipeline/static/core/stapip_vu1_program.cpp index 32f80a1..cceea14 100644 --- a/engine/src/renderer/3d/pipeline/static/core/stapip_vu1_program.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/stapip_vu1_program.cpp @@ -12,7 +12,7 @@ namespace Tyra { -StapipVU1Program::StapipVU1Program(const StapipProgramName& t_name, +StaPipVU1Program::StaPipVU1Program(const StaPipProgramName& t_name, u32* t_start, u32* t_end, const u32& t_reglist, const u8& t_reglistCount, @@ -26,21 +26,21 @@ StapipVU1Program::StapipVU1Program(const StapipProgramName& t_name, programSize = calculateProgramSize(); } -StapipVU1Program::~StapipVU1Program() {} +StaPipVU1Program::~StaPipVU1Program() {} -const StapipProgramName& StapipVU1Program::getName() const { return name; } +const StaPipProgramName& StaPipVU1Program::getName() const { return name; } -u32& StapipVU1Program::getReglist() { return reglist; } +u32& StaPipVU1Program::getReglist() { return reglist; } -void StapipVU1Program::addBufferDataToPacket(packet2_t* packet, - StapipQBuffer* buffer, +void StaPipVU1Program::addBufferDataToPacket(packet2_t* packet, + StaPipQBuffer* buffer, prim_t* prim) { addStandardBufferDataToPacket(packet, buffer, prim); addProgramQBufferDataToPacket(packet, buffer); } -void StapipVU1Program::addStandardBufferDataToPacket(packet2_t* packet, - StapipQBuffer* buffer, +void StaPipVU1Program::addStandardBufferDataToPacket(packet2_t* packet, + StaPipQBuffer* buffer, prim_t* prim) { if (buffer->bag->texture) prim->mapping = 1; @@ -61,7 +61,7 @@ void StapipVU1Program::addStandardBufferDataToPacket(packet2_t* packet, packet2_utils_vu_close_unpack(packet); } -u16 StapipVU1Program::getMaxVertCount(const bool& singleColorEnabled, +u16 StaPipVU1Program::getMaxVertCount(const bool& singleColorEnabled, const u16& bufferSize) const { u16 res = bufferSize - 4; u8 colorElementsPerVertex = diff --git a/engine/src/renderer/3d/pipeline/static/core/static_pipeline_core.cpp b/engine/src/renderer/3d/pipeline/static/core/static_pipeline_core.cpp index ca6936d..5da1095 100644 --- a/engine/src/renderer/3d/pipeline/static/core/static_pipeline_core.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/static_pipeline_core.cpp @@ -22,26 +22,26 @@ namespace Tyra { -StapipelineCore::StapipelineCore() { maxVertCount = 0; } +StaPipelineCore::StaPipelineCore() { maxVertCount = 0; } -StapipelineCore::~StapipelineCore() {} +StaPipelineCore::~StaPipelineCore() {} -void StapipelineCore::init(RendererCore* t_core) { +void StaPipelineCore::init(RendererCore* t_core) { rendererCore = t_core; qbufferRenderer.init(t_core); packager.init(&rendererCore->renderer3D.frustumPlanes); } -void StapipelineCore::reinitStandardVU1Programs() { +void StaPipelineCore::reinitStandardVU1Programs() { qbufferRenderer.reinitVU1(); } -u32 StapipelineCore::getMaxVertCountByBag(const StapipBag* bag) { +u32 StaPipelineCore::getMaxVertCountByBag(const StaPipBag* bag) { return qbufferRenderer.getCullProgramByBag(bag)->getMaxVertCount( bag->color->many == nullptr, qbufferRenderer.getBufferSize()); } -u32 StapipelineCore::getMaxVertCountByParams(const bool& isSingleColor, +u32 StaPipelineCore::getMaxVertCountByParams(const bool& isSingleColor, const bool& isLightingEnabled, const bool& isTextureEnabled) { return qbufferRenderer @@ -49,7 +49,7 @@ u32 StapipelineCore::getMaxVertCountByParams(const bool& isSingleColor, ->getMaxVertCount(isSingleColor, qbufferRenderer.getBufferSize()); } -void StapipelineCore::render(StapipBag* bag, StapipBagPackagesBBox* bbox) { +void StaPipelineCore::render(StaPipBag* bag, StaPipBagPackagesBBox* bbox) { if (bag->count <= 0) return; TYRA_ASSERT(bag->vertices != nullptr, @@ -71,7 +71,7 @@ void StapipelineCore::render(StapipBag* bag, StapipBagPackagesBBox* bbox) { !bag->texture || (bag->texture->texture && bag->texture->coordinates), "If you want texture, please provide texture and coordinates!"); - StapipBagPackagesBBox* renderBbox; + StaPipBagPackagesBBox* renderBbox; u32 maxVertCount = getMaxVertCountByBag(bag); @@ -79,7 +79,7 @@ void StapipelineCore::render(StapipBag* bag, StapipBagPackagesBBox* bbox) { if (!bbox) renderBbox = - new StapipBagPackagesBBox(bag->vertices, bag->count, maxVertCount); + new StaPipBagPackagesBBox(bag->vertices, bag->count, maxVertCount); else renderBbox = bbox; @@ -141,7 +141,7 @@ void StapipelineCore::render(StapipBag* bag, StapipBagPackagesBBox* bbox) { Verbose("Render finished"); } -void StapipelineCore::renderPkgs(StapipBagPackage* packages, u16 count) { +void StaPipelineCore::renderPkgs(StaPipBagPackage* packages, u16 count) { for (u16 i = 0; i < count; i++) { if (packages[i].isInFrustum == IN_FRUSTUM) { Verbose(i, " - package in frustum -> cull"); @@ -161,7 +161,7 @@ void StapipelineCore::renderPkgs(StapipBagPackage* packages, u16 count) { } } -void StapipelineCore::renderSubpkgs(StapipBagPackage* subpkgs, u16 count) { +void StaPipelineCore::renderSubpkgs(StaPipBagPackage* subpkgs, u16 count) { std::vector doneIndexes; std::vector loadedIndexes; @@ -218,7 +218,7 @@ void StapipelineCore::renderSubpkgs(StapipBagPackage* subpkgs, u16 count) { } } -void StapipelineCore::setMaxVertCount(const u32& count) { +void StaPipelineCore::setMaxVertCount(const u32& count) { maxVertCount = count; packager.setMaxVertCount(count); qbufferRenderer.setMaxVertCount(count); diff --git a/engine/src/renderer/3d/pipeline/static/static_pipeline.cpp b/engine/src/renderer/3d/pipeline/static/static_pipeline.cpp index 87a2e33..834edf4 100644 --- a/engine/src/renderer/3d/pipeline/static/static_pipeline.cpp +++ b/engine/src/renderer/3d/pipeline/static/static_pipeline.cpp @@ -12,18 +12,18 @@ namespace Tyra { -Stapipeline::Stapipeline() { colorsCache = new Vec4[4]; } +StaticPipeline::StaticPipeline() { colorsCache = new Vec4[4]; } -Stapipeline::~Stapipeline() { delete[] colorsCache; } +StaticPipeline::~StaticPipeline() { delete[] colorsCache; } -void Stapipeline::init(RendererCore* t_core) { +void StaticPipeline::init(RendererCore* t_core) { rendererCore = t_core; core.init(t_core); } -void Stapipeline::onUse() { core.reinitStandardVU1Programs(); } +void StaticPipeline::onUse() { core.reinitStandardVU1Programs(); } -void Stapipeline::render(DynamicMesh* mesh, const StapipOptions* options) { +void StaticPipeline::render(DynamicMesh* mesh, const StaPipOptions* options) { auto model = mesh->getModelMatrix(); MeshFrame* frameFrom = mesh->getFramesCount() > 0 @@ -49,7 +49,7 @@ void Stapipeline::render(DynamicMesh* mesh, const StapipOptions* options) { // material->isSingleColorActivated(), material->getNormalFaces(), // material->getTextureCoordFaces()); - StapipBag bag; + StaPipBag bag; addVertices(mesh, material, &bag, frameFrom, frameTo); bag.info = infoBag; bag.color = getColorBag(mesh, material, frameFrom, frameTo); @@ -65,9 +65,9 @@ void Stapipeline::render(DynamicMesh* mesh, const StapipOptions* options) { delete infoBag; } -void Stapipeline::addVertices(DynamicMesh* mesh, MeshMaterial* material, - StapipBag* bag, MeshFrame* frameFrom, - MeshFrame* frameTo) const { +void StaticPipeline::addVertices(DynamicMesh* mesh, MeshMaterial* material, + StaPipBag* bag, MeshFrame* frameFrom, + MeshFrame* frameTo) const { bag->count = material->getFacesCount(); bag->vertices = new Vec4[bag->count]; @@ -83,10 +83,10 @@ void Stapipeline::addVertices(DynamicMesh* mesh, MeshMaterial* material, } } -StapipInfoBag* Stapipeline::getInfoBag(DynamicMesh* mesh, - const StapipOptions* options, - M4x4* model) const { - auto* result = new StapipInfoBag(); +StaPipInfoBag* StaticPipeline::getInfoBag(DynamicMesh* mesh, + const StaPipOptions* options, + M4x4* model) const { + auto* result = new StaPipInfoBag(); if (options) { result->antiAliasingEnabled = options->antiAliasingEnabled; @@ -96,7 +96,7 @@ StapipInfoBag* Stapipeline::getInfoBag(DynamicMesh* mesh, } else { result->antiAliasingEnabled = false; result->blendingEnabled = true; - result->shadingType = StapipShadingFlat; + result->shadingType = StaPipShadingFlat; result->noClipChecks = true; } @@ -105,11 +105,11 @@ StapipInfoBag* Stapipeline::getInfoBag(DynamicMesh* mesh, return result; } -StapipColorBag* Stapipeline::getColorBag(DynamicMesh* mesh, - MeshMaterial* material, - MeshFrame* frameFrom, - MeshFrame* frameTo) const { - auto* result = new StapipColorBag(); +StaPipColorBag* StaticPipeline::getColorBag(DynamicMesh* mesh, + MeshMaterial* material, + MeshFrame* frameFrom, + MeshFrame* frameTo) const { + auto* result = new StaPipColorBag(); if (material->isSingleColorActivated()) { result->single = &material->singleColor; @@ -133,13 +133,13 @@ StapipColorBag* Stapipeline::getColorBag(DynamicMesh* mesh, return result; } -StapipTextureBag* Stapipeline::getTextureBag(DynamicMesh* mesh, - MeshMaterial* material, - MeshFrame* frameFrom, - MeshFrame* frameTo) { +StaPipTextureBag* StaticPipeline::getTextureBag(DynamicMesh* mesh, + MeshMaterial* material, + MeshFrame* frameFrom, + MeshFrame* frameTo) { if (!material->getTextureCoordFaces()) return nullptr; - auto* result = new StapipTextureBag(); + auto* result = new StaPipTextureBag(); result->texture = rendererCore->texture.repository.getBySpriteOrMesh(material->getId()); @@ -163,15 +163,15 @@ StapipTextureBag* Stapipeline::getTextureBag(DynamicMesh* mesh, return result; } -StapipLightingBag* Stapipeline::getLightingBag( +StaPipLightingBag* StaticPipeline::getLightingBag( DynamicMesh* mesh, MeshMaterial* material, M4x4* model, MeshFrame* frameFrom, MeshFrame* frameTo, - const StapipOptions* options) const { + const StaPipOptions* options) const { if (!material->getNormalFaces() || options == nullptr || options->lighting == nullptr) return nullptr; - auto* result = new StapipLightingBag(true); + auto* result = new StaPipLightingBag(true); result->lightMatrix = model; result->setLightsManually(colorsCache, @@ -193,8 +193,8 @@ StapipLightingBag* Stapipeline::getLightingBag( return result; } -void Stapipeline::setLightingColorsCache( - StapipLightingOptions* lightingOptions) { +void StaticPipeline::setLightingColorsCache( + StaPipLightingOptions* lightingOptions) { for (int i = 0; i < 3; i++) { colorsCache[i] = reinterpret_cast(lightingOptions->directionalColors[i]); @@ -202,8 +202,8 @@ void Stapipeline::setLightingColorsCache( colorsCache[3] = reinterpret_cast(*lightingOptions->ambientColor); } -void Stapipeline::deallocDrawBags(StapipBag* bag, - MeshMaterial* material) const { +void StaticPipeline::deallocDrawBags(StaPipBag* bag, + MeshMaterial* material) const { if (bag->color->many) { delete[] bag->color->many; } diff --git a/samples/h4570/inc/h4570.hpp b/samples/h4570/inc/h4570.hpp index e776d72..8d62c75 100644 --- a/samples/h4570/inc/h4570.hpp +++ b/samples/h4570/inc/h4570.hpp @@ -39,8 +39,8 @@ class H4570 : public Game { Vec4 cameraPosition, cameraLookAt; MinecraftPipeline mcPip; - Stapipeline stapip; - StapipOptions* renderOptions; + StaticPipeline stapip; + StaPipOptions* renderOptions; Texture* blocksTex; u32 blocksCount; diff --git a/samples/h4570/src/h4570.cpp b/samples/h4570/src/h4570.cpp index 9c0dfc6..b0a0ece 100644 --- a/samples/h4570/src/h4570.cpp +++ b/samples/h4570/src/h4570.cpp @@ -18,7 +18,7 @@ H4570::H4570(Engine* t_engine) { engine = t_engine; } H4570::~H4570() {} DynamicMesh* getWarrior(Renderer* renderer); -StapipOptions* getRenderingOptions(); +StaPipOptions* getRenderingOptions(); Sprite* get2DPicture(Renderer* renderer); void H4570::init() { @@ -179,8 +179,8 @@ Sprite* get2DPicture(Renderer* renderer) { return sprite; } -StapipOptions* getRenderingOptions() { - auto* options = new StapipOptions(); +StaPipOptions* getRenderingOptions() { + auto* options = new StaPipOptions(); auto* ambientColor = new Color(32.0F, 32.0F, 32.0F, 32.0F); auto* directionalColors = new Color[3]; @@ -189,12 +189,12 @@ StapipOptions* getRenderingOptions() { for (int i = 0; i < 3; i++) directionalDirections[i].set(1.0F, 1.0F, 1.0F, 1.0F); - auto* lightingOptions = new StapipLightingOptions(); // Memory leak! + auto* lightingOptions = new StaPipLightingOptions(); // Memory leak! lightingOptions->ambientColor = ambientColor; lightingOptions->directionalColors = directionalColors; lightingOptions->directionalDirections = directionalDirections; - options->shadingType = Tyra::StapipShadingGouraud; + options->shadingType = Tyra::StaPipShadingGouraud; options->blendingEnabled = true; options->antiAliasingEnabled = false; options->lighting = lightingOptions; diff --git a/samples/wellinator/inc/wellinator.hpp b/samples/wellinator/inc/wellinator.hpp index faa0f49..ed115e3 100644 --- a/samples/wellinator/inc/wellinator.hpp +++ b/samples/wellinator/inc/wellinator.hpp @@ -36,8 +36,8 @@ class Wellinator : public Game { Vec4 cameraPosition, cameraLookAt; MinecraftPipeline mcPip; - Stapipeline stapip; - StapipOptions* renderOptions; + StaticPipeline stapip; + StaPipOptions* renderOptions; Texture* blocksTex; u32 blocksCount; diff --git a/samples/wellinator/src/wellinator.cpp b/samples/wellinator/src/wellinator.cpp index f47ecae..05482e6 100644 --- a/samples/wellinator/src/wellinator.cpp +++ b/samples/wellinator/src/wellinator.cpp @@ -18,7 +18,7 @@ Wellinator::Wellinator(Engine* t_engine) { engine = t_engine; } Wellinator::~Wellinator() {} DynamicMesh* getWarrior(Renderer* renderer); -StapipOptions* getRenderingOptions(); +StaPipOptions* getRenderingOptions(); Sprite* get2DPicture(Renderer* renderer); void Wellinator::init() { @@ -150,8 +150,8 @@ Sprite* get2DPicture(Renderer* renderer) { return sprite; } -StapipOptions* getRenderingOptions() { - auto* options = new StapipOptions(); +StaPipOptions* getRenderingOptions() { + auto* options = new StaPipOptions(); auto* ambientColor = new Color(32.0F, 32.0F, 32.0F, 128.0F); auto* directionalColors = new Color[3]; @@ -160,12 +160,12 @@ StapipOptions* getRenderingOptions() { for (int i = 0; i < 3; i++) directionalDirections[i].set(1.0F, 1.0F, 1.0F, 1.0F); - auto* lightingOptions = new StapipLightingOptions(); // Memory leak! + auto* lightingOptions = new StaPipLightingOptions(); // Memory leak! lightingOptions->ambientColor = ambientColor; lightingOptions->directionalColors = directionalColors; lightingOptions->directionalDirections = directionalDirections; - options->shadingType = Tyra::StapipShadingGouraud; + options->shadingType = Tyra::StaPipShadingGouraud; options->blendingEnabled = true; options->antiAliasingEnabled = false; options->lighting = lightingOptions;