mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-26 22:57:52 -05:00
feat: load accuracy graphs using generic 2d graph loader
This commit is contained in:
@ -221,9 +221,9 @@ namespace IW4
|
||||
}
|
||||
};
|
||||
|
||||
GenericAccuracyGraph ConvertAccuracyGraph(const char* graphName, const vec2_t* originalKnots, const unsigned originalKnotCount)
|
||||
GenericGraph2D ConvertAccuracyGraph(const char* graphName, const vec2_t* originalKnots, const unsigned originalKnotCount)
|
||||
{
|
||||
GenericAccuracyGraph graph;
|
||||
GenericGraph2D graph;
|
||||
|
||||
graph.name = graphName;
|
||||
graph.knots.resize(originalKnotCount);
|
||||
|
@ -535,9 +535,9 @@ namespace IW5
|
||||
const WeaponFullDef* m_weapon;
|
||||
};
|
||||
|
||||
GenericAccuracyGraph ConvertAccuracyGraph(const char* graphName, const vec2_t* originalKnots, const unsigned originalKnotCount)
|
||||
GenericGraph2D ConvertAccuracyGraph(const char* graphName, const vec2_t* originalKnots, const unsigned originalKnotCount)
|
||||
{
|
||||
GenericAccuracyGraph graph;
|
||||
GenericGraph2D graph;
|
||||
|
||||
graph.name = graphName;
|
||||
graph.knots.resize(originalKnotCount);
|
||||
|
@ -265,9 +265,9 @@ namespace T6
|
||||
}
|
||||
};
|
||||
|
||||
GenericAccuracyGraph ConvertAccuracyGraph(const char* graphName, const vec2_t* originalKnots, const unsigned originalKnotCount)
|
||||
GenericGraph2D ConvertAccuracyGraph(const char* graphName, const vec2_t* originalKnots, const unsigned originalKnotCount)
|
||||
{
|
||||
GenericAccuracyGraph graph;
|
||||
GenericGraph2D graph;
|
||||
|
||||
graph.name = graphName;
|
||||
graph.knots.resize(originalKnotCount);
|
||||
|
@ -19,7 +19,7 @@ namespace
|
||||
return false;
|
||||
}
|
||||
|
||||
void DumpAccuracyGraph(const AssetDumpingContext& context, const GenericAccuracyGraph& graph, const std::string& subFolder)
|
||||
void DumpAccuracyGraph(const AssetDumpingContext& context, const GenericGraph2D& graph, const std::string& subFolder)
|
||||
{
|
||||
const auto file = context.OpenAssetFile(std::format("accuracy/{}/{}", subFolder, graph.name));
|
||||
if (!file)
|
||||
@ -46,12 +46,12 @@ bool AccuracyGraphWriter::ShouldDumpAiVsPlayerGraph(const std::string& graphName
|
||||
return ShouldDumpAccuracyGraph(m_dumped_ai_vs_player_graphs, graphName);
|
||||
}
|
||||
|
||||
void AccuracyGraphWriter::DumpAiVsAiGraph(const AssetDumpingContext& context, const GenericAccuracyGraph& aiVsAiGraph)
|
||||
void AccuracyGraphWriter::DumpAiVsAiGraph(const AssetDumpingContext& context, const GenericGraph2D& aiVsAiGraph)
|
||||
{
|
||||
DumpAccuracyGraph(context, aiVsAiGraph, "aivsai");
|
||||
}
|
||||
|
||||
void AccuracyGraphWriter::DumpAiVsPlayerGraph(const AssetDumpingContext& context, const GenericAccuracyGraph& aiVsPlayerGraph)
|
||||
void AccuracyGraphWriter::DumpAiVsPlayerGraph(const AssetDumpingContext& context, const GenericGraph2D& aiVsPlayerGraph)
|
||||
{
|
||||
DumpAccuracyGraph(context, aiVsPlayerGraph, "aivsplayer");
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "Dumping/AssetDumpingContext.h"
|
||||
#include "Dumping/IZoneAssetDumperState.h"
|
||||
#include "Weapon/GenericAccuracyGraph.h"
|
||||
#include "Parsing/GenericGraph2D.h"
|
||||
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
@ -12,8 +12,8 @@ public:
|
||||
bool ShouldDumpAiVsAiGraph(const std::string& graphName);
|
||||
bool ShouldDumpAiVsPlayerGraph(const std::string& graphName);
|
||||
|
||||
static void DumpAiVsAiGraph(const AssetDumpingContext& context, const GenericAccuracyGraph& aiVsAiGraph);
|
||||
static void DumpAiVsPlayerGraph(const AssetDumpingContext& context, const GenericAccuracyGraph& aiVsPlayerGraph);
|
||||
static void DumpAiVsAiGraph(const AssetDumpingContext& context, const GenericGraph2D& aiVsAiGraph);
|
||||
static void DumpAiVsPlayerGraph(const AssetDumpingContext& context, const GenericGraph2D& aiVsPlayerGraph);
|
||||
|
||||
private:
|
||||
std::unordered_set<std::string> m_dumped_ai_vs_ai_graphs;
|
||||
|
Reference in New Issue
Block a user