@ -3206,20 +3206,20 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2
if ( source . width < 0 ) { flipX = true ; source . width * = - 1 ; }
if ( source . height < 0 ) source . y - = source . height ;
Vector2 topLeft = { 0 } ;
Vector2 topRight = { 0 } ;
Vector2 bottomLeft = { 0 } ;
Vector2 bottomRight = { 0 } ;
Vector2 topRight = { 0 } ;
Vector2 topLeft = { 0 } ;
/ / Only calculate rotation if needed
if ( rotation = = 0.0f )
{
float x = dest . x - origin . x ;
float y = dest . y - origin . y ;
bottom Left = ( Vector2 ) { x , y } ;
bottom Right = ( Vector2 ) { x , y + dest . height } ;
topRigh t = ( Vector2 ) { x + dest . width , y + dest . height } ;
topLef t = ( Vector2 ) { x + dest . width , y } ;
top Left = ( Vector2 ) { x , y } ;
top Right = ( Vector2 ) { x + dest . width , y } ;
bottomLef t = ( Vector2 ) { x , y + dest . height } ;
bottomRigh t = ( Vector2 ) { x + dest . width , y + dest . height } ;
}
else
{
@ -3230,17 +3230,17 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2
float dx = - origin . x ;
float dy = - origin . y ;
bottomLeft . x = x + dx * cosRotation - ( dy + dest . height ) * sinRotation ;
bottomLeft . y = y + dx * sinRotation + ( dy + dest . height ) * cosRotation ;
bottomRight . x = x + ( dx + dest . width ) * cosRotation - ( dy + dest . height ) * sinRotation ;
bottomRight . y = y + ( dx + dest . width ) * sinRotation + ( dy + dest . height ) * cosRotation ;
topLeft . x = x + dx * cosRotation - dy * sinRotation ;
topLeft . y = y + dx * sinRotation + dy * cosRotation ;
topRight . x = x + ( dx + dest . width ) * cosRotation - dy * sinRotation ;
topRight . y = y + ( dx + dest . width ) * sinRotation + dy * cosRotation ;
topLeft . x = x + dx * cosRotation - dy * sinRotation ;
topLeft . y = y + dx * sinRotation + dy * cosRotation ;
bottomLeft . x = x + dx * cosRotation - ( dy + dest . height ) * sinRotation ;
bottomLeft . y = y + dx * sinRotation + ( dy + dest . height ) * cosRotation ;
bottomRight . x = x + ( dx + dest . width ) * cosRotation - ( dy + dest . height ) * sinRotation ;
bottomRight . y = y + ( dx + dest . width ) * sinRotation + ( dy + dest . height ) * cosRotation ;
}
rlEnableTexture ( texture . id ) ;
@ -3249,25 +3249,25 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2
rlColor4ub ( tint . r , tint . g , tint . b , tint . a ) ;
rlNormal3f ( 0.0f , 0.0f , 1.0f ) ; / / Normal vector pointing towards viewer
/ / Bottom - left corner for texture and quad
/ / Top - left corner for texture and quad
if ( flipX ) rlTexCoord2f ( ( source . x + source . width ) / width , source . y / height ) ;
else rlTexCoord2f ( source . x / width , source . y / height ) ;
rlVertex2f ( bottom Left. x , bottom Left. y ) ;
rlVertex2f ( top Left. x , top Left. y ) ;
/ / Bottom - righ t corner for texture and quad
/ / Bottom - lef t corner for texture and quad
if ( flipX ) rlTexCoord2f ( ( source . x + source . width ) / width , ( source . y + source . height ) / height ) ;
else rlTexCoord2f ( source . x / width , ( source . y + source . height ) / height ) ;
rlVertex2f ( bottomRigh t . x , bottomRigh t . y ) ;
rlVertex2f ( bottomLef t . x , bottomLef t . y ) ;
/ / Top - right corner for texture and quad
/ / Bottom - right corner for texture and quad
if ( flipX ) rlTexCoord2f ( source . x / width , ( source . y + source . height ) / height ) ;
else rlTexCoord2f ( ( source . x + source . width ) / width , ( source . y + source . height ) / height ) ;
rlVertex2f ( top Right. x , top Right. y ) ;
rlVertex2f ( bottom Right. x , bottom Right. y ) ;
/ / Top - lef t corner for texture and quad
/ / Top - righ t corner for texture and quad
if ( flipX ) rlTexCoord2f ( source . x / width , source . y / height ) ;
else rlTexCoord2f ( ( source . x + source . width ) / width , source . y / height ) ;
rlVertex2f ( topLef t . x , topLef t . y ) ;
rlVertex2f ( topRigh t . x , topRigh t . y ) ;
rlEnd ( ) ;
rlDisableTexture ( ) ;