feat: major engine overhaul - scene demo with lighting, sphere, ground

- Scene Demo: cube + sphere + ground plane with proper lighting
- Audio: XAudio2 dynamic loading + WAV playback
- Physics: expanded collision system
- Renderer: improved pipeline with materials
- UI: extended widget system
- VisualScript: enhanced serializer + block interactions
- ASM: optimized math/memory/profiling routines
- Window: mouse input + scroll support
This commit is contained in:
shuiyu1123 committed 2026-07-12 08:21:07 +08:00
1 parent 2653926d85
commit 0669d102ce
35 files changed
+1844 -314

No files matched your search

+24
View File
@@ -33,6 +33,30 @@ Block* block_create(BlockType type, float x, float y) {
return block;
}
// 复制积木 (深拷贝,不复制连接关系)
Block* block_copy(const Block* src) {
if (!src) return NULL;
Block* block = (Block*)malloc(sizeof(Block));
if (!block) return NULL;
memcpy(block, src, sizeof(Block));
// 重新设置拥有者,断开所有连接
for (int i = 0; i < MAX_BLOCK_INPUTS; i++) {
block->inputs[i].owner = block;
block->inputs[i].connected = NULL;
}
for (int i = 0; i < MAX_BLOCK_OUTPUTS; i++) {
block->outputs[i].owner = block;
block->outputs[i].connected = NULL;
}
block->next = NULL;
block->parent_if = NULL;
block->workspace = NULL;
block->user_data = NULL;
return block;
}
// 销毁积木
void block_destroy(Block* block) {
if (!block) return;