Fixed building with SDL_LEAN_AND_MEAN
Build (All) / Create test plan (push) Waiting to run
Build (All) / level1 (push) Blocked by required conditions
Build (All) / level2 (push) Blocked by required conditions

Fixes https://github.com/libsdl-org/SDL/issues/12578
This commit is contained in:
Sam Lantinga
2025-03-18 09:54:29 -07:00
parent a551c2a6d7
commit 82335fd0e9
+10 -7
View File
@@ -1034,27 +1034,30 @@ static bool SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd)
data->drawstate.texture = texture; data->drawstate.texture = texture;
} else if (texture) { } else if (texture) {
D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal; D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal;
UpdateDirtyTexture(data->device, &texturedata->texture); if (texturedata) {
UpdateDirtyTexture(data->device, &texturedata->texture);
#ifdef SDL_HAVE_YUV #ifdef SDL_HAVE_YUV
if (texturedata->yuv) { if (texturedata->yuv) {
UpdateDirtyTexture(data->device, &texturedata->utexture); UpdateDirtyTexture(data->device, &texturedata->utexture);
UpdateDirtyTexture(data->device, &texturedata->vtexture); UpdateDirtyTexture(data->device, &texturedata->vtexture);
}
#endif // SDL_HAVE_YUV
} }
#endif
} }
if (texture) { if (texture) {
D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal;
UpdateTextureScaleMode(data, cmd->data.draw.texture_scale_mode, 0); UpdateTextureScaleMode(data, cmd->data.draw.texture_scale_mode, 0);
UpdateTextureAddressMode(data, cmd->data.draw.texture_address_mode, 0); UpdateTextureAddressMode(data, cmd->data.draw.texture_address_mode, 0);
#ifdef SDL_HAVE_YUV
D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal;
if (texturedata && texturedata->yuv) { if (texturedata && texturedata->yuv) {
UpdateTextureScaleMode(data, cmd->data.draw.texture_scale_mode, 1); UpdateTextureScaleMode(data, cmd->data.draw.texture_scale_mode, 1);
UpdateTextureScaleMode(data, cmd->data.draw.texture_scale_mode, 2); UpdateTextureScaleMode(data, cmd->data.draw.texture_scale_mode, 2);
UpdateTextureAddressMode(data, cmd->data.draw.texture_address_mode, 1); UpdateTextureAddressMode(data, cmd->data.draw.texture_address_mode, 1);
UpdateTextureAddressMode(data, cmd->data.draw.texture_address_mode, 2); UpdateTextureAddressMode(data, cmd->data.draw.texture_address_mode, 2);
} }
#endif // SDL_HAVE_YUV
} }
if (blend != data->drawstate.blend) { if (blend != data->drawstate.blend) {