Commit Graph
66 Commits
Author SHA1 Message Date
西风逍遥游andCursor 610cb70a82 feat(graphics): decode file textures on the thread pool
Queue ImageData load through IAsyncWorkExecutor so newTextureFromFile returns a stub immediately; GPU upload still uses the existing immediate path on first use. Skip a second ImGui atlas rebuild on ui.setScale so CJK glyphs are not duplicated during galgame startup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 16:11:57 +08:00
西风逍遥游 61df9a1e07 feat(ui): integrate world-space GUI anchors 2026-08-31 20:51:13 +08:00
西风逍遥游 7163fb1ea2 feat(ui): add desktop drag and drop 2026-08-31 00:50:47 +08:00
西风逍遥游 63246b8c68 fix: complete architecture consolidation contracts 2026-08-28 00:01:55 +08:00
西风逍遥游 3b28b012ad fix: handle critical UI and image results 2026-08-27 17:11:23 +08:00
西风逍遥游 293be41d66 Merge remote-tracking branch 'origin/dev' into codex/architecture-consolidation
# Conflicts:
#	cmake/module_manifest.cmake
#	docs/usr/modules/procgen.md
#	src/engine/CMakeLists.txt
#	src/engine/cmdline/Run.cpp
#	src/engine/common/ScriptModule.h
#	src/modules/animation/Animation.cpp
#	src/modules/physics/World.cpp
#	src/modules/physics/World3D.cpp
#	src/modules/procgen/Procgen.cpp
#	src/modules/procgen/Procgen.h
#	src/modules/scene/SceneCapabilities.cpp
#	src/modules/schema/Schema.cpp
#	src/modules/schema/Schema.h
2026-08-27 14:52:28 +08:00
西风逍遥游 a8b8e83128 refactor: consolidate engine architecture contracts 2026-08-27 12:54:48 +08:00
西风逍遥游 9a485b045b Merge branch 'dev' into codex/runtime-profiler 2026-08-26 14:30:50 +08:00
西风逍遥游 04b2ebcf0e Merge pull request #256 from EVEngine/codex/ui-framework-overhaul
Unify UI presentation and component framework
2026-08-26 08:28:55 +08:00
西风逍遥游 7c19cf33e5 fix(ui): parse numeric properties on older Apple targets 2026-08-26 02:52:49 +08:00
西风逍遥游 1a58e4d809 feat(ui): unify presentation and component framework 2026-08-26 02:35:29 +08:00
西风逍遥游 3ac1411d85 feat(profiler): add built-in engine-wide profiler
Introduce a Tracy/UE-Insights-style scoped-zone profiler that instruments the
engine's core per-frame systems and reports per-module/per-zone self vs total
time plus GPU frame timing.

- common/Profile.* : core zone collector (eve::prof). EV_PROFILE_* RAII macros
  push {name,module,thread,parent,depth,start,end} into per-thread buffers;
  frameMark() aggregates the frame into a call tree with self/total per module
  and zone, sorted by self time. Cheap single-branch no-op when disabled.
  Lives in common/ so any module can instrument without layering violations.
- profiler module (SLOT profiler): script API setEnabled()/beginFrame()/
  endFrame()/begin()/end()/capture()/textReport()/frameMs()/gpuFrameMs().
  Installs itself as the IRenderTracer so render passes become graphics zones.
- Instrument core hot systems: physics (World/World3D), animation, particles,
  audio pump, ui render, scene transforms, map tiles, crowd, event pump.
- GPU timing: Vulkan timestamp queries around the present command buffer
  (whole-frame), exposed via common/GpuTimer.h IGpuTimer capability provided by
  graphics; read after the synchronous submit waits the in-flight fence.
- load.nut drives frameBegin()/endFrame() + section markers, no-op when absent.
- Tests: C++ unit (core aggregation self<total, render-pass zones) + script API.

