File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments