Forráskód Böngészése

Reorganization: updated the documentation and the data plugin for the new layout

Iñigo Valentin 1 napja
szülő
commit
3221d4191f

+ 2 - 2
.github/agents/ff7-format-researcher.agent.md

@@ -1,5 +1,5 @@
 ---
-description: "Use when researching how an FF7 binary file format works, how an existing parser/serializer in src/data implements it, or what the installer decompiler emits. Read-only investigation that returns findings with file references."
+description: "Use when researching how an FF7 binary file format works, how an existing parser/serializer in src/formats implements it, or what the installer decompiler emits. Read-only investigation that returns findings with file references."
 tools: [read, search]
 ---
 
@@ -15,7 +15,7 @@ You are a specialist at investigating FF7 binary formats in the V-Gears codebase
 ## Approach
 
 1. Check the format documentation in [the FF7 wiki at wiki.ffrtt.ru](https://wiki.ffrtt.ru/index.php/FF7) and in the header comments of existing parsers first.
-2. Find the relevant parser triplet in `src/data/` (`*File`, `*FileSerializer`, `*FileManager`) and read the serializer for the authoritative byte layout.
+2. Find the relevant parser triplet in `src/formats/` (`*File`, `*FileSerializer`, `*FileManager`) and read the serializer for the authoritative byte layout.
 3. For installer/decompiler questions, read `src/installer/` and the matching instruction classes under `src/installer/decompiler/`.
 4. Cross-check with the test suite in `test/` — tests often show minimal usage examples.
 5. `_OLD/` contains legacy q-gears code useful as historical reference only; flag it as such if you use it.

+ 6 - 5
.github/copilot-instructions.md

@@ -10,11 +10,12 @@ V-Gears is a free, cross-platform reimplementation of the Final Fantasy VII engi
 
 ## Architecture
 
-- `src/common/` — application base class and file utilities shared by all targets.
-- `src/core/` — engine runtime: audio, console, entities, walkmesh, UI, particles, savemap, `ScriptManager` (Lua bindings via sol2 and system LuaJIT).
-- `src/data/` — FF7 binary format parsers (LGP, LZS, HRC, TEX, field files, worldmap TXZ...). Most formats follow a triplet: `*File` (data), `*FileSerializer` (read/write), `*FileManager` (Ogre resource loading).
-- `src/installer/` — Qt data installer (`v-gears-installer`); includes the script `decompiler/` that converts field/world scripts into Lua and the SfxDump audio converter.
-- `src/map/`, `src/modules/`, `src/viewer/` — field map code, game modules (e.g. worldmap), and the model viewer.
+- `src/app/` — the game entry point, the application class and the game state.
+- `src/common/` — files, logger, strings, types and other utilities shared by all targets.
+- `src/formats/` — FF7 binary format parsers, by kind: `lgp/`, `field/`, `model/`, `texture/` and `worldmap/`. Most formats follow a triplet: `*File` (data), `*FileSerializer` (read/write), `*FileManager` (Ogre resource loading).
+- `src/engine/` — engine runtime, by subsystem: `audio/`, `config/`, `entity/`, `graphics/`, `input/`, `particles/`, `save/`, `script/` (`ScriptManager`, Lua bindings via sol2 and system LuaJIT), `ui/` and `xml/` (XML loaders).
+- `src/modules/` — game modules: `battle/` and `worldmap/`.
+- `src/installer/` — Qt data installer (`v-gears-installer`): `gui/`, `cli/`, `steps/` (the installation process), `extractors/` (game data conversion), `formats/`, `support/`, `tables/` (data tables) and `decompiler/` (converts field and world scripts into Lua).
 - `src/third_party/sol/` — vendored sol2 single header. Do not restyle, modernize, or refactor it.
 - LuaJIT is a system dependency.
 - `test/` — Boost.Test suite mirroring `src/` paths; sources are listed manually in `test/CMakeLists.txt`.

+ 5 - 5
.github/instructions/ff7-data-formats.instructions.md

@@ -1,23 +1,23 @@
 ---
 description: "Use when working on FF7 binary format parsers, serializers, resource managers, LGP/LZS archives, the data installer, or the script decompiler. Covers the File/Serializer/Manager triplet pattern and known installer gotchas."
-applyTo: ["src/data/**", "src/installer/**", "test/data/**", "test/installer/**"]
+applyTo: ["src/formats/**", "src/installer/**", "test/formats/**", "test/installer/**"]
 ---
 
 # FF7 Data Formats and Installer
 
 ## Parser Triplet Pattern
 
-Most formats in `src/data/` follow this structure — mirror it when adding formats:
+Most formats in `src/formats/` follow this structure — mirror it when adding formats:
 
 - `XFile` — plain data container for the parsed format.
-- `XFileSerializer` — reads/writes the binary layout (derives from `VGearsSerializer`).
+- `XFileSerializer` — reads/writes the binary layout (derives from `Serializer` (`src/formats/Serializer.h`)).
 - `XFileManager` — Ogre `ResourceManager` integration (singleton + `Resource`).
 
-Format documentation lives in [the FF7 wiki at wiki.ffrtt.ru](https://wiki.ffrtt.ru/index.php/FF7) and in the header comments of the parsers. Check there and at existing similar parsers (e.g. `src/data/worldmap/TxzFile*`) before writing a new one.
+Format documentation lives in [the FF7 wiki at wiki.ffrtt.ru](https://wiki.ffrtt.ru/index.php/FF7) and in the header comments of the parsers. Check there and at existing similar parsers (e.g. `src/formats/worldmap/TxzFile*`) before writing a new one.
 
 ## Installer Gotchas (verified, don't regress)
 
-- World map HRC loads must create meshes via `HRCFile::GetMeshFileName()` (i.e. `NameLookup::model(splitBase(hrc_name)) + ".mesh"`). Do NOT use `FF7Data::GetWorldMapModelName()` — that friendly-name table can diverge from the actual Ogre mesh resource name and triggers `FileNotFoundException` (e.g. `barrier.mesh`).
+- World map HRC loads must create meshes via `HRCFile::GetMeshFileName()` (i.e. `NameLookup::model(splitBase(hrc_name)) + ".mesh"`). Do NOT use a friendly-name table for the mesh names: it can diverge from the actual Ogre mesh resource name and triggers `FileNotFoundException` (e.g. `barrier.mesh`).
 - `WorldInstaller::ExportMesh()` expects a directory prefix, not a full filename prefix.
 - The decompiler (`src/installer/decompiler/`) emits Lua — keep output close to [doc/STYLE-LUA.md](../../../doc/STYLE-LUA.md), but it is exempt from strict conformance.
 - The installer is Qt-based and handles copyrighted game data at runtime on the user's machine: never write code that copies extracted assets into the repo or build tree.

+ 1 - 1
.github/instructions/tests.instructions.md

@@ -6,7 +6,7 @@ applyTo: "test/**"
 # V-Gears Testing Conventions
 
 - Tests use Boost.Test with dynamic linking (`BOOST_TEST_DYN_LINK`); the suite builds as the `v-gears-tests` target and is registered with CTest.
-- Test files mirror the path of the code under test (`test/data/VGearsLGPArchive.cpp` tests `src/formats/lgp/LGPArchive.cpp`). Follow this existing convention for placement.
+- Test files mirror the path of the code under test (`test/formats/model/AFile.cpp` tests `src/formats/model/AFile.cpp`). Follow this existing convention for placement.
 - Every new test source file must be added manually to `SOURCE_FILES` in [test/CMakeLists.txt](../../test/CMakeLists.txt) — there is no globbing.
 - RTTI (`dynamic_cast`, `typeid`) is allowed in tests even though production code avoids it.
 - Never use original game data in tests. Construct binary fixtures in-code (byte buffers, temp files) instead.

+ 2 - 2
.github/prompts/new-data-format.prompt.md

@@ -1,14 +1,14 @@
 ---
 description: "Scaffold a new FF7 data format parser (File/Serializer/Manager triplet) following project conventions"
 agent: "agent"
-argument-hint: "Format name and target directory, e.g. 'XYZ in src/data/worldmap'"
+argument-hint: "Format name and target directory, e.g. 'XYZ in src/formats/worldmap'"
 ---
 
 Scaffold a new FF7 binary format parser for the format named by the user:
 
 1. Research first:
    - Check [the FF7 wiki at wiki.ffrtt.ru](https://wiki.ffrtt.ru/index.php/FF7) for documentation of the format.
-   - Read the most similar existing triplet in `src/data/` (e.g. `TxzFile.h/.cpp`, `TxzFileSerializer.h/.cpp`, `TxzFileManager.h/.cpp` in `src/data/worldmap/`) and mirror its structure, base classes, and Doxygen comment style exactly.
+   - Read the most similar existing triplet in `src/formats/` (e.g. `TxzFile.h/.cpp`, `TxzFileSerializer.h/.cpp` in `src/formats/worldmap/`) and mirror its structure, base classes, and Doxygen comment style exactly.
 2. Create the triplet in the requested directory:
    - `XFile` — passive data container for the parsed format.
    - `XFileSerializer` — binary read/write, deriving from the same serializer base as its neighbors.

+ 5 - 5
PlugIns/Data/CMakeLists.txt

@@ -2,15 +2,15 @@ set(V-Gears_SOURCE_DIR ../../src)
 
 # Define header and source files for the library.
 set(HEADER_FILES
-    ${V-Gears_SOURCE_DIR}/VGearsPrerequisites.h
-    ${V-Gears_SOURCE_DIR}/common/VGearsManualObject.h
-    ${V-Gears_SOURCE_DIR}/common/VGearsStringUtil.h
+    ${V-Gears_SOURCE_DIR}/common/Prerequisites.h
+    ${V-Gears_SOURCE_DIR}/common/ManualObject.h
+    ${V-Gears_SOURCE_DIR}/common/StringUtil.h
     ${V-Gears_SOURCE_DIR}/common/TypeDefine.h
     include/VGearsDataPlugin.h
 )
 set(SOURCE_FILES
-    ${V-Gears_SOURCE_DIR}/common/VGearsManualObject.cpp
-    ${V-Gears_SOURCE_DIR}/common/VGearsStringUtil.cpp
+    ${V-Gears_SOURCE_DIR}/common/ManualObject.cpp
+    ${V-Gears_SOURCE_DIR}/common/StringUtil.cpp
     ${V-Gears_SOURCE_DIR}/common/TypeDefine.cpp
     src/VGearsDataPlugin.cpp
     src/VGearsDataPluginDll.cpp

+ 1 - 1
src/formats/field/Background2DFile.h

@@ -25,7 +25,7 @@ namespace VGears{
     /**
      * Handles 2D background files
      *
-     * @todo What's the difference with VGearsBackgroundFile.h?
+     * @todo What's the difference with BackgroundFile.h?
      */
     class Background2DFile : public Resource{
         public:

+ 1 - 1
src/installer/formats/DaFile.h

@@ -46,7 +46,7 @@ class DaFile{
          * Generates .a files from the da file.
          *
          * A file will be generated for each animation in the da file. See
-         * {@see VGearsAFile.h} for  more info about .a files. Files will be
+         * {@see AFile.h} for  more info about .a files. Files will be
          * created in the specified path, and will be named like the model id,
          * followed by an underscore, followed a two-digit animation index
          * (starting from 0) followed by the ".a extension". For example, if