This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ---@meta | |
| ---@class CF_Touch | |
| ---@field id number | |
| ---@field x number | |
| ---@field y number | |
| ---@field pressure number | |
| ---@class CF_ImeComposition | |
| ---@field composition string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Shallow copy a table | |
| local function shallow_copy(t) | |
| local copy = {} | |
| for k, v in pairs(t) do | |
| copy[k] = v | |
| end | |
| return copy | |
| end | |
| -- Escape reserved characters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define SPRITEBATCH_CHECK_BUFFER_GROW(ctx, count, capacity, data, type) \ | |
| do { \ | |
| if ((ctx->count) >= ctx->capacity) \ | |
| { \ | |
| int new_capacity = (ctx->count) * 2; \ | |
| void* new_data = SPRITEBATCH_MALLOC(sizeof(type) * new_capacity, ctx->mem_ctx); \ | |
| if (!new_data) return 0; \ | |
| SPRITEBATCH_MEMCPY(new_data, ctx->data, sizeof(type) * (ctx->count)); \ | |
| SPRITEBATCH_FREE(ctx->data, ctx->mem_ctx); \ | |
| ctx->data = (type*)new_data; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <pico_ecs.h> | |
| // -- System API -- | |
| template<ecs_system_fn F> | |
| inline ecs_id_t ecs_system; | |
| template<ecs_system_fn F, typename... Cs> | |
| ecs_id_t ecs_register_system(ecs_t *ecs, void *udata) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public sealed class ObjectPool<T> : IDisposable where T : Node2D, IPoolable<T> | |
| { | |
| private readonly Node m_Parent; | |
| private readonly PackedScene m_PackedScene; | |
| private readonly string? m_Group; | |
| private readonly HashSet<T> m_Active = new HashSet<T>(); | |
| private readonly Stack<T> m_Inactive = new Stack<T>(); | |
| private readonly Action<T> m_OnReleased; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public readonly struct Subscription : IDisposable | |
| { | |
| private readonly Action? m_Dispose; | |
| public Subscription(Action dispose) | |
| { | |
| m_Dispose = dispose; | |
| } | |
| public void Dispose() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <Spaghetti/Vec2.h> | |
| namespace Spaghetti { | |
| template<typename T> | |
| struct Vec2; | |
| template<typename T> | |
| struct Circle { |
NewerOlder