aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he
diff options
context:
space:
mode:
authormd52011-03-19 02:33:09 +0200
committermd52011-03-19 02:33:09 +0200
commitd602a420b622ce77c4a7e3782a4e7cad3a09e480 (patch)
treedbcb12d8f56872c23b9687a5a3af9db01290b120 /engines/scumm/he
parent8af0d35a5ff17e8e4f52401a0758cf6f04e0e17a (diff)
downloadscummvm-rg350-d602a420b622ce77c4a7e3782a4e7cad3a09e480.tar.gz
scummvm-rg350-d602a420b622ce77c4a7e3782a4e7cad3a09e480.tar.bz2
scummvm-rg350-d602a420b622ce77c4a7e3782a4e7cad3a09e480.zip
SCUMM: Changed usage of PI to M_PI (normally defined in math.h)
Diffstat (limited to 'engines/scumm/he')
-rw-r--r--engines/scumm/he/logic_he.cpp6
-rw-r--r--engines/scumm/he/script_v90he.cpp12
-rw-r--r--engines/scumm/he/wiz_he.cpp2
3 files changed, 10 insertions, 10 deletions
diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp
index ed92c33105..c088fd6e22 100644
--- a/engines/scumm/he/logic_he.cpp
+++ b/engines/scumm/he/logic_he.cpp
@@ -160,8 +160,8 @@ int32 LogicHErace::dispatch(int op, int numArgs, int32 *args) {
return res;
}
-#define RAD2DEG (180 / PI)
-#define DEG2RAD (PI / 180)
+#define RAD2DEG (180 / M_PI)
+#define DEG2RAD (M_PI / 180)
int32 LogicHErace::op_1003(int32 *args) {
int value = args[2] ? args[2] : 1;
@@ -457,7 +457,7 @@ void LogicHEfunshop::op_1004(int32 *args) {
sq = sqrt(data[i + 1] * data[i + 1] + data[i] * data[i]);
if (at <= 0)
- at += 2 * PI;
+ at += 2 * M_PI;
data[i] = cos(at + a1) * sq;
data[i + 1] = sin(at + a1) * sq;
diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp
index 841eba960d..1a38a99f17 100644
--- a/engines/scumm/he/script_v90he.cpp
+++ b/engines/scumm/he/script_v90he.cpp
@@ -351,12 +351,12 @@ void ScummEngine_v90he::o90_max() {
}
void ScummEngine_v90he::o90_sin() {
- double a = pop() * PI / 180.;
+ double a = pop() * M_PI / 180.;
push((int)(sin(a) * 100000));
}
void ScummEngine_v90he::o90_cos() {
- double a = pop() * PI / 180.;
+ double a = pop() * M_PI / 180.;
push((int)(cos(a) * 100000));
}
@@ -372,7 +372,7 @@ void ScummEngine_v90he::o90_sqrt() {
void ScummEngine_v90he::o90_atan2() {
int y = pop();
int x = pop();
- int a = (int)(atan2((double)y, (double)x) * 180. / PI);
+ int a = (int)(atan2((double)y, (double)x) * 180. / M_PI);
if (a < 0) {
a += 360;
}
@@ -384,7 +384,7 @@ void ScummEngine_v90he::o90_getSegmentAngle() {
int x1 = pop();
int dy = y1 - pop();
int dx = x1 - pop();
- int a = (int)(atan2((double)dy, (double)dx) * 180. / PI);
+ int a = (int)(atan2((double)dy, (double)dx) * 180. / M_PI);
if (a < 0) {
a += 360;
}
@@ -2292,13 +2292,13 @@ void ScummEngine_v90he::o90_kernelGetFunctions() {
switch (args[0]) {
case 1001:
{
- double b = args[1] * PI / 180.;
+ double b = args[1] * M_PI / 180.;
push((int)(sin(b) * 100000));
}
break;
case 1002:
{
- double b = args[1] * PI / 180.;
+ double b = args[1] * M_PI / 180.;
push((int)(cos(b) * 100000));
}
break;
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index c7e6a56083..3d1aa5b048 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -111,7 +111,7 @@ void Wiz::polygonStore(int id, bool flag, int vert1x, int vert1y, int vert2x, in
}
void Wiz::polygonRotatePoints(Common::Point *pts, int num, int angle) {
- double alpha = angle * PI / 180.;
+ double alpha = angle * M_PI / 180.;
double cos_alpha = cos(alpha);
double sin_alpha = sin(alpha);