Fixed an issue with clipping the render rectangle

This commit is contained in:
abdelrahman committed 2022-10-05 23:41:13 +01:00
1 parent 2eb8d83dc0
commit c1659dcf88
5 files changed
+99 -39

No files matched your search

+5 -4
View File
@@ -3,8 +3,8 @@
#include "AssetManager.h"
#include "ObjectStore.h"
#include "Renderer.h"
#include "SDL_pixels.h"
#include "SDL_rect.h"
#include "Window.h"
#include "reusable_ids.h"
#include <stdbool.h>
@@ -61,15 +61,16 @@ WindowSize get_window_real_size();
*/
WindowDrawingArea get_window_drawing_area();
void fill_rectangle(float x, float y, float w, float h, SDL_Color color);
void fill_rectangle(RenderRect rect, SDL_Color color);
/**
* Ensures that a rendered rectangle is clipped to the drawing area when it is
* smaller than the actual size of the window.
*/
void clip_render_rect_to_drawing_area(SDL_FRect *rect);
void clip_source_rect_to_drawing_area(RenderRect *src, RenderRect *dest);
void render_texture_asset(AssetID id, float x, float y, float w, float h);
RenderRect get_texture_asset_rect(AssetID id);
void render_texture_asset(AssetID id, RenderRect *src, RenderRect *dest);
void render_text_with_font_asset(AssetID id, const char *text, float x,
float y);
void set_font_asset_size(AssetID id, uint32_t size);