AVA2 client Windows parity passes (gr2 BitKnit2/64-bit, GamePhase handlers, python modules)

- gr2: BitKnit2 decompression, 64-bit LE files, compressed curves
- net: remaining GamePhase handlers, generated GC packet table
- python: event/chat/chr/minimap/guild/quest/messenger/shop-search and
  other native modules ported against the AVA2 Windows client
- render: D3D8 fixed-function lighting in Gr2ModelRenderer, terrain
  without baked shade; cape/NPC equipment attachment
- tests + audits updated; docs/PORT-PLAN.md and WINDOWS-PARITY.md

Batch 4 (render pipeline: background.*, app.RenderGame/UpdateGame,
camera bindings, main.cpp fake-content removal) is still in progress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-08 10:43:01 +09:00
co-authored by Claude Opus 5.5
parent 9f748eb05a
commit 9077aa389a
145 changed files with 22692 additions and 6584 deletions
+21
View File
@@ -4,6 +4,7 @@
#include <gr2/gr2.h>
#include <SDL3/SDL.h>
#include <string>
#include <unordered_map>
#include <vector>
#include <memory>
@@ -22,6 +23,16 @@ public:
void AttachModel(const std::string& bone_name, std::shared_ptr<Gr2ModelInstance> attachment, const float* offset_matrix = nullptr);
void AttachPart(std::shared_ptr<Gr2ModelInstance> part);
void DetachAll();
void DetachModel(const std::string& bone_name);
void DetachPart(const std::shared_ptr<Gr2ModelInstance>& part);
// CActorInstance::AttachSash: the attached instance plays its own motion 0 on the parent's clock.
void SetAttachmentAnimated(const std::string& bone_name, bool animated);
// ENABLE_OBJ_SCALLING: the attachment is scaled about the parent origin in Granny (Z-up) space.
void SetAttachmentScale(const std::string& bone_name, float sx, float sy, float sz);
// CGrannyModelInstance::SetMaterialImagePointer: textures whose StringPath matches src are drawn with dst.
void SetSkin(const std::string& src_file_name, const std::string& dst_file_name);
void ClearSkins() { m_skins.clear(); }
const std::string& GetFilePath() const { return m_filepath; }
// Build 3D draw commands for this model and all attached components (weapons, hair, armor parts)
std::vector<Render3DDraw> BuildDrawCommands(float animation_time = -1.0f, const float* world_matrix = nullptr);
@@ -41,7 +52,11 @@ private:
std::string bone_name;
std::shared_ptr<Gr2ModelInstance> model;
float offset[16];
bool animated = false;
bool scaled = false;
float scale[3] = {1.0f, 1.0f, 1.0f};
};
void ApplySkins(std::vector<Render3DDraw>& draws, size_t first) const;
std::unique_ptr<gr2::File> m_file;
std::string m_filepath;
@@ -50,6 +65,7 @@ private:
std::vector<AttachedModel> m_attached_models;
std::vector<std::shared_ptr<Gr2ModelInstance>> m_attached_parts;
std::unordered_map<std::string, std::string> m_skins;
};
// 3D Scene and Model Renderer (modeled after 40250 pipeline architecture)
@@ -61,6 +77,11 @@ public:
void SetCameraLookAt(float eyeX, float eyeY, float eyeZ,
float targetX, float targetY, float targetZ,
float upX, float upY, float upZ);
// D3DXMatrixLookAtRH as used by the original CCamera::SetViewMatrix, expressed for this
// renderer's LH projection: LookAtLH with the x axis negated (RH view x RH proj == this view x LH proj).
void SetCameraLookAtRH(float eyeX, float eyeY, float eyeZ,
float targetX, float targetY, float targetZ,
float upX, float upY, float upZ);
void SetPerspective(float fovYDegrees, float aspect, float zNear, float zFar);