Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ static PoolSizeRec PoolSizes[] =
{ "Render2DClass", 64, 32 },
{ "SurfaceClass", 128, 32 },
{ "FontCharsClassCharDataStruct", 1024, 32 },
{ "FontCharsBuffer", 16, 4 },
{ "FVFInfoClass", 128, 32 },
{ "TerrainTracksRenderObjClass", 128, 32 },
{ "DynamicIBAccessClass", 32, 32 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,6 @@ static PoolSizeRec PoolSizes[] =
{ "Render2DClass", 64, 32 },
{ "SurfaceClass", 128, 32 },
{ "FontCharsClassCharDataStruct", 1024, 32 },
{ "FontCharsBuffer", 16, 4 },
{ "FVFInfoClass", 152, 64 },
{ "TerrainTracksRenderObjClass", 128, 32 },
{ "DynamicIBAccessClass", 32, 32 },
Expand Down
10 changes: 10 additions & 0 deletions Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,12 @@ Bool W3DDisplay::setDisplayMode( UnsignedInt xres, UnsignedInt yres, UnsignedInt
{
Render2DClass::Set_Screen_Resolution(RectClass(0, 0, xres, yres));
Display::setDisplayMode(xres, yres, bitdepth, windowed);

// TheSuperHackers @tweak Font point sizes are scaled from the resolution, so every glyph
// cached for the old resolution is now dead weight. Discard the current glyphs and start
// with a clean slate.
WW3DAssetManager::Get_Instance()->Free_All_FontChars_Glyph_Caches();

return TRUE;
}

Expand Down Expand Up @@ -982,6 +988,10 @@ void W3DDisplay::reset()

Display::reset();

// TheSuperHackers @tweak Discard the current glyphs and start with a clean slate.
// This can reduce the memory overhead from glyphs that are no longer needed from here on.
WW3DAssetManager::Get_Instance()->Free_All_FontChars_Glyph_Caches();

// Remove all render objects.

if (m_3DScene != nullptr)
Expand Down
Loading
Loading