Fixed a Windows bug
This commit is contained in:
parent
c9ea18d586
commit
ceb25e8e38
3 changed files with 25 additions and 20 deletions
|
|
@ -1 +1 @@
|
||||||
2059
|
2060
|
||||||
|
|
|
||||||
|
|
@ -122,26 +122,31 @@ namespace ogfx
|
||||||
// 7. Upload glyph bitmap into atlas
|
// 7. Upload glyph bitmap into atlas
|
||||||
SDL_Rect dstRect { m_penX, m_penY, gw, gh };
|
SDL_Rect dstRect { m_penX, m_penY, gw, gh };
|
||||||
|
|
||||||
void* lockedPixels = nullptr;
|
SDL_LockSurface(surf);
|
||||||
int lockedPitch = 0;
|
SDL_UpdateTexture(atlas, &dstRect, surf->pixels, surf->pitch);
|
||||||
if (SDL_LockTexture(atlas, &dstRect, &lockedPixels, &lockedPitch))
|
SDL_UnlockSurface(surf);
|
||||||
{
|
|
||||||
SDL_LockSurface(surf);
|
|
||||||
uint8_t* src = (uint8_t*)surf->pixels;
|
|
||||||
uint8_t* dst = (uint8_t*)lockedPixels;
|
|
||||||
for (int y = 0; y < gh; y++)
|
|
||||||
{
|
|
||||||
memcpy(dst, src, gw * 4); // 4 bytes per pixel (ARGB8888)
|
|
||||||
src += surf->pitch;
|
|
||||||
dst += lockedPitch;
|
|
||||||
}
|
|
||||||
SDL_UnlockSurface(surf);
|
|
||||||
SDL_UnlockTexture(atlas);
|
|
||||||
}
|
|
||||||
|
|
||||||
// SDL_UpdateTexture(atlas, &dstRect, surf->pixels, surf->pitch);
|
|
||||||
SDL_DestroySurface(surf);
|
SDL_DestroySurface(surf);
|
||||||
|
|
||||||
|
// void* lockedPixels = nullptr;
|
||||||
|
// int lockedPitch = 0;
|
||||||
|
// if (SDL_LockTexture(atlas, &dstRect, &lockedPixels, &lockedPitch))
|
||||||
|
// {
|
||||||
|
// SDL_LockSurface(surf);
|
||||||
|
// uint8_t* src = (uint8_t*)surf->pixels;
|
||||||
|
// uint8_t* dst = (uint8_t*)lockedPixels;
|
||||||
|
// for (int y = 0; y < gh; y++)
|
||||||
|
// {
|
||||||
|
// memcpy(dst, src, gw * 4); // 4 bytes per pixel (ARGB8888)
|
||||||
|
// src += surf->pitch;
|
||||||
|
// dst += lockedPitch;
|
||||||
|
// }
|
||||||
|
// SDL_UnlockSurface(surf);
|
||||||
|
// SDL_UnlockTexture(atlas);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // SDL_UpdateTexture(atlas, &dstRect, surf->pixels, surf->pitch);
|
||||||
|
// SDL_DestroySurface(surf);
|
||||||
|
|
||||||
// 8. Compute UVs
|
// 8. Compute UVs
|
||||||
float u0 = float(m_penX) / float(AtlasTextureDimension);
|
float u0 = float(m_penX) / float(AtlasTextureDimension);
|
||||||
float v0 = float(m_penY) / float(AtlasTextureDimension);
|
float v0 = float(m_penY) / float(AtlasTextureDimension);
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ namespace ostd
|
||||||
if (!parseThemeFileLine(line, variables))
|
if (!parseThemeFileLine(line, variables))
|
||||||
l_warn("Error");
|
l_warn("Error");
|
||||||
};
|
};
|
||||||
uint8_t lineNumberMaxWidth = ostd::String("").add(lines.size()).len();
|
uint8_t lineNumberMaxWidth = ostd::String("").add(static_cast<uint32_t>(lines.size())).len();
|
||||||
ostd::String groupSelector = "";
|
ostd::String groupSelector = "";
|
||||||
bool groupLines = true;
|
bool groupLines = true;
|
||||||
std::vector<ostd::String> group;
|
std::vector<ostd::String> group;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue