From db40d60b95e10e8def6b0b2c23d3e6698c60d6d4 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 14 Jul 2012 23:20:06 +0000 Subject: [PATCH] added a terrain editor git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4072 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/csaddon/src/csaddon.qc | 28 +- quakec/csaddon/src/csaddon.src | 3 +- quakec/csaddon/src/csplat.qc | 1392 +++++++++++++------------- quakec/csaddon/src/editor_terrain.qc | 274 +++++ 4 files changed, 1001 insertions(+), 696 deletions(-) create mode 100644 quakec/csaddon/src/editor_terrain.qc diff --git a/quakec/csaddon/src/csaddon.qc b/quakec/csaddon/src/csaddon.qc index 844fa73e1..d2989cb45 100644 --- a/quakec/csaddon/src/csaddon.qc +++ b/quakec/csaddon/src/csaddon.qc @@ -8,7 +8,8 @@ enum MODE_LIGHTEDIT=1, MODE_SPLINEEDIT=2, - MODE_PARTICLEEDIT=3 + MODE_TERRAINEDIT=3, + MODE_PARTICLEEDIT=4, }; var vector vidsize = '640 480 0'; @@ -16,6 +17,7 @@ vector curmousepos; vector mousediff; vector originalmousepos; float mousedown; +float shiftdown; /*the renderscene builtin in the parent progs is redirected to here*/ void() wrap_renderscene = @@ -88,10 +90,14 @@ void() wrap_renderscene = setproperty(VF_DRAWENGINESBAR, 0); setproperty(VF_DRAWCROSSHAIR, 0); +vidsize = getproperty(VF_SIZE); + if (autocvar_ca_editormode == MODE_LIGHTEDIT) editor_lights_add(); else if (autocvar_ca_editormode == MODE_SPLINEEDIT) editor_spline_add(); + else if (autocvar_ca_editormode == MODE_TERRAINEDIT) + editor_terrain_add(curmousepos); renderscene(); @@ -119,6 +125,16 @@ void() wrap_renderscene = col = '1 1 1'; drawrawstring('64 0 0'*(MODE_PARTICLEEDIT-1), "PARTICLES", '8 8 0', col, 1); + if (autocvar_ca_editormode == MODE_TERRAINEDIT) + col = '1 0 0'; + else if (curmousepos_y < 8 && curmousepos_x >= 64*(MODE_TERRAINEDIT-1) && curmousepos_x < 64*MODE_TERRAINEDIT) + col = '0 0 1'; + else + col = '1 1 1'; + drawrawstring('64 0 0'*(MODE_TERRAINEDIT-1), "TERRAIN", '8 8 0', col, 1); + + + if (autocvar_ca_editormode == MODE_LIGHTEDIT) editor_lights_overlay(curmousepos); else if (autocvar_ca_editormode == MODE_SPLINEEDIT) @@ -129,6 +145,8 @@ void() wrap_renderscene = } else if (autocvar_ca_editormode == MODE_PARTICLEEDIT) editor_particles_overlay(curmousepos); + else if (autocvar_ca_editormode == MODE_TERRAINEDIT) + editor_terrain_overlay(curmousepos); drawcharacter(curmousepos - '4 4', '+', '8 8', '1 1 1', 1); }; @@ -164,6 +182,11 @@ float (float event, float parama, float paramb) wrap_InputEvent = if (editor_particles_key(parama, paramb, curmousepos)) return TRUE; } + else if (autocvar_ca_editormode == MODE_TERRAINEDIT) + { + if (editor_terrain_key(parama, paramb, curmousepos)) + return TRUE; + } if (parama == 512) { mousedown = 1; @@ -218,9 +241,6 @@ float (float event, float parama, float paramb) wrap_InputEvent = /*this is a fallback function, in case the main progs does not have one*/ void(float width, float height, float do2d) CSQC_UpdateView = { - vidsize_x = width; - vidsize_y = height; - vidsize_z = 0; clearscene(); setproperty(VF_DRAWENGINESBAR, 1); setproperty(VF_DRAWCROSSHAIR, 1); diff --git a/quakec/csaddon/src/csaddon.src b/quakec/csaddon/src/csaddon.src index 1eebcb2a6..e0e65f961 100644 --- a/quakec/csaddon/src/csaddon.src +++ b/quakec/csaddon/src/csaddon.src @@ -1,9 +1,10 @@ -../csprogs.dat +../csaddon.dat //pr_dumpplatform -FFTE -Fdefines -TCS -O csplat opts.qc csplat.qc editor_lights.qc +editor_terrain.qc textfield.qc editor_particles.qc menu.qc diff --git a/quakec/csaddon/src/csplat.qc b/quakec/csaddon/src/csplat.qc index 1c516cfb6..82526af36 100644 --- a/quakec/csaddon/src/csplat.qc +++ b/quakec/csaddon/src/csplat.qc @@ -1,691 +1,701 @@ -/* -This file was automatically generated by FTE QuakeWorld v1.01 -This file can be regenerated by issuing the following command: -pr_dumpplatform -FFTE -Fdefines -TCS -O csplat -Available options: --Ffte - target only FTE (optimations and additional extensions) --Tnq - dump specifically NQ fields --Tqw - dump specifically QW fields --Tcs - dump specifically CSQC fields --Fdefines - generate #defines instead of constants --O - write to a different qc file -*/ -#pragma noref 1 -#pragma target FTE -#define CSQC -entity self; -entity other; -entity world; -float time; -float cltime; -float frametime; -float player_localentnum; -float player_localnum; -float maxclients; -float clientcommandframe; -float servercommandframe; -string mapname; -float intermission; -vector v_forward, v_up, v_right; -vector view_angles; -float trace_allsolid, trace_startsolid, trace_fraction; -vector trace_endpos, trace_plane_normal; -float trace_plane_dist; -entity trace_ent; -float trace_inopen; -float trace_inwater; -float input_timelength; -vector input_angles; -vector input_movevalues; -float input_buttons; -float input_impulse; -void end_sys_globals; -.float modelindex; -.vector absmin, absmax; -.float entnum; -.float drawmask; -.void() predraw; -.float movetype; -.float solid; -.vector origin; -.vector oldorigin; -.vector velocity; -.vector angles; -.vector avelocity; -.float pmove_flags; -.string classname; -.float renderflags; -.string model; -.float frame; -.float frame1time; -.float frame2; -.float frame2time; -.float lerpfrac; -.float skin; -.float effects; -.vector mins, maxs; -.vector size; -.void() touch; -.void() think; -.void() blocked; -.float nextthink; -.entity chain; -.entity enemy; -.float flags; -.float colormap; -.entity owner; -void end_sys_fields; -.vector punchangle; -.float gravity; -.float hull; -.entity movechain; -.void() chainmoved; -.float dimension_solid; -.float dimension_hit; -.float scale; -.float fatness; -.float alpha; -.entity tag_entity; -.float skeletonindex; -.vector colormod; -.float friction; -.float erp; -.float jointtype; -.float mass; -.float bouncefactor; -.float bouncestop; -.float forceshader; -.float baseframe; -.float baseframe2; -.float baseframe1time; -.float baseframe2time; -.float baselerpfrac; -.float basebone; -.float bonecontrol1; -.float bonecontrol2; -.float bonecontrol3; -.float bonecontrol4; -.float bonecontrol5; -.float subblendfrac; -.float basesubblendfrac; -.vector glowmod; -.float ideal_pitch; -.float pitch_speed; -var float physics_mode = 2; -#define TRUE 1 -#define FALSE 0 -#define MOVETYPE_NONE 0 -#define MOVETYPE_WALK 3 -#define MOVETYPE_STEP 4 -#define MOVETYPE_FLY 5 -#define MOVETYPE_TOSS 6 -#define MOVETYPE_PUSH 7 -#define MOVETYPE_NOCLIP 8 -#define MOVETYPE_FLYMISSILE 9 -#define MOVETYPE_BOUNCE 10 -#define MOVETYPE_BOUNCEMISSILE 11 -#define MOVETYPE_FOLLOW 12 -#define MOVETYPE_PHYSICS 32 -#define SOLID_NOT 0 -#define SOLID_TRIGGER 1 -#define SOLID_BBOX 2 -#define SOLID_SLIDEBOX 3 -#define SOLID_BSP 4 -#define SOLID_CORPSE 5 -#define SOLID_LADDER 20 -#define SOLID_PHYSICS_BOX 32 -#define SOLID_PHYSICS_SPHERE 33 -#define SOLID_PHYSICS_CAPSULE 34 -#define JOINTTYPE_FIXED -1 -#define JOINTTYPE_POINT 1 -#define JOINTTYPE_HINGE 2 -#define JOINTTYPE_SLIDER 3 -#define JOINTTYPE_UNIVERSAL 4 -#define JOINTTYPE_HINGE2 5 -#define CONTENT_EMPTY -1 -#define CONTENT_SOLID -2 -#define CONTENT_WATER -3 -#define CONTENT_SLIME -4 -#define CONTENT_LAVA -5 -#define CONTENT_SKY -6 -#define CHAN_AUTO 0 -#define CHAN_WEAPON 1 -#define CHAN_VOICE 2 -#define CHAN_ITEM 3 -#define CHAN_BODY 4 -#define ATTN_NONE 0 -#define ATTN_NORM 1 -#define FL_FLY 1 -#define FL_SWIM 2 -#define FL_CLIENT 8 -#define FL_INWATER 16 -#define FL_MONSTER 32 -#define FL_ITEM 256 -#define FL_ONGROUND 512 -#define FL_PARTIALGROUND 1024 -#define FL_WATERJUMP 2048 -#define FL_FINDABLE_NONSOLID 16384 -#define MOVE_NORMAL 0 -#define MOVE_NOMONSTERS 1 -#define MOVE_MISSILE 2 -#define MOVE_HITMODEL 4 -#define MOVE_TRIGGERS 16 -#define MOVE_EVERYTHING 32 -#define MOVE_ENTCHAIN 128 -#define EF_BRIGHTFIELD 1 -#define EF_MUZZLEFLASH 2 -#define EF_BRIGHTLIGHT 4 -#define EF_DIMLIGHT 8 -#define EF_ADDITIVE 32 -#define EF_BLUE 64 -#define EF_RED 128 -#define EF_FULLBRIGHT 512 -#define EF_NODEPTHTEST 8192 -#define STAT_HEALTH 0 -#define STAT_WEAPON 2 -#define STAT_AMMO 3 -#define STAT_ARMOR 4 -#define STAT_WEAPONFRAME 5 -#define STAT_SHELLS 6 -#define STAT_NAILS 7 -#define STAT_ROCKETS 8 -#define STAT_CELLS 9 -#define STAT_ACTIVEWEAPON 10 -#define STAT_TOTALSECRETS 11 -#define STAT_TOTALMONSTERS 12 -#define STAT_SECRETS 13 -#define STAT_MONSTERS 14 -#define STAT_ITEMS 15 -#define STAT_VIEWHEIGHT 16 -#define STAT_VIEW2 20 -#define STAT_VIEWZOOM 21 -#define VF_MIN 1 -#define VF_MIN_X 2 -#define VF_MIN_Y 3 -#define VF_SIZE 4 -#define VF_SIZE_X 5 -#define VF_SIZE_Y 6 -#define VF_VIEWPORT 7 -#define VF_FOV 8 -#define VF_FOVX 9 -#define VF_ORIGIN 11 -#define VF_ORIGIN_X 12 -#define VF_ORIGIN_Y 13 -#define VF_ORIGIN_Z 14 -#define VF_ANGLES 15 -#define VF_ANGLES_X 16 -#define VF_ANGLES_Y 17 -#define VF_ANGLES_Z 18 -#define VF_DRAWWORLD 19 -#define VF_DRAWENGINESBAR 20 -#define VF_DRAWCROSSHAIR 21 -#define VF_CL_VIEWANGLES 33 -#define VF_CL_VIEWANGLES_X 34 -#define VF_CL_VIEWANGLES_Y 35 -#define VF_CL_VIEWANGLES_Z 36 -#define VF_PERSPECTIVE 200 -#define VF_LPLAYER 202 -#define VF_AFOV 203 -#define RF_VIEWMODEL 1 -#define RF_EXTERNALMODEL 2 -#define RF_DEPTHHACK 4 -#define RF_ADDITIVE 8 -#define RF_USEAXIS 16 -#define RF_NOSHADOW 32 -#define RF_FRAMETIMESARESTARTTIMES 64 -#define RF_NOAUTOADD 128 -#define IE_KEYDOWN 0 -#define IE_KEYUP 1 -#define IE_MOUSEDELTA 2 -#define IE_MOUSEABS 3 -#define IE_ACCELEROMETER 4 -#define FILE_READ 0 -#define FILE_APPEND 1 -#define FILE_WRITE 2 -#define FILE_READNL 4 -#define FILE_MMAP_READ 5 -#define FILE_MMAP_RW 6 -#define MOVE_LAGGED 64 -#define MASK_ENGINE 1 -#define MASK_VIEWMODEL 2 -#define LFIELD_ORIGIN 0 -#define LFIELD_COLOUR 1 -#define LFIELD_RADIUS 2 -#define LFIELD_FLAGS 3 -#define LFIELD_STYLE 4 -#define LFIELD_ANGLES 5 -#define LFIELD_FOV 6 -#define LFIELD_CORONA 7 -#define LFIELD_CORONASCALE 8 -#define LFIELD_CUBEMAPNAME 9 -#define LFIELD_AMBIENTSCALE 10 -#define LFIELD_DIFFUSESCALE 11 -#define LFIELD_SPECULARSCALE 12 -#define LFLAG_NORMALMODE 1 -#define LFLAG_REALTIMEMODE 2 -#define LFLAG_LIGHTMAP 4 -#define LFLAG_FLASHBLEND 8 -#define LFLAG_NOSHADOWS 256 -#define LFLAG_SHADOWMAP 512 -#define LFLAG_CREPUSCULAR 1024 -void(vector) 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; -#ifdef SSQC -void(float style, float val) lightstylestatic = #5; -void() break = #6; -#endif -float() random = #7; -void(entity e, float chan, string samp, float vol, float atten, optional float speedpct, optional float flags) 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 ent) traceline = #16; -#ifdef SSQC -entity() checkclient = #17; -#endif -entity(entity start, .string fld, string match) find = #18; -void(string s) precache_sound = #19; -void(string s) precache_model = #20; -#ifdef SSQC -void(entity client, string s) stuffcmd = #21; -#endif -entity(vector org, float rad) findradius = #22; -#ifdef SSQC -void(string s) bprint = #23; -void(entity client, string s) sprint = #24; -#endif -void(string s, ...) dprint = #25; -string(float val) ftos = #26; -string(vector val) vtos = #27; -void() coredump = #28; -void() traceon = #29; -void() traceoff = #30; -void(entity e) eprint = #31; -float(float yaw, float dist) walkmove = #32; -float() droptofloor = #34; -void(float lightstyle, string stylestring) lightstyle = #35; -float(float) rint = #36; -float(float) floor = #37; -float(float) ceil = #38; -//float(vector v) qtest_canreach = #39; -float(entity ent) checkbottom = #40; -float(vector pos) pointcontents = #41; -float(float) fabs = #43; -#ifdef SSQC -vector(entity player, float missilespeed) aim = #44; -#endif -float(string) cvar = #45; -void(string, ...) localcmd = #46; -entity(entity) nextent = #47; -void(vector pos, vector dir, float colour, float count) particle = #48; -#define ChangeYaw changeyaw -void() changeyaw = #49; -vector(vector fwd, optional vector up) vectoangles = #51; -#ifdef SSQC -void(float to, float val) WriteByte = #52; -void(float to, float val) WriteChar = #53; -void(float to, float val) WriteShort = #54; -void(float to, float val) WriteLong = #55; -void(float to, float val) WriteCoord = #56; -void(float to, float val) WriteAngle = #57; -void(float to, string val) WriteString = #58; -void(float to, entity val) WriteEntity = #59; -#endif -float(float angle) sin = #60; -float(float angle) cos = #61; -float(float value) sqrt = #62; -void(entity ent) changepitch = #63; -void(entity ent, entity ignore) tracetoss = #64; -string(entity ent) etos = #65; -void(float step) movetogoal = #67; -#ifdef SSQC -void(string s) precache_file = #68; -#endif -void(entity e) makestatic = #69; -#ifdef SSQC -void(string mapname, optional string newmapstartspot) changelevel = #70; -#endif -void(string cvarname, string valuetoset) cvar_set = #72; -#ifdef SSQC -void(entity ent, string text, ...) centerprint = #73; -#endif -void (vector pos, string samp, float vol, float atten) ambientsound = #74; -void(string str) precache_model2 = #75; -void(string str) precache_sound2 = #76; -#ifdef SSQC -void(string str) precache_file2 = #77; -void() setspawnparms = #78; -void(entity killer, entity killee) logfrag = #79; -string(entity e, string key) infokey = #80; -#endif -float(string) stof = #81; -#ifdef SSQC -void(vector where, float set) multicast = #82; -#endif -void(vector start, vector mins, vector maxs, vector end, float nomonsters, entity ent) tracebox = #90; -vector() randomvec = #91; -vector(vector org) getlight = #92; -void(string cvarname, string defaultvalue) registercvar = #93; -float(float a, float b, ...) min = #94; -float(float a, float b, ...) max = #95; -float(float minimum, float val, float maximum) bound = #96; -float(float value, float exp) pow = #97; -entity(entity start, .float fld, float match) findfloat = #98; -float(string extname) checkextension = #99; -#ifdef SSQC -float(string builtinname) builtin_find = #100; -float(float value) anglemod = #102; -void(string slot, string picname, float x, float y, float zone, optional entity player) showpic = #104; -void(string slot, optional entity player) hidepic = #105; -void(string slot, float x, float y, float zone, optional entity player) movepic = #106; -void(string slot, string picname, optional entity player) changepic = #107; -#endif -float(string filename, float mode, optional float mmapminsize) 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(string s1, optional string s2, ...) 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; -#ifdef SSQC -void(string cvar, float val) cvar_setf = #176; -#endif -float(string modelname, optional float queryonly) getmodelindex = #200; -__variant(float prnum, string funcname, ...) externcall = #201; -float(string progsname) addprogs = #202; -__variant(float prnum, string varname) externvalue = #203; -void(float prnum, __variant newval, string varname) externset = #204; -float(string input, string token) instr = #206; -void(float portal, float state) openportal = #207; -#ifdef SSQC -float(float attributes, string effectname, ...) RegisterTempEnt = #208; -void(float type, vector pos, ...) CustomTempEnt = #209; -float(optional float sleeptime) fork = #210; -#endif -void(optional __variant ret) abort = #211; -#ifdef SSQC -void(float sleeptime) sleep = #212; -void(entity player, string key, string value) forceinfokey = #213; -void(string filename, float starttag, entity edict) chat = #214; -#endif -void(vector org, vector dmin, vector dmax, float colour, float effect, float count) particle2 = #215; -void(vector org, vector box, float colour, float effect, float count) particle3 = #216; -void(vector org, float radius, float colour, float effect, float count) particle4 = #217; -float(float number, float quantity) bitshift = #218; -void(vector pos) te_lightningblood = #219; -float(string s1, string sub, optional float startidx) strstrofs = #221; -float(string str, float index) str2chr = #222; -string(float chr, ...) chr2str = #223; -string(float ccase, float redalpha, float redchars, string str, ...) strconv = #224; -string(float pad, string str1, ...) strpad = #225; -string(string old, string key, string value) infoadd = #226; -string(string info, string key) infoget = #227; -float(string s1, string s2, float len) strncmp = #228; -float(string s1, string s2) strcasecmp = #229; -float(string s1, string s2, float len) strncasecmp = #230; -void() calltimeofday = #231; -#ifdef SSQC -void(float num, float type, .void fld) clientstat = #232; -void(float num, float type, string name) globalstat = #233; -void(entity player) isbackbuffered = #234; -#endif -void(vector angle) rotatevectorsbyangle = #235; -void(vector fwd, vector right, vector up) rotatevectorsbyvectors = #236; -float(float mdlindex, string skinname) skinforname = #237; -#ifdef CSQC -float(string shadername, optional string defaultshader, ...) shaderforname = #238; -#endif -void(vector org, optional float count) te_bloodqw = #239; -#ifdef SSQC -float(vector viewpos, entity entity) checkpvs = #240; -entity(string match, optional float matchnum) matchclientname = #241; -void(string dest, string content) sendpacket = #242; -#endif -#ifdef CSQC -vector(entity ent, float tagnum) rotatevectorsbytag = #244; -#endif -int(string) stoi = #259; -string(int) itos = #260; -int(string) stoh = #261; -string(int) htos = #262; -float(float modlindex, optional float useabstransforms) skel_create = #263; -float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone, optional float addfrac) skel_build = #264; -float(float skel) skel_get_numbones = #265; -string(float skel, float bonenum) skel_get_bonename = #266; -float(float skel, float bonenum) skel_get_boneparent = #267; -float(float skel, string tagname) skel_find_bone = #268; -vector(float skel, float bonenum) skel_get_bonerel = #269; -vector(float skel, float bonenum) skel_get_boneabs = #270; -void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_set_bone = #271; -void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_mul_bone = #272; -void(float skel, float startbone, float endbone, vector org, optional vector fwd, optional vector right, optional vector up) skel_mul_bones = #273; -void(float skeldst, float skelsrc, float startbone, float entbone) skel_copybones = #274; -void(float skel) skel_delete = #275; -void(float modidx, string framename) frameforname = #276; -float(float modidx, float framenum) frameduration = #277; -void(float action, vector pos, float radius, float quant) terrain_edit = #278; -void() touchtriggers = #279; -#ifdef SSQC -void(float buf, float fl) writefloat = #280; -#endif -float*(float skel) skel_mmap = #282; -void(entity ent, float bonenum, vector org, optional vector angorfwd, optional vector right, optional vector up) skel_set_bone_world = #283; -#ifdef CSQC -void() clearscene = #300; -void(float mask) addentities = #301; -void(entity ent) addentity = #302; -#define setviewprop setproperty -float(float property, ...) setproperty = #303; -void() renderscene = #304; -float(vector org, float radius, vector lightcolours) dynamiclight_add = #305; -void(string texturename) R_BeginPolygon = #306; -void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307; -void() R_EndPolygon = #308; -#define getviewprop getproperty -__variant(float property) getproperty = #309; -vector (vector v) unproject = #310; -vector (vector v) project = #311; -void(float width, vector pos1, vector pos2) drawline = #315; -float(string name) iscachedpic = #316; -string(string name, float trywad) precache_pic = #317; -vector(string picname) draw_getimagesize = #318; -void(string name) freepic = #319; -float(vector position, float character, vector scale, vector rgb, float alpha, optional float flag) drawcharacter = #320; -float(vector position, string text, vector scale, vector rgb, float alpha, optional float flag) drawrawstring = #321; -float(vector position, string pic, vector size, vector rgb, float alpha, optional float flag) drawpic = #322; -float(vector position, vector size, vector rgb, float alpha, optional float flag) drawfill = #323; -void(float x, float y, float width, float height) drawsetcliparea = #324; -void(void) drawresetcliparea = #325; -float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring = #326; -float(string text, float usecolours, optional vector fontsize) stringwidth = #327; -void(vector pos, vector sz, string pic, vector srcpos, vector srcsz, vector rgb, float alpha, float flag) drawsubpic = #328; -float(float stnum) getstati = #330; -#define getstatf getstatbits -float(float stnum, optional float firstbit, optional float bitcount) getstatbits = #331; -string(float firststnum) getstats = #332; -void(entity e, float mdlindex) setmodelindex = #333; -string(float mdlindex) modelnameforindex = #334; -#endif -float(string effectname) particleeffectnum = #335; -void(float effectnum, entity ent, vector start, vector end) trailparticles = #336; -void(float effectnum, vector origin, optional vector dir, optional float count) pointparticles = #337; -#ifdef CSQC -void(string s, ...) cprint = #338; -#endif -void(string s, ...) print = #339; -#ifdef CSQC -string(float keynum) keynumtostring = #340; -float(string keyname) stringtokeynum = #341; -string(float keynum) getkeybind = #342; -vector() getmousepos = #344; -float(float framenum) getinputstate = #345; -void(float sens) setsensitivityscaler = #346; -#endif -void(entity ent) runstandardplayerphysics = #347; -#ifdef CSQC -string(float playernum, string keyname) getplayerkeyvalue = #348; -float() isdemo = #349; -float() isserver = #350; -void(vector origin, vector forward, vector right, vector up) SetListener = #351; -void(string cmdname) registercommand = #352; -#endif -float(entity ent) wasfreed = #353; -#ifdef CSQC -string(string key) serverkey = #354; -string() getentitytoken = #355; -void(string evname, string evargs, ...) sendevent = #359; -float() readbyte = #360; -float() readchar = #361; -float() readshort = #362; -float() readlong = #363; -float() readcoord = #364; -float() readangle = #365; -string() readstring = #366; -float() readfloat = #367; -float() readentitynum = #368; -float(string modelname, float(float isnew) updatecallback, float flags) deltalisten = #371; -__variant(float lno, float fld) dynamiclight_get = #372; -void(float lno, float fld, __variant value) dynamiclight_set = #373; -string(float efnum, float body) particleeffectquery = #374; -#endif -void(entity from, entity to) copyentity = #400; -#ifdef SSQC -void(entity from, entity to) setcolors = #401; -#endif -entity(string field, string match) findchain = #402; -entity(float fld, float match) findchainfloat = #403; -void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; -void(vector org, vector dir, float count) te_blood = #405; -void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406; -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, vector vel, float howmany) te_spark = #411; -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, float radius, float lifetime, vector color) te_customflash = #417; -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; -void(vector dir) vectorvectors = #432; -void(vector org) te_plasmaburn = #433; -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; -#ifdef SSQC -void(entity e, string s) clientcommand = #440; -#endif -float(string s) tokenize = #441; -string(float n) argv = #442; -#ifdef SSQC -void(entity e, entity tagentity, string tagname) setattachment = #443; -#endif -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; -string(string cvarname) cvar_string = #448; -entity(entity start, .entity fld, float match) findflags = #449; -entity(.float fld, float match) findchainflags = #450; -float(entity ent, string tagname) gettagindex = #451; -vector(entity ent, float tagindex) gettaginfo = #452; -#ifdef SSQC -void(entity player) dropclient = #453; -entity() spawnclient = #454; -float(entity client) clienttype = #455; -void(float target, string str) WriteUnterminatedString = #456; -#endif -entity(float entnum) edict_num = #459; -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(float s) asin = #471; -float(float c) acos = #472; -float(float t) atan = #473; -float(float c, float s) atan2 = #474; -float(float a) tan = #475; -float(string s) strlennocol = #476; -string(string s) strdecolorize = #477; -string(float uselocaltime, string format, ...) strftime = #478; -float(string s, string separator1, ...) tokenizebyseparator = #479; -string(string s) strtolower = #480; -string(string s) strtoupper = #481; -string(string s) cvar_defstring = #482; -#ifdef CSQC -void(vector origin, string sample, float volume, float attenuation) pointsound = #483; -#endif -string(string search, string replace, string subject) strreplace = #484; -string(string search, string replace, string subject) strireplace = #485; -//vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; -#ifdef CSQC -float(string name) gecko_create = #487; -void(string name) gecko_destroy = #488; -void(string name, string URI) gecko_navigate = #489; -float(string name, float key, float eventtype) gecko_keyevent = #490; -void(string name, float x, float y) gecko_mousemove = #491; -void(string name, float w, float h) gecko_resize = #492; -vector(string name) gecko_get_texture_extent = #493; -#endif -float(float caseinsensitive, string s, ...) crc16 = #494; -float(string name) cvar_type = #495; -//float() numentityfields = #496; -//string(float fieldnum) entityfieldname = #497; -//float(float fieldnum) entityfieldtype = #498; -//string(float fieldnum, entity ent) getentityfieldstring = #499; -//float(float fieldnum, entity ent, string s) putentityfieldstring = #500; -//void(float to, string s, float sz) WritePicture = #501; -string(string filename) whichpack = #503; -string(string in) uri_escape = #510; -string(string in) uri_unescape = #511; -float(entity ent) num_for_edict = #512; -void(string str) tokenize_console = #514; -float(float idx) argv_start_index = #515; -float(float idx) argv_end_index = #516; -string(string cvarname) cvar_description = #518; -#ifdef CSQC -float(optional float timetype) gettime = #519; -#endif -void(string s) loadfromdata = #529; -void(string s) loadfromfile = #530; -#ifdef SSQC -float(string mname) precache_vwep_model = #532; -#endif -void(.../*, string funcname*/) callfunction = #605; -void(float fh, entity e) writetofile = #606; -float(string s) isfunction = #607; -void(entity e, string s) parseentitydata = #608; -string(...) sprintf = #627; -#pragma noref 0 +/* +This file was automatically generated by FTE QuakeWorld v1.01 +This file can be regenerated by issuing the following command: +pr_dumpplatform -FFTE -Fdefines -TCS -O csplat +Available options: +-Ffte - target only FTE (optimations and additional extensions) +-Tnq - dump specifically NQ fields +-Tqw - dump specifically QW fields +-Tcs - dump specifically CSQC fields +-Fdefines - generate #defines instead of constants +-O - write to a different qc file +*/ +#pragma noref 1 +#pragma target FTE +#define CSQC +entity self; +entity other; +entity world; +float time; +float cltime; +float frametime; +float player_localentnum; +float player_localnum; +float maxclients; +float clientcommandframe; +float servercommandframe; +string mapname; +float intermission; +vector v_forward, v_up, v_right; +vector view_angles; +float trace_allsolid, trace_startsolid, trace_fraction; +shared vector trace_endpos; +vector trace_plane_normal; +float trace_plane_dist; +entity trace_ent; +float trace_inopen; +float trace_inwater; +float input_timelength; +vector input_angles; +vector input_movevalues; +float input_buttons; +float input_impulse; +void end_sys_globals; +.float modelindex; +.vector absmin, absmax; +.float entnum; +.float drawmask; +.void() predraw; +.float movetype; +.float solid; +.vector origin; +.vector oldorigin; +.vector velocity; +.vector angles; +.vector avelocity; +.float pmove_flags; +.string classname; +.float renderflags; +.string model; +.float frame; +.float frame1time; +.float frame2; +.float frame2time; +.float lerpfrac; +.float skin; +.float effects; +.vector mins, maxs; +.vector size; +.void() touch; +.void() think; +.void() blocked; +.float nextthink; +.entity chain; +.entity enemy; +.float flags; +.float colormap; +.entity owner; +void end_sys_fields; +.vector punchangle; +.float gravity; +.float hull; +.entity movechain; +.void() chainmoved; +.float dimension_solid; +.float dimension_hit; +.float scale; +.float fatness; +.float alpha; +.entity tag_entity; +.float skeletonindex; +.vector colormod; +.vector glowmod; +.vector gravitydir; +.float friction; +.float erp; +.float jointtype; +.float mass; +.float bouncefactor; +.float bouncestop; +.float forceshader; +.float baseframe; +.float baseframe2; +.float baseframe1time; +.float baseframe2time; +.float baselerpfrac; +.float basebone; +.float bonecontrol1; +.float bonecontrol2; +.float bonecontrol3; +.float bonecontrol4; +.float bonecontrol5; +.float subblendfrac; +.float basesubblendfrac; +.float ideal_pitch; +.float pitch_speed; +var float physics_mode = 2; +#define TRUE 1 +#define FALSE 0 +#define MOVETYPE_NONE 0 +#define MOVETYPE_WALK 3 +#define MOVETYPE_STEP 4 +#define MOVETYPE_FLY 5 +#define MOVETYPE_TOSS 6 +#define MOVETYPE_PUSH 7 +#define MOVETYPE_NOCLIP 8 +#define MOVETYPE_FLYMISSILE 9 +#define MOVETYPE_BOUNCE 10 +#define MOVETYPE_BOUNCEMISSILE 11 +#define MOVETYPE_FOLLOW 12 +#define MOVETYPE_PHYSICS 32 +#define SOLID_NOT 0 +#define SOLID_TRIGGER 1 +#define SOLID_BBOX 2 +#define SOLID_SLIDEBOX 3 +#define SOLID_BSP 4 +#define SOLID_CORPSE 5 +#define SOLID_LADDER 20 +#define SOLID_PHYSICS_BOX 32 +#define SOLID_PHYSICS_SPHERE 33 +#define SOLID_PHYSICS_CAPSULE 34 +#define JOINTTYPE_FIXED -1 +#define JOINTTYPE_POINT 1 +#define JOINTTYPE_HINGE 2 +#define JOINTTYPE_SLIDER 3 +#define JOINTTYPE_UNIVERSAL 4 +#define JOINTTYPE_HINGE2 5 +#define CONTENT_EMPTY -1 +#define CONTENT_SOLID -2 +#define CONTENT_WATER -3 +#define CONTENT_SLIME -4 +#define CONTENT_LAVA -5 +#define CONTENT_SKY -6 +#define CHAN_AUTO 0 +#define CHAN_WEAPON 1 +#define CHAN_VOICE 2 +#define CHAN_ITEM 3 +#define CHAN_BODY 4 +#define ATTN_NONE 0 +#define ATTN_NORM 1 +#define FL_FLY 1 +#define FL_SWIM 2 +#define FL_CLIENT 8 +#define FL_INWATER 16 +#define FL_MONSTER 32 +#define FL_ITEM 256 +#define FL_ONGROUND 512 +#define FL_PARTIALGROUND 1024 +#define FL_WATERJUMP 2048 +#define FL_FINDABLE_NONSOLID 16384 +#define MOVE_NORMAL 0 +#define MOVE_NOMONSTERS 1 +#define MOVE_MISSILE 2 +#define MOVE_HITMODEL 4 +#define MOVE_TRIGGERS 16 +#define MOVE_EVERYTHING 32 +#define MOVE_ENTCHAIN 128 +#define EF_BRIGHTFIELD 1 +#define EF_MUZZLEFLASH 2 +#define EF_BRIGHTLIGHT 4 +#define EF_DIMLIGHT 8 +#define EF_ADDITIVE 32 +#define EF_BLUE 64 +#define EF_RED 128 +#define EF_FULLBRIGHT 512 +#define EF_NODEPTHTEST 8192 +#define STAT_HEALTH 0 +#define STAT_WEAPON 2 +#define STAT_AMMO 3 +#define STAT_ARMOR 4 +#define STAT_WEAPONFRAME 5 +#define STAT_SHELLS 6 +#define STAT_NAILS 7 +#define STAT_ROCKETS 8 +#define STAT_CELLS 9 +#define STAT_ACTIVEWEAPON 10 +#define STAT_TOTALSECRETS 11 +#define STAT_TOTALMONSTERS 12 +#define STAT_SECRETS 13 +#define STAT_MONSTERS 14 +#define STAT_ITEMS 15 +#define STAT_VIEWHEIGHT 16 +#define STAT_VIEW2 20 +#define STAT_VIEWZOOM 21 +#define VF_MIN 1 +#define VF_MIN_X 2 +#define VF_MIN_Y 3 +#define VF_SIZE 4 +#define VF_SIZE_X 5 +#define VF_SIZE_Y 6 +#define VF_VIEWPORT 7 +#define VF_FOV 8 +#define VF_FOVX 9 +#define VF_ORIGIN 11 +#define VF_ORIGIN_X 12 +#define VF_ORIGIN_Y 13 +#define VF_ORIGIN_Z 14 +#define VF_ANGLES 15 +#define VF_ANGLES_X 16 +#define VF_ANGLES_Y 17 +#define VF_ANGLES_Z 18 +#define VF_DRAWWORLD 19 +#define VF_DRAWENGINESBAR 20 +#define VF_DRAWCROSSHAIR 21 +#define VF_CL_VIEWANGLES 33 +#define VF_CL_VIEWANGLES_X 34 +#define VF_CL_VIEWANGLES_Y 35 +#define VF_CL_VIEWANGLES_Z 36 +#define VF_PERSPECTIVE 200 +#define VF_LPLAYER 202 +#define VF_AFOV 203 +#define RF_VIEWMODEL 1 +#define RF_EXTERNALMODEL 2 +#define RF_DEPTHHACK 4 +#define RF_ADDITIVE 8 +#define RF_USEAXIS 16 +#define RF_NOSHADOW 32 +#define RF_FRAMETIMESARESTARTTIMES 64 +#define RF_NOAUTOADD 128 +#define IE_KEYDOWN 0 +#define IE_KEYUP 1 +#define IE_MOUSEDELTA 2 +#define IE_MOUSEABS 3 +#define IE_ACCELEROMETER 4 +#define FILE_READ 0 +#define FILE_APPEND 1 +#define FILE_WRITE 2 +#define FILE_READNL 4 +#define FILE_MMAP_READ 5 +#define FILE_MMAP_RW 6 +#define MOVE_LAGGED 64 +#define MASK_ENGINE 1 +#define MASK_VIEWMODEL 2 +#define LFIELD_ORIGIN 0 +#define LFIELD_COLOUR 1 +#define LFIELD_RADIUS 2 +#define LFIELD_FLAGS 3 +#define LFIELD_STYLE 4 +#define LFIELD_ANGLES 5 +#define LFIELD_FOV 6 +#define LFIELD_CORONA 7 +#define LFIELD_CORONASCALE 8 +#define LFIELD_CUBEMAPNAME 9 +#define LFIELD_AMBIENTSCALE 10 +#define LFIELD_DIFFUSESCALE 11 +#define LFIELD_SPECULARSCALE 12 +#define LFLAG_NORMALMODE 1 +#define LFLAG_REALTIMEMODE 2 +#define LFLAG_LIGHTMAP 4 +#define LFLAG_FLASHBLEND 8 +#define LFLAG_NOSHADOWS 256 +#define LFLAG_SHADOWMAP 512 +#define LFLAG_CREPUSCULAR 1024 +void(vector) 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; +#ifdef SSQC +void(float style, float val) lightstylestatic = #5; +void() break = #6; +#endif +float() random = #7; +void(entity e, float chan, string samp, float vol, float atten, optional float speedpct, optional float flags) 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 ent) traceline = #16; +#ifdef SSQC +entity() checkclient = #17; +#endif +entity(entity start, .string fld, string match) find = #18; +void(string s) precache_sound = #19; +void(string s) precache_model = #20; +#ifdef SSQC +void(entity client, string s) stuffcmd = #21; +#endif +entity(vector org, float rad) findradius = #22; +#ifdef SSQC +void(string s) bprint = #23; +void(entity client, string s) sprint = #24; +#endif +void(string s, ...) dprint = #25; +string(float val) ftos = #26; +string(vector val) vtos = #27; +void() coredump = #28; +void() traceon = #29; +void() traceoff = #30; +void(entity e) eprint = #31; +float(float yaw, float dist) walkmove = #32; +float() droptofloor = #34; +void(float lightstyle, string stylestring) lightstyle = #35; +float(float) rint = #36; +float(float) floor = #37; +float(float) ceil = #38; +//float(vector v) qtest_canreach = #39; +float(entity ent) checkbottom = #40; +float(vector pos) pointcontents = #41; +float(float) fabs = #43; +#ifdef SSQC +vector(entity player, float missilespeed) aim = #44; +#endif +float(string) cvar = #45; +void(string, ...) localcmd = #46; +entity(entity) nextent = #47; +void(vector pos, vector dir, float colour, float count) particle = #48; +#define ChangeYaw changeyaw +void() changeyaw = #49; +vector(vector fwd, optional vector up) vectoangles = #51; +#ifdef SSQC +void(float to, float val) WriteByte = #52; +void(float to, float val) WriteChar = #53; +void(float to, float val) WriteShort = #54; +void(float to, float val) WriteLong = #55; +void(float to, float val) WriteCoord = #56; +void(float to, float val) WriteAngle = #57; +void(float to, string val) WriteString = #58; +void(float to, entity val) WriteEntity = #59; +#endif +float(float angle) sin = #60; +float(float angle) cos = #61; +float(float value) sqrt = #62; +void(entity ent) changepitch = #63; +void(entity ent, entity ignore) tracetoss = #64; +string(entity ent) etos = #65; +void(float step) movetogoal = #67; +#ifdef SSQC +void(string s) precache_file = #68; +#endif +void(entity e) makestatic = #69; +#ifdef SSQC +void(string mapname, optional string newmapstartspot) changelevel = #70; +#endif +void(string cvarname, string valuetoset) cvar_set = #72; +#ifdef SSQC +void(entity ent, string text, ...) centerprint = #73; +#endif +void (vector pos, string samp, float vol, float atten) ambientsound = #74; +void(string str) precache_model2 = #75; +void(string str) precache_sound2 = #76; +#ifdef SSQC +void(string str) precache_file2 = #77; +void() setspawnparms = #78; +void(entity killer, entity killee) logfrag = #79; +string(entity e, string key) infokey = #80; +#endif +float(string) stof = #81; +#ifdef SSQC +void(vector where, float set) multicast = #82; +#endif +void(vector start, vector mins, vector maxs, vector end, float nomonsters, entity ent) tracebox = #90; +vector() randomvec = #91; +vector(vector org) getlight = #92; +void(string cvarname, string defaultvalue) registercvar = #93; +float(float a, float b, ...) min = #94; +float(float a, float b, ...) max = #95; +float(float minimum, float val, float maximum) bound = #96; +float(float value, float exp) pow = #97; +entity(entity start, .float fld, float match) findfloat = #98; +float(string extname) checkextension = #99; +#ifdef SSQC +float(string builtinname) builtin_find = #100; +float(float value) anglemod = #102; +void(string slot, string picname, float x, float y, float zone, optional entity player) showpic = #104; +void(string slot, optional entity player) hidepic = #105; +void(string slot, float x, float y, float zone, optional entity player) movepic = #106; +void(string slot, string picname, optional entity player) changepic = #107; +#endif +float(string filename, float mode, optional float mmapminsize) 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(string s1, optional string s2, ...) 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; +#ifdef SSQC +void(string cvar, float val) cvar_setf = #176; +#endif +float(string modelname, optional float queryonly) getmodelindex = #200; +__variant(float prnum, string funcname, ...) externcall = #201; +float(string progsname) addprogs = #202; +__variant(float prnum, string varname) externvalue = #203; +void(float prnum, __variant newval, string varname) externset = #204; +float(string input, string token) instr = #206; +void(float portal, float state) openportal = #207; +#ifdef SSQC +float(float attributes, string effectname, ...) RegisterTempEnt = #208; +void(float type, vector pos, ...) CustomTempEnt = #209; +float(optional float sleeptime) fork = #210; +#endif +void(optional __variant ret) abort = #211; +#ifdef SSQC +void(float sleeptime) sleep = #212; +void(entity player, string key, string value) forceinfokey = #213; +void(string filename, float starttag, entity edict) chat = #214; +#endif +void(vector org, vector dmin, vector dmax, float colour, float effect, float count) particle2 = #215; +void(vector org, vector box, float colour, float effect, float count) particle3 = #216; +void(vector org, float radius, float colour, float effect, float count) particle4 = #217; +float(float number, float quantity) bitshift = #218; +void(vector pos) te_lightningblood = #219; +float(string s1, string sub, optional float startidx) strstrofs = #221; +float(string str, float index) str2chr = #222; +string(float chr, ...) chr2str = #223; +string(float ccase, float redalpha, float redchars, string str, ...) strconv = #224; +string(float pad, string str1, ...) strpad = #225; +string(string old, string key, string value) infoadd = #226; +string(string info, string key) infoget = #227; +float(string s1, string s2, float len) strncmp = #228; +float(string s1, string s2) strcasecmp = #229; +float(string s1, string s2, float len) strncasecmp = #230; +void() calltimeofday = #231; +#ifdef SSQC +void(float num, float type, .void fld) clientstat = #232; +void(float num, float type, string name) globalstat = #233; +void(entity player) isbackbuffered = #234; +#endif +void(vector angle) rotatevectorsbyangle = #235; +void(vector fwd, vector right, vector up) rotatevectorsbyvectors = #236; +float(float mdlindex, string skinname) skinforname = #237; +#ifdef CSQC +float(string shadername, optional string defaultshader, ...) shaderforname = #238; +#endif +void(vector org, optional float count) te_bloodqw = #239; +#ifdef SSQC +float(vector viewpos, entity entity) checkpvs = #240; +entity(string match, optional float matchnum) matchclientname = #241; +void(string dest, string content) sendpacket = #242; +#endif +#ifdef CSQC +vector(entity ent, float tagnum) rotatevectorsbytag = #244; +#endif +int(string) stoi = #259; +string(int) itos = #260; +int(string) stoh = #261; +string(int) htos = #262; +float(float modlindex, optional float useabstransforms) skel_create = #263; +float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone, optional float addfrac) skel_build = #264; +float(float skel) skel_get_numbones = #265; +string(float skel, float bonenum) skel_get_bonename = #266; +float(float skel, float bonenum) skel_get_boneparent = #267; +float(float skel, string tagname) skel_find_bone = #268; +vector(float skel, float bonenum) skel_get_bonerel = #269; +vector(float skel, float bonenum) skel_get_boneabs = #270; +void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_set_bone = #271; +void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_mul_bone = #272; +void(float skel, float startbone, float endbone, vector org, optional vector fwd, optional vector right, optional vector up) skel_mul_bones = #273; +void(float skeldst, float skelsrc, float startbone, float entbone) skel_copybones = #274; +void(float skel) skel_delete = #275; +void(float modidx, string framename) frameforname = #276; +float(float modidx, float framenum) frameduration = #277; +void(float action, vector pos, float radius, float quant) terrain_edit = #278; +void() touchtriggers = #279; +#ifdef SSQC +void(float buf, float fl) writefloat = #280; +#endif +float*(float skel) skel_mmap = #282; +void(entity ent, float bonenum, vector org, optional vector angorfwd, optional vector right, optional vector up) skel_set_bone_world = #283; +void*(int size) memalloc = #384; +void(void *ptr) memfree = #385; +void(void *dst, void *src, int size) memcpy = #386; +void(void *dst, int val, int size) memset = #387; +#ifdef CSQC +void() clearscene = #300; +void(float mask) addentities = #301; +void(entity ent) addentity = #302; +#define setviewprop setproperty +float(float property, ...) setproperty = #303; +void() renderscene = #304; +float(vector org, float radius, vector lightcolours) dynamiclight_add = #305; +void(string texturename, optional float flags) R_BeginPolygon = #306; +void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307; +void() R_EndPolygon = #308; +#define getviewprop getproperty +__variant(float property) getproperty = #309; +vector (vector v) unproject = #310; +vector (vector v) project = #311; +void(float width, vector pos1, vector pos2) drawline = #315; +float(string name) iscachedpic = #316; +string(string name, float trywad) precache_pic = #317; +vector(string picname) draw_getimagesize = #318; +void(string name) freepic = #319; +float(vector position, float character, vector scale, vector rgb, float alpha, optional float flag) drawcharacter = #320; +float(vector position, string text, vector scale, vector rgb, float alpha, optional float flag) drawrawstring = #321; +float(vector position, string pic, vector size, vector rgb, float alpha, optional float flag) drawpic = #322; +float(vector position, vector size, vector rgb, float alpha, optional float flag) drawfill = #323; +void(float x, float y, float width, float height) drawsetcliparea = #324; +void(void) drawresetcliparea = #325; +float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring = #326; +float(string text, float usecolours, optional vector fontsize) stringwidth = #327; +void(vector pos, vector sz, string pic, vector srcpos, vector srcsz, vector rgb, float alpha, float flag) drawsubpic = #328; +float(float stnum) getstati = #330; +#define getstatf getstatbits +float(float stnum, optional float firstbit, optional float bitcount) getstatbits = #331; +string(float firststnum) getstats = #332; +void(entity e, float mdlindex) setmodelindex = #333; +string(float mdlindex) modelnameforindex = #334; +#endif +float(string effectname) particleeffectnum = #335; +void(float effectnum, entity ent, vector start, vector end) trailparticles = #336; +void(float effectnum, vector origin, optional vector dir, optional float count) pointparticles = #337; +#ifdef CSQC +void(string s, ...) cprint = #338; +#endif +void(string s, ...) print = #339; +#ifdef CSQC +string(float keynum) keynumtostring = #340; +float(string keyname) stringtokeynum = #341; +string(float keynum) getkeybind = #342; +vector() getmousepos = #344; +float(float framenum) getinputstate = #345; +void(float sens) setsensitivityscaler = #346; +#endif +void(entity ent) runstandardplayerphysics = #347; +#ifdef CSQC +string(float playernum, string keyname) getplayerkeyvalue = #348; +float() isdemo = #349; +float() isserver = #350; +void(vector origin, vector forward, vector right, vector up) SetListener = #351; +void(string cmdname) registercommand = #352; +#endif +float(entity ent) wasfreed = #353; +#ifdef CSQC +string(string key) serverkey = #354; +string() getentitytoken = #355; +void(string evname, string evargs, ...) sendevent = #359; +float() readbyte = #360; +float() readchar = #361; +float() readshort = #362; +float() readlong = #363; +float() readcoord = #364; +float() readangle = #365; +string() readstring = #366; +float() readfloat = #367; +float() readentitynum = #368; +float(string modelname, float(float isnew) updatecallback, float flags) deltalisten = #371; +__variant(float lno, float fld) dynamiclight_get = #372; +void(float lno, float fld, __variant value) dynamiclight_set = #373; +string(float efnum, float body) particleeffectquery = #374; +#endif +void(entity from, entity to) copyentity = #400; +#ifdef SSQC +void(entity from, entity to) setcolors = #401; +#endif +entity(string field, string match) findchain = #402; +entity(float fld, float match) findchainfloat = #403; +void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; +void(vector org, vector dir, float count) te_blood = #405; +void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406; +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, vector vel, float howmany) te_spark = #411; +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, float radius, float lifetime, vector color) te_customflash = #417; +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; +void(vector dir) vectorvectors = #432; +void(vector org) te_plasmaburn = #433; +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; +#ifdef SSQC +void(entity e, string s) clientcommand = #440; +#endif +float(string s) tokenize = #441; +string(float n) argv = #442; +#ifdef SSQC +void(entity e, entity tagentity, string tagname) setattachment = #443; +#endif +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; +string(string cvarname) cvar_string = #448; +entity(entity start, .entity fld, float match) findflags = #449; +entity(.float fld, float match) findchainflags = #450; +float(entity ent, string tagname) gettagindex = #451; +vector(entity ent, float tagindex) gettaginfo = #452; +#ifdef SSQC +void(entity player) dropclient = #453; +entity() spawnclient = #454; +float(entity client) clienttype = #455; +void(float target, string str) WriteUnterminatedString = #456; +#endif +entity(float entnum) edict_num = #459; +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(float s) asin = #471; +float(float c) acos = #472; +float(float t) atan = #473; +float(float c, float s) atan2 = #474; +float(float a) tan = #475; +float(string s) strlennocol = #476; +string(string s) strdecolorize = #477; +string(float uselocaltime, string format, ...) strftime = #478; +float(string s, string separator1, ...) tokenizebyseparator = #479; +string(string s) strtolower = #480; +string(string s) strtoupper = #481; +string(string s) cvar_defstring = #482; +#ifdef CSQC +void(vector origin, string sample, float volume, float attenuation) pointsound = #483; +#endif +string(string search, string replace, string subject) strreplace = #484; +string(string search, string replace, string subject) strireplace = #485; +//vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; +#ifdef CSQC +float(string name) gecko_create = #487; +void(string name) gecko_destroy = #488; +void(string name, string URI) gecko_navigate = #489; +float(string name, float key, float eventtype) gecko_keyevent = #490; +void(string name, float x, float y) gecko_mousemove = #491; +void(string name, float w, float h) gecko_resize = #492; +vector(string name) gecko_get_texture_extent = #493; +#endif +float(float caseinsensitive, string s, ...) crc16 = #494; +float(string name) cvar_type = #495; +//float() numentityfields = #496; +//string(float fieldnum) entityfieldname = #497; +//float(float fieldnum) entityfieldtype = #498; +//string(float fieldnum, entity ent) getentityfieldstring = #499; +//float(float fieldnum, entity ent, string s) putentityfieldstring = #500; +//void(float to, string s, float sz) WritePicture = #501; +//string() ReadPicture = #501; +string(string filename) whichpack = #503; +#ifdef CSQC +__variant(float entnum, float fieldnum) getentity = #504; +#endif +string(string in) uri_escape = #510; +string(string in) uri_unescape = #511; +float(entity ent) num_for_edict = #512; +void(string str) tokenize_console = #514; +float(float idx) argv_start_index = #515; +float(float idx) argv_end_index = #516; +string(string cvarname) cvar_description = #518; +#ifdef CSQC +float(optional float timetype) gettime = #519; +#endif +void(string s) loadfromdata = #529; +void(string s) loadfromfile = #530; +#ifdef SSQC +float(string mname) precache_vwep_model = #532; +#endif +void(.../*, string funcname*/) callfunction = #605; +void(float fh, entity e) writetofile = #606; +float(string s) isfunction = #607; +void(entity e, string s) parseentitydata = #608; +string(...) sprintf = #627; +#pragma noref 0 diff --git a/quakec/csaddon/src/editor_terrain.qc b/quakec/csaddon/src/editor_terrain.qc new file mode 100644 index 000000000..927182274 --- /dev/null +++ b/quakec/csaddon/src/editor_terrain.qc @@ -0,0 +1,274 @@ +enum +{ + ter_reload = 0, //reload the entire thing + ter_save = 1, //save the entire heightmap + ter_sethole = 2, + ter_height_set = 3, //set heights to a specific value + ter_height_smooth = 4, //smooth the heights slightly (non-destructive) + ter_height_spread = 5, //smooth the heights slightly (leaves center as-is) + ter_height_raise = 6, //raise the terrain in a bell (negative value to lower) + ter_height_lower = 7, //lower the terrain in a bell (negative value to raise) + ter_tex_kill = 8, //set section texture + ter_tex_get = 9, //get section texture + ter_mixpaint = 10, //paint a specific texture + ter_mixconcentrate = 11, //figure out which is the strongest mixed texture and make it stronger + ter_mixnoise = 12, //add random noise to the affected samples + ter_mixblur = 13, //blur the texture mixture + + + + ter_blank, + ter_radius, + ter_quant, + ter_tex, + ter_count +}; +static var float eradius = 256; +static var float equant = 8; +static var vector emix = '1 0 0'; +static string tex[8]; +static float curtool; +static int painttex; + +static string toolname[ter_count] = +{ + "reload", + "save", + "holes", + "height set", + "height smooth", + "height spread", + "height raise", + "height lower", + "tex kill", + "tex get", + "mix paint", + "mix concentrate", + "mix noise", + "mix blur", + "", + "rad", + "quant", + "tex" +}; + +#define terrain_edit terrain_editfoo + +__variant(float action, ...) terrain_edit = #278; + +float(float keyc, float unic, vector m) editor_terrain_key = +{ + if (curtool == ter_tex) + { + string txt; + float nt = curtool; + if (curtool == ter_radius) + txt = itos((int)eradius); + if (curtool == ter_quant) + txt = itos((int)equant); + if (curtool == ter_tex) + txt = tex[painttex]; + + if (keyc == 10 || keyc == 13) + nt = ter_mixpaint; + else if (keyc == 127) + txt = substring(txt, 0, -2); + else if (keyc == 8) + txt = ""; + else if (unic) + txt = strcat(txt, chr2str(unic)); + + if (curtool == ter_radius) + eradius = stof(txt); + if (curtool == ter_quant) + equant = stof(txt); + if (curtool == ter_tex) + { + txt = strzone(txt); + strunzone(tex[painttex]); + tex[painttex] = txt; + } + + curtool = nt; + } + else if (keyc == 13 || keyc == 512) + { + if (m_x < 128) + curtool = floor((m_y-16) / 8); + else + { + vector t = unproject(m + '0 0 8192'); + vector o = unproject(m); + if (vlen(o - t) > 8192) + t = o + normalize(t)*8192; + traceline(o, t, TRUE, world); + + switch(curtool) + { + case ter_reload: + case ter_save: + terrain_edit(curtool); + break; + case ter_sethole: //use view center instead of targetted - you cannot target that which is not there + terrain_edit(curtool, trace_endpos, eradius, equant); + break; + case ter_height_set: + case ter_height_smooth: + case ter_height_raise: + case ter_height_lower: + terrain_edit(curtool, trace_endpos, eradius, equant); + break; + case ter_tex_get: + strunzone(tex[0]); + strunzone(tex[1]); + strunzone(tex[2]); + strunzone(tex[3]); + tex[0] = strzone(terrain_edit(curtool, trace_endpos, 0, 0)); + tex[1] = strzone(terrain_edit(curtool, trace_endpos, 0, 1)); + tex[2] = strzone(terrain_edit(curtool, trace_endpos, 0, 2)); + tex[3] = strzone(terrain_edit(curtool, trace_endpos, 0, 3)); + break; +// case ter_mixset: +// terrain_edit(curtool, trace_endpos, eradius, equant, emix); +// break; + case ter_mixpaint: + terrain_edit(curtool, trace_endpos, eradius, equant, tex[painttex]); + break; + case ter_tex_kill: + terrain_edit(curtool, trace_endpos, eradius, equant, tex[painttex]); + break; + case ter_mixconcentrate: + case ter_mixnoise: + case ter_mixblur: + terrain_edit(curtool, trace_endpos, eradius, equant); + break; + } + } + } + else if (unic == '+' || unic == '=') + eradius += 16; + else if (unic == '-') + eradius -= 16; + else if (unic == '[') + equant -= 1; + else if (unic == ']') + equant += 1; + else if (unic == '{') + painttex = (painttex + 7) & 7; + else if (unic == '}') + painttex = (painttex + 1) & 7; + else if (unic == '1') + painttex = 0; + else if (unic == '2') + painttex = 1; + else if (unic == '3') + painttex = 2; + else if (unic == '4') + painttex = 3; + else if (unic == '5') + painttex = 4; + else if (unic == '6') + painttex = 5; + else if (unic == '7') + painttex = 6; + else if (unic == '8') + painttex = 7; + else + return FALSE; + return TRUE; +}; + +shared vector v_forward; +shared vector v_right; +shared vector v_up; +void(vector mousepos) editor_terrain_add = +{ + float s,c; + float r; + vector tx, p, col; + float a; + if (mousepos_x < 128) + return; + + vector t = unproject(mousepos + '0 0 8192'); + vector o = unproject(mousepos); + if (vlen(o - t) > 8192) + t = o + normalize(t)*8192; + traceline(o, t, TRUE, world); + + + shaderforname("terrainedit", + "{" + "{\n" + "map terrainedit\n" + "blendfunc add\n" + "rgbgen vertex\n" + "alphagen vertex\n" + "}\n" + "}"); + + r = eradius;//sqrt(eradius*eradius/2); + + s = sin(gettime(5)) * r; + c = cos(gettime(5)) * r; + + col_x = (sin(gettime(5))+1.5)*0.1; + + R_BeginPolygon("terrainedit"); + for (a = 0; a < 3.14*2; a += 3.14*2/8) + { + tx_x = sin(a); + tx_y = cos(a); + + //-1 -1 + p_x = trace_endpos_x + tx_x*c - tx_y*s; + p_y = trace_endpos_y + tx_y*c + tx_x*s; + p_z = trace_endpos_z + 5; + tx = (tx*0.5)+'0.5 0.5 0'; + R_PolygonVertex(p, tx, col, 1); + } + R_EndPolygon(); +}; + +vector vidsize; +void(vector mousepos) editor_terrain_overlay = +{ + float i; + vector pos; + vector colour; + + pos = '128 0 0'; + pos_y = vidsize_y - 32; + drawfill('0 16 0', pos, '0 0 0', 0.3); + + pos = '0 16 0'; + for (i = 0; i < ter_count; i+=1) + { + if (curtool == i) + colour = '1 0 0'; + else if (mousepos_x < 128 && mousepos_y >= pos_y && mousepos_y < pos_y + 8) + colour = '0 0 1'; + else + colour = '1 1 1'; + + if (i == ter_radius) + drawstring(pos, sprintf("radius: %g", eradius), '8 8 0', colour, 1, 0); + else if (i == ter_quant) + drawstring(pos, sprintf("quantity: %g", equant), '8 8 0', colour, 1, 0); + else if (i == ter_tex) + { + if (curtool == ter_tex_get) + { + drawstring(pos, sprintf("Tex0: %s", tex[0]), '8 8 0', colour, 1, 0); pos_y += 8; + drawstring(pos, sprintf("Tex1: %s", tex[1]), '8 8 0', colour, 1, 0); pos_y += 8; + drawstring(pos, sprintf("Tex2: %s", tex[2]), '8 8 0', colour, 1, 0); pos_y += 8; + drawstring(pos, sprintf("Tex3: %s", tex[3]), '8 8 0', colour, 1, 0); + } + else + drawstring(pos, sprintf("Tex%1i: %s", painttex, tex[painttex]), '8 8 0', colour, 1, 0); + } + else + drawstring(pos, toolname[i], '8 8 0', colour, 1, 0); + pos_y += 8; + } +};