diff options
author | dhewg | 2011-03-19 11:24:06 +0100 |
---|---|---|
committer | dhewg | 2011-03-19 11:24:06 +0100 |
commit | 2def212de75b3885738c4db188f0a42b712bd48f (patch) | |
tree | 03657dca73b120b0e80c73346dac1e47ec543d6a /engines | |
parent | a4c05b1632940b3f2003055e0c64970b4b053f32 (diff) | |
download | scummvm-rg350-2def212de75b3885738c4db188f0a42b712bd48f.tar.gz scummvm-rg350-2def212de75b3885738c4db188f0a42b712bd48f.tar.bz2 scummvm-rg350-2def212de75b3885738c4db188f0a42b712bd48f.zip |
ALL: s/PI/M_PI/
Tip of the day: git grep -w PI
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kmovement.cpp | 4 | ||||
-rw-r--r-- | engines/sword25/util/lua/lmathlib.cpp | 9 |
2 files changed, 4 insertions, 9 deletions
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp index 49d2900835..f93a6716b9 100644 --- a/engines/sci/engine/kmovement.cpp +++ b/engines/sci/engine/kmovement.cpp @@ -569,8 +569,8 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { debugC(kDebugLevelBresen, " avoider %04x:%04x", PRINT_REG(avoider)); for (moves = 0; moves < 8; moves++) { - int move_x = (int)(sin(angle * PI / 180.0) * (xstep)); - int move_y = (int)(-cos(angle * PI / 180.0) * (ystep)); + int move_x = (int)(sin(angle * M_PI / 180.0) * (xstep)); + int move_y = (int)(-cos(angle * M_PI / 180.0) * (ystep)); writeSelectorValue(segMan, client, SELECTOR(x), oldx + move_x); writeSelectorValue(segMan, client, SELECTOR(y), oldy + move_y); diff --git a/engines/sword25/util/lua/lmathlib.cpp b/engines/sword25/util/lua/lmathlib.cpp index ed50539f1f..bb9c6ed442 100644 --- a/engines/sword25/util/lua/lmathlib.cpp +++ b/engines/sword25/util/lua/lmathlib.cpp @@ -16,12 +16,7 @@ #include "lauxlib.h" #include "lualib.h" - -#undef PI -#define PI (3.14159265358979323846) -#define RADIANS_PER_DEGREE (PI/180.0) - - +#define RADIANS_PER_DEGREE (M_PI/180.0) static int math_abs (lua_State *L) { lua_pushnumber(L, fabs(luaL_checknumber(L, 1))); @@ -250,7 +245,7 @@ static const luaL_Reg mathlib[] = { */ LUALIB_API int luaopen_math (lua_State *L) { luaL_register(L, LUA_MATHLIBNAME, mathlib); - lua_pushnumber(L, PI); + lua_pushnumber(L, M_PI); lua_setfield(L, -2, "pi"); #if defined(MACOSX) && defined(__GNUC__) && ! defined( __XLC__ ) // WORKAROUND for a bug in the Mac OS X 10.2.8 SDK. It defines |