From e5bf7ef1720a167a1087945162e22b19a2e5f977 Mon Sep 17 00:00:00 2001 From: Edgar Velazquez-Armendariz Date: Mon, 21 Jan 2013 17:55:51 -0500 Subject: [PATCH] Fixes for the new font-related functions. --- src/films/CMakeLists.txt | 4 ++-- src/libhw/font.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/films/CMakeLists.txt b/src/films/CMakeLists.txt index 20f268e5..c9633ce8 100644 --- a/src/films/CMakeLists.txt +++ b/src/films/CMakeLists.txt @@ -8,8 +8,8 @@ macro(add_film) endmacro() add_film(mfilm mfilm.cpp) -add_film(ldrfilm ldrfilm.cpp banner.h) -add_film(hdrfilm hdrfilm.cpp banner.h) +add_film(ldrfilm ldrfilm.cpp banner.h MTS_HW) +add_film(hdrfilm hdrfilm.cpp banner.h MTS_HW) if (OPENEXR_FOUND) include_directories(${ILMBASE_INCLUDE_DIRS} ${OPENEXR_INCLUDE_DIRS}) diff --git a/src/libhw/font.cpp b/src/libhw/font.cpp index 8f288c40..5349fd72 100644 --- a/src/libhw/font.cpp +++ b/src/libhw/font.cpp @@ -99,8 +99,8 @@ void Font::drawText(Bitmap *dest, Point2i pos, const std::string &text) const { ); Point2i sourceOffset( - glyph.tx.x * m_bitmap->getWidth(), - glyph.tx.y * m_bitmap->getHeight()); + (int) (glyph.tx.x * m_bitmap->getWidth()), + (int) (glyph.tx.y * m_bitmap->getHeight())); dest->accumulate(m_bitmap.get(), sourceOffset, targetOffset, glyph.size); @@ -120,7 +120,7 @@ Vector2i Font::getSize(const std::string &text) const { if (character == '\r') continue; if (character == '\n') { - size.y += getMaxVerticalBearing()*(4.0 / 3.0); + size.y += (int) (getMaxVerticalBearing()*(4.0 / 3.0)); size.x = std::max(size.x, pos); pos = 0; continue;