2V2-e.1: 3D draw-command channel — recording D3D8 device, StateManager, GrpBase, camera

EterLib/StateManager.cpp and GrpBase.cpp ported verbatim. CGraphicDevice::Create builds a platform
IDirect3DDevice8 that keeps the device state and records every Draw* call as a Render3DDraw
(vertices decoded by FVF, strips/fans expanded, textures, world/view/proj, blend/depth/light state).
The 40250 camera (__UpdateCamera, SetCenterPosition, ...) and the Process order
(__UpdateCamera -> OnCameraUpdate -> OnUIUpdate -> Begin/SetInterfaceRenderState/OnUIRender/End)
are in place; CScreen Begin/End, CPythonGraphic render states and CCullingManager::Process matrix
updates are verbatim. port.login_flow asserts a textured, lit character draw under the RH
perspective with every vertex on screen; offline and live pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-23 20:15:54 +09:00
co-authored by Claude Opus 5.5
parent 668f48d6ec
commit 5bfa13c5cc
27 changed files with 3616 additions and 777 deletions
+1
View File
@@ -517,3 +517,4 @@
{"time": "2026-09-23T09:39:22Z", "event": "port_round", "unit": "PORT-PLAN 2V2-c: chrmgr/chr modules + race registration chain", "ported": ["UserInterface/PythonCharacterManagerModule.cpp", "UserInterface/PythonCharacterModule.cpp", "GameLib/RaceData.cpp", "GameLib/RaceDataFile.cpp", "GameLib/RaceManager.cpp", "GameLib/RaceMotionData.cpp", "GameLib/GameType.cpp", "EterLib/AttributeData.cpp", "EterLib/AttributeInstance.cpp", "EterLib/TextFileLoader.cpp", "EterLib/Util.cpp (lines 1-141, 297-end)", "EterLib/Camera.cpp", "UserInterface/CameraProcedure.cpp"], "adapted": ["EterLib/Util.cpp code page / font face stays with the platform font backend", "CRaceManager created in PythonBoot in CPythonApplication member order", "D3DXVec2CCW / D3DXMatrixfDeterminant / D3DXMatrixLookAtRH"], "divergent": [], "needs_live": ["intermittent (about 1 in 11 live runs) unhandled header 7 in the Loading phase, suspected packet-size desync; the test now prints g_iLastPacket and fails; 8 later runs clean"], "tests": ["port.login_flow: pass (chr/chrmgr not stubs, race 0 MODE_GENERAL/NAME_WAIT registered, no unhandled packet header)", "port.login_live: 8/8 pass against 192.168.21.203", "script/port_gate.sh macos: PASS"], "todo": ["2V2-d gr2 loader + CGraphicThing adapter, InstanceBase/ActorInstance stand-ins", "2V2-e render", "Loading-phase header 7 desync"]}
{"time": "2026-09-23T10:56:00Z", "event": "port_round", "unit": "PORT-PLAN 2V2-d.1: ActorInstance/InstanceBase closure, main character instance", "ported": ["GameLib/ActorInstance.cpp", "GameLib/ActorInstanceAttach.cpp", "GameLib/ActorInstanceBattle.cpp", "GameLib/ActorInstanceBlend.cpp", "GameLib/ActorInstanceCollisionDetection.cpp", "GameLib/ActorInstanceEvent.cpp", "GameLib/ActorInstanceFly.cpp", "GameLib/ActorInstanceMotion.cpp", "GameLib/ActorInstanceMotionEvent.cpp", "GameLib/ActorInstancePosition.cpp", "GameLib/ActorInstanceRender.cpp", "GameLib/ActorInstanceRotation.cpp", "GameLib/ActorInstanceSync.cpp", "GameLib/ActorInstanceWeaponTrace.cpp", "UserInterface/InstanceBase.cpp", "UserInterface/InstanceBaseBattle.cpp", "UserInterface/InstanceBaseEffect.cpp", "UserInterface/InstanceBaseEvent.cpp", "UserInterface/InstanceBaseMotion.cpp", "UserInterface/InstanceBaseTransform.cpp", "GameLib/GameUtil.cpp", "GameLib/FlyTarget.cpp", "GameLib/PhysicsObject.cpp", "GameLib/GameEventManager.cpp", "GameLib/WeaponTrace.cpp", "GameLib/MapUtil.cpp", "EterLib/lineintersect_utils.cpp"], "adapted": ["Packet.h TPlayerSkill::tNextRead LONG (32-bit time_t on the wire) + static_assert 1531", "MapUtil.cpp <float.h> include", "CGameEventManager / CPythonSystem created in PythonBoot in CPythonApplication member order", "D3D8Types.h full D3DTA/D3DTEXTUREOP/D3DCMPFUNC/D3DBLEND/D3DCULL"], "divergent": [], "needs_live": [], "tests": ["port.login_flow: pass (main instance exists, race 0, no AdditionalInfo error, SKILL_LEVEL in Loading)", "port.login_live: 8/8 pass against 192.168.21.203, no unhandled packet", "script/port_gate.sh macos: PASS"], "todo": ["2V2-d.2 gr2/mdatr resource factories + CGraphicThing/CGrannyModel/CGrannyMotion/CGraphicThingInstance on libgr2", "2V2-e render"]}
{"time": "2026-09-23T10:36:40Z", "event": "port_round", "unit": "PORT-PLAN 2V2-d.2: Granny runtime on libgr2 + EterGrnLib, main character model animates", "ported": ["EterGrnLib/LODController.cpp", "EterGrnLib/Material.cpp", "EterGrnLib/Mesh.cpp", "EterGrnLib/Model.cpp", "EterGrnLib/ModelInstance.cpp", "EterGrnLib/ModelInstanceCollisionDetection.cpp", "EterGrnLib/ModelInstanceModel.cpp", "EterGrnLib/ModelInstanceMotion.cpp", "EterGrnLib/ModelInstanceRender.cpp", "EterGrnLib/ModelInstanceUpdate.cpp", "EterGrnLib/Motion.cpp", "EterGrnLib/Thing.cpp", "EterGrnLib/ThingInstance.cpp", "EterGrnLib/Util.cpp", "EterLib/GrpObjectInstance.cpp", "EterLib/GrpCollisionObject.cpp", "EterLib/CollisionData.cpp"], "adapted": ["platform/EterGrnLib/GrannyRuntime.cpp: Granny SDK 2.11 API on libgr2 (file sections, type-definition vertex conversion incl. half floats, material texture by Usage, mesh/bone bindings, deformer, control clock/loop/ease, weighted SRT sampling, composite matrices)", "shim/sdk/granny.h declared from the SDK 2.11 header", "CPU vertex/index buffers (platform/EterLib/CpuBuffer.h)", "Resource.cpp gr2 factory", "CPythonApplication::UpdateGame/RenderGame/GetMousePosition through singletons (no app object); CPythonGraphic in GameSingletons; host cursor", "libgr2: skeleton/mesh/anim/fileinfo accessors", "D3D8Types texture-stage enums, D3DXVec4Transform"], "divergent": [], "needs_live": [], "tests": ["port.login_flow: pass (PART_MAIN model has meshes, material 0 diffuse image loaded, WAIT motion changes bone matrices between frames)", "port.login_live: pass against 192.168.21.203", "script/port_gate.sh macos: PASS"], "todo": ["2V2-e Godot render adapter: recognizable standing character offline + live", "mdatr factory with CAttributeData resource"]}
{"time": "2026-09-23T11:09:12Z", "event": "port_round", "unit": "PORT-PLAN 2V2-e.1: 3D draw-command channel (recording D3D8 device, StateManager, GrpBase, camera)", "ported": ["EterLib/StateManager.cpp", "EterLib/GrpBase.cpp"], "adapted": ["platform/EterLib/RecordingDevice.cpp: IDirect3DDevice8 that records every Draw* as Render3DDraw (RenderCommands3D.h)", "CGraphicDevice::Create on the recording device, CPU default IB/PDT VBs", "D3DXMath PerspectiveFovRH/OrthoRH/OrthoOffCenterRH + ID3DXMatrixStack", "PythonApplicationCamera.cpp: __UpdateCamera and camera API verbatim, members in a file-static struct", "Process: __UpdateCamera, OnCameraUpdate, Begin/SetInterfaceRenderState/OnUIRender/End", "CScreen Begin/End/Set*Operation, CPythonGraphic Set{Game,Interface}RenderState/PushState/PopState/GetOrthoDepth, CCullingManager::Process view/proj (no frustum culling yet)", "pending CPythonPlayer main-actor functions (no event handler), CMapManager::IsMapReady"], "divergent": [], "needs_live": [], "tests": ["port.login_flow: pass (textured lit triangle draw, RH perspective, all vertices on screen)", "port.login_live: pass against 192.168.21.203", "script/port_gate.sh macos: PASS"], "todo": ["2V2-e.2 Godot consumer of Render3DDraws + offline screenshot", "2V2-e.3 live smoke", "SphereLib frustum culling", "PythonPlayerEventHandler"]}