mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 15:08:31 +00:00
Fixed clamp texture address mode in software renderer
This commit is contained in:
@@ -5001,6 +5001,22 @@ static bool SDLCALL SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
|
||||
}
|
||||
}
|
||||
|
||||
// Check if UVs within range
|
||||
if (is_quad) {
|
||||
const float *uv0_ = (const float *)((const char *)uv + A * color_stride);
|
||||
const float *uv1_ = (const float *)((const char *)uv + B * color_stride);
|
||||
const float *uv2_ = (const float *)((const char *)uv + C * color_stride);
|
||||
const float *uv3_ = (const float *)((const char *)uv + C2 * color_stride);
|
||||
if (uv0_[0] >= 0.0f && uv0_[0] <= 1.0f &&
|
||||
uv1_[0] >= 0.0f && uv1_[0] <= 1.0f &&
|
||||
uv2_[0] >= 0.0f && uv2_[0] <= 1.0f &&
|
||||
uv3_[0] >= 0.0f && uv3_[0] <= 1.0f) {
|
||||
// ok
|
||||
} else {
|
||||
is_quad = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Start rendering rect
|
||||
if (is_quad) {
|
||||
SDL_FRect s;
|
||||
|
Reference in New Issue
Block a user