核心热路径(数学/内存/字符串/性能分析)用MASM汇编(SSE/AVX2) 外围系统(窗口/渲染/ECS/音频/UI/脚本)用C语言 含自研编辑器、VisualScript积木编程、中文渲染(glyph_atlas)
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
#pragma once
|
|
|
|
// ============================================================================
|
|
// block_palette.h - 积木面板
|
|
// ============================================================================
|
|
|
|
#include "block_types.h"
|
|
#include "block_workspace.h"
|
|
|
|
#define MAX_PALETTE_CATEGORIES 16
|
|
|
|
typedef struct {
|
|
char name[64];
|
|
BlockType blocks[64];
|
|
int block_count;
|
|
int expanded;
|
|
} PaletteCategory;
|
|
|
|
typedef struct BlockPalette {
|
|
PaletteCategory categories[MAX_PALETTE_CATEGORIES];
|
|
int category_count;
|
|
|
|
float x, y, width, height;
|
|
float scroll_y;
|
|
|
|
char search_text[128];
|
|
int search_active;
|
|
} BlockPalette;
|
|
|
|
// 初始化
|
|
void palette_init(BlockPalette* palette);
|
|
|
|
// 添加积木到面板 (按分类)
|
|
void palette_add_block(BlockPalette* palette, BlockType type);
|
|
|
|
struct BlockRenderer;
|
|
void palette_render(BlockPalette* palette, struct BlockRenderer* renderer);
|
|
|
|
// 处理点击
|
|
BlockType palette_handle_click(BlockPalette* palette, float mx, float my);
|
|
|
|
// 搜索
|
|
void palette_search(BlockPalette* palette, const char* text);
|