[Scummvm-git-logs] scummvm branch-2-8 -> 8aa7ea796c4acfac3eac91b72e53adc7f734c5ce

OMGPizzaGuy noreply at scummvm.org
Sat Jan 13 16:33:52 UTC 2024


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

Summary:
289fc44a69 ULTIMA8: Ignore hidden gumps on mouse cursor  and trace object checks.
c1160086b5 ULTIMA8: Interpret book page breaks correctly
a01d16532c ULTIMA8: Skip spaces at end of last line too
50fb6648a3 ULTIMA8: Ignore tabs at start of centered lines
e2749e820a ULTIMA8: Reset movement flags on pause and remove left-click jump on keybind movement
365fcb3d3e ULTIMA8: Remove Tongue of Flame from Malchir treasure list.
bb1a89006e ULTIMA8: Fix bounds check for set mouse coordinates
8aa7ea796c NEWS: Mention Ultima 8 fixes


Commit: 289fc44a69368d8b9bde9a304355df6aaf58caf9
    https://github.com/scummvm/scummvm/commit/289fc44a69368d8b9bde9a304355df6aaf58caf9
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-01-13T09:41:11-06:00

Commit Message:
ULTIMA8: Ignore hidden gumps on mouse cursor  and trace object checks.
FIxes #14794

Changed paths:
    engines/ultima/ultima8/gumps/gump.cpp


