**DarkPlaces Engine**
-------------------------------------------------------------------------------
-* **Project Leader**
+* **Project Leader**
* **Ashley Rose Hale (LadyHavoc)**
* **Core Developers/Maintainers**
int i;
fs_offset_t ix = SCR_CaptureVideo_RIFF_GetPosition();
fs_offset_t pos, sz;
-
+
if(!format->canseek)
Sys_Error("SCR_CaptureVideo_RIFF_MakeIxChunk called on non-seekable AVI");
//fs_offset_t curfilesize;
if (format->riffstacklevel != 2)
Sys_Error("SCR_CaptureVideo_RIFF_OverflowCheck: chunk stack leakage!\n");
-
+
if(!format->canseek)
return;
long e_o_s;
int64_t granulepos;
-
+
int64_t packetno; /* sequence number for decode; the framing
knows where there's a hole in the data,
but we need coupling so that the codec
* Theora bitstream info.
* Contains the basic playback parameters for a stream,
* corresponding to the initial 'info' header packet.
- *
+ *
* Encoded theora frames must be a multiple of 16 in width and height.
* To handle other frame sizes, a crop rectangle is specified in
* frame_height and frame_width, offset_x and * offset_y. The offset
* fraction. Aspect ratio is also stored as a rational fraction, and
* refers to the aspect ratio of the frame pixels, not of the
* overall frame itself.
- *
+ *
* See <a href="http://svn.xiph.org/trunk/theora/examples/encoder_example.c">
* examples/encoder_example.c</a> for usage examples of the
* other paramters and good default settings for the encoder parameters.
} theora_state;
-/**
+/**
* Comment header metadata.
*
* This structure holds the in-stream metadata corresponding to
* the 'comment' header packet.
*
* Meta data is stored as a series of (tag, value) pairs, in
- * length-encoded string vectors. The first occurence of the
+ * length-encoded string vectors. The first occurence of the
* '=' character delimits the tag and value. A particular tag
* may occur more than once. The character set encoding for
* the strings is always UTF-8, but the tag names are limited
FS_Write(cls.capturevideo.videofile, pg.body, pg.body_len);
}
}
-
+
while (1) {
int result = qogg_stream_flush (&format->to, &pg);
if (result < 0)
Cvar_RegisterVariable(&r_fixtrans_auto);
Cvar_RegisterVariable(&cl_team);
Cvar_RegisterVariable(&cl_skin);
- Cvar_RegisterVariable(&cl_noaim);
+ Cvar_RegisterVariable(&cl_noaim);
Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "cmd", CL_ForwardToServer_f, "send a console commandline to the server (used by some mods)");
Cmd_AddCommand(CF_CLIENT, "color", CL_Color_f, "change your player shirt and pants colors");
cvar_t in_pitch_min = {CF_CLIENT, "in_pitch_min", "-90", "how far you can aim upward (quake used -70)"};
cvar_t in_pitch_max = {CF_CLIENT, "in_pitch_max", "90", "how far you can aim downward (quake used 80)"};
-cvar_t m_filter = {CF_CLIENT | CF_ARCHIVE, "m_filter","0", "smoothes mouse movement, less responsive but smoother aiming"};
+cvar_t m_filter = {CF_CLIENT | CF_ARCHIVE, "m_filter","0", "smoothes mouse movement, less responsive but smoother aiming"};
cvar_t m_accelerate = {CF_CLIENT | CF_ARCHIVE, "m_accelerate","1", "linear mouse acceleration factor (set to 1 to disable the linear acceleration and use only the power or natural acceleration; set to 0 to disable all acceleration)"};
cvar_t m_accelerate_minspeed = {CF_CLIENT | CF_ARCHIVE, "m_accelerate_minspeed","5000", "below this speed in px/s, no acceleration is done, with a linear slope between (applied only on linear acceleration)"};
cvar_t m_accelerate_maxspeed = {CF_CLIENT | CF_ARCHIVE, "m_accelerate_maxspeed","10000", "above this speed in px/s, full acceleration is done, with a linear slope between (applied only on linear acceleration)"};
r_refdef.scene.numlights = 0;
r_refdef.view.matrix = identitymatrix;
r_refdef.view.quality = 1;
-
+
cl.num_brushmodel_entities = 0;
if (cls.state == ca_connected && cls.signon == SIGNONS)
ent = cl_meshentities + i;
ent->state_current.active = true;
ent->render.model = cl_meshentitymodels + i;
- Mod_Mesh_Create(ent->render.model, cl_meshentitynames[i]);
+ Mod_Mesh_Create(ent->render.model, cl_meshentitynames[i]);
ent->render.alpha = 1;
ent->render.flags = RENDER_SHADOW | RENDER_LIGHT;
ent->render.framegroupblend[0].lerp = 1;
{
// be quiet while shutting down
S_StopAllSounds();
-
+
// disconnect client from server if active
CL_Disconnect();
-
+
CL_Video_Shutdown();
#ifdef CONFIG_MENU
CDAudio_Shutdown ();
S_Terminate ();
-
+
R_Modules_Shutdown();
VID_Shutdown();
R_TimeReport_EndFrame();
R_TimeReport_BeginFrame();
-
+
if(!scr_loading)
Sbar_ShowFPS();
verts[1] = verts[4] = vid_conheight.integer - scr_loadingscreen_barheight.value;
verts[3] = verts[6] = vid_conwidth.integer * loadingscreenstack->absolute_loading_amount_min;
verts[7] = verts[10] = vid_conheight.integer;
-
+
#if _MSC_VER >= 1400
#define sscanf sscanf_s
#endif
if (video->subtitles == CLVIDEO_MAX_SUBTITLES)
{
Con_Printf(CON_WARN "WARNING: CLVIDEO_MAX_SUBTITLES = %i reached when reading subtitles from '%s'\n", CLVIDEO_MAX_SUBTITLES, subtitlesfile);
- break;
+ break;
}
// add a sub
video->subtitle_text[numsubs] = (char *) Mem_Alloc(cls.permanentmempool, strlen(com_token) + 1);
}
// update all videos
-void CL_Video_Frame(void)
+void CL_Video_Frame(void)
{
clvideo_t *video;
int destframe;
do {
video->framenum++;
if (video->decodeframe(video->stream, video->imagedata, cl_videormask, cl_videogmask, cl_videobmask, cl_videobytesperpixel, cl_videobytesperpixel * video->width))
- {
+ {
// finished?
CL_RestartVideo(video);
if (video->state == CLVIDEO_PLAY)
py = 0;
sx = vid_conwidth.integer;
sy = vid_conheight.integer;
- st[0] = 0.0; st[1] = 0.0;
- st[2] = 1.0; st[3] = 0.0;
- st[4] = 0.0; st[5] = 1.0;
- st[6] = 1.0; st[7] = 1.0;
+ st[0] = 0.0; st[1] = 0.0;
+ st[2] = 1.0; st[3] = 0.0;
+ st[4] = 0.0; st[5] = 1.0;
+ st[6] = 1.0; st[7] = 1.0;
if (cl_video_keepaspectratio.integer)
{
float a = video->getaspectratio(video->stream) / ((float)vid.width / (float)vid.height);
CL_RestartVideo( cl_videos );
}
-void CL_Video_KeyEvent( int key, int ascii, qbool down )
+void CL_Video_KeyEvent( int key, int ascii, qbool down )
{
// only react to up events, to allow the user to delay the abortion point if it suddenly becomes interesting..
if( !down ) {
// scale
AvCodec_FillPicture((AVPicture *)s->frame_output, (uint8_t *)s->frame_output_buffer, PIX_FMT_BGRA, s->framewidth, s->frameheight);
AvCodec_FillPicture((AVPicture *)s->frame_output_scale, (uint8_t *)imagedata, PIX_FMT_BGRA, s->info_imagewidth, s->info_imageheight);
- SwsContext *scale_context = SwScale_GetCachedContext(NULL, s->framewidth, s->frameheight, PIX_FMT_BGRA, s->info_imagewidth, s->info_imageheight, PIX_FMT_BGRA, libavcodec_scalers[max(0, min(LIBAVCODEC_SCALERS, cl_video_libavcodec_scaler.integer))], NULL, NULL, NULL);
+ SwsContext *scale_context = SwScale_GetCachedContext(NULL, s->framewidth, s->frameheight, PIX_FMT_BGRA, s->info_imagewidth, s->info_imageheight, PIX_FMT_BGRA, libavcodec_scalers[max(0, min(LIBAVCODEC_SCALERS, cl_video_libavcodec_scaler.integer))], NULL, NULL, NULL);
if (!scale_context)
{
Con_Printf("JamDecoder: LibAvcodec: error creating scale context frame %i\n", s->framenum);
}
if (!SwScale_Scale(scale_context, s->frame_output->data, s->frame_output->linesize, 0, s->frameheight, s->frame_output_scale->data, s->frame_output_scale->linesize))
Con_Printf("JamDecoder: LibAvcodec : error scaling frame\n", s->framenum);
- SwScale_FreeContext(scale_context);
+ SwScale_FreeContext(scale_context);
#else
// make BGRA imagepixels from 8bit palettized frame
b = (unsigned char *)imagedata;
s->info_imagewidth = max(s->info_imagewidth, (unsigned int)cl_video_libavw_minwidth.integer);
if (cl_video_libavw_minheight.integer > 0)
s->info_imageheight = max(s->info_imageheight, (unsigned int)cl_video_libavw_minheight.integer);
-
+
// provide sound in separate .wav
len = strlen(filename) + 10;
wavename = (char *)Z_Malloc(len);
pos = PRVM_G_VECTOR(OFS_PARM0);
string = PRVM_G_STRING(OFS_PARM1);
scale = PRVM_G_VECTOR(OFS_PARM2);
- VectorCopy(PRVM_G_VECTOR(OFS_PARM3), rgb);
+ VectorCopy(PRVM_G_VECTOR(OFS_PARM3), rgb);
alpha = PRVM_G_FLOAT(OFS_PARM4);
flag = (int)PRVM_G_FLOAT(OFS_PARM5);
}
* The Quake command-line is super basic. It can be entered in the console
* or in config files. A semicolon is used to terminate a command and chain
* them together. Otherwise, a newline delineates command input.
- *
+ *
* In most engines, the Quake command-line is a simple linear text buffer that
* is parsed when it executes. In Darkplaces, we use a linked list of command
* input and parse the input on the spot.
- *
+ *
* This was done because Darkplaces allows multiple command interpreters on the
* same thread. Previously, each interpreter maintained its own buffer and this
* caused problems related to execution order, and maintaining a single simple
command = false;
comment = false;
break;
- default:
+ default:
if(!comment) // Not a newline so far. Still not a valid command yet.
{
if(!quotes && (*input)[pos] == ';') // Ignore semicolons in quotes.
}
strlcpy(&(*output)->text[offset], &(*input)[start], cmdsize + 1);
-
+
/*
* If we were still looking ahead by the time we broke from the loop, the command input
* hasn't terminated yet and we're still expecting more, so keep this node open for appending later.
* can insert data at the beginning of the text buffer
*/
current = List_Entry(cbuf->start.next, cmd_input_t, list);
-
+
// Recycle memory so using WASD doesn't cause a malloc and free
List_Move_Tail(¤t->list, &cbuf->free);
-
+
/*
* Assume we're rolling with the current command-line and
* always set this false because alias expansion or cbuf insertion
Cmd_StuffCmds_f
Adds command line parameters as script statements
-Commands lead with a +, and continue until a - or another +
+Commands lead with a +, and continue until a - or another
quake +prog jctest.qp +cmd amlev1
quake -nosound +cmd amlev1
===============
}
}
}
- else
+ else
outtext[outlen++] = *in++;
}
outtext[outlen] = 0;
static cmd_state_t *Cmd_AddInterpreter(cmd_buf_t *cbuf, cvar_state_t *cvars, int cvars_flagsmask, int cmds_flagsmask, cmd_userdefined_t *userdefined)
{
cmd_state_t *cmd = (cmd_state_t *)Mem_Alloc(tempmempool, sizeof(cmd_state_t));
-
+
cmd->mempool = Mem_AllocPool("commands", 0, NULL);
// space for commands and script files
cmd->cbuf = cbuf;
{
cmd_function_t *func;
cmd_function_t **next = &cmd->userdefined->qc_functions;
-
+
while(*next)
{
func = *next;
* Cloudwalk FIXME: This idea sounded great in my head but...
* How do we handle commands that can be received by the client,
* but which the server can also execute locally?
- *
+ *
* If we create a callback where the engine will forward to server
* but try to execute the command locally if it's dedicated,
* we're back to intermixing client and server code which I'm
gamemode_t gamemode;
const char *gamename;
-const char *gamenetworkfiltername; // same as gamename currently but with _ in place of spaces so that "getservers" packets parse correctly (this also means the
+const char *gamenetworkfiltername; // same as gamename currently but with _ in place of spaces so that "getservers" packets parse correctly (this also means the
const char *gamedirname1;
const char *gamedirname2;
const char *gamescreenshotname;
/*
* Insert a node between two known nodes.
- *
+ *
* Only use when prev and next are known.
*/
static inline void __List_Add(llist_t *node, llist_t *prev, llist_t *next)
FS_Print (logfile, sanitizedmsg);
Mem_Free(sanitizedmsg);
}
- else
+ else
{
FS_Print (logfile, msg);
}
FS_Write(file, sanitizedmsg, strlen(sanitizedmsg));
Mem_Free(sanitizedmsg);
}
- else
+ else
{
FS_Write(file, CON_LINES(i).start, CON_LINES(i).len);
}
else g -= 87;
if(isdigit(b)) b -= '0';
else b -= 87;
-
+
color = Sys_Con_NearestColor(r * 17, g * 17, b * 17);
in += 3; // 3 only, the switch down there does the fourth
}
else
color = in[1];
-
+
switch(color)
{
case STRING_COLOR_TAG:
convex_face_t faces[CONVEX_MAX_FACES];
// we consider points to be equivalent if they are within this distance
- // suggested value is maxextent / 1048576.0f, which is a way of saying
+ // suggested value is maxextent / 1048576.0f, which is a way of saying
// 'equivalent within 20 bits of precision'
float epsilon;
}
static crypto_t *Crypto_ServerFindInstance(lhnetaddress_t *peeraddress, qbool allow_create)
{
- crypto_t *crypto;
+ crypto_t *crypto;
int i, best;
if(!d0_blind_id_dll)
if(!d0_blind_id_dll)
return;
-
+
// syntax of keystring:
// aeslevel id@key id@key ...
/*
* This should be fine for now but FTEQW uses flags for keydest
* and checks that an array called "eyeoffset" is 0
- *
+ *
* Just a note in case there's compatibility problems later
*/
PRVM_G_FLOAT(OFS_PARM2) = key_dest == key_game;
float px, py, *v, a, b, c, *cp[3][3], temp[3][64];
int xmax = max(1, 2*tesselationwidth);
int ymax = max(1, 2*tesselationheight);
-
+
// iterate over the individual 3x3 quadratic spline surfaces one at a time
// expanding them to fill the output array (with some overlap to ensure
// the edges are filled)
// a.b / (|a| |b|)
//
// so the area is
- //
+ //
// 0.5 * sqrt(|a|^2 |b|^2 - (a.b)^2)
int c;
float aa = 0, bb = 0, ab = 0;
return modified;
}
-#undef SIDE_INVALID
+#undef SIDE_INVALID
#undef SIDE_X
#undef SIDE_Y
for (char **alias = cvar->aliases; alias && *alias; alias++)
if (!strncasecmp(partial, *alias, len) && (cvar->flags & neededflags))
h++;
-
+
return h;
}
for (char **alias = cvar->aliases; alias && *alias; alias++)
if (!strncasecmp(partial, *alias, len) && (cvar->flags & neededflags))
buf[bpos++] = *alias;
-
+
buf[bpos] = NULL;
return buf;
if (!strncasecmp (partial, *alias, len) && (cvar->flags & neededflags))
Cvar_PrintHelp(cvar, *alias, true);
-
+
}
// check if a cvar is held by some progs
//darkplaces implementation: Blub\0
//cvar definitions:
// utf8_enable: enable utf8 encoding
-//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc.,
+//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc.,
//and count as 1 char for string functions like strlen, substring, etc.
// note: utf8_enable is run-time cvar, could be changed during execution
// note: beware that str2chr() could return value bigger than 255 once utf8 is enabled
// description: allows alternative 'static' lightstyle syntax : "=value"
// examples: "=0.5", "=2.0", "=2.75"
// could be used to control switchable lights or making styled lights with brightness > 2
-// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact
+// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact
// that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax
//DP_LITSPRITES
//supported stuff:
// %
// optional: <argpos>$ for the argument to format (the arg counter then is not increased)
-// flags: #0- +
+// flags: #0-
// optional: <width>, *, or *<argpos>$ for the field width (width is read before value and precision)
// optional: .<precision>, .*, or .*<argpos>$ for the precision (precision is read before value)
// length modifiers: h for forcing a float, l for forcing an entity (by default, %d etc. cast a float to int), ll for forcing an int
//syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens:
// <start> <end> "string"
// start: subtitle start time in seconds
-// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started,
+// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started,
// if below 0 - show until next subtitles minus this number of seconds
// text: subtitle text, color codes (Q3-style and ^xRGB) are allowed
//example of subtitle file:
// 3 0 "Vengeance! Vengeance for my eternity of suffering!"
// 9 0 "Whelp! As if you knew what eternity was!"
// 13 0 "Grovel before your true master."
-// 17 0 "Never!"
+// 17 0 "Never!"
// 18 7 "I'll hack you from crotch to gizzard and feed what's left of you to your brides..."
//DP_SOLIDCORPSE
.vector massofs; // offsets a mass center out of object center, if not set a center of model bounds is used
.float friction; // a friction of object, get multiplied by second objects's friction on contact
.float bouncefactor;
-.float bouncestop;
+.float bouncestop;
.float jointtype; // type of joint
.float forcetype; // type of force
-.float erp; // error restitution parameter, makes ODE solver attempt to fix errors in contacts,
- // bringing together 2 joints or fixing object being stuch in other object,
+.float erp; // error restitution parameter, makes ODE solver attempt to fix errors in contacts,
+ // bringing together 2 joints or fixing object being stuch in other object,
// a value of 0.1 will fix slightly, a value of 1.0 attempts to fix whole error in one frame
// use with care as high values makes system unstable and likely to explode
//builtin definitions:
float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467;
vector drawcolorcodedstring2(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #467;
-
+
float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
}
elsif(/getglobal\w*\(\w+, "(\w+)"\)/)
{
- # hack for weird DP source
+ # hack for weird DP source
$vm{csprogs}{globals}{$1} = [0, "DP_CSQC_SPAWNPARTICLE"];
}
}
};
static dllhandle_t shfolder_dll = NULL;
-const GUID qFOLDERID_SavedGames = {0x4C5C32FF, 0xBB9D, 0x43b0, {0xB5, 0xB4, 0x2D, 0x72, 0xE5, 0x4E, 0xAA, 0xA4}};
+const GUID qFOLDERID_SavedGames = {0x4C5C32FF, 0xBB9D, 0x43b0, {0xB5, 0xB4, 0x2D, 0x72, 0xE5, 0x4E, 0xAA, 0xA4}};
#define qREFKNOWNFOLDERID const GUID *
#define qKF_FLAG_CREATE 0x8000
#define qKF_FLAG_NO_ALIAS 0x1000
Cvar_SetQuick (&scr_screenshot_name, com_modname);
else
Cvar_SetQuick (&scr_screenshot_name, gamescreenshotname);
-
+
if((i = Sys_CheckParm("-modname")) && i < sys.argc - 1)
strlcpy(com_modname, sys.argv[i+1], sizeof(com_modname));
ret = FS_SysCheckGameDir(va(vabuf, sizeof(vabuf), "%s%s/", fs_basedir, gamedir), buf, sizeof(buf));
if(ret)
return ret;
-
+
return fs_checkgamedir_missing;
}
continue;
if(!*info)
continue;
- stringlistappend(&list2, list.strings[i]);
+ stringlistappend(&list2, list.strings[i]);
}
stringlistfreecontents(&list);
====================
FS_SanitizePath
-Sanitize path (replace non-portable characters
+Sanitize path (replace non-portable characters
with portable ones in-place, etc)
====================
*/
if(count < 0)
return NULL;
linkbuf[count] = 0;
-
+
// Now combine the paths...
mergeslash = strrchr(filename, '/');
mergestart = linkbuf;
{
Con_Printf("usage:\n%s <file>\n", Cmd_Argv(cmd, 0));
return;
- }
+ }
filename = Cmd_Argv(cmd, 1);
sp = FS_FindFile(filename, &index, true);
if (!sp) {
Mem_Free(tmp);
return NULL;
}
-
+
if(qz_deflateEnd(&strm) != Z_OK)
{
Con_Printf("FS_Deflate: deflateEnd failed\n");
memcpy(out, tmp, strm.total_out);
Mem_Free(tmp);
-
+
return out;
}
case Z_STREAM_END:
case Z_OK:
break;
-
+
case Z_STREAM_ERROR:
Con_Print("FS_Inflate: stream error!\n");
break;
default:
Con_Print("FS_Inflate: unknown error!\n");
break;
-
+
}
if(ret != Z_OK && ret != Z_STREAM_END)
{
Mem_Free(outbuf.data);
*inflated_size = (size_t)outbuf.cursize;
-
+
return out;
}
#include "utf8lib.h"
-/*
+/*
* From http://www.unicode.org/Public/UNIDATA/Blocks.txt
*
* E000..F8FF; Private Use Area
qbool image_font; // only fallbacks are freetype fonts
// TODO: clean this up and do not expose everything.
-
+
const unsigned char *data; // FT2 needs it to stay
//fs_offset_t datasize;
void *face;
{
#if 0
unsigned int unitnum;
-
+
BACKENDACTIVECHECK
for (unitnum = 0;unitnum < MAX_TEXTUREUNITS;unitnum++)
// returns 0 otherwise
static int RGBstring_to_colorindex(const char *str)
{
- Uchar ch;
+ Uchar ch;
int ind = 0x0001 << 4;
do {
if (*str <= '9' && *str >= '0')
if (r_glsl_permutation->loc_Color_Ambient >= 0) qglUniform3f(r_glsl_permutation->loc_Color_Ambient, rtlightambient[0], rtlightambient[1], rtlightambient[2]);
if (r_glsl_permutation->loc_Color_Diffuse >= 0) qglUniform3f(r_glsl_permutation->loc_Color_Diffuse, rtlightdiffuse[0], rtlightdiffuse[1], rtlightdiffuse[2]);
if (r_glsl_permutation->loc_Color_Specular >= 0) qglUniform3f(r_glsl_permutation->loc_Color_Specular, rtlightspecular[0], rtlightspecular[1], rtlightspecular[2]);
-
+
// additive passes are only darkened by fog, not tinted
if (r_glsl_permutation->loc_FogColor >= 0)
qglUniform3f(r_glsl_permutation->loc_FogColor, 0, 0, 0);
r_refdef.stats[r_stat_animcache_skeletal_bones] += model->num_bones;
r_refdef.stats[r_stat_animcache_skeletal_maxbones] = max(r_refdef.stats[r_stat_animcache_skeletal_maxbones], model->num_bones);
ent->animcache_skeletaltransform3x4 = (float *)R_FrameData_Alloc(sizeof(float[3][4]) * model->num_bones);
- Mod_Skeletal_BuildTransforms(model, ent->frameblend, ent->skeleton, NULL, ent->animcache_skeletaltransform3x4);
+ Mod_Skeletal_BuildTransforms(model, ent->frameblend, ent->skeleton, NULL, ent->animcache_skeletaltransform3x4);
// note: this can fail if the buffer is at the grow limit
ent->animcache_skeletaltransform3x4size = sizeof(float[3][4]) * model->num_bones;
ent->animcache_skeletaltransform3x4buffer = R_BufferData_Store(ent->animcache_skeletaltransform3x4size, ent->animcache_skeletaltransform3x4, R_BUFFERDATA_UNIFORM, &ent->animcache_skeletaltransform3x4offset);
r_refdef.view.usecustompvs = true;
r_refdef.scene.worldmodel->brush.FatPVS(r_refdef.scene.worldmodel, visorigin, 2, r_refdef.viewcache.world_pvsbits, (r_refdef.viewcache.world_numclusters+7)>>3, false);
}
-
+
// camera needs no clipplane
r_refdef.view.useclipplane = false;
// TODO: is the camera origin always valid? if so we don't need to clear this
{
// declare variables
float blur_factor, blur_mouseaccel, blur_velocity;
- static float blur_average;
+ static float blur_average;
static vec3_t blur_oldangles; // used to see how quickly the mouse is moving
// set a goal for the factoring
- blur_velocity = bound(0, (VectorLength(cl.movement_velocity) - r_motionblur_velocityfactor_minspeed.value)
+ blur_velocity = bound(0, (VectorLength(cl.movement_velocity) - r_motionblur_velocityfactor_minspeed.value)
/ max(1, r_motionblur_velocityfactor_maxspeed.value - r_motionblur_velocityfactor_minspeed.value), 1);
- blur_mouseaccel = bound(0, ((fabs(VectorLength(cl.viewangles) - VectorLength(blur_oldangles)) * 10) - r_motionblur_mousefactor_minspeed.value)
+ blur_mouseaccel = bound(0, ((fabs(VectorLength(cl.viewangles) - VectorLength(blur_oldangles)) * 10) - r_motionblur_mousefactor_minspeed.value)
/ max(1, r_motionblur_mousefactor_maxspeed.value - r_motionblur_mousefactor_minspeed.value), 1);
- blur_factor = ((blur_velocity * r_motionblur_velocityfactor.value)
+ blur_factor = ((blur_velocity * r_motionblur_velocityfactor.value)
+ (blur_mouseaccel * r_motionblur_mousefactor.value));
// from the goal, pick an averaged value between goal and last value
cl.motionbluralpha = bound(0, (cl.time - cl.oldtime) / max(0.001, r_motionblur_averaging.value), 1);
blur_average = blur_average * (1 - cl.motionbluralpha) + blur_factor * cl.motionbluralpha;
- // enforce minimum amount of blur
+ // enforce minimum amount of blur
blur_factor = blur_average * (1 - r_motionblur_minblur.value) + r_motionblur_minblur.value;
//Con_Printf("motionblur: direct factor: %f, averaged factor: %f, velocity: %f, mouse accel: %f \n", blur_factor, blur_average, blur_velocity, blur_mouseaccel);
cl.motionbluralpha = 1 - exp(-
(
(r_motionblur.value * blur_factor / 80)
- +
+
(r_damageblur.value * (cl.cshifts[CSHIFT_DAMAGE].percent / 1600))
)
/
};
#define BBOXEDGES 13
-static const float bboxedges[BBOXEDGES][6] =
+static const float bboxedges[BBOXEDGES][6] =
{
// whole box
{ 0, 0, 0, 1, 1, 1 },
// Now check if update flags are set on any surfaces that are visible
if (r_q1bsp_lightmap_updates_hidden_surfaces.integer)
{
- /*
+ /*
* We can do less frequent texture uploads (approximately 10hz for animated
* lightstyles) by rebuilding lightmaps on surfaces that are not currently visible.
* For optimal efficiency, this includes the submodels of the worldmodel, so we
surfaceindex = leafsurfaceindices[leafsurfaceindex];
surface = surfaces + surfaceindex;
if(!surface->texture)
- continue;
+ continue;
if (CHECKPVSBIT(info->outsurfacepvs, surfaceindex))
continue;
SETPVSBIT(info->outsurfacepvs, surfaceindex);
return false;
}
- png = (void *)qpng_create_write_struct(
+ png = (void *)qpng_create_write_struct(
(qpng_access_version_number() / 100 == 102) ? PNG_LIBPNG_VER_STRING_12 :
(qpng_access_version_number() / 100 == 104) ? PNG_LIBPNG_VER_STRING_14 :
(qpng_access_version_number() / 100 == 105) ? PNG_LIBPNG_VER_STRING_15 :
memcpy(&address->addr.in, addrinf->ai_addr, sizeof(address->addr.in));
}
address->port = port;
-
+
freeaddrinfo (addrinf);
return 1;
}
#endif
namecache[namecacheposition].address.addresstype = LHNETADDRESSTYPE_NONE;
}
-
+
namecacheposition = (namecacheposition + 1) % MAX_NAMECACHE;
return resolved;
}
}
else
qcurl_easy_setopt(di->curle, CURLOPT_USERAGENT, "");
- if(developer_curl.integer)
+ if(developer_curl.integer)
qcurl_easy_setopt(di->curle, CURLOPT_VERBOSE, (long) 1);
qcurl_easy_setopt(di->curle, CURLOPT_REFERER, di->referer);
qcurl_easy_setopt(di->curle, CURLOPT_RESUME_FROM, (long) di->startpos);
}
qcurl_easy_setopt(di->curle, CURLOPT_HTTPHEADER, di->slist);
-
+
qcurl_multi_add_handle(curlm, di->curle);
di->started = true;
++numdownloads;
##### BSD specific variables #####
# Link
-LDFLAGS_BSDSV=$(LDFLAGS_UNIXCOMMON)
+LDFLAGS_BSDSV=$(LDFLAGS_UNIXCOMMON)
LDFLAGS_BSDSDL=$(LDFLAGS_UNIXCOMMON) $(LDFLAGS_UNIXSDL)
trans_sortarraysize = r_transparent_sortarraysize.integer;
if (trans_hash)
Mem_Free(trans_hash);
- trans_hash = (meshqueue_t **)Mem_Alloc(cls.permanentmempool, sizeof(meshqueue_t *) * trans_sortarraysize);
+ trans_hash = (meshqueue_t **)Mem_Alloc(cls.permanentmempool, sizeof(meshqueue_t *) * trans_sortarraysize);
if (trans_hashpointer)
Mem_Free(trans_hashpointer);
- trans_hashpointer = (meshqueue_t ***)Mem_Alloc(cls.permanentmempool, sizeof(meshqueue_t **) * trans_sortarraysize);
+ trans_hashpointer = (meshqueue_t ***)Mem_Alloc(cls.permanentmempool, sizeof(meshqueue_t **) * trans_sortarraysize);
}
// build index
_mm_store_ps(r->m[1], r1);
_mm_store_ps(r->m[2], r2);
_mm_store_ps(r->m[3], r3);
- }
+ }
}
}
if (!bonepose)
bonepose = (float * RESTRICT) Mod_Skeletal_AnimateVertices_AllocBuffers(sizeof(float[12]) * model->num_bones);
-
+
if (skeleton && !skeleton->relativetransforms)
skeleton = NULL;
newweights.index[i] = newindex[i];
newweights.influence[i] = (unsigned char)(newinfluence[i] * scale);
total += newweights.influence[i];
- }
+ }
while (total > 255)
{
for (i = 0;i < 4;i++)
{
- if(newweights.influence[i] > 0 && total > 255)
- {
+ if(newweights.influence[i] > 0 && total > 255)
+ {
newweights.influence[i]--;
- total--;
+ total--;
}
}
}
{
for (i = 0; i < 4;i++)
{
- if(newweights.influence[i] < 255 && total < 255)
- {
- newweights.influence[i]++;
- total++;
+ if(newweights.influence[i] < 255 && total < 255)
+ {
+ newweights.influence[i]++;
+ total++;
}
}
}
if (loadmodel->num_posescale == 0) // don't divide by zero
loadmodel->num_posescale = 1.0;
loadmodel->num_poseinvscale = 1.0f / loadmodel->num_posescale;
-
+
// load the poses from the animkeys
for (index = 0;index < numanimkeys;index++)
{
if (loadmodel->num_posescale == 0) // don't divide by zero
loadmodel->num_posescale = 1.0;
loadmodel->num_poseinvscale = 1.0f / loadmodel->num_posescale;
-
+
// load the basepose as a frame
for (index = 0;index < numbones;index++)
{
va.offset = LittleLong(vas[i].offset);
vsize = header.num_vertexes*va.size;
switch (va.format)
- {
+ {
case IQM_FLOAT: vsize *= sizeof(float); break;
case IQM_UBYTE: vsize *= sizeof(unsigned char); break;
default: continue;
Matrix4x4_FromArray12FloatD3D(&pinvbase, loadmodel->data_baseboneposeinverse + 12*loadmodel->data_bones[i].parent);
Matrix4x4_Concat(&invbase, &relinvbase, &pinvbase);
Matrix4x4_ToArray12FloatD3D(&invbase, loadmodel->data_baseboneposeinverse + 12*i);
- }
+ }
else Matrix4x4_ToArray12FloatD3D(&relinvbase, loadmodel->data_baseboneposeinverse + 12*i);
}
}
}
else
{
- for (i = 0, k = 0;i < (int)header.num_frames;i++)
+ for (i = 0, k = 0;i < (int)header.num_frames;i++)
{
for (j = 0;j < (int)header.num_poses;j++, k++)
{
bound.mins[0] = LittleFloat(bounds[i].mins[0]);
bound.mins[1] = LittleFloat(bounds[i].mins[1]);
bound.mins[2] = LittleFloat(bounds[i].mins[2]);
- bound.maxs[0] = LittleFloat(bounds[i].maxs[0]);
- bound.maxs[1] = LittleFloat(bounds[i].maxs[1]);
- bound.maxs[2] = LittleFloat(bounds[i].maxs[2]);
+ bound.maxs[0] = LittleFloat(bounds[i].maxs[0]);
+ bound.maxs[1] = LittleFloat(bounds[i].maxs[1]);
+ bound.maxs[2] = LittleFloat(bounds[i].maxs[2]);
bound.xyradius = LittleFloat(bounds[i].xyradius);
bound.radius = LittleFloat(bounds[i].radius);
if (!i)
dsi = lmwidth-2;
if (dti > lmheight-2)
dti = lmheight-2;
-
+
// calculate bilinear interpolation factors
// and also multiply by fixedpoint conversion factors to
// compensate for lightmaps being 0-255 (as 0-2), we use
t1 = DotProduct (plane->normal, t->start) - plane->dist;
t2 = DotProduct (plane->normal, t->end) - plane->dist;
}
-
+
midf = t1 / (t1 - t2);
VectorMA(t->start, midf, t->dist, mid);
Con_Printf("Mod_Q1BSP_LoadEdges: %s has invalid vertex indices in edge %i (vertices %i %i >= numvertices %i)\n", loadmodel->name, i, out->v[0], out->v[1], loadmodel->brushq1.numvertexes);
if(!loadmodel->brushq1.numvertexes)
Host_Error("Mod_Q1BSP_LoadEdges: %s has edges but no vertexes, cannot fix\n", loadmodel->name);
-
+
out->v[0] = 0;
out->v[1] = 0;
}
out->maxs[0] = MSG_ReadLittleShort(sb);
out->maxs[1] = MSG_ReadLittleShort(sb);
out->maxs[2] = MSG_ReadLittleShort(sb);
-
+
firstmarksurface = MSG_ReadLittleLong(sb);
nummarksurfaces = MSG_ReadLittleLong(sb);
}
out->maxs[0] = MSG_ReadLittleFloat(sb);
out->maxs[1] = MSG_ReadLittleFloat(sb);
out->maxs[2] = MSG_ReadLittleFloat(sb);
-
+
firstmarksurface = MSG_ReadLittleLong(sb);
nummarksurfaces = MSG_ReadLittleLong(sb);
}
out->maxs[0] = MSG_ReadLittleShort(sb);
out->maxs[1] = MSG_ReadLittleShort(sb);
out->maxs[2] = MSG_ReadLittleShort(sb);
-
+
firstmarksurface = (unsigned short)MSG_ReadLittleShort(sb);
nummarksurfaces = (unsigned short)MSG_ReadLittleShort(sb);
}
loadmodel->data_textures = (texture_t*)Mem_Realloc(loadmodel->mempool, loadmodel->data_textures, loadmodel->num_texturesperskin * sizeof(texture_t));
// now assemble the texture chains
- // if we encounter the textures out of order, the later ones won't mark the earlier ones in a sequence, so the earlier
+ // if we encounter the textures out of order, the later ones won't mark the earlier ones in a sequence, so the earlier
for (i = 0, out = loadmodel->brushq1.texinfo;i < count;i++, out++)
{
int j, k;
out->maxs[0] = MSG_ReadLittleShort(sb);
out->maxs[1] = MSG_ReadLittleShort(sb);
out->maxs[2] = MSG_ReadLittleShort(sb);
-
+
firstmarksurface = (unsigned short)MSG_ReadLittleShort(sb);
nummarksurfaces = (unsigned short)MSG_ReadLittleShort(sb);
firstmarkbrush = (unsigned short)MSG_ReadLittleShort(sb);
patchtess[patchtesscount].info.lods[PATCH_LOD_VISUAL].ytess = ytess;
patchtess[patchtesscount].info.lods[PATCH_LOD_COLLISION].xtess = cxtess;
patchtess[patchtesscount].info.lods[PATCH_LOD_COLLISION].ytess = cytess;
-
+
patchtess[patchtesscount].surface_id = i;
patchtess[patchtesscount].lodgroup[0] = LittleFloat(in->specific.patch.mins[0]);
patchtess[patchtesscount].lodgroup[1] = LittleFloat(in->specific.patch.mins[1]);
{
out->v[0] = (unsigned short)MSG_ReadLittleShort(sb);
out->v[1] = (unsigned short)MSG_ReadLittleShort(sb);
-
+
if ((int)out->v[0] >= loadmodel->brushq1.numvertexes || (int)out->v[1] >= loadmodel->brushq1.numvertexes)
{
Con_Printf("Mod_VBSP_LoadEdges: %s has invalid vertex indices in edge %i (vertices %i %i >= numvertices %i)\n", loadmodel->name, i, out->v[0], out->v[1], loadmodel->brushq1.numvertexes);
if(!loadmodel->brushq1.numvertexes)
Host_Error("Mod_VBSP_LoadEdges: %s has edges but no vertexes, cannot fix\n", loadmodel->name);
-
+
out->v[0] = 0;
out->v[1] = 0;
}
/*
* The Half-Life MDL format is Valve's format for models in GoldSrc engine.
- *
+ *
* These headers were added based on information found at
* https://github.com/malortie/assimp/wiki/MDL:-Half-Life-1-file-format
*/
int32_t ofs_events;
int32_t num_frames;
-
+
int64_t unused0;
-
+
int32_t motiontype;
int32_t motionbone;
vec3_t linearmovement;
int32_t num_verts;
int32_t ofs_vertinfo;
int32_t ofs_verts;
-
+
int32_t num_norms;
int32_t ofs_norminfo;
int32_t ofs_norms;
-
+
int64_t unused1;
} dhlmdl_t;
unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds;
unsigned int num_comment, ofs_comment;
unsigned int num_extensions, ofs_extensions;
-}
+}
iqmheader_t;
typedef struct iqmmesh_s
float xyradius, radius;
}
iqmbounds_t;
-
+
#endif
if (mod->name[0] == '*') // submodel
return mod;
-
+
if (!strcmp(mod->name, "null"))
{
if(mod->loaded)
if (developer_loading.integer)
Con_Printf("loading model %s\n", mod->name);
-
+
SCR_PushLoadingScreen(mod->name, 1);
// LadyHavoc: unload the existing model in this slot (if there is one)
if (buf)
{
int i;
- const char *ext = FS_FileExtension(mod->name);
+ const char *ext = FS_FileExtension(mod->name);
char *bufend = (char *)buf + filesize;
// all models use memory, so allocate a memory pool
mod->mempool = Mem_AllocPool(mod->name, 0, NULL);
{
for (y = 0;y < model->terrain.size[1];y += model->terrain.
Mod_Terrain_SurfaceRecurseChunk(model, model->terrain.maxstepsize, x, y);
- Mod_Terrain_BuildChunk(model,
+ Mod_Terrain_BuildChunk(model,
}
#endif
int numparameters;
char parameter[TEXTURE_MAXFRAMES + 4][Q3PATHLENGTH];
char *custsurfaceparmnames[256]; // VorteX: q3map2 has 64 but well, someone will need more
- unsigned long custsurfaceflags[256];
+ unsigned long custsurfaceflags[256];
int numcustsurfaceflags;
qbool dpshaderkill;
while(COM_ParseToken_QuakeC(&text, false))
{
if (!strcasecmp(com_token, "}"))
- break;
+ break;
// register surfaceflag
if (numcustsurfaceflags >= 256)
{
if(layer->blendfunc[0] == GL_ONE && layer->blendfunc[1] == GL_ONE)
layer->blendfunc[0] = GL_SRC_ALPHA;
}
-
+
layer->dptexflags = 0;
if (layer->alphatest)
layer->dptexflags |= TEXF_ALPHA;
texture->offsetscale = 1;
texture->offsetbias = 0;
texture->specularscalemod = 1;
- texture->specularpowermod = 1;
+ texture->specularpowermod = 1;
texture->rtlightambient = 0;
texture->transparentsort = TRANSPARENTSORT_DISTANCE;
// WHEN ADDING DEFAULTS HERE, REMEMBER TO PUT DEFAULTS IN ALL LOADERS
// if it's only one frame, use the original frame name
if (j == i + 1)
strlcpy(animname, mod->animscenes[i].name, sizeof(animname));
-
+
}
dpsnprintf(outname, sizeof(outname), "%s_decompiled/%s.smd", basename, animname);
Mod_Decompile_SMD(mod, outname, first, count, false);
VM_CL_gettaginfo, // #312 vector(entity ent, float tagindex) gettaginfo (DP_QC_GETTAGINFO) (DP_QC_RENDER_SCENE)
#else
// CSQC range #300-#399
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
-NULL,
NULL,
-NULL,
-NULL,
-NULL,
+NULL,
+NULL,
+NULL,
+NULL,
+NULL,
+NULL,
+NULL,
+NULL,
+NULL,
+NULL,
+NULL,
+NULL,
#endif
NULL, // #313
NULL, // #314
strlcpy(favorites_idfp[nFavorites_idfp], com_token, sizeof(favorites_idfp[nFavorites_idfp]));
++nFavorites_idfp;
}
- else
+ else
{
if(LHNETADDRESS_FromString(&favorites[nFavorites], com_token, 26000))
++nFavorites;
if(A->info.isfavorite != B->info.isfavorite)
return A->info.isfavorite;
}
-
+
switch( serverlist_sortbyfield ) {
case SLIF_PING:
result = A->info.ping - B->info.ping;
entry->info.ping = min((unsigned) entry->info.ping, (unsigned) pingtime);
serverreplycount++;
}
-
+
// other server info is updated by the caller
return n;
}
break;
if( n < serverlist_cachecount ) {
- // the entry has already been queried once or
+ // the entry has already been queried once or
return true;
}
strlcpy (entry->info.cname, ipstring, sizeof(entry->info.cname));
entry->info.isfavorite = isfavorite;
-
+
// no, then reset the ping right away
entry->info.ping = -1;
// we also want to increase the serverlist_cachecount then
if (serverlist_consoleoutput && developer_networking.integer)
Con_Printf("Requesting info from DarkPlaces server %s\n", ipstring);
-
+
if( !NetConn_ClientParsePacket_ServerList_PrepareQuery( PROTOCOL_DARKPLACES7, ipstring, false ) ) {
break;
}
dpsnprintf (ipstring, sizeof (ipstring), "%u.%u.%u.%u:%u", data[0], data[1], data[2], data[3], data[4] * 256 + data[5]);
if (serverlist_consoleoutput && developer_networking.integer)
Con_Printf("Requesting info from QuakeWorld server %s\n", ipstring);
-
+
if( !NetConn_ClientParsePacket_ServerList_PrepareQuery( PROTOCOL_QUAKEWORLD, ipstring, false ) ) {
break;
}
if(comparator(peeraddress, userpass_start, password, cs, cslen))
goto check;
}
-
+
return NULL; // DENIED
check:
#define SDL_HAPTIC_SPHERICAL 2
/**
- * \brief Use this value to play an effect on the steering wheel axis. This
- * provides better compatibility across platforms and devices as SDL will guess
+ * \brief Use this value to play an effect on the steering wheel axis. This
+ * provides better compatibility across platforms and devices as SDL will guess
* the correct axis.
* \sa SDL_HapticDirection
*/
* By default this hint is not set and the APK expansion files are not searched.
*/
#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"
-
+
/**
* \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc.
*
* \brief A variable to control whether we trap the Android back button to handle it manually.
* This is necessary for the right mouse button to work on some Android devices, or
* to be able to trap the back button for use in your code reliably. If set to true,
- * the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of
+ * the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of
* SDL_SCANCODE_AC_BACK.
*
* The variable can be set to the following values:
* "0" - Back button will be handled as usual for system. (default)
* "1" - Back button will be trapped, allowing you to handle the key press
- * manually. (This will also let right mouse click work on systems
+ * manually. (This will also let right mouse click work on systems
* where the right mouse button functions as back.)
*
* The value of this hint is used at runtime, so it can be changed at any time.
/**
* \brief Specify an application name.
- *
+ *
* This hint lets you specify the application name sent to the OS when
* required. For example, this will often appear in volume control applets for
* audio streams, and in lists of applications which are inhibiting the
/**
* \brief If set, game controller face buttons report their values according to their labels instead of their positional layout.
- *
+ *
* For example, on Nintendo Switch controllers, normally you'd get:
*
* (Y)
*
* The variable can be set to the following values:
* "0" - SDL_TEXTEDITING events are sent, and it is the application's
- * responsibility to render the text from these events and
+ * responsibility to render the text from these events and
* differentiate it somehow from committed text. (default)
- * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent,
+ * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent,
* and text that is being composed will be rendered in its own UI.
*/
#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING"
* disabled. You should use a string that describes what your program is doing
* (and, therefore, why the screensaver is disabled). For example, "Playing a
* game" or "Watching a video".
- *
+ *
* Setting this to "" or leaving it unset will have SDL use a reasonable
* default: "Playing a game" or something similar.
*
* On some platforms, like Linux, a realtime priority thread may be subject to restrictions
* that require special handling by the application. This hint exists to let SDL know that
* the app is prepared to handle said restrictions.
- *
+ *
* On Linux, SDL will apply the following configuration to any thread that becomes realtime:
* * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy,
* * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit.
* * Exceeding this limit will result in the kernel sending SIGKILL to the app,
* * Refer to the man pages for more information.
- *
+ *
* This variable can be set to the following values:
* "0" - default platform specific behaviour
* "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy
#define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK"
/**
- * \brief A variable controlling whether the screensaver is enabled.
+ * \brief A variable controlling whether the screensaver is enabled.
*
* This variable can be set to the following values:
* "0" - Disable screensaver
/**
* \brief Tell the video driver that we only want a double buffer.
*
- * By default, most lowlevel 2D APIs will use a triple buffer scheme that
+ * By default, most lowlevel 2D APIs will use a triple buffer scheme that
* wastes no CPU time on waiting for vsync after issuing a flip, but
* introduces a frame of latency. On the other hand, using a double buffer
* scheme instead is recommended for cases where low latency is an important
/**
* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p").
-*
+*
* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has
-* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly
+* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly
* created SDL_Window:
*
* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is
/**
* \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.
- *
+ *
* This variable can be set to the following values:
* "0" - Disable _NET_WM_BYPASS_COMPOSITOR
* "1" - Enable _NET_WM_BYPASS_COMPOSITOR
- *
+ *
* By default SDL will use _NET_WM_BYPASS_COMPOSITOR
- *
+ *
*/
#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
/**
- * \brief A variable controlling whether the windows message loop is processed by SDL
+ * \brief A variable controlling whether the windows message loop is processed by SDL
*
* This variable can be set to the following values:
* "0" - The window message loop is not run
#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"
/**
- * \brief A variable to specify custom icon resource id from RC file on Windows platform
+ * \brief A variable to specify custom icon resource id from RC file on Windows platform
*/
#define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON"
#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
#define SDL_HINT_WINDOWS_USE_D3D9EX "SDL_WINDOWS_USE_D3D9EX"
/**
- * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
+ * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
*
* This variable can be set to the following values:
* "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc)
#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
/**
-* \brief A variable controlling whether the window is activated when the SDL_ShowWindow function is called
+* \brief A variable controlling whether the window is activated when the SDL_ShowWindow function is called
*
* This variable can be set to the following values:
* "0" - The window is activated when the SDL_ShowWindow function is called
#elif defined(__NACL__)
/* On NACL we use ppapi_simple to set up the application helper code,
- then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before
+ then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before
starting the user main function.
- All user code is run in a separate thread by ppapi_simple, thus
+ All user code is run in a separate thread by ppapi_simple, thus
allowing for blocking io to take place via nacl_io
*/
#define SDL_MAIN_NEEDED
# define GLAPI extern
# endif /* _STATIC_MESA support */
# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
-# define GLAPIENTRY
+# define GLAPIENTRY
# else
# define GLAPIENTRY __stdcall
# endif
#ifndef GL_EXT_multisampled_render_to_texture
#define GL_EXT_multisampled_render_to_texture 1
#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
#endif
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef unsigned short int khronos_uint16_t;
/*
- * Types that differ between LLP64 and LP64 architectures - in LLP64,
+ * Types that differ between LLP64 and LP64 architectures - in LLP64,
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use.
*/
* \sa SDL_RenderGetLogicalSize
* \sa SDL_RenderSetLogicalSize
*/
-extern DECLSPEC void SDLCALL SDL_RenderWindowToLogical(SDL_Renderer * renderer,
- int windowX, int windowY,
+extern DECLSPEC void SDLCALL SDL_RenderWindowToLogical(SDL_Renderer * renderer,
+ int windowX, int windowY,
float *logicalX, float *logicalY);
-
+
/**
* Get real coordinates of point in window when given logical coordinates of point in renderer.
* Logical coordinates will differ from real coordinates when render is scaled and logical renderer size set
- *
+ *
* \param renderer the renderer from which the window coordinates should be calculated
* \param logicalX the logical x coordinate
* \param logicalY the logical y coordinate
* \param windowX the pointer filled with the real X coordinate in the window
* \param windowY the pointer filled with the real Y coordinate in the window
-
- *
+
+ *
* \since This function is available since SDL 2.0.18.
- *
+ *
* \sa SDL_RenderGetScale
* \sa SDL_RenderSetScale
* \sa SDL_RenderGetLogicalSize
* \sa SDL_RenderSetLogicalSize
*/
-extern DECLSPEC void SDLCALL SDL_RenderLogicalToWindow(SDL_Renderer * renderer,
+extern DECLSPEC void SDLCALL SDL_RenderLogicalToWindow(SDL_Renderer * renderer,
float logicalX, float logicalY,
int *windowX, int *windowY);
* -X ... +X : left ... right
* -Y ... +Y : bottom ... top
* -Z ... +Z : farther ... closer
- *
+ *
* The axis data is not changed when the phone is rotated.
*
* \sa SDL_GetDisplayOrientation()
* -X ... +X : left ... right
* -Y ... +Y : bottom ... top
* -Z ... +Z : farther ... closer
- *
+ *
* The axis data is not changed when the phone or controller is rotated.
*
* \sa SDL_GetDisplayOrientation()
/* Platform specific functions for Windows */
#ifdef __WIN32__
-
+
typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
/**
* \since This function is available since SDL 2.0.18.
*/
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
-
+
#endif /* __LINUX__ */
-
+
/* Platform specific functions for iOS */
#ifdef __IPHONEOS__
/**
* \brief Start tracking SDL memory allocations
- *
+ *
* \note This should be called before any other SDL functions for complete tracking coverage
*/
int SDLTest_TrackAllocations(void);
OP_BITOR,
// TODO: actually support Hexen 2?
-
+
OP_MULSTORE_F, //66 redundant, for h2 compat
OP_MULSTORE_VF, //67 redundant, for h2 compat
OP_MULSTOREP_F, //68
OP_CONV_IF,
OP_CONV_FI,
-
+
OP_LOADP_IF,
OP_LOADP_FI,
OP_ADD_PIW,
OP_LOADA_F,
- OP_LOADA_V,
+ OP_LOADA_V,
OP_LOADA_S,
OP_LOADA_ENT,
OP_LOADA_FLD,
OP_LOAD_P,
OP_LOADP_F,
- OP_LOADP_V,
+ OP_LOADP_V,
OP_LOADP_S,
OP_LOADP_ENT,
OP_LOADP_FLD,
OP_GE_I,
OP_LT_I,
OP_GT_I,
-
+
OP_LE_IF,
OP_GE_IF,
OP_LT_IF,
OP_GSTOREP_ENT,
OP_GSTOREP_FLD,
OP_GSTOREP_S,
- OP_GSTOREP_FNC,
+ OP_GSTOREP_FNC,
OP_GSTOREP_V,
OP_GADDRESS,
OP_GLOAD_I,
// stringbuffer flags
#define STRINGBUFFER_SAVED 1 // saved in savegames
#define STRINGBUFFER_QCFLAGS 1 // allowed to be set by QC
-#define STRINGBUFFER_TEMP 128 // internal use ONLY
+#define STRINGBUFFER_TEMP 128 // internal use ONLY
typedef struct prvm_stringbuffer_s
{
int max_strings;
ret |= 16; // CVAR_TYPE_HASDESCRIPTION
if(cvar->flags & CF_READONLY)
ret |= 32; // CVAR_TYPE_READONLY
-
+
PRVM_G_FLOAT(OFS_RETURN) = ret;
}
{
mdef_t *d;
int i = (int)PRVM_G_FLOAT(OFS_PARM0);
-
+
if (i < 0 || i >= prog->numfielddefs)
{
VM_Warning(prog, "VM_entityfieldtype: %s: field index out of bounds\n", prog->name);
PRVM_G_FLOAT(OFS_RETURN) = -1.0;
return;
}
-
+
d = &prog->fielddefs[i];
PRVM_G_FLOAT(OFS_RETURN) = (prvm_vec_t)d->type;
}
prvm_edict_t * ent;
int i = (int)PRVM_G_FLOAT(OFS_PARM0);
char valuebuf[MAX_INPUTLINE];
-
+
if (i < 0 || i >= prog->numfielddefs)
{
VM_Warning(prog, "VM_entityfielddata: %s: field index out of bounds\n", prog->name);
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, "");
return;
}
-
+
d = &prog->fielddefs[i];
-
+
// get the entity
ent = PRVM_G_EDICT(OFS_PARM1);
if(ent->free)
return;
}
val = (prvm_eval_t *)(ent->fields.fp + d->ofs);
-
+
// if it's 0 or blank, return an empty string
type = d->type & ~DEF_SAVEGLOBAL;
for (j=0 ; j<prvm_type_size[type] ; j++)
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, "");
return;
}
-
+
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, PRVM_UglyValueString(prog, (etype_t)d->type, val, valuebuf, sizeof(valuebuf)));
}
string[length] = 0;
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, string);
*/
-
+
s = PRVM_G_STRING(OFS_PARM0);
start = (int)PRVM_G_FLOAT(OFS_PARM1);
length = (int)PRVM_G_FLOAT(OFS_PARM2);
u_slength = (int)u8_strlen(s);
length += u_slength - start + 1;
}
-
+
// positive start, positive length
u_start = u8_byteofs(s, start, NULL);
if (u_start < 0)
u_length = u8_bytelen(s + u_start, length);
if (u_length >= sizeof(string)-1)
u_length = sizeof(string)-1;
-
+
memcpy(string, s + u_start, u_length);
string[u_length] = 0;
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, string);
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, tmp);
*/
-
+
char tmp[8];
int len;
VM_SAFEPARMCOUNT(1, VM_chr);
========================
VM_gecko_keyevent
-float[bool] gecko_keyevent( string name, float key, float eventtype )
+float[bool] gecko_keyevent( string name, float key, float eventtype )
========================
*/
void VM_gecko_keyevent(prvm_prog_t *prog) {
void BufStr_Del(prvm_prog_t *prog, prvm_stringbuffer_t *stringbuffer)
{
int i;
-
+
if (!stringbuffer)
return;
VM_Warning(prog, "VM_buf_writefile: no such file handle %i (or file has been closed) in %s\n", filenum, prog->name);
return;
}
-
+
// get string buffer
stringbuffer = (prvm_stringbuffer_t *)Mem_ExpandableArray_RecordAtIndex(&prog->stringbuffersarray, (int)PRVM_G_FLOAT(OFS_PARM1));
if(!stringbuffer)
ppos = strchr(pattern, '*');
qpos = strchr(pattern, '?');
// has ? - pattern
- if (qpos)
+ if (qpos)
{
*matchrule = MATCH_PATTERN;
return pattern;
if ((ppos - pattern) == 0)
{
ppos = strchr(pattern+1, '*');
- // *something
- if (!ppos)
+ // *something
+ if (!ppos)
{
*matchrule = MATCH_RIGHT;
return pattern+1;
antilen = 0;
else
antilen = strlen(antipartial);
-
+
for (n = 0;n < stringbuffer->num_strings;n++)
if (stringbuffer->strings[n])
Mem_Free(stringbuffer->strings[n]);
stringbuffer->max_strings = stringbuffer->num_strings = n;
if (stringbuffer->max_strings)
stringbuffer->strings = (char **)Mem_Alloc(prog->progs_mempool, sizeof(stringbuffer->strings[0]) * stringbuffer->max_strings);
-
+
n = 0;
for(cvar = prog->console_cmd->cvars->vars; cvar; cvar = cvar->next)
{
szString = PRVM_G_STRING(OFS_PARM0);
COM_StringDecolorize(szString, 0, szNewString, sizeof(szNewString), true);
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, szNewString);
-
+
}
// #221 float(string str, string sub[, float startpos]) strstrofs (FTE_STRINGS)
=========
*/
-//#349 float() isdemo
+//#349 float() isdemo
void VM_CL_isdemo (prvm_prog_t *prog)
{
VM_SAFEPARMCOUNT(0, VM_CL_isdemo);
PRVM_G_FLOAT(OFS_RETURN) = cls.demoplayback;
}
-//#355 float() videoplaying
+//#355 float() videoplaying
void VM_CL_videoplaying (prvm_prog_t *prog)
{
VM_SAFEPARMCOUNT(0, VM_CL_videoplaying);
// complete directive format:
// %3$*1$.*2$ld
-
+
width = -1;
precision = -1;
thisarg = -1;
float[bool] gecko_create( string name )
void gecko_destroy( string name )
void gecko_navigate( string name, string URI )
-float[bool] gecko_keyevent( string name, float key, float eventtype )
+float[bool] gecko_keyevent( string name, float key, float eventtype )
void gecko_mousemove( string name, float x, float y )
==============================================================================
}
else
{
-
+
Con_DPrint("No spawn function for:\n");
- if (developer.integer > 0) // don't confuse non-developers with errors
+ if (developer.integer > 0) // don't confuse non-developers with errors
PRVM_ED_Print(prog, ent, NULL);
PRVM_ED_Free (prog, ent);
if(!PRVM_ED_CallSpawnFunction(prog, ent, data, start))
continue;
-
+
PRVM_ED_CallPostspawnFunction(prog, ent);
spawned++;
f->tprofile_total += prog->stack[prog->depth].tprofile_acc;
f->builtinsprofile_total += prog->stack[prog->depth].builtinsprofile_acc;
}
-
+
return prog->stack[prog->depth].s;
}
&&handle_OP_GE_I,
&&handle_OP_LT_I,
&&handle_OP_GT_I,
-
+
&&handle_OP_LE_IF,
&&handle_OP_GE_IF,
&&handle_OP_LT_IF,
&&handle_OP_GSTOREP_ENT,
&&handle_OP_GSTOREP_FLD,
&&handle_OP_GSTOREP_S,
- &&handle_OP_GSTOREP_FNC,
+ &&handle_OP_GSTOREP_FNC,
&&handle_OP_GSTOREP_V,
&&handle_OP_GADDRESS,
&&handle_OP_GLOAD_I,
HANDLE_OPCODE(OP_CALL6):
HANDLE_OPCODE(OP_CALL7):
HANDLE_OPCODE(OP_CALL8):
-#ifdef PRVMTIMEPROFILING
+#ifdef PRVMTIMEPROFILING
tm = Sys_DirtyTime();
prog->xfunction->tprofile += (tm - starttm >= 0 && tm - starttm < 1800) ? (tm - starttm) : 0;
starttm = tm;
if (builtinnumber < prog->numbuiltins && prog->builtins[builtinnumber])
{
prog->builtins[builtinnumber](prog);
-#ifdef PRVMTIMEPROFILING
+#ifdef PRVMTIMEPROFILING
tm = Sys_DirtyTime();
enterfunc->tprofile += (tm - starttm >= 0 && tm - starttm < 1800) ? (tm - starttm) : 0;
prog->xfunction->tbprofile += (tm - starttm >= 0 && tm - starttm < 1800) ? (tm - starttm) : 0;
HANDLE_OPCODE(OP_DONE):
HANDLE_OPCODE(OP_RETURN):
-#ifdef PRVMTIMEPROFILING
+#ifdef PRVMTIMEPROFILING
tm = Sys_DirtyTime();
prog->xfunction->tprofile += (tm - starttm >= 0 && tm - starttm < 1800) ? (tm - starttm) : 0;
starttm = tm;
if(an1 > bias*ap1 && an2 > bias*ap2 && an3 > bias*ap3)
mask &= (3<<4)
| (dn1 >= 0 ? (1<<0)|(2<<2) : (2<<0)|(1<<2))
- | (dn2 >= 0 ? (1<<0)|(2<<2) : (2<<0)|(1<<2))
+ | (dn2 >= 0 ? (1<<0)|(2<<2) : (2<<0)|(1<<2))
| (dn3 >= 0 ? (1<<0)|(2<<2) : (2<<0)|(1<<2));
dp1 = p1[1] + p1[2], dn1 = p1[1] - p1[2], ap1 = fabs(dp1), an1 = fabs(dn1),
if(ap1 > bias*an1 && ap2 > bias*an2 && ap3 > bias*an3)
mask &= (3<<0)
| (dp1 >= 0 ? (1<<2)|(1<<4) : (2<<2)|(2<<4))
- | (dp2 >= 0 ? (1<<2)|(1<<4) : (2<<2)|(2<<4))
+ | (dp2 >= 0 ? (1<<2)|(1<<4) : (2<<2)|(2<<4))
| (dp3 >= 0 ? (1<<2)|(1<<4) : (2<<2)|(2<<4));
if(an1 > bias*ap1 && an2 > bias*ap2 && an3 > bias*ap3)
mask &= (3<<0)
GL_DepthMask(false);
GL_Color(0, 0, 0, 1);
GL_Scissor(r_refdef.view.viewport.x, r_refdef.view.viewport.y, r_refdef.view.viewport.width, r_refdef.view.viewport.height);
-
+
r_shadow_rendermode = R_SHADOW_RENDERMODE_NONE;
r_shadow_lightingrendermode = R_SHADOW_RENDERMODE_LIGHT_GLSL;
dlight_t *light;
rtlight_t *rtlight;
- // calculate bounds enclosing world lights as they should be noticably tighter
+ // calculate bounds enclosing world lights as they should be noticably tighter
// than the world bounds on maps with unlit monster containers (see e1m7 etc)
range = (unsigned int)Mem_ExpandableArray_IndexRange(&r_shadow_worldlightsarray); // checked
for (lightindex = 0;lightindex < range;lightindex++)
qbool settingschanged;
enable = R_Shadow_BounceGrid_CheckEnable(flag);
-
+
R_Shadow_BounceGrid_GenerateSettings(&settings);
-
+
// changing intensity does not require an update
r_shadow_bouncegrid_state.intensity = r_shadow_bouncegrid_intensity.value;
If the sprite is out of view, track it.
`origin`, `left` and `up` are changed by this function to achive a rotation around
the hotspot.
-
+
--blub
*/
#define SIDE_TOP 1
float x, y; // screen X and Y coordinates
float ax, ay; // absolute coords, used for division
// I divide x and y by the greater absolute value to get ranges -1.0 to +1.0
-
+
bCoord[2] *= r_refdef.view.frustum_x;
bCoord[1] *= r_refdef.view.frustum_y;
//Con_Printf("%f %f %f\n", bCoord[0], bCoord[1], bCoord[2]);
-
+
ax = fabs(bCoord[1]);
ay = fabs(bCoord[2]);
// get the greater value and determine the screen edge it's on
else
*edge = SIDE_LEFT;
}
-
- // umm...
+
+ // umm...
if(ax < MIN_EPSILON) // this was == 0.0f before --blub
ax = MIN_EPSILON;
// get the -1 to +1 range
// g is frustum Y
// y is y
// b is ay
-
+
// real dist (r) shall be d, so
// r*r = d*d + dfxa*dfxa + dgyb*dgyb
// r*r = d*d * (1 + fxa*fxa + gyb*gyb)
// d*d = r*r / (1 + fxa*fxa + gyb*gyb)
// d = sqrt(r*r / (1 + fxa*fxa + gyb*gyb))
// thus:
- distance = sqrt((distance*distance) / (1.0 +
- r_refdef.view.frustum_x*r_refdef.view.frustum_x * x*x * ax*ax +
+ distance = sqrt((distance*distance) / (1.0
+ r_refdef.view.frustum_x*r_refdef.view.frustum_x * x*x * ax*ax
r_refdef.view.frustum_y*r_refdef.view.frustum_y * y*y * ay*ay));
// ^ the one we want ^ the one we have ^ our factors
-
+
// Place the sprite a few units ahead of the player
VectorCopy(r_refdef.view.origin, origin);
VectorMA(origin, distance, r_refdef.view.forward, origin);
90.0f, // bottom
180.0f, // right
};
-
+
// rotate around the hotspot according to which edge it's on
// since the hotspot == the origin, only rotate the vectors
matrix4x4_t rotm;
if(edge < 1 || edge > 4)
return; // this usually means something went wrong somewhere, there's no way to get a wrong edge value currently
-
+
dir[0] = frame->right + frame->left;
dir[1] = frame->down + frame->up;
// fixed HUD pixel size specified in sprite
// honors scale
// honors a global label scaling cvar
-
+
if(r_fb.water.renderingscene) // labels are considered HUD items, and don't appear in reflections
return;
// It has to be done before the calculations, because it moves the origin.
if(r_track_sprites.integer)
R_TrackSprite(ent, org, left, up, &edge, &dir_angle);
-
+
scale = 2 * ent->scale * (DotProduct(r_refdef.view.forward, org) - DotProduct(r_refdef.view.forward, r_refdef.view.origin)) * r_labelsprites_scale.value;
VectorScale(left, scale * r_refdef.view.frustum_x / vid_conwidth.integer, left); // 1px
VectorScale(up, scale * r_refdef.view.frustum_y / vid_conheight.integer, up); // 1px
// It has to be done before the calculations, because it moves the origin.
if(r_track_sprites.integer)
R_TrackSprite(ent, org, left, up, &edge, &dir_angle);
-
+
scale = 2 * (DotProduct(r_refdef.view.forward, org) - DotProduct(r_refdef.view.forward, r_refdef.view.origin));
if(r_labelsprites_roundtopixels.integer)
RSurf_ActiveCustomEntity(&identitymatrix, &identitymatrix, ent->flags, 0, ent->colormod[0], ent->colormod[1], ent->colormod[2], ent->alpha * ent->frameblend[i].lerp, 4, vertex3f, spritetexcoord2f, NULL, NULL, NULL, NULL, 2, polygonelement3i, polygonelement3s, false, false);
frame = model->sprite.sprdata_frames + ent->frameblend[i].subframe;
texture = R_GetCurrentTexture(model->data_textures + ent->frameblend[i].subframe);
-
+
// sprites are fullbright by default, but if this one is not fullbright we
// need to combine the lighting into ambient as sprite lighting is not
// directional
#define IDI_ICON1 101
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
Cvar_RegisterVariable(&cl_showdate);
Cvar_RegisterVariable(&cl_showdate_format);
Cvar_RegisterVariable(&cl_showtex);
-
+
Cvar_RegisterVirtual(&cl_showfps, "showfps");
Cvar_RegisterVirtual(&cl_showsound, "showsound");
Cvar_RegisterVirtual(&cl_showblur, "showblur");
Cvar_RegisterVirtual(&cl_showdate, "showdate");
Cvar_RegisterVirtual(&cl_showdate_format, "showdate_format");
Cvar_RegisterVirtual(&cl_showtex, "showtex");
-
+
Cvar_RegisterVariable(&sbar_alpha_bg);
Cvar_RegisterVariable(&sbar_alpha_fg);
Cvar_RegisterVariable(&sbar_hudselector);
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
if (first_to_die == -1)
return NULL;
-
+
S_StopChannel (first_to_die, true, false);
emptychan_found:
// threaded sound backends
if (lockmutex && !simsound)
SndSys_LockRenderBuffer();
-
+
ch = &channels[channel_ind];
sfx = ch->sfx;
if (sfx != NULL)
thiscomment = qvorbis_comment_query(vc, "REPLAYGAIN_TRACK_GAIN", 0);
if(thiscomment)
*gaindb = atof(thiscomment);
-
+
startcomment = qvorbis_comment_query(vc, "LOOP_START", 0); // DarkPlaces, and some Japanese app
if(startcomment)
{
else
suggested->width = 2;
}
-
+
return false;
}
Con_Print("SndSys_Init: could not open /dev/dsp\n");
return false;
}
-
+
// Use non-blocking IOs if possible
flags = fcntl(audio_fd, F_GETFL);
if (flags != -1)
}
else
Con_Print("SndSys_Init: fcntl(F_GETFL) failed!\n");
-
+
// Set the fragment size (up to "NB_FRAGMENTS" fragments of "fragmentsize" bytes)
fragmentsize = requested->speed * requested->channels * requested->width / 10;
fragmentsize = (unsigned int)ceilf((float)fragmentsize / (float)NB_FRAGMENTS);
{
unsigned int startoffset, factor, limit, nbframes;
int written;
-
+
if (audio_fd < 0 ||
snd_renderbuffer->startframe == snd_renderbuffer->endframe)
return;
written = SndSys_Write (&snd_renderbuffer->ring[startoffset * factor], limit * factor);
if (written < 0 || (unsigned int)written < limit * factor)
return;
-
+
nbframes -= limit;
startoffset = 0;
}
SV_SaveSpawnparms ();
strlcpy(level, Cmd_Argv(cmd, 1), sizeof(level));
SV_SpawnServer(level);
-
+
if(sv.active && host.hook.ConnectLocal != NULL)
host.hook.ConnectLocal();
}
strlcpy(mapname, sv.name, sizeof(mapname));
SV_SpawnServer(mapname);
-
+
if(sv.active && host.hook.ConnectLocal != NULL)
host.hook.ConnectLocal();
}
print("Pause not allowed.\n");
return;
}
-
+
sv.paused ^= 1;
if (cmd->source != src_local)
SV_BroadcastPrintf("%s %spaused the game\n", host_client->name, sv.paused ? "" : "un");
}
else
hours = 0;
-
+
packetloss = 0;
if (client->netconnection)
for (j = 0;j < NETGRAPH_PACKETS;j++)
frags = atoi(qcstatus);
}
}
-
+
if (in == 0) // default layout
{
if (sv.protocol == PROTOCOL_QUAKE && svs.maxclients <= 99)
MSG_WriteByte (&sv.reliable_datagram, clientnum);
MSG_WriteString (&sv.reliable_datagram, host_client->name);
SV_WriteNetnameIntoDemo(host_client);
- }
+ }
}
/*
static void SV_SendCvar_f(cmd_state_t *cmd)
{
- int i;
+ int i;
const char *cvarname;
client_t *old;
-
+
if(Cmd_Argc(cmd) != 2)
return;
Matrix4x4_OriginFromMatrix(&view, org);
VectorSet(temp, 65536, 0, 0);
- Matrix4x4_Transform(&view, temp, dest);
+ Matrix4x4_Transform(&view, temp, dest);
trace = SV_TraceLine(org, dest, MOVE_NORMAL, NULL, SUPERCONTENTS_SOLID, 0, 0, collision_extendmovelength.value);
// Spawn it
PRVM_ED_CallPrespawnFunction(prog, ed);
-
+
if(!PRVM_ED_CallSpawnFunction(prog, ed, NULL, NULL))
{
print("Could not spawn a \"%s\". No such entity or it has no spawn function\n", Cmd_Argv(cmd, 1));
return;
}
- PRVM_ED_CallPostspawnFunction(prog, ed);
+ PRVM_ED_CallPostspawnFunction(prog, ed);
// Make it appear in the world
SV_LinkEdict(ed);
Matrix4x4_OriginFromMatrix(&view, org);
VectorSet(temp, 65536, 0, 0);
- Matrix4x4_Transform(&view, temp, dest);
+ Matrix4x4_Transform(&view, temp, dest);
trace = SV_TraceLine(org, dest, MOVE_NORMAL, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY, 0, 0, collision_extendmovelength.value);
-
+
if(trace.ent)
ednum = (int)PRVM_EDICT_TO_PROG(trace.ent);
if(!trace.ent || !ednum)
Cvar_RegisterVariable(&sv_status_privacy);
Cvar_RegisterVariable(&sv_status_show_qcstatus);
Cvar_RegisterVariable(&sv_namechangetimer);
-
+
Cmd_AddCommand(CF_SERVER | CF_SERVER_FROM_CLIENT, "status", SV_Status_f, "print server status information");
Cmd_AddCommand(CF_SHARED, "map", SV_Map_f, "kick everyone off the server and start a new level");
Cmd_AddCommand(CF_SHARED, "restart", SV_Restart_f, "restart current level");
Cmd_AddCommand(CF_CHEAT | CF_SERVER_FROM_CLIENT, "noclip", SV_Noclip_f, "noclip mode (flight without collisions, move through walls)");
Cmd_AddCommand(CF_CHEAT | CF_SERVER_FROM_CLIENT, "give", SV_Give_f, "alter inventory");
Cmd_AddCommand(CF_SERVER_FROM_CLIENT, "kill", SV_Kill_f, "die instantly");
-
+
Cmd_AddCommand(CF_USERINFO, "color", SV_Color_f, "change your player shirt and pants colors");
Cmd_AddCommand(CF_USERINFO, "name", SV_Name_f, "change your player name");
Cmd_AddCommand(CF_USERINFO, "rate", SV_Rate_f, "change your network connection speed");
return;
if(sendbuffer->cursize == 0)
return;
-
+
temp = sendbuffer->cursize | (clienttoserver ? DEMOMSG_CLIENT_TO_SERVER : 0);
len = LittleLong(temp);
FS_Write(client->sv_demo_file, &len, 4);
if(client->sv_demo_file == NULL)
return;
-
+
buf.data = bufdata;
buf.maxsize = sizeof(bufdata);
SZ_Clear(&buf);
ringlast = (ringfirst + NUM_CSQCENTITYDB_FRAMES - 1) % NUM_CSQCENTITYDB_FRAMES; // most recently added entry
valid = false;
-
+
for(j = 0; j < NUM_CSQCENTITYDB_FRAMES; ++j)
{
d = &client->csqcentityframehistory[(ringfirst + j) % NUM_CSQCENTITYDB_FRAMES];
ringfirst = (ringfirst + j) % NUM_CSQCENTITYDB_FRAMES;
if(ringlast < ringfirst)
ringlast += NUM_CSQCENTITYDB_FRAMES;
-
+
memset(recoversendflags, 0, sizeof(recoversendflags));
for(j = ringfirst; j <= ringlast; ++j)
// if no single ent got added, remove the frame from the DB again, to allow
// for a larger history
EntityFrameCSQC_DeallocFrame(client, framenum);
-
+
return sectionstarted;
}
// first reset them all
host_client->download_deflate = false;
-
+
for(i = 2; i < argc; ++i)
{
if(!strcmp(Cmd_Argv(cmd, i), "deflate"))
}
is_csqc = (sv.csqc_progname[0] && strcmp(Cmd_Argv(cmd, 1), sv.csqc_progname) == 0);
-
+
if (!sv_allowdownloads.integer && !is_csqc)
{
SV_ClientPrintf("Downloads are disabled on this server\n");
{
char extensions[MAX_QPATH]; // make sure this can hold all extensions
extensions[0] = '\0';
-
+
if(host_client->download_deflate)
strlcat(extensions, " deflate", sizeof(extensions));
-
+
Con_DPrintf("Downloading %s to %s\n", host_client->download_name, host_client->name);
if(host_client->download_deflate && svs.csqc_progdata_deflated)
host_client->download_file = FS_FileFromData(svs.csqc_progdata_deflated, svs.csqc_progsize_deflated, true);
else
host_client->download_file = FS_FileFromData(svs.csqc_progdata, sv.csqc_progsize, true);
-
+
// no, no space is needed between %s and %s :P
SV_ClientCommands("\ncl_downloadbegin %i %s%s\n", (int)FS_FileSize(host_client->download_file), host_client->download_name, extensions);
{
char extensions[MAX_QPATH]; // make sure this can hold all extensions
extensions[0] = '\0';
-
+
if(host_client->download_deflate)
strlcat(extensions, " deflate", sizeof(extensions));
svs.csqc_progdata = NULL;
svs.csqc_progdata_deflated = NULL;
-
+
sv.csqc_progname[0] = 0;
svs.csqc_progdata = FS_LoadFile(csqc_progname.string, sv_mempool, false, &progsize);
++svs.perf_acc_offset_samples;
svs.perf_acc_offset += offset;
svs.perf_acc_offset_squared += offset * offset;
-
+
if(svs.perf_acc_offset_max < offset)
svs.perf_acc_offset_max = offset;
}
// (like newline, specifically) into escape codes
s = stringbuffer->strings[k];
for (l = 0;l < (int)sizeof(line) - 2 && *s;)
- {
+ {
if (*s == '\n')
{
line[l++] = '\\';
else
Con_Printf(CON_ERROR "failed to create stringbuffer %i \"%s\"\n", i, com_token);
}
- }
+ }
// skip any trailing text or unrecognized commands
while (COM_ParseToken_Simple(&t, true, false, true) && strcmp(com_token, "\n"))
;
{
statsf[STAT_MOVEVARS_AIRACCEL_QW_STRETCHFACTOR] = sv_airaccel_qw_stretchfactor.value;
statsf[STAT_MOVEVARS_AIRCONTROL_PENALTY] = sv_aircontrol_penalty.value;
- statsf[STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW] = sv_airspeedlimit_nonqw.value;
+ statsf[STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW] = sv_airspeedlimit_nonqw.value;
statsf[STAT_MOVEVARS_AIRSTRAFEACCEL_QW] = sv_airstrafeaccel_qw.value;
statsf[STAT_MOVEVARS_AIRCONTROL_POWER] = sv_aircontrol_power.value;
// movement settings for prediction
statsf[STAT_MOVEVARS_AIRCONTROL] = sv_aircontrol.value;
statsf[STAT_FRAGLIMIT] = fraglimit.value;
statsf[STAT_TIMELIMIT] = timelimit.value;
- statsf[STAT_MOVEVARS_FRICTION] = sv_friction.value;
+ statsf[STAT_MOVEVARS_FRICTION] = sv_friction.value;
statsf[STAT_MOVEVARS_WATERFRICTION] = sv_waterfriction.value >= 0 ? sv_waterfriction.value : sv_friction.value;
statsf[STAT_MOVEVARS_TICRATE] = sys_ticrate.value;
statsf[STAT_MOVEVARS_TIMESCALE] = host_timescale.value;
scale = PRVM_serveredictfloat(ent, scale);
if (!scale)
scale = 1.0f;
-
+
if (viewmatrix)
Matrix4x4_CreateFromQuakeEntity(out, PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2] + PRVM_serveredictvector(ent, view_ofs)[2], PRVM_serveredictvector(ent, v_angle)[0], PRVM_serveredictvector(ent, v_angle)[1], PRVM_serveredictvector(ent, v_angle)[2], scale * cl_viewmodel_scale.value);
else
qbool SV_VM_ConsoleCommand (const char *text)
{
prvm_prog_t *prog = SVVM_prog;
- return PRVM_ConsoleCommand(prog, text, &prog->funcoffsets.ConsoleCmd, true, PRVM_EDICT_TO_PROG(sv.world.prog->edicts), sv.time, !(!sv.active || !prog || !prog->loaded), "QC function ConsoleCmd is missing");
+ return PRVM_ConsoleCommand(prog, text, &prog->funcoffsets.ConsoleCmd, true, PRVM_EDICT_TO_PROG(sv.world.prog->edicts), sv.time, !(!sv.active || !prog || !prog->loaded), "QC function ConsoleCmd is missing");
}
// #352 void(string cmdname) registercommand (EXT_CSQC)
# elif TARGET_OS_MAC
# define DP_OS_NAME "macOS"
# define DP_OS_STR "macos"
-# endif
+# endif
#elif defined(__MORPHOS__)
# define DP_OS_NAME "MorphOS"
# define DP_OS_STR "morphos"
qbool Sys_LoadSelf(dllhandle_t *handle);
-/*! Loads a dependency library.
+/*! Loads a dependency library.
* \param dllnames a NULL terminated array of possible names for the DLL you want to load.
* \param handle
* \param fcts
va_end (argptr);
Con_Printf(CON_ERROR "Engine Error: %s\n", string);
-
+
if(!nocrashdialog)
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Engine Error", string, NULL);
Host_Main();
Sys_Quit(0);
-
+
return 0;
}
if (QueryPerformanceFrequency (&PerformanceFreq))
{
QueryPerformanceCounter (&PerformanceCount);
-
+
timescale = 1.0 / ((double) PerformanceFreq.LowPart + (double) PerformanceFreq.HighPart * 65536.0 * 65536.0);
return ((double) PerformanceCount.LowPart + (double) PerformanceCount.HighPart * 65536.0 * 65536.0) * timescale;
}
double currentTime = Sys_DirtyTime(); \
Con_Printf ("%s: %.3g s\n", S, currentTime - _timing_start_); \
}
-
+
#define TIMING_TIMESTATEMENT(Stmt) \
{ \
TIMING_BEGIN \
- todo: difficulty ratings are: 0 = trivial, 1 = easy, 2 = easy-moderate, 3 = moderate, 4 = moderate-hard, 5 = hard, 6 = hard++, 7 = nightmare, d = done, -d = done but have not notified the people who asked for it, f = failed, -f = failed but have not notified the people who asked for it
-d bug darkplaces d3d9: drawsetcliparea not working right - seems to be Y-flipped, this also affects menus in Steelstorm (VorteX)
-d bug darkplaces d3d9: overbright particles get weird colors (VorteX)
-0 bug darkplaces server browser: scrolling wraps weirdly (causing duplicates of first entry) when there are fewer servers than a full screen can show (LordHavoc)
+0 bug darkplaces server browser: scrolling wraps weirdly (causing duplicates of first entry) when there are fewer servers than a full screen can show (LordHavoc)
0 bug darkplaces android: make sure android:theme is set reasonably to avoid having performance issues on Adreno (it may need to be android:theme="@android:style/Theme.Translucent" or maybe some other value?) (banshee21)
0 bug darkplaces client csqc: CSQC_InputEvent is supposed to handle mouse movement, compare to FTEQW code (avirox)
0 bug darkplaces client csqc: engine prediction function is not implemented - could just return the engine's current cl.movement_origin (Spike)
if (_len) *_len = 0;
return false;
}
-
+
if (bits == 1) { // ascii
if (_start) *_start = i;
if (_len) *_len = 1;
{
// have the mouse stuck in the middle, example use: prevent expose effect of beryl during the game when not using
// window grabbing. --blub
-
+
// we need 2 frames to initialize the center position
if(!stuck)
{
workWidth = workArea.right - workArea.left;
workHeight = workArea.bottom - workArea.top;
- // SDL forces the window height to be <= screen height - 27px (on Win8.1 - probably intended for the title bar)
+ // SDL forces the window height to be <= screen height - 27px (on Win8.1 - probably intended for the title bar)
// If the task bar is docked to the the left screen border and we move the window to negative y,
// there would be some part of the regular desktop visible on the bottom of the screen.
screenHeight = GetSystemMetrics(SM_CYSCREEN);
rect->top = workArea.top + titleBarPixels;
mode->height = workHeight - titleBarPixels;
}
- else
+ else
{
rect->left = workArea.left + max(0, (workWidth - width) / 2);
rect->top = workArea.top + max(0, (workHeight - height) / 2);
vid_hasfocus = true;
vid_usingmouse = false;
vid_usinghidecursor = false;
-
+
return true;
}
r_refdef.viewblend[1] *= (1.0f/256.0f);
r_refdef.viewblend[2] *= (1.0f/256.0f);
}
-
+
// Samual: Ugly hack, I know. But it's the best we can do since
// there is no way to detect client states from the engine.
- if (cl.stats[STAT_HEALTH] <= 0 && cl.stats[STAT_HEALTH] != -666 &&
+ if (cl.stats[STAT_HEALTH] <= 0 && cl.stats[STAT_HEALTH] != -666 &&
cl.stats[STAT_HEALTH] != -2342 && cl_deathfade.value > 0)
{
cl.deathfade += cl_deathfade.value * max(0.00001, cl.time - cl.oldtime);
Cvar_RegisterVariable (&v_kickpitch);
Cvar_RegisterVariable (&cl_stairsmoothspeed);
-
+
Cvar_RegisterVariable (&cl_smoothviewheight);
Cvar_RegisterVariable (&chase_back);
/*
* The VPK format is Valve's package format for Source engine games,
* used to store game content.
- *
+ *
* Game content is spread across multiple VPK files. A single, special
* VPK file, ending in _dir.vpk, contains a centralized directory
* tree for all of the other files, and has its own header.
* Although content can be stored in the directory file.
- *
+ *
* This is useful for navigating game content without having
* to guess which VPK some file belongs to, while also
* making game updates more efficient by spreading content
dContactMotionN = 0x080,
dContactSlip1 = 0x100,
dContactSlip2 = 0x200,
-
+
dContactApprox0 = 0x0000,
dContactApprox1_1 = 0x1000,
dContactApprox1_2 = 0x2000,
dWorldSetAutoDisableFlag(odeworld, (physics_ode_autodisable.integer) ? 1 : 0);
if (physics_ode_autodisable.integer)
{
- dWorldSetAutoDisableSteps(odeworld, bound(1, physics_ode_autodisable_steps.integer, 100));
+ dWorldSetAutoDisableSteps(odeworld, bound(1, physics_ode_autodisable_steps.integer, 100));
dWorldSetAutoDisableTime(odeworld, physics_ode_autodisable_time.value);
dWorldSetAutoDisableAverageSamplesCount(odeworld, bound(1, physics_ode_autodisable_threshold_samples.integer, 100));
- dWorldSetAutoDisableLinearThreshold(odeworld, physics_ode_autodisable_threshold_linear.value);
- dWorldSetAutoDisableAngularThreshold(odeworld, physics_ode_autodisable_threshold_angular.value);
+ dWorldSetAutoDisableLinearThreshold(odeworld, physics_ode_autodisable_threshold_linear.value);
+ dWorldSetAutoDisableAngularThreshold(odeworld, physics_ode_autodisable_threshold_angular.value);
}
}
}
// test convex geometry data
-// planes for a cube, these should coincide with the
-dReal test_convex_planes[] =
+// planes for a cube, these should coincide with the
+dReal test_convex_planes[] =
{
1.0f ,0.0f ,0.0f ,2.25f,
0.0f ,1.0f ,0.0f ,2.25f,
};
const unsigned int test_convex_planecount = 6;
// points for a cube
-dReal test_convex_points[] =
+dReal test_convex_points[] =
{
2.25f,2.25f,2.25f, // point 0
-2.25f,2.25f,2.25f, // point 1
-2.25f,-2.25f,-2.25f, // point 7
};
const unsigned int test_convex_pointcount = 8;
-// polygons for a cube (6 squares), index
-unsigned int test_convex_polygons[] =
+// polygons for a cube (6 squares), index
+unsigned int test_convex_polygons[] =
{
4,0,2,6,4, // positive X
4,1,0,4,5, // positive Y
{
// already formed a polygon?
if (used[triangleindex])
- continue;
+ continue;
// init polygon
// switch clockwise->counterclockwise
ie = &model->brush.collisionmesh->element3i[triangleindex*3];
polygons = polygonsData;
for (i = 0; i < numplanes; i++)
{
- if((pointsData[(polygons[1]*3)+0]*pointsData[(polygons[2]*3)+1]*pointsData[(polygons[3]*3)+2] +
- pointsData[(polygons[1]*3)+1]*pointsData[(polygons[2]*3)+2]*pointsData[(polygons[3]*3)+0] +
+ if((pointsData[(polygons[1]*3)+0]*pointsData[(polygons[2]*3)+1]*pointsData[(polygons[3]*3)+2]
+ pointsData[(polygons[1]*3)+1]*pointsData[(polygons[2]*3)+2]*pointsData[(polygons[3]*3)+0]
pointsData[(polygons[1]*3)+2]*pointsData[(polygons[2]*3)+0]*pointsData[(polygons[3]*3)+1] -
pointsData[(polygons[1]*3)+2]*pointsData[(polygons[2]*3)+1]*pointsData[(polygons[3]*3)+0] -
pointsData[(polygons[1]*3)+1]*pointsData[(polygons[2]*3)+0]*pointsData[(polygons[3]*3)+2] -
// at least one object has to be using MOVETYPE_PHYSICS and should be enabled or we just don't care
if (!b1enabled && !b2enabled)
return;
-
+
// exit without doing anything if the two bodies are connected by a joint
if (b1 && b2 && dAreConnectedExcluding(b1, b2, dJointTypeContact))
return;
world->physics.ode_iterations++;
world->physics.ode_time -= world->physics.ode_step;
}
- }
+ }
world->physics.ode_movelimit = physics_ode_movelimit.value / world->physics.ode_step;
World_Physics_UpdateODE(world);