Verified: all changed TUs compile against real VKBuilder/ECS/zeroerr headers;
module_depgraph.py --check / --check-layers pass. Full-link build blocked in
this env by a prebuilt third-party Squirrel version mismatch (unrelated).
2026-08-26 00:44:26 +08:00
西风逍遥游 08614ed194 feat: add playable galgame demo 2026-08-25 22:45:53 +08:00
西风逍遥游 25f59bcb5f Merge remote-tracking branch 'origin/dev' into codex/unity-editor
# Conflicts:
#	docs/usr/modules/ui.md
2026-08-25 12:45:31 +08:00
西风逍遥游 b8b653b9e5 fix(ui): center tool icons and reserve flex flow space 2026-08-25 11:47:57 +08:00
西风逍遥游 346ee1fd3e feat(ui): add theme-driven responsive editor layout 2026-08-25 11:40:20 +08:00
西风逍遥游 9b19879e5e fix(ui): polish editor toolbar rendering 2026-08-25 06:20:08 +08:00
西风逍遥游 4bc6cc1ba6 feat(ui): modernize editor shell workspace layout 2026-08-25 06:12:16 +08:00
西风逍遥游 8daf841af2 feat(ui): composite engine textures in declarative widgets 2026-08-25 06:09:09 +08:00
西风逍遥游 56d8dc6873 feat(ui): add reusable desktop editor layout components 2026-08-25 06:07:47 +08:00
西风逍遥游 f0cbcbea5c feat(ui): add modern editor widget primitives 2026-08-25 06:02:24 +08:00
西风逍遥游 812662d723 feat(ui): add bundled semantic editor icons 2026-08-25 05:53:56 +08:00
西风逍遥游 73a04432b1 feat(ui): modernize theme and sharpen Windows rendering 2026-08-25 05:43:43 +08:00
西风逍遥游 5682654e5b fix(ui): trim desktop host services on WebGPU 2026-08-25 00:57:34 +08:00
西风逍遥游 a8905cf365 fix(editor): keep JSON protocol portable 2026-08-25 00:49:18 +08:00
西风逍遥游 cdff0b90d6 Merge remote-tracking branch 'origin/dev' into codex/editor-p0-p1-mcp 2026-08-25 00:39:42 +08:00
西风逍遥游 328e37e8ec feat(editor): complete P0 and P1 authoring services 2026-08-24 22:47:23 +08:00
西风逍遥游 4b32a0e06b fix(event): add owning messages and payloads 2026-08-24 20:48:28 +08:00
西风逍遥游 9e59e2bab7 fix(ui): merge CJK system font so Chinese text renders instead of '?'
The first available regular system font (Segoe UI / DejaVu Sans / Helvetica) is Latin-only, so requesting CJK glyph ranges in loadFonts() never put any Chinese glyphs in the ImGui atlas. Every missing codepoint then rendered as ImGui's '?' fallback glyph.

Merge the first available CJK-capable system font (msyh.ttc / PingFang / NotoSansCJK / wqy) into the same atlas with MergeMode, and warn after upload if the atlas still lacks CJK coverage.
2026-08-23 15:01:34 +08:00
西风逍遥游 811eff1c3a ci(quality): warnings-as-errors gate, sanitizers, smoke, Python lint/tests
- EVENGINE_ENABLE_STRICT_WARNINGS option: MSVC /W4 /WX, GCC/Clang
  -Wall -Wextra -Werror, with documented noise suppressions and
  -isystem/-external:I for third-party headers; enabled on the
  Windows/Linux debug CI jobs.
- Fix warnings across engine, modules and tests exposed by the gate,
  including real bugs (incomplete-type deletes, Timespan microsecond
  overflow, overload hiding, enum switch gaps, dead code).
- Add Linux ASan+UBSan job, example smoke step, python-tools test
  job, ruff config (scripts+tools), weekly Linux coverage job and a
  CodeQL workflow.
