Editor: animacoes M3, compartilhar/receber blocos por QR e ver codigo-fonte
- Animacoes (curvas do M3): blocos criados por codigo surgem em cascata, apagados saem de cena (fantasma que encolhe), os de baixo deslizam ao mudar de lugar na pilha; rolagem e zoom suaves. TINYBLOCKS_REDUCE_MOTION=1 desliga (o harness usa). Texto respeita a opacidade no backend SDL2. - Botao direito: "Ver codigo-fonte" (funcao C do bloco na aba de codigo), "Compartilhar pilha/blueprint (QR)" (scratchblocks em partes de 220 bytes, "TB1|id|parte|total|", em loop de 1 s) e "Receber blocos (QR)" (camera, partes em qualquer ordem, importa onde clicou). - tinyblocks-qr: qrcodegen (MIT) + quirc (ISC) e camera em cinza: V4L2 no Linux, Camera2 do NDK no Android (sem Java), nada no Windows. - Captura de desenvolvimento: TINYBLOCKS_SHOT_COUNT/STEP salvam sequencias. - Testes: test-qr (ida e volta) e harness cenario 35. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
70c819393c
commit
4f6a68c22c
31 files changed
+5789
-49
No files matched your search
@@ -116,6 +116,10 @@
|
||||
#define MI_REFRESH 0xe5d5
|
||||
#define MI_SAVE 0xe161
|
||||
#define MI_SEARCH 0xef7a
|
||||
#define MI_SHARE 0xe80d
|
||||
#define MI_QR_CODE 0xe00a
|
||||
#define MI_QR_SCANNER 0xf206
|
||||
#define MI_SOURCE 0xf1c8
|
||||
#define MI_SELECT 0xf74d
|
||||
#define MI_SETTINGS 0xe8b8
|
||||
#define MI_STOP 0xe047
|
||||
@@ -130,6 +134,28 @@
|
||||
#define MI_ZOOM_IN 0xe8ff
|
||||
#define MI_ZOOM_OUT 0xe900
|
||||
|
||||
/* == Movimento: curvas do M3 (cubic-bezier, como no CSS) === */
|
||||
static inline float m3_bezier(float x1, float y1, float x2, float y2, float t) {
|
||||
if (t <= 0.f) return 0.f;
|
||||
if (t >= 1.f) return 1.f;
|
||||
float lo = 0.f, hi = 1.f, u = t;
|
||||
for (int i = 0; i < 24; i++) { /* acha u com x(u) = t (bissecao) */
|
||||
u = (lo + hi) * 0.5f;
|
||||
float iu = 1.f - u;
|
||||
float x = 3.f * iu * iu * u * x1 + 3.f * iu * u * u * x2 + u * u * u;
|
||||
if (x < t) lo = u; else hi = u;
|
||||
}
|
||||
float iu = 1.f - u;
|
||||
return 3.f * iu * iu * u * y1 + 3.f * iu * u * u * y2 + u * u * u;
|
||||
}
|
||||
#define M3_EASE_STANDARD(t) m3_bezier(0.2f, 0.f, 0.f, 1.f, (t))
|
||||
#define M3_EASE_EMPH_DECEL(t) m3_bezier(0.05f, 0.7f, 0.1f, 1.f, (t)) /* entrar */
|
||||
#define M3_EASE_EMPH_ACCEL(t) m3_bezier(0.3f, 0.f, 0.8f, 0.15f, (t)) /* sair */
|
||||
#define M3_DUR_SCROLL 260u /* ms */
|
||||
#define M3_DUR_SLIDE 280u
|
||||
#define M3_DUR_APPEAR 380u
|
||||
#define M3_DUR_EXIT 220u
|
||||
|
||||
/* == Utilitarios === */
|
||||
static inline Col m3_alpha(Col c, float a) { c.a = a; return c; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user