Pre-increment is said to be faster in many situations
This commit is contained in:
parent
d253877e5d
commit
14e77a54c9
|
@ -253,8 +253,8 @@ inline byte *compute_surface(t_interpol *vector, gint32 width, gint32 height)
|
||||||
guint32 color;
|
guint32 color;
|
||||||
byte *ptr_swap;
|
byte *ptr_swap;
|
||||||
|
|
||||||
for (j = 0; j < height; j++)
|
for (j = 0; j < height; ++j)
|
||||||
for (i = 0; i < width; i++) {
|
for (i = 0; i < width; ++i) {
|
||||||
interpol = &vector[add_dest];
|
interpol = &vector[add_dest];
|
||||||
add_src = (interpol->coord & 0xFFFF) * width + (interpol->coord >> 16);
|
add_src = (interpol->coord & 0xFFFF) * width + (interpol->coord >> 16);
|
||||||
ptr_pix = &((byte *)surface1)[add_src];
|
ptr_pix = &((byte *)surface1)[add_src];
|
||||||
|
@ -266,7 +266,7 @@ inline byte *compute_surface(t_interpol *vector, gint32 width, gint32 height)
|
||||||
surface2[add_dest] = (byte)255;
|
surface2[add_dest] = (byte)255;
|
||||||
else
|
else
|
||||||
surface2[add_dest] = (byte)color;
|
surface2[add_dest] = (byte)color;
|
||||||
add_dest++;
|
++add_dest;
|
||||||
}
|
}
|
||||||
ptr_swap = surface2;
|
ptr_swap = surface2;
|
||||||
surface2 = surface1;
|
surface2 = surface1;
|
||||||
|
@ -288,8 +288,8 @@ inline byte *compute_surface_mmx(t_interpol *vector, gint32 width, gint32 height
|
||||||
register byte *ptr_pix;
|
register byte *ptr_pix;
|
||||||
byte *ptr_swap;
|
byte *ptr_swap;
|
||||||
|
|
||||||
for (j = 0; j < height; j++)
|
for (j = 0; j < height; ++j)
|
||||||
for (i = 0; i < width; i++) {
|
for (i = 0; i < width; ++i) {
|
||||||
interpol = &vector[add_dest];
|
interpol = &vector[add_dest];
|
||||||
add_src = (interpol->coord & 0xFFFF) * width + (interpol->coord >> 16);
|
add_src = (interpol->coord & 0xFFFF) * width + (interpol->coord >> 16);
|
||||||
ptr_pix = &((byte *)surface1)[add_src];
|
ptr_pix = &((byte *)surface1)[add_src];
|
||||||
|
@ -311,7 +311,7 @@ inline byte *compute_surface_mmx(t_interpol *vector, gint32 width, gint32 height
|
||||||
surface2[add_dest] = 255;
|
surface2[add_dest] = 255;
|
||||||
else
|
else
|
||||||
surface2[add_dest] = (byte)color;
|
surface2[add_dest] = (byte)color;
|
||||||
add_dest++;
|
++add_dest;
|
||||||
}
|
}
|
||||||
ptr_swap = surface1;
|
ptr_swap = surface1;
|
||||||
surface1 = surface2;
|
surface1 = surface2;
|
||||||
|
|
Loading…
Reference in New Issue