mirror of https://github.com/AxioDL/metaforce.git
Pixel factor switching fix
This commit is contained in:
parent
cb8d7145c2
commit
f4c0903eee
|
@ -59,6 +59,7 @@ class FontAtlas
|
||||||
friend class FontCache;
|
friend class FontCache;
|
||||||
FT_Face m_face;
|
FT_Face m_face;
|
||||||
boo::ITextureSA* m_tex = nullptr;
|
boo::ITextureSA* m_tex = nullptr;
|
||||||
|
boo::IGraphicsDataToken m_token;
|
||||||
uint32_t m_dpi;
|
uint32_t m_dpi;
|
||||||
FT_Fixed m_ftXscale;
|
FT_Fixed m_ftXscale;
|
||||||
FT_UShort m_ftXPpem;
|
FT_UShort m_ftXPpem;
|
||||||
|
|
|
@ -57,7 +57,6 @@ public:
|
||||||
SplitView::Resources m_splitRes;
|
SplitView::Resources m_splitRes;
|
||||||
Toolbar::Resources m_toolbarRes;
|
Toolbar::Resources m_toolbarRes;
|
||||||
Button::Resources m_buttonRes;
|
Button::Resources m_buttonRes;
|
||||||
boo::IGraphicsDataToken m_fontData;
|
|
||||||
boo::IGraphicsDataToken m_resData;
|
boo::IGraphicsDataToken m_resData;
|
||||||
|
|
||||||
Specter::FontTag m_mainFont;
|
Specter::FontTag m_mainFont;
|
||||||
|
|
|
@ -377,6 +377,7 @@ FontAtlas::FontAtlas(boo::IGraphicsDataFactory* gf, FT_Face face, uint32_t dpi,
|
||||||
m_tex =
|
m_tex =
|
||||||
gf->newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1,
|
gf->newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1,
|
||||||
boo::TextureFormat::RGBA8, texmap.get(), bufSz);
|
boo::TextureFormat::RGBA8, texmap.get(), bufSz);
|
||||||
|
m_token = gf->commit();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -457,6 +458,7 @@ FontAtlas::FontAtlas(boo::IGraphicsDataFactory* gf, FT_Face face, uint32_t dpi,
|
||||||
m_tex =
|
m_tex =
|
||||||
gf->newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1,
|
gf->newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1,
|
||||||
boo::TextureFormat::I8, texmap.get(), bufSz);
|
boo::TextureFormat::I8, texmap.get(), bufSz);
|
||||||
|
m_token = gf->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
buildKernTable(face);
|
buildKernTable(face);
|
||||||
|
@ -576,6 +578,7 @@ FontAtlas::FontAtlas(boo::IGraphicsDataFactory* gf, FT_Face face, uint32_t dpi,
|
||||||
m_tex =
|
m_tex =
|
||||||
gf->newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1,
|
gf->newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1,
|
||||||
boo::TextureFormat::RGBA8, texmap.get(), bufSz);
|
boo::TextureFormat::RGBA8, texmap.get(), bufSz);
|
||||||
|
m_token = gf->commit();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -656,6 +659,7 @@ FontAtlas::FontAtlas(boo::IGraphicsDataFactory* gf, FT_Face face, uint32_t dpi,
|
||||||
m_tex =
|
m_tex =
|
||||||
gf->newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1,
|
gf->newStaticArrayTexture(TEXMAP_DIM, finalHeight, fullTexmapLayers + 1,
|
||||||
boo::TextureFormat::I8, texmap.get(), bufSz);
|
boo::TextureFormat::I8, texmap.get(), bufSz);
|
||||||
|
m_token = gf->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
buildKernTable(face);
|
buildKernTable(face);
|
||||||
|
|
|
@ -17,7 +17,6 @@ void ViewResources::init(boo::IGraphicsDataFactory* factory, FontCache* fcache,
|
||||||
m_heading14 = fcache->prepMainFont(factory, LatinAndJapaneseCharFilter, false, 14.f, dpi);
|
m_heading14 = fcache->prepMainFont(factory, LatinAndJapaneseCharFilter, false, 14.f, dpi);
|
||||||
m_heading18 = fcache->prepMainFont(factory, LatinAndJapaneseCharFilter, false, 18.f, dpi);
|
m_heading18 = fcache->prepMainFont(factory, LatinAndJapaneseCharFilter, false, 18.f, dpi);
|
||||||
m_curveFont = fcache->prepCurvesFont(factory, AllCharFilter, false, 8.f, dpi);
|
m_curveFont = fcache->prepCurvesFont(factory, AllCharFilter, false, 8.f, dpi);
|
||||||
m_fontData = factory->commit();
|
|
||||||
switch (factory->platform())
|
switch (factory->platform())
|
||||||
{
|
{
|
||||||
case boo::IGraphicsDataFactory::Platform::OGL:
|
case boo::IGraphicsDataFactory::Platform::OGL:
|
||||||
|
@ -49,7 +48,6 @@ void ViewResources::resetPixelFactor(float pf)
|
||||||
m_heading14 = m_fcache->prepMainFont(m_factory, LatinAndJapaneseCharFilter, false, 14.f, dpi);
|
m_heading14 = m_fcache->prepMainFont(m_factory, LatinAndJapaneseCharFilter, false, 14.f, dpi);
|
||||||
m_heading18 = m_fcache->prepMainFont(m_factory, LatinAndJapaneseCharFilter, false, 18.f, dpi);
|
m_heading18 = m_fcache->prepMainFont(m_factory, LatinAndJapaneseCharFilter, false, 18.f, dpi);
|
||||||
m_curveFont = m_fcache->prepCurvesFont(m_factory, AllCharFilter, false, 8.f, dpi);
|
m_curveFont = m_fcache->prepCurvesFont(m_factory, AllCharFilter, false, 8.f, dpi);
|
||||||
m_fontData = m_factory->commit();
|
|
||||||
m_fcache->closeBuiltinFonts();
|
m_fcache->closeBuiltinFonts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue