[Scummvm-git-logs] scummvm master -> 7ca8d7b2b23eae77827591bd2fceba2c19627240
sev-
noreply at scummvm.org
Wed Dec 4 13:00:28 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:
7ca8d7b2b2 QDENGINE: More renames in adv minigames
Commit: 7ca8d7b2b23eae77827591bd2fceba2c19627240
https://github.com/scummvm/scummvm/commit/7ca8d7b2b23eae77827591bd2fceba2c19627240
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-12-04T14:00:10+01:00
Commit Message:
QDENGINE: More renames in adv minigames
Changed paths:
engines/qdengine/minigames/adv/RunTime.cpp
engines/qdengine/minigames/adv/common.h
engines/qdengine/minigames/adv/m_triangles.cpp
engines/qdengine/minigames/adv/m_triangles.h
diff --git a/engines/qdengine/minigames/adv/RunTime.cpp b/engines/qdengine/minigames/adv/RunTime.cpp
index 090e23fc5bc..45e8a21ee8c 100644
--- a/engines/qdengine/minigames/adv/RunTime.cpp
+++ b/engines/qdengine/minigames/adv/RunTime.cpp
@@ -52,19 +52,19 @@ public:
bool timeIsOut() const;
float leftTime() const;
float timeCost() const {
- return timeCost_;
+ return _timeCost;
}
void quant(float dt);
private:
float _gameTime;
- float timeCost_;
- int lastEventTime_;
- mgVect3f startPos_;
- mgVect2f size_;
- Direction direction_;
- QDObject timeBar_;
+ float _timeCost;
+ int _lastEventTime;
+ mgVect3f _startPos;
+ mgVect2f _size;
+ Direction _direction;
+ QDObject _timeBar;
MinigameManager *_runtime;
};
@@ -1101,45 +1101,45 @@ TimeManager::TimeManager(HoldData<TimeManagerData> &data_, MinigameManager *runt
} else
_gameTime = -1.f;
- timeCost_ = 0.f;
+ _timeCost = 0.f;
if (_gameTime > 0) {
if (const char *data = _runtime->parameter("time_bar"))
- timeBar_ = _runtime->getObject(data);
+ _timeBar = _runtime->getObject(data);
if (const char *data = _runtime->parameter("time_cost"))
- sscanf(data, "%f", &timeCost_);
+ sscanf(data, "%f", &_timeCost);
}
- direction_ = DOWN; // Default value
+ _direction = DOWN; // Default value
- if (timeBar_) {
+ if (_timeBar) {
TimeManagerData myData;
- myData.crd = _runtime->world2game(timeBar_);
+ myData.crd = _runtime->world2game(_timeBar);
data_.process(myData);
- startPos_ = myData.crd;
- size_ = _runtime->getSize(timeBar_);
+ _startPos = myData.crd;
+ _size = _runtime->getSize(_timeBar);
if (const char *data = _runtime->parameter("time_bar_direction")) {
int dir;
if (sscanf(data, "%d", &dir) == 1) {
assert(dir >= 0 && dir <= 3);
- direction_ = Direction(dir);
+ _direction = Direction(dir);
}
}
} else
- size_ = mgVect2f(-1.f, -1.f);
+ _size = mgVect2f(-1.f, -1.f);
assert(_runtime->getTime() == 0.f);
- lastEventTime_ = 0;
+ _lastEventTime = 0;
}
TimeManager::~TimeManager() {
- if (timeBar_)
- _runtime->release(timeBar_);
+ if (_timeBar)
+ _runtime->release(_timeBar);
}
@@ -1159,8 +1159,8 @@ float TimeManager::leftTime() const {
void TimeManager::quant(float dt) {
int seconds = round(_runtime->getTime());
- if (seconds != lastEventTime_) {
- lastEventTime_ = seconds;
+ if (seconds != _lastEventTime) {
+ _lastEventTime = seconds;
_runtime->textManager().updateTime(seconds);
int amountSeconds = round(leftTime());
if (_gameTime < 0.f || amountSeconds > 10)
@@ -1176,29 +1176,29 @@ void TimeManager::quant(float dt) {
_runtime->signal(EVENT_TIME_LESS_10_SECOND_LEFT_SECOND_TICK);
}
- if (_gameTime <= 0.f || !timeBar_)
+ if (_gameTime <= 0.f || !_timeBar)
return;
float phase = clamp(_runtime->getTime() / _gameTime, 0.f, 1.f);
mgVect3f pos;
- switch (direction_) {
+ switch (_direction) {
case UP:
- pos.y = -size_.y * phase;
+ pos.y = -_size.y * phase;
break;
case DOWN:
- pos.y = size_.y * phase;
+ pos.y = _size.y * phase;
break;
case LEFT:
- pos.x = -size_.x * phase;
+ pos.x = -_size.x * phase;
break;
case RIGHT:
- pos.x = size_.x * phase;
+ pos.x = _size.x * phase;
break;
}
- pos += startPos_;
+ pos += _startPos;
- timeBar_->set_R(_runtime->game2world(pos));
+ _timeBar->set_R(_runtime->game2world(pos));
}
} // namespace QDEngine
diff --git a/engines/qdengine/minigames/adv/common.h b/engines/qdengine/minigames/adv/common.h
index 9e5fbe6e313..b4410952fa6 100644
--- a/engines/qdengine/minigames/adv/common.h
+++ b/engines/qdengine/minigames/adv/common.h
@@ -35,13 +35,13 @@ class QDObject {
qdMinigameObjectInterface *_obj;
#ifdef _DEBUG
- Common::String name_;
+ Common::String _name;
#endif
public:
QDObject(qdMinigameObjectInterface* obj = 0, const char* name = "") : _obj(obj) {
#ifdef _DEBUG
- name_ = name;
+ _name = name;
#endif
}
diff --git a/engines/qdengine/minigames/adv/m_triangles.cpp b/engines/qdengine/minigames/adv/m_triangles.cpp
index e904331cbd8..d8767069be5 100644
--- a/engines/qdengine/minigames/adv/m_triangles.cpp
+++ b/engines/qdengine/minigames/adv/m_triangles.cpp
@@ -92,16 +92,16 @@ MinigameTriangle::MinigameTriangle(MinigameManager *runtime) {
switch (_gameType) {
case TRIANGLE:
- fieldSize_ = sqr(_fieldLines);
+ _fieldSize = sqr(_fieldLines);
break;
case RECTANGLE:
- fieldSize_ = _fieldLines * _fieldWidth;
+ _fieldSize = _fieldLines * _fieldWidth;
break;
case HEXAGON:
assert(_fieldLines % 2 == 0);
if (_fieldLines % 2 != 0)
return;
- fieldSize_ = 3 * sqr(_fieldLines) / 2;
+ _fieldSize = 3 * sqr(_fieldLines) / 2;
break;
}
@@ -114,7 +114,7 @@ MinigameTriangle::MinigameTriangle(MinigameManager *runtime) {
char name[64];
name[63] = 0;
- for (int num = 0; num < fieldSize_; ++num) {
+ for (int num = 0; num < _fieldSize; ++num) {
_nodes.push_back(Node(num, 0));
Node &node = _nodes.back();
for (int angle = 1; angle <= 3; ++angle) {
@@ -168,7 +168,7 @@ MinigameTriangle::MinigameTriangle(MinigameManager *runtime) {
}
}
- for (int idx = 0; idx < fieldSize_; ++idx)
+ for (int idx = 0; idx < _fieldSize; ++idx)
updateNode(_nodes[idx], idx);
setState(RUNNING);
@@ -448,7 +448,7 @@ void MinigameTriangle::quant(float dt) {
return;
int mousePos = -1;
- for (int idx = 0; idx < fieldSize_; ++idx)
+ for (int idx = 0; idx < _fieldSize; ++idx)
if (_nodes[idx].hit(_runtime->mousePosition())) {
mousePos = idx;
break;
@@ -472,7 +472,7 @@ void MinigameTriangle::quant(float dt) {
}
if (_selected != lastSelected) {
- for (int idx = 0; idx < fieldSize_; ++idx) {
+ for (int idx = 0; idx < _fieldSize; ++idx) {
Node &node = _nodes[idx];
if (idx == _selected || compatible(_selected, idx)) { // Ñ ÑÑой ÑиÑкой можно поменÑÑÑÑÑ
if (!node._border)
@@ -519,7 +519,7 @@ void MinigameTriangle::quant(float dt) {
int MinigameTriangle::rowBegin(int row) const {
if (row == _fieldLines)
- return fieldSize_;
+ return _fieldSize;
switch (_gameType) {
case TRIANGLE:
@@ -533,14 +533,14 @@ int MinigameTriangle::rowBegin(int row) const {
assert(row >= 0 && row < _fieldLines);
if (row >= _fieldLines / 2) {
row -= _fieldLines / 2;
- return fieldSize_ / 2 + (2 * _fieldLines - row) * row;
+ return _fieldSize / 2 + (2 * _fieldLines - row) * row;
}
return (_fieldLines + row) * row;
}
int MinigameTriangle::rowByNum(int num) const {
- if (num >= fieldSize_)
+ if (num >= _fieldSize)
return _fieldLines;
switch (_gameType) {
@@ -552,7 +552,7 @@ int MinigameTriangle::rowByNum(int num) const {
break;
}
//case HEXAGON:
- int row = num < fieldSize_ / 2 ? 0 : _fieldLines / 2;
+ int row = num < _fieldSize / 2 ? 0 : _fieldLines / 2;
while (row < _fieldLines && num >= rowBegin(row))
++row;
return row > 0 ? row - 1 : 0;
@@ -568,7 +568,7 @@ int MinigameTriangle::orientation(int num) const {
break;
}
//case HEXAGON:
- return (num + rowByNum(num) + (num >= fieldSize_ / 2 ? 1 : 0)) % 2;
+ return (num + rowByNum(num) + (num >= _fieldSize / 2 ? 1 : 0)) % 2;
}
bool MinigameTriangle::compatible(int num1, int num2) const {
diff --git a/engines/qdengine/minigames/adv/m_triangles.h b/engines/qdengine/minigames/adv/m_triangles.h
index 9ef0fa758a1..202268bdef1 100644
--- a/engines/qdengine/minigames/adv/m_triangles.h
+++ b/engines/qdengine/minigames/adv/m_triangles.h
@@ -84,7 +84,7 @@ private:
int _fieldLines = 0;
int _fieldWidth = 0;
- int fieldSize_ = 0;
+ int _fieldSize = 0;
Nodes _nodes;
ObjectContainer _selectBorders[2];
ObjectContainer _backSides[6];
More information about the Scummvm-git-logs
mailing list