diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2025-03-24 00:02:46 +0100 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2025-03-24 00:02:46 +0100 |
commit | 4a7f0649d53fcb427e79954290e67f5c55513b7d (patch) | |
tree | 668ae41c08e17afd7218a27c5fc87a1f7fd7743e | |
parent | c5f64725155bb954e2ec5003e8eb5cad5ba861c4 (diff) | |
download | reduced_system_layer-4a7f0649d53fcb427e79954290e67f5c55513b7d.zip |
Fix out of memory check
-rwxr-xr-x | graphics.c | 30 |
1 files changed, 21 insertions, 9 deletions
@@ -787,11 +787,25 @@ static void draw_text_(Pixel_Buffer dst, vec4_f32 color, f64 x0, f64 y0, f64 sca #if !defined(GRAPHICS_ENABLE_EXTERNAL_FONT) Box external_font_text_area(i32 font, vec2 scale, i64 num_chars, c32 *text) { // TODO + + (void) font; + (void) scale; + (void) num_chars; + (void) text; + return (Box) {0}; } void external_font_render_to_buffer(Pixel_Buffer dst, i32 font, vec4_f32 color, vec2 position, vec2 scale, i64 num_chars, c32 *text) { // TODO + + (void) dst; + (void) font; + (void) color; + (void) position; + (void) scale; + (void) num_chars; + (void) text; } #endif // !defined(GRAPHICS_ENABLE_EXTERNAL_FONT) @@ -2009,15 +2023,13 @@ static void perform_graphics_request_cached_(Pixel_Buffer dst, Graphics_Request if (s->buffer_len < num_pixels) // Out of memory s->occupied = 0; - - Pixel_Buffer dst = { - .width = s->width, - .height = s->height, - .stride = s->width, - .pixels = s->buffer, - }; - - perform_graphics_request_to_buffer_(dst, s->req); + else + perform_graphics_request_to_buffer_((Pixel_Buffer) { + .width = s->width, + .height = s->height, + .stride = s->width, + .pixels = s->buffer, + }, s->req); } if (s->occupied) |