Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-06-26 00:52:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-26 00:52:33 +0400
commit8245bdca2b89b9af3ca42399a7e83dae76653040 (patch)
tree36c7df074abe6473cb3c58a0e2b8ecbf4903cc14 /source/blender/gpu
parent8574808b2d60305439bc2af9e3a6be6f34cd5375 (diff)
quiet double promotion warning and some style cleanup
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index fc28ec2d6f7..cfdbf87785e 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -937,13 +937,13 @@ void GPU_paint_set_mipmap(int mipmap)
static bool GPU_check_scaled_image(ImBuf *ibuf, Image *ima, float *frect, int x, int y, int w, int h)
{
if ((!GPU_non_power_of_two_support() && !is_power_of_2_resolution(ibuf->x, ibuf->y)) ||
- is_over_resolution_limit(ibuf->x, ibuf->y))
+ is_over_resolution_limit(ibuf->x, ibuf->y))
{
int x_limit = smaller_power_of_2_limit(ibuf->x);
int y_limit = smaller_power_of_2_limit(ibuf->y);
- float xratio = x_limit/(float)ibuf->x;
- float yratio = y_limit/(float)ibuf->y;
+ float xratio = x_limit / (float)ibuf->x;
+ float yratio = y_limit / (float)ibuf->y;
/* find new width, height and x,y gpu texture coordinates */
@@ -965,27 +965,27 @@ static bool GPU_check_scaled_image(ImBuf *ibuf, Image *ima, float *frect, int x,
glBindTexture(GL_TEXTURE_2D, ima->bindcode);
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, rectw, recth, GL_RGBA,
- GL_FLOAT, fscalerect);
+ GL_FLOAT, fscalerect);
MEM_freeN(fscalerect);
}
/* byte images are not continuous in memory so do manual interpolation */
else {
- unsigned char *scalerect= MEM_mallocN(rectw*recth*sizeof(*scalerect)*4, "scalerect");
+ unsigned char *scalerect = MEM_mallocN(rectw * recth * sizeof(*scalerect) * 4, "scalerect");
unsigned int *p = (unsigned int *)scalerect;
int i, j;
- float inv_xratio = 1.0/xratio;
- float inv_yratio = 1.0/yratio;
+ float inv_xratio = 1.0f / xratio;
+ float inv_yratio = 1.0f / yratio;
for (i = 0; i < rectw; i++) {
- float u = (x + i)*inv_xratio;
+ float u = (x + i) * inv_xratio;
for (j = 0; j < recth; j++) {
- float v = (y + j)*inv_yratio;
+ float v = (y + j) * inv_yratio;
bilinear_interpolation_color_wrap(ibuf, (unsigned char *)(p + i + j * (rectw)), NULL, u, v);
}
}
glBindTexture(GL_TEXTURE_2D, ima->bindcode);
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, rectw, recth, GL_RGBA,
- GL_UNSIGNED_BYTE, scalerect);
+ GL_UNSIGNED_BYTE, scalerect);
MEM_freeN(scalerect);
}