From 5e29cecf44ec2000755df74fb47a3df8d589ab96 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 4 Jun 2021 13:29:27 +0900 Subject: [PATCH] [ruamoko] Add pr_type_size array to types.[rh] --- ruamoko/include/types.h | 1 + ruamoko/lib/types.r | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ruamoko/include/types.h b/ruamoko/include/types.h index c2f157e76..19ec0c736 100644 --- a/ruamoko/include/types.h +++ b/ruamoko/include/types.h @@ -92,5 +92,6 @@ typedef struct qfot_type_encodings_s { @extern string ty_meta_name[7]; @extern string pr_type_name[ev_type_count]; +@extern int pr_type_size[ev_type_count]; #endif diff --git a/ruamoko/lib/types.r b/ruamoko/lib/types.r index aa1f65a02..45f51c70e 100644 --- a/ruamoko/lib/types.r +++ b/ruamoko/lib/types.r @@ -11,6 +11,23 @@ string ty_meta_name[7] = { "alias", }; +int pr_type_size[ev_type_count] = { + 1, // ev_void + 1, // ev_string + 1, // ev_float + 3, // ev_vector + 1, // ev_entity + 1, // ev_field + 1, // ev_func + 1, // ev_pointer + 4, // ev_quat + 1, // ev_integer + 1, // ev_uinteger + 0, // ev_short value in opcode + 2, // ev_double + 0, // ev_invalid not a valid/simple type +}; + string pr_type_name[ev_type_count] = { "void", "string", @@ -24,6 +41,6 @@ string pr_type_name[ev_type_count] = { "integer", "uinteger", "short", - "double" + "double", "invalid", };