fteqw/engine/qclib
2008-01-23 01:34:21 +00:00
..
cmdlib.h macros were broken. This removes the warnings when calling the new parsing function with C like seperation.. 2004-11-13 17:33:05 +00:00
comprout.c fixed msvc6 warnings 2006-01-27 08:17:59 +00:00
execloop.h bigfoot: Works for me(TM) 2007-03-11 16:51:45 +00:00
execloop16d.h bigfoot: Works for me(TM) 2007-03-11 16:51:45 +00:00
execloop32.h bigfoot: Works for me(TM) 2007-03-11 16:51:45 +00:00
execloop32d.h bigfoot: Works for me(TM) 2007-03-11 16:51:45 +00:00
gui.h Qux removed to a plugin. 2005-03-01 15:36:23 +00:00
hash.c A few things... f_ruleset stuff, 64bit qvm compatability, added cvars so you can put the built in http server on a custom port, added #warnings to annoy molgrum. 2007-09-17 20:35:39 +00:00
hash.h A few things... f_ruleset stuff, 64bit qvm compatability, added cvars so you can put the built in http server on a custom port, added #warnings to annoy molgrum. 2007-09-17 20:35:39 +00:00
initlib.c Changed the pf_clientstat function and parameters to match the ordering originally documented in the ext_csqc extension I posted on wiki.quakesrc.org, as per krimzon's recommendation. Updated qclib to support querying fields based on their offset rather than purely a name basis, to support the clientstat change. 2008-01-23 01:31:01 +00:00
LICENSE GNU GPL V2 2005-06-01 18:33:06 +00:00
Makefile divVerent's revised fteqcc makefile 2007-11-01 13:02:19 +00:00
pr_comp.h Don't byteswap the beginning of the string table, please. (commited by proxy for Spike) 2007-07-20 17:05:35 +00:00
pr_edict.c stringtonative knows better 2007-11-30 22:58:16 +00:00
pr_exec.c fixing more builds 2007-08-07 17:42:10 +00:00
pr_multi.c s/thier/their 2007-10-05 17:43:26 +00:00
progsint.h Changed the pf_clientstat function and parameters to match the ordering originally documented in the ext_csqc extension I posted on wiki.quakesrc.org, as per krimzon's recommendation. Updated qclib to support querying fields based on their offset rather than purely a name basis, to support the clientstat change. 2008-01-23 01:31:01 +00:00
progslib.h Changed the pf_clientstat function and parameters to match the ordering originally documented in the ext_csqc extension I posted on wiki.quakesrc.org, as per krimzon's recommendation. Updated qclib to support querying fields based on their offset rather than purely a name basis, to support the clientstat change. 2008-01-23 01:31:01 +00:00
progtype.h qc string_t is now an int instead of char *, stringtable is char * instead of int. 2005-05-15 18:49:04 +00:00
qcc.dsp Changed the default build location of fteqccgui debug builds, to a relative path which is likely to exist on more computers than just my desktop. 2008-01-23 01:34:21 +00:00
qcc.h Trying to fix the remaining warnings. Is this correct? Builds that now compiles with no warnings in VS 2005: Debug, Debug Dedicated Server and GLDebug. 2007-08-08 02:37:59 +00:00
qcc_cmdlib.c sizeof(long)==8 2006-11-10 15:48:18 +00:00
qcc_pr_comp.c s/compatable/compatible (take notice that sv_compatablehulls will have a changed name too) 2007-10-05 18:08:47 +00:00
qcc_pr_lex.c Black's fix for #define macro parameters in fteqcc. 2008-01-23 00:37:56 +00:00
qccgui.c s/compatable/compatible (take notice that sv_compatablehulls will have a changed name too) 2007-10-05 18:08:47 +00:00
qccguistuff.c Meh, I'm just going to commit everything. 2006-01-02 23:01:54 +00:00
qccmain.c s/compatable/compatible (take notice that sv_compatablehulls will have a changed name too) 2007-10-05 18:08:47 +00:00
qcd.h Initial Checkin 2004-08-23 01:38:21 +00:00
qcd_main.c SOFTWARE RENDERING IS BROKEN: DO NOT USE ASM VERSION. 2005-02-28 07:16:19 +00:00
qcdecomp.c Renamed vector to _vector to avoid name clashes on Altivec systems. 2005-11-29 13:30:20 +00:00
readme.txt origional -> original. 2005-07-28 15:52:31 +00:00
test.c FrikaC told me of a few bugs in here, so lets use a decent compiler and fix them 2005-11-21 20:53:43 +00:00

