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:
Diffstat (limited to 'source/blender/editors/screen/glutil.c')
-rw-r--r--source/blender/editors/screen/glutil.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 74e0bc3852e..e0849bae51f 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -419,7 +419,7 @@ static int get_cached_work_texture(int *w_r, int *h_r)
return texid;
}
-void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void *rect)
+void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, void *rect, float scaleX, float scaleY)
{
unsigned char *uc_rect= (unsigned char*) rect;
float *f_rect= (float *)rect;
@@ -460,13 +460,13 @@ void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void *
glVertex2f(rast_x, rast_y);
glTexCoord2f((float) (subpart_w-1)/tex_w, 0);
- glVertex2f(rast_x+subpart_w*xzoom, rast_y);
+ glVertex2f(rast_x+subpart_w*xzoom*scaleX, rast_y);
glTexCoord2f((float) (subpart_w-1)/tex_w, (float) (subpart_h-1)/tex_h);
- glVertex2f(rast_x+subpart_w*xzoom, rast_y+subpart_h*yzoom);
+ glVertex2f(rast_x+subpart_w*xzoom*scaleX, rast_y+subpart_h*yzoom*scaleY);
glTexCoord2f(0, (float) (subpart_h-1)/tex_h);
- glVertex2f(rast_x, rast_y+subpart_h*yzoom);
+ glVertex2f(rast_x, rast_y+subpart_h*yzoom*scaleY);
glEnd();
glDisable(GL_TEXTURE_2D);
}
@@ -477,6 +477,11 @@ void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void *
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
+void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void *rect)
+{
+ glaDrawPixelsTexScaled(x, y, img_w, img_h, format, rect, 1.0f, 1.0f);
+}
+
void glaDrawPixelsSafe_to32(float fx, float fy, int img_w, int img_h, int row_w, float *rectf)
{
float *rf;