Converte símbolos Unicode decorativos dos comentários para ASCII
Substitui barras de caixa (─ ═ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴), travessões (—), setas (→ ←), reticências (…), bullets (•), multiplicação (×) e guillemets (› ‹) por equivalentes ASCII. Acentos portugueses são preservados.
This commit is contained in:
1 parent
1cc0ff9d02
commit
90d47bf8a0
36 files changed
+327
-327
No files matched your search
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* TinyBlocks — tb_sdl2.h
|
||||
* TinyBlocks - tb_sdl2.h
|
||||
*
|
||||
* TypeBlocks disponíveis após registrar esta library:
|
||||
*
|
||||
* SDL2.Events — expõe o estado de eventos do frame corrente (sem inputs;
|
||||
* SDL2.Events - expõe o estado de eventos do frame corrente (sem inputs;
|
||||
* outputs pré-preenchidos pelo SDL2.App antes de cada on_draw)
|
||||
*
|
||||
* SDL2.App — cria janela, roda o loop principal, chama on_draw na scene.
|
||||
* SDL2.App - cria janela, roda o loop principal, chama on_draw na scene.
|
||||
* in: title(text), w(int), h(int), scene(block), events(block)
|
||||
*
|
||||
* Blocos primitivos (uso manual):
|
||||
@@ -30,7 +30,7 @@ TB_API const TinyBlocks_LibraryDescriptor* tinyblocks_get_library(void);
|
||||
struct TinyBlocks_GraphicsBackend;
|
||||
TB_API const struct TinyBlocks_GraphicsBackend* tb_sdl2_graphics_backend(void);
|
||||
|
||||
/* ── Índices de output do bloco SDL2.Events ──────────────────────────────── */
|
||||
/* -- Índices de output do bloco SDL2.Events --- */
|
||||
#define SDL2_EV_MOUSE_X 0 /* real: posição X do mouse */
|
||||
#define SDL2_EV_MOUSE_Y 1 /* real: posição Y do mouse */
|
||||
#define SDL2_EV_MOUSE_L_HELD 2 /* int: botão esquerdo pressionado (estado) */
|
||||
@@ -52,7 +52,7 @@ TB_API const struct TinyBlocks_GraphicsBackend* tb_sdl2_graphics_backend(void);
|
||||
#define SDL2_EV_MOD_STATE 18 /* int: SDL_GetModState() deste frame */
|
||||
#define SDL2_EV_COUNT 19 /* total de outputs */
|
||||
|
||||
/* ── Constantes de tipo de evento (SDL2.PollEvent legado) ───────────────── */
|
||||
/* -- Constantes de tipo de evento (SDL2.PollEvent legado) --- */
|
||||
#define TB_SDL2_EVENT_NONE 0
|
||||
#define TB_SDL2_EVENT_QUIT 256
|
||||
#define TB_SDL2_EVENT_KEYDOWN 768
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* TinyBlocks — tb_sdl2.c
|
||||
* TinyBlocks - tb_sdl2.c
|
||||
* Backend SDL2 para TinyBlocks.
|
||||
*
|
||||
* Blocos principais:
|
||||
* SDL2.Events — snapshot de eventos do frame, pré-preenchido pelo SDL2.App
|
||||
* SDL2.App — janela + renderer + loop principal + executor de renderables
|
||||
* SDL2.Events - snapshot de eventos do frame, pré-preenchido pelo SDL2.App
|
||||
* SDL2.App - janela + renderer + loop principal + executor de renderables
|
||||
*
|
||||
* Blocos primitivos legados: Init, Quit, Window, Renderer, etc.
|
||||
*
|
||||
* Também implementa o contrato TinyBlocks_GraphicsBackend da interface
|
||||
* tinyblocks-graphics (várias janelas, entrada por janela, desenho com AA e
|
||||
* medição de texto com a fonte real) — ver tb_sdl2_graphics_backend().
|
||||
* medição de texto com a fonte real) - ver tb_sdl2_graphics_backend().
|
||||
*/
|
||||
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
@@ -27,9 +27,9 @@
|
||||
#include <tb_graphics.h>
|
||||
#include "../include/tb_sdl2.h"
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Handles opacos de Window/Renderer (blocos wrapper)
|
||||
* ═══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static TinyBlocks_TypeBlock* s_type_window_handle = NULL;
|
||||
static TinyBlocks_TypeBlock* s_type_renderer_handle = NULL;
|
||||
|
||||
@@ -44,9 +44,9 @@ static void eval_handle_noop(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
(void)self; (void)rt;
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════════════════
|
||||
* Fonte TTF — cache por tamanho
|
||||
* ═══════════════════════════════════════════════════════════════════════════ */
|
||||
/* ===
|
||||
* Fonte TTF - cache por tamanho
|
||||
* === */
|
||||
#define FONT_CACHE_CAP 8
|
||||
#define FONT_SEARCH_COUNT 6
|
||||
|
||||
@@ -88,11 +88,11 @@ static void fonts_close_all(void) {
|
||||
s_font_cache_n = 0;
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Executor de TinyBlocks_RenderableBlock via SDL2
|
||||
* ═══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
|
||||
/* ── Rasterização com antialias ─────────────────────────────────────────────
|
||||
/* -- Rasterização com antialias ---
|
||||
* As formas preenchidas são varridas linha a linha com AA_SUB sub-linhas por
|
||||
* pixel e cobertura horizontal exata. Cada pixel é pintado uma única vez, com
|
||||
* alpha proporcional à cobertura: bordas suavizadas e sem overdraw (cores
|
||||
@@ -349,9 +349,9 @@ static void sdl2_execute(SDL_Renderer* ren,
|
||||
}
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Backend da interface tinyblocks-graphics
|
||||
* ═══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
typedef struct SdlWin {
|
||||
SDL_Window* win;
|
||||
SDL_Renderer* ren;
|
||||
@@ -586,9 +586,9 @@ const TinyBlocks_GraphicsBackend* tinyblocks_get_graphics_backend(void) {
|
||||
return &s_sdl2_backend;
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════════════════
|
||||
* SDL2.Events — snapshot de eventos do frame
|
||||
* ═══════════════════════════════════════════════════════════════════════════ */
|
||||
/* ===
|
||||
* SDL2.Events - snapshot de eventos do frame
|
||||
* === */
|
||||
static void eval_sdl2_events(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
(void)rt;
|
||||
/* Outputs são pré-preenchidos pelo SDL2.App antes de cada frame.
|
||||
@@ -658,9 +658,9 @@ static void events_push(TinyBlocks_Block* ev, const FrameEvents* fe) {
|
||||
ev->dirty = false;
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════════════════
|
||||
* SDL2.App — janela + loop principal
|
||||
* ═══════════════════════════════════════════════════════════════════════════ */
|
||||
/* ===
|
||||
* SDL2.App - janela + loop principal
|
||||
* === */
|
||||
typedef struct {
|
||||
SDL_Window* win;
|
||||
SDL_Renderer* ren;
|
||||
@@ -824,9 +824,9 @@ static void eval_sdl2_app(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
self->dirty = false;
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Blocos primitivos legados
|
||||
* ═══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static void eval_sdl2_init(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
(void)self;
|
||||
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_EVENTS) != 0)
|
||||
@@ -936,9 +936,9 @@ static void eval_sdl2_poll_event(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
}
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Registro da library
|
||||
* ═══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static bool sdl2_lib_init(TinyBlocks* rt, TinyBlocks_LibraryBlock* lib) {
|
||||
s_type_window_handle = tb_type_block_create(rt, "SDL2._WindowHandle",
|
||||
NULL,0,NULL,0, eval_handle_noop);
|
||||
|
||||
Reference in new issue
Block a user