diff --git a/engines/ultima/ultima8/gumps/gump.cpp b/engines/ultima/ultima8/gumps/gump.cpp
index 17ab61a5ab4..9bc88aa57ca 100644
--- a/engines/ultima/ultima8/gumps/gump.cpp
+++ b/engines/ultima/ultima8/gumps/gump.cpp
@@ -205,8 +205,9 @@ bool Gump::GetMouseCursor(int32 mx, int32 my, Shape &shape, int32 &frame) {
 	{
 		Gump *g = *it;
 
-		// Not if closing
-		if (g->_flags & FLAG_CLOSING) continue;
+		// Not if closing or hidden
+		if (g->_flags & FLAG_CLOSING || g->IsHidden())
+			continue;
 
 		// It's got the point
 		if (g->PointOnGump(mx, my))
@@ -501,8 +502,9 @@ uint16 Gump::TraceObjId(int32 mx, int32 my) {
 	for (it = _children.rbegin(); it != _children.rend(); ++it) {
 		Gump *g = *it;
 
-		// Not if closing
-		if (g->_flags & FLAG_CLOSING) continue;
+		// Not if closing or hidden
+		if (g->_flags & FLAG_CLOSING || g->IsHidden())
+			continue;
 
 		// It's got the point
 		if (g->PointOnGump(gx, gy)) objId_ = g->TraceObjId(gx, gy);
@@ -702,8 +704,9 @@ Gump *Gump::onMouseDown(int button, int32 mx, int32 my) {
 	for (it = _children.rbegin(); it != _children.rend(); ++it) {
 		Gump *g = *it;
 
-		// Not if closing
-		if (g->_flags & FLAG_CLOSING || g->IsHidden()) continue;
+		// Not if closing or hidden
+		if (g->_flags & FLAG_CLOSING || g->IsHidden())
+			continue;
 
 		// It's got the point
 		if (g->PointOnGump(mx, my)) handled = g->onMouseDown(button, mx, my);
@@ -725,8 +728,9 @@ Gump *Gump::onMouseMotion(int32 mx, int32 my) {
 	for (it = _children.rbegin(); it != _children.rend(); ++it) {
 		Gump *g = *it;
 
-		// Not if closing
-		if (g->_flags & FLAG_CLOSING || g->IsHidden()) continue;
+		// Not if closing or hidden
+		if (g->_flags & FLAG_CLOSING || g->IsHidden())
+			continue;
 
 		// It's got the point
 		if (g->PointOnGump(mx, my)) handled = g->onMouseMotion(mx, my);


Commit: c1160086b50856cb3f9e0b52e5935dfc8e6e7c38
    https://github.com/scummvm/scummvm/commit/c1160086b50856cb3f9e0b52e5935dfc8e6e7c38
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2024-01-13T09:41:26-06:00

Commit Message:
ULTIMA8: Interpret book page breaks correctly

Now interpreting page breaks in scrolls and books. Verified the behaviour
of those two gumps in dosbox. Also verified that plaques treat '*' as a
linebreak.

Fixes #14833.

Changed paths:
    engines/ultima/ultima8/graphics/fonts/font.cpp
    engines/ultima/ultima8/graphics/fonts/font.h
    engines/ultima/ultima8/graphics/fonts/jp_font.cpp
    engines/ultima/ultima8/graphics/fonts/jp_font.h
    engines/ultima/ultima8/graphics/fonts/shape_font.cpp
    engines/ultima/ultima8/graphics/fonts/shape_font.h
    engines/ultima/ultima8/graphics/fonts/tt_font.cpp
    engines/ultima/ultima8/graphics/fonts/tt_font.h
    engines/ultima/ultima8/gumps/book_gump.cpp
    engines/ultima/ultima8/gumps/scroll_gump.cpp
    engines/ultima/ultima8/gumps/widgets/edit_widget.cpp
    engines/ultima/ultima8/gumps/widgets/text_widget.cpp
    engines/ultima/ultima8/gumps/widgets/text_widget.h


diff --git a/engines/ultima/ultima8/graphics/fonts/font.cpp b/engines/ultima/ultima8/graphics/fonts/font.cpp
index e7fd531831a..3138e9087ef 100644
--- a/engines/ultima/ultima8/graphics/fonts/font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/font.cpp
@@ -39,10 +39,10 @@ void Font::getTextSize(const Std::string &text,
 					   int32 &resultwidth, int32 &resultheight,
 					   unsigned int &remaining,
 					   int32 width, int32 height, TextAlign align,
-					   bool u8specials) {
+					   bool u8specials, bool pagebreaks) {
 	Std::list<PositionedText> tmp;
 	tmp = typesetText<Traits>(this, text, remaining,
-	                          width, height, align, u8specials,
+	                          width, height, align, u8specials, pagebreaks,
 	                          resultwidth, resultheight);
 }
 
@@ -180,7 +180,7 @@ CHECKME: any others? (page breaks for books?)
 template<class T>
 Std::list<PositionedText> typesetText(Font *font,
 	const Std::string &text, unsigned int &remaining, int32 width, int32 height,
-	Font::TextAlign align, bool u8specials, int32 &resultwidth,
+	Font::TextAlign align, bool u8specials, bool pagebreaks, int32 &resultwidth,
 	int32 &resultheight, Std::string::size_type cursor) {
 
 	debugC(kDebugGraphics, "typeset (%d, %d) %s", width, height, text.c_str());
@@ -205,6 +205,7 @@ Std::list<PositionedText> typesetText(Font *font,
 	while (true) {
 		if (iter == text.end() || breakhere || T::isBreak(iter, u8specials)) {
 			// break here
+			bool atpagebreak = pagebreaks && T::isPageBreak(iter, u8specials);
 			int32 stringwidth = 0, stringheight = 0;
 			font->getStringSize(curline, stringwidth, stringheight);
 			line._dims.left = 0;
@@ -239,7 +240,7 @@ Std::list<PositionedText> typesetText(Font *font,
 				curlinestart = iter;
 			}
 
-			if (height != 0 && totalheight + font->getHeight() > height) {
+			if (atpagebreak || (height != 0 && totalheight + font->getHeight() > height)) {
 				// next line won't fit
 				remaining = curlinestart - text.begin();
 				break;
@@ -366,14 +367,14 @@ template
 Std::list<PositionedText> typesetText<Font::Traits>
 (Font *font, const Std::string &text,
  unsigned int &remaining, int32 width, int32 height,
- Font::TextAlign align, bool u8specials,
+ Font::TextAlign align, bool u8specials, bool pagebreaks,
  int32 &resultwidth, int32 &resultheight, Std::string::size_type cursor);
 
 template
 Std::list<PositionedText> typesetText<Font::SJISTraits>
 (Font *font, const Std::string &text,
  unsigned int &remaining, int32 width, int32 height,
- Font::TextAlign align, bool u8specials,
+ Font::TextAlign align, bool u8specials, bool pagebreaks,
  int32 &resultwidth, int32 &resultheight, Std::string::size_type cursor);
 
 } // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/graphics/fonts/font.h b/engines/ultima/ultima8/graphics/fonts/font.h
index e098ad5d0b0..3d4521938a8 100644
--- a/engines/ultima/ultima8/graphics/fonts/font.h
+++ b/engines/ultima/ultima8/graphics/fonts/font.h
@@ -72,10 +72,12 @@ public:
 	//! \param height The height of the target rectangle, or 0 for unlimited
 	//! \param align Alignment of the text (left, right, center)
 	//! \param u8specials If true, interpret the special characters U8 uses
+	//! \param pagebreaks If true (and u8specials too), stop at U8 pagebreaks
 	//! \return the rendered text in a RenderedText object
 	virtual RenderedText *renderText(const Std::string &text,
 	    unsigned int &remaining, int32 width = 0, int32 height = 0,
 		TextAlign align = TEXT_LEFT, bool u8specials = false,
+		bool pagebreaks = false,
 		Std::string::size_type cursor = Std::string::npos) = 0;
 
 	//! get the dimensions of a rendered string
@@ -85,12 +87,13 @@ public:
 	//! \param remaining Returns index of the first character not printed
 	//! \param width The width of the target rectangle, or 0 for unlimited
 	//! \param height The height of the target rectangle, or 0 for unlimited
-	//! \param u8specials If true, interpret the special characters U8 uses
 	//! \param align Alignment of the text (left, right, center)
+	//! \param u8specials If true, interpret the special characters U8 uses
+	//! \param pagebreaks If true (and u8specials too), stop at U8 pagebreaks
 	virtual void getTextSize(const Std::string &text,
 		int32 &resultwidth, int32 &resultheight, unsigned int &remaining,
 		int32 width = 0, int32 height = 0, TextAlign align = TEXT_LEFT,
-		bool u8specials = false);
+		bool u8specials = false, bool pagebreaks = false);
 
 	void setHighRes(bool hr) {
 		_highRes = hr;
@@ -120,6 +123,10 @@ protected:
 			return (c == '\n' ||
 			        (u8specials && (c == '\n' || c == '~' || c == '*')));
 		}
+		static bool isPageBreak(Std::string::const_iterator &i, bool u8specials) {
+			char c = *i;
+			return (u8specials && c == '*');
+		}
 		static bool canBreakAfter(Std::string::const_iterator &i);
 		static void advance(Std::string::const_iterator &i) {
 			++i;
@@ -164,7 +171,8 @@ template<class T>
 Std::list<PositionedText> typesetText(Font *font,
 	const Std::string &text, unsigned int &remaining,
 	int32 width, int32 height, Font::TextAlign align,
-	bool u8specials, int32 &resultwidth, int32 &resultheight,
+	bool u8specials, bool pagebreaks,
+	int32 &resultwidth, int32 &resultheight,
 	Std::string::size_type cursor = Std::string::npos);
 
 } // End of namespace Ultima8
diff --git a/engines/ultima/ultima8/graphics/fonts/jp_font.cpp b/engines/ultima/ultima8/graphics/fonts/jp_font.cpp
index 3bf4d179abe..be935800c85 100644
--- a/engines/ultima/ultima8/graphics/fonts/jp_font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/jp_font.cpp
@@ -78,22 +78,22 @@ void JPFont::getTextSize(const Std::string &text,
 						 int32 &resultwidth, int32 &resultheight,
 						 unsigned int &remaining,
 						 int32 width, int32 height, TextAlign align,
-						 bool u8specials) {
+						 bool u8specials, bool pagebreaks) {
 	Std::list<PositionedText> tmp;
 	tmp = typesetText<SJISTraits>(this, text, remaining,
-	                              width, height, align, u8specials,
+	                              width, height, align, u8specials, pagebreaks,
 	                              resultwidth, resultheight);
 }
 
 RenderedText *JPFont::renderText(const Std::string &text,
 								 unsigned int &remaining,
 								 int32 width, int32 height, TextAlign align,
-								 bool u8specials,
+								 bool u8specials, bool pagebreaks,
 								 Std::string::size_type cursor) {
 	int32 resultwidth, resultheight;
 	Std::list<PositionedText> lines;
 	lines = typesetText<SJISTraits>(this, text, remaining,
-	                                width, height, align, u8specials,
+	                                width, height, align, u8specials, pagebreaks,
 	                                resultwidth, resultheight,
 	                                cursor);
 
diff --git a/engines/ultima/ultima8/graphics/fonts/jp_font.h b/engines/ultima/ultima8/graphics/fonts/jp_font.h
index 8bdcfa01b44..161e79f2cb8 100644
--- a/engines/ultima/ultima8/graphics/fonts/jp_font.h
+++ b/engines/ultima/ultima8/graphics/fonts/jp_font.h
@@ -44,11 +44,13 @@ public:
 		int32 &width, int32 &height) override;
 	void getTextSize(const Std::string &text, int32 &resultwidth,
 		int32 &resultheight, unsigned int &remaining, int32 width = 0,
-		int32 height = 0, TextAlign align = TEXT_LEFT, bool u8specials = false) override;
+		int32 height = 0, TextAlign align = TEXT_LEFT,
+		bool u8specials = false, bool pagebreaks = false) override;
 
 	RenderedText *renderText(const Std::string &text,
 		unsigned int &remaining, int32 width = 0, int32 height = 0,
 		TextAlign align = TEXT_LEFT, bool u8specials = false,
+		bool pagebreaks = false,
 		Std::string::size_type cursor = Std::string::npos) override;
 
 protected:
diff --git a/engines/ultima/ultima8/graphics/fonts/shape_font.cpp b/engines/ultima/ultima8/graphics/fonts/shape_font.cpp
index 6ad278e353c..5cc8377a95b 100644
--- a/engines/ultima/ultima8/graphics/fonts/shape_font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/shape_font.cpp
@@ -121,12 +121,12 @@ int ShapeFont::charToFrameNum(char c) const {
 RenderedText *ShapeFont::renderText(const Std::string &text,
 									unsigned int &remaining,
 									int32 width, int32 height, TextAlign align,
-									bool u8specials,
+									bool u8specials, bool pagebreaks,
 									Std::string::size_type cursor) {
 	int32 resultwidth, resultheight;
 	Std::list<PositionedText> lines;
 	lines = typesetText<Traits>(this, text, remaining,
-	                            width, height, align, u8specials,
+	                            width, height, align, u8specials, pagebreaks,
 	                            resultwidth, resultheight, cursor);
 
 	return new ShapeRenderedText(lines, resultwidth, resultheight,
diff --git a/engines/ultima/ultima8/graphics/fonts/shape_font.h b/engines/ultima/ultima8/graphics/fonts/shape_font.h
index 7b2c062a71e..462edce56e9 100644
--- a/engines/ultima/ultima8/graphics/fonts/shape_font.h
+++ b/engines/ultima/ultima8/graphics/fonts/shape_font.h
@@ -67,6 +67,7 @@ public:
 	RenderedText *renderText(const Std::string &text,
 		unsigned int &remaining, int32 width = 0, int32 height = 0,
 		TextAlign align = TEXT_LEFT, bool u8specials = false,
+		bool pagebreaks = false,
 		Std::string::size_type cursor = Std::string::npos) override;
 };
 
diff --git a/engines/ultima/ultima8/graphics/fonts/tt_font.cpp b/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
index 2a13f1a897a..f2d33003a4a 100644
--- a/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
@@ -105,15 +105,15 @@ void TTFont::getTextSize(const Std::string &text,
 						 int32 &resultWidth, int32 &resultHeight,
 						 unsigned int &remaining,
 						 int32 width, int32 height, TextAlign align,
-						 bool u8specials) {
+						 bool u8specials, bool pagebreaks) {
 	Std::list<PositionedText> tmp;
 	if (!_SJIS)
 		tmp = typesetText<Traits>(this, text, remaining,
-		                          width, height, align, u8specials,
+		                          width, height, align, u8specials, pagebreaks,
 		                          resultWidth, resultHeight);
 	else
 		tmp = typesetText<SJISTraits>(this, text, remaining,
-		                              width, height, align, u8specials,
+		                              width, height, align, u8specials, pagebreaks,
 		                              resultWidth, resultHeight);
 }
 
@@ -189,15 +189,15 @@ void TTFont::addTextBorder(Graphics::ManagedSurface &textSurf, uint32 *texBuf, c
 }
 
 RenderedText *TTFont::renderText(const Std::string &text, unsigned int &remaining,
-		int32 width, int32 height, TextAlign align, bool u8specials,
+		int32 width, int32 height, TextAlign align, bool u8specials, bool pagebreaks,
 		Std::string::size_type cursor) {
 	int32 resultWidth, resultHeight, lineHeight;
 	Std::list<PositionedText> lines;
 	if (!_SJIS)
-		lines = typesetText<Traits>(this, text, remaining, width, height, align, u8specials,
+		lines = typesetText<Traits>(this, text, remaining, width, height, align, u8specials, pagebreaks,
 			resultWidth, resultHeight, cursor);
 	else
-		lines = typesetText<SJISTraits>(this, text, remaining, width, height, align, u8specials,
+		lines = typesetText<SJISTraits>(this, text, remaining, width, height, align, u8specials, pagebreaks,
 			resultWidth, resultHeight, cursor);
 	lineHeight = _ttfFont->getFontHeight();
 
diff --git a/engines/ultima/ultima8/graphics/fonts/tt_font.h b/engines/ultima/ultima8/graphics/fonts/tt_font.h
index 0d48eeb1138..fca321d8a26 100644
--- a/engines/ultima/ultima8/graphics/fonts/tt_font.h
+++ b/engines/ultima/ultima8/graphics/fonts/tt_font.h
@@ -49,11 +49,12 @@ public:
 	void getTextSize(const Std::string &text,
 		int32 &resultwidth, int32 &resultheight, unsigned int &remaining,
 		int32 width = 0, int32 height = 0, TextAlign align = TEXT_LEFT,
-		bool u8specials = false) override;
+		bool u8specials = false, bool pagebreaks = false) override;
 
 	RenderedText *renderText(const Std::string &text,
 		unsigned int &remaining, int32 width = 0, int32 height = 0,
 		TextAlign align = TEXT_LEFT, bool u8specials = false,
+		bool pagebreaks = false,
 		Std::string::size_type cursor = Std::string::npos) override;
 
 protected:
diff --git a/engines/ultima/ultima8/gumps/book_gump.cpp b/engines/ultima/ultima8/gumps/book_gump.cpp
index 1e9cc1da819..88fd5f04701 100644
--- a/engines/ultima/ultima8/gumps/book_gump.cpp
+++ b/engines/ultima/ultima8/gumps/book_gump.cpp
@@ -66,11 +66,11 @@ void BookGump::InitGump(Gump *newparent, bool take_focus) {
 	}
 
 	// Create the TextWidgets (NOTE: they _must_ have exactly the same _dims)
-	TextWidget *widget = new TextWidget(9, 5, _text, true, 9, 123, 129); //!! constants
+	TextWidget *widget = new TextWidget(9, 5, _text, true, 9, 123, 129, Font::TEXT_LEFT, true); //!! constants
 	widget->InitGump(this);
 	_textWidgetL = widget->getObjId();
 
-	widget = new TextWidget(150, 5, _text, true, 9, 123, 129); //!! constants
+	widget = new TextWidget(150, 5, _text, true, 9, 123, 129, Font::TEXT_LEFT, true); //!! constants
 	widget->InitGump(this);
 	_textWidgetR = widget->getObjId();
 	widget->setupNextText();
diff --git a/engines/ultima/ultima8/gumps/scroll_gump.cpp b/engines/ultima/ultima8/gumps/scroll_gump.cpp
index 2afb4efc9a6..0b6a56af6b2 100644
--- a/engines/ultima/ultima8/gumps/scroll_gump.cpp
+++ b/engines/ultima/ultima8/gumps/scroll_gump.cpp
@@ -52,7 +52,7 @@ void ScrollGump::InitGump(Gump *newparent, bool take_focus) {
 	ModalGump::InitGump(newparent, take_focus);
 
 	// Create the TextWidget
-	Gump *widget = new TextWidget(22, 29, _text, true, 9, 204, 115); //!! constants
+	Gump *widget = new TextWidget(22, 29, _text, true, 9, 204, 115, Font::TEXT_LEFT, true); //!! constants
 	widget->InitGump(this);
 	_textWidget = widget->getObjId();
 
diff --git a/engines/ultima/ultima8/gumps/widgets/edit_widget.cpp b/engines/ultima/ultima8/gumps/widgets/edit_widget.cpp
index ffb95687179..c04d7b97d6f 100644
--- a/engines/ultima/ultima8/gumps/widgets/edit_widget.cpp
+++ b/engines/ultima/ultima8/gumps/widgets/edit_widget.cpp
@@ -147,7 +147,8 @@ void EditWidget::renderText() {
 		_cachedText = font->renderText(_text, remaining,
 		                               max_width, max_height,
 		                               Font::TEXT_LEFT,
-		                               false, cv ? _cursor : Std::string::npos);
+		                               false, false,
+		                               cv ? _cursor : Std::string::npos);
 
 		// Trim text to fit
 		if (remaining < _text.length()) {
diff --git a/engines/ultima/ultima8/gumps/widgets/text_widget.cpp b/engines/ultima/ultima8/gumps/widgets/text_widget.cpp
index 53c853ee984..2dbf945ff9f 100644
--- a/engines/ultima/ultima8/gumps/widgets/text_widget.cpp
+++ b/engines/ultima/ultima8/gumps/widgets/text_widget.cpp
@@ -38,10 +38,11 @@ TextWidget::TextWidget() : Gump(), _gameFont(false), _fontNum(0), _blendColour(0
 }
 
 TextWidget::TextWidget(int x, int y, const Std::string &txt, bool gamefont, int font,
-					   int w, int h, Font::TextAlign align) :
+					   int w, int h, Font::TextAlign align, bool dopaging) :
 	Gump(x, y, w, h), _text(txt), _gameFont(gamefont), _fontNum(font),
 	_blendColour(0), _currentStart(0), _currentEnd(0), _tx(0), _ty(0),
-	_targetWidth(w), _targetHeight(h), _cachedText(nullptr), _textAlign(align) {
+	_doPaging(dopaging), _targetWidth(w), _targetHeight(h),
+	_cachedText(nullptr), _textAlign(align) {
 }
 
 TextWidget::~TextWidget(void) {
@@ -110,7 +111,7 @@ bool TextWidget::setupNextText() {
 
 	unsigned int remaining;
 	font->getTextSize(_text.substr(_currentStart), _tx, _ty, remaining,
-	                  _targetWidth, _targetHeight, _textAlign, true);
+	                  _targetWidth, _targetHeight, _textAlign, true, _doPaging);
 
 
 	_dims.top = -font->getBaseline();
@@ -153,7 +154,7 @@ void TextWidget::renderText() {
 		_cachedText = font->renderText(_text.substr(_currentStart,
 		                               _currentEnd - _currentStart),
 		                               remaining, _targetWidth, _targetHeight,
-		                               _textAlign, true);
+		                               _textAlign, true, _doPaging);
 	}
 }
 
@@ -248,7 +249,7 @@ bool TextWidget::loadData(Common::ReadStream *rs, uint32 version) {
 	int32 tx, ty;
 	unsigned int remaining;
 	font->getTextSize(_text.substr(_currentStart), tx, ty, remaining,
-	                  _targetWidth, _targetHeight, _textAlign, true);
+	                  _targetWidth, _targetHeight, _textAlign, true, _doPaging);
 
 	// Y offset is always baseline
 	_dims.top = -font->getBaseline();
diff --git a/engines/ultima/ultima8/gumps/widgets/text_widget.h b/engines/ultima/ultima8/gumps/widgets/text_widget.h
index 0f7bf2dc0f1..f4b479d54a5 100644
--- a/engines/ultima/ultima8/gumps/widgets/text_widget.h
+++ b/engines/ultima/ultima8/gumps/widgets/text_widget.h
@@ -42,6 +42,7 @@ protected:
 	int             _fontNum;
 	uint32          _blendColour;
 	int32           _tx, _ty;
+	bool            _doPaging;
 
 	unsigned int    _currentStart; //!< start of currently displaying text
 	unsigned int    _currentEnd;   //!< start of remaining text
@@ -56,7 +57,8 @@ public:
 	TextWidget();
 	TextWidget(int x, int y, const Std::string &txt, bool gamefont, int fontnum,
 	           int width = 0, int height = 0,
-	           Font::TextAlign align = Font::TEXT_LEFT);
+	           Font::TextAlign align = Font::TEXT_LEFT,
+	           bool dopaging = false);
 	~TextWidget() override;
 
 	// Init the gump, call after construction


Commit: a01d16532c3aca0e29d3869d96c8ccf40148bf10
    https://github.com/scummvm/scummvm/commit/a01d16532c3aca0e29d3869d96c8ccf40148bf10
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2024-01-13T09:41:43-06:00

Commit Message:
ULTIMA8: Skip spaces at end of last line too

We were treating the last line differently from other lines because
it didn't end with a linebreak.

Fixes #14832.

Changed paths:
    engines/ultima/ultima8/graphics/fonts/font.cpp


diff --git a/engines/ultima/ultima8/graphics/fonts/font.cpp b/engines/ultima/ultima8/graphics/fonts/font.cpp
index 3138e9087ef..84ab5be24d9 100644
--- a/engines/ultima/ultima8/graphics/fonts/font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/font.cpp
@@ -265,7 +265,8 @@ Std::list<PositionedText> typesetText(Font *font,
 					spaces.append(" ");
 				}
 			}
-			if (foundLF) continue;
+			// no next word?
+			if (foundLF || nextword == text.end()) continue;
 
 			// process word
 			Std::string::const_iterator endofnextword = iter;


Commit: 50fb6648a3489d435b8b34d30eee1fa09b393479
    https://github.com/scummvm/scummvm/commit/50fb6648a3489d435b8b34d30eee1fa09b393479
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2024-01-13T09:42:00-06:00

Commit Message:
ULTIMA8: Ignore tabs at start of centered lines

This matches U8's behaviour in dosbox.

Changed paths:
    engines/ultima/ultima8/graphics/fonts/font.cpp


diff --git a/engines/ultima/ultima8/graphics/fonts/font.cpp b/engines/ultima/ultima8/graphics/fonts/font.cpp
index 84ab5be24d9..d4be6cd7867 100644
--- a/engines/ultima/ultima8/graphics/fonts/font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/font.cpp
@@ -260,7 +260,9 @@ Std::list<PositionedText> typesetText(Font *font,
 					foundLF = true;
 					break;
 				} else if (T::isTab(iter, u8specials)) {
-					spaces.append("    ");
+					// ignore tabs at beginning of line when centered
+					if (!(curline.empty() && align == Font::TEXT_CENTER))
+						spaces.append("    ");
 				} else if (!curline.empty()) {
 					spaces.append(" ");
 				}


Commit: e2749e820ab73498182d0bdd230135b4b5473034
    https://github.com/scummvm/scummvm/commit/e2749e820ab73498182d0bdd230135b4b5473034
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-01-13T09:42:12-06:00

Commit Message:
ULTIMA8: Reset movement flags on pause and remove left-click jump on keybind movement
Fixes #14852

Changed paths:
    engines/ultima/ultima8/ultima8.cpp
    engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp


diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index 5f90bee6e1c..3bdfeec8ec3 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -199,6 +199,8 @@ void Ultima8Engine::pauseEngineIntern(bool pause) {
 		if (midiPlayer)
 			midiPlayer->pause(pause);
 	}
+
+	_avatarMoverProcess->resetMovementFlags();
 }
 
 bool Ultima8Engine::hasFeature(EngineFeature f) const {
diff --git a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
index 5beb7e097e4..23a64f6354d 100644
--- a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
+++ b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
@@ -434,7 +434,7 @@ void U8AvatarMoverProcess::handleNormalMode() {
 		}
 	}
 
-	if ((!_mouseButton[0].isState(MBS_HANDLED) || m0unhandled) && hasMovementFlags(MOVE_ANY_DIRECTION | MOVE_STEP)) {
+	if ((!_mouseButton[0].isState(MBS_HANDLED) || m0unhandled) && hasMovementFlags(MOVE_MOUSE_DIRECTION | MOVE_STEP)) {
 		_mouseButton[0].setState(MBS_HANDLED);
 		// We got a left mouse down while already moving in any direction or holding the step button.
 		// CHECKME: check what needs to happen when keeping left pressed


Commit: 365fcb3d3ea16e0e5966f89b1999e7092e65d634
    https://github.com/scummvm/scummvm/commit/365fcb3d3ea16e0e5966f89b1999e7092e65d634
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-01-13T09:42:27-06:00

Commit Message:
ULTIMA8: Remove Tongue of Flame from Malchir treasure list.
The Tongue of Flame and book are given to Malchir by a previous usecode event. Fixes #14312

Changed paths:
    devtools/create_ultima8/u8monsters.ini


diff --git a/devtools/create_ultima8/u8monsters.ini b/devtools/create_ultima8/u8monsters.ini
index b31a706bc4d..f7b10225702 100644
--- a/devtools/create_ultima8/u8monsters.ini
+++ b/devtools/create_ultima8/u8monsters.ini
@@ -319,7 +319,7 @@ alignment=0x24
 unk=0
 damage_type=0x0001
 defense_type=0x0000
-treasure=type=potion;type=sorcreag1;type=sorcreag2;type=sorcfocus;type=fireblackrock
+treasure=type=potion;type=sorcreag1;type=sorcreag2;type=sorcfocus
 
 [theurgist]
 shape=269


Commit: bb1a89006ee9f35f6a2a5ad777de43afcc105f97
    https://github.com/scummvm/scummvm/commit/bb1a89006ee9f35f6a2a5ad777de43afcc105f97
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-01-13T09:42:40-06:00

Commit Message:
ULTIMA8: Fix bounds check for set mouse coordinates
Fixes #14838

Changed paths:
    engines/ultima/ultima8/kernel/mouse.cpp


diff --git a/engines/ultima/ultima8/kernel/mouse.cpp b/engines/ultima/ultima8/kernel/mouse.cpp
index e7ab098dd5b..708da926363 100644
--- a/engines/ultima/ultima8/kernel/mouse.cpp
+++ b/engines/ultima/ultima8/kernel/mouse.cpp
@@ -275,13 +275,13 @@ void Mouse::setMouseCoords(int mx, int my) {
 
 	if (mx < dims.left)
 		mx = dims.left;
-	else if (mx > dims.width())
-		mx = dims.width();
+	else if (mx >= dims.right)
+		mx = dims.right - 1;
 
 	if (my < dims.top)
 		my = dims.top;
-	else if (my > dims.height())
-		my = dims.height();
+	else if (my >= dims.bottom)
+		my = dims.bottom - 1;
 
 	_mousePos.x = mx;
 	_mousePos.y = my;


Commit: 8aa7ea796c4acfac3eac91b72e53adc7f734c5ce
    https://github.com/scummvm/scummvm/commit/8aa7ea796c4acfac3eac91b72e53adc7f734c5ce
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-01-13T10:03:52-06:00

Commit Message:
NEWS: Mention Ultima 8 fixes

Changed paths:
    NEWS.md


diff --git a/NEWS.md b/NEWS.md
index db62f8c6ab7..ef03157a501 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -11,7 +11,7 @@ For a more comprehensive changelog of the latest experimental code, see:
 
  MM:
    - Enabled engine, allowing MM1 and Xeen to be compiled.
-   
+
  MTROPOLIS:
    - Fixed crash in Muppet Treasure Island on some platforms.
 
@@ -32,6 +32,13 @@ For a more comprehensive changelog of the latest experimental code, see:
    - Fix scenery zoom issue.
    - Fix animation glitches after using the holomap.
 
+ Ultima:
+   - Fix Ultima VIII hidden minimap blocking keyring use
+   - Fix Ultima VIII page breaks in books
+   - Fix Ultima VIII text centering for plaques
+   - Fix Ultima VIII crash on dragging items to screen edge
+   - Fix Ultima VIII unexpected jumping on left click
+
  Android port:
    - Fixed crash in built-in help with German language.
 




More information about the Scummvm-git-logs mailing list