|
|
@ -278,8 +278,8 @@ static bool ImGui_ImplDX9_CreateFontsTexture()
|
|
|
|
#ifndef IMGUI_USE_BGRA_PACKED_COLOR
|
|
|
|
#ifndef IMGUI_USE_BGRA_PACKED_COLOR
|
|
|
|
if (io.Fonts->TexPixelsUseColors)
|
|
|
|
if (io.Fonts->TexPixelsUseColors)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ImU32* dst_start = (ImU32*)ImGui::MemAlloc(width * height * bytes_per_pixel);
|
|
|
|
ImU32* dst_start = (ImU32*)ImGui::MemAlloc((size_t)width * height * bytes_per_pixel);
|
|
|
|
for (ImU32* src = (ImU32*)pixels, *dst = dst_start, *dst_end = dst_start + width * height; dst < dst_end; src++, dst++)
|
|
|
|
for (ImU32* src = (ImU32*)pixels, *dst = dst_start, *dst_end = dst_start + (size_t)width * height; dst < dst_end; src++, dst++)
|
|
|
|
*dst = IMGUI_COL_TO_DX9_ARGB(*src);
|
|
|
|
*dst = IMGUI_COL_TO_DX9_ARGB(*src);
|
|
|
|
pixels = (unsigned char*)dst_start;
|
|
|
|
pixels = (unsigned char*)dst_start;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -293,7 +293,7 @@ static bool ImGui_ImplDX9_CreateFontsTexture()
|
|
|
|
if (g_FontTexture->LockRect(0, &tex_locked_rect, NULL, 0) != D3D_OK)
|
|
|
|
if (g_FontTexture->LockRect(0, &tex_locked_rect, NULL, 0) != D3D_OK)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
for (int y = 0; y < height; y++)
|
|
|
|
for (int y = 0; y < height; y++)
|
|
|
|
memcpy((unsigned char*)tex_locked_rect.pBits + tex_locked_rect.Pitch * y, pixels + (width * bytes_per_pixel) * y, (width * bytes_per_pixel));
|
|
|
|
memcpy((unsigned char*)tex_locked_rect.pBits + (size_t)tex_locked_rect.Pitch * y, pixels + (size_t)width * bytes_per_pixel * y, (size_t)width * bytes_per_pixel);
|
|
|
|
g_FontTexture->UnlockRect(0);
|
|
|
|
g_FontTexture->UnlockRect(0);
|
|
|
|
|
|
|
|
|
|
|
|
// Store our identifier
|
|
|
|
// Store our identifier
|
|
|
|