From 50413abfc9a6e2ba14313bd7aee5ea2f2e1b6135 Mon Sep 17 00:00:00 2001 From: Bruno Dilly Date: Thu, 16 Aug 2012 21:34:49 +0000 Subject: [PATCH] EPhysics: drop camera zoom Reasons: - we don't have previewed cases for that (would be code to be implemented and maintained without use) - can be done on user side changing world rate, camera position, objects size SVN revision: 75329 --- legacy/ephysics/src/lib/EPhysics.h | 54 ++------------------- legacy/ephysics/src/lib/ephysics_camera.cpp | 32 ------------ 2 files changed, 4 insertions(+), 82 deletions(-) diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h index d4fc80cbec..c3d0571d2a 100644 --- a/legacy/ephysics/src/lib/EPhysics.h +++ b/legacy/ephysics/src/lib/EPhysics.h @@ -303,13 +303,12 @@ typedef struct _EPhysics_Body EPhysics_Body; * * Every world has a camera, that can be get with * @ref ephysics_world_camera_get(). - * Its position can be set with @ref ephysics_camera_position_set() and zoom - * in / zoom out can be done with @ref ephysics_camera_zoom_set(). + * Its position can be set with @ref ephysics_camera_position_set() or + * can be set to track a body, with @ref ephysics_camera_body_track(); * - * @note WIP: ZOOM API ISN'T WORKING YET!! */ -typedef struct _EPhysics_Camera EPhysics_Camera; /**< Camera handle, used to zoom in / out a scene, or change the frame position to be rendered. Every world have a camera that can be get with @ref ephysics_world_camera_get(). */ +typedef struct _EPhysics_Camera EPhysics_Camera; /**< Camera handle, used to change the position of the frame to be rendered. Every world have a camera that can be get with @ref ephysics_world_camera_get(). */ /** * @brief @@ -415,51 +414,6 @@ EAPI void ephysics_camera_body_track(EPhysics_Camera *camera, EPhysics_Body *bod */ EAPI void ephysics_camera_tracked_body_get(EPhysics_Camera *camera, EPhysics_Body **body, Eina_Bool *horizontal, Eina_Bool *vertical); -/** - * @brief - * Set camera's zoom. - * - * Zoom affects size and position of evas objects automatically updated - * by ephysics. With zoom equal to 1, the original size of evas objects is - * used and their position on canvas depends only on world rate and - * camera's position. - * - * When zoom is smaller than 1, evas objects will be scaled down, and position - * will take world rate, camera's position and zoom in account. More objects - * could fit on the screen with small zoom values. - * - * If zoom is bigger than 1, evas objects will be scaled up, and position - * will take world rate, camera's position and zoom in account. Less objects - * will fit on the screen with big zoom values. It's nice for close-up - * effects. - * - * By default zoom value is 1. - * - * @note This change will be noticed on the next physics tick, so evas objects - * will be updated taking the camera's new zoom in account. - * - * @param camera The camera to be zoomed in / out. - * @param zoom The new zoom value. Must to be bigger than 0. - * - * @see ephysics_camera_zoom_get(). - * - * @ingroup EPhysics_Camera - */ -EAPI void ephysics_camera_zoom_set(EPhysics_Camera *camera, double zoom); - -/** - * @brief - * Get camera's zoom. - * - * @param camera The world's camera. - * @return The zoom value or -1 on error. - * - * @see ephysics_camera_zoom_set() for more details. - * - * @ingroup EPhysics_Camera - */ -EAPI double ephysics_camera_zoom_get(const EPhysics_Camera *camera); - /** * @} */ @@ -864,7 +818,7 @@ EAPI Eina_List *ephysics_world_bodies_get(const EPhysics_World *world); * @return The camera. * * @see ephysics_camera_position_set(). - * @see ephysics_camera_zoom_set(). + * @see ephysics_camera_body_track(). * * @ingroup EPhysics_World */ diff --git a/legacy/ephysics/src/lib/ephysics_camera.cpp b/legacy/ephysics/src/lib/ephysics_camera.cpp index 120688603d..72cc2e02f3 100644 --- a/legacy/ephysics/src/lib/ephysics_camera.cpp +++ b/legacy/ephysics/src/lib/ephysics_camera.cpp @@ -13,7 +13,6 @@ extern "C" { struct _EPhysics_Camera { EPhysics_World *world; EPhysics_Body *target; - double zoom; int x, y; Eina_Bool track_horizontal:1; Eina_Bool track_vertical:1; @@ -202,37 +201,6 @@ ephysics_camera_tracked_body_get(EPhysics_Camera *camera, EPhysics_Body **body, if (vertical) *vertical = camera->track_vertical; } -EAPI void -ephysics_camera_zoom_set(EPhysics_Camera *camera, double zoom) -{ - if (!camera) - { - ERR("Can't set camera zoom, camera == NULL."); - return; - } - - if (zoom <= 0) - { - ERR("Zoom should be a positive value. Keeping the old value: %lf.", - camera->zoom); - return; - } - - camera->zoom = zoom; -} - -EAPI double -ephysics_camera_zoom_get(const EPhysics_Camera *camera) -{ - if (!camera) - { - ERR("Can't get camera zoom, camera == NULL."); - return -1; - } - - return camera->zoom; -} - #ifdef __cplusplus } #endif