[Scummvm-git-logs] scummvm master -> fac2cda433a3f71a7376d498579bf38225322e7a

sev- noreply at scummvm.org
Fri Oct 18 11:09:13 UTC 2024


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:
fac2cda433 QDENGINE: More class variable renames in minigames/adv/


Commit: fac2cda433a3f71a7376d498579bf38225322e7a
    https://github.com/scummvm/scummvm/commit/fac2cda433a3f71a7376d498579bf38225322e7a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-18T12:53:02+02:00

Commit Message:
QDENGINE: More class variable renames in minigames/adv/

Changed paths:
    engines/qdengine/minigames/adv/Rect.h
    engines/qdengine/minigames/adv/TextManager.cpp
    engines/qdengine/minigames/adv/TextManager.h


diff --git a/engines/qdengine/minigames/adv/Rect.h b/engines/qdengine/minigames/adv/Rect.h
index 54f12cd7f64..4e745001ebe 100644
--- a/engines/qdengine/minigames/adv/Rect.h
+++ b/engines/qdengine/minigames/adv/Rect.h
@@ -22,6 +22,7 @@
 #ifndef QDENGINE_MINIGAMES_ADV_RECT_H
 #define QDENGINE_MINIGAMES_ADV_RECT_H
 
+#include "qdengine/xmath.h"
 #include "qdengine/minigames/adv/Range.h"
 
 namespace QDEngine {
@@ -38,76 +39,76 @@ namespace QDEngine {
  */
 template<typename scalar_type, class vect_type>
 struct Rect {
-	typedef typename vect_type VectType;
-	typedef typename scalar_type ScalarType;
+	typedef vect_type VectType;
+	typedef scalar_type ScalarType;
 	typedef Rect<ScalarType, VectType> RectType;
 	typedef Rangef RangeType;
 
 	// конструкторы
 	Rect() :
-		left_(ScalarType(0)),
-		top_(ScalarType(0)),
-		width_(ScalarType(0)),
-		height_(ScalarType(0)) {}
+		_left(ScalarType(0)),
+		_top(ScalarType(0)),
+		_width(ScalarType(0)),
+		_height(ScalarType(0)) {}
 
 	/// Создаёт Rect размера \a _size, левый-верхний угол остаётся в точке (0, 0).
-	Rect(const VectType& _size) :
-		top_(ScalarType(0)),
-		left_(ScalarType(0)),
-		width_(_size.x),
-		height_(_size.y) {}
-
-	Rect(ScalarType _left, ScalarType _top, ScalarType _width, ScalarType _height) :
-		left_(_left),
-		top_(_top),
-		width_(_width),
-		height_(_height) {}
-
-	Rect(const VectType& _top_left, const VectType& _size) :
-		left_(_top_left.x),
-		top_(_top_left.y),
-		width_(_size.x),
-		height_(_size.y) {}
-
-	void set(ScalarType _left, ScalarType _top, ScalarType _width, ScalarType _height) {
-		left_ = _left;
-		top_ = _top;
-		width_ = _width;
-		height_ = _height;
+	Rect(const VectType& size) :
+		_top(ScalarType(0)),
+		_left(ScalarType(0)),
+		_width(size.x),
+		_height(size.y) {}
+
+	Rect(ScalarType left, ScalarType top, ScalarType width, ScalarType height) :
+		_left(left),
+		_top(top),
+		_width(width),
+		_height(height) {}
+
+	Rect(const VectType& _topleft, const VectType& size) :
+		_left(_topleft.x),
+		_top(_topleft.y),
+		_width(size.x),
+		_height(size.y) {}
+
+	void set(ScalarType left, ScalarType top, ScalarType width, ScalarType height) {
+		_left = left;
+		_top = top;
+		_width = width;
+		_height = height;
 	}
 
 	inline ScalarType left() const {
-		return left_;
+		return _left;
 	}
 	inline ScalarType top() const {
-		return top_;
+		return _top;
 	}
 	inline ScalarType width() const {
-		return width_;
+		return _width;
 	}
 	inline ScalarType height() const {
-		return height_;
+		return _height;
 	}
 
-	VectType left_top() const {
-		return VectType(left_, top_);
+	VectType _lefttop() const {
+		return VectType(_left, _top);
 	}
 	VectType right_top() const {
-		return VectType(left + width_, top_);
+		return VectType(_left + _width, _top);
 	}
-	VectType left_bottom() const {
-		return VectType(left_, top_ + height_);
+	VectType _leftbottom() const {
+		return VectType(_left, _top + _height);
 	}
 	VectType right_bottom() const {
-		return VectType(left_ + width_, top_ + height_);
+		return VectType(_left + _width, _top + _height);
 	}
 
 	// аксессоры (вычисляющие):
 	inline ScalarType right() const {
-		return left_ + width_;
+		return _left + _width;
 	}
 	inline ScalarType bottom() const {
-		return top_ + height_;
+		return _top + _height;
 	}
 
 	/*
@@ -117,40 +118,40 @@ struct Rect {
 
 	/// Возвращает координаты цетра прямоугольника.
 	inline VectType center() const {
-		return VectType(left_ + width_ / ScalarType(2),
-		                top_ + height_ / ScalarType(2));
+		return VectType(_left + _width / ScalarType(2),
+		                _top + _height / ScalarType(2));
 	}
 	/// Возвращает размер прямоугольника.
 	inline VectType size() const {
-		return VectType(width_, height_);
+		return VectType(_width, _height);
 	}
 
 	// сеттеры:
-	inline void left(ScalarType _left) {
-		left_ = _left;
+	inline void left(ScalarType left) {
+		_left = left;
 	}
-	inline void top(ScalarType _top) {
-		top_ = _top;
+	inline void top(ScalarType top) {
+		_top = top;
 	}
-	inline void width(ScalarType _width) {
-		width_ = _width;
+	inline void width(ScalarType width) {
+		_width = width;
 	}
-	inline void height(ScalarType _height) {
-		height_ = _height;
+	inline void height(ScalarType height) {
+		_height = height;
 	}
 
 	// сеттеры (вычисляющие):
-	inline void right(ScalarType _right) {
-		left_ = _right - width_;
+	inline void right(ScalarType right) {
+		_left = right - _width;
 	}
-	inline void bottom(ScalarType _bottom) {
-		top_ = _bottom - height_;
+	inline void bottom(ScalarType bottom) {
+		_top = bottom - _height;
 	}
 
 	/// Переносит центр прямоугольника в точку \a _center не изменяя его размер.
-	inline void center(const VectType& _center) {
-		left_ = _center.x - width_ / ScalarType(2);
-		top_ = _center.y - height_ / ScalarType(2);
+	inline void center(const VectType& center) {
+		_left = center.x - _width / ScalarType(2);
+		_top = center.y - _height / ScalarType(2);
 	}
 	/*
 	* FIXME: размер должен менятся относительно левого-верхнего угла (как у
@@ -160,33 +161,33 @@ struct Rect {
 	* скэлинг)?
 	*/
 	/// Устанавливает новые размеры, сохраняя левый-верхний угол в преждней точке.
-	inline void size(const VectType& _size) {
-		width_ = _size.x;
-		height_ = _size.y;
+	inline void size(const VectType& size) {
+		_width = size.x;
+		_height = size.y;
 	}
 
 	// утилиты:
 
 	/// Проверяет не находится ли точка \a _point внутри прямоугольника
-	inline bool point_inside(const VectType& _point) const {
-		if (_point.x >= left() && _point.y >= top() &&
-		                                      _point.x <= right() && _point.y <= bottom())
+	inline bool point_inside(const VectType& point) const {
+		if (point.x >= left() && point.y >= top() &&
+		                                      point.x <= right() && point.y <= bottom())
 			return true;
 		else
 			return false;
 	}
 	/// Проверяет не находится ли прямоугольник \a _rect внутри прямоугольника
-	inline bool rect_inside(const RectType& _rect) const {
-		if (_rect.left() >= left() && _rect.top() >= top() &&
-		                    _rect.bottom() <= bottom() && _rect.right() <= right())
+	inline bool rect_inside(const RectType& rect) const {
+		if (rect.left() >= left() && rect.top() >= top() &&
+		                    rect.bottom() <= bottom() && rect.right() <= right())
 			return true;
 		else
 			return false;
 	}
 
-	inline bool rect_overlap(const RectType& _rect) const {
-		if (left() > _rect.right() || right() < _rect.left()
-		        || top() > _rect.bottom() || bottom() < _rect.top())
+	inline bool rect_overlap(const RectType& rect) const {
+		if (left() > rect.right() || right() < rect.left()
+		        || top() > rect.bottom() || bottom() < rect.top())
 			return false;
 
 		return true;
@@ -197,8 +198,8 @@ struct Rect {
 	*  Возвращает копию прямоугольника, над которой произведён скэлинг
 	*  относительно точки \a _origin.
 	*/
-	inline RectType scaled(const VectType& _scale, const VectType& _origin) const {
-		return (*this - _origin) * _scale + _origin;
+	inline RectType scaled(const VectType& scale, const VectType& origin) const {
+		return (*this - origin) * scale + origin;
 	}
 
 	/// Исправляет отрицательную ширину/высоту
@@ -213,20 +214,20 @@ struct Rect {
 		}
 	}
 
-	inline RectType intersection(const RectType& _rect) const {
-		RangeType xRange = RangeType(left(), right()).intersection(RangeType(_rect.left(), _rect.right()));
-		RangeType yRange = RangeType(top(), bottom()).intersection(RangeType(_rect.top(), _rect.bottom()));
+	inline RectType intersection(const RectType& rect) const {
+		RangeType xRange = RangeType(left(), right()).intersection(RangeType(rect.left(), rect.right()));
+		RangeType yRange = RangeType(top(), bottom()).intersection(RangeType(rect.top(), rect.bottom()));
 		return RectType(xRange.minimum(), yRange.minimum(), xRange.length(), yRange.length());
 	}
 
 	// Операторы
-	RectType operator+(const VectType& _point) const {
-		return RectType(left() + _point.x, top() + _point.y,
+	RectType operator+(const VectType& point) const {
+		return RectType(left() + point.x, top() + point.y,
 		                width(), height());
 	}
 
-	RectType operator-(const VectType& _point) const {
-		return RectType(left() - _point.x, top() - _point.y,
+	RectType operator-(const VectType& point) const {
+		return RectType(left() - point.x, top() - point.y,
 		                width(), height());
 	}
 
@@ -247,32 +248,33 @@ struct Rect {
 		return RectType(leftTop, size);
 	}
 
-	RectType operator/(const VectType& _point) const {
-		return RectType(left() / _point.x, top() / _point.y,
-		                width() / _point.x, height() / _point.y);
+	RectType operator/(const VectType& point) const {
+		return RectType(left() / point.x, top() / point.y,
+		                width() / point.x, height() / point.y);
 	}
 
 	bool operator==(const RectType& rect) const {
-		return (left_ == rect.left_ && top_ == rect.top_ &&
-		width_ == rect.width_ && height_ == rect.height_);
+		return (_left == rect._left && _top == rect._top &&
+		_width == rect._width && _height == rect._height);
 	}
 
 	bool eq(const RectType& rect, ScalarType eps = FLT_COMPARE_TOLERANCE) const {
-		return (abs(left_ - rect.left_) < eps && abs(top_ - rect.top_) < eps &&
-		        abs(width_ - rect.width_) < eps && abs(height_ - rect.height_) < eps);
+		return (abs(_left - rect._left) < eps && abs(_top - rect._top) < eps &&
+		        abs(_width - rect._width) < eps && abs(_height - rect._height) < eps);
 	}
 
 	bool operator!=(const RectType& rect) const {
-		return (left_ != rect.left_ || top_ != rect.top_ ||
-		                                       width_ != rect.width_ || height_ != rect.height_);
+		return (_left != rect._left || _top != rect._top ||
+		                                       _width != rect._width || _height != rect._height);
 	}
 
 protected:
-	ScalarType left_;
-	ScalarType top_;
-	ScalarType width_;
-	ScalarType height_;
+	ScalarType _left;
+	ScalarType _top;
+	ScalarType _width;
+	ScalarType _height;
 
+#if 0
 public:
 	// SideKick на этом обламывается:
 	template<class ST, class VT>
@@ -282,7 +284,7 @@ public:
 		                      static_cast<ST>(width()),
 		                      static_cast<ST>(height()));
 	}
-
+#endif
 
 	bool clipLine(VectType& pos0, VectType& pos1) const;
 };
diff --git a/engines/qdengine/minigames/adv/TextManager.cpp b/engines/qdengine/minigames/adv/TextManager.cpp
index 72042eedf2f..c16ea622d10 100644
--- a/engines/qdengine/minigames/adv/TextManager.cpp
+++ b/engines/qdengine/minigames/adv/TextManager.cpp
@@ -54,7 +54,7 @@ TextManager::TextManager() {
 				digit.pool.releaseObject(obj);
 			}
 			debugC(2, kDebugMinigames, "set size to (%5.1f, %5.1f)\n", digit.size.x, digit.size.y);
-			fonts_.push_back(digit);
+			_fonts.push_back(digit);
 		} else
 			break;
 	}
@@ -74,27 +74,27 @@ TextManager::TextManager() {
 
 			if (read != 11)
 				break;
-			escapes_.push_back(escape);
+			_escapes.push_back(escape);
 		} else
 			break;
 	}
-	debugCN(2, kDebugMinigames, "TextManager(): registered %d particle escapes", escapes_.size());
+	debugCN(2, kDebugMinigames, "TextManager(): registered %d particle escapes", _escapes.size());
 
-	if (getStaticPreset(show_scores_, "show_scores"))
-		show_scores_.textID = createStaticText(show_scores_.pos, show_scores_.font, show_scores_.align);
+	if (getStaticPreset(_show_scores, "show_scores"))
+		_show_scores.textID = createStaticText(_show_scores.pos, _show_scores.font, _show_scores.align);
 	else
-		show_scores_.textID = -1;
+		_show_scores.textID = -1;
 
-	if (getStaticPreset(show_time_, "show_time"))
-		show_time_.textID = createStaticText(show_time_.pos, show_time_.font, show_time_.align);
+	if (getStaticPreset(_show_time, "show_time"))
+		_show_time.textID = createStaticText(_show_time.pos, _show_time.font, _show_time.align);
 	else
-		show_time_.textID = -1;
+		_show_time.textID = -1;
 
-	targetScore_ = 0;
-	currentScore_ = 0;
-	scoreUpdateTimer_ = 0.f;
+	_targetScore = 0;
+	_currentScore = 0;
+	_scoreUpdateTimer = 0.f;
 
-	scoreUpdateTime_ = getParameter("score_update_time", 0.1f);
+	_scoreUpdateTime = getParameter("score_update_time", 0.1f);
 }
 
 bool TextManager::getStaticPreset(StaticTextPreset& preset, const char* name) const {
@@ -146,67 +146,67 @@ bool TextManager::getStaticPreset(StaticTextPreset& preset, const char* name) co
 }
 
 TextManager::~TextManager() {
-	for (auto &mit : flowMsgs_)
+	for (auto &mit : _flowMsgs)
 		mit.release();
 
-	for (auto &sit : staticMsgs_)
+	for (auto &sit : _staticMsgs)
 		sit.release();
 
-	for (auto &dit : fonts_)
+	for (auto &dit : _fonts)
 		dit.pool.release();
 }
 
 int TextManager::createStaticText(const mgVect3f& pos, int fontID, TextAlign align) {
-	assert(fontID >= 0 && fontID < fonts_.size());
+	assert(fontID >= 0 && fontID < _fonts.size());
 
-	StaticMessage msg(&fonts_[fontID]);
+	StaticMessage msg(&_fonts[fontID]);
 
-	msg.align_ = align;
-	msg.depth_ = pos.z;
-	msg.pos_ = mgVect2f(pos.x, pos.y);
+	msg._align = align;
+	msg._depth = pos.z;
+	msg._pos = mgVect2f(pos.x, pos.y);
 
-	staticMsgs_.push_back(msg);
-	return (int)staticMsgs_.size() - 1;
+	_staticMsgs.push_back(msg);
+	return (int)_staticMsgs.size() - 1;
 }
 
 void TextManager::updateStaticText(int textID, const char* txt) {
-	assert(textID >= 0 && textID < staticMsgs_.size());
+	assert(textID >= 0 && textID < _staticMsgs.size());
 
-	staticMsgs_[textID].setText(txt);
+	_staticMsgs[textID].setText(txt);
 }
 
 void TextManager::showText(const char* txt, const mgVect2f& pos, int fontID, int escapeID) {
-	assert(fontID >= 0 && fontID < fonts_.size());
-	assert(escapeID >= 0 && escapeID < escapes_.size());
+	assert(fontID >= 0 && fontID < _fonts.size());
+	assert(escapeID >= 0 && escapeID < _escapes.size());
 
-	Escape& es = escapes_[escapeID];
+	Escape& es = _escapes[escapeID];
 
-	Message msg(&fonts_[fontID]);
+	Message msg(&_fonts[fontID]);
 
 	msg.setText(txt);
 	if (msg.empty())
 		return;
 
-	msg.time_ = es.aliveTime > 0 ? es.aliveTime : 1.e6f;
+	msg._time = es.aliveTime > 0 ? es.aliveTime : 1.e6f;
 
-	msg.depth_ = es.depth;
-	msg.pos_ = pos;
+	msg._depth = es.depth;
+	msg._pos = pos;
 
-	msg.vel_.x = runtime->rnd(es.vel_min.x, es.vel_max.x);
-	msg.vel_.y = runtime->rnd(es.vel_min.y, es.vel_max.y);
-	msg.accel_.x = runtime->rnd(es.accel_min.x, es.accel_max.x);
-	msg.accel_.y = runtime->rnd(es.accel_min.y, es.accel_max.y);
+	msg._vel.x = runtime->rnd(es.vel_min.x, es.vel_max.x);
+	msg._vel.y = runtime->rnd(es.vel_min.y, es.vel_max.y);
+	msg._accel.x = runtime->rnd(es.accel_min.x, es.accel_max.x);
+	msg._accel.y = runtime->rnd(es.accel_min.y, es.accel_max.y);
 
-	flowMsgs_.push_back(msg);
+	_flowMsgs.push_back(msg);
 }
 
 void TextManager::showNumber(int num, const mgVect2f& pos, int fontID, int escapeID) {
-	assert(fontID >= 0 && fontID < fonts_.size());
-	assert(escapeID >= 0 && escapeID < escapes_.size());
+	assert(fontID >= 0 && fontID < _fonts.size());
+	assert(escapeID >= 0 && escapeID < _escapes.size());
 
 	char buf[16];
 	buf[15] = 0;
-	snprintf(buf, 15, escapes_[escapeID].format, num);
+	snprintf(buf, 15, _escapes[escapeID].format, num);
 
 	showText(buf, pos, fontID, escapeID);
 }
@@ -224,20 +224,20 @@ TextManager::StaticTextPreset::StaticTextPreset() {
 }
 
 TextManager::StaticMessage::StaticMessage(Font* font, TextAlign align) {
-	font_ = font;
-	align_ = align;
-	depth_ = 0.f;
+	_font = font;
+	_align = align;
+	_depth = 0.f;
 }
 
 void TextManager::StaticMessage::release() {
-	for (auto &it : objects_)
-		font_->pool.releaseObject(it);
+	for (auto &it : _objects)
+		_font->pool.releaseObject(it);
 
-	objects_.clear();
+	_objects.clear();
 }
 
 void TextManager::StaticMessage::setText(const char* str) {
-	assert(font_);
+	assert(_font);
 
 	if (!str) {
 		release();
@@ -246,29 +246,29 @@ void TextManager::StaticMessage::setText(const char* str) {
 
 	int len = (int)strlen(str);
 
-	if (objects_.size() < len)
-		objects_.resize(len);
+	if (_objects.size() < len)
+		_objects.resize(len);
 	else
-		while (objects_.size() > len) {
-			if (objects_.back())
-				font_->pool.releaseObject(objects_.back());
-			objects_.pop_back();
+		while (_objects.size() > len) {
+			if (_objects.back())
+				_font->pool.releaseObject(_objects.back());
+			_objects.pop_back();
 		}
 
 	for (int idx = 0; idx < len; ++idx) {
 		if (validSymbol(str[idx])) {
-			if (!objects_[idx])
-				objects_[idx] = font_->pool.getObject();
-		} else if (objects_[idx])
-			font_->pool.releaseObject(objects_[idx]);
+			if (!_objects[idx])
+				_objects[idx] = _font->pool.getObject();
+		} else if (_objects[idx])
+			_font->pool.releaseObject(_objects[idx]);
 	}
 
 	char name[2];
 	name[1] = 0;
 	for (int idx = 0; idx < len; ++idx) {
-		if (objects_[idx]) {
+		if (_objects[idx]) {
 			name[0] = str[idx];
-			objects_[idx].setState(name);
+			_objects[idx].setState(name);
 		}
 	}
 
@@ -276,13 +276,13 @@ void TextManager::StaticMessage::setText(const char* str) {
 }
 
 void TextManager::StaticMessage::update() {
-	if (objects_.empty())
+	if (_objects.empty())
 		return;
 
-	float width = font_->size.x * (objects_.size() - 1);
-	float x = pos_.x;
-	float y = pos_.y;
-	switch (align_) {
+	float width = _font->size.x * (_objects.size() - 1);
+	float x = _pos.x;
+	float y = _pos.y;
+	switch (_align) {
 	case ALIGN_RIGHT:
 		x -= width;
 		break;
@@ -292,87 +292,87 @@ void TextManager::StaticMessage::update() {
 	default:
 		break;
 	}
-	if (y < -font_->size.y || y > runtime->screenSize().y + font_->size.y
+	if (y < -_font->size.y || y > runtime->screenSize().y + _font->size.y
 	        || x < -2 * width || x > runtime->screenSize().x + 2 * width) {
 		release();
 		return;
 	}
 
-	for (auto &it : objects_) {
+	for (auto &it : _objects) {
 		if (it)
-			it->set_R(runtime->game2world(mgVect2f(x, y), depth_));
-		x += font_->size.x;
+			it->set_R(runtime->game2world(mgVect2f(x, y), _depth));
+		x += _font->size.x;
 	}
 }
 
 TextManager::Message::Message(Font* font)
 	: StaticMessage(font) {
-	time_ = 0.f;
+	_time = 0.f;
 }
 
 void TextManager::Message::release() {
 	StaticMessage::release();
-	time_ = 0.f;
+	_time = 0.f;
 }
 
 void TextManager::Message::quant(float dt) {
 	if (empty())
 		return;
 
-	time_ -= dt;
-	if (time_ < 0.f) {
+	_time -= dt;
+	if (_time < 0.f) {
 		release();
 		return;
 	}
 
-	vel_ += accel_ * dt;
-	pos_ += vel_ * dt;
+	_vel += _accel * dt;
+	_pos += _vel * dt;
 
 	update();
 }
 
 void TextManager::quant(float dt) {
-	Messages::iterator it = flowMsgs_.begin();
-	while (it != flowMsgs_.end()) {
+	Messages::iterator it = _flowMsgs.begin();
+	while (it != _flowMsgs.end()) {
 		it->quant(dt);
 		if (it->empty())
-			it = flowMsgs_.erase(it);
+			it = _flowMsgs.erase(it);
 		else
 			++it;
 	}
 
-	if (show_scores_.textID >= 0) {
-		if (scoreUpdateTimer_ >= 0.f && scoreUpdateTimer_ <= runtime->getTime()) {
-			int sgn = targetScore_ - currentScore_ < 0 ? -1 : 1;
-			int mod = abs(currentScore_ - targetScore_);
-			currentScore_ += sgn * (mod / 10 + 1);
+	if (_show_scores.textID >= 0) {
+		if (_scoreUpdateTimer >= 0.f && _scoreUpdateTimer <= runtime->getTime()) {
+			int sgn = _targetScore - _currentScore < 0 ? -1 : 1;
+			int mod = abs(_currentScore - _targetScore);
+			_currentScore += sgn * (mod / 10 + 1);
 
 			char buf[16];
 			buf[15] = 0;
-			snprintf(buf, 15, show_scores_.format, currentScore_);
-			updateStaticText(show_scores_.textID, buf);
+			snprintf(buf, 15, _show_scores.format, _currentScore);
+			updateStaticText(_show_scores.textID, buf);
 
-			scoreUpdateTimer_ = currentScore_ != targetScore_ ? runtime->getTime() + scoreUpdateTime_ : -1.f;
+			_scoreUpdateTimer = _currentScore != _targetScore ? runtime->getTime() + _scoreUpdateTime : -1.f;
 		}
 	}
 }
 
 void TextManager::updateScore(int score) {
-	targetScore_ = score;
-	if (scoreUpdateTimer_ < 0.f)
-		scoreUpdateTimer_ = runtime->getTime();
+	_targetScore = score;
+	if (_scoreUpdateTimer < 0.f)
+		_scoreUpdateTimer = runtime->getTime();
 }
 
 void TextManager::updateTime(int seconds) {
-	if (show_time_.textID >= 0) {
+	if (_show_time.textID >= 0) {
 		char buf[16];
 		buf[15] = 0;
 		int h = seconds / 3600;
 		seconds -= 3600 * h;
 		int minutes = seconds / 60;
 		seconds -= 60 * minutes;
-		snprintf(buf, 15, show_time_.format, h, minutes, seconds);
-		updateStaticText(show_time_.textID, buf);
+		snprintf(buf, 15, _show_time.format, h, minutes, seconds);
+		updateStaticText(_show_time.textID, buf);
 	}
 }
 
diff --git a/engines/qdengine/minigames/adv/TextManager.h b/engines/qdengine/minigames/adv/TextManager.h
index 56a48009e6d..3e28be0b795 100644
--- a/engines/qdengine/minigames/adv/TextManager.h
+++ b/engines/qdengine/minigames/adv/TextManager.h
@@ -77,18 +77,18 @@ private:
 	bool getStaticPreset(StaticTextPreset& preset, const char* name) const;
 
 	struct StaticMessage {
-		StaticMessage(Font* font = 0, TextAlign align_ = ALIGN_CENTER);
+		StaticMessage(Font* font = 0, TextAlign _align = ALIGN_CENTER);
 		void release();
 
 		bool empty() const {
-			return objects_.empty();
+			return _objects.empty();
 		}
 
 		void setText(const char* str);
 
-		int depth_;
-		mgVect2f pos_;
-		TextAlign align_;
+		int _depth;
+		mgVect2f _pos;
+		TextAlign _align;
 
 	protected:
 		void update();
@@ -97,9 +97,9 @@ private:
 		}
 
 	private:
-		Font *font_;
+		Font *_font;
 
-		QDObjects objects_;
+		QDObjects _objects;
 	};
 	typedef Std::vector<StaticMessage> StaticMessages;
 
@@ -109,24 +109,24 @@ private:
 
 		void quant(float dt);
 
-		float time_;
-		mgVect2f vel_;
-		mgVect2f accel_;
+		float _time;
+		mgVect2f _vel;
+		mgVect2f _accel;
 
 	};
 	typedef Std::vector<Message> Messages;
 
-	Fonts fonts_;
-	Escapes escapes_;
-	StaticTextPreset show_scores_;
-	StaticTextPreset show_time_;
-	StaticMessages staticMsgs_;
-	Messages flowMsgs_;
-
-	int targetScore_;
-	int currentScore_;
-	float scoreUpdateTime_;
-	float scoreUpdateTimer_;
+	Fonts _fonts;
+	Escapes _escapes;
+	StaticTextPreset _show_scores;
+	StaticTextPreset _show_time;
+	StaticMessages _staticMsgs;
+	Messages _flowMsgs;
+
+	int _targetScore;
+	int _currentScore;
+	float _scoreUpdateTime;
+	float _scoreUpdateTimer;
 };
 
 } // namespace QDEngine




More information about the Scummvm-git-logs mailing list