| 2831 | } |
| 2832 | |
| 2833 | int |
| 2834 | SDL_RenderFillRectsF(SDL_Renderer * renderer, |
| 2835 | const SDL_FRect * rects, int count) |
| 2836 | { |
| 2837 | SDL_FRect *frects; |
| 2838 | int i; |
| 2839 | int retval; |
| 2840 | SDL_bool isstack; |
| 2841 | |
| 2842 | CHECK_RENDERER_MAGIC(renderer, -1); |
| 2843 | |
| 2844 | if (!rects) { |
| 2845 | return SDL_SetError("SDL_RenderFillFRects(): Passed NULL rects"); |
| 2846 | } |
| 2847 | if (count < 1) { |
| 2848 | return 0; |
| 2849 | } |
| 2850 | |
| 2851 | /* Don't draw while we're hidden */ |
| 2852 | if (renderer->hidden) { |
| 2853 | return 0; |
| 2854 | } |
| 2855 | |
| 2856 | frects = SDL_small_alloc(SDL_FRect, count, &isstack); |
| 2857 | if (!frects) { |
| 2858 | return SDL_OutOfMemory(); |
| 2859 | } |
| 2860 | for (i = 0; i < count; ++i) { |
| 2861 | frects[i].x = rects[i].x * renderer->scale.x; |
| 2862 | frects[i].y = rects[i].y * renderer->scale.y; |
| 2863 | frects[i].w = rects[i].w * renderer->scale.x; |
| 2864 | frects[i].h = rects[i].h * renderer->scale.y; |
| 2865 | } |
| 2866 | |
| 2867 | retval = QueueCmdFillRects(renderer, frects, count); |
| 2868 | |
| 2869 | SDL_small_free(frects, isstack); |
| 2870 | |
| 2871 | return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); |
| 2872 | } |
| 2873 | |
| 2874 | /* !!! FIXME: move this to a public API if we want to do float versions of all of these later */ |
| 2875 | SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r) |
no test coverage detected