File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ DefaultResources
1818dist
1919Test Project /Game.csproj
2020Test Project /Sandbox.sln
21+ .idea
Original file line number Diff line number Diff line change @@ -86,14 +86,21 @@ public bool Initialize()
8686 unsafe
8787 {
8888 byte * data = null ;
89- int fontWidth = 0 ;
90- int fontHeight = 0 ;
89+ var fontWidth = 0 ;
90+ var fontHeight = 0 ;
9191
9292 io . Fonts . GetTexDataAsRGBA32 ( & data , ref fontWidth , ref fontHeight ) ;
9393
94- byte [ ] fontData = new byte [ fontWidth * fontHeight * 4 ] ;
94+ if ( data == null )
95+ {
96+ Log . Error ( "Failed to load font" ) ;
97+
98+ return false ;
99+ }
100+
101+ var fontData = new byte [ fontWidth * fontHeight * 4 ] ;
95102
96- for ( int i = 0 ; i < fontData . Length ; i ++ )
103+ for ( var i = 0 ; i < fontData . Length ; i ++ )
97104 {
98105 fontData [ i ] = data [ i ] ;
99106 }
@@ -315,7 +322,7 @@ private void Render(ImDrawDataPtr drawData)
315322 var clipPos = drawData . DisplayPos ;
316323 var clipScale = drawData . FramebufferScale ;
317324
318- for ( int i = 0 ; i < drawData . CmdListsCount ; i ++ )
325+ for ( var i = 0 ; i < drawData . CmdListsCount ; i ++ )
319326 {
320327 bgfx . TransientVertexBuffer tvb ;
321328 bgfx . TransientIndexBuffer tib ;
@@ -409,7 +416,7 @@ public static ImTextureID GetImGuiTexture(Texture texture)
409416 return ImTextureID . Null ;
410417 }
411418
412- return new ImTextureID ( texture . handle . idx ) ;
419+ return new ImTextureID ( ( ulong ) texture . handle . idx ) ;
413420 }
414421
415422 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
You can’t perform that action at this time.
0 commit comments