ConfettiFX / The-Forge

The Forge Cross-Platform Rendering Framework PC Windows, Steamdeck (native), Ray Tracing, macOS / iOS, Android, XBOX, PS4, PS5, Switch, Quest 2
Apache License 2.0
4.83k stars 505 forks source link

Missing #else implementation in fntGetFontAtlasSize() #304

Closed sliptrixx closed 2 months ago

sliptrixx commented 6 months ago

The function int2 fntGetFontAtlasSize() in FontSystem.cpp is missing the alternate implementation when ENABLE_FORGE_FONTS is not defined.

Current Version:

int2 fntGetFontAtlasSize()
{
#ifdef ENABLE_FORGE_FONTS
    ASSERT(gFontstash.mRenderInitialized && "Font Rendering not initialized! Make sure to call initFontRendering!");

    int2         size = {};
    FONScontext* fs = gFontstash.pContext;
    fonsGetAtlasSize(fs, &size.x, &size.y);
    return size;
#endif
}


Expected Version:

int2 fntGetFontAtlasSize()
{
#ifdef ENABLE_FORGE_FONTS
    ASSERT(gFontstash.mRenderInitialized && "Font Rendering not initialized! Make sure to call initFontRendering!");

    int2         size = {};
    FONScontext* fs = gFontstash.pContext;
    fonsGetAtlasSize(fs, &size.x, &size.y);
    return size;
#else
    return int2(0);
#endif
}
sliptrixx commented 2 months ago

Fixed as of Release 1.59. Thank you!