-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from Xeeynamo/feature/hdasset-detection
HD Asset detection
- Loading branch information
Showing
5 changed files
with
141 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using OpenKh.Common.Archives; | ||
using OpenKh.Game.Infrastructure; | ||
using System.IO; | ||
|
||
namespace OpenKh.Game.DataContent | ||
{ | ||
public class HdAssetContent : IDataContent | ||
{ | ||
private readonly IDataContent _innerDataContext; | ||
|
||
public HdAssetContent(IDataContent innerDataContext) | ||
{ | ||
_innerDataContext = innerDataContext; | ||
} | ||
|
||
public bool FileExists(string fileName) => _innerDataContext.FileExists(fileName); | ||
|
||
public Stream FileOpen(string fileName) | ||
{ | ||
var stream = _innerDataContext.FileOpen(fileName); | ||
if (stream == null) | ||
return null; | ||
|
||
return HdAsset.Read(stream).Stream; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters