[Scummvm-git-logs] scummvm master -> 527b814bf14476fbb6df95846192f8a763967777
dreammaster
dreammaster at scummvm.org
Tue Mar 14 02:58:12 CET 2017
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:
527b814bf1 TITANIC: Rename CStarControlSub4 class to FRange
Commit: 527b814bf14476fbb6df95846192f8a763967777
https://github.com/scummvm/scummvm/commit/527b814bf14476fbb6df95846192f8a763967777
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-03-13T21:57:56-04:00
Commit Message:
TITANIC: Rename CStarControlSub4 class to FRange
Changed paths:
A engines/titanic/star_control/frange.cpp
A engines/titanic/star_control/frange.h
R engines/titanic/star_control/star_control_sub4.cpp
R engines/titanic/star_control/star_control_sub4.h
engines/titanic/module.mk
engines/titanic/star_control/base_star.cpp
engines/titanic/star_control/base_star.h
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 325263d..cdb3a64 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -436,10 +436,10 @@ MODULE_OBJS := \
star_control/dvector.o \
star_control/fmatrix.o \
star_control/fpoint.o \
+ star_control/frange.o \
star_control/frect.o \
star_control/fvector.o \
star_control/star_control_sub2.o \
- star_control/star_control_sub4.o \
star_control/star_control_sub5.o \
star_control/star_control_sub6.o \
star_control/star_control_sub7.o \
diff --git a/engines/titanic/star_control/base_star.cpp b/engines/titanic/star_control/base_star.cpp
index 97ed683..ffe5fd0 100644
--- a/engines/titanic/star_control/base_star.cpp
+++ b/engines/titanic/star_control/base_star.cpp
@@ -67,11 +67,11 @@ void CBaseStar::clear() {
void CBaseStar::initialize() {
_minVal = 9.9999998e10;
_maxVal = -9.9999998e10;
- _sub4.initialize();
+ _minMax.reset();
for (uint idx = 0; idx < _data.size(); ++idx) {
const CBaseStarEntry *entry = getDataPtr(idx);
- _sub4.checkEntry(entry->_position);
+ _minMax.expand(entry->_position);
if (entry->_value < _minVal)
_minVal = entry->_value;
diff --git a/engines/titanic/star_control/base_star.h b/engines/titanic/star_control/base_star.h
index 57be804..1c75efd 100644
--- a/engines/titanic/star_control/base_star.h
+++ b/engines/titanic/star_control/base_star.h
@@ -24,7 +24,7 @@
#define TITANIC_STAR_CONTROL_SUB3_H
#include "titanic/support/simple_file.h"
-#include "titanic/star_control/star_control_sub4.h"
+#include "titanic/star_control/frange.h"
#include "titanic/star_control/star_control_sub5.h"
#include "titanic/star_control/surface_area.h"
@@ -68,7 +68,7 @@ private:
void draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarControlSub5 *sub5);
protected:
Common::Array<CBaseStarEntry> _data;
- CStarControlSub4 _sub4;
+ FRange _minMax;
double _minVal;
double _maxVal;
double _range;
diff --git a/engines/titanic/star_control/frange.cpp b/engines/titanic/star_control/frange.cpp
new file mode 100644
index 0000000..e70976d
--- /dev/null
+++ b/engines/titanic/star_control/frange.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/algorithm.h"
+#include "titanic/star_control/frange.h"
+
+namespace Titanic {
+
+FRange::FRange() {
+}
+
+void FRange::reset() {
+ _min._x = _min._y = _min._z = 9.9999994e27;
+ _max._x = _max._y = _max._z = -9.9999994e27;
+}
+
+void FRange::expand(const FVector &v) {
+ _min._x = MIN(_min._x, v._x);
+ _min._y = MIN(_min._y, v._y);
+ _min._z = MIN(_min._z, v._z);
+ _max._x = MAX(_max._x, v._x);
+ _max._y = MAX(_max._y, v._y);
+ _max._z = MAX(_max._z, v._z);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/frange.h b/engines/titanic/star_control/frange.h
new file mode 100644
index 0000000..f36aa2c5
--- /dev/null
+++ b/engines/titanic/star_control/frange.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FRANGE_H
+#define TITANIC_FRANGE_H
+
+#include "titanic/star_control/fvector.h"
+
+namespace Titanic {
+
+class FRange {
+private:
+ FVector _min;
+ FVector _max;
+public:
+ FRange();
+
+ /**
+ * Resets the minimum & maximum vector values
+ */
+ void reset();
+
+ /**
+ * Expands the minimum & maximum as necessary to encompass the passed vector/
+ */
+ void expand(const FVector &v);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FRANGE_H */
diff --git a/engines/titanic/star_control/star_control_sub4.cpp b/engines/titanic/star_control/star_control_sub4.cpp
deleted file mode 100644
index 6ce0795..0000000
--- a/engines/titanic/star_control/star_control_sub4.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/algorithm.h"
-#include "titanic/star_control/star_control_sub4.h"
-
-namespace Titanic {
-
-CStarControlSub4::CStarControlSub4() {
-}
-
-void CStarControlSub4::initialize() {
- _min._x = _min._y = _min._z = 9.9999994e27;
- _max._x = _max._y = _max._z = -9.9999994e27;
-}
-
-void CStarControlSub4::checkEntry(const FVector &v) {
- _min._x = MIN(_min._x, v._x);
- _min._y = MIN(_min._y, v._y);
- _min._z = MIN(_min._z, v._z);
- _max._x = MAX(_max._x, v._x);
- _max._y = MAX(_max._y, v._y);
- _max._z = MAX(_max._z, v._z);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub4.h b/engines/titanic/star_control/star_control_sub4.h
deleted file mode 100644
index 43c8ab5..0000000
--- a/engines/titanic/star_control/star_control_sub4.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB4_H
-#define TITANIC_STAR_CONTROL_SUB4_H
-
-#include "titanic/star_control/fvector.h"
-
-namespace Titanic {
-
-class CStarControlSub4 {
-private:
- FVector _min;
- FVector _max;
-public:
- CStarControlSub4();
-
- void initialize();
-
- void checkEntry(const FVector &v);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB4_H */
More information about the Scummvm-git-logs
mailing list