[Scummvm-cvs-logs] scummvm master -> b7b4e9cc5899eff0810d97a848ace0fa2ede5548

eriktorbjorn eriktorbjorn at telia.com
Sun Feb 8 10:18:40 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b7b4e9cc58 ZVISION: Draw transparent text in original save dialog


Commit: b7b4e9cc5899eff0810d97a848ace0fa2ede5548
    https://github.com/scummvm/scummvm/commit/b7b4e9cc5899eff0810d97a848ace0fa2ede5548
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-02-08T10:13:18+01:00

Commit Message:
ZVISION: Draw transparent text in original save dialog

Before this change, text was drawn in black boxes in Zork Nemesis,
so while this does make it look better (and more like the original)
this may actually make the text slightly harder to read. The
original dialogs allowed only upper-case letters, but I think that
it's better to leave that to the player.

Changed paths:
    engines/zvision/scripting/controls/input_control.cpp
    engines/zvision/scripting/controls/input_control.h
    engines/zvision/text/text.cpp



diff --git a/engines/zvision/scripting/controls/input_control.cpp b/engines/zvision/scripting/controls/input_control.cpp
index 47da27f..b25aa13 100644
--- a/engines/zvision/scripting/controls/input_control.cpp
+++ b/engines/zvision/scripting/controls/input_control.cpp
@@ -39,6 +39,7 @@ namespace ZVision {
 
 InputControl::InputControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream)
 	: Control(engine, key, CONTROL_INPUT),
+	  _background(0),
 	  _nextTabstop(0),
 	  _focused(false),
 	  _textChanged(false),
@@ -111,6 +112,11 @@ InputControl::InputControl(ZVision *engine, uint32 key, Common::SeekableReadStre
 	}
 }
 
+InputControl::~InputControl() {
+	_background->free();
+	delete _background;
+}
+
 bool InputControl::onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) {
 	if (_engine->getScriptManager()->getStateFlag(_key) & Puzzle::DISABLED)
 		return false;
@@ -191,12 +197,16 @@ bool InputControl::process(uint32 deltaTimeInMillis) {
 	if (_engine->getScriptManager()->getStateFlag(_key) & Puzzle::DISABLED)
 		return false;
 
+	if (!_background) {
+		_background = _engine->getRenderManager()->getBkgRect(_textRectangle);
+	}
+
 	// First see if we need to render the text
 	if (_textChanged) {
 		// Blit the text using the RenderManager
 
 		Graphics::Surface txt;
-		txt.create(_textRectangle.width(), _textRectangle.height(), _engine->_resourcePixelFormat);
+		txt.copyFrom(*_background);
 
 		if (!_readOnly || !_focused)
 			_txtWidth = _engine->getTextRenderer()->drawTxt(_currentInputText, _stringInit, txt);
diff --git a/engines/zvision/scripting/controls/input_control.h b/engines/zvision/scripting/controls/input_control.h
index 99f7f52..e23ba0b 100644
--- a/engines/zvision/scripting/controls/input_control.h
+++ b/engines/zvision/scripting/controls/input_control.h
@@ -38,8 +38,10 @@ namespace ZVision {
 class InputControl : public Control {
 public:
 	InputControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream);
+	~InputControl();
 
 private:
+	Graphics::Surface *_background;
 	Common::Rect _textRectangle;
 	Common::Rect _headerRectangle;
 	cTxtStyle _stringInit;
diff --git a/engines/zvision/text/text.cpp b/engines/zvision/text/text.cpp
index e0501ae..4af3b96 100644
--- a/engines/zvision/text/text.cpp
+++ b/engines/zvision/text/text.cpp
@@ -315,8 +315,6 @@ int32 TextRenderer::drawTxt(const Common::String &txt, cTxtStyle &fontStyle, Gra
 	StyledTTFont font(_engine);
 	fontStyle.setFont(font);
 
-	dst.fillRect(Common::Rect(dst.w, dst.h), 0);
-
 	uint32 clr = _engine->_resourcePixelFormat.RGBToColor(fontStyle._red, fontStyle._green, fontStyle._blue);
 
 	int16 w;






More information about the Scummvm-git-logs mailing list