More resourcehandler fixes.

This commit is contained in:
Ottermandias 2023-01-19 17:56:26 +01:00
parent 123dd3aacc
commit 832b1163e0
2 changed files with 8 additions and 10 deletions

View file

@ -153,9 +153,8 @@ public unsafe partial class ResourceLoader
ref var manager = ref *ResourceManager;
var catIdx = ( uint )cat >> 0x18;
cat = ( ResourceCategory )( ushort )cat;
var category = ( ResourceGraph.CategoryContainer* )manager->ResourceGraph->ContainerArray + ( int )cat;
var extMap = FindInMap( ( StdMap< uint, Pointer< StdMap< uint, Pointer< ResourceHandle > > > >* )category->CategoryMaps[ catIdx ],
( uint )ext );
ref var category = ref manager->ResourceGraph->ContainerArraySpan[(int) cat];
var extMap = FindInMap( category.CategoryMapsSpan[ (int) catIdx ].Value, ( uint )ext );
if( extMap == null )
{
return null;

View file

@ -44,13 +44,6 @@ public partial class ConfigWindow
return;
}
unsafe
{
Dalamud.SigScanner.TryGetStaticAddressFromSig( Sigs.ResourceManager, out var x );
ImGui.TextUnformatted( $"Static Address: 0x{( ulong )ResourceLoader.ResourceManager:X} (+0x{(ulong) ResourceLoader.ResourceManager - (ulong) Dalamud.SigScanner.Module.BaseAddress:X})" );
ImGui.TextUnformatted( $"Actual Address: 0x{( ulong )*ResourceLoader.ResourceManager:X}" );
}
// Filter for resources containing the input string.
ImGui.SetNextItemWidth( -1 );
ImGui.InputTextWithHint( "##resourceFilter", "Filter...", ref _resourceManagerFilter, Utf8GamePath.MaxGamePathLength );
@ -65,6 +58,12 @@ public partial class ConfigWindow
{
ResourceLoader.IterateGraphs( DrawCategoryContainer );
}
ImGui.NewLine();
unsafe
{
ImGui.TextUnformatted( $"Static Address: 0x{( ulong )ResourceLoader.ResourceManager:X} (+0x{( ulong )ResourceLoader.ResourceManager - ( ulong )Dalamud.SigScanner.Module.BaseAddress:X})" );
ImGui.TextUnformatted( $"Actual Address: 0x{( ulong )*ResourceLoader.ResourceManager:X}" );
}
}
private unsafe void DrawResourceMap( ResourceCategory category, uint ext, StdMap< uint, Pointer< ResourceHandle > >* map )