summaryrefslogtreecommitdiff
path: root/src/serialization-static-ui.cpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-05-22 14:23:51 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-05-22 14:23:51 -0400
commitf924e16b7f4dad1766343383bd678e0df7271fe3 (patch)
treeafeb5de46e4f4a144c1c781f24c00a2c33d00555 /src/serialization-static-ui.cpp
parentea7c4d554fc6735f9442797527834ae95c51267b (diff)
ecs: compile-time-assert
Diffstat (limited to 'src/serialization-static-ui.cpp')
-rw-r--r--src/serialization-static-ui.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/serialization-static-ui.cpp b/src/serialization-static-ui.cpp
index 7f15b10..e68f2ed 100644
--- a/src/serialization-static-ui.cpp
+++ b/src/serialization-static-ui.cpp
@@ -1,5 +1,6 @@
#include "serialization-static-ui.hpp"
+#include "compile-time-assert.hpp"
#include "ecs.hpp"
#include "font.hpp"
#include "pk.h"
@@ -18,6 +19,7 @@ pk_handle pke_serialize_ui_box_internal(srlztn_serialize_helper *h, pke_ui_box_t
kvec.child_handles.bkt = h->bkt;
h->handle_head.itemIndex++;
+ compt_a<4==sizeof(pke_ui_box_type_data::pke_ui_box_type_data_text)>();
{
kve.key = SRLZTN_UI_BOX_DATA_TEXT_FONT_RENDER_UUID;
s = pk_new<char>(37, h->bkt);
@@ -42,6 +44,7 @@ void pke_deserialize_ui_box_internal(srlztn_deserialize_helper *h, pke_kve_conta
assert(kvec->arr.next == 1);
pk_uuid font_render_uuid = pk_uuid_zed;
+ compt_a<4==sizeof(pke_ui_box_type_data::pke_ui_box_type_data_text)>();
if (strstr(SRLZTN_UI_BOX_DATA_TEXT_FONT_RENDER_UUID, kvec->arr[0].key)) {
kvec->arr[0].val >> font_render_uuid;
}
@@ -72,6 +75,7 @@ pk_handle pke_serialize_ui_box(srlztn_serialize_helper *h, pke_ui_box *box) {
kvec.children.bkt = h->bkt;
h->handle_head.itemIndex++;
+ compt_a<160==sizeof(pke_ui_box)>();
if (box->uuid != pk_uuid_zed && box->uuid != pk_uuid_max) {
kve.key = SRLZTN_UI_BOX_UUID;
s = pk_new<char>(37, h->bkt);
@@ -192,6 +196,7 @@ void pke_deserialize_ui_box(srlztn_deserialize_helper *h, pke_kve_container *kve
pke_ui_box *parent_box = nullptr;
bx.type_data = nullptr;
+ compt_a<160==sizeof(pke_ui_box)>();
for (i = 0; i < kvec->arr.next; ++i) {
kve = &kvec->arr[i];
if (strstr(SRLZTN_UI_BOX_UUID, kve->key)) {