[sear] The Pi function has changed
Bruno Wolff III
bruno at fedoraproject.org
Sat Nov 17 06:19:59 UTC 2012
commit 66211b82f6b71f04a42e7a2c8daf1ed31ec62cf1
Author: Bruno Wolff III <bruno at wolff.to>
Date: Sat Nov 17 00:19:42 2012 -0600
The Pi function has changed
sear-nopi.patch | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
sear.spec | 2 +
2 files changed, 72 insertions(+), 0 deletions(-)
---
diff --git a/sear-nopi.patch b/sear-nopi.patch
new file mode 100644
index 0000000..98962bd
--- /dev/null
+++ b/sear-nopi.patch
@@ -0,0 +1,70 @@
+--- common/Utility.h.orig 2012-11-16 22:58:27.187421774 -0600
++++ common/Utility.h 2012-11-16 22:59:27.703113008 -0600
+@@ -24,12 +24,12 @@
+
+ template <class T>
+ T deg_to_rad(const T & t) {
+- return (t * (WFMath::Pi / 180.0f));
++ return (t * (WFMath::numeric_constants<WFMath::CoordType>::pi() / 180.0f));
+ }
+
+ template <class T>
+ T rad_to_deg(const T & t) {
+- return (t * (180.0f / WFMath::Pi));
++ return (t * (180.0f / WFMath::numeric_constants<WFMath::CoordType>::pi()));
+ }
+
+ template <class T>
+--- loaders/cal3d/Cal3dModel.cpp.orig 2012-11-16 23:49:45.729688666 -0600
++++ loaders/cal3d/Cal3dModel.cpp 2012-11-16 23:50:59.613078865 -0600
+@@ -204,7 +204,7 @@
+ shininess = pCalRenderer->getShininess();
+ dyno->setShininess(shininess);
+
+- dyno->getMatrix().rotateZ(-m_rotate / 180.0 * WFMath::Pi);
++ dyno->getMatrix().rotateZ(-m_rotate / 180.0 * WFMath::numeric_constants<WFMath::CoordType>::pi());
+
+ dyno->setState(m_state);
+ dyno->setSelectState(m_select_state);
+@@ -463,7 +463,7 @@
+ // the first rotation makes the coord system compatible
+ // The third rotation takes into account the model rotation to make it
+ // face the right way.
+- po.orient = WFMath::Quaternion(1, WFMath::Pi / 2.0) *
++ po.orient = WFMath::Quaternion(1, WFMath::numeric_constants<WFMath::CoordType>::pi() / 2.0) *
+ m_core_model->getBoneRotation(bone) *
+ WFMath::Quaternion(cq.w, cq.x, cq.y, cq.z).inverse() *
+ model_rotation;
+--- loaders/NPlane.cpp.orig 2012-11-16 23:55:58.464061288 -0600
++++ loaders/NPlane.cpp 2012-11-16 23:57:19.917413590 -0600
+@@ -52,7 +52,7 @@
+ float *normalptr = so->createNormalData(3 * 12 * num_planes);
+ float *texptr = so->createTextureData(2 * 12 * num_planes);
+
+- float rads_per_segment = WFMath::Pi / (float)num_planes;
++ float rads_per_segment = WFMath::numeric_constants<WFMath::CoordType>::pi() / (float)num_planes;
+
+ float in[3][3];
+ float out[3];
+--- renderers/Camera.cpp.orig 2012-11-17 00:01:48.639566794 -0600
++++ renderers/Camera.cpp 2012-11-17 00:03:39.449650186 -0600
+@@ -25,7 +25,7 @@
+
+
+
+-static const WFMath::Quaternion QUAT_elevation_45(0, WFMath::Pi / 4.0f);
++static const WFMath::Quaternion QUAT_elevation_45(0, WFMath::numeric_constants<WFMath::CoordType>::pi() / 4.0f);
+
+ namespace Sear {
+
+--- renderers/Graphics.cpp.orig 2012-11-17 00:07:51.990746861 -0600
++++ renderers/Graphics.cpp 2012-11-17 00:08:31.095716901 -0600
+@@ -49,7 +49,7 @@
+ static const WFMath::Vector<3> x_vector(1.0f, 0.0f, 0.0f);
+ static const WFMath::Vector<3> y_vector(0.0f, 1.0f, 0.0f);
+ static const WFMath::Vector<3> z_vector(0.0f, 0.0f, 1.0f);
+-static const WFMath::Quaternion quaternion_by_90(z_vector, WFMath::Pi / 2.0f);
++static const WFMath::Quaternion quaternion_by_90(z_vector, WFMath::numeric_constants<WFMath::CoordType>::pi() / 2.0f);
+
+ static bool c_select = false;
+
diff --git a/sear.spec b/sear.spec
index 257edc2..617be06 100644
--- a/sear.spec
+++ b/sear.spec
@@ -22,6 +22,7 @@ Patch3: sear-eris-api-change.patch
Patch4: sear-missing-includes.patch
Patch5: sear-lua-fix.patch
Patch6: sear-compileopts.patch
+Patch7: sear-nopi.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: lib3ds-devel mercator-devel varconf-devel eris-devel sage-devel
@@ -47,6 +48,7 @@ in which quests and full games can be built.
%patch4 -p0 -b .missingincludes
%patch5 -p0 -b .luafix
%patch6 -p0 -b .compileopts
+%patch7 -p0 -b .nopi
chmod a-x COPYING AUTHORS
chmod a-x */*.h
chmod a-x */*.cpp
More information about the scm-commits
mailing list