[Bf-blender-cvs] [fb24813d64d] blender2.8: Remove game properties in image editor

Dalai Felinto noreply at git.blender.org
Tue Apr 17 17:52:34 CEST 2018


Commit: fb24813d64dd8fa2ddb8c0e55004d3792281c8d7
Author: Dalai Felinto
Date:   Tue Apr 17 15:53:36 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBfb24813d64dd8fa2ddb8c0e55004d3792281c8d7

Remove game properties in image editor

The following properties were used by the Blender Game Engine and no longer
need to be around:

* Animated
* Tiles
* Clamp
* Mapping

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

M	release/scripts/startup/bl_ui/space_image.py
M	source/blender/blenkernel/intern/image.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/space_image/image_draw.c
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/gpu/GPU_draw.h
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/gpu/intern/gpu_texture.c
M	source/blender/makesdna/DNA_image_types.h
M	source/blender/makesrna/intern/rna_image.c

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

diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 123e95c013c..1877e299d70 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -614,50 +614,6 @@ class IMAGE_PT_image_properties(Panel):
         layout.template_image(sima, "image", iuser, multiview=True)
 
 
-class IMAGE_PT_game_properties(Panel):
-    bl_space_type = 'IMAGE_EDITOR'
-    bl_region_type = 'UI'
-    bl_label = "Game Properties"
-
-    @classmethod
-    def poll(cls, context):
-        sima = context.space_data
-        # display even when not in game mode because these settings effect the 3d view
-        return (sima and sima.image and not sima.show_maskedit)  # and (view_render.engine == 'BLENDER_GAME')
-
-    def draw(self, context):
-        layout = self.layout
-
-        sima = context.space_data
-        ima = sima.image
-
-        split = layout.split()
-        col = split.column()
-        col.prop(ima, "use_animation")
-        sub = col.column(align=True)
-        sub.active = ima.use_animation
-        sub.prop(ima, "frame_start", text="Start")
-        sub.prop(ima, "frame_end", text="End")
-        sub.prop(ima, "fps", text="Speed")
-
-        col = split.column()
-        col.prop(ima, "use_tiles")
-        sub = col.column(align=True)
-        sub.active = ima.use_tiles or ima.use_animation
-        sub.prop(ima, "tiles_x", text="X")
-        sub.prop(ima, "tiles_y", text="Y")
-
-        split = layout.split()
-        col = split.column()
-        col.label(text="Clamp:")
-        col.prop(ima, "use_clamp_x", text="X")
-        col.prop(ima, "use_clamp_y", text="Y")
-
-        col = split.column()
-        col.label(text="Mapping:")
-        col.prop(ima, "mapping", expand=True)
-
-
 class IMAGE_PT_view_properties(Panel):
     bl_space_type = 'IMAGE_EDITOR'
     bl_region_type = 'UI'
@@ -1363,7 +1319,6 @@ classes = (
     IMAGE_PT_active_mask_spline,
     IMAGE_PT_active_mask_point,
     IMAGE_PT_image_properties,
-    IMAGE_PT_game_properties,
     IMAGE_PT_view_properties,
     IMAGE_PT_tools_transform_uvs,
     IMAGE_PT_tools_align_uvs,
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 28245f9a4d8..50b1756ff87 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -370,7 +370,6 @@ static void image_init(Image *ima, short source, short type)
 
 	ima->ok = IMA_OK;
 
-	ima->xrep = ima->yrep = 1;
 	ima->aspx = ima->aspy = 1.0;
 	ima->gen_x = 1024; ima->gen_y = 1024;
 	ima->gen_type = IMA_GENTYPE_GRID;
@@ -473,12 +472,10 @@ void BKE_image_copy_data(Main *UNUSED(bmain), Image *ima_dst, const Image *ima_s
 
 	BLI_listbase_clear(&ima_dst->anims);
 
-	ima_dst->totbind = 0;
 	for (int i = 0; i < TEXTARGET_COUNT; i++) {
 		ima_dst->bindcode[i] = 0;
 		ima_dst->gputexture[i] = NULL;
 	}
-	ima_dst->repbind = NULL;
 
 	if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0) {
 		BKE_previewimg_id_copy(&ima_dst->id, &ima_src->id);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index dad9d92225f..b40321f75d1 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3924,8 +3924,6 @@ static void direct_link_image(FileData *fd, Image *ima)
 		}
 		ima->rr = NULL;
 	}
