forked from bartvdbraak/blender
style cleanup
This commit is contained in:
parent
bf4be941fc
commit
e903701450
@ -49,7 +49,6 @@ char *BLI_str_prev_char_utf8(const char *p);
|
|||||||
|
|
||||||
/* wchar_t functions, copied from blenders own font.c originally */
|
/* wchar_t functions, copied from blenders own font.c originally */
|
||||||
size_t BLI_wstrlen_utf8(const wchar_t *src);
|
size_t BLI_wstrlen_utf8(const wchar_t *src);
|
||||||
size_t BLI_strlen_utf8_char(const char *strc);
|
|
||||||
size_t BLI_strlen_utf8(const char *strc);
|
size_t BLI_strlen_utf8(const char *strc);
|
||||||
size_t BLI_strlen_range_utf8(const char *start, const char *end);
|
size_t BLI_strlen_range_utf8(const char *start, const char *end);
|
||||||
size_t BLI_strncpy_wchar_as_utf8(char *__restrict dst, const wchar_t *__restrict src, const size_t maxcpy);
|
size_t BLI_strncpy_wchar_as_utf8(char *__restrict dst, const wchar_t *__restrict src, const size_t maxcpy);
|
||||||
|
@ -231,8 +231,9 @@ size_t BLI_wstrlen_utf8(const wchar_t *src)
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* this is very close to 'BLI_str_utf8_size' functionality, perhaps we should de-duplicate */
|
||||||
/* size of UTF-8 character in bytes */
|
/* size of UTF-8 character in bytes */
|
||||||
size_t BLI_strlen_utf8_char(const char *strc)
|
static size_t strlen_utf8_char(const char *strc)
|
||||||
{
|
{
|
||||||
if ((*strc & 0xe0) == 0xc0) {
|
if ((*strc & 0xe0) == 0xc0) {
|
||||||
if ((strc[1] & 0x80) && (strc[1] & 0x40) == 0x00)
|
if ((strc[1] & 0x80) && (strc[1] & 0x40) == 0x00)
|
||||||
@ -255,7 +256,7 @@ size_t BLI_strlen_utf8(const char *strc)
|
|||||||
int len;
|
int len;
|
||||||
|
|
||||||
for (len = 0; *strc; len++)
|
for (len = 0; *strc; len++)
|
||||||
strc += BLI_strlen_utf8_char(strc);
|
strc += strlen_utf8_char(strc);
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
@ -266,7 +267,7 @@ size_t BLI_strlen_range_utf8(const char *start, const char *end)
|
|||||||
int len;
|
int len;
|
||||||
|
|
||||||
for (len = 0; strc < end; len++)
|
for (len = 0; strc < end; len++)
|
||||||
strc += BLI_strlen_utf8_char(strc);
|
strc += strlen_utf8_char(strc);
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,7 @@ typedef struct SunSky {
|
|||||||
|
|
||||||
float perez_Y[5], perez_x[5], perez_y[5];
|
float perez_Y[5], perez_x[5], perez_y[5];
|
||||||
|
|
||||||
/* suggested by glome in
|
/* suggested by glome in patch [#8063] */
|
||||||
* http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9*/
|
|
||||||
float horizon_brightness;
|
float horizon_brightness;
|
||||||
float spread;
|
float spread;
|
||||||
float sun_brightness;
|
float sun_brightness;
|
||||||
|
@ -217,8 +217,7 @@ void InitSunSky(struct SunSky *sunsky, float turb, const float toSun[3], float h
|
|||||||
sunsky->perez_y[3] = -0.04405f * T - 1.65369f;
|
sunsky->perez_y[3] = -0.04405f * T - 1.65369f;
|
||||||
sunsky->perez_y[4] = -0.01092f * T + 0.05291f;
|
sunsky->perez_y[4] = -0.01092f * T + 0.05291f;
|
||||||
|
|
||||||
/* suggested by glome in
|
/* suggested by glome in patch [#8063] */
|
||||||
* http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9*/
|
|
||||||
sunsky->perez_Y[0] *= sunsky->horizon_brightness;
|
sunsky->perez_Y[0] *= sunsky->horizon_brightness;
|
||||||
sunsky->perez_x[0] *= sunsky->horizon_brightness;
|
sunsky->perez_x[0] *= sunsky->horizon_brightness;
|
||||||
sunsky->perez_y[0] *= sunsky->horizon_brightness;
|
sunsky->perez_y[0] *= sunsky->horizon_brightness;
|
||||||
|
Loading…
Reference in New Issue
Block a user