Browse Source

Tuple to Pair to make VS2017 happy

pull/2/head
Odilitime 5 years ago
parent
commit
a48f30abd7
  1. 2
      src/graphics/components/InputComponent.cpp
  2. 4
      src/graphics/text/TextRasterizer.cpp
  3. 2
      src/graphics/text/TextRasterizer.h

2
src/graphics/components/InputComponent.cpp

@ -232,7 +232,7 @@ void InputComponent::updateText() { @@ -232,7 +232,7 @@ void InputComponent::updateText() {
request.sourceStartX = 0;
request.sourceStartY = 0;
request.noWrap = true;
std::unique_ptr<std::tuple<int, int>> textInfo=textRasterizer->size(request);
std::unique_ptr<std::pair<int, int>> textInfo=textRasterizer->size(request);
if (textInfo.get() == nullptr) {
std::cout << "InputComponent::updateText couldn't estimate value[" << value << "] size" << std::endl;
return;

4
src/graphics/text/TextRasterizer.cpp

@ -36,7 +36,7 @@ TextRasterizer::~TextRasterizer() { @@ -36,7 +36,7 @@ TextRasterizer::~TextRasterizer() {
FT_Done_FreeType(lib);
}
std::unique_ptr<std::tuple<int, int>> TextRasterizer::size(const rasterizationRequest &request) const {
std::unique_ptr<std::pair<int, int>> TextRasterizer::size(const rasterizationRequest &request) const {
if (request.startX == request.availableWidth) {
std::cout << "TextRasterizer::size - x [" << static_cast<int>(request.startX) << "] matches window width [" << static_cast<int>(request.availableWidth)<< "] for text[" << request.text << "] no room to render anything" << std::endl;
@ -151,7 +151,7 @@ std::unique_ptr<std::tuple<int, int>> TextRasterizer::size(const rasterizationRe @@ -151,7 +151,7 @@ std::unique_ptr<std::tuple<int, int>> TextRasterizer::size(const rasterizationRe
response->height = y1max;
//std::cout << "adjusted:" << (int)width << "x" << (int)height << std::endl;
}
return std::make_unique<std::tuple<int, int>>(std::tuple<int, int>(response->width, response->height));
return std::make_unique<std::pair<int, int>>(std::pair<int, int>(response->width, response->height));
}
std::unique_ptr<rasterizationResponse> TextRasterizer::rasterize(const rasterizationRequest &request) const {

2
src/graphics/text/TextRasterizer.h

@ -68,7 +68,7 @@ public: @@ -68,7 +68,7 @@ public:
TextRasterizer(const std::string &fontPath, const int size, const unsigned int resolution, const bool bold);
~TextRasterizer();
//std::unique_ptr<Glyph[]> rasterize(const std::string &text, const int x, const int windowWidth, const int wrapToX, float &width, float &height, unsigned int &glyphCount, int &endingX, int &endingY, bool &wrapped) const;
std::unique_ptr<std::tuple<int, int>> size(const rasterizationRequest &request) const;
std::unique_ptr<std::pair<int, int>> size(const rasterizationRequest &request) const;
std::unique_ptr<rasterizationResponse> rasterize(const rasterizationRequest &request) const;
bool isUnicodeBMP(const FT_Face &face) const;
FT_Library lib;

Loading…
Cancel
Save