-
-	ima->repbind = NULL;
 	
 	/* undo system, try to restore render buffers */
 	if (fd->imamap) {
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index b1b24b8d0e6..e16cc122414 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -917,18 +917,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
 
 	if (main->versionfile <= 223) {
 		VFont *vf;
-		Image *ima;
-
 		for (vf = main->vfont.first; vf; vf = vf->id.next) {
 			if (STREQ(vf->name + strlen(vf->name) - 6, ".Bfont")) {
 				strcpy(vf->name, FO_BUILTIN_NAME);
 			}
 		}
-
-		/* Old textures animate at 25 FPS */
-		for (ima = main->image.first; ima; ima = ima->id.next) {
-			ima->animspeed = 25;
-		}
 	}
 
 	if (main->versionfile <= 224) {
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 4eea4fed9b6..084b3dfbf09 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -2492,8 +2492,7 @@ static bool IsectPoly2Df_twoside(const float pt[2], float uv[][2], const int tot
 static void project_paint_face_init(
         const ProjPaintState *ps,
         const int thread_index, const int bucket_index, const int tri_index, const int image_index,
-        const rctf *clip_rect, const rctf *bucket_bounds, ImBuf *ibuf, ImBuf **tmpibuf,
-        const bool clamp_u, const bool clamp_v)
+        const rctf *clip_rect, const rctf *bucket_bounds, ImBuf *ibuf, ImBuf **tmpibuf)
 {
 	/* Projection vars, to get the 3D locations into screen space  */
 	MemArena *arena = ps->arena_mt[thread_index];
@@ -2600,17 +2599,6 @@ static void project_paint_face_init(
 #endif
 
 		if (pixel_bounds_array(uv_clip, &bounds_px, ibuf->x, ibuf->y, uv_clip_tot)) {
-
-			if (clamp_u) {
-				CLAMP(bounds_px.xmin, 0, ibuf->x);
-				CLAMP(bounds_px.xmax, 0, ibuf->x);
-			}
-
-			if (clamp_v) {
-				CLAMP(bounds_px.ymin, 0, ibuf->y);
-				CLAMP(bounds_px.ymax, 0, ibuf->y);
-			}
-
 #if 0
 			project_paint_undo_tiles_init(&bounds_px, ps->projImages + image_index, tmpibuf,
 			                              tile_width, threaded, ps->do_masking);
@@ -2927,19 +2915,16 @@ static void project_bucket_init(
 	int tri_index, image_index = 0;
 	ImBuf *ibuf = NULL;
 	Image *tpage_last = NULL, *tpage;
-	Image *ima = NULL;
 	ImBuf *tmpibuf = NULL;
 
 	if (ps->image_tot == 1) {
 		/* Simple loop, no context switching */
 		ibuf = ps->projImages[0].ibuf;
-		ima = ps->projImages[0].ima;
 
 		for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
 			project_paint_face_init(
 			        ps, thread_index, bucket_index, GET_INT_FROM_POINTER(node->link), 0,
-			        clip_rect, bucket_bounds, ibuf, &tmpibuf,
-			        (ima->tpageflag & IMA_CLAMP_U) != 0, (ima->tpageflag & IMA_CLAMP_V) != 0);
+			        clip_rect, bucket_bounds, ibuf, &tmpibuf);
 		}
 	}
 	else {
@@ -2956,7 +2941,6 @@ static void project_bucket_init(
 				for (image_index = 0; image_index < ps->image_tot; image_index++) {
 					if (ps->projImages[image_index].ima == tpage_last) {
 						ibuf = ps->projImages[image_index].ibuf;
-						ima = ps->projImages[image_index].ima;
 						break;
 					}
 				}
@@ -2965,8 +2949,7 @@ static void project_bucket_init(
 
 			project_paint_face_init(
 			        ps, thread_index, bucket_index, tri_index, image_index,
-			        clip_rect, bucket_bounds, ibuf, &tmpibuf,
-			        (ima->tpageflag & IMA_CLAMP_U) != 0, (ima->tpageflag & IMA_CLAMP_V) != 0);
+			        clip_rect, bucket_bounds, ibuf, &tmpibuf);
 		}
 	}
 
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 43d5348da3e..e1ba83a0d78 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -548,118 +548,6 @@ static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *ar,
 	}
 }
 
-static unsigned int *get_part_from_buffer(unsigned int *buffer, int width, short startx, short starty, short endx, short endy)
-{
-	unsigned int *rt, *rp, *rectmain;
-	short y, heigth, len;
-
-	/* the right offset in rectot */
-
-	rt = buffer + (starty * width + startx);
-
-	len = (endx - startx);
-	heigth = (endy - starty);
-
-	rp = rectmain = MEM_mallocN(heigth * len * sizeof(int), "rect");
-	
-	for (y = 0; y < heigth; y++) {
-		memcpy(rp, rt, len * 4);
-		rt += width;
-		rp += len;
-	}
-	return rectmain;
-}
-
-static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Scene *scene, Image *ima, ImBuf *ibuf, float fx, float fy, float zoomx, float zoomy)
-{
-	unsigned char *display_buffer;
-	unsigned int *rect;
-	int dx, dy, sx, sy, x, y;
-	void *cache_handle;
-	float shuffle[4] = {0.0f, 0.0f, 0.0f, 0.0f};
-
-	/* verify valid values, just leave this a while */
-	if (ima->xrep < 1) return;
-	if (ima->yrep < 1) return;
-
-	if (ima->flag & IMA_VIEW_AS_RENDER)
-		display_buffer = IMB_display_buffer_acquire(ibuf, &scene->view_settings, &scene->display_settings, &cache_handle);
-	else
-		display_buffer = IMB_display_buffer_acquire(ibuf, NULL, &scene->display_settings, &cache_handle);
-
-	if (!display_buffer)
-		return;
-
-	if (sima->curtile >= ima->xrep * ima->yrep)
-		sima->curtile = ima->xrep * ima->yrep - 1;
-	
-	/* retrieve part of image buffer */
-	dx = max_ii(ibuf->x / ima->xrep, 1);
-	dy = max_ii(ibuf->y / ima->yrep, 1);
-	sx = (sima->curtile % ima->xrep) * dx;
-	sy = (sima->curtile / ima->xrep) * dy;
-	rect = get_part_from_buffer((unsigned int *)display_buffer, ibuf->x, sx, sy, sx + dx, sy + dy);
-	
-	/* draw repeated */
-	if ((sima->flag & (SI_SHOW_R | SI_SHOW_G | SI_SHOW_B | SI_SHOW_ALPHA)) != 0) {
-		if (sima->flag & SI_SHOW_R)
-			shuffle[0] = 1.0f;
-		else if (sima->flag & SI_SHOW_G)
-			shuffle[1] = 1.0f;
-		else if (sima->flag & SI_SHOW_B)
-			shuffle[2] = 1.0f;
-		else if (sima->flag & SI_SHOW_ALPHA)
-			shuffle[3] = 1.0f;
-	}
-
-	for (sy = 0; sy + dy <= ibuf->y; sy += dy) {
-		for (sx = 0; sx + dx <= ibuf->x; sx += dx) {
-			UI_view2d_view_to_region(&ar->v2d, fx + (float)sx / (float)ibuf->x, fy + (float)sy / (float)ibuf->y, &x, &y);
-
-			if ((sima->flag & (SI_SHOW_R | SI_SHOW_G | SI_SHOW_B | SI_SHOW_ALPHA)) == 0) {
-				IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR);
-				immDrawPixelsTex(&state, x, y, dx, dy, GL_RGBA, GL_UNSIGNED_BYTE, GL_NEAREST, rect, zoomx, zoomy, NULL);
-			}
-			else {
-				IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR);
-				GPU_shader_uniform_vector(state.shader, GPU_shader_get_uniform(state.shader, "shuffle"), 4, 1, shuffle);
-
-				immDrawPixelsTex(&state, x, y, dx, dy, GL_RGBA, GL

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list