diff --git a/other/build.nr b/other/build.nr index a4ea6e7..1113ea2 100644 --- a/other/build.nr +++ b/other/build.nr @@ -1 +1 @@ -2059 +2060 diff --git a/src/ogfx/render/FontGlyphAtlas.cpp b/src/ogfx/render/FontGlyphAtlas.cpp index 5c5f076..d11446b 100644 --- a/src/ogfx/render/FontGlyphAtlas.cpp +++ b/src/ogfx/render/FontGlyphAtlas.cpp @@ -122,26 +122,31 @@ namespace ogfx // 7. Upload glyph bitmap into atlas SDL_Rect dstRect { m_penX, m_penY, gw, gh }; - 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_LockSurface(surf); + SDL_UpdateTexture(atlas, &dstRect, surf->pixels, surf->pitch); + SDL_UnlockSurface(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 float u0 = float(m_penX) / float(AtlasTextureDimension); float v0 = float(m_penY) / float(AtlasTextureDimension); diff --git a/src/ostd/io/Stylesheet.cpp b/src/ostd/io/Stylesheet.cpp index 8598413..c65c5d8 100644 --- a/src/ostd/io/Stylesheet.cpp +++ b/src/ostd/io/Stylesheet.cpp @@ -56,7 +56,7 @@ namespace ostd if (!parseThemeFileLine(line, variables)) l_warn("Error"); }; - uint8_t lineNumberMaxWidth = ostd::String("").add(lines.size()).len(); + uint8_t lineNumberMaxWidth = ostd::String("").add(static_cast(lines.size())).len(); ostd::String groupSelector = ""; bool groupLines = true; std::vector group;