From 86f85373c55d2efb452aa3905711be00dd53e471 Mon Sep 17 00:00:00 2001 From: rachytski Date: Wed, 12 Jan 2011 22:30:27 +0200 Subject: [PATCH] iphone color order fix. --- 3party/agg/agg_pixfmt_rgb_packed.h | 27 ++++++++++++---------- iphone/Maps/Maps.xcodeproj/project.pbxproj | 4 ++++ iphone/Maps/Platform/IPhonePlatform.mm | 4 ++-- map/drawer_yg.cpp | 18 +++++++++++---- map/drawer_yg.hpp | 12 ++++++++-- map/render_queue_routine.cpp | 9 ++++---- qt/widgets.cpp | 2 ++ qt_tstfrm/tstwidgets.cpp | 4 ++-- yg/geometry_batcher.cpp | 24 +++++++++++-------- yg/geometry_batcher.hpp | 8 ++++--- yg/resource_manager.cpp | 4 ++-- yg/resource_manager.hpp | 5 +++- yg/skin.cpp | 8 ++++--- yg/skin.hpp | 4 +++- yg/skin_loader.cpp | 10 +++++--- yg/skin_loader.hpp | 6 ++++- yg/skin_page.cpp | 9 ++++---- yg/text_renderer.cpp | 11 +++++---- yg/text_renderer.hpp | 8 ++++--- yg/yg_tests/skin_loader_test.cpp | 2 +- yg/yg_tests/skin_test.cpp | 2 +- yg/yg_tests/yg_tests.pro | 2 +- 22 files changed, 118 insertions(+), 65 deletions(-) diff --git a/3party/agg/agg_pixfmt_rgb_packed.h b/3party/agg/agg_pixfmt_rgb_packed.h index 593a6048d2..658c994c5b 100644 --- a/3party/agg/agg_pixfmt_rgb_packed.h +++ b/3party/agg/agg_pixfmt_rgb_packed.h @@ -83,27 +83,30 @@ namespace agg unsigned) { pixel_type rgb = *p; - calc_type r = (rgb >> 7) & 0xF8; - calc_type g = (rgb >> 2) & 0xF8; - calc_type b = (rgb << 3) & 0xF8; + + calc_type b = (rgb >> 4) & 0xF0; + calc_type g = (rgb ) & 0xF0; + calc_type r = (rgb << 4) & 0xF0; + *p = (pixel_type) - (((((cr - r) * alpha + (r << 8)) >> 1) & 0x7C00) | - ((((cg - g) * alpha + (g << 8)) >> 6) & 0x03E0) | - (((cb - b) * alpha + (b << 8)) >> 11) | 0x8000); + (((((cb - b) * alpha + (b << 8)) >> 4) & 0x0F00) | + ((((cg - g) * alpha + (g << 8)) >> 8) & 0x00F0) | + (((cr - r) * alpha + (r << 8)) >> 12) | 0xF000); } static AGG_INLINE pixel_type make_pix(unsigned r, unsigned g, unsigned b) { - return (pixel_type)(((r & 0xF8) << 7) | - ((g & 0xF8) << 2) | - (b >> 3) | 0x8000); + return (pixel_type)(((b & 0xF0) << 4) | + ((g & 0xF0) ) | + (r >> 4) | + 0xF000); } static AGG_INLINE color_type make_color(pixel_type p) { - return color_type((p >> 7) & 0xF8, - (p >> 2) & 0xF8, - (p << 3) & 0xF8); + return color_type((p << 4) & 0xF0, + (p ) & 0xF0, + (p >> 4) & 0xF0); } }; diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 0fbd12deca..c4e71e27fe 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -36,6 +36,7 @@ EEE4C93E1298A2F3007231A9 /* symbols_24.png in Resources */ = {isa = PBXBuildFile; fileRef = EEE4C93D1298A2F3007231A9 /* symbols_24.png */; }; EEE4C9401298A303007231A9 /* symbols_48.png in Resources */ = {isa = PBXBuildFile; fileRef = EEE4C93F1298A303007231A9 /* symbols_48.png */; }; EEE4C9421298A31B007231A9 /* basic_highres.skn in Resources */ = {isa = PBXBuildFile; fileRef = EEE4C9411298A31B007231A9 /* basic_highres.skn */; }; + EEF5745512DE1AD50082F472 /* libfribidi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEF5745412DE1AD50082F472 /* libfribidi.a */; }; EEFC0A9612B561B7002914FF /* dejavusans.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFC0A9512B561B7002914FF /* dejavusans.ttf */; }; EEFC0BBF12B5656A002914FF /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE12020311CD464100ABDD5D /* libfreetype.a */; }; FA04373212CAB83F00017494 /* libstorage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA04373112CAB83F00017494 /* libstorage.a */; }; @@ -103,6 +104,7 @@ EEE4C93D1298A2F3007231A9 /* symbols_24.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = symbols_24.png; path = ../../data/symbols_24.png; sourceTree = SOURCE_ROOT; }; EEE4C93F1298A303007231A9 /* symbols_48.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = symbols_48.png; path = ../../data/symbols_48.png; sourceTree = SOURCE_ROOT; }; EEE4C9411298A31B007231A9 /* basic_highres.skn */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = basic_highres.skn; path = ../../data/basic_highres.skn; sourceTree = SOURCE_ROOT; }; + EEF5745412DE1AD50082F472 /* libfribidi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfribidi.a; path = libfribidi.a; sourceTree = SOURCE_ROOT; }; EEFC0A9512B561B7002914FF /* dejavusans.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = dejavusans.ttf; path = ../../data/dejavusans.ttf; sourceTree = ""; }; FA04373112CAB83F00017494 /* libstorage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libstorage.a; sourceTree = SOURCE_ROOT; }; FA065FEC128614C400FEA989 /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "Resources-iPad/MainWindow-iPad.xib"; sourceTree = SOURCE_ROOT; }; @@ -152,6 +154,7 @@ EE12021211CD464100ABDD5D /* libyg.a in Frameworks */, FA87151B12B1518F00592DAF /* SystemConfiguration.framework in Frameworks */, FA04373212CAB83F00017494 /* libstorage.a in Frameworks */, + EEF5745512DE1AD50082F472 /* libfribidi.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -275,6 +278,7 @@ FA1DE68411E15D4E00C6D69A /* Static Libraries */ = { isa = PBXGroup; children = ( + EEF5745412DE1AD50082F472 /* libfribidi.a */, FA04373112CAB83F00017494 /* libstorage.a */, EE1201FF11CD464100ABDD5D /* libbase.a */, EE12020011CD464100ABDD5D /* libcoding.a */, diff --git a/iphone/Maps/Platform/IPhonePlatform.mm b/iphone/Maps/Platform/IPhonePlatform.mm index ec2830f5d4..06db42e6c4 100644 --- a/iphone/Maps/Platform/IPhonePlatform.mm +++ b/iphone/Maps/Platform/IPhonePlatform.mm @@ -19,7 +19,7 @@ IPhonePlatform::IPhonePlatform() NSString * path = [bundle resourcePath]; m_resourcesPath = [path UTF8String]; m_resourcesPath += '/'; - + NSArray * dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString * docsDir = [dirPaths objectAtIndex:0]; m_writablePath = [docsDir UTF8String]; @@ -162,7 +162,7 @@ bool IPhonePlatform::IsMultiSampled() const { return m_isMultiSampled; } - + bool IPhonePlatform::DoPeriodicalUpdate() const { return m_doPeriodicalUpdate; diff --git a/map/drawer_yg.cpp b/map/drawer_yg.cpp index bb9f17c74c..ee444002eb 100644 --- a/map/drawer_yg.cpp +++ b/map/drawer_yg.cpp @@ -17,11 +17,19 @@ #include "../base/start_mem_debug.hpp" +DrawerYG::Params::Params() + : m_dynamicPagesCount(2), + m_textPagesCount(2) +{ +} -DrawerYG::DrawerYG(string const & skinName, screen_t::Params const & params) +DrawerYG::DrawerYG(string const & skinName, params_t const & params) { m_pScreen = shared_ptr(new yg::gl::Screen(params)); - m_pSkin = shared_ptr(loadSkin(params.m_resourceManager, skinName)); + m_pSkin = shared_ptr(loadSkin(params.m_resourceManager, + skinName, + params.m_dynamicPagesCount, + params.m_textPagesCount)); m_pScreen->setSkin(m_pSkin); if (m_pSkin) @@ -266,7 +274,7 @@ void DrawerYG::Draw(di::DrawInfo const * pInfo, rule_ptr_t pRule, int depth) } } -void DrawerYG::drawStats(double duration, int scale, double lat, double lng) +void DrawerYG::drawStats(double duration, int scale, double lat, double lng, bool log2vis) { ostringstream out; out << "SPF: " << duration; @@ -274,9 +282,9 @@ void DrawerYG::drawStats(double duration, int scale, double lat, double lng) out << " FPS: inf"; else out << " FPS: " << 1.0 / duration; - m_pScreen->drawText(m2::PointD(10, 20), 0, 10, out.str().c_str(), yg::maxDepth, true); + m_pScreen->drawText(m2::PointD(10, 20), 0, 10, out.str().c_str(), yg::maxDepth, true, log2vis); out.str(""); out << "(" << lat << ", " << lng << ") Scale: " << scale; - m_pScreen->drawText(m2::PointD(10, 40), 0, 10, out.str().c_str(), yg::maxDepth, true); + m_pScreen->drawText(m2::PointD(10, 40), 0, 10, out.str().c_str(), yg::maxDepth, true, log2vis); } diff --git a/map/drawer_yg.hpp b/map/drawer_yg.hpp index 6d220e6c82..47ff0ec6a4 100644 --- a/map/drawer_yg.hpp +++ b/map/drawer_yg.hpp @@ -74,7 +74,15 @@ protected: public: typedef yg::gl::Screen screen_t; - typedef screen_t::Params params_t; + + struct Params : screen_t::Params + { + size_t m_dynamicPagesCount; + size_t m_textPagesCount; + Params(); + }; + + typedef Params params_t; DrawerYG(string const & skinName, params_t const & params = params_t()); @@ -87,7 +95,7 @@ public: void onSize(int w, int h); - void drawStats(double duration, int scale, double lat, double lng); + void drawStats(double duration, int scale, double lat, double lng, bool log2vis = false); shared_ptr screen() const; diff --git a/map/render_queue_routine.cpp b/map/render_queue_routine.cpp index 788d1d542d..cff8c59658 100644 --- a/map/render_queue_routine.cpp +++ b/map/render_queue_routine.cpp @@ -105,13 +105,13 @@ void RenderQueueRoutine::getUpdateAreas(vector & areas) size_t w = m_renderState->m_textureWidth; size_t h = m_renderState->m_textureHeight; - if (m_renderState->m_doRepaintAll) +/* if (m_renderState->m_doRepaintAll) { m_renderState->m_doRepaintAll = false; areas.push_back(m2::RectI(0, 0, w, h)); return; - } -/* + }*/ + if (m_renderState->isPanning()) { /// adding two rendering sub-commands to render new areas, opened by panning. @@ -158,7 +158,7 @@ void RenderQueueRoutine::getUpdateAreas(vector & areas) areas.push_back(m2::RectI(0, minY, minX, maxY)); } } - else */ + else { areas.push_back(m2::RectI(0, 0, w, h)); @@ -293,6 +293,7 @@ void RenderQueueRoutine::Do() if ((areas[i].SizeX() != 0) && (areas[i].SizeY() != 0)) { frameScreen.PtoG(m2::Inflate(m2::RectD(areas[i]), 30 * m_visualScale, 30 * m_visualScale), glbRect); +// frameScreen.PtoG(m2::Inflate(m2::RectD(areas[i]), (double)200, (double)200), glbRect); if ((glbRect.SizeX() == 0) || (glbRect.SizeY() == 0)) continue; diff --git a/qt/widgets.cpp b/qt/widgets.cpp index d49e75ee93..375b161e17 100644 --- a/qt/widgets.cpp +++ b/qt/widgets.cpp @@ -55,6 +55,8 @@ namespace qt p.m_resourceManager = m_resourceManager; p.m_isMultiSampled = false; p.m_frameBuffer = make_shared_ptr(new yg::gl::FrameBuffer(true)); + p.m_dynamicPagesCount = 1; + p.m_textPagesCount = 0; m_p = shared_ptr(new DrawerYG(GetPlatform().SkinName(), p)); } diff --git a/qt_tstfrm/tstwidgets.cpp b/qt_tstfrm/tstwidgets.cpp index f0bbbccefb..a4d0a1ee83 100644 --- a/qt_tstfrm/tstwidgets.cpp +++ b/qt_tstfrm/tstwidgets.cpp @@ -57,7 +57,7 @@ void GLDrawWidget::initializeGL() m_frameBuffer = make_shared_ptr(new yg::gl::FrameBuffer()); - yg::gl::Screen::Params params; + DrawerYG::Params params; params.m_resourceManager = m_resourceManager; params.m_isMultiSampled = false; params.m_frameBuffer = m_frameBuffer; @@ -66,7 +66,7 @@ void GLDrawWidget::initializeGL() m_primaryFrameBuffer = make_shared_ptr(new yg::gl::FrameBuffer(true)); - m_skin = shared_ptr(loadSkin(m_resourceManager, GetPlatform().SkinName())); + m_skin = shared_ptr(loadSkin(m_resourceManager, GetPlatform().SkinName(), params.m_dynamicPagesCount, params.m_textPagesCount)); m_p->setSkin(m_skin); params.m_frameBuffer = m_primaryFrameBuffer; diff --git a/yg/geometry_batcher.cpp b/yg/geometry_batcher.cpp index 5267a43de8..5a4317f284 100644 --- a/yg/geometry_batcher.cpp +++ b/yg/geometry_batcher.cpp @@ -133,14 +133,13 @@ namespace yg base_t::endFrame(); } - wstring GeometryBatcher::GetDrawString(string const & utf8Str) + wstring GeometryBatcher::Log2Vis(wstring const & str) { - wstring const wstr = FromUtf8(utf8Str); - size_t const count = wstr.size(); + size_t const count = str.size(); wstring res; res.resize(count); FriBidiParType dir = FRIBIDI_PAR_LTR; // requested base direction - fribidi_log2vis(wstr.c_str(), count, &dir, &res[0], 0, 0, 0); + fribidi_log2vis(str.c_str(), count, &dir, &res[0], 0, 0, 0); return res; } @@ -609,19 +608,26 @@ namespace yg } } - void GeometryBatcher::drawText(m2::PointD const & pt, float angle, uint8_t fontSize, string const & utf8Text, double depth, bool isFixedFont) + void GeometryBatcher::drawText(m2::PointD const & pt, float angle, uint8_t fontSize, string const & utf8Text, double depth, bool isFixedFont, bool log2vis) { - wstring const text = GetDrawString(utf8Text); + wstring text = FromUtf8(utf8Text); + + if (log2vis) + text = Log2Vis(text); ForEachGlyph(fontSize, text, true, isFixedFont, bind(&GeometryBatcher::drawGlyph, this, cref(pt), _1, angle, 0, _2, depth)); ForEachGlyph(fontSize, text, false, isFixedFont, bind(&GeometryBatcher::drawGlyph, this, cref(pt), _1, angle, 0, _2, depth)); } - m2::RectD const GeometryBatcher::textRect(string const & utf8Text, uint8_t fontSize) + m2::RectD const GeometryBatcher::textRect(string const & utf8Text, uint8_t fontSize, bool log2vis) { m2::RectD rect; m2::PointD pt(0, 0); - wstring const text = GetDrawString(utf8Text); + + wstring text = FromUtf8(utf8Text); + if (log2vis) + text = Log2Vis(text); + for (size_t i = 0; i < text.size(); ++i) { GlyphMetrics const m = resourceManager()->getGlyphMetrics(GlyphKey(text[i], fontSize, false)); @@ -725,7 +731,7 @@ namespace yg { pts_array arrPath(path, s, fullLength, pathOffset); - wstring const text = GetDrawString(utf8Text); + wstring const text = Log2Vis(FromUtf8(utf8Text)); // calculate base line offset float blOffset = 2; diff --git a/yg/geometry_batcher.hpp b/yg/geometry_batcher.hpp index e0e9902468..c7f47d1de4 100644 --- a/yg/geometry_batcher.hpp +++ b/yg/geometry_batcher.hpp @@ -39,7 +39,7 @@ namespace yg private: - static wstring GetDrawString(string const & utf8Str); + static wstring Log2Vis(wstring const & str); typedef RenderStateUpdater base_t; @@ -133,10 +133,12 @@ namespace yg uint8_t fontSize, string const & utf8Text, double depth, - bool fixedFont = false); + bool fixedFont = false, + bool log2vis = false); m2::RectD const textRect(string const & utf8Text, - uint8_t fontSize); + uint8_t fontSize, + bool log2vis); /// Drawing text in the middle of the path. bool drawPathText(m2::PointD const * path, diff --git a/yg/resource_manager.cpp b/yg/resource_manager.cpp index ce013a8541..27e94c9396 100644 --- a/yg/resource_manager.cpp +++ b/yg/resource_manager.cpp @@ -54,11 +54,11 @@ namespace yg return m_staticTextures[fileName]; } - Skin * loadSkin(shared_ptr const & resourceManager, string const & fileName) + Skin * loadSkin(shared_ptr const & resourceManager, string const & fileName, size_t dynamicPagesCount, size_t textPagesCount) { if (fileName.empty()) return 0; - SkinLoader loader(resourceManager); + SkinLoader loader(resourceManager, dynamicPagesCount, textPagesCount); FileReader skinFile(GetPlatform().ReadPathForFile(fileName)); ReaderSource source(skinFile); bool parseResult = ParseXML(source, loader); diff --git a/yg/resource_manager.hpp b/yg/resource_manager.hpp index f17039224c..098c6cb7c7 100644 --- a/yg/resource_manager.hpp +++ b/yg/resource_manager.hpp @@ -70,6 +70,9 @@ namespace yg void addFont(char const * fileName); }; - Skin * loadSkin(shared_ptr const & resourceManager, string const & fileName); + Skin * loadSkin(shared_ptr const & resourceManager, + string const & fileName, + size_t dynamicPagesCount, + size_t textPagesCount); } diff --git a/yg/skin.cpp b/yg/skin.cpp index e0488e1312..b8e21bc487 100644 --- a/yg/skin.cpp +++ b/yg/skin.cpp @@ -20,10 +20,12 @@ namespace yg { Skin::Skin(shared_ptr const & resourceManager, - Skin::TSkinPages const & pages) + Skin::TSkinPages const & pages, + size_t dynamicPagesCount, + size_t textPagesCount) : m_pages(pages), - m_dynamicPagesCount(2), - m_textPagesCount(2), + m_dynamicPagesCount(dynamicPagesCount), + m_textPagesCount(dynamicPagesCount), m_staticPagesCount(pages.size()), m_resourceManager(resourceManager) { diff --git a/yg/skin.hpp b/yg/skin.hpp index 3c7e32e328..e042b5e68e 100644 --- a/yg/skin.hpp +++ b/yg/skin.hpp @@ -63,7 +63,9 @@ namespace yg void clearHandles(); Skin(shared_ptr const & resourceManager, - TSkinPages const & pages); + TSkinPages const & pages, + size_t dynamicPagesCount, + size_t textPagesCount); friend class SkinLoader; diff --git a/yg/skin_loader.cpp b/yg/skin_loader.cpp index 9f3a947652..09cb6e34ff 100644 --- a/yg/skin_loader.cpp +++ b/yg/skin_loader.cpp @@ -10,7 +10,9 @@ namespace yg { - SkinLoader::SkinLoader(shared_ptr const & resourceManager) + SkinLoader::SkinLoader(shared_ptr const & resourceManager, + size_t dynamicPagesCount, + size_t textPagesCount) : m_id(-1), m_texRect(0, 0, 0, 0), m_xOffset(0), @@ -18,7 +20,9 @@ namespace yg m_xAdvance(0), m_fileName(""), m_resourceManager(resourceManager), - m_skin(0) + m_skin(0), + m_dynamicPagesCount(dynamicPagesCount), + m_textPagesCount(textPagesCount) { m_mode.push_back(ERoot); } @@ -103,7 +107,7 @@ namespace yg void SkinLoader::popSkin() { - m_skin = new Skin(m_resourceManager, m_pages); + m_skin = new Skin(m_resourceManager, m_pages, m_dynamicPagesCount, m_textPagesCount); } #define PUSH_MODE(mode, name) \ diff --git a/yg/skin_loader.hpp b/yg/skin_loader.hpp index 77ada673a4..55623d7c4b 100644 --- a/yg/skin_loader.hpp +++ b/yg/skin_loader.hpp @@ -104,12 +104,16 @@ namespace yg TStylesList m_stylesList; shared_ptr m_resourceManager; + size_t m_dynamicPagesCount; + size_t m_textPagesCount; Skin * m_skin; public: - SkinLoader(shared_ptr const & resourceManager); + SkinLoader(shared_ptr const & resourceManager, + size_t dynamicPagesCount, + size_t textPagesCount); bool Push(string const & element); void Pop(string const & element); diff --git a/yg/skin_page.cpp b/yg/skin_page.cpp index a77149ffa5..ba732713b5 100644 --- a/yg/skin_page.cpp +++ b/yg/skin_page.cpp @@ -370,10 +370,12 @@ namespace yg agg_pixfmt_t pixfmt(buf); agg::renderer_base rbase(pixfmt); - rbase.clear(agg::rgba8(penInfo.m_color.r, +/* rbase.clear(agg::rgba8(penInfo.m_color.r, penInfo.m_color.g, penInfo.m_color.b, - 0)); + 0));*/ + + gil::fill_pixels(v, penColorTranslucent); agg::scanline_u8 s; agg::rasterizer_scanline_aa<> rasterizer; @@ -400,7 +402,7 @@ namespace yg if (alpha != 0) { v(x, y) = penColor; - gil::get_color(v(x, y), gil::alpha_t()) = alpha; +// gil::get_color(v(x, y), gil::alpha_t()) = alpha; } } } @@ -469,7 +471,6 @@ namespace yg dynTexture->upload(&v(0, 0), rect); - lodepng_write_view("test.png", v); } m_penUploadCommands.clear(); } diff --git a/yg/text_renderer.cpp b/yg/text_renderer.cpp index 2274f1a3f7..40d5832826 100644 --- a/yg/text_renderer.cpp +++ b/yg/text_renderer.cpp @@ -28,12 +28,12 @@ namespace yg void TextRenderer::TextObj::Draw(GeometryBatcher * pBatcher) const { - pBatcher->drawText(m_pt, 0.0, m_size, m_utf8Text, yg::maxDepth, m_isFixedFont); + pBatcher->drawText(m_pt, 0.0, m_size, m_utf8Text, yg::maxDepth, m_isFixedFont, m_log2vis); } m2::RectD const TextRenderer::TextObj::GetLimitRect(GeometryBatcher * pBatcher) const { - return m2::Offset(pBatcher->textRect(m_utf8Text, m_size), m_pt); + return m2::Offset(pBatcher->textRect(m_utf8Text, m_size, m_log2vis), m_pt); } void TextRenderer::drawText(m2::PointD const & pt, @@ -41,13 +41,14 @@ namespace yg uint8_t fontSize, string const & utf8Text, double depth, - bool isFixedFont) + bool isFixedFont, + bool log2vis) { if (isFixedFont) - base_t::drawText(pt, angle, fontSize, utf8Text, depth, isFixedFont); + base_t::drawText(pt, angle, fontSize, utf8Text, depth, isFixedFont, log2vis); else { - TextObj obj(pt, utf8Text, fontSize, depth, isFixedFont); + TextObj obj(pt, utf8Text, fontSize, depth, isFixedFont, log2vis); m2::RectD r = obj.GetLimitRect(this); /* m2::PointD pts[5] = diff --git a/yg/text_renderer.hpp b/yg/text_renderer.hpp index edadd32e71..33c6227e46 100644 --- a/yg/text_renderer.hpp +++ b/yg/text_renderer.hpp @@ -22,10 +22,11 @@ namespace yg string m_utf8Text; double m_depth; bool m_isFixedFont; + bool m_log2vis; public: - TextObj(m2::PointD const & pt, string const & txt, uint8_t sz, double d, bool isFixedFont) - : m_pt(pt), m_size(sz), m_utf8Text(txt), m_depth(d), m_isFixedFont(isFixedFont) + TextObj(m2::PointD const & pt, string const & txt, uint8_t sz, double d, bool isFixedFont, bool log2vis) + : m_pt(pt), m_size(sz), m_utf8Text(txt), m_depth(d), m_isFixedFont(isFixedFont), m_log2vis(log2vis) { } @@ -61,7 +62,8 @@ namespace yg uint8_t fontSize, string const & utf8Text, double depth, - bool isFixedFont = false); + bool isFixedFont = false, + bool log2vis = false); void endFrame(); }; diff --git a/yg/yg_tests/skin_loader_test.cpp b/yg/yg_tests/skin_loader_test.cpp index 35d2fb6f03..166750750f 100644 --- a/yg/yg_tests/skin_loader_test.cpp +++ b/yg/yg_tests/skin_loader_test.cpp @@ -9,5 +9,5 @@ UNIT_TEST(SkinLoaderTest_Main) { GL_TEST_START; shared_ptr rm(new yg::ResourceManager(1000, 1000, 2, 1000, 1000, 2, 1000, 1000, 2, 128, 128, 15, 2000000)); - /*yg::Skin * skin = */loadSkin(rm, "basic.skn"); + /*yg::Skin * skin = */loadSkin(rm, "basic.skn", 2, 2); }; diff --git a/yg/yg_tests/skin_test.cpp b/yg/yg_tests/skin_test.cpp index 2eb679d14e..f00b642c26 100644 --- a/yg/yg_tests/skin_test.cpp +++ b/yg/yg_tests/skin_test.cpp @@ -10,7 +10,7 @@ UNIT_TEST(SkinTest_Main) GL_TEST_START; shared_ptr rm(new yg::ResourceManager(100, 100, 1, 100, 100, 1, 100, 100, 1, 128, 128, 15, 2000000)); - yg::Skin * skin = loadSkin(rm, "test.skn"); + yg::Skin * skin = loadSkin(rm, "test.skn", 2, 2); double p0 [] = {1, 1}; yg::PenInfo penInfo0(yg::Color(0xFF, 0, 0, 0xFF), 1, p0, 2, 0); diff --git a/yg/yg_tests/yg_tests.pro b/yg/yg_tests/yg_tests.pro index 87a533a6b7..dfbe119bde 100644 --- a/yg/yg_tests/yg_tests.pro +++ b/yg/yg_tests/yg_tests.pro @@ -4,7 +4,7 @@ CONFIG -= app_bundle TEMPLATE = app ROOT_DIR = ../.. -DEPENDENCIES = qt_tstfrm map yg geometry platform coding base sgitess freetype fribidi expat +DEPENDENCIES = qt_tstfrm map yg indexer geometry platform coding base sgitess freetype fribidi expat include($$ROOT_DIR/common.pri)