r3361 - in trunk/data/qcsrc/client: . old
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Feb 12 15:47:38 EST 2008
Author: urre
Date: 2008-02-12 15:47:36 -0500 (Tue, 12 Feb 2008)
New Revision: 3361
Added:
trunk/data/qcsrc/client/Defs.qc
trunk/data/qcsrc/client/Main.qc
trunk/data/qcsrc/client/View.qc
trunk/data/qcsrc/client/credit.txt
trunk/data/qcsrc/client/csqc_builtins.qc
trunk/data/qcsrc/client/csqc_constants.qc
trunk/data/qcsrc/client/old/
trunk/data/qcsrc/client/old/csqc_builtins.h
trunk/data/qcsrc/client/old/csqc_constants.h
trunk/data/qcsrc/client/old/defs.c
trunk/data/qcsrc/client/old/helpers.c
trunk/data/qcsrc/client/old/main.c
trunk/data/qcsrc/client/old/progs.src
trunk/data/qcsrc/client/old/vars.h
trunk/data/qcsrc/client/old/view.c
Removed:
trunk/data/qcsrc/client/csqc_builtins.h
trunk/data/qcsrc/client/csqc_constants.h
trunk/data/qcsrc/client/defs.c
trunk/data/qcsrc/client/helpers.c
trunk/data/qcsrc/client/main.c
trunk/data/qcsrc/client/vars.h
trunk/data/qcsrc/client/view.c
Modified:
trunk/data/qcsrc/client/progs.src
Log:
Added a clientside QuakeC base by Dresk and myself. Included an example of a networked clientside client
Added: trunk/data/qcsrc/client/Defs.qc
===================================================================
--- trunk/data/qcsrc/client/Defs.qc (rev 0)
+++ trunk/data/qcsrc/client/Defs.qc 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,171 @@
+#pragma flag off fastarrays // make dp behave with new fteqcc versions. remove when dp bug with fteqcc fastarrays is fixed
+
+
+//NOTE: THIS IS AN INTERFACE FILE. DO NOT EDIT.
+//MODIFYING THIS FILE CAN RESULT IN CRC ERRORS.
+//YOU HAVE BEEN WARNED.
+
+//feel free to look though. :)
+
+
+
+
+#define CSQC 1
+
+/*
+==============================================================================
+
+ SOURCE FOR GLOBALVARS_T C STRUCTURE
+
+==============================================================================
+*/
+
+//
+// system globals
+//
+entity self;
+entity other;
+entity world;
+float time;
+float frametime;
+
+float player_localentnum; //the entnum
+float player_localnum; //the playernum
+float maxclients; //a constant filled in by the engine. gah, portability eh?
+
+float clientcommandframe; //player movement
+float servercommandframe; //clientframe echoed off the server
+
+string mapname;
+
+//
+// global variables set by built in functions
+//
+vector v_forward, v_up, v_right; // set by makevectors()
+
+// set by traceline / tracebox
+float trace_allsolid;
+float trace_startsolid;
+float trace_fraction;
+vector trace_endpos;
+vector trace_plane_normal;
+float trace_plane_dist;
+entity trace_ent;
+float trace_inopen;
+float trace_inwater;
+
+//
+// required prog functions
+//
+void() CSQC_Init;
+void() CSQC_Shutdown;
+float(float f, float t, float n) CSQC_InputEvent;
+void() CSQC_UpdateView;
+float(string s) CSQC_ConsoleCommand;
+
+//these fields are read and set by the default player physics
+vector pmove_org;
+vector pmove_vel;
+vector pmove_mins;
+vector pmove_maxs;
+//retrieved from the current movement commands (read by player physics)
+float input_timelength;
+vector input_angles;
+vector input_movevalues; //forwards, right, up.
+float input_buttons; //attack, use, jump (default physics only uses jump)
+
+float movevar_gravity;
+float movevar_stopspeed;
+float movevar_maxspeed;
+float movevar_spectatormaxspeed; //used by NOCLIP movetypes.
+float movevar_accelerate;
+float movevar_airaccelerate;
+float movevar_wateraccelerate;
+float movevar_friction;
+float movevar_waterfriction;
+float movevar_entgravity; //the local player's gravity field. Is a multiple (1 is the normal value)
+
+//================================================
+void end_sys_globals; // flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+ SOURCE FOR ENTVARS_T C STRUCTURE
+
+==============================================================================
+*/
+
+//
+// system fields (*** = do not set in prog code, maintained by C code)
+//
+.float modelindex; // *** model index in the precached list
+.vector absmin, absmax; // *** origin + mins / maxs
+
+.float entnum; // *** the ent number as on the server
+.float drawmask;
+.void() predraw;
+
+.float movetype;
+.float solid;
+
+.vector origin; // ***
+.vector oldorigin; // ***
+.vector velocity;
+.vector angles;
+.vector avelocity;
+
+.string classname; // spawn function
+.string model;
+.float frame;
+.float skin;
+.float effects;
+
+.vector mins, maxs; // bounding box extents reletive to origin
+.vector size; // maxs - mins
+
+.void() touch;
+.void() use;
+.void() think;
+.void() blocked; // for doors or plats, called when can't push other
+
+.float nextthink;
+
+.entity chain;
+
+.string netname;
+
+.entity enemy;
+
+.float flags;
+
+.float colormap;
+
+.entity owner; // who launched a missile
+
+//================================================
+void end_sys_fields; // flag for structure dumping
+//================================================
+
+// Additional OPTIONAL Fields and Globals
+float intermission;
+float sb_showscores;
+.string message;
+float coop;
+float deathmatch;
+
+float dmg_take;
+float dmg_save;
+vector dmg_origin;
+
+// Darkplaces Render Modifications
+.float alpha;
+.float renderflags;
+.vector colormod;
+.float scale;
+
+// Basic variables
+.float enttype; // entity type sent from server
+.float sv_entnum; // entity number sent from server
+float vid_conwidth, vid_conheight;
\ No newline at end of file
Added: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc (rev 0)
+++ trunk/data/qcsrc/client/Main.qc 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,129 @@
+// --------------------------------------------------------------------------
+// BEGIN REQUIRED CSQC FUNCTIONS
+
+// CSQC_Init : Called every time the CSQC code is initialized (essentially at map load)
+// Useful for precaching things
+void CSQC_Init(void)
+{
+}
+// CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
+void CSQC_Shutdown(void)
+{
+}
+// CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercmd" function
+// Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
+float CSQC_ConsoleCommand(string strMessage)
+{
+ local float nReturn;
+ local string s;
+ local vector v;
+ nReturn = FALSE;
+
+ // Tokenize String
+ tokenize(strMessage);
+
+ // Acquire Command
+ local string strCmd;
+ strCmd = argv(0);
+
+ /*
+ if (strCmd == "+forward")
+ {
+ // blah
+ nReturn = TRUE;
+ }
+ */
+ return nReturn;
+}
+// CSQC_InputEvent : Used to perform actions based on any key pressed, key released and mouse on the client.
+// Return value should be 1 if CSQC handled the input, otherwise return 0 to have the input passed to the engine.
+// All keys are in ascii.
+// bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
+// In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
+// In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
+float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
+{
+ local float bSkipKey;
+ bSkipKey = false;
+ return bSkipKey;
+}
+
+// END REQUIRED CSQC FUNCTIONS
+// --------------------------------------------------------------------------
+
+// --------------------------------------------------------------------------
+// BEGIN OPTIONAL CSQC FUNCTIONS
+
+// CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
+// The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
+void(float bIsNewEntity) CSQC_Ent_Update =
+{
+ self.enttype = ReadByte();
+ /*
+ if (self.enttype == ENT_CLIENT)
+ {
+ setmodelindex(self, ReadShort());
+ self.origin_x = ReadCoord();
+ self.origin_y = ReadCoord();
+ self.origin_z = ReadCoord();
+ self.angles_x = ReadCoord();
+ self.angles_y = ReadCoord();
+ self.angles_z = ReadCoord();
+ self.sv_entnum = ReadShort();
+ setorigin(self, self.origin); // relink
+ if (bIsNewEntity)
+ {
+ setsize(self, '0 0 0', '0 0 0');
+ self.drawmask = MASK_NORMAL;
+ self.think = Client_Think;
+ self.nextthink = time;
+ }
+ }
+ else
+ error("unknown entity type in CSQC_Ent_Update\n");
+ */
+};
+// CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed. Essentially call remove(self) as well.
+void CSQC_Ent_Remove()
+{
+ remove(self);
+}
+// CSQC_Parse_StuffCmd : Provides the stuffcmd string in the first parameter that the server provided. To execute standard behavior, simply execute localcmd with the string.
+void CSQC_Parse_StuffCmd(string strMessage)
+{
+ localcmd(strMessage);
+}
+// CSQC_Parse_Print : Provides the print string in the first parameter that the server provided. To execute standard behavior, simply execute print with the string.
+void CSQC_Parse_Print(string strMessage)
+{
+ print(strMessage);
+}
+// CSQC_Parse_CenterPrint : Provides the centerprint string in the first parameter that the server provided. To execute standard behavior, simply execute cprint with the string.
+void CSQC_Parse_CenterPrint(string strMessage)
+{
+ cprint(strMessage);
+}
+// CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
+// You must ALWAYS first acquire the temporary ID, which is sent as a byte.
+// Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
+float CSQC_Parse_TempEntity()
+{
+ local float bHandled;
+ bHandled = true;
+ // Acquire TE ID
+ local float nTEID;
+ nTEID = ReadByte();
+
+ switch(nTEID)
+ {
+ //case TE_GUNSHOT:
+ // Do something cool with TE_GUNSHOT!
+ // break;
+ default:
+ // No special logic for this temporary entity; return 0 so the engine can handle it
+ bHandled = false;
+ break;
+ }
+
+ return bHandled;
+}
\ No newline at end of file
Added: trunk/data/qcsrc/client/View.qc
===================================================================
--- trunk/data/qcsrc/client/View.qc (rev 0)
+++ trunk/data/qcsrc/client/View.qc 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,42 @@
+// CSQC_UpdateView - Called every rendered frame on the client. Useful for HUD drawing operations.
+void CSQC_UpdateView(void)
+{
+ // ALWAYS Clear Current Scene First
+ R_ClearScene();
+
+ // Assign Standard Viewflags
+ // Draw the World (and sky)
+ R_SetView(VF_DRAWWORLD, 1);
+ // Draw the Crosshair
+ R_SetView(VF_DRAWCROSSHAIR, 1);
+ // Draw the Engine Status Bar (the default Quake HUD)
+ R_SetView(VF_DRAWENGINESBAR, 1);
+
+ // Set the console size vars
+ vid_conwidth = cvar("vid_conwidth");
+ vid_conheight = cvar("vid_conheight");
+
+ // Update the mouse position
+ /*
+ mousepos_x = vid_conwidth;
+ mousepos_y = vid_conheight;
+ mousepos = mousepos*0.5 + getmousepos();
+ */
+
+ // Update the camera
+ /*
+ UpdateCamera();
+ R_SetView(VF_ORIGIN, self.origin);
+ R_SetView(VF_ANGLES, self.angles);
+ */
+
+ // Setup Entities to be Rendered (include all base types; normal, engine and viewmodels)
+ R_AddEntities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS);
+
+ // Render the Scene
+ R_RenderScene();
+
+ // Draw the mouse cursor
+ // NOTE: drawpic must happen after R_RenderScene for some reason
+ //drawpic(mousepos, "gfx/cursor.tga", '11 14 0', '1 1 1', 1, 0);
+}
\ No newline at end of file
Added: trunk/data/qcsrc/client/credit.txt
===================================================================
--- trunk/data/qcsrc/client/credit.txt (rev 0)
+++ trunk/data/qcsrc/client/credit.txt 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,3 @@
+Credits go to Dresk for putting this CSQC scratch source together.
+
+and Urre :o
\ No newline at end of file
Deleted: trunk/data/qcsrc/client/csqc_builtins.h
===================================================================
--- trunk/data/qcsrc/client/csqc_builtins.h 2008-02-12 17:28:43 UTC (rev 3360)
+++ trunk/data/qcsrc/client/csqc_builtins.h 2008-02-12 20:47:36 UTC (rev 3361)
@@ -1,239 +0,0 @@
-void (vector ang) makevectors = #1;
-void(entity e, vector o) setorigin = #2;
-void (entity e, string m) setmodel = #3;
-
-void () break = #6;
-float () random = #7;
-void (entity e, float chan, string samp, float vol, float atten) sound = #8;
-vector (vector v) normalize = #9;
-void (string e) error = #10;
-void (string e) objerror = #11;
-float (vector v) vlen = #12;
-float (vector v) vectoyaw = #13;
-entity () spawn = #14;
-void (entity e) remove = #15;
-
-void (vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
-
-entity (entity start, .string fld, string match) find = #18;
-string (string s) precache_sound = #19;
-string (string s) precache_model = #20;
-
-void (string s) dprint = #25;
-string (float f) ftos = #26;
-string (vector v) vtos = #27;
-void () coredump = #28;
-void () traceon = #29;
-void () traceoff = #30;
-void (entity e) eprint = #31;
-
-float (float v) rint = #36;
-float (float v) floor = #37;
-float (float v) ceil = #38;
-
-float (vector v) pointcontents = #41;
-float (float f) fabs = #43;
-
-float (string s) cvar = #45;
-void (string s, ...) localcmd = #46;
-entity (entity e) nextent = #47;
-
-vector (vector v) vectoangles = #51;
-
-void (string var, string val) cvar_set = #72;
-
-
-float() ReadByte = #360;
-float() ReadChar = #361;
-float() ReadShort = #362;
-float() ReadLong = #363;
-float() ReadCoord = #364;
-float() ReadAngle = #365;
-string() ReadString = #366; //warning: this returns a temporary!
-
-float(string s) stof = #81;
-
-
-void (vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
-float (string name, string value) registercvar = #93;
-
-entity (entity start, .entity fld, entity match) findentity = #98;
-entity (entity start, .float fld, float match) findfloat = #98;
-
-float (string s) checkextension = #99;
-
-float (string filename, float mode) fopen = #110;
-void (float fhandle) fclose = #111;
-string (float fhandle) fgets = #112;
-void (float fhandle, string s) fputs = #113;
-float (string s) strlen = #114;
-string (...) strcat = #115;
-string (string s, float start, float length) substring = #116;
-vector (string s) stov = #117;
-string (string s) strzone = #118;
-void (string s) strunzone = #119;
-
-void () R_ClearScene = #300;
-void (float mask) R_AddEntities = #301;
-void (entity e) R_AddEntity = #302;
-float (float property, ...) R_SetView = #303;
-void () R_RenderScene = #304;
-void (vector org, float radius, vector rgb) R_AddDynamicLight = #305;
-void () R_CalcRefDef = #306;
-
-vector (vector v) cs_unproject = #310;
-vector (vector v) cs_project = #311;
-
-void drawline(float width, vector pos1, vector pos2, vector rgb, float alpha, float flags) = #315;
-float iscachedpic(string name) = #316;
-string precache_pic(string name, ...) = #317;
-vector drawgetimagesize(string pic) = #318;
-void freepic(string name) = #319;
-float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #320;
-float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #321;
-float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #322;
-float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #323;
-void drawsetcliparea(float x, float y, float width, float height) = #324;
-void drawresetcliparea(void) = #325;
-
-
-float (float statnum) getstatf = #330;
-float (float statnum) getstati = #331;
-string (float statnum) getstats = #332;
-
-void (entity e, float i) setmodelindex = #333;
-string (float i) modelnameforindex = #334;
-
-float(string efname) particleseffectforname = #335;
-void(entity ent, float effectnum, vector start, vector end, ...) trailparticles = #336;
-void (float efnum, vector org, vector vel, float countmultiplier) pointparticles = #337;
-
-void (string s, ...) cprint = #338;
-void (string s, ...) print = #339;
-
-void (float scale) setsensitivityscale = #347;
-
-
-void (float framenum) RetrieveMovementFrame = #345;
-void () DefaultPlayerPhysics = #347;
-
-string (float playernum, string key) getplayerkey = #348;
-void (string cmdname) registercmd = #352;
-vector () getmousepos = #344;
-
-string (string s) uncolorstring = #170;
-
-float () playernum = #354;
-
-void (vector org, vector forward, vector right, vector up) setlistener = #351;
-
-float (vector start, vector end, float ignore, float csqcents) selecttraceline = #355;
-float () isdemo = #349;
-float () isserver = #350;
-
-void (float f) setwantsmousemove = #343;
-string (float key) getkeybind = #342;
-string (float f) chr = #78;
-
-vector (vector org) getlight = #92;
-
-entity (.string fld, string match) findchain = #402;
-entity (.float fld, float match) findchainflags = #450;
-entity (.entity fld, entity match) findchainentity = #403;
-entity (.float fld, float match) findchainfloat = #403;
-entity (entity start, .entity fld, float match) findflags = #449;
-
-float (string pattern, float caseinsensitive, float quiet) search_begin = #444;
-void (float handle) search_end = #445;
-float (float handle) search_getsize = #446;
-string (float handle, float num) search_getfilename = #447;
-
-
-float (entity e, float s) getsurfacenumpoints = #434;
-vector (entity e, float s, float n) getsurfacepoint = #435;
-vector (entity e, float s) getsurfacenormal = #436;
-string (entity e, float s) getsurfacetexture = #437;
-float (entity e, vector p) getsurfacenearpoint = #438;
-vector (entity e, float s, vector p) getsurfaceclippedpoint = #439;
-
-float (float a, float b) min = #94;
-float (float a, float b, float c) min3 = #94;
-float (float a, float b, float c, float d) min4 = #94;
-float (float a, float b, float c, float d, float e) min5 = #94;
-float (float a, float b, float c, float d, float e, float f) min6 = #94;
-float (float a, float b, float c, float d, float e, float f, float g) min7 = #94;
-float (float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
-float (float a, float b) max = #95;
-float (float a, float b, float c) max3 = #95;
-float (float a, float b, float c, float d) max4 = #95;
-float (float a, float b, float c, float d, float e) max5 = #95;
-float (float a, float b, float c, float d, float e, float f) max6 = #95;
-float (float a, float b, float c, float d, float e, float f, float g) max7 = #95;
-float (float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
-float (float minimum, float val, float maximum) bound = #96;
-
-vector () randomvec = #91;
-
-float (float val) sin = #60;
-float (float val) cos = #61;
-float (float val) sqrt = #62;
-float (float a, float b) pow = #97;
-
-void (vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
-
-void (vector org, vector velocity, float howmany) te_blood = #405;
-void (vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
-void (vector org, float radius, float lifetime, vector color) te_customflash = #417;
-void(vector org, vector color) te_explosionrgb = #407;
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
-void(vector org) te_plasmaburn = #433;
-void(vector org) te_gunshotquad = #412;
-void(vector org) te_spikequad = #413;
-void(vector org) te_superspikequad = #414;
-void(vector org) te_explosionquad = #415;
-void(vector org) te_smallflash = #416;
-void(vector org, vector vel, float howmany) te_spark = #411;
-
-void(vector org) te_gunshot = #418;
-void(vector org) te_spike = #419;
-void(vector org) te_superspike = #420;
-void(vector org) te_explosion = #421;
-void(vector org) te_tarexplosion = #422;
-void(vector org) te_wizspike = #423;
-void(vector org) te_knightspike = #424;
-void(vector org) te_lavasplash = #425;
-void(vector org) te_teleport = #426;
-void(vector org, float color, float colorlength) te_explosion2 = #427;
-void(entity own, vector start, vector end) te_lightning1 = #428;
-void(entity own, vector start, vector end) te_lightning2 = #429;
-void(entity own, vector start, vector end) te_lightning3 = #430;
-void(entity own, vector start, vector end) te_beam = #431;
-
-float (entity ent, string tagname) gettagindex = #451;
-vector (entity ent, float tagindex) gettaginfo = #452;
-
-float (string s) tokenize = #441;
-string (float argnum) argv = #442;
-
-string (string s) cvar_string = #448;
-
-float () buf_create = #460;
-void (float bufhandle) buf_del = #461;
-float (float bufhandle) buf_getsize = #462;
-void (float bufhandle_from, float bufhandle_to) buf_copy = #463;
-void (float bufhandle, float sortpower, float backward) buf_sort = #464;
-string (float bufhandle, string glue) buf_implode = #465;
-string (float bufhandle, float string_index) bufstr_get = #466;
-void (float bufhandle, float string_index, string str) bufstr_set = #467;
-float (float bufhandle, string str, float order) bufstr_add = #468;
-void (float bufhandle, float string_index) bufstr_free = #469;
-
-float () onground = #355;
-
-void(string texturename, ...) R_BeginPolygon = #306;
-void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307;
-void() R_EndPolygon = #308;
-
-float(string s, float num) charindex = #356;
Added: trunk/data/qcsrc/client/csqc_builtins.qc
===================================================================
--- trunk/data/qcsrc/client/csqc_builtins.qc (rev 0)
+++ trunk/data/qcsrc/client/csqc_builtins.qc 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,249 @@
+void (vector ang) makevectors = #1;
+void(entity e, vector o) setorigin = #2;
+void (entity e, string m) setmodel = #3;
+void(entity e, vector min, vector max) setsize = #4;
+
+void () break = #6;
+float () random = #7;
+void (entity e, float chan, string samp, float vol, float atten) sound = #8;
+vector (vector v) normalize = #9;
+void (string e) error = #10;
+void (string e) objerror = #11;
+float (vector v) vlen = #12;
+float (vector v) vectoyaw = #13;
+entity () spawn = #14;
+void (entity e) remove = #15;
+
+void (vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
+
+entity (entity start, .string fld, string match) find = #18;
+string (string s) precache_sound = #19;
+string (string s) precache_model = #20;
+
+void (string s) dprint = #25;
+string (float f) ftos = #26;
+string (vector v) vtos = #27;
+void () coredump = #28;
+void () traceon = #29;
+void () traceoff = #30;
+void (entity e) eprint = #31;
+
+float (float v) rint = #36;
+float (float v) floor = #37;
+float (float v) ceil = #38;
+
+float (vector v) pointcontents = #41;
+float (float f) fabs = #43;
+
+float (string s) cvar = #45;
+void (string s, ...) localcmd = #46;
+entity (entity e) nextent = #47;
+
+vector (vector v) vectoangles = #51;
+
+void (string var, string val) cvar_set = #72;
+
+
+float() ReadByte = #360;
+float() ReadChar = #361;
+float() ReadShort = #362;
+float() ReadLong = #363;
+float() ReadCoord = #364;
+float() ReadAngle = #365;
+string() ReadString = #366; //warning: this returns a temporary!
+
+float(string s) stof = #81;
+
+
+void (vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
+float (string name, string value) registercvar = #93;
+
+entity (entity start, .entity fld, entity match) findentity = #98;
+entity (entity start, .float fld, float match) findfloat = #98;
+
+float (string s) checkextension = #99;
+
+float (string filename, float mode) fopen = #110;
+void (float fhandle) fclose = #111;
+string (float fhandle) fgets = #112;
+void (float fhandle, string s) fputs = #113;
+float (string s) strlen = #114;
+string (...) strcat = #115;
+string (string s, float start, float length) substring = #116;
+vector (string s) stov = #117;
+string (string s) strzone = #118;
+void (string s) strunzone = #119;
+
+void () R_ClearScene = #300;
+void (float mask) R_AddEntities = #301;
+void (entity e) R_AddEntity = #302;
+float (float property, ...) R_SetView = #303;
+void () R_RenderScene = #304;
+void (vector org, float radius, vector rgb) R_AddDynamicLight = #305;
+void () R_CalcRefDef = #306;
+
+vector (vector v) cs_unproject = #310;
+vector (vector v) cs_project = #311;
+
+void drawline(float width, vector pos1, vector pos2, vector rgb, float alpha, float flags) = #315;
+float iscachedpic(string name) = #316;
+string precache_pic(string name, ...) = #317;
+vector drawgetimagesize(string pic) = #318;
+void freepic(string name) = #319;
+float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #320;
+float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #321;
+float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #322;
+float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #323;
+void drawsetcliparea(float x, float y, float width, float height) = #324;
+void drawresetcliparea(void) = #325;
+float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #326;
+
+
+float (float statnum) getstatf = #330;
+float (float statnum) getstati = #331;
+string (float statnum) getstats = #332;
+
+void (entity e, float i) setmodelindex = #333;
+string (float i) modelnameforindex = #334;
+
+float(string efname) particleeffectnum = #335;
+void(entity ent, float effectnum, vector start, vector end, ...) trailparticles = #336;
+void (float efnum, vector org, vector vel, float countmultiplier) pointparticles = #337;
+
+void (string s, ...) cprint = #338;
+void (string s, ...) print = #339;
+
+void (float scale) setsensitivityscale = #347;
+
+
+void (float framenum) RetrieveMovementFrame = #345;
+void () DefaultPlayerPhysics = #347;
+
+string (float playernum, string key) getplayerkey = #348;
+void (string cmdname) registercmd = #352;
+vector () getmousepos = #344;
+
+string (string s) uncolorstring = #170;
+
+float () playernum = #354;
+
+void (vector org, vector forward, vector right, vector up) setlistener = #351;
+
+float (vector start, vector end, float ignore, float csqcents) selecttraceline = #355;
+float () isdemo = #349;
+float () isserver = #350;
+
+void (float f) setwantsmousemove = #343;
+string (float key) getkeybind = #342;
+string (float f) chr = #78;
+
+vector (vector org) getlight = #92;
+
+entity (.string fld, string match) findchain = #402;
+entity (.float fld, float match) findchainflags = #450;
+entity (.entity fld, entity match) findchainentity = #403;
+entity (.float fld, float match) findchainfloat = #403;
+entity (entity start, .entity fld, float match) findflags = #449;
+
+float (string pattern, float caseinsensitive, float quiet) search_begin = #444;
+void (float handle) search_end = #445;
+float (float handle) search_getsize = #446;
+string (float handle, float num) search_getfilename = #447;
+
+
+float (entity e, float s) getsurfacenumpoints = #434;
+vector (entity e, float s, float n) getsurfacepoint = #435;
+vector (entity e, float s) getsurfacenormal = #436;
+string (entity e, float s) getsurfacetexture = #437;
+float (entity e, vector p) getsurfacenearpoint = #438;
+vector (entity e, float s, vector p) getsurfaceclippedpoint = #439;
+
+float (float a, float b) min = #94;
+float (float a, float b, float c) min3 = #94;
+float (float a, float b, float c, float d) min4 = #94;
+float (float a, float b, float c, float d, float e) min5 = #94;
+float (float a, float b, float c, float d, float e, float f) min6 = #94;
+float (float a, float b, float c, float d, float e, float f, float g) min7 = #94;
+float (float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
+float (float a, float b) max = #95;
+float (float a, float b, float c) max3 = #95;
+float (float a, float b, float c, float d) max4 = #95;
+float (float a, float b, float c, float d, float e) max5 = #95;
+float (float a, float b, float c, float d, float e, float f) max6 = #95;
+float (float a, float b, float c, float d, float e, float f, float g) max7 = #95;
+float (float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
+float (float minimum, float val, float maximum) bound = #96;
+
+vector () randomvec = #91;
+
+float (float val) sin = #60;
+float (float val) cos = #61;
+float (float val) sqrt = #62;
+float (float a, float b) pow = #97;
+
+void (vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
+
+void (vector org, vector velocity, float howmany) te_blood = #405;
+void (vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
+void (vector org, float radius, float lifetime, vector color) te_customflash = #417;
+void(vector org, vector color) te_explosionrgb = #407;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
+void(vector org) te_plasmaburn = #433;
+void(vector org) te_gunshotquad = #412;
+void(vector org) te_spikequad = #413;
+void(vector org) te_superspikequad = #414;
+void(vector org) te_explosionquad = #415;
+void(vector org) te_smallflash = #416;
+void(vector org, vector vel, float howmany) te_spark = #411;
+
+void(vector org) te_gunshot = #418;
+void(vector org) te_spike = #419;
+void(vector org) te_superspike = #420;
+void(vector org) te_explosion = #421;
+void(vector org) te_tarexplosion = #422;
+void(vector org) te_wizspike = #423;
+void(vector org) te_knightspike = #424;
+void(vector org) te_lavasplash = #425;
+void(vector org) te_teleport = #426;
+void(vector org, float color, float colorlength) te_explosion2 = #427;
+void(entity own, vector start, vector end) te_lightning1 = #428;
+void(entity own, vector start, vector end) te_lightning2 = #429;
+void(entity own, vector start, vector end) te_lightning3 = #430;
+void(entity own, vector start, vector end) te_beam = #431;
+
+float (entity ent, string tagname) gettagindex = #451;
+vector (entity ent, float tagindex) gettaginfo = #452;
+
+float (string s) tokenize = #441;
+string (float argnum) argv = #442;
+
+string (string s) cvar_string = #448;
+
+float () buf_create = #460;
+void (float bufhandle) buf_del = #461;
+float (float bufhandle) buf_getsize = #462;
+void (float bufhandle_from, float bufhandle_to) buf_copy = #463;
+void (float bufhandle, float sortpower, float backward) buf_sort = #464;
+string (float bufhandle, string glue) buf_implode = #465;
+string (float bufhandle, float string_index) bufstr_get = #466;
+void (float bufhandle, float string_index, string str) bufstr_set = #467;
+float (float bufhandle, string str, float order) bufstr_add = #468;
+void (float bufhandle, float string_index) bufstr_free = #469;
+
+float () onground = #355;
+
+void(string texturename, ...) R_BeginPolygon = #306;
+void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307;
+void() R_EndPolygon = #308;
+
+float(string s, float num) charindex = #356;
+
+// Darkplaces Additional Functions
+string(string s) strdecolorize = #477;
+string(string s) strtolower = #480; // returns the passed in string in pure lowercase form
+string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form
+float(string s) strlennocol = #476;
+
+void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
\ No newline at end of file
Deleted: trunk/data/qcsrc/client/csqc_constants.h
===================================================================
--- trunk/data/qcsrc/client/csqc_constants.h 2008-02-12 17:28:43 UTC (rev 3360)
+++ trunk/data/qcsrc/client/csqc_constants.h 2008-02-12 20:47:36 UTC (rev 3361)
@@ -1,81 +0,0 @@
-const entity NULL = world;
-
-const float MASK_ENGINE = 1;
-const float MASK_ENGINEVIEWMODELS = 2;
-const float MASK_NORMAL = 4;
-
-const float RF_VIEWMODEL = 1;
-const float RF_EXTERNALMODEL = 2;
-const float RF_DEPTHHACK = 4;
-const float RF_ADDATIVE = 8;
-const float RF_USEAXIS = 16;
-
-const float VF_MIN = 1; //(vector)
-const float VF_MIN_X = 2; //(float)
-const float VF_MIN_Y = 3; //(float)
-const float VF_SIZE = 4; //(vector) (viewport size)
-const float VF_SIZE_Y = 5; //(float)
-const float VF_SIZE_X = 6; //(float)
-const float VF_VIEWPORT = 7; //(vector, vector)
-const float VF_FOV = 8; //(vector)
-const float VF_FOVX = 9; //(float)
-const float VF_FOVY = 10; //(float)
-const float VF_ORIGIN = 11; //(vector)
-const float VF_ORIGIN_X = 12; //(float)
-const float VF_ORIGIN_Y = 13; //(float)
-const float VF_ORIGIN_Z = 14; //(float)
-const float VF_ANGLES = 15; //(vector)
-const float VF_ANGLES_X = 16; //(float)
-const float VF_ANGLES_Y = 17; //(float)
-const float VF_ANGLES_Z = 18; //(float)
-const float VF_DRAWWORLD = 19; //(float)
-const float VF_DRAWENGINESBAR = 20; //(float)
-const float VF_DRAWCROSSHAIR = 21; //(float)
-
-const float VF_CL_VIEWANGLES = 33; //(vector)
-const float VF_CL_VIEWANGLES_X = 34; //(float)
-const float VF_CL_VIEWANGLES_Y = 35; //(float)
-const float VF_CL_VIEWANGLES_Z = 36; //(float)
-
-const float STAT_HEALTH = 0;
-const float STAT_WEAPONMODEL = 2;
-const float STAT_AMMO = 3;
-const float STAT_ARMOR = 4;
-const float STAT_WEAPONFRAME = 5;
-const float STAT_SHELLS = 6;
-const float STAT_NAILS = 7;
-const float STAT_ROCKETS = 8;
-const float STAT_CELLS = 9;
-const float STAT_ACTIVEWEAPON = 10;
-const float STAT_ITEMS = 15;
-
-const float true = 1;
-const float false = 0;
-
-const float EXTRA_LOW = -99999999;
-const float EXTRA_HIGH = 99999999;
-
-const vector VEC_1 = '1 1 1';
-const vector VEC_0 = '0 0 0';
-const vector VEC_M1 = '-1 -1 -1';
-
-const float M_PI = 3.14159265358979323846;
-
-vector VEC_HULL_MIN = '-16 -16 -24';
-vector VEC_HULL_MAX = '16 16 32';
-
-const float EF_ADDITIVE = 32;
-const float EF_BLUE = 64;
-const float EF_FLAME = 1024;
-const float EF_FULLBRIGHT = 512;
-const float EF_NODEPTHTEST = 8192;
-const float EF_NODRAW = 16;
-const float EF_NOSHADOW = 4096;
-const float EF_RED = 128;
-const float EF_STARDUST = 2048;
-const float EF_SELECTABLE = 16384;
-
-const float PFL_ONGROUND = 1;
-const float PFL_CROUCH = 2;
-const float PFL_DEAD = 4;
-const float PFL_GIBBED = 8;
Added: trunk/data/qcsrc/client/csqc_constants.qc
===================================================================
--- trunk/data/qcsrc/client/csqc_constants.qc (rev 0)
+++ trunk/data/qcsrc/client/csqc_constants.qc 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,140 @@
+const entity NULL = world;
+
+// Mask Constants (set .drawmask on entities; use R_AddEntities to add all entities based on mask)
+const float MASK_ENGINE = 1;
+const float MASK_ENGINEVIEWMODELS = 2;
+const float MASK_NORMAL = 4;
+
+// Renderflag Constants (used for CSQC entities)
+const float RF_VIEWMODEL = 1;
+const float RF_EXTERNALMODEL = 2;
+const float RF_DEPTHHACK = 4;
+const float RF_ADDITIVE = 8;
+const float RF_USEAXIS = 16;
+
+// Viewflag Constants (use with R_SetView)
+const float VF_MIN = 1; //(vector)
+const float VF_MIN_X = 2; //(float)
+const float VF_MIN_Y = 3; //(float)
+const float VF_SIZE = 4; //(vector) (viewport size)
+const float VF_SIZE_Y = 5; //(float)
+const float VF_SIZE_X = 6; //(float)
+const float VF_VIEWPORT = 7; //(vector, vector)
+const float VF_FOV = 8; //(vector)
+const float VF_FOVX = 9; //(float)
+const float VF_FOVY = 10; //(float)
+const float VF_ORIGIN = 11; //(vector)
+const float VF_ORIGIN_X = 12; //(float)
+const float VF_ORIGIN_Y = 13; //(float)
+const float VF_ORIGIN_Z = 14; //(float)
+const float VF_ANGLES = 15; //(vector)
+const float VF_ANGLES_X = 16; //(float)
+const float VF_ANGLES_Y = 17; //(float)
+const float VF_ANGLES_Z = 18; //(float)
+const float VF_DRAWWORLD = 19; //(float)
+const float VF_DRAWENGINESBAR = 20; //(float)
+const float VF_DRAWCROSSHAIR = 21; //(float)
+const float VF_PERSPECTIVE = 200; //(float)
+
+const float VF_CL_VIEWANGLES = 33; //(vector)
+const float VF_CL_VIEWANGLES_X = 34; //(float)
+const float VF_CL_VIEWANGLES_Y = 35; //(float)
+const float VF_CL_VIEWANGLES_Z = 36; //(float)
+
+// Server Autosent Stat Constants
+const float STAT_HEALTH = 0;
+const float STAT_WEAPONMODEL = 2;
+const float STAT_AMMO = 3;
+const float STAT_ARMOR = 4;
+const float STAT_WEAPONFRAME = 5;
+const float STAT_SHELLS = 6;
+const float STAT_NAILS = 7;
+const float STAT_ROCKETS = 8;
+const float STAT_CELLS = 9;
+const float STAT_ACTIVEWEAPON = 10;
+const float STAT_TOTALSECRETS = 11;
+const float STAT_TOTALMONSTERS = 12;
+const float STAT_SECRETS = 13;
+const float STAT_MONSTERS = 14;
+const float STAT_ITEMS = 15;
+const float STAT_VIEWHEIGHT = 16;
+
+// Sound Constants
+const float CHAN_AUTO = 0;
+const float CHAN_WEAPON = 1;
+const float CHAN_VOICE = 2;
+const float CHAN_ITEM = 3;
+const float CHAN_BODY = 4;
+
+const float ATTN_NONE = 0;
+const float ATTN_NORM = 1;
+const float ATTN_IDLE = 2;
+const float ATTN_STATIC = 3;
+
+// Quake-style Point Contents
+const float CONTENT_EMPTY = -1;
+const float CONTENT_SOLID = -2;
+const float CONTENT_WATER = -3;
+const float CONTENT_SLIME = -4;
+const float CONTENT_LAVA = -5;
+const float CONTENT_SKY = -6;
+
+// Boolean Constants
+const float true = 1;
+const float false = 0;
+const float TRUE = 1;
+const float FALSE = 0;
+
+// Vector / Hull Constants
+const vector VEC_1 = '1 1 1';
+const vector VEC_0 = '0 0 0';
+const vector VEC_M1 = '-1 -1 -1';
+
+const vector VEC_HULL_MIN = '-16 -16 -24';
+const vector VEC_HULL_MAX = '16 16 32';
+
+// Effect Constants
+const float EF_NODRAW = 16;
+const float EF_ADDITIVE = 32;
+const float EF_BLUE = 64;
+const float EF_RED = 128;
+const float EF_FULLBRIGHT = 512;
+const float EF_FLAME = 1024;
+const float EF_STARDUST = 2048;
+const float EF_NOSHADOW = 4096;
+const float EF_NODEPTHTEST = 8192;
+
+// Quake Player Flag Constants
+const float PFL_ONGROUND = 1;
+const float PFL_CROUCH = 2;
+const float PFL_DEAD = 4;
+const float PFL_GIBBED = 8;
+
+// Quake Temporary Entity Constants
+const float TE_SPIKE = 0;
+const float TE_SUPERSPIKE = 1;
+const float TE_GUNSHOT = 2;
+const float TE_EXPLOSION = 3;
+const float TE_TAREXPLOSION = 4;
+const float TE_LIGHTNING1 = 5;
+const float TE_LIGHTNING2 = 6;
+const float TE_WIZSPIKE = 7;
+const float TE_KNIGHTSPIKE = 8;
+const float TE_LIGHTNING3 = 9;
+const float TE_LAVASPLASH = 10;
+const float TE_TELEPORT = 11;
+const float TE_EXPLOSION2 = 12;
+// Darkplaces Additions
+const float TE_EXPLOSIONRGB = 53;
+const float TE_GUNSHOTQUAD = 57;
+const float TE_EXPLOSIONQUAD = 70;
+
+// Math Constants
+const float M_PI = 3.14159265358979323846;
+const float EXTRA_LOW = -99999999;
+const float EXTRA_HIGH = 99999999;
+
+// Frik File Constants
+const float FILE_READ = 0;
+const float FILE_APPEND = 1;
+const float FILE_WRITE = 2;
\ No newline at end of file
Deleted: trunk/data/qcsrc/client/defs.c
===================================================================
--- trunk/data/qcsrc/client/defs.c 2008-02-12 17:28:43 UTC (rev 3360)
+++ trunk/data/qcsrc/client/defs.c 2008-02-12 20:47:36 UTC (rev 3361)
@@ -1,153 +0,0 @@
-#pragma flag off fastarrays // make dp behave with new fteqcc versions. remove when dp bug with fteqcc fastarrays is fixed
-
-
-//NOTE: THIS IS AN INTERFACE FILE. DO NOT EDIT.
-//MODIFYING THIS FILE CAN RESULT IN CRC ERRORS.
-//YOU HAVE BEEN WARNED.
-
-//feel free to look though. :)
-
-
-
-
-#define CSQC 1
-
-/*
-==============================================================================
-
- SOURCE FOR GLOBALVARS_T C STRUCTURE
-
-==============================================================================
-*/
-
-//
-// system globals
-//
-entity self;
-entity other;
-entity world;
-float time;
-float frametime;
-
-float player_localentnum; //the entnum
-float player_localnum; //the playernum
-float maxclients; //a constant filled in by the engine. gah, portability eh?
-
-float clientcommandframe; //player movement
-float servercommandframe; //clientframe echoed off the server
-
-string mapname;
-
-//
-// global variables set by built in functions
-//
-vector v_forward, v_up, v_right; // set by makevectors()
-
-// set by traceline / tracebox
-float trace_allsolid;
-float trace_startsolid;
-float trace_fraction;
-vector trace_endpos;
-vector trace_plane_normal;
-float trace_plane_dist;
-entity trace_ent;
-float trace_inopen;
-float trace_inwater;
-
-//
-// required prog functions
-//
-void() CSQC_Init;
-void() CSQC_Shutdown;
-float(float f, float t) CSQC_InputEvent;
-void() CSQC_UpdateView;
-void(string s) CSQC_ConsoleCommand;
-
-
-//these fields are read and set by the default player physics
-vector pmove_org;
-vector pmove_vel;
-vector pmove_mins;
-vector pmove_maxs;
-//retrieved from the current movement commands (read by player physics)
-float input_timelength;
-vector input_angles;
-vector input_movevalues; //forwards, right, up.
-float input_buttons; //attack, use, jump (default physics only uses jump)
-
-float movevar_gravity;
-float movevar_stopspeed;
-float movevar_maxspeed;
-float movevar_spectatormaxspeed; //used by NOCLIP movetypes.
-float movevar_accelerate;
-float movevar_airaccelerate;
-float movevar_wateraccelerate;
-float movevar_friction;
-float movevar_waterfriction;
-float movevar_entgravity; //the local player's gravity field. Is a multiple (1 is the normal value)
-
-//================================================
-void end_sys_globals; // flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
- SOURCE FOR ENTVARS_T C STRUCTURE
-
-==============================================================================
-*/
-
-//
-// system fields (*** = do not set in prog code, maintained by C code)
-//
-.float modelindex; // *** model index in the precached list
-.vector absmin, absmax; // *** origin + mins / maxs
-
-.float entnum; // *** the ent number as on the server
-.float drawmask;
-.void() predraw;
-
-.float movetype;
-.float solid;
-
-.vector origin; // ***
-.vector oldorigin; // ***
-.vector velocity;
-.vector angles;
-.vector avelocity;
-
-.string classname; // spawn function
-.string model;
-.float frame;
-.float skin;
-.float effects;
-
-.vector mins, maxs; // bounding box extents reletive to origin
-.vector size; // maxs - mins
-
-.void() touch;
-.void() use;
-.void() think;
-.void() blocked; // for doors or plats, called when can't push other
-
-.float nextthink;
-
-.entity chain;
-
-.string netname;
-
-.entity enemy;
-
-.float flags;
-
-.float colormap;
-
-.entity owner; // who launched a missile
-
-//================================================
-void end_sys_fields; // flag for structure dumping
-//================================================
-
-.float alpha;
-.float renderflags;
Deleted: trunk/data/qcsrc/client/helpers.c
===================================================================
--- trunk/data/qcsrc/client/helpers.c 2008-02-12 17:28:43 UTC (rev 3360)
+++ trunk/data/qcsrc/client/helpers.c 2008-02-12 20:47:36 UTC (rev 3361)
@@ -1,20 +0,0 @@
-void RegisterCvar (string name, string defvalue, float save)
-{
- if(registercvar(name, defvalue) && save)
- localcmd("seta ", name, " ", cvar_string(name), "\n");
-}
-
-float DotProduct (vector x, vector y)
-{
- // LordHavoc: why does this function exist? vec*vec in QC is dotproduct
- return x*y;
- //return (x_x*y_x + x_y*y_y + x_z*y_z);
-}
-
-// dummy function to shut up compiler warnings
-void foo()
-{
- self.alpha = 0;
- self.renderflags = 0;
- self = NULL;
-}
Deleted: trunk/data/qcsrc/client/main.c
===================================================================
--- trunk/data/qcsrc/client/main.c 2008-02-12 17:28:43 UTC (rev 3360)
+++ trunk/data/qcsrc/client/main.c 2008-02-12 20:47:36 UTC (rev 3361)
@@ -1,105 +0,0 @@
-void SysParms_UPDATE (void)
-{
- float f;
-
- vid_width = cvar("vid_conwidth");
- vid_height = cvar("vid_conheight");
- makevectors(input_angles);
- pl_view_forward = v_forward;
- pl_view_right = v_right;
- pl_view_up = v_up;
- pl_xyspeed = floor(sqrt(pmove_vel_x*pmove_vel_x + pmove_vel_y*pmove_vel_y));
-
- f = getstati(STAT_HEALTH);
- spec = (f == -666);
- if(f < 1 && !(player_flags & PFL_DEAD))
- player_flags |= PFL_DEAD;
- else if(f >= 1 && player_flags & PFL_DEAD)
- player_flags -= player_flags & (PFL_DEAD | PFL_GIBBED);
-}
-
-void CSQC_Ent_Update (float isnew)
-{
- float i;
- i = ReadByte();
-}
-
-void CSQC_Ent_Remove ()
-{
- remove(self);
-};
-
-
-void CSQC_Init (void)
-{
-}
-
-void CSQC_Shutdown (void)
-{
-}
-
-void CSQC_ConsoleCommand (string str)
-{
-}
-
-void CSQC_UpdateView (void)
-{
- SysParms_UPDATE();
- View_Update();
-
- R_ClearScene();
-
- R_SetView(VF_DRAWWORLD, 1);
-
- if(getstati(STAT_HEALTH) == 6666)
- {
- R_SetView(VF_DRAWCROSSHAIR, 0);
- R_SetView(VF_DRAWENGINESBAR, 0);
- }
- else
- {
- R_SetView(VF_DRAWCROSSHAIR, 1);
- R_SetView(VF_DRAWENGINESBAR, 1);
- }
-
- R_AddEntities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS);
- R_RenderScene();
-
- if(cvar("cg_showvelocity"))
- {
- local float f;
- local string s;
- f = pl_xyspeed;
- if(max_ups < f)
- max_ups = f;
- s = ftos(f);
- s = strcat(s, " ups");
- drawstring('1 0 0'*vid_width + '-64 64 0', s, '8 8 0', VEC_1, 1, 0);
- s = ftos(max_ups);
- s = strcat(s, " max");
- drawstring('1 0 0'*vid_width + '-64 72 0', s, '8 8 0', VEC_1, 1, 0);
- }
-}
-
-float CSQC_InputEvent (float event, float parama)
-{
- return false;
-}
-
-void CSQC_Parse_StuffCmd (string msg)
-{
- // doesn't work, dp obviously doesn't execute csprogs.dat on demo playback
- if(isdemo() && msg == "menu_showteamselect\n")
- return;
- localcmd(msg);
-}
-
-void CSQC_Parse_Print (string msg)
-{
- print(msg);
-}
-
-void CSQC_Parse_CenterPrint (string msg)
-{
- cprint(msg);
-}
Added: trunk/data/qcsrc/client/old/csqc_builtins.h
===================================================================
--- trunk/data/qcsrc/client/old/csqc_builtins.h (rev 0)
+++ trunk/data/qcsrc/client/old/csqc_builtins.h 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,239 @@
+void (vector ang) makevectors = #1;
+void(entity e, vector o) setorigin = #2;
+void (entity e, string m) setmodel = #3;
+
+void () break = #6;
+float () random = #7;
+void (entity e, float chan, string samp, float vol, float atten) sound = #8;
+vector (vector v) normalize = #9;
+void (string e) error = #10;
+void (string e) objerror = #11;
+float (vector v) vlen = #12;
+float (vector v) vectoyaw = #13;
+entity () spawn = #14;
+void (entity e) remove = #15;
+
+void (vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
+
+entity (entity start, .string fld, string match) find = #18;
+string (string s) precache_sound = #19;
+string (string s) precache_model = #20;
+
+void (string s) dprint = #25;
+string (float f) ftos = #26;
+string (vector v) vtos = #27;
+void () coredump = #28;
+void () traceon = #29;
+void () traceoff = #30;
+void (entity e) eprint = #31;
+
+float (float v) rint = #36;
+float (float v) floor = #37;
+float (float v) ceil = #38;
+
+float (vector v) pointcontents = #41;
+float (float f) fabs = #43;
+
+float (string s) cvar = #45;
+void (string s, ...) localcmd = #46;
+entity (entity e) nextent = #47;
+
+vector (vector v) vectoangles = #51;
+
+void (string var, string val) cvar_set = #72;
+
+
+float() ReadByte = #360;
+float() ReadChar = #361;
+float() ReadShort = #362;
+float() ReadLong = #363;
+float() ReadCoord = #364;
+float() ReadAngle = #365;
+string() ReadString = #366; //warning: this returns a temporary!
+
+float(string s) stof = #81;
+
+
+void (vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
+float (string name, string value) registercvar = #93;
+
+entity (entity start, .entity fld, entity match) findentity = #98;
+entity (entity start, .float fld, float match) findfloat = #98;
+
+float (string s) checkextension = #99;
+
+float (string filename, float mode) fopen = #110;
+void (float fhandle) fclose = #111;
+string (float fhandle) fgets = #112;
+void (float fhandle, string s) fputs = #113;
+float (string s) strlen = #114;
+string (...) strcat = #115;
+string (string s, float start, float length) substring = #116;
+vector (string s) stov = #117;
+string (string s) strzone = #118;
+void (string s) strunzone = #119;
+
+void () R_ClearScene = #300;
+void (float mask) R_AddEntities = #301;
+void (entity e) R_AddEntity = #302;
+float (float property, ...) R_SetView = #303;
+void () R_RenderScene = #304;
+void (vector org, float radius, vector rgb) R_AddDynamicLight = #305;
+void () R_CalcRefDef = #306;
+
+vector (vector v) cs_unproject = #310;
+vector (vector v) cs_project = #311;
+
+void drawline(float width, vector pos1, vector pos2, vector rgb, float alpha, float flags) = #315;
+float iscachedpic(string name) = #316;
+string precache_pic(string name, ...) = #317;
+vector drawgetimagesize(string pic) = #318;
+void freepic(string name) = #319;
+float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #320;
+float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #321;
+float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #322;
+float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #323;
+void drawsetcliparea(float x, float y, float width, float height) = #324;
+void drawresetcliparea(void) = #325;
+
+
+float (float statnum) getstatf = #330;
+float (float statnum) getstati = #331;
+string (float statnum) getstats = #332;
+
+void (entity e, float i) setmodelindex = #333;
+string (float i) modelnameforindex = #334;
+
+float(string efname) particleseffectforname = #335;
+void(entity ent, float effectnum, vector start, vector end, ...) trailparticles = #336;
+void (float efnum, vector org, vector vel, float countmultiplier) pointparticles = #337;
+
+void (string s, ...) cprint = #338;
+void (string s, ...) print = #339;
+
+void (float scale) setsensitivityscale = #347;
+
+
+void (float framenum) RetrieveMovementFrame = #345;
+void () DefaultPlayerPhysics = #347;
+
+string (float playernum, string key) getplayerkey = #348;
+void (string cmdname) registercmd = #352;
+vector () getmousepos = #344;
+
+string (string s) uncolorstring = #170;
+
+float () playernum = #354;
+
+void (vector org, vector forward, vector right, vector up) setlistener = #351;
+
+float (vector start, vector end, float ignore, float csqcents) selecttraceline = #355;
+float () isdemo = #349;
+float () isserver = #350;
+
+void (float f) setwantsmousemove = #343;
+string (float key) getkeybind = #342;
+string (float f) chr = #78;
+
+vector (vector org) getlight = #92;
+
+entity (.string fld, string match) findchain = #402;
+entity (.float fld, float match) findchainflags = #450;
+entity (.entity fld, entity match) findchainentity = #403;
+entity (.float fld, float match) findchainfloat = #403;
+entity (entity start, .entity fld, float match) findflags = #449;
+
+float (string pattern, float caseinsensitive, float quiet) search_begin = #444;
+void (float handle) search_end = #445;
+float (float handle) search_getsize = #446;
+string (float handle, float num) search_getfilename = #447;
+
+
+float (entity e, float s) getsurfacenumpoints = #434;
+vector (entity e, float s, float n) getsurfacepoint = #435;
+vector (entity e, float s) getsurfacenormal = #436;
+string (entity e, float s) getsurfacetexture = #437;
+float (entity e, vector p) getsurfacenearpoint = #438;
+vector (entity e, float s, vector p) getsurfaceclippedpoint = #439;
+
+float (float a, float b) min = #94;
+float (float a, float b, float c) min3 = #94;
+float (float a, float b, float c, float d) min4 = #94;
+float (float a, float b, float c, float d, float e) min5 = #94;
+float (float a, float b, float c, float d, float e, float f) min6 = #94;
+float (float a, float b, float c, float d, float e, float f, float g) min7 = #94;
+float (float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
+float (float a, float b) max = #95;
+float (float a, float b, float c) max3 = #95;
+float (float a, float b, float c, float d) max4 = #95;
+float (float a, float b, float c, float d, float e) max5 = #95;
+float (float a, float b, float c, float d, float e, float f) max6 = #95;
+float (float a, float b, float c, float d, float e, float f, float g) max7 = #95;
+float (float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
+float (float minimum, float val, float maximum) bound = #96;
+
+vector () randomvec = #91;
+
+float (float val) sin = #60;
+float (float val) cos = #61;
+float (float val) sqrt = #62;
+float (float a, float b) pow = #97;
+
+void (vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
+
+void (vector org, vector velocity, float howmany) te_blood = #405;
+void (vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
+void (vector org, float radius, float lifetime, vector color) te_customflash = #417;
+void(vector org, vector color) te_explosionrgb = #407;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
+void(vector org) te_plasmaburn = #433;
+void(vector org) te_gunshotquad = #412;
+void(vector org) te_spikequad = #413;
+void(vector org) te_superspikequad = #414;
+void(vector org) te_explosionquad = #415;
+void(vector org) te_smallflash = #416;
+void(vector org, vector vel, float howmany) te_spark = #411;
+
+void(vector org) te_gunshot = #418;
+void(vector org) te_spike = #419;
+void(vector org) te_superspike = #420;
+void(vector org) te_explosion = #421;
+void(vector org) te_tarexplosion = #422;
+void(vector org) te_wizspike = #423;
+void(vector org) te_knightspike = #424;
+void(vector org) te_lavasplash = #425;
+void(vector org) te_teleport = #426;
+void(vector org, float color, float colorlength) te_explosion2 = #427;
+void(entity own, vector start, vector end) te_lightning1 = #428;
+void(entity own, vector start, vector end) te_lightning2 = #429;
+void(entity own, vector start, vector end) te_lightning3 = #430;
+void(entity own, vector start, vector end) te_beam = #431;
+
+float (entity ent, string tagname) gettagindex = #451;
+vector (entity ent, float tagindex) gettaginfo = #452;
+
+float (string s) tokenize = #441;
+string (float argnum) argv = #442;
+
+string (string s) cvar_string = #448;
+
+float () buf_create = #460;
+void (float bufhandle) buf_del = #461;
+float (float bufhandle) buf_getsize = #462;
+void (float bufhandle_from, float bufhandle_to) buf_copy = #463;
+void (float bufhandle, float sortpower, float backward) buf_sort = #464;
+string (float bufhandle, string glue) buf_implode = #465;
+string (float bufhandle, float string_index) bufstr_get = #466;
+void (float bufhandle, float string_index, string str) bufstr_set = #467;
+float (float bufhandle, string str, float order) bufstr_add = #468;
+void (float bufhandle, float string_index) bufstr_free = #469;
+
+float () onground = #355;
+
+void(string texturename, ...) R_BeginPolygon = #306;
+void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307;
+void() R_EndPolygon = #308;
+
+float(string s, float num) charindex = #356;
Added: trunk/data/qcsrc/client/old/csqc_constants.h
===================================================================
--- trunk/data/qcsrc/client/old/csqc_constants.h (rev 0)
+++ trunk/data/qcsrc/client/old/csqc_constants.h 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,81 @@
+const entity NULL = world;
+
+const float MASK_ENGINE = 1;
+const float MASK_ENGINEVIEWMODELS = 2;
+const float MASK_NORMAL = 4;
+
+const float RF_VIEWMODEL = 1;
+const float RF_EXTERNALMODEL = 2;
+const float RF_DEPTHHACK = 4;
+const float RF_ADDATIVE = 8;
+const float RF_USEAXIS = 16;
+
+const float VF_MIN = 1; //(vector)
+const float VF_MIN_X = 2; //(float)
+const float VF_MIN_Y = 3; //(float)
+const float VF_SIZE = 4; //(vector) (viewport size)
+const float VF_SIZE_Y = 5; //(float)
+const float VF_SIZE_X = 6; //(float)
+const float VF_VIEWPORT = 7; //(vector, vector)
+const float VF_FOV = 8; //(vector)
+const float VF_FOVX = 9; //(float)
+const float VF_FOVY = 10; //(float)
+const float VF_ORIGIN = 11; //(vector)
+const float VF_ORIGIN_X = 12; //(float)
+const float VF_ORIGIN_Y = 13; //(float)
+const float VF_ORIGIN_Z = 14; //(float)
+const float VF_ANGLES = 15; //(vector)
+const float VF_ANGLES_X = 16; //(float)
+const float VF_ANGLES_Y = 17; //(float)
+const float VF_ANGLES_Z = 18; //(float)
+const float VF_DRAWWORLD = 19; //(float)
+const float VF_DRAWENGINESBAR = 20; //(float)
+const float VF_DRAWCROSSHAIR = 21; //(float)
+
+const float VF_CL_VIEWANGLES = 33; //(vector)
+const float VF_CL_VIEWANGLES_X = 34; //(float)
+const float VF_CL_VIEWANGLES_Y = 35; //(float)
+const float VF_CL_VIEWANGLES_Z = 36; //(float)
+
+const float STAT_HEALTH = 0;
+const float STAT_WEAPONMODEL = 2;
+const float STAT_AMMO = 3;
+const float STAT_ARMOR = 4;
+const float STAT_WEAPONFRAME = 5;
+const float STAT_SHELLS = 6;
+const float STAT_NAILS = 7;
+const float STAT_ROCKETS = 8;
+const float STAT_CELLS = 9;
+const float STAT_ACTIVEWEAPON = 10;
+const float STAT_ITEMS = 15;
+
+const float true = 1;
+const float false = 0;
+
+const float EXTRA_LOW = -99999999;
+const float EXTRA_HIGH = 99999999;
+
+const vector VEC_1 = '1 1 1';
+const vector VEC_0 = '0 0 0';
+const vector VEC_M1 = '-1 -1 -1';
+
+const float M_PI = 3.14159265358979323846;
+
+vector VEC_HULL_MIN = '-16 -16 -24';
+vector VEC_HULL_MAX = '16 16 32';
+
+const float EF_ADDITIVE = 32;
+const float EF_BLUE = 64;
+const float EF_FLAME = 1024;
+const float EF_FULLBRIGHT = 512;
+const float EF_NODEPTHTEST = 8192;
+const float EF_NODRAW = 16;
+const float EF_NOSHADOW = 4096;
+const float EF_RED = 128;
+const float EF_STARDUST = 2048;
+const float EF_SELECTABLE = 16384;
+
+const float PFL_ONGROUND = 1;
+const float PFL_CROUCH = 2;
+const float PFL_DEAD = 4;
+const float PFL_GIBBED = 8;
Added: trunk/data/qcsrc/client/old/defs.c
===================================================================
--- trunk/data/qcsrc/client/old/defs.c (rev 0)
+++ trunk/data/qcsrc/client/old/defs.c 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,153 @@
+#pragma flag off fastarrays // make dp behave with new fteqcc versions. remove when dp bug with fteqcc fastarrays is fixed
+
+
+//NOTE: THIS IS AN INTERFACE FILE. DO NOT EDIT.
+//MODIFYING THIS FILE CAN RESULT IN CRC ERRORS.
+//YOU HAVE BEEN WARNED.
+
+//feel free to look though. :)
+
+
+
+
+#define CSQC 1
+
+/*
+==============================================================================
+
+ SOURCE FOR GLOBALVARS_T C STRUCTURE
+
+==============================================================================
+*/
+
+//
+// system globals
+//
+entity self;
+entity other;
+entity world;
+float time;
+float frametime;
+
+float player_localentnum; //the entnum
+float player_localnum; //the playernum
+float maxclients; //a constant filled in by the engine. gah, portability eh?
+
+float clientcommandframe; //player movement
+float servercommandframe; //clientframe echoed off the server
+
+string mapname;
+
+//
+// global variables set by built in functions
+//
+vector v_forward, v_up, v_right; // set by makevectors()
+
+// set by traceline / tracebox
+float trace_allsolid;
+float trace_startsolid;
+float trace_fraction;
+vector trace_endpos;
+vector trace_plane_normal;
+float trace_plane_dist;
+entity trace_ent;
+float trace_inopen;
+float trace_inwater;
+
+//
+// required prog functions
+//
+void() CSQC_Init;
+void() CSQC_Shutdown;
+float(float f, float t) CSQC_InputEvent;
+void() CSQC_UpdateView;
+void(string s) CSQC_ConsoleCommand;
+
+
+//these fields are read and set by the default player physics
+vector pmove_org;
+vector pmove_vel;
+vector pmove_mins;
+vector pmove_maxs;
+//retrieved from the current movement commands (read by player physics)
+float input_timelength;
+vector input_angles;
+vector input_movevalues; //forwards, right, up.
+float input_buttons; //attack, use, jump (default physics only uses jump)
+
+float movevar_gravity;
+float movevar_stopspeed;
+float movevar_maxspeed;
+float movevar_spectatormaxspeed; //used by NOCLIP movetypes.
+float movevar_accelerate;
+float movevar_airaccelerate;
+float movevar_wateraccelerate;
+float movevar_friction;
+float movevar_waterfriction;
+float movevar_entgravity; //the local player's gravity field. Is a multiple (1 is the normal value)
+
+//================================================
+void end_sys_globals; // flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+ SOURCE FOR ENTVARS_T C STRUCTURE
+
+==============================================================================
+*/
+
+//
+// system fields (*** = do not set in prog code, maintained by C code)
+//
+.float modelindex; // *** model index in the precached list
+.vector absmin, absmax; // *** origin + mins / maxs
+
+.float entnum; // *** the ent number as on the server
+.float drawmask;
+.void() predraw;
+
+.float movetype;
+.float solid;
+
+.vector origin; // ***
+.vector oldorigin; // ***
+.vector velocity;
+.vector angles;
+.vector avelocity;
+
+.string classname; // spawn function
+.string model;
+.float frame;
+.float skin;
+.float effects;
+
+.vector mins, maxs; // bounding box extents reletive to origin
+.vector size; // maxs - mins
+
+.void() touch;
+.void() use;
+.void() think;
+.void() blocked; // for doors or plats, called when can't push other
+
+.float nextthink;
+
+.entity chain;
+
+.string netname;
+
+.entity enemy;
+
+.float flags;
+
+.float colormap;
+
+.entity owner; // who launched a missile
+
+//================================================
+void end_sys_fields; // flag for structure dumping
+//================================================
+
+.float alpha;
+.float renderflags;
Added: trunk/data/qcsrc/client/old/helpers.c
===================================================================
--- trunk/data/qcsrc/client/old/helpers.c (rev 0)
+++ trunk/data/qcsrc/client/old/helpers.c 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,20 @@
+void RegisterCvar (string name, string defvalue, float save)
+{
+ if(registercvar(name, defvalue) && save)
+ localcmd("seta ", name, " ", cvar_string(name), "\n");
+}
+
+float DotProduct (vector x, vector y)
+{
+ // LordHavoc: why does this function exist? vec*vec in QC is dotproduct
+ return x*y;
+ //return (x_x*y_x + x_y*y_y + x_z*y_z);
+}
+
+// dummy function to shut up compiler warnings
+void foo()
+{
+ self.alpha = 0;
+ self.renderflags = 0;
+ self = NULL;
+}
Added: trunk/data/qcsrc/client/old/main.c
===================================================================
--- trunk/data/qcsrc/client/old/main.c (rev 0)
+++ trunk/data/qcsrc/client/old/main.c 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,105 @@
+void SysParms_UPDATE (void)
+{
+ float f;
+
+ vid_width = cvar("vid_conwidth");
+ vid_height = cvar("vid_conheight");
+ makevectors(input_angles);
+ pl_view_forward = v_forward;
+ pl_view_right = v_right;
+ pl_view_up = v_up;
+ pl_xyspeed = floor(sqrt(pmove_vel_x*pmove_vel_x + pmove_vel_y*pmove_vel_y));
+
+ f = getstati(STAT_HEALTH);
+ spec = (f == -666);
+ if(f < 1 && !(player_flags & PFL_DEAD))
+ player_flags |= PFL_DEAD;
+ else if(f >= 1 && player_flags & PFL_DEAD)
+ player_flags -= player_flags & (PFL_DEAD | PFL_GIBBED);
+}
+
+void CSQC_Ent_Update (float isnew)
+{
+ float i;
+ i = ReadByte();
+}
+
+void CSQC_Ent_Remove ()
+{
+ remove(self);
+};
+
+
+void CSQC_Init (void)
+{
+}
+
+void CSQC_Shutdown (void)
+{
+}
+
+void CSQC_ConsoleCommand (string str)
+{
+}
+
+void CSQC_UpdateView (void)
+{
+ SysParms_UPDATE();
+ View_Update();
+
+ R_ClearScene();
+
+ R_SetView(VF_DRAWWORLD, 1);
+
+ if(getstati(STAT_HEALTH) == 6666)
+ {
+ R_SetView(VF_DRAWCROSSHAIR, 0);
+ R_SetView(VF_DRAWENGINESBAR, 0);
+ }
+ else
+ {
+ R_SetView(VF_DRAWCROSSHAIR, 1);
+ R_SetView(VF_DRAWENGINESBAR, 1);
+ }
+
+ R_AddEntities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS);
+ R_RenderScene();
+
+ if(cvar("cg_showvelocity"))
+ {
+ local float f;
+ local string s;
+ f = pl_xyspeed;
+ if(max_ups < f)
+ max_ups = f;
+ s = ftos(f);
+ s = strcat(s, " ups");
+ drawstring('1 0 0'*vid_width + '-64 64 0', s, '8 8 0', VEC_1, 1, 0);
+ s = ftos(max_ups);
+ s = strcat(s, " max");
+ drawstring('1 0 0'*vid_width + '-64 72 0', s, '8 8 0', VEC_1, 1, 0);
+ }
+}
+
+float CSQC_InputEvent (float event, float parama)
+{
+ return false;
+}
+
+void CSQC_Parse_StuffCmd (string msg)
+{
+ // doesn't work, dp obviously doesn't execute csprogs.dat on demo playback
+ if(isdemo() && msg == "menu_showteamselect\n")
+ return;
+ localcmd(msg);
+}
+
+void CSQC_Parse_Print (string msg)
+{
+ print(msg);
+}
+
+void CSQC_Parse_CenterPrint (string msg)
+{
+ cprint(msg);
+}
Added: trunk/data/qcsrc/client/old/progs.src
===================================================================
--- trunk/data/qcsrc/client/old/progs.src (rev 0)
+++ trunk/data/qcsrc/client/old/progs.src 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,12 @@
+../../csprogs.dat
+
+defs.c
+
+csqc_constants.h
+csqc_builtins.h
+vars.h
+
+helpers.c
+view.c
+
+main.c
Added: trunk/data/qcsrc/client/old/vars.h
===================================================================
--- trunk/data/qcsrc/client/old/vars.h (rev 0)
+++ trunk/data/qcsrc/client/old/vars.h 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,20 @@
+float player_flags;
+float spec;
+
+vector pl_view_forward;
+vector pl_view_right;
+vector pl_view_up;
+
+float pl_xyspeed;
+
+vector vieworg;
+
+float vid_width, vid_height;
+
+vector PL_VIEW_OFS = '0 0 35';
+vector PL_MIN = '-16 -16 -24';
+vector PL_MAX = '16 16 45';
+vector PL_CROUCH_VIEW_OFS = '0 0 15';
+vector PL_CROUCH_MIN = '-16 -16 -24';
+vector PL_CROUCH_MAX = '16 16 25';
+
Added: trunk/data/qcsrc/client/old/view.c
===================================================================
--- trunk/data/qcsrc/client/old/view.c (rev 0)
+++ trunk/data/qcsrc/client/old/view.c 2008-02-12 20:47:36 UTC (rev 3361)
@@ -0,0 +1,29 @@
+float max_ups;
+vector angle_alive;
+
+void View_Update (void)
+{
+ vieworg = pmove_org;
+ angle_alive = input_angles;
+ makevectors(input_angles);
+
+ if(player_flags & PFL_DEAD && !spec)
+ {
+ R_SetView(VF_ORIGIN, vieworg+'0 0 4');
+ angle_alive_z = 80;
+ R_SetView(VF_ANGLES, angle_alive);
+ R_SetView(VF_CL_VIEWANGLES, angle_alive);
+ return;
+ }
+
+ if(input_buttons & 16 && !spec)
+ vieworg += PL_CROUCH_VIEW_OFS;
+ else
+ vieworg += PL_VIEW_OFS;
+
+ if(cvar("chase_active") && !spec)
+ vieworg = vieworg + v_up * cvar("chase_up") - v_forward * cvar("chase_back");
+
+ R_SetView(VF_ORIGIN, vieworg);
+ R_SetView(VF_ANGLES, input_angles);
+}
Modified: trunk/data/qcsrc/client/progs.src
===================================================================
--- trunk/data/qcsrc/client/progs.src 2008-02-12 17:28:43 UTC (rev 3360)
+++ trunk/data/qcsrc/client/progs.src 2008-02-12 20:47:36 UTC (rev 3361)
@@ -1,12 +1,8 @@
-../../csprogs.dat
-
-defs.c
-
-csqc_constants.h
-csqc_builtins.h
-vars.h
-
-helpers.c
-view.c
-
-main.c
+../../csprogs.dat
+
+Defs.qc
+csqc_constants.qc
+csqc_builtins.qc
+
+Main.qc
+View.qc
\ No newline at end of file
Deleted: trunk/data/qcsrc/client/vars.h
===================================================================
--- trunk/data/qcsrc/client/vars.h 2008-02-12 17:28:43 UTC (rev 3360)
+++ trunk/data/qcsrc/client/vars.h 2008-02-12 20:47:36 UTC (rev 3361)
@@ -1,20 +0,0 @@
-float player_flags;
-float spec;
-
-vector pl_view_forward;
-vector pl_view_right;
-vector pl_view_up;
-
-float pl_xyspeed;
-
-vector vieworg;
-
-float vid_width, vid_height;
-
-vector PL_VIEW_OFS = '0 0 35';
-vector PL_MIN = '-16 -16 -24';
-vector PL_MAX = '16 16 45';
-vector PL_CROUCH_VIEW_OFS = '0 0 15';
-vector PL_CROUCH_MIN = '-16 -16 -24';
-vector PL_CROUCH_MAX = '16 16 25';
-
Deleted: trunk/data/qcsrc/client/view.c
===================================================================
--- trunk/data/qcsrc/client/view.c 2008-02-12 17:28:43 UTC (rev 3360)
+++ trunk/data/qcsrc/client/view.c 2008-02-12 20:47:36 UTC (rev 3361)
@@ -1,29 +0,0 @@
-float max_ups;
-vector angle_alive;
-
-void View_Update (void)
-{
- vieworg = pmove_org;
- angle_alive = input_angles;
- makevectors(input_angles);
-
- if(player_flags & PFL_DEAD && !spec)
- {
- R_SetView(VF_ORIGIN, vieworg+'0 0 4');
- angle_alive_z = 80;
- R_SetView(VF_ANGLES, angle_alive);
- R_SetView(VF_CL_VIEWANGLES, angle_alive);
- return;
- }
-
- if(input_buttons & 16 && !spec)
- vieworg += PL_CROUCH_VIEW_OFS;
- else
- vieworg += PL_VIEW_OFS;
-
- if(cvar("chase_active") && !spec)
- vieworg = vieworg + v_up * cvar("chase_up") - v_forward * cvar("chase_back");
-
- R_SetView(VF_ORIGIN, vieworg);
- R_SetView(VF_ANGLES, input_angles);
-}
More information about the nexuiz-commits
mailing list