Fixes for the new font-related functions.

metadata
Edgar Velazquez-Armendariz 2013-01-21 17:55:51 -05:00
parent 9a5e3eb8d0
commit e5bf7ef172
2 changed files with 5 additions and 5 deletions

View File

@ -8,8 +8,8 @@ macro(add_film)
endmacro() endmacro()
add_film(mfilm mfilm.cpp) add_film(mfilm mfilm.cpp)
add_film(ldrfilm ldrfilm.cpp banner.h) add_film(ldrfilm ldrfilm.cpp banner.h MTS_HW)
add_film(hdrfilm hdrfilm.cpp banner.h) add_film(hdrfilm hdrfilm.cpp banner.h MTS_HW)
if (OPENEXR_FOUND) if (OPENEXR_FOUND)
include_directories(${ILMBASE_INCLUDE_DIRS} ${OPENEXR_INCLUDE_DIRS}) include_directories(${ILMBASE_INCLUDE_DIRS} ${OPENEXR_INCLUDE_DIRS})

View File

@ -99,8 +99,8 @@ void Font::drawText(Bitmap *dest, Point2i pos, const std::string &text) const {
); );
Point2i sourceOffset( Point2i sourceOffset(
glyph.tx.x * m_bitmap->getWidth(), (int) (glyph.tx.x * m_bitmap->getWidth()),
glyph.tx.y * m_bitmap->getHeight()); (int) (glyph.tx.y * m_bitmap->getHeight()));
dest->accumulate(m_bitmap.get(), sourceOffset, targetOffset, glyph.size); dest->accumulate(m_bitmap.get(), sourceOffset, targetOffset, glyph.size);
@ -120,7 +120,7 @@ Vector2i Font::getSize(const std::string &text) const {
if (character == '\r') if (character == '\r')
continue; continue;
if (character == '\n') { 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); size.x = std::max(size.x, pos);
pos = 0; pos = 0;
continue; continue;