aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-06-03 21:45:59 +0200
committerEinar Johan Trøan Sømåen2012-06-03 21:53:11 +0200
commitdb2c12fb08277a55e8bd215e140931b963b08e95 (patch)
tree58c53fc8464f22b09be4089de8bf3109462cb393 /engines
parentb881ff7eef5b014fda3aaa3cbc9bd544134a944a (diff)
downloadscummvm-rg350-db2c12fb08277a55e8bd215e140931b963b08e95.tar.gz
scummvm-rg350-db2c12fb08277a55e8bd215e140931b963b08e95.tar.bz2
scummvm-rg350-db2c12fb08277a55e8bd215e140931b963b08e95.zip
WINTERMUTE: Make BFontTT draw almost the right color.
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/Base/BFontTT.cpp21
-rw-r--r--engines/wintermute/Base/BSurfaceSDL.cpp2
2 files changed, 14 insertions, 9 deletions
diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp
index a183254f52..2c062e6d91 100644
--- a/engines/wintermute/Base/BFontTT.cpp
+++ b/engines/wintermute/Base/BFontTT.cpp
@@ -249,11 +249,14 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex
TextLineList::iterator it;
- warning("CBFontTT::RenderTextToTexture - Not ported yet");
+ warning("CBFontTT::RenderTextToTexture - Not fully ported yet");
+ warning("%s %d %d %d %d", text.c_str(), D3DCOLGetR(_layers[0]->_color), D3DCOLGetG(_layers[0]->_color),D3DCOLGetB(_layers[0]->_color),D3DCOLGetA(_layers[0]->_color));
// void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const;
Graphics::Surface *surface = new Graphics::Surface();
- surface->create(width, _fontHeight, Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 5, 1, 0));
- _fallbackFont->drawString(surface, text, 0, 0, width, 255);
+ surface->create(width, _fontHeight, Graphics::PixelFormat(2, 5, 5, 5, 1, 10, 5, 0, 15));
+
+ uint16 useColor = 0xffff;
+ _fallbackFont->drawString(surface, text, 0, 0, width, useColor);
CBSurfaceSDL *retSurface = new CBSurfaceSDL(Game);
retSurface->PutSurface(*surface->convertTo(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8 ,0)));
delete surface;
@@ -615,7 +618,6 @@ void CBFontTT::AfterLoad() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBFontTT::InitFont() {
if (!_fontFile) return E_FAIL;
- warning("BFontTT::InitFont - Not ported yet");
Common::SeekableReadStream *file = Game->_fileManager->OpenFile(_fontFile);
if (!file) {
@@ -627,11 +629,14 @@ HRESULT CBFontTT::InitFont() {
//return E_FAIL;
}
}
- warning("I guess we got a file");
+
if (file) {
- //_font = Graphics::loadTTFFont(*file->getMemStream(), _fontHeight);
- } else {
- _fallbackFont = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
+#ifdef USE_FREETYPE2
+ _font = Graphics::loadTTFFont(*file, _fontHeight);
+#endif
+ }
+ if (!_font) {
+ _fallbackFont = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
warning("BFontTT::InitFont - Couldn't load %s", _fontFile);
}
return S_OK;
diff --git a/engines/wintermute/Base/BSurfaceSDL.cpp b/engines/wintermute/Base/BSurfaceSDL.cpp
index 8406985be8..ba211ac86d 100644
--- a/engines/wintermute/Base/BSurfaceSDL.cpp
+++ b/engines/wintermute/Base/BSurfaceSDL.cpp
@@ -494,7 +494,7 @@ HRESULT CBSurfaceSDL::DrawSprite(int X, int Y, RECT *Rect, float ZoomX, float Zo
position.left += offsetX;
position.top += offsetY;
- renderer->drawFromSurface(_surface, &srcRect, &position);
+ renderer->drawFromSurface(_surface, &srcRect, &position, r, g, b, a);
#if 0
SDL_RenderCopy(renderer->GetSdlRenderer(), _texture, &srcRect, &position);
#endif