Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3c745da authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 24057 into eclair

* changes:
  checkpoint
parents 3194a663 7adb985e
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -210,26 +210,27 @@ void generateRipples() {
        int x = 0;
        int yOffset = y * width;
        for ( ; x < width; x += 1) {
            int o = ((yOffset + x) << 3);
            int o1 = o + 8 + 5;
            int ow = o + w8 + 5;
            int ow1 = ow + 8;
            struct vert_s *v = (struct vec3_s *)(vertices + x);
            //int o = ((yOffset + x) << 3);
            //int o1 = o + 8 + 5;
            //int ow = o + w8 + 5;
            //int ow1 = ow + 8;

            struct vec3_s n1, n2, n3;
            vec3Sub(&n1, (struct vec3_s *)(vertices + o1 + 5), (struct vec3_s *)(vertices + o + 5));
            vec3Sub(&n2, (struct vec3_s *)(vertices + ow + 5), (struct vec3_s *)(vertices + o + 5));
            vec3Sub(&n1, (struct vec3_s *)&(v+1)->x, (struct vec3_s *)&v->x);
            vec3Sub(&n2, (struct vec3_s *)&(v+width)->x, (struct vec3_s *)&v->x);
            vec3Cross(&n3, &n1, &n2);
            vec3Norm(&n3);

            // Average of previous normal and N1 x N2
            vec3Sub(&n1, (struct vec3_s *)(vertices + ow1 + 5), (struct vec3_s *)(vertices + o + 5));
            vec3Sub(&n1, (struct vec3_s *)&(v+width+1)->x, (struct vec3_s *)&v->x);
            vec3Cross(&n2, &n1, &n2);
            vec3Add(&n3, &n3, &n2);
            vec3Norm(&n3);

            vertices[o + 0] = n3.x;
            vertices[o + 1] = n3.y;
            vertices[o + 2] = -n3.z;
            v->nx = n3.x;
            v->ny = n3.y;
            v->nz = -n3.z;

            // reset Z
            //vertices[(yOffset + x) << 3 + 7] = 0.0f;