Change to the C99 standard method of testing for nan This fixes all remaining strict-aliasing rule warnings in GCC. Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
Optimize VectorNormalize macros by not doing the sqrt on 0 length, this also means it should be more friendly to the CPU intrinsics for 1/sqrt in a single instruction
mathlib: Implement Q_rint and use it git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13025 d7cf8633-e32d-0410-b094-e92efae38249
Rename qboolean to qbool git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12920 d7cf8633-e32d-0410-b094-e92efae38249
Corrected names in credits to be more accurate and consistent. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12485 d7cf8633-e32d-0410-b094-e92efae38249
Fix severe bugs in mul128 implementation which was breaking the Lehmer RNG. Added gcc specific implementation of mul128 using __int128 intrinsic type. Added unit tests for mul128 implementation. Added r_shadow_bouncegrid_normalizevectors cvar, default on, this slightly brightens typical scenes, some more affected than others. Changed the behavior of r_shadow_bouncegrid_dynamic_stablerandom to also affect static mode, changed it to use the light position as the RNG seed, and changed the meaning of stablerandom 1 to be lhcheeserandom again as it is fast and of sufficient quality, the Lehmer RNG is available as stablerandom 2 but it has a framerate hit in dynamic mode that I can't ignore. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12301 d7cf8633-e32d-0410-b094-e92efae38249
Added an implementation of Lehmer random number generator with Lecuyer constant, this is a simple mul128 based RNG with a period of 2^126. Use the new RNG for bouncegrid traces to hopefully improve the photon distribution compared to lhcheeserandom. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12298 d7cf8633-e32d-0410-b094-e92efae38249
Rollback last change which was meant to be many smaller pieces. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12291 d7cf8633-e32d-0410-b094-e92efae38249
Added developer_memorylargerthanmb cvar which dprints notices about very large memory allocations (16MB and larger by default). Slightly improved the Mem_Alloc out of memory error to include the size of the failed allocation. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12290 d7cf8633-e32d-0410-b094-e92efae38249
v_yshearing: Make the cvar take the max angle to apply the effect to; remove the in_pitch hack for this as it is no longer needed then. This makes Y shearing mode actually useful together with higer FOV (less noticeable distortion). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12247 d7cf8633-e32d-0410-b094-e92efae38249
v_yshearing: Make view and input behave more like Duke Nukem 3D ;) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12246 d7cf8633-e32d-0410-b094-e92efae38249
rename a macro with misleading name, as TriangleOverlapsBox doesn't check for actual triangle/box overlap, but just whether an overlap is possible at all using a bbox check. No functional changes, just search/replace. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11829 d7cf8633-e32d-0410-b094-e92efae38249
added PRVM_64 define which upgrades the QC VM to double precision variables (such that levels can run for more than 24 hours without time precision breakdown, and bit arithmetic can be done on 52 bit flags rather than 23 bit flags) changed csqc setmodel builtin to do setsize as well (like on server) fixed multiple bugs where csqc builtins were passing right as left in a matrix conversion git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11785 d7cf8633-e32d-0410-b094-e92efae38249
major overhaul for thread-safety - many global variables and static buffers eliminated, this causes MANY changes, such as va() taking a buffer, prog variable has to be passed as parameter to every PRVM function, and many other edits of that nature. realtime is now the only linearly increasing time stamp in the engine, Sys_DoubleTime replaced by Sys_DirtyTime which requires sanity checks in every use, but ensures thread-safe behavior added -Wmissing-prototypes to makefile so that no one will ever put an extern function prototype in a .c file again, this was necessary to clean up crashes where prototype parameters differed. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11463 d7cf8633-e32d-0410-b094-e92efae38249
added LoopingFrameNumberFromDouble function to do this operation correctly (using divide, floor, and multiply), since doing it the lazy way (cast to int, use modulus operator) breaks down after a certain amount of time in the level git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11163 d7cf8633-e32d-0410-b094-e92efae38249
implemented r_shadow_particletrace cvar which enables an exceptionally slow realtime global illumination deferred rendering technique, UNPLAYABLE framerates with this option on, some rendering artifacts, experimental only git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10854 d7cf8633-e32d-0410-b094-e92efae38249
DP_CSQC_BOXPARTICLES allow particles to be tinted, and trails to be modded in their spacing by the particle count factor git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10195 d7cf8633-e32d-0410-b094-e92efae38249
overhauled vertex formats, now supports 100% interleaved arrays rendering mode, reworked vertexbuffer management to be a more robust system, added fully vertex buffered rendering options (gl_vbo_dynamicvertex, gl_vbo_dynamicindex) which are off by default (they seem to hurt fps in tests here) centralized handling of "generic" mesh rendering (fixed function stuff) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10109 d7cf8633-e32d-0410-b094-e92efae38249
implemented a new type of height fog using a texture to describe multiple fog layers, some visual issues due to the method used. new command and worldspawn property - identical extra for a new texturename parameter at the end fixed some issues with shadowmapping in Cg shaders git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10044 d7cf8633-e32d-0410-b094-e92efae38249
redesigned skeletal model animation bone pose format - instead of float[12] matrix data it is now short[6] origin+quat data with appropriate scale factors detected at load to preserve full range of motion, this does however lose the ability to scale bones in a model... this reduces memory usage significantly in some games git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9815 d7cf8633-e32d-0410-b094-e92efae38249