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;
size_t len, i;
if (!name || name[0] == '#' || OPTS_FLAG(SINGLE_VECTOR_DEFS))
return;
- def.type = TYPE_FLOAT;
+ def.type = type;
len = strlen(name);
def.offset = global->codeAddress();
m_code->defs.push_back(def);
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)
- 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;
}
}
if (pushdef) {
m_code->defs.push_back(def);
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);
case TYPE_ENTITY:
if (pushdef) {
m_code->defs.push_back(def);
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;
}
}
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());
}