Skip to content

Commit 749dd1a

Browse files
committed
Workaround dumb BC5 hack
1 parent dc88eae commit 749dd1a

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

Alpha/Alpha.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>2.1.5.0</Version>
3+
<Version>2.1.5.1</Version>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net9.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>

Alpha/Services/GuiService.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,16 @@ public Texture GetTexture(TexFile file) {
8686
return tex;
8787
} else {
8888
var size = new Vector2(file.Header.Width, file.Header.Height);
89-
var handle = this.imgui.CreateTexture(file.ImageData, file.Header.Width, file.Header.Height);
89+
90+
byte[] data;
91+
try {
92+
data = file.ImageData;
93+
} catch {
94+
// BC5/BC7, probably
95+
data = new byte[file.Header.Width * file.Header.Height * 4];
96+
}
97+
98+
var handle = this.imgui.CreateTexture(data, file.Header.Width, file.Header.Height);
9099
return this.textures[file.FilePath] = new Texture {
91100
Handle = handle,
92101
Size = size

0 commit comments

Comments
 (0)