コード例 #1
0
ファイル: pr2_exec.c プロジェクト: Classic-Fortress/server
//===========================================================================
// PR2_SetString
// FIXME for VM
//===========================================================================
intptr_t PR2_SetString(char *s)
{
	qvm_t *qvm;
	intptr_t off;
	if(!sv_vm)
		return PR1_SetString(s);

	switch (sv_vm->type)
	{
	case VM_NONE:
		return PR1_SetString(s);

	case VM_NATIVE:
		return (intptr_t) s;

	case VM_BYTECODE:
		qvm = (qvm_t*)(sv_vm->hInst);
		off = (byte*)s - qvm->ds;
		if (off &(~qvm->ds_mask))
			return 0;

		return off;
		break;
	}

	return 0;
}
コード例 #2
0
ファイル: pr_exec.c プロジェクト: DavidWiberg/ezquake-source
void PR_SetTmpString(string_t* target, const char *s)
{
	static int index1;
	static char tmp[8][2048];

	index1 = (index1 + 1) & 7;

	strlcpy(tmp[index1], s, sizeof(tmp[index1]));
	PR1_SetString(target, tmp[index1]);
}