[Bf-blender-cvs] [effe0473185] blender-v2.81-release: Cleanup: rename undo tile x/y members

Campbell Barton noreply at git.blender.org
Sat Nov 2 02:33:41 CET 2019


Commit: effe0473185aea3546f68319b719bf63ea409ab2
Author: Campbell Barton
Date:   Sat Nov 2 12:29:46 2019 +1100
Branches: blender-v2.81-release
https://developer.blender.org/rBeffe0473185aea3546f68319b719bf63ea409ab2

Cleanup: rename undo tile x/y members

Avoid mixing up pixel/tile location.

===================================================================

M	source/blender/editors/space_image/image_undo.c

===================================================================

diff --git a/source/blender/editors/space_image/image_undo.c b/source/blender/editors/space_image/image_undo.c
index 49964869f1c..b6b32293cee 100644
--- a/source/blender/editors/space_image/image_undo.c
+++ b/source/blender/editors/space_image/image_undo.c
@@ -115,7 +115,7 @@ typedef struct PaintTile {
   ushort *mask;
   bool valid;
   bool use_float;
-  int x, y;
+  int x_tile, y_tile;
 } PaintTile;
 
 static void ptile_free(PaintTile *ptile)
@@ -154,7 +154,7 @@ void *ED_image_paint_tile_find(ListBase *paint_tiles,
                                bool validate)
 {
   for (PaintTile *ptile = paint_tiles->first; ptile; ptile = ptile->next) {
-    if (ptile->x == x_tile && ptile->y == y_tile) {
+    if (ptile->x_tile == x_tile && ptile->y_tile == y_tile) {
       if (ptile->image == image && ptile->ibuf == ibuf) {
         if (r_mask) {
           /* allocate mask if requested. */
@@ -206,8 +206,8 @@ void *ED_image_paint_tile_push(ListBase *paint_tiles,
   ptile->image = image;
   ptile->ibuf = ibuf;
 
-  ptile->x = x_tile;
-  ptile->y = y_tile;
+  ptile->x_tile = x_tile;
+  ptile->y_tile = y_tile;
 
   /* add mask explicitly here */
   if (r_mask) {
@@ -271,8 +271,8 @@ static void ptile_restore_runtime_list(ListBase *paint_tiles)
 
     IMB_rectcpy(ibuf,
                 tmpibuf,
-                ptile->x * ED_IMAGE_UNDO_TILE_SIZE,
-                ptile->y * ED_IMAGE_UNDO_TILE_SIZE,
+                ptile->x_tile * ED_IMAGE_UNDO_TILE_SIZE,
+                ptile->y_tile * ED_IMAGE_UNDO_TILE_SIZE,
                 0,
                 0,
                 ED_IMAGE_UNDO_TILE_SIZE,
@@ -770,7 +770,7 @@ static bool image_undosys_step_encode(struct bContext *C,
         utile->users = 1;
         utile->rect.pt = ptile->rect.pt;
         ptile->rect.pt = NULL;
-        const uint tile_index = index_from_xy(ptile->x, ptile->y, ubuf_pre->tiles_dims);
+        const uint tile_index = index_from_xy(ptile->x_tile, ptile->y_tile, ubuf_pre->tiles_dims);
 
         BLI_assert(ubuf_pre->tiles[tile_index] == NULL);
         ubuf_pre->tiles[tile_index] = utile;



More information about the Bf-blender-cvs mailing list