From 9cedc8185065ff59cb909cbdb7a0a485b8d334bf Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Fri, 1 Sep 2023 20:29:24 +0100 Subject: [PATCH] Fix broken merge --- GL/alloc/alloc.c | 19 +++++-------------- tests/test_glteximage2d.h | 5 ++++- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/GL/alloc/alloc.c b/GL/alloc/alloc.c index b263d46..24ade90 100644 --- a/GL/alloc/alloc.c +++ b/GL/alloc/alloc.c @@ -147,25 +147,16 @@ void* alloc_next_available_ex(void* pool, size_t required_size, size_t* start_su uintptr_t offset = (it - pool_header.block_usage) * 8; offset += (i + 1); offset -= required_subblocks; + + if(start_subblock_out) { + *start_subblock_out = offset; + } + return pool_header.base_address + (offset * 256); } } } else { found_subblocks = 0; - } else { - found_subblocks++; - if(found_subblocks >= required_subblocks) { - /* We found space! Now calculate the address */ - uintptr_t offset = (it - pool_header.block_usage) * 8; - offset += (i + 1); - offset -= required_subblocks; - - if(start_subblock_out) { - *start_subblock_out = offset; - } - - return pool_header.base_address + (offset * 256); - } } t <<= 1; diff --git a/tests/test_glteximage2d.h b/tests/test_glteximage2d.h index 3c5995a..3349c42 100644 --- a/tests/test_glteximage2d.h +++ b/tests/test_glteximage2d.h @@ -10,7 +10,10 @@ public: uint8_t image_data[8 * 8 * 4] = {0}; void set_up() { - glKosInit(); + GLdcConfig config; + glKosInitConfig(&config); + config.texture_twiddle = false; + glKosInitEx(&config); /* Init image data so each texel RGBA value matches the * position in the array */