mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Revert "Fix Sprite3D's incorrect behavior when using AtlasTextures."
This commit is contained in:
		
							parent
							
								
									3f3b4703e4
								
							
						
					
					
						commit
						b484d5c2d8
					
				
					 1 changed files with 9 additions and 20 deletions
				
			
		|  | @ -366,17 +366,11 @@ void Sprite3D::_draw() { | |||
| 		final_rect.position * pixel_size, | ||||
| 
 | ||||
| 	}; | ||||
| 
 | ||||
| 	// Properly setup UVs for impostor textures (AtlasTexture).
 | ||||
| 	RID texture_rid = texture->get_rid(); | ||||
| 	Vector2 src_tsize = Vector2( | ||||
| 			VS::get_singleton()->texture_get_width(texture_rid), | ||||
| 			VS::get_singleton()->texture_get_height(texture_rid)); | ||||
| 	Vector2 uvs[4] = { | ||||
| 		final_src_rect.position / src_tsize, | ||||
| 		(final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / src_tsize, | ||||
| 		(final_src_rect.position + final_src_rect.size) / src_tsize, | ||||
| 		(final_src_rect.position + Vector2(0, final_src_rect.size.y)) / src_tsize, | ||||
| 		final_src_rect.position / tsize, | ||||
| 		(final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize, | ||||
| 		(final_src_rect.position + final_src_rect.size) / tsize, | ||||
| 		(final_src_rect.position + Vector2(0, final_src_rect.size.y)) / tsize, | ||||
| 	}; | ||||
| 
 | ||||
| 	if (is_flipped_h()) { | ||||
|  | @ -655,23 +649,18 @@ void AnimatedSprite3D::_draw() { | |||
| 	float pixel_size = get_pixel_size(); | ||||
| 
 | ||||
| 	Vector2 vertices[4] = { | ||||
| 
 | ||||
| 		(final_rect.position + Vector2(0, final_rect.size.y)) * pixel_size, | ||||
| 		(final_rect.position + final_rect.size) * pixel_size, | ||||
| 		(final_rect.position + Vector2(final_rect.size.x, 0)) * pixel_size, | ||||
| 		final_rect.position * pixel_size, | ||||
| 
 | ||||
| 	}; | ||||
| 
 | ||||
| 	// Properly setup UVs for impostor textures (AtlasTexture).
 | ||||
| 	RID texture_rid = texture->get_rid(); | ||||
| 	Vector2 src_tsize = Vector2( | ||||
| 			VS::get_singleton()->texture_get_width(texture_rid), | ||||
| 			VS::get_singleton()->texture_get_height(texture_rid)); | ||||
| 	Vector2 uvs[4] = { | ||||
| 		final_src_rect.position / src_tsize, | ||||
| 		(final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / src_tsize, | ||||
| 		(final_src_rect.position + final_src_rect.size) / src_tsize, | ||||
| 		(final_src_rect.position + Vector2(0, final_src_rect.size.y)) / src_tsize, | ||||
| 		final_src_rect.position / tsize, | ||||
| 		(final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize, | ||||
| 		(final_src_rect.position + final_src_rect.size) / tsize, | ||||
| 		(final_src_rect.position + Vector2(0, final_src_rect.size.y)) / tsize, | ||||
| 	}; | ||||
| 
 | ||||
| 	if (is_flipped_h()) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Juan Linietsky
						Juan Linietsky