From ae29b0d9615853f0a6fcc26899db9bd97ff0fa36 Mon Sep 17 00:00:00 2001 From: Alexander Sedov <alex0player@gmail.com> Date: Sat, 24 Jan 2015 17:16:52 +0300 Subject: [PATCH] Goodbye infinite GPU memory hog, you will not be missed. --- game/engines/default/engine/ui/Base.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/game/engines/default/engine/ui/Base.lua b/game/engines/default/engine/ui/Base.lua index d2e85dcb4d..16cd7bdf38 100644 --- a/game/engines/default/engine/ui/Base.lua +++ b/game/engines/default/engine/ui/Base.lua @@ -27,7 +27,6 @@ module(..., package.seeall, class.make) local gfx_prefix = "/data/gfx/" local cache = {} local tcache = {} -local fcache = {} -- Default font _M.font = core.display.newFont("/data/font/DroidSans.ttf", 12) @@ -94,7 +93,6 @@ end function _M:clearCache() cache = {} tcache = {} - fcache = {} end function _M:getImage(file, noerror) @@ -120,12 +118,9 @@ function _M:getUITexture(file) end function _M:drawFontLine(font, text, width) -- always draw with white, outputting texture can have it changed - local cached = table.getTable(fcache, font, font:getStyle()) - if cached[text] then return cached[text] end width = width or font:size(text) local tex = font:draw(text, width, 255, 255, 255, true)[1] local r = {t = tex._tex, w=tex.w, h=tex.h, tw=tex._tex_w, th=tex._tex_h} - cached[text] = r return r end -- GitLab