summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@Simons-Mac-Pro.local>2012-04-26 12:10:47 (GMT)
committer Simon Robertshaw <simon@Simons-Mac-Pro.local>2012-04-26 12:10:47 (GMT)
commitbb8a3f76e3b558a63eab38ab15ebb71f9b5ac762 (patch)
treeff63bd38df84018dc9843e5a5d26f5795b657735 /src/elements
parent9e4cd165eb66b27a42f8eb3aad1993be5178d825 (diff)
downloadpowder-bb8a3f76e3b558a63eab38ab15ebb71f9b5ac762.zip
powder-bb8a3f76e3b558a63eab38ab15ebb71f9b5ac762.tar.gz
OS X compiling working, Make it a bit more friendly with stricter compilers
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/bomb.cpp4
-rw-r--r--src/elements/figh.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/elements/bomb.cpp b/src/elements/bomb.cpp
index 3b6db26..99eb7f0 100644
--- a/src/elements/bomb.cpp
+++ b/src/elements/bomb.cpp
@@ -31,7 +31,7 @@ int update_BOMB(UPDATE_FUNC_ARGS) {
pmap[y][x] = 0;
for (nxj=-(rad+1); nxj<=(rad+1); nxj++)
for (nxi=-(rad+1); nxi<=(rad+1); nxi++)
- if ((pow(nxi,2))/(pow((rad+1),2))+(pow(nxj,2))/(pow((rad+1),2))<=1) {
+ if ((pow((float)nxi,2))/(pow((float)(rad+1),2))+(pow((float)nxj,2))/(pow((float)(rad+1),2))<=1) {
nb = sim->create_part(-1, x+nxi, y+nxj, PT_BOMB);
if (nb!=-1) {
parts[nb].tmp = 1;
@@ -43,7 +43,7 @@ int update_BOMB(UPDATE_FUNC_ARGS) {
}
for (nxj=-rad; nxj<=rad; nxj++)
for (nxi=-rad; nxi<=rad; nxi++)
- if ((pow(nxi,2))/(pow(rad,2))+(pow(nxj,2))/(pow(rad,2))<=1)
+ if ((pow((float)nxi,2))/(pow((float)rad,2))+(pow((float)nxj,2))/(pow((float)rad,2))<=1)
if ((pmap[y+nxj][x+nxi]&0xFF)!=PT_DMND && (pmap[y+nxj][x+nxi]&0xFF)!=PT_CLNE && (pmap[y+nxj][x+nxi]&0xFF)!=PT_PCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_BCLN) {
sim->delete_part(x+nxi, y+nxj, 0);//it SHOULD kill anything but the exceptions above, doesn't seem to always work
sim->pv[(y+nxj)/CELL][(x+nxi)/CELL] += 0.1f;
diff --git a/src/elements/figh.cpp b/src/elements/figh.cpp
index 6a8bb4e..6b67a27 100644
--- a/src/elements/figh.cpp
+++ b/src/elements/figh.cpp
@@ -11,8 +11,8 @@ int update_FIGH(UPDATE_FUNC_ARGS)
//Set target cords
if (sim->player.spwn && sim->player2.spwn)
{
- if ((pow(sim->player.legs[2]-x, 2) + pow(sim->player.legs[3]-y, 2))<=
- (pow(sim->player2.legs[2]-x, 2) + pow(sim->player2.legs[3]-y, 2)))
+ if ((pow((float)sim->player.legs[2]-x, 2) + pow((float)sim->player.legs[3]-y, 2))<=
+ (pow((float)sim->player2.legs[2]-x, 2) + pow((float)sim->player2.legs[3]-y, 2)))
{
tarx = (unsigned int)sim->player.legs[2];
tary = (unsigned int)sim->player.legs[3];
@@ -43,7 +43,7 @@ int update_FIGH(UPDATE_FUNC_ARGS)
switch (parts[i].tmp2)
{
case 1:
- if ((pow(tarx-x, 2) + pow(tary-y, 2))<600)
+ if ((pow(float(tarx-x), 2) + pow(float(tary-y), 2))<600)
{
if (figh->elem == PT_LIGH || figh->elem == PT_NEUT
|| sim->ptypes[figh->elem].properties&(PROP_DEADLY|PROP_RADIOACTIVE)