feat(parity): implement EterBase CTimer, image/slot cooldown geometry rendering (pass32)

This commit is contained in:
shen
2026-10-08 00:01:18 -07:00
parent b70e9aa2d7
commit a3674ee672
10 changed files with 601 additions and 17 deletions
+20
View File
@@ -724,3 +724,23 @@ Validation: macOS build and Android arm64 libmain.so pass. Five targeted CTests
- `python3 tools/audit_ava2_python_interfaces.py`: **46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods**.
- CTest suite: **41/41 tests passed (100%)**.
- Android arm64 `libmain.so` and macOS arm64 `ava2_client` build cleanly.
## 2026-10-08 pass32 — EterBase Timer & Singleton, image/slot cooldown geometry rendering (dracaryS_DUNGEON_LIB)
- **EterBase CTimer and ELTimer Parity**:
- Added `src/eter_base/Singleton.h` and `src/eter_base/Timer.h` / `src/eter_base/Timer.cpp` replicating upstream Windows `EterBase/Timer.h` and `Timer.cpp`.
- Implemented `CTimer : public CSingleton<CTimer>` with safe singleton fallback, `Advance()`, `Adjust()`, `SetBaseTime()`, `GetCurrentSecond()`, `GetCurrentMillisecond()`, `GetElapsedSecond()`, `GetElapsedMilliecond()`, and `UseCustomTime()`.
- Implemented `ELTimer_Init()`, `ELTimer_GetMSec()`, `ELTimer_SetServerMSec()`, `ELTimer_GetServerMSec()`, `ELTimer_SetFrameMSec()`, `ELTimer_GetFrameMSec()`, and `ELTimer_GetServerFrameMSec()`.
- Updated `src/python_app.cpp` `SetServerMSec` and `ResetPythonAppState` to synchronize with `ELTimer`.
- **Image Cooldown Geometry Rendering (`dracaryS_DUNGEON_LIB`)**:
- Declared and implemented `RenderCoolTime(float fCoolTime)` and `OnRenderCoolTime(float fCoolTime)` on `CGraphicImageInstance` in `src/eter_image/GrpImageInstance.h` and `.cpp`.
- Declared and implemented `RenderCoolTime(float fCoolTime)` and `OnRenderCoolTime(float fCoolTime)` on `CGraphicExpandedImageInstance` in `src/eter_image/GrpExpandedImageInstance.h` and `GrpImageInstance.cpp`.
- Formed 8-triangle radial fan sweep geometry rendered via hardware-accelerated `SDL_RenderGeometry` matching upstream Direct3D behavior.
- **Python Window Cooldown Parity**:
- Updated `CImageBox::OnRender()` and `CExpandedImageBox::OnRender()` in `src/eter_ui/PythonWindow.cpp` to call `RenderCoolTime((CTimer::Instance().GetCurrentSecond() - m_fCoolTimeStart) / m_fCoolTime)` when `m_fCoolTime != 0.0f` matching upstream lines 1687 and 1895.
- Updated `CSlotWindow::OnRender()` in `src/eter_ui/PythonWindow.cpp` to render radial clock-sweep cooldown geometry via `SDL_RenderGeometry` matching upstream `CPythonGraphic::RenderCoolTimeBox`.
- **Results**:
- Checked packet constants: **240**, 0 mismatches, 0 unmatched.
- `python3 tools/audit_windows_parity.py`: **0 placeholder bindings**.
- `python3 tools/audit_ava2_python_interfaces.py`: **46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods**.
- CTest suite: **41/41 tests passed (100%)**.
- Android arm64 `libmain.so` and macOS arm64 `ava2_client` build cleanly.