mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-04 07:01:04 +01:00 
			
		
		
		
	Merge branch 'master' into navigation
This commit is contained in:
		
							
								
								
									
										11
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								imgui.cpp
									
									
									
									
									
								
							@@ -1925,6 +1925,8 @@ ImGuiWindow::~ImGuiWindow()
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    IM_DELETE(DrawList);
 | 
					    IM_DELETE(DrawList);
 | 
				
			||||||
    IM_DELETE(Name);
 | 
					    IM_DELETE(Name);
 | 
				
			||||||
 | 
					    for (int i = 0; i != ColumnsStorage.Size; i++)
 | 
				
			||||||
 | 
					        ColumnsStorage[i].~ImGuiColumnsSet();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end)
 | 
					ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end)
 | 
				
			||||||
@@ -3066,15 +3068,16 @@ void ImGui::NewFrame()
 | 
				
			|||||||
    if (!g.Initialized)
 | 
					    if (!g.Initialized)
 | 
				
			||||||
        Initialize();
 | 
					        Initialize();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    g.Time += g.IO.DeltaTime;
 | 
				
			||||||
 | 
					    g.FrameCount += 1;
 | 
				
			||||||
 | 
					    g.TooltipOverrideCount = 0;
 | 
				
			||||||
 | 
					    g.WindowsActiveCount = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SetCurrentFont(GetDefaultFont());
 | 
					    SetCurrentFont(GetDefaultFont());
 | 
				
			||||||
    IM_ASSERT(g.Font->IsLoaded());
 | 
					    IM_ASSERT(g.Font->IsLoaded());
 | 
				
			||||||
    g.DrawListSharedData.ClipRectFullscreen = ImVec4(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
 | 
					    g.DrawListSharedData.ClipRectFullscreen = ImVec4(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
 | 
				
			||||||
    g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol;
 | 
					    g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    g.Time += g.IO.DeltaTime;
 | 
					 | 
				
			||||||
    g.FrameCount += 1;
 | 
					 | 
				
			||||||
    g.TooltipOverrideCount = 0;
 | 
					 | 
				
			||||||
    g.WindowsActiveCount = 0;
 | 
					 | 
				
			||||||
    g.OverlayDrawList.Clear();
 | 
					    g.OverlayDrawList.Clear();
 | 
				
			||||||
    g.OverlayDrawList.PushTextureID(g.IO.Fonts->TexID);
 | 
					    g.OverlayDrawList.PushTextureID(g.IO.Fonts->TexID);
 | 
				
			||||||
    g.OverlayDrawList.PushClipRectFullScreen();
 | 
					    g.OverlayDrawList.PushClipRectFullScreen();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1445,11 +1445,14 @@ void    ImFontAtlas::GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_wid
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        unsigned char* pixels;
 | 
					        unsigned char* pixels;
 | 
				
			||||||
        GetTexDataAsAlpha8(&pixels, NULL, NULL);
 | 
					        GetTexDataAsAlpha8(&pixels, NULL, NULL);
 | 
				
			||||||
        TexPixelsRGBA32 = (unsigned int*)ImGui::MemAlloc((size_t)(TexWidth * TexHeight * 4));
 | 
					        if (pixels)
 | 
				
			||||||
        const unsigned char* src = pixels;
 | 
					        {
 | 
				
			||||||
        unsigned int* dst = TexPixelsRGBA32;
 | 
					            TexPixelsRGBA32 = (unsigned int*)ImGui::MemAlloc((size_t)(TexWidth * TexHeight * 4));
 | 
				
			||||||
        for (int n = TexWidth * TexHeight; n > 0; n--)
 | 
					            const unsigned char* src = pixels;
 | 
				
			||||||
            *dst++ = IM_COL32(255, 255, 255, (unsigned int)(*src++));
 | 
					            unsigned int* dst = TexPixelsRGBA32;
 | 
				
			||||||
 | 
					            for (int n = TexWidth * TexHeight; n > 0; n--)
 | 
				
			||||||
 | 
					                *dst++ = IM_COL32(255, 255, 255, (unsigned int)(*src++));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *out_pixels = (unsigned char*)TexPixelsRGBA32;
 | 
					    *out_pixels = (unsigned char*)TexPixelsRGBA32;
 | 
				
			||||||
@@ -1689,6 +1692,7 @@ bool    ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
 | 
				
			|||||||
        IM_ASSERT(font_offset >= 0);
 | 
					        IM_ASSERT(font_offset >= 0);
 | 
				
			||||||
        if (!stbtt_InitFont(&tmp.FontInfo, (unsigned char*)cfg.FontData, font_offset))
 | 
					        if (!stbtt_InitFont(&tmp.FontInfo, (unsigned char*)cfg.FontData, font_offset))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            atlas->TexWidth = atlas->TexHeight = 0; // Reset output on failure
 | 
				
			||||||
            ImGui::MemFree(tmp_array);
 | 
					            ImGui::MemFree(tmp_array);
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user