[Scummvm-cvs-logs] SF.net SVN: scummvm:[33257] scummvm/branches/gsoc2008-gui
Tanoku at users.sourceforge.net
Tanoku at users.sourceforge.net
Thu Jul 24 00:32:00 CEST 2008
Revision: 33257
http://scummvm.svn.sourceforge.net/scummvm/?rev=33257&view=rev
Author: Tanoku
Date: 2008-07-23 22:32:00 +0000 (Wed, 23 Jul 2008)
Log Message:
-----------
Improved text handling.
Fixed About dialog scroll-out text.
Modified Paths:
--------------
scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp
scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h
scummvm/branches/gsoc2008-gui/gui/about.cpp
Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp 2008-07-23 21:48:28 UTC (rev 33256)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp 2008-07-23 22:32:00 UTC (rev 33257)
@@ -275,7 +275,7 @@
template <typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
drawString(const Graphics::Font *font, const Common::String &text, const Common::Rect &area,
- GUI::Theme::TextAlign alignH, GUI::Theme::TextAlignVertical alignV) {
+ GUI::Theme::TextAlign alignH, GUI::Theme::TextAlignVertical alignV, int deltax) {
int offset = 0;
@@ -291,7 +291,7 @@
break;
}
- font->drawString(_activeSurface, text, area.left, offset, area.width(), _fgColor, (Graphics::TextAlignment)alignH, 0, false);
+ font->drawString(_activeSurface, text, area.left, offset, area.width(), _fgColor, (Graphics::TextAlignment)alignH, deltax, false);
}
/** LINES **/
Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h 2008-07-23 21:48:28 UTC (rev 33256)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h 2008-07-23 22:32:00 UTC (rev 33257)
@@ -407,7 +407,7 @@
*/
virtual void blitSurface(Graphics::Surface *source, const Common::Rect &r) = 0;
- virtual void drawString(const Graphics::Font *font, const Common::String &text, const Common::Rect &area, GUI::Theme::TextAlign alignH, GUI::Theme::TextAlignVertical alignV) = 0;
+ virtual void drawString(const Graphics::Font *font, const Common::String &text, const Common::Rect &area, GUI::Theme::TextAlign alignH, GUI::Theme::TextAlignVertical alignV, int deltax) = 0;
virtual void disableShadows() { _disableShadows = true; }
virtual void enableShadows() { _disableShadows = false; }
@@ -486,7 +486,7 @@
void drawString(const Graphics::Font *font, const Common::String &text,
const Common::Rect &area, GUI::Theme::TextAlign alignH,
- GUI::Theme::TextAlignVertical alignV);
+ GUI::Theme::TextAlignVertical alignV, int deltax);
/**
* @see VectorRenderer::setFgColor()
Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp 2008-07-23 21:48:28 UTC (rev 33256)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp 2008-07-23 22:32:00 UTC (rev 33257)
@@ -270,10 +270,7 @@
for (int i = 0; i < kDrawDataMAX; ++i) {
if (_widgets[i] == 0) {
-#ifdef REQUIRE_ALL_DD_SETS
- warning("Error when parsing custom theme '%s': Missing data assets.", themeName.c_str());
- return false;
-#endif
+ warning("Missing data asset: '%s'", kDrawDataDefaults[i].name);
} else {
calcBackgroundOffset((DrawData)i);
@@ -341,7 +338,7 @@
}
void ThemeRenderer::queueDDText(TextData type, const Common::Rect &r, const Common::String &text, bool restoreBg,
- bool elipsis, TextAlign alignH, TextAlignVertical alignV) {
+ bool elipsis, TextAlign alignH, TextAlignVertical alignV, int deltax) {
if (_texts[type] == 0)
return;
@@ -354,6 +351,7 @@
q.alignH = alignH;
q.alignV = alignV;
q.restoreBg = restoreBg;
+ q.deltax = deltax;
if (_buffering) {
_textQueue.push_back(q);
@@ -389,7 +387,7 @@
restoreBackground(q.area);
_vectorRenderer->setFgColor(_texts[q.type]->_color.r, _texts[q.type]->_color.g, _texts[q.type]->_color.b);
- _vectorRenderer->drawString(_texts[q.type]->_fontPtr, q.text, q.area, q.alignH, q.alignV);
+ _vectorRenderer->drawString(_texts[q.type]->_fontPtr, q.text, q.area, q.alignH, q.alignV, q.deltax);
addDirtyRect(q.area);
}
@@ -567,21 +565,21 @@
if (inverted) {
queueDD(kDDTextSelectionBackground, r);
- queueDDText(kTextDataInverted, r, str, false, useEllipsis);
+ queueDDText(kTextDataInverted, r, str, false, useEllipsis, align);
return;
}
switch (state) {
case kStateDisabled:
- queueDDText(kTextDataDisabled, r, str, true, useEllipsis);
+ queueDDText(kTextDataDisabled, r, str, true, useEllipsis, align);
break;
case kStateHighlight:
- queueDDText(kTextDataHover, r, str, true, useEllipsis);
+ queueDDText(kTextDataHover, r, str, true, useEllipsis, align);
break;
case kStateEnabled:
- queueDDText(kTextDataDefault, r, str, true, useEllipsis);
+ queueDDText(kTextDataDefault, r, str, true, useEllipsis, align);
break;
}
}
Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h 2008-07-23 21:48:28 UTC (rev 33256)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h 2008-07-23 22:32:00 UTC (rev 33257)
@@ -181,6 +181,7 @@
GUI::Theme::TextAlignVertical alignV;
bool elipsis;
bool restoreBg;
+ int deltax;
};
public:
@@ -550,7 +551,7 @@
*/
inline void queueDD(DrawData type, const Common::Rect &r, uint32 dynamic = 0);
inline void queueDDText(TextData type, const Common::Rect &r, const Common::String &text, bool restoreBg,
- bool elipsis, TextAlign alignH = kTextAlignLeft, TextAlignVertical alignV = kTextAlignVTop);
+ bool elipsis, TextAlign alignH = kTextAlignLeft, TextAlignVertical alignV = kTextAlignVTop, int deltax = 0);
/**
* DEBUG: Draws a white square around the given position and writes the given next to it.
Modified: scummvm/branches/gsoc2008-gui/gui/about.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/about.cpp 2008-07-23 21:48:28 UTC (rev 33256)
+++ scummvm/branches/gsoc2008-gui/gui/about.cpp 2008-07-23 22:32:00 UTC (rev 33257)
@@ -203,7 +203,7 @@
}
void AboutDialog::drawDialog() {
- g_gui.theme()->setDrawArea(Common::Rect(_x, _y, _x+_w, _y+_h));
+// g_gui.theme()->setDrawArea(Common::Rect(_x, _y, _x+_w, _y+_h));
Dialog::drawDialog();
// Draw text
@@ -265,10 +265,10 @@
while (*str && *str == ' ')
str++;
- g_gui.theme()->drawText(Common::Rect(_x + _xOff, y, _x + _w - _xOff, y + g_gui.theme()->getFontHeight()), str, state, align, false, 0, false);
+ if (y > _y && y + g_gui.theme()->getFontHeight() < _y + _h)
+ g_gui.theme()->drawText(Common::Rect(_x + _xOff, y, _x + _w - _xOff, y + g_gui.theme()->getFontHeight()), str, state, align, false, 0, false);
y += _lineHeight;
}
- g_gui.theme()->resetDrawArea();
}
void AboutDialog::handleTickle() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list