Skip to content

Commit 82335fd

Browse files
committed
Fixed building with SDL_LEAN_AND_MEAN
Fixes #12578
1 parent a551c2a commit 82335fd

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/render/direct3d/SDL_render_d3d.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,27 +1034,30 @@ static bool SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd)
10341034
data->drawstate.texture = texture;
10351035
} else if (texture) {
10361036
D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal;
1037-
UpdateDirtyTexture(data->device, &texturedata->texture);
1037+
if (texturedata) {
1038+
UpdateDirtyTexture(data->device, &texturedata->texture);
10381039
#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
10421045
}
1043-
#endif
10441046
}
10451047

10461048
if (texture) {
1047-
D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal;
1048-
10491049
UpdateTextureScaleMode(data, cmd->data.draw.texture_scale_mode, 0);
10501050
UpdateTextureAddressMode(data, cmd->data.draw.texture_address_mode, 0);
10511051

1052+
#ifdef SDL_HAVE_YUV
1053+
D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal;
10521054
if (texturedata && texturedata->yuv) {
10531055
UpdateTextureScaleMode(data, cmd->data.draw.texture_scale_mode, 1);
10541056
UpdateTextureScaleMode(data, cmd->data.draw.texture_scale_mode, 2);
10551057
UpdateTextureAddressMode(data, cmd->data.draw.texture_address_mode, 1);
10561058
UpdateTextureAddressMode(data, cmd->data.draw.texture_address_mode, 2);
10571059
}
1060+
#endif // SDL_HAVE_YUV
10581061
}
10591062

10601063
if (blend != data->drawstate.blend) {

0 commit comments

Comments
 (0)