2026-08-22 02:27:37 +08:00
西风逍遥游 a07a93a8a4 fix(ui): replace to_chars float formatting for iOS < 16.3 compatibility 2026-08-21 19:50:06 +08:00
西风逍遥游 96dae32c38 feat(ui): DevTools panel suite - database grid, nested editing, scene tree, editor shell 2026-08-21 18:15:59 +08:00
西风逍遥游 06061d9d99 feat(ui): reflection-driven property inspector (MVVM DevTools) 2026-08-21 17:34:26 +08:00
西风逍遥游 34d1fdb63b refactor(modules): clear remaining back-edges and split the largest TUs (#127)
* chore(ci): add clang-format gate, CODEOWNERS and agent collaboration rules

* refactor(modules): clear remaining back-edges and split the largest TUs

Three known dependency back-edges are gone (module_depgraph.py KNOWN_BACK_EDGES
is now empty; --check passes with 0 violations, 0 cycles):

- window -> graphics: window queries the new IWindowSurfaceHost capability
  (common/WindowSurfaceHost.h) instead of holding a Graphics pointer;
  Window::setGraphics was removed and all call sites updated.
- window -> image: Window::setIcon was replaced by setIconRGBA(const uint8_t*,
  w, h); the window no longer decodes ImageData.
- scene -> graphics: pickScreenAt / collectFrustumIdsAt implementations moved
  to graphics/ScenePicking.cpp (graphics -> scene is a legal downward edge);
  scene now depends only on spatial.

TU splits (pure moves, verified identical method sets and brace balance):

- vulkan/Graphics.cpp (5118 lines) -> Graphics.cpp (lifecycle), GraphicsPipeline,
  Graphics2D, Graphics3D, GraphicsMesh + shared GraphicsInternal.h.
- scene/Scene.cpp -> Scene.cpp (script layer / host lifecycle / serialization)
  + SceneNodes.cpp + shared SceneInternal.h.

Verified with a real build (MSVC 19.51, prebuilt third-party): full build green;
window.* and Scene.* suites pass, including scene picking/culling and GPU cases.

* refactor(graphics): narrow Graphics interfaces and clear public-header leaks

Step 4 — interface segregation:
- New lean interfaces: IGraphics2D, IGraphics3D, IResourceFactory, IPostFX
  (pure virtuals, forward-declared types only; graphics/Color.h extracted from
  Canvas.h so modules that only need the color type stop pulling Canvas.h).
- Graphics now implements all four facets; consumers can depend on the narrow
  interface they use instead of the 129-method god class.
- Migrated voxel (VoxelWorld::drawVisible -> IGraphics3D*) and model3d
  (ModelRenderer::buildRenderable(s) -> IResourceFactory&).
- Graphics.h slims from 24 sub-header includes to a handful of small type
  headers + forward declarations; the destructor moved out-of-line so
  unique_ptr effect members are destroyed where types are complete.

Step 5 — header leaks (module_depgraph.py '*' marks: 14 -> 7):
- map/TileLayer.h, particles/ParticleEmitter.h, avatar/AvatarInstance.h,
  animation/SpineAnim.h, map/TileSystem.h, model3d/ModelData.h,
  model3d/ModelRenderer.h, audio/Audio.h + Source.h, image/ImageData.h +
  Image.h, dialogue/Dialogue.h, procgen Palette/OutputSpec/TextureRecipe/
  PbrMaterial -> forward declarations, includes moved to .cpp.
- voxel/VoxelWorld.h: terrain sampler Pimpl'd (unique_ptr + out-of-line
  destructor), removing the procgen header dependency.
- gpgpu/vulkan backend headers stop pulling graphics/vulkan/Graphics.h.
- Remaining '*' marks are deliberate: tiny POD/enum headers (GridConfig,
  MapObject, BlendMode, Color), an internal backend header
  (GraphicsInternal.h -> filesystem), and lean interface references.

Verified with a full clean build (MSVC) and tests: window/Scene/voxel/
RenderSystem/Quad/shader/TextureSampler/resourceLifetime pass; broad suite
only shows the pre-existing PHYSFS-init filesystem-environment failures.

* feat(resources): revive ResourceManager as unified IAssetReloader-backed cache

* fix(resources): leak ResourceManager singleton to avoid exit-time teardown crashes

