[ruamoko] Use pr_type_names.h for Ruamoko

Keeping the two sets of definitions in sync has always been a pain.
This commit is contained in:
Bill Currie 2022-01-18 14:21:09 +09:00
parent 8a9911bf61
commit 2f6c3c8ffb
4 changed files with 12 additions and 27 deletions

View file

@ -316,9 +316,11 @@ if test "$ENABLE_tools_qfcc" = "yes" -a "$ENABLE_tools_pak" = "yes"; then
QF_NEED(top, [ruamoko])
qfac_qfcc_include_qf="\$(qfcc_include_qf)"
qfac_qfcc_include_qf_input="\$(qfcc_include_qf_input)"
qfac_qfcc_include_qf_progs="\$(qfcc_include_qf_progs)"
fi
QF_SUBST(qfac_qfcc_include_qf)
QF_SUBST(qfac_qfcc_include_qf_input)
QF_SUBST(qfac_qfcc_include_qf_progs)
if test x"${top_need_libs}" = xyes; then
qfac_include_qf="\$(include_qf)"

View file

@ -198,6 +198,7 @@ include_qf_vulkan = \
# headers shared with ruamoko
qfcc_include_qf = include/QF/input.h
qfcc_include_qf_progs = include/QF/progs/pr_type_names.h
qfcc_include_qf_input = \
include/QF/input/binding.h \
include/QF/input/imt.h
@ -225,8 +226,10 @@ qf_vulkan_include_HEADERS = @qfac_include_qf_vulkan@
ruamoko_qf_includedir = $(ruamoko_includedir)/QF
ruamoko_qf_input_includedir = $(ruamoko_includedir)/QF/input
ruamoko_qf_progs_includedir = $(ruamoko_includedir)/QF/progs
ruamoko_qf_include_HEADERS = @qfac_qfcc_include_qf@
ruamoko_qf_input_include_HEADERS = @qfac_qfcc_include_qf_input@
ruamoko_qf_progs_include_HEADERS = @qfac_qfcc_include_qf_progs@
EXTRA_HEADERS += \
$(include_qf) \

View file

@ -1,21 +1,9 @@
#ifndef __types_h
#define __types_h
#define EV_TYPE(type) ev_##type,
typedef enum {
ev_void,
ev_string,
ev_float,
ev_vector,
ev_entity,
ev_field,
ev_func,
ev_pointer, // end of v6 types
ev_quat,
ev_int,
ev_uint,
ev_short, // value is embedded in the opcode
ev_double,
#include <QF/progs/pr_type_names.h>
ev_invalid, // invalid type. used for instruction checking
ev_type_count // not a type, gives number of types
} etype_t;

View file

@ -11,6 +11,7 @@ string ty_meta_name[7] = {
"alias",
};
//FIXME use pr_type_names.h
int pr_type_size[ev_type_count] = {
1, // ev_void
1, // ev_string
@ -25,22 +26,13 @@ int pr_type_size[ev_type_count] = {
1, // ev_uinteger
0, // ev_short value in opcode
2, // ev_double
2, // ev_long
2, // ev_ulong
0, // ev_invalid not a valid/simple type
};
#define EV_TYPE(type) #type,
string pr_type_name[ev_type_count] = {
"void",
"string",
"float",
"vector",
"entity",
"field",
"function",
"pointer",
"quaternion",
"integer",
"uinteger",
"short",
"double",
#include <QF/progs/pr_type_names.h>
"invalid",
};