Road to 0.6.0

- readd the c++ linear allocator for 3ds
- start switching from PD::Vec to std::vector
- Add Color::Hex as constexpr for compiletime color converts
- Add FNV Hasing functions
- Make UI7 ids be able to be generated at compile time
- Added a Throw Function (for whatever)
- Added HexCHar2Int (replaces the lookup table)
- Made u128 fully constexpr
This commit is contained in:
2025-12-10 19:02:54 +01:00
parent 91754558f7
commit f19c947fc3
23 changed files with 262 additions and 120 deletions

View File

@@ -27,19 +27,10 @@ SOFTWARE.
#include <3ds.h>
#include <citro3d.h>
#include <pd-3ds/linearAllocator.hpp>
#include <pd/lithium/lithium.hpp>
namespace PD {
template <typename T>
class LinearAlloc : public Allocator<T> {
public:
LinearAlloc() = default;
~LinearAlloc() = default;
/** Never forget the sizeof(T) again (most painful bug i created) */
T* Allocate(size_t n) override { return (T*)linearAlloc(n * sizeof(T)); }
void Deallocate(T* ptr) { linearFree(ptr); }
};
class GfxC3D : public GfxDriver {
public:
GfxC3D() : GfxDriver("Citro3D") {}
@@ -59,8 +50,8 @@ class GfxC3D : public GfxDriver {
PD::Li::Texture::Filter filter =
PD::Li::Texture::Filter::LINEAR) override;
Vec<Li::Vertex, LinearAlloc<Li::Vertex>> VertexBuffer;
Vec<u16, LinearAlloc<u16>> IndexBuffer;
std::vector<Li::Vertex, LinearAllocator<Li::Vertex>> VertexBuffer;
std::vector<u16, LinearAllocator<u16>> IndexBuffer;
int pLocProjection = 0;
DVLB_s* ShaderCode;
shaderProgram_s Shader;