Cached CPU resources may own third-party handles (FreeType faces, Assimp
scenes, image decode handlers) whose libraries are torn down at process
exit in an unspecified TU order; destroying cached entries from the
singleton destructor can segfault at exit (seen on CI Windows in
model3d.materialApi.objMtl). Keep the singleton alive until OS reclaim;
explicit unload()/clear() still release entries during the run.

* refactor(devtools): consume business modules through capability interfaces

DevTools / cmdline no longer include business-module headers, so trimming
scene / physics / procgen / particles / audio / ui / graphics no longer
requires disabling devtools, and devtools can be switched off with
-DEVENGINE_MODULE_DEVTOOLS=OFF.

New capability interfaces in common/:
- ISceneQuery (scene) - host/node inspection + mutation + transform sync
- IRenderCapture (graphics) - render status, PNG capture, camera control,
  visible-entity snapshot, entity-ID mask, G-buffer PNGs
- IPhysicsQuery (physics) - 2D world lifecycle + ray casts
- IProcgenQuery (procgen) - recipe listing, map/mesh generation
- IParticlesQuery (particles) - emitter status + one-shot emit
- IAudioQuery (audio) - volume / stop-all
- IEditorHost (ui) - declarative editor host (used by cmdline too)

Providers register in their module constructors. DevTools rewires McpServer
(render/scene/procgen/physics/particles/audio/host tools), SceneInspect
(now delegates to ISceneQuery + IRenderCapture) and RenderVision (uses
IRenderCapture::capturePngDataUrl); cmdline/Mcp.cpp uses IEditorHost.

manifest: devtools DEPS graphics scene physics procgen particles audio ui
image event filesystem -> event; cmdline DEPS filesystem ui -> filesystem.

Verified: full build green; devtools.mcp.* tests pass; broad suite shows
only the pre-existing PHYSFS-init filesystem-environment failures.

* style: apply clang-format to changed lines after dev merge

* fix(webgpu): include RenderControl/TextureSampler explicitly after Graphics.h slimming

* fix(webgpu): provide newFont/print stubs to satisfy IGraphics2D/IResourceFactory vtables

