Simon McVittie [Fri, 20 Jan 2012 09:26:10 +0000 (09:26 +0000)]
Be a bit more type-safe about using libpng
The simplified libpng declarations in DarkPlaces just use "void **" for
various pointer-to-pointer arguments. However, this conflicts with the system
libpng headers (if used), which expect something like "png_struct **" (which
is not considered to be a compatible type by ISO C), causing compiler
warnings. This patch reduces the simplification a bit by distinguishing
between the various pointers-to-struct enough that system libpng headers
do not provoke warnings.
Similarly, assigning a function pointer provokes warnings if the arguments'
types are not exactly as expected. Avoiding those warnings potentially makes
genuine bugs easier to spot, so it seems worth being a bit more precise.
Simon McVittie [Thu, 7 Jul 2011 17:11:42 +0000 (18:11 +0100)]
Be more type-safe when calling setjmp(); call the same one that libpng would
Depending whether _BSD_SOURCE is preferred, glibc will provide one of two
implementations of setjmp()/longjmp() (it either does or doesn't save the
signal mask), acting on different definitions of the jmp_buf struct.
libpng calls longjmp() internally, and expects its callers to call the
version of setjmp() corresponding to the longjmp() call that libpng would
make.
In an attempt to ensure that consistent versions of setjmp() and longjmp()
are used, pngconf.h insists that on Linux, setjmp.h has not already been
included. However, quakedef.h includes that header, leading to some
interesting contortions when using the system libpng.
(IMO the right thing for libpng to do would be for it to provide an exported
function png_setjmp (or something) which calls the version of setjmp() that
libpng expects on the jmp_buf included in the png structure, like qpng_setjmp
in this patch.)
When using the system libpng headers, this patch also avoids the assumption
that jmp_buf is the first thing in the png structure.
fix a severe texture corruption and crash case when using vid_dx9 1 is used with vid_sRGB 1
work around a crash when using vid_dx9 1 with vid_stereobuffer 1 (this needs a better fix, D3D9 does not support this)
fix a warning in C++ where a bit flag mask was being passed as a bool
vortex [Thu, 28 Mar 2013 20:24:13 +0000 (20:24 +0000)]
Rewritten SVQC stringbuffer saving routines (which is part of yet unfinished databuffers extension). Changes are backwards compatible with old savefile format. Now, once saved stringbuffers are found in extended savegame section, all string buffers allocated by worldspawn()/entityspawn (which is processed prior to savegame parsing) are deleted, and stringbuffers are restored from savegamefile with their original handles.
eihrul [Tue, 26 Mar 2013 22:19:01 +0000 (22:19 +0000)]
disable depthfirst rendering on animated models since it doesn't work and should theoretically have little performance benefit (and most likely performance detriment)
havoc [Sun, 24 Mar 2013 18:20:15 +0000 (18:20 +0000)]
reworked the MOVETYPE_WALK and MOVETYPE_STEP sticking logic so that it
only cares about world when deciding to be stuck, this means if you get
into a bmodel entity you can still move out of it
havoc [Sat, 2 Mar 2013 04:57:07 +0000 (04:57 +0000)]
changed MOVETYPE_STEP and MOVETYPE_WALK to match Quake behavior (unable
to move when allsolid - but also check SUPERCONTENTS_SOLID), this makes
hip2m3 shalrath work again
divverent [Thu, 28 Feb 2013 11:39:47 +0000 (11:39 +0000)]
sound7(): properly support channel flags on client; reassign sound flags so FORCELOOP is now 2 (and FULLVOLUME is 16); note that these flags only work on csqc for now
havoc [Thu, 28 Feb 2013 09:44:12 +0000 (09:44 +0000)]
csqc sound7 call now looks at the global variable sound_starttime to
calculate a startposition from, this allows a sound to be played at a
later time (delayed) or an earlier time (for instance restoring a
dialogue sound in-progress when loading a savegame)
havoc [Thu, 28 Feb 2013 09:36:29 +0000 (09:36 +0000)]
changed the default sv_gameplayfix_ cvar values based on GAME_,
GAME_NORMAL (quake) and derivatives now default them to 0 for better
compatibility and avoiding gameplay changes, non-quake games such as
GAME_NEXUIZ and others are unaffected (still default to 1 there)
havoc [Thu, 28 Feb 2013 09:30:03 +0000 (09:30 +0000)]
implemented use of GL_ARB_uniform_buffer_object for r_glsl_skeletal
added R_BufferData_ system which allows arbitrary vertex/index/uniform
buffers to be dynamically built during a frame (in the same way as the
R_FrameData_ system), this has vastly better performance than uploading
them individually and code should be migrated to use it as appropriate
vid.support.glshaderversion added (typically 140)
havoc [Sat, 23 Feb 2013 11:08:31 +0000 (11:08 +0000)]
added entity caching stats in graph
optimized logic for animcache and dynamic batching
optimized r_shadows code which was often casting shadows from entities
it did not animcache, and these entities didn't need to cast anyway,
imposed an artificial limit of 1024 entities in r_shadows code...
now exactly determines if models are animated at load (except iqm which
is trusted), and the isanimated flag is not needed for animating a
skeletal model with skeletonobject
havoc [Sat, 23 Feb 2013 07:37:10 +0000 (07:37 +0000)]
changed r_refdef.stats struct to be an array indexed by r_stat_* enums
added r_speeds_graph and associated cvars, this will visually graph any
chosen renderer statistics (8 allowed at one time)
added a lot of additional statistics for the batcher
havoc [Sun, 17 Feb 2013 05:05:28 +0000 (05:05 +0000)]
changed Q1BSP traceline to only use the surface-hitting variant if
sv_gameplayfix_q1bsptracelinereportstexture is on, because in one of
negke's maps a set of items are crushed by a pusher and are expected to
fall through the sky brush they are sitting on, which does not happen if
the sky surface is considered solid, but in any other situation this
should be reported as solid
havoc [Thu, 7 Feb 2013 14:22:17 +0000 (14:22 +0000)]
added props files for vs2010 and vs2012, changed name of darkplaces-2010.sln to darkplaces-vs2010.sln and renamed the vcproj files similarly to darkplaces-sdl-vs2010.vcxproj and such.
havoc [Thu, 7 Feb 2013 12:59:53 +0000 (12:59 +0000)]
fix a sizeof using an array index variable that is never initialized (harmless but the variable is unused by actual code and thus causes a warning)
declare macros for ID3DXBuffer_ functions because they were removed in a DX SDK update
havoc [Thu, 7 Feb 2013 11:40:40 +0000 (11:40 +0000)]
changed format of builtin shader strings to use comma separated lines,
this should fix compilation on MSVC where default.glsl exceeded 65535
character limit
removed MODE_SHOWDEPTH from shaders and code because it is not used and
is not likely to ever be used anyway
reworked shadermodeinfo_t to only have one filename rather than separate
filenames for vertex and fragment shader
reworked r_glsl_dumpshader to cope with multiple shader filenames and
unified some code for glsl and hlsl text processing
divverent [Wed, 23 Jan 2013 12:52:13 +0000 (12:52 +0000)]
skel_build: fix wrong 4th matrix row of skeleton matrices
Matrix4x4_Scale doesn't affect the 4th row, but Matrix4x4_Accumulate
does, leading to wrong result. This broke weapon to player attachment
when the player has a skeletonobject.
havoc [Wed, 16 Jan 2013 16:54:25 +0000 (16:54 +0000)]
implemented a fallback case for r_glsl_skeletal 1 when dynamicvertex
occurs (the batch code will apply the skeletal deforms to the batch, to
ensure proper functionality with deformvertexes and such)
added r_batch_debugdynamicvertexpath cvar which is useful for debugging
skeletal fallback issues
divverent [Tue, 8 Jan 2013 12:37:43 +0000 (12:37 +0000)]
Breakpoints and watchpoints
"Break" on statement: prvm_breakpoint server 12345
"Break" on function: prvm_breakpoint server ClientConnect
Watch for global change: prvm_globalwatchpoint server time
Watch for entity field change: prvm_edictwatchpoint server 1 health
There can be only one of each kind. To clear, do:
prvm_breakpoint server
prvm_globalwatchpoint server
prvm_edictwatchpoint server
havoc [Tue, 8 Jan 2013 12:29:24 +0000 (12:29 +0000)]
reworked some code for BATCHNEED_NOGAPS to be more consistent and made
the comments more clear about its behavior (firstvertex is 0, no gaps),
no longer using BATCHNEED_NOGAPS in a couple places
havoc [Tue, 8 Jan 2013 10:56:58 +0000 (10:56 +0000)]
added r_batch_multidraw and r_batch_multidraw_mintriangles cvars, this
code defaults on, restoring the old rendering path that used multiple
glDrawRangeElements calls for surface batching rather than copying index
data, on high poly maps this has a positive impact, on low poly maps I
was unable to find a difference in fps either way
havoc [Sat, 22 Dec 2012 07:49:40 +0000 (07:49 +0000)]
fix bug with transparency sorting introduced by vortex in r11822 where
.transparentsort was not initialized in a lot of materials, which meant
TRANSPARENTSORT_SKY was used rather than TRANSPARENTSORT_DISTANCE