@@ -1034,27 +1034,30 @@ static bool SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd)
1034
1034
data -> drawstate .texture = texture ;
1035
1035
} else if (texture ) {
1036
1036
D3D_TextureData * texturedata = (D3D_TextureData * )texture -> internal ;
1037
- UpdateDirtyTexture (data -> device , & texturedata -> texture );
1037
+ if (texturedata ) {
1038
+ UpdateDirtyTexture (data -> device , & texturedata -> texture );
1038
1039
#ifdef SDL_HAVE_YUV
1039
- if (texturedata -> yuv ) {
1040
- UpdateDirtyTexture (data -> device , & texturedata -> utexture );
1041
- UpdateDirtyTexture (data -> device , & texturedata -> vtexture );
1040
+ if (texturedata -> yuv ) {
1041
+ UpdateDirtyTexture (data -> device , & texturedata -> utexture );
1042
+ UpdateDirtyTexture (data -> device , & texturedata -> vtexture );
1043
+ }
1044
+ #endif // SDL_HAVE_YUV
1042
1045
}
1043
- #endif
1044
1046
}
1045
1047
1046
1048
if (texture ) {
1047
- D3D_TextureData * texturedata = (D3D_TextureData * )texture -> internal ;
1048
-
1049
1049
UpdateTextureScaleMode (data , cmd -> data .draw .texture_scale_mode , 0 );
1050
1050
UpdateTextureAddressMode (data , cmd -> data .draw .texture_address_mode , 0 );
1051
1051
1052
+ #ifdef SDL_HAVE_YUV
1053
+ D3D_TextureData * texturedata = (D3D_TextureData * )texture -> internal ;
1052
1054
if (texturedata && texturedata -> yuv ) {
1053
1055
UpdateTextureScaleMode (data , cmd -> data .draw .texture_scale_mode , 1 );
1054
1056
UpdateTextureScaleMode (data , cmd -> data .draw .texture_scale_mode , 2 );
1055
1057
UpdateTextureAddressMode (data , cmd -> data .draw .texture_address_mode , 1 );
1056
1058
UpdateTextureAddressMode (data , cmd -> data .draw .texture_address_mode , 2 );
1057
1059
}
1060
+ #endif // SDL_HAVE_YUV
1058
1061
}
1059
1062
1060
1063
if (blend != data -> drawstate .blend ) {
0 commit comments