From c5d88f03d58b21fd9a58b051dcccf277dff89835 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 4 Nov 2024 21:07:43 -0700 Subject: [PATCH] Increased max loaded regions, need to reduce memory by dynamically allocating/deallocating memory for them --- client/include/hex.h | 2 +- client/src/main.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/include/hex.h b/client/include/hex.h index f6f0f21..6e7ab1d 100644 --- a/client/include/hex.h +++ b/client/include/hex.h @@ -5,7 +5,7 @@ #define REGION_SIZE (10) #define REGION_HEX_COUNT (3*REGION_SIZE*(REGION_SIZE-1)+1) -#define MAX_LOADED_REGIONS (25*25) +#define MAX_LOADED_REGIONS (51*51) typedef struct GPUHexStruct { float height[6]; diff --git a/client/src/main.c b/client/src/main.c index 96ac285..929e649 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -99,11 +99,14 @@ VkResult main_thread(ClientContext* context) { 0x0000FFFF, }; + context->hex->data.current_map = 0x01; + add_transfer(&context->hex->data.current_map, context->hex->context, offsetof(GPUHexContext, current_map), sizeof(uint32_t), context->render->current_frame, context->render); + uint32_t region = 0; for(int32_t y = -2; y < 2; y++) { for(int32_t q = -5; q < 5; q++) { for(int32_t r = -5; r < 5; r++) { - VK_RESULT(set_hex_region(q, r, y, 0x00, ®ions[region], context->hex, context->render)); + VK_RESULT(set_hex_region(q, r, y, 0x01, ®ions[region], context->hex, context->render)); for(uint32_t i = 0; i < REGION_HEX_COUNT; i++) { for(uint32_t h = 0; h < 6; h++) { regions[region]->data.hexes[i].color[h] = colors[(q+r+50) % (sizeof(colors)/sizeof(uint32_t))];