mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-19 10:00:46 +00:00
fix writing of globaldefs for vector subcomponents so that FTE field remapping works
This commit is contained in:
parent
02b20dbd09
commit
fa7dce495b
1 changed files with 7 additions and 7 deletions
14
ir.cpp
14
ir.cpp
|
@ -3239,7 +3239,7 @@ bool ir_builder::generateGlobalFunctionCode(ir_value *global)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_vector_defs(code_t *code, prog_section_def_t def, const char *name)
|
static void gen_vector_defs(code_t *code, prog_section_def_t def, const char *name, int type)
|
||||||
{
|
{
|
||||||
char *component;
|
char *component;
|
||||||
size_t len, i;
|
size_t len, i;
|
||||||
|
@ -3247,7 +3247,7 @@ static void gen_vector_defs(code_t *code, prog_section_def_t def, const char *na
|
||||||
if (!name || name[0] == '#' || OPTS_FLAG(SINGLE_VECTOR_DEFS))
|
if (!name || name[0] == '#' || OPTS_FLAG(SINGLE_VECTOR_DEFS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
def.type = TYPE_FLOAT;
|
def.type = type;
|
||||||
|
|
||||||
len = strlen(name);
|
len = strlen(name);
|
||||||
|
|
||||||
|
@ -3347,9 +3347,9 @@ bool ir_builder::generateGlobal(ir_value *global, bool islocal)
|
||||||
def.offset = global->codeAddress();
|
def.offset = global->codeAddress();
|
||||||
m_code->defs.push_back(def);
|
m_code->defs.push_back(def);
|
||||||
if (global->m_vtype == TYPE_VECTOR)
|
if (global->m_vtype == TYPE_VECTOR)
|
||||||
gen_vector_defs(m_code.get(), def, global->m_name.c_str());
|
gen_vector_defs(m_code.get(), def, global->m_name.c_str(), TYPE_FLOAT);
|
||||||
else if (global->m_vtype == TYPE_FIELD && global->m_fieldtype == TYPE_VECTOR)
|
else if (global->m_vtype == TYPE_FIELD && global->m_fieldtype == TYPE_VECTOR)
|
||||||
gen_vector_defs(m_code.get(), def, global->m_name.c_str());
|
gen_vector_defs(m_code.get(), def, global->m_name.c_str(), TYPE_FIELD);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3391,7 +3391,7 @@ bool ir_builder::generateGlobal(ir_value *global, bool islocal)
|
||||||
if (pushdef) {
|
if (pushdef) {
|
||||||
m_code->defs.push_back(def);
|
m_code->defs.push_back(def);
|
||||||
if (global->m_fieldtype == TYPE_VECTOR)
|
if (global->m_fieldtype == TYPE_VECTOR)
|
||||||
gen_vector_defs(m_code.get(), def, global->m_name.c_str());
|
gen_vector_defs(m_code.get(), def, global->m_name.c_str(), TYPE_FIELD);
|
||||||
}
|
}
|
||||||
return gen_global_field(m_code.get(), global);
|
return gen_global_field(m_code.get(), global);
|
||||||
case TYPE_ENTITY:
|
case TYPE_ENTITY:
|
||||||
|
@ -3457,7 +3457,7 @@ bool ir_builder::generateGlobal(ir_value *global, bool islocal)
|
||||||
if (pushdef) {
|
if (pushdef) {
|
||||||
m_code->defs.push_back(def);
|
m_code->defs.push_back(def);
|
||||||
def.type &= ~DEF_SAVEGLOBAL;
|
def.type &= ~DEF_SAVEGLOBAL;
|
||||||
gen_vector_defs(m_code.get(), def, global->m_name.c_str());
|
gen_vector_defs(m_code.get(), def, global->m_name.c_str(), TYPE_FLOAT);
|
||||||
}
|
}
|
||||||
return global->m_code.globaladdr >= 0;
|
return global->m_code.globaladdr >= 0;
|
||||||
}
|
}
|
||||||
|
@ -3560,7 +3560,7 @@ static bool ir_builder_gen_field(ir_builder *self, ir_value *field)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field->m_fieldtype == TYPE_VECTOR) {
|
if (field->m_fieldtype == TYPE_VECTOR) {
|
||||||
gen_vector_defs (self->m_code.get(), def, field->m_name.c_str());
|
gen_vector_defs (self->m_code.get(), def, field->m_name.c_str(), TYPE_FIELD);
|
||||||
gen_vector_fields(self->m_code.get(), fld, field->m_name.c_str());
|
gen_vector_fields(self->m_code.get(), fld, field->m_name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue