examples/sphere_hunter: fix another instance of floating point incorrectness

I missed this one yesterday. Also change it to use floating point values
instead of casting which does not make much sense for hard-coded values.

CID: 1327343
This commit is contained in:
Stefan Schmidt 2015-10-21 10:26:00 +02:00
parent d1fd0e34a4
commit 3a334ecd4d
1 changed files with 2 additions and 2 deletions

View File

@ -404,7 +404,7 @@ _key_down(void *data,
if (camera_y > 26.5)
{
camera_y -= 0.5;
camera_z -= 0.5 * (7 / 4);
camera_z -= 0.5 * (7.0 / 4.0);
}
}
if (!strcmp(ev->key, "Down"))
@ -412,7 +412,7 @@ _key_down(void *data,
if (camera_y < 100.0)
{
camera_y += 0.5;
camera_z += 0.5 * (7 / (double)4);
camera_z += 0.5 * (7.0 / 4.0);
}
}
if (!strcmp(ev->key, "n"))