From 330159d2558b83f8018db09a37b530bac54711c9 Mon Sep 17 00:00:00 2001 From: Bogdan Devichev Date: Wed, 15 Apr 2015 17:00:36 +0200 Subject: [PATCH] evas: fix indexation of grid (it neccessary for future tangent calculation) in Evas 3D examples Summary: New indexation for more easy calculation of tangents. Reviewers: Hermet, raster, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2332 Signed-off-by: Cedric BAIL --- src/examples/evas/evas-3d-primitives.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/examples/evas/evas-3d-primitives.c b/src/examples/evas/evas-3d-primitives.c index baee7a1a4a..f7370024b0 100644 --- a/src/examples/evas/evas-3d-primitives.c +++ b/src/examples/evas/evas-3d-primitives.c @@ -246,13 +246,13 @@ _generate_grid_indices(unsigned short *indices, int count) for (j = 0; j < count; j++) for (i = 0; i < count; i++) { - *index++ = (unsigned short)(i + vccount * j); - *index++ = i + vccount * (j + 1); - *index++ = i + 1 + vccount * (j + 1); + *index++ = (i * vccount) + j; + *index++ = (i * vccount) + j + 1; + *index++ = ((i + 1) * vccount) + j; - *index++ = i + vccount * j; - *index++ = i + 1 + vccount * j; - *index++ = i + vccount * (j + 1) + 1; + *index++ = ((i + 1) * vccount) + j; + *index++ = (i * vccount) + j + 1; + *index++ = ((i + 1) * vccount) + j + 1; } }