diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-25 20:30:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-25 20:30:53 +0400 |
commit | 7fba5779ede5d96fa6a9db0d7d529022be692d09 (patch) | |
tree | 45b75496b14941aaf75facdd72ce77d9a6ad7a5c /source | |
parent | f83ea3fa85ed79f85bdf5eda9a35b886a2d9159c (diff) |
match function names for clip/image spaces
Diffstat (limited to 'source')
19 files changed, 113 insertions, 85 deletions
diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index c07d6e699a8..b31d52a6644 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -50,17 +50,17 @@ struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **lock void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock); int ED_space_image_has_buffer(struct SpaceImage *sima); -void ED_space_image_size(struct SpaceImage *sima, int *width, int *height); -void ED_space_image_aspect(struct SpaceImage *sima, float *aspx, float *aspy); -void ED_space_image_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy); -void ED_space_image_uv_aspect(struct SpaceImage *sima, float *aspx, float *aspy); +void ED_space_image_get_size(struct SpaceImage *sima, int *width, int *height); +void ED_space_image_get_aspect(struct SpaceImage *sima, float *aspx, float *aspy); +void ED_space_image_get_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy); +void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *aspx, float *aspy); void ED_space_image_paint_update(struct wmWindowManager *wm, struct ToolSettings *settings); void ED_space_image_uv_sculpt_update(struct wmWindowManager *wm, struct ToolSettings *settings); -void ED_image_size(struct Image *ima, int *width, int *height); -void ED_image_aspect(struct Image *ima, float *aspx, float *aspy); -void ED_image_uv_aspect(struct Image *ima, float *aspx, float *aspy); +void ED_image_get_size(struct Image *ima, int *width, int *height); +void ED_image_get_aspect(struct Image *ima, float *aspx, float *aspy); +void ED_image_get_uv_aspect(struct Image *ima, float *aspx, float *aspy); int ED_space_image_show_render(struct SpaceImage *sima); int ED_space_image_show_paint(struct SpaceImage *sima); diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index ca5de41c392..3af61b366b2 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -226,7 +226,7 @@ void ED_mask_size(const bContext *C, int *width, int *height) case SPACE_IMAGE: { SpaceImage *sima = sa->spacedata.first; - ED_space_image_size(sima, width, height); + ED_space_image_get_size(sima, width, height); break; } default: @@ -263,7 +263,7 @@ void ED_mask_aspect(const bContext *C, float *aspx, float *aspy) case SPACE_IMAGE: { SpaceImage *sima = sa->spacedata.first; - ED_space_image_uv_aspect(sima, aspx, aspy); + ED_space_image_get_uv_aspect(sima, aspx, aspy); break; } default: @@ -281,25 +281,53 @@ void ED_mask_aspect(const bContext *C, float *aspx, float *aspy) void ED_mask_pixelspace_factor(const bContext *C, float *scalex, float *scaley) { - SpaceClip *sc = CTX_wm_space_clip(C); + ScrArea *sa = CTX_wm_area(C); + if (sa && sa->spacedata.first) { + switch (sa->spacetype) { + case SPACE_CLIP: + { + SpaceClip *sc = sa->spacedata.first; + int width, height; + float zoomx, zoomy, aspx, aspy; - /* MASKTODO */ + ED_space_clip_get_size(C, &width, &height); + ED_space_clip_get_zoom(C, &zoomx, &zoomy); + ED_space_clip_get_aspect(sc, &aspx, &aspy); - if (sc) { - int width, height; - float zoomx, zoomy, aspx, aspy; + *scalex = ((float)width * aspx) * zoomx; + *scaley = ((float)height * aspy) * zoomy; + break; + } + case SPACE_SEQ: + { + *scalex = *scaley = 1.0f; /* MASKTODO? */ + break; + } + case SPACE_IMAGE: + { + SpaceImage *sima = sa->spacedata.first; + ARegion *ar = CTX_wm_region(C); + int width, height; + float zoomx, zoomy, aspx, aspy; - ED_space_clip_get_size(C, &width, &height); - ED_space_clip_get_zoom(C, &zoomx, &zoomy); - ED_space_clip_get_aspect(sc, &aspx, &aspy); + ED_space_image_get_size(sima, &width, &height); + ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy); + ED_space_image_get_uv_aspect(sima, &aspx, &aspy); - *scalex = ((float)width * aspx) * zoomx; - *scaley = ((float)height * aspy) * zoomy; + *scalex = ((float)width * aspx) * zoomx; + *scaley = ((float)height * aspy) * zoomy; + break; + } + default: + /* possible other spaces from which mask editing is available */ + BLI_assert(0); + *scalex = *scaley = 1.0f; + break; + } } else { - /* possible other spaces from which mask editing is available */ - *scalex = 1.0f; - *scaley = 1.0f; + BLI_assert(0); + *scalex = *scaley = 1.0f; } } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 91a41224d6a..2a497d599aa 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5201,7 +5201,7 @@ int get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy) SpaceImage *sima = CTX_wm_space_image(C); ARegion *ar = CTX_wm_region(C); - ED_space_image_zoom(sima, ar, zoomx, zoomy); + ED_space_image_get_zoom(sima, ar, zoomx, zoomy); return 1; } diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index 95441600d77..fdce8ec04a4 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -315,8 +315,8 @@ static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event, UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]); sima = CTX_wm_space_image(C); - ED_space_image_size(sima, &width, &height); - ED_space_image_zoom(sima, ar, &zoomx, &zoomy); + ED_space_image_get_size(sima, &width, &height); + ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy); radius = BKE_brush_size_get(scene, brush) / (width * zoomx); aspectRatio = width / (float)height; @@ -683,8 +683,8 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent radius = BKE_brush_size_get(scene, brush); sima = CTX_wm_space_image(C); - ED_space_image_size(sima, &width, &height); - ED_space_image_zoom(sima, ar, &zoomx, &zoomy); + ED_space_image_get_size(sima, &width, &height); + ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy); aspectRatio = width / (float)height; radius /= (width * zoomx); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index aaa2676c4c2..52ed7fd1d0b 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -710,7 +710,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) what_image(sima); if (sima->image) { - ED_image_aspect(sima->image, &xuser_asp, &yuser_asp); + ED_image_get_aspect(sima->image, &xuser_asp, &yuser_asp); /* UGLY hack? until now iusers worked fine... but for flipbook viewer we need this */ if (sima->image->type == IMA_TYPE_COMPOSITE) { @@ -727,7 +727,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) /* retrieve the image and information about it */ ima = ED_space_image(sima); - ED_space_image_zoom(sima, ar, &zoomx, &zoomy); + ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy); show_viewer = (ima && ima->source == IMA_SRC_VIEWER); show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT); diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index 8b9c9d76755..736b585864b 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -136,7 +136,7 @@ int ED_space_image_has_buffer(SpaceImage *sima) return has_buffer; } -void ED_image_size(Image *ima, int *width, int *height) +void ED_image_get_size(Image *ima, int *width, int *height) { ImBuf *ibuf = NULL; void *lock; @@ -157,7 +157,7 @@ void ED_image_size(Image *ima, int *width, int *height) BKE_image_release_ibuf(ima, lock); } -void ED_space_image_size(SpaceImage *sima, int *width, int *height) +void ED_space_image_get_size(SpaceImage *sima, int *width, int *height) { Scene *scene = sima->iuser.scene; ImBuf *ibuf; @@ -190,7 +190,7 @@ void ED_space_image_size(SpaceImage *sima, int *width, int *height) ED_space_image_release_buffer(sima, lock); } -void ED_image_aspect(Image *ima, float *aspx, float *aspy) +void ED_image_get_aspect(Image *ima, float *aspx, float *aspy) { *aspx = *aspy = 1.0; @@ -204,27 +204,27 @@ void ED_image_aspect(Image *ima, float *aspx, float *aspy) *aspy = ima->aspy / ima->aspx; } -void ED_space_image_aspect(SpaceImage *sima, float *aspx, float *aspy) +void ED_space_image_get_aspect(SpaceImage *sima, float *aspx, float *aspy) { - ED_image_aspect(ED_space_image(sima), aspx, aspy); + ED_image_get_aspect(ED_space_image(sima), aspx, aspy); } -void ED_space_image_zoom(SpaceImage *sima, ARegion *ar, float *zoomx, float *zoomy) +void ED_space_image_get_zoom(SpaceImage *sima, ARegion *ar, float *zoomx, float *zoomy) { int width, height; - ED_space_image_size(sima, &width, &height); + ED_space_image_get_size(sima, &width, &height); *zoomx = (float)(ar->winrct.xmax - ar->winrct.xmin + 1) / (float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin) * width); *zoomy = (float)(ar->winrct.ymax - ar->winrct.ymin + 1) / (float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin) * height); } -void ED_space_image_uv_aspect(SpaceImage *sima, float *aspx, float *aspy) +void ED_space_image_get_uv_aspect(SpaceImage *sima, float *aspx, float *aspy) { int w, h; - ED_space_image_aspect(sima, aspx, aspy); - ED_space_image_size(sima, &w, &h); + ED_space_image_get_aspect(sima, aspx, aspy); + ED_space_image_get_size(sima, &w, &h); *aspx *= (float)w; *aspy *= (float)h; @@ -239,12 +239,12 @@ void ED_space_image_uv_aspect(SpaceImage *sima, float *aspx, float *aspy) } } -void ED_image_uv_aspect(Image *ima, float *aspx, float *aspy) +void ED_image_get_uv_aspect(Image *ima, float *aspx, float *aspy) { int w, h; - ED_image_aspect(ima, aspx, aspy); - ED_image_size(ima, &w, &h); + ED_image_get_aspect(ima, aspx, aspy); + ED_image_get_size(ima, &w, &h); *aspx *= (float)w; *aspy *= (float)h; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 9dfaac76dab..c204d0dec31 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -91,7 +91,7 @@ static void sima_zoom_set(SpaceImage *sima, ARegion *ar, float zoom, float locat if (sima->zoom < 0.1f || sima->zoom > 4.0f) { /* check zoom limits */ - ED_space_image_size(sima, &width, &height); + ED_space_image_get_size(sima, &width, &height); width *= sima->zoom; height *= sima->zoom; @@ -107,8 +107,8 @@ static void sima_zoom_set(SpaceImage *sima, ARegion *ar, float zoom, float locat if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) { float aspx, aspy, w, h; - ED_space_image_size(sima, &width, &height); - ED_space_image_aspect(sima, &aspx, &aspy); + ED_space_image_get_size(sima, &width, &height); + ED_space_image_get_aspect(sima, &aspx, &aspy); w = width * aspx; h = height * aspy; @@ -564,8 +564,8 @@ static int image_view_all_exec(bContext *C, wmOperator *UNUSED(op)) sima = CTX_wm_space_image(C); ar = CTX_wm_region(C); - ED_space_image_size(sima, &width, &height); - ED_space_image_aspect(sima, &aspx, &aspy); + ED_space_image_get_size(sima, &width, &height); + ED_space_image_get_aspect(sima, &aspx, &aspy); w = width * aspx; h = height * aspy; @@ -621,8 +621,8 @@ static int image_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) obedit = CTX_data_edit_object(C); ima = ED_space_image(sima); - ED_space_image_size(sima, &width, &height); - ED_image_aspect(ima, &aspx, &aspy); + ED_space_image_get_size(sima, &width, &height); + ED_image_get_aspect(ima, &aspx, &aspy); width = width * aspx; height = height * aspy; diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 8760b5d551f..3c9c46c1c75 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -507,7 +507,7 @@ static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar) if (image_preview_active(curarea, &width, &height)) ; else #endif - ED_space_image_size(sima, &width, &height); + ED_space_image_get_size(sima, &width, &height); w = width; h = height; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index b2bb33f19ea..ceb10060826 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -147,7 +147,7 @@ void convertViewVec(TransInfo *t, float r_vec[3], int dx, int dy) /* MASKTODO - see clip clamp w/h */ - ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); + ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); r_vec[0] *= aspx; r_vec[1] *= aspy; } @@ -211,7 +211,7 @@ void projectIntView(TransInfo *t, const float vec[3], int adr[2]) else if (t->spacetype == SPACE_IMAGE) { float aspx, aspy, v[2]; - ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); + ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); v[0] = vec[0] / aspx; v[1] = vec[1] / aspy; @@ -306,13 +306,13 @@ void applyAspectRatio(TransInfo *t, float vec[2]) if ((sima->flag & SI_COORDFLOATS) == 0) { int width, height; - ED_space_image_size(sima, &width, &height); + ED_space_image_get_size(sima, &width, &height); vec[0] *= width; vec[1] *= height; } - ED_space_image_uv_aspect(sima, &aspx, &aspy); + ED_space_image_get_uv_aspect(sima, &aspx, &aspy); vec[0] /= aspx; vec[1] /= aspy; } @@ -346,13 +346,13 @@ void removeAspectRatio(TransInfo *t, float vec[2]) if ((sima->flag & SI_COORDFLOATS) == 0) { int width, height; - ED_space_image_size(sima, &width, &height); + ED_space_image_get_size(sima, &width, &height); vec[0] /= width; vec[1] /= height; } - ED_space_image_uv_aspect(sima, &aspx, &aspy); + ED_space_image_get_uv_aspect(sima, &aspx, &aspy); vec[0] *= aspx; vec[1] *= aspy; } diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 55110e48469..b5b1fbde184 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -722,7 +722,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t) else if (t->spacetype == SPACE_IMAGE) { float aspx, aspy; - ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); + ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); glScalef(1.0f / aspx, 1.0f / aspy, 1.0); } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 8ab6e5e68ce..6dc0e986058 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2320,7 +2320,7 @@ static void UVsToTransData(SpaceImage *sima, TransData *td, TransData2D *td2d, f { float aspx, aspy; - ED_space_image_uv_aspect(sima, &aspx, &aspy); + ED_space_image_get_uv_aspect(sima, &aspx, &aspy); /* uv coords are scaled by aspects. this is needed for rotations and * proportional editing to be consistent with the stretched uv coords @@ -2428,8 +2428,8 @@ void flushTransUVs(TransInfo *t) int a, width, height; float aspx, aspy, invx, invy; - ED_space_image_uv_aspect(sima, &aspx, &aspy); - ED_space_image_size(sima, &width, &height); + ED_space_image_get_uv_aspect(sima, &aspx, &aspy); + ED_space_image_get_size(sima, &width, &height); invx = 1.0f / aspx; invy = 1.0f / aspy; @@ -2451,7 +2451,7 @@ int clipUVTransform(TransInfo *t, float *vec, int resize) int a, clipx = 1, clipy = 1; float aspx, aspy, min[2], max[2]; - ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); + ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); min[0] = min[1] = 0.0f; max[0] = aspx; max[1] = aspy; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index a250c763dd1..8651241f338 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1432,7 +1432,7 @@ void calculateCenterCursor2D(TransInfo *t) if (t->spacetype == SPACE_IMAGE) { SpaceImage *sima = (SpaceImage *)t->sa->spacedata.first; /* only space supported right now but may change */ - ED_space_image_uv_aspect(sima, &aspx, &aspy); + ED_space_image_get_uv_aspect(sima, &aspx, &aspy); cursor = sima->cursor; } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 0ea48e81029..7c86b697437 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -206,7 +206,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t) myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); glLoadIdentity(); - ED_space_image_aspect(t->sa->spacedata.first, &xuser_aspx, &yuser_asp); + ED_space_image_get_aspect(t->sa->spacedata.first, &xuser_aspx, &yuser_asp); ED_space_image_width(t->sa->spacedata.first, &wi, &hi); w = (((float)wi) / 256.0f) * G.sima->zoom * xuser_asp; h = (((float)hi) / 256.0f) * G.sima->zoom * yuser_asp; @@ -927,7 +927,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) UI_view2d_region_to_view(&t->ar->v2d, t->mval[0], t->mval[1], co, co + 1); if (ED_uvedit_nearest_uv(t->scene, t->obedit, ima, co, t->tsnap.snapPoint)) { - ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); + ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); t->tsnap.snapPoint[0] *= aspx; t->tsnap.snapPoint[1] *= aspy; @@ -2135,7 +2135,7 @@ static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], Gea /* evil hack - snapping needs to be adapted for image aspect ratio */ if ((t->spacetype == SPACE_IMAGE) && (t->mode == TFM_TRANSLATION)) { - ED_space_image_uv_aspect(t->sa->spacedata.first, asp, asp + 1); + ED_space_image_get_uv_aspect(t->sa->spacedata.first, asp, asp + 1); } for (i = 0; i <= max_index; i++) { diff --git a/source/blender/editors/uvedit/uvedit_buttons.c b/source/blender/editors/uvedit/uvedit_buttons.c index ec645f86848..fa39a52444b 100644 --- a/source/blender/editors/uvedit/uvedit_buttons.c +++ b/source/blender/editors/uvedit/uvedit_buttons.c @@ -125,7 +125,7 @@ static void uvedit_vertex_buttons(const bContext *C, uiBlock *block) float center[2]; int imx, imy, step, digits; - ED_space_image_size(sima, &imx, &imy); + ED_space_image_get_size(sima, &imx, &imy); em = BMEdit_FromObject(obedit); @@ -168,7 +168,7 @@ static void do_uvedit_vertex(bContext *C, void *UNUSED(arg), int event) em = BMEdit_FromObject(obedit); - ED_space_image_size(sima, &imx, &imy); + ED_space_image_get_size(sima, &imx, &imy); uvedit_center(scene, em, ima, center); if (sima->flag & SI_COORDFLOATS) { diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 17c57b1f6e4..55dfbc8a0df 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -68,8 +68,8 @@ static void drawcursor_sima(SpaceImage *sima, ARegion *ar) float zoomx, zoomy, w, h; int width, height; - ED_space_image_size(sima, &width, &height); - ED_space_image_zoom(sima, ar, &zoomx, &zoomy); + ED_space_image_get_size(sima, &width, &height); + ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy); w = zoomx * width / 256.0f; h = zoomy * height / 256.0f; @@ -174,7 +174,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe float aspx, aspy, col[4], (*tf_uv)[2] = NULL, (*tf_uvorig)[2] = NULL; int i, j, nverts; - ED_space_image_uv_aspect(sima, &aspx, &aspy); + ED_space_image_get_uv_aspect(sima, &aspx, &aspy); switch (sima->dt_uvstretch) { case SI_UVDT_STRETCH_AREA: diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 0510ae21326..0f4f03e5b71 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -199,8 +199,8 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im float prev_aspect[2], fprev_aspect; float aspect[2], faspect; - ED_image_uv_aspect(previma, prev_aspect, prev_aspect + 1); - ED_image_uv_aspect(ima, aspect, aspect + 1); + ED_image_get_uv_aspect(previma, prev_aspect, prev_aspect + 1); + ED_image_get_uv_aspect(ima, aspect, aspect + 1); fprev_aspect = prev_aspect[0]/prev_aspect[1]; faspect = aspect[0]/aspect[1]; @@ -292,7 +292,7 @@ static void uvedit_pixel_to_float(SpaceImage *sima, float *dist, float pixeldist int width, height; if (sima) { - ED_space_image_size(sima, &width, &height); + ED_space_image_get_size(sima, &width, &height); } else { width = 256; @@ -2604,8 +2604,8 @@ static int circle_select_exec(bContext *C, wmOperator *op) /* compute ellipse size and location, not a circle since we deal * with non square image. ellipse is normalized, r = 1.0. */ - ED_space_image_size(sima, &width, &height); - ED_space_image_zoom(sima, ar, &zoomx, &zoomy); + ED_space_image_get_size(sima, &width, &height); + ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy); ellipse[0] = width * zoomx / radius; ellipse[1] = height * zoomy / radius; @@ -2781,7 +2781,7 @@ static void snap_cursor_to_pixels(SpaceImage *sima) { int width = 0, height = 0; - ED_space_image_size(sima, &width, &height); + ED_space_image_get_size(sima, &width, &height); snap_uv_to_pixel(sima->cursor, width, height); } @@ -2936,7 +2936,7 @@ static int snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit) float w, h; short change = 0; - ED_space_image_size(sima, &width, &height); + ED_space_image_get_size(sima, &width, &height); w = (float)width; h = (float)height; diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 1def5caad87..4b6c0ef0e7b 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -198,7 +198,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em, float aspx, aspy; tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); - ED_image_uv_aspect(tf->tpage, &aspx, &aspy); + ED_image_get_uv_aspect(tf->tpage, &aspx, &aspy); if (aspx != aspy) param_aspect_ratio(handle, aspx, aspy); @@ -388,7 +388,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *e float aspx, aspy; tf = CustomData_bmesh_get(&em->bm->pdata, editFace->head.data, CD_MTEXPOLY); - ED_image_uv_aspect(tf->tpage, &aspx, &aspy); + ED_image_get_uv_aspect(tf->tpage, &aspx, &aspy); if (aspx != aspy) param_aspect_ratio(handle, aspx, aspy); @@ -1017,7 +1017,7 @@ static void correct_uv_aspect(BMEditMesh *em) MTexPoly *tf; tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); - ED_image_uv_aspect(tf->tpage, &aspx, &aspy); + ED_image_get_uv_aspect(tf->tpage, &aspx, &aspy); } if (aspx == aspy) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index acfd413fdde..96f26eb637d 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -620,7 +620,7 @@ static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values) sa = rna_area_from_space(ptr); /* can be NULL */ ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); if (ar) { - ED_space_image_zoom(sima, ar, &values[0], &values[1]); + ED_space_image_get_zoom(sima, ar, &values[0], &values[1]); } } @@ -633,7 +633,7 @@ static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *val } else { int w, h; - ED_space_image_size(sima, &w, &h); + ED_space_image_get_size(sima, &w, &h); values[0] = sima->cursor[0] * w; values[1] = sima->cursor[1] * h; @@ -649,7 +649,7 @@ static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const floa } else { int w, h; - ED_space_image_size(sima, &w, &h); + ED_space_image_get_size(sima, &w, &h); sima->cursor[0] = values[0] / w; sima->cursor[1] = values[1] / h; diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 53f3dacbffa..8ae083af0ba 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -271,7 +271,7 @@ short ANIM_add_driver(struct ID *id, const char rna_path[], int array_index, sho short ANIM_remove_driver(struct ID *id, const char rna_path[], int array_index, short flag) {return 0;} void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock) {} struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **lock_r) {return (struct ImBuf *) NULL;} -void ED_space_image_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy) {} +void ED_space_image_get_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy) {} char *ED_info_stats_string(struct Scene *scene) {return (char *) NULL;} void ED_area_tag_redraw(struct ScrArea *sa) {} void ED_area_tag_refresh(struct ScrArea *sa) {} @@ -345,7 +345,7 @@ intptr_t mesh_octree_table(struct Object *ob, struct BMEditMesh *em, float *co, void ED_sequencer_update_view(struct bContext *C, int view) {} float ED_rollBoneToVector(struct EditBone *bone, float new_up_axis[3]) {return 0.0f;} -void ED_space_image_size(struct SpaceImage *sima, int *width, int *height) {} +void ED_space_image_get_size(struct SpaceImage *sima, int *width, int *height) {} void ED_nurb_set_spline_type(struct Nurb *nu, int type) {} |