diff options
Diffstat (limited to 'source/blender/render/intern/multires_bake.c')
-rw-r--r-- | source/blender/render/intern/multires_bake.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/render/intern/multires_bake.c b/source/blender/render/intern/multires_bake.c index 79eddd20bdf..f701d9a987a 100644 --- a/source/blender/render/intern/multires_bake.c +++ b/source/blender/render/intern/multires_bake.c @@ -996,7 +996,7 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm, rrgbf[3] = 1.0f; } else { - unsigned char *rrgb = (unsigned char *)ibuf->rect + pixel * 4; + uchar *rrgb = (uchar *)ibuf->rect + pixel * 4; rgb_float_to_uchar(rrgb, vec); rrgb[3] = 255; } @@ -1009,8 +1009,8 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm, /* Must be a power of two. */ # define MAX_NUMBER_OF_AO_RAYS 1024 -static unsigned short ao_random_table_1[MAX_NUMBER_OF_AO_RAYS]; -static unsigned short ao_random_table_2[MAX_NUMBER_OF_AO_RAYS]; +static ushort ao_random_table_1[MAX_NUMBER_OF_AO_RAYS]; +static ushort ao_random_table_2[MAX_NUMBER_OF_AO_RAYS]; static void init_ao_random(void) { @@ -1022,18 +1022,18 @@ static void init_ao_random(void) } } -static unsigned short get_ao_random1(const int i) +static ushort get_ao_random1(const int i) { return ao_random_table_1[i & (MAX_NUMBER_OF_AO_RAYS - 1)]; } -static unsigned short get_ao_random2(const int i) +static ushort get_ao_random2(const int i) { return ao_random_table_2[i & (MAX_NUMBER_OF_AO_RAYS - 1)]; } -static void build_permutation_table(unsigned short permutation[], - unsigned short temp_permutation[], +static void build_permutation_table(ushort permutation[], + ushort temp_permutation[], const int number_of_rays, const int is_first_perm_table) { @@ -1044,9 +1044,9 @@ static void build_permutation_table(unsigned short permutation[], } for (i = 0; i < number_of_rays; i++) { - const unsigned int nr_entries_left = number_of_rays - i; - unsigned short rnd = is_first_perm_table != false ? get_ao_random1(i) : get_ao_random2(i); - const unsigned short entry = rnd % nr_entries_left; + const uint nr_entries_left = number_of_rays - i; + ushort rnd = is_first_perm_table != false ? get_ao_random1(i) : get_ao_random2(i); + const ushort entry = rnd % nr_entries_left; /* pull entry */ permutation[i] = temp_permutation[entry]; @@ -1116,7 +1116,7 @@ static void *init_ao_data(MultiresBakeRender *bkr, ImBuf *UNUSED(ibuf)) { MAOBakeData *ao_data; DerivedMesh *lodm = bkr->lores_dm; - unsigned short *temp_permutation_table; + ushort *temp_permutation_table; size_t permutation_size; init_ao_random(); @@ -1131,7 +1131,7 @@ static void *init_ao_data(MultiresBakeRender *bkr, ImBuf *UNUSED(ibuf)) create_ao_raytree(bkr, ao_data); /* initialize permutation tables */ - permutation_size = sizeof(unsigned short) * bkr->number_of_rays; + permutation_size = sizeof(ushort) * bkr->number_of_rays; ao_data->permutation_table_1 = MEM_callocN(permutation_size, "multires AO baker perm1"); ao_data->permutation_table_2 = MEM_callocN(permutation_size, "multires AO baker perm2"); temp_permutation_table = MEM_callocN(permutation_size, "multires AO baker temp perm"); @@ -1273,9 +1273,9 @@ static void apply_ao_callback(DerivedMesh *lores_dm, /* use N-Rooks to distribute our N ray samples across * a multi-dimensional domain (2D) */ - const unsigned short I = + const ushort I = ao_data->permutation_table_1[(i + perm_ofs) % ao_data->number_of_rays]; - const unsigned short J = ao_data->permutation_table_2[i]; + const ushort J = ao_data->permutation_table_2[i]; const float JitPh = (get_ao_random2(I + perm_ofs) & (MAX_NUMBER_OF_AO_RAYS - 1)) / ((float)MAX_NUMBER_OF_AO_RAYS); @@ -1317,7 +1317,7 @@ static void apply_ao_callback(DerivedMesh *lores_dm, rrgbf[3] = 1.0f; } else { - unsigned char *rrgb = (unsigned char *)ibuf->rect + pixel * 4; + uchar *rrgb = (uchar *)ibuf->rect + pixel * 4; rrgb[0] = rrgb[1] = rrgb[2] = unit_float_to_uchar_clamp(value); rrgb[3] = 255; } @@ -1393,7 +1393,7 @@ static void bake_ibuf_normalize_displacement(ImBuf *ibuf, } if (ibuf->rect) { - unsigned char *cp = (unsigned char *)(ibuf->rect + i); + uchar *cp = (uchar *)(ibuf->rect + i); cp[0] = cp[1] = cp[2] = unit_float_to_uchar_clamp(normalized_displacement); cp[3] = 255; } |