* fix(common): make ProcgenQuery.h self-sufficient (cstdint/utility for GCC)
2026-08-20 05:53:33 +08:00
西风逍遥游 209140eea7 Merge pull request #118 from EVEngine/codex/startup-timing
fix(startup): cut make-run delay, boot diagnostics, and crash backtrace
2026-08-19 13:04:30 +08:00
西风逍遥游 84e56a9421 fix(ui): include common/config.h before the Emscripten/WebGPU JSON guard
EVENGINE_WEBGPU is injected via common/config.h (#cmakedefine), not as a
compiler flag; UI.cpp never included it, so the Poco guard stayed inactive
and the WASM build still failed on Poco/JSON includes. EditorHost.cpp works
because it includes config.h explicitly.
2026-08-19 10:13:01 +08:00
西风逍遥游 c63725e5df Merge remote-tracking branch 'origin/main' into codex/ui-viewport-terrain-editor
# Conflicts:
#	src/modules/graphics/RenderSystem3D.h
#	src/modules/ui/UI.h
#	src/modules/ui/UISystem.h
#	src/modules/ui/Widget.h
2026-08-19 09:59:41 +08:00
西风逍遥游 8f980a580f Merge remote-tracking branch 'origin/main' into codex/startup-timing 2026-08-19 09:49:51 +08:00
西风逍遥游 1c7a93a010 fix(ui): guard Poco JSON UI assets for the Emscripten/WebGPU build
saveTreeJson/loadTreeJson used Poco JSON, which the trimmed WASM runtime
does not ship (same guard pattern as EditorHost.cpp). Wrap the includes,
JSON helpers and the two methods, with no-op stubs on Emscripten.
2026-08-19 09:48:13 +08:00
西风逍遥游 c7de064bf4 Merge remote-tracking branch 'origin/main' into codex/ui-viewport-terrain-editor
# Conflicts:
#	src/modules/sceneloader/SceneLoader.cpp
#	test/sceneloader.cpp
2026-08-19 09:11:05 +08:00
西风逍遥游 a2dd8d7fb1 feat(ui): two-pass layout, images, events, virtualization, viewport
Gap-closing work for the declarative UI module vs UE/Unity/Godot:

- Layout: real measure pass (measureTree) + pure flexArrange with
  margin/padding/min-max/percent/anchor/absolute placement; window size,
  anchors and percentage sizing; script layout props.
- Widgets: Image/ImageButton (engine textures + nine-patch + tint/uv),
  Combo, text wrapping + CJK font candidates/ranges, InputText 1024B,
  virtualized ScrollList/virtualList.
- Events: script onClick/onChange callbacks with structured payloads
  (keeps the poll queues for compatibility).
- Tooling: UI JSON save/load (saveTreeJson/loadTreeJson), host pos tween
  animation, gamepad nav, per-frame UI stats.
- Viewport: embedded offscreen render target widget with input routing;
  RenderSystem3D::renderToCanvas preview pass + Graphics::renderScene3DToCanvas;
  editor.newHeightmapMesh/updateHeightmapMesh for heightmap terrain;
  examples/terrain-editor demonstrating orbit camera + raise/lower brush.
- Tests: 32 UI tests including real-window Vulkan smoke for the viewport.
2026-08-19 09:07:55 +08:00
西风逍遥游 4377e062dd feat: zeroerr parameter validation + Doxygen API documentation
Squashed onto current main. Adds src/engine/common/Assert.h (EV_PARAM_CHECK / EV_ASSERT backed by zeroerr), an EVENGINE_ENABLE_ASSERTS option (non-Debug builds strip ZEROERR_NO_ASSERT unless enabled), parameter checks at key entry points, Doxygen comments across headers, Doxyfile + make docs / CMake docs targets, and Windows setup + code conventions in AGENTS.md.
2026-08-19 09:01:12 +08:00
西风逍遥游 50a230f5a3 Revert "feat: zeroerr parameter validation + Doxygen API documentation (#113)"
This reverts commit 3f3e41990b, reversing
changes made to 7d6375bc95.
2026-08-19 08:36:18 +08:00
西风逍遥游 a0bd90c775 fix(startup): cut make-run delay and add boot timing diagnostics
Makefile: defer the WSL capability probe so make run no longer cold-starts the WSL VM (use wsl -l -q for make all). filesystem: file() now fails when the file is missing so file_exists() returns false (eve run from a dir without config.nut no longer dies at dofile). Add temporary [startup] stage timers and EVE_BOOT_BENCH auto-exit to profile boot time.
2026-08-19 08:26:53 +08:00
西风逍遥游 af0cae4e49 Merge branch 'main' into codex/asserts-and-api-docs
# Conflicts:
#	src/engine/cmdline/cmdline.h
#	src/modules/building/BuildingTypes.h
#	src/modules/building/Ghost.h
#	src/modules/building/JsonHelpers.h
#	src/modules/building/PlacementSystem.h
#	src/modules/building/PlacementWorld.h
#	src/modules/dialogue/Dialogue.h
#	src/modules/filesystem/HotReload.h
#	src/modules/gpgpu/Gpgpu.h
#	src/modules/graphics/Graphics.h
#	src/modules/inventory/JsonHelpers.h
#	src/modules/model3d/ModelData.h
#	src/modules/network/Network.h
#	src/modules/network/TcpSocket.h
#	src/modules/rpg/JsonHelpers.h
#	src/modules/scene/SceneHost.h
#	src/modules/tensor/GpuBackend.h
#	src/modules/tensor/Graph.h
#	src/modules/tensor/Tensor.h
#	src/modules/voxel/Chunk.h
#	src/modules/voxel/GreedyMesher.h
#	src/modules/voxel/VoxelWorld.h
2026-08-19 08:20:18 +08:00
西风逍遥游 228b5a0f15 docs: add Doxygen API comments, docs target, and Windows AGENTS.md
Normalize all header comments to Doxygen @brief form and fill in missing class/method docs across engine common, cmdline, and module headers (~2368 @brief entries). Add root Doxyfile, 'make docs' target, CMake docs target, .gitignore for docs/api, README/docs/dev updates, and a Windows (native) + code-conventions section in AGENTS.md.
2026-08-19 00:13:35 +08:00
Cursor Agentand西风逍遥游 f7aacbc4a9 refactor(event): let modules translate their own platform events
The SDL pump did the translation itself, so it had to know about keyboard,
joystick, touch, window, graphics, audio and ui: eight upward dependencies from
one of the engine's lowest modules, and the source of every remaining
dependency cycle.

Each module now registers an IPlatformEventSink for the events it owns and the
pump only dispatches. Key and text events move to keyboard/sdl, joystick and
game-controller events (including the hotplug device table) to joystick/sdl,
finger events to touch/sdl, resize and the mobile background/foreground surface
watch to window/sdl, the ImGui observer to ui, and Audio::pump to an
end-of-pump hook in audio. The pump keeps only quit and window-close, which are
about the event loop rather than any one module.

Sinks run in priority order -- observer, then surface, then input -- so ImGui
still sees events first and the window is resized before anything reads its
size. The mobile surface teardown keeps using SDL_AddEventWatch rather than the
poll path, since by the time SDL_PollEvent returns the native surface is gone;
the watch is now installed by the window module on its first pump.

Also removes exceptionIfInRenderPass, whose body has been commented out since
it was written and whose only remaining effect was a graphics include.

The engine dependency graph now has zero cycles, down from 26, and the back-edge
whitelist is down to 2 (window -> graphics, window -> image). Layering is also
right way up: event sits at L0 with the input modules above it at L1/L2.

Verified: unit tests for event/input/ui/audio/thread pass, and the example
smoke suite gives the same 19 pass / 9 fail as the pre-change baseline (those 9
fail on main too, from script API drift in the examples themselves).

Co-authored-by: 西风逍遥游 <sunxfancy@gmail.com>
2026-08-18 13:46:04 +00:00
sunxfancy 4f726fd937 fix(ui): compile EditorHost stub on Emscripten/WebGPU
EditorHost.cpp did not include common/config.h, so EVENGINE_WEBGPU was
never defined and the Emscripten stub branch never compiled on the
webgpu build; the full Poco-based implementation was pulled in instead,
failing with Poco/Dynamic/Var.h not found. Include config.h and define
a minimal EditorHost::Impl for the stub so the pimpl unique_ptr can
destruct. Also fix the nested comment in EditorHost.h that clang warns
about on Emscripten.
2026-08-18 09:22:58 +08:00
西风逍遥游 4b24d1a157 feat(mcp): headless eve mcp host with AI-crafted MVVM editors
Adds 'eve mcp': a desktop-only headless MCP host (stdio by default, --port for TCP, --root for the project). It runs the full runtime, attaches DevTools (eve_eval / eve_run_script / snapshot), and starts the new EditorHost module that renders JSON-defined editor Views (ImGui) bound two-way to Squirrel ViewModel tables (MVVM), persists editors under editors/, and exposes the eve_host_* tool family (apply/state/set_value/events/capture/script/shutdown...). The stdio transport uses a background stdin reader and keeps stdout JSON-RPC-only; script print() is routed to stderr.

Tests: stdio handshake + tools/list round trip, host editor binding (VM<->View sync, set_value -> VM write + onChange events, save/reload persistence). Docs updated (AI与MCP支持.md, 命令行设计.md, tools/eve-mcp README) with the editor JSON protocol and Codex stdio setup.
2026-08-17 22:43:08 +08:00
sunxfancy 0d47e7bdd8 fix(ui): avoid double DPI scaling on high-resolution screens
ImGui's SDL backend already applies the display density via
io.DisplayFramebufferScale (used by ImGui_ImplVulkan_RenderDrawData), but
the UI backend was additionally multiplying the same DPI ratio into the
font atlas size and theme geometry. On HiDPI displays this scaled the UI
twice, making it appear far too large.

Split the logical (point-space) UI scale from the display/framebuffer DPI
ratio: the font atlas is still rasterized at native DPI for crispness, but
applyThemeToImGui cancels it via FontGlobalScale so logical text/geometry
stay constant across display densities.
2026-08-16 03:53:44 +08:00