Readme for the FTE QCLib

This library is a library for running QuakeC gamecode. It does not provide any builtins itself.

Features:
	* Multiple library instances, enabling server qc, client qc, and menu qc. There is no maximum instance limit other than memory.

	* Addons, for running multiple progs in any individual instance.

	* Field reassignment, allowing a single engine to support multiple subtly different QC APIs. Also makes additional fields easier.

	* Step-by-step debugging. Requires a text editor of some form, however. A printout of the current line is also useful of course.

	* 64bit support. All strings, globals, and fields are allocated in a consecutive addressable section of memory. This also allows pointers and secure access (not implemented yet, but should be relativly easy bar builtins, which are your responsability).

	* Multiple 'threads'. The library allows a builtin to make a duplicate of the current execution state, or to wipe the current state. This allows sleep commands and fork commands. How handy.

	* Integrated QC compiler. FTEQCC comes as part of qclib. By setting up an interface with a specific value, you can cause it to always run, or run only if it detects a source change.

	* Support for different sorts of progs. Namly Hexen2's, kkqwsv's bigprogs, and FTE's extended format with extra opcodes and possibly fully 32bit offsets. The use of kkqwsv's progs is not recommended - this might be removed at some point.




Quirks:
	* don't use multiple instances of fteqcc at the same time. Compilation will fail.
	* 64bit support requires all strings to be allocated by qclib itself, achivable via a method call. Compatability requires a certain ammount of caution.
	* a fair number of methods are obsolete.
	* An overuse of pointers in the API. There are some macros which you can use to hide some of the dereferences.
	* kkqwsv progs are not reliable. Do not try saving the game. Avoid letting your users know of support.
	
	* Builtin structures are different from original quake. You'll need to convert the arguments to qclib style. This change was required for both multiple instances as well as addon support. It should be straightforward enough.
	* Entity fields are accessed via a pointer from the edict_t structure. This was required to place entity fields within the 64bit accessable section. Changing a . to a -> is not a major issue though. However, there are a lot. do a find and replace of ->v. to ->v->
	* FTE's entities are numbers not pointers. This fact is not made into a big feature as it's kinda incompatable with standard quake. Please do not use numbers directly to refer to ents but instead use the EDICT_TO_PROGS macro which will give protection. This is consistant with standard quake.


Basic usage:
	* refer to test.c for a sample on how to set up the library.
	* refer to progslib.h for the things that I've forgotten to mention.
	* Call the InitProgs function to get a handle to the instance. It takes a parameter which should be set up with some fields. You'll require ReadFile, FileSize, Abort and printf for basic execution.
	* Call the configure function to say how much memory to use, and how many progs/addons to support.
	* Load your progs via LoadProgs. Use a crc of 0 to use any. Otherwise progs will be rejected if it doesn't match. Give it a list of progs-specific builtins too. :)
	* Before calling the spawn builtin, call the InitEnts method. It's parameter stating how many maximum entities to spawn. Using a really large quantity is not much of an issue, as they are allocated as required.
	* Before calling InitEnts, you can tell the VM which fields your engine uses (state all basic ones or none). This will place the entity fields in the same order as your engine expects for entvars_t.
	* Obtain pointers to globals, or just use the globals structure directly.
	* Call the ExecuteProgram method to start execution.
	* Call the FindFunction method to find a function to run in the first place.
	* Call the 'globals' method to retrieve a pointer to the globals (you should always use PR_CURRENT here). Set the parameters with the G_INT/G_FLOAT macros and friends. Use OFS_PARM0 - OFS_PARM7 to set params before calling or read inside a builtin. Use OFS_RETURN to read the return value. These macros are hard coded to use a 'pr_globals' symbol, so avoid renaming builtin parameter names.
	* Ask me on IRC when it all starts keeling over.
	* These are the C files that form qclib: pr_edict.c pr_exec.c pr_multi.c initlib.c qcc_pr_comp.c qcc_pr_lex.c qccmain.c qcc_cmdlib.c comprout.c hash.c qcd_main.c qcdecomp.c