mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-25 02:52:06 +00:00
Print data being loaded from an entity.
This commit is contained in:
parent
232d2f7e18
commit
2f504709dd
2 changed files with 30 additions and 10 deletions
|
@ -882,6 +882,24 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents)
|
||||||
case 'O':
|
case 'O':
|
||||||
str = va ("%04x", addr + (short) opval);
|
str = va ("%04x", addr + (short) opval);
|
||||||
break;
|
break;
|
||||||
|
case 'E':
|
||||||
|
{
|
||||||
|
edict_t *ed;
|
||||||
|
opval = pr->pr_globals[s->a].entity_var;
|
||||||
|
parm_ind = pr->pr_globals[s->b].uinteger_var;
|
||||||
|
if (parm_ind < pr->progs->entityfields
|
||||||
|
&& opval >= 0
|
||||||
|
&& opval < pr->pr_edictareasize) {
|
||||||
|
ed = PROG_TO_EDICT (pr, opval);
|
||||||
|
opval = &ed->v[parm_ind] - pr->pr_globals;
|
||||||
|
} else {
|
||||||
|
str = "bad entity.field";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
str = global_string (pr, opval, optype, contents & 1);
|
||||||
|
str = va ("%d %d %s", s->a, s->b, str);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,7 @@ VISIBLE const char *pr_type_name[ev_type_count] = {
|
||||||
// P function parameter
|
// P function parameter
|
||||||
// F function (must come before any P)
|
// F function (must come before any P)
|
||||||
// R return value
|
// R return value
|
||||||
|
// E entity + field (%Eab)
|
||||||
//
|
//
|
||||||
// a operand a
|
// a operand a
|
||||||
// b operand b
|
// b operand b
|
||||||
|
@ -266,52 +267,52 @@ VISIBLE opcode_t pr_opcodes[] = {
|
||||||
{".", "load.f", OP_LOAD_F, false,
|
{".", "load.f", OP_LOAD_F, false,
|
||||||
ev_entity, ev_field, ev_float,
|
ev_entity, ev_field, ev_float,
|
||||||
PROG_ID_VERSION,
|
PROG_ID_VERSION,
|
||||||
"%Ga.%Gb, %gc",
|
"%Ga.%Gb(%Ec), %gc",//FIXME %E more flexible?
|
||||||
},
|
},
|
||||||
{".", "load.v", OP_LOAD_V, false,
|
{".", "load.v", OP_LOAD_V, false,
|
||||||
ev_entity, ev_field, ev_vector,
|
ev_entity, ev_field, ev_vector,
|
||||||
PROG_ID_VERSION,
|
PROG_ID_VERSION,
|
||||||
"%Ga.%Gb, %gc",
|
"%Ga.%Gb(%Ec), %gc",
|
||||||
},
|
},
|
||||||
{".", "load.q", OP_LOAD_Q, false,
|
{".", "load.q", OP_LOAD_Q, false,
|
||||||
ev_entity, ev_field, ev_quat,
|
ev_entity, ev_field, ev_quat,
|
||||||
PROG_ID_VERSION,
|
PROG_ID_VERSION,
|
||||||
"%Ga.%Gb, %gc",
|
"%Ga.%Gb(%Ec), %gc",
|
||||||
},
|
},
|
||||||
{".", "load.s", OP_LOAD_S, false,
|
{".", "load.s", OP_LOAD_S, false,
|
||||||
ev_entity, ev_field, ev_string,
|
ev_entity, ev_field, ev_string,
|
||||||
PROG_ID_VERSION,
|
PROG_ID_VERSION,
|
||||||
"%Ga.%Gb, %gc",
|
"%Ga.%Gb(%Ec), %gc",
|
||||||
},
|
},
|
||||||
{".", "load.ent", OP_LOAD_ENT, false,
|
{".", "load.ent", OP_LOAD_ENT, false,
|
||||||
ev_entity, ev_field, ev_entity,
|
ev_entity, ev_field, ev_entity,
|
||||||
PROG_ID_VERSION,
|
PROG_ID_VERSION,
|
||||||
"%Ga.%Gb, %gc",
|
"%Ga.%Gb(%Ec), %gc",
|
||||||
},
|
},
|
||||||
{".", "load.fld", OP_LOAD_FLD, false,
|
{".", "load.fld", OP_LOAD_FLD, false,
|
||||||
ev_entity, ev_field, ev_field,
|
ev_entity, ev_field, ev_field,
|
||||||
PROG_ID_VERSION,
|
PROG_ID_VERSION,
|
||||||
"%Ga.%Gb, %gc",
|
"%Ga.%Gb(%Ec), %gc",
|
||||||
},
|
},
|
||||||
{".", "load.fn", OP_LOAD_FN, false,
|
{".", "load.fn", OP_LOAD_FN, false,
|
||||||
ev_entity, ev_field, ev_func,
|
ev_entity, ev_field, ev_func,
|
||||||
PROG_ID_VERSION,
|
PROG_ID_VERSION,
|
||||||
"%Ga.%Gb, %gc",
|
"%Ga.%Gb(%Ec), %gc",
|
||||||
},
|
},
|
||||||
{".", "load.i", OP_LOAD_I, false,
|
{".", "load.i", OP_LOAD_I, false,
|
||||||
ev_entity, ev_field, ev_integer,
|
ev_entity, ev_field, ev_integer,
|
||||||
PROG_VERSION,
|
PROG_VERSION,
|
||||||
"%Ga.%Gb, %gc",
|
"%Ga.%Gb(%Ec), %gc",
|
||||||
},
|
},
|
||||||
{".", "load.u", OP_LOAD_U, false,
|
{".", "load.u", OP_LOAD_U, false,
|
||||||
ev_entity, ev_field, ev_uinteger,
|
ev_entity, ev_field, ev_uinteger,
|
||||||
PROG_VERSION,
|
PROG_VERSION,
|
||||||
"%Ga.%Gb, %gc",
|
"%Ga.%Gb(%Ec), %gc",
|
||||||
},
|
},
|
||||||
{".", "load.p", OP_LOAD_P, false,
|
{".", "load.p", OP_LOAD_P, false,
|
||||||
ev_entity, ev_field, ev_pointer,
|
ev_entity, ev_field, ev_pointer,
|
||||||
PROG_VERSION,
|
PROG_VERSION,
|
||||||
"%Ga.%Gb, %gc",
|
"%Ga.%Gb(%Ec), %gc",
|
||||||
},
|
},
|
||||||
|
|
||||||
{".", "loadb.f", OP_LOADB_F, false,
|
{".", "loadb.f", OP_LOADB_F, false,
|
||||||
|
@ -419,6 +420,7 @@ VISIBLE opcode_t pr_opcodes[] = {
|
||||||
{"&", "address", OP_ADDRESS, false,
|
{"&", "address", OP_ADDRESS, false,
|
||||||
ev_entity, ev_field, ev_pointer,
|
ev_entity, ev_field, ev_pointer,
|
||||||
PROG_ID_VERSION,
|
PROG_ID_VERSION,
|
||||||
|
"%Ga.%Gb, %gc",
|
||||||
},
|
},
|
||||||
|
|
||||||
{"&", "address.f", OP_ADDRESS_F, false,
|
{"&", "address.f", OP_ADDRESS_F, false,
|
||||||
|
|
Loading…
Reference in a new issue