[gamecode] Use pr_type_names.h for type sizes

The goal of the previous mess of commits. Ruamoko needs to wait until
qfcc has the new types.
This commit is contained in:
Bill Currie 2022-01-18 15:53:31 +09:00
parent 2c52e26d1a
commit 25f8d3a23d
3 changed files with 11 additions and 16 deletions

View file

@ -25,8 +25,12 @@
typedef int32_t pr_string_t;
typedef float pr_float_t;
typedef float pr_vector_t[3];
typedef uint32_t pr_entity_t;
typedef uint32_t pr_field_t;
typedef uint32_t pr_func_t;
typedef uint32_t pr_ptr_t;
typedef float pr_quaternion_t[4];
typedef int32_t pr_int_t;
typedef uint32_t pr_uint_t;
typedef int16_t pr_short_t;

View file

@ -33,22 +33,11 @@
#include "QF/progs.h"
typedef pr_type_t pr_void_t; // so size of void is 1
#define EV_TYPE(type) (sizeof (pr_##type##_t) / sizeof (pr_int_t)),
VISIBLE const pr_ushort_t 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_int
1, // ev_uint
0, // ev_short value in opcode
2, // ev_double
2, // ev_long
2, // ev_ulong
#include "QF/progs/pr_type_names.h"
0, // ev_invalid not a valid/simple type
};

View file

@ -11,8 +11,10 @@ string ty_meta_name[7] = {
"alias",
};
//FIXME use pr_type_names.h
//FIXME use pr_type_names.h, but need to fix unsigned, and add missing types
//#define EV_TYPE(type) sizeof(type),
int pr_type_size[ev_type_count] = {
//#include <QF/progs/pr_type_names.h>
1, // ev_void
1, // ev_string
1, // ev_float