From 4c60d97a2718ab4e689de36105b1267d4806e3d4 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 16 Oct 2004 14:02:43 +0000 Subject: [PATCH] playing with enum stuff. getting it actually working properly. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@346 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qcc_pr_comp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index 0f74e7007..a53b897c5 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -6339,11 +6339,11 @@ void QCC_PR_ParseDefs (char *classname) { if (pr_token_type != tt_immediate && pr_immediate_type->type != ev_float) { - def = QCC_PR_GetDef(NULL, name, NULL, false, 0); + def = QCC_PR_GetDef(NULL, QCC_PR_ParseName(), NULL, false, 0); if (def) { if (!def->constant) - QCC_PR_ParseError(ERR_NOTANUMBER, "enum - %s is not a constant", name); + QCC_PR_ParseError(ERR_NOTANUMBER, "enum - %s is not a constant", def->name); else v = G_FLOAT(def->ofs); } @@ -6355,6 +6355,7 @@ void QCC_PR_ParseDefs (char *classname) QCC_PR_Lex(); } def = QCC_PR_GetDef(type_float, name, pr_scope, true, 1); + def->constant = true; G_FLOAT(def->ofs) = v; v++; @@ -6380,11 +6381,11 @@ void QCC_PR_ParseDefs (char *classname) { if (pr_token_type != tt_immediate && pr_immediate_type->type != ev_float) { - def = QCC_PR_GetDef(NULL, name, NULL, false, 0); + def = QCC_PR_GetDef(NULL, QCC_PR_ParseName(), NULL, false, 0); if (def) { if (!def->constant) - QCC_PR_ParseError(ERR_NOTANUMBER, "enumflags - %s is not a constant", name); + QCC_PR_ParseError(ERR_NOTANUMBER, "enumflags - %s is not a constant", def->name); else v = G_FLOAT(def->ofs); } @@ -6412,6 +6413,7 @@ void QCC_PR_ParseDefs (char *classname) QCC_PR_Lex(); } def = QCC_PR_GetDef(type_float, name, pr_scope, true, 1); + def->constant = true; G_FLOAT(def->ofs) = v; v*=2;