2009-11-04 21:44:48 +00:00
# include "quakedef.h"
2011-07-30 14:14:56 +00:00
# include "glquake.h"
2011-10-27 16:16:29 +00:00
# include "gl_draw.h"
2012-09-30 05:52:03 +00:00
# ifdef D3D9QUAKE
2009-11-04 21:44:48 +00:00
# include "shader.h"
2011-01-04 02:56:16 +00:00
# if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
# define HMONITOR_DECLARED
DECLARE_HANDLE ( HMONITOR ) ;
# endif
2009-11-04 21:44:48 +00:00
# include <d3d9.h>
2010-05-01 22:47:47 +00:00
2012-07-05 19:42:36 +00:00
/*
Things to improve :
mmapping :
this code is fairly simple . the caller gives a series of batches / meshes , and this code pushes the data to the gpu in its entirety before moving on to the next batch
for the world , this is fast enough where its pretty much all vboed ( except for weird shaders ) .
but for lightning beams and models etc , we ' re mmapping new data regions in the dynamic vbo for every single quad .
not just one mmap , but one mmap for every single individual attribute that is submitted
by using a single buffer for all dynamic data , and filling that buffer before flushing anything to the hardware we ought to get higher framerates
especially if this means D3DLOCK_NOOVERWRITE checks etc are not doing weird slow things .
This won ' t affect the world too much , but should stop everything else destroying the framerate .
long story short , make this batch properly , and use D3DLOCK_DISCARD only .
models :
models should already be in a buffer ( with different offsets for different poses ) . This is a problem with gl too .
hlsl :
we don ' t really use this as much as we should . Should be possible to use as a fast path to avoid having to do any weird shader / dynamic stuff .
currently used for water ( required to mimic software rendering ) and sky ( because its muuuch faster than a skydome ) .
hlsl programs ought to have per - hlsl vertex declarations , and only one stream source .
*/
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
//#define FORCESTATE
2012-07-05 19:42:36 +00:00
2012-11-27 03:23:19 +00:00
# ifdef FORCESTATE
# pragma warningmsg("D3D9 FORCESTATE is active")
# endif
2012-07-05 19:42:36 +00:00
2009-11-07 13:29:15 +00:00
extern LPDIRECT3DDEVICE9 pD3DDev9 ;
2010-11-02 23:17:25 +00:00
//#define d3dcheck(foo) foo
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# ifdef _DEBUG
2011-05-19 13:34:07 +00:00
# define d3dcheck(foo) do{HRESULT err = foo; if (FAILED(err)) Sys_Error("D3D reported error on backend line %i - error 0x%x\n", __LINE__, (unsigned int)err);} while(0)
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# else
# define d3dcheck(foo) foo
# endif
2010-11-02 23:17:25 +00:00
2012-11-27 03:23:19 +00:00
# define MAX_TMUS 16
# define MAX_TC_TMUS 4
2010-05-01 22:47:47 +00:00
2011-09-03 03:49:43 +00:00
extern float d3d_trueprojection [ 16 ] ;
2012-01-01 02:26:42 +00:00
static void BE_RotateForEntity ( const entity_t * e , const model_t * mod ) ;
2010-05-01 22:47:47 +00:00
/*========================================== tables for deforms =====================================*/
# define frand() (rand()*(1.0 / RAND_MAX))
# define FTABLE_SIZE 1024
# define FTABLE_CLAMP(x) (((int)((x)*FTABLE_SIZE) & (FTABLE_SIZE-1)))
# define FTABLE_EVALUATE(table,x) (table ? table[FTABLE_CLAMP(x)] : frand()*((x)-floor(x)))
static float r_sintable [ FTABLE_SIZE ] ;
static float r_triangletable [ FTABLE_SIZE ] ;
static float r_squaretable [ FTABLE_SIZE ] ;
static float r_sawtoothtable [ FTABLE_SIZE ] ;
static float r_inversesawtoothtable [ FTABLE_SIZE ] ;
static float * FTableForFunc ( unsigned int func )
{
switch ( func )
{
case SHADER_FUNC_SIN :
return r_sintable ;
case SHADER_FUNC_TRIANGLE :
return r_triangletable ;
case SHADER_FUNC_SQUARE :
return r_squaretable ;
case SHADER_FUNC_SAWTOOTH :
return r_sawtoothtable ;
case SHADER_FUNC_INVERSESAWTOOTH :
return r_inversesawtoothtable ;
}
//bad values allow us to crash (so I can debug em)
return NULL ;
}
static void FTable_Init ( void )
{
unsigned int i ;
double t ;
for ( i = 0 ; i < FTABLE_SIZE ; i + + )
{
t = ( double ) i / ( double ) FTABLE_SIZE ;
r_sintable [ i ] = sin ( t * 2 * M_PI ) ;
2011-05-19 13:34:07 +00:00
if ( t < 0.25 )
2010-05-01 22:47:47 +00:00
r_triangletable [ i ] = t * 4.0 ;
else if ( t < 0.75 )
r_triangletable [ i ] = 2 - 4.0 * t ;
else
r_triangletable [ i ] = ( t - 0.75 ) * 4.0 - 1.0 ;
2011-05-19 13:34:07 +00:00
if ( t < 0.5 )
2010-05-01 22:47:47 +00:00
r_squaretable [ i ] = 1.0f ;
else
r_squaretable [ i ] = - 1.0f ;
r_sawtoothtable [ i ] = t ;
r_inversesawtoothtable [ i ] = 1.0 - t ;
}
}
2010-11-10 03:32:47 +00:00
typedef vec3_t mat3_t [ 3 ] ;
static mat3_t axisDefault = { { 1 , 0 , 0 } ,
{ 0 , 1 , 0 } ,
{ 0 , 0 , 1 } } ;
static void Matrix3_Transpose ( mat3_t in , mat3_t out )
{
out [ 0 ] [ 0 ] = in [ 0 ] [ 0 ] ;
out [ 1 ] [ 1 ] = in [ 1 ] [ 1 ] ;
out [ 2 ] [ 2 ] = in [ 2 ] [ 2 ] ;
out [ 0 ] [ 1 ] = in [ 1 ] [ 0 ] ;
out [ 0 ] [ 2 ] = in [ 2 ] [ 0 ] ;
out [ 1 ] [ 0 ] = in [ 0 ] [ 1 ] ;
out [ 1 ] [ 2 ] = in [ 2 ] [ 1 ] ;
out [ 2 ] [ 0 ] = in [ 0 ] [ 2 ] ;
out [ 2 ] [ 1 ] = in [ 1 ] [ 2 ] ;
}
2010-11-13 17:22:46 +00:00
static void Matrix3_Multiply_Vec3 ( const mat3_t a , const vec3_t b , vec3_t product )
2010-11-10 03:32:47 +00:00
{
product [ 0 ] = a [ 0 ] [ 0 ] * b [ 0 ] + a [ 0 ] [ 1 ] * b [ 1 ] + a [ 0 ] [ 2 ] * b [ 2 ] ;
product [ 1 ] = a [ 1 ] [ 0 ] * b [ 0 ] + a [ 1 ] [ 1 ] * b [ 1 ] + a [ 1 ] [ 2 ] * b [ 2 ] ;
product [ 2 ] = a [ 2 ] [ 0 ] * b [ 0 ] + a [ 2 ] [ 1 ] * b [ 1 ] + a [ 2 ] [ 2 ] * b [ 2 ] ;
}
2010-11-13 17:22:46 +00:00
static int Matrix3_Compare ( const mat3_t in , const mat3_t out )
2010-11-10 03:32:47 +00:00
{
return ! memcmp ( in , out , sizeof ( mat3_t ) ) ;
}
2010-05-01 22:47:47 +00:00
/*================================================*/
2009-11-07 13:29:15 +00:00
typedef struct
{
2010-11-02 23:17:25 +00:00
backendmode_t mode ;
unsigned int flags ;
2010-05-01 22:47:47 +00:00
float curtime ;
2012-01-01 02:26:42 +00:00
const entity_t * curentity ;
const dlight_t * curdlight ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
batch_t * curbatch , dummybatch ;
2012-01-01 02:26:42 +00:00
vec3_t curdlight_colours ;
2009-11-07 13:29:15 +00:00
shader_t * curshader ;
texnums_t * curtexnums ;
texid_t curlightmap ;
texid_t curdeluxmap ;
2010-05-01 22:47:47 +00:00
int curvertdecl ;
unsigned int shaderbits ;
2010-11-10 03:32:47 +00:00
unsigned int curcull ;
2011-04-23 20:37:20 +00:00
float depthbias ;
float depthfactor ;
2011-09-03 03:49:43 +00:00
float m_model [ 16 ] ;
2010-05-01 22:47:47 +00:00
unsigned int lastpasscount ;
2011-12-23 03:12:29 +00:00
vbo_t * batchvbo ;
2010-05-01 22:47:47 +00:00
2012-01-01 02:26:42 +00:00
shader_t * shader_rtlight ;
2014-10-05 20:04:11 +00:00
IDirect3DTexture9 * curtex [ MAX_TMUS ] ;
unsigned int curtexflags [ MAX_TMUS ] ;
2010-11-11 18:22:49 +00:00
unsigned int tmuflags [ MAX_TMUS ] ;
2010-11-10 03:32:47 +00:00
2010-10-02 02:25:39 +00:00
mesh_t * * meshlist ;
unsigned int nummeshes ;
2010-05-01 22:47:47 +00:00
D3DCOLOR passcolour ;
2010-11-02 23:17:25 +00:00
qboolean passsinglecolour ;
2010-05-01 22:47:47 +00:00
2010-11-02 23:17:25 +00:00
/*FIXME: we shouldn't lock these so much - we need to cache which batches have been submitted and set up streams separately from the vertex data*/
2010-05-01 22:47:47 +00:00
IDirect3DVertexBuffer9 * dynxyz_buff ;
unsigned int dynxyz_offs ;
2010-11-02 23:17:25 +00:00
unsigned int dynxyz_size ;
2010-05-01 22:47:47 +00:00
2012-11-27 03:23:19 +00:00
IDirect3DVertexBuffer9 * dynst_buff [ MAX_TC_TMUS ] ;
unsigned int dynst_offs [ MAX_TC_TMUS ] ;
2010-11-02 23:17:25 +00:00
unsigned int dynst_size ;
2010-05-01 22:47:47 +00:00
IDirect3DVertexBuffer9 * dyncol_buff ;
unsigned int dyncol_offs ;
2010-11-02 23:17:25 +00:00
unsigned int dyncol_size ;
2010-05-01 22:47:47 +00:00
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
IDirect3DVertexBuffer9 * dynnorm_buff ;
unsigned int dynnorm_offs ;
unsigned int dynnorm_size ;
2010-05-01 22:47:47 +00:00
IDirect3DIndexBuffer9 * dynidx_buff ;
unsigned int dynidx_offs ;
2010-11-02 23:17:25 +00:00
unsigned int dynidx_size ;
2010-11-06 23:05:29 +00:00
unsigned int wbatch ;
unsigned int maxwbatches ;
batch_t * wbatches ;
2014-10-05 20:04:11 +00:00
int mipfilter [ 3 ] ;
int picfilter [ 3 ] ;
2009-11-07 13:29:15 +00:00
} d3dbackend_t ;
2012-07-05 19:42:36 +00:00
typedef struct
{
vecV_t coord ;
vec2_t tex ;
vec2_t lm ;
vec3_t ndir ;
vec3_t sdir ;
vec3_t tdir ;
byte_vec4_t colorsb ;
} vbovdata_t ;
2010-05-01 22:47:47 +00:00
# define DYNVBUFFSIZE 65536
# define DYNIBUFFSIZE 65536
static d3dbackend_t shaderstate ;
2009-11-04 21:44:48 +00:00
extern int be_maxpasses ;
2011-05-19 13:34:07 +00:00
enum
2010-05-01 22:47:47 +00:00
{
D3D_VDEC_COL4B = 1 < < 0 ,
2010-11-10 03:32:47 +00:00
D3D_VDEC_ST0 = 1 < < 1 ,
D3D_VDEC_ST1 = 1 < < 2 ,
2010-05-01 22:47:47 +00:00
D3D_VDEC_ST2 = 1 < < 3 ,
2010-11-10 03:32:47 +00:00
D3D_VDEC_ST3 = 1 < < 4 ,
2011-09-03 03:49:43 +00:00
D3D_VDEC_NORM = 1 < < 5 ,
D3D_VDEC_SKEL = 1 < < 6 ,
2011-12-23 03:12:29 +00:00
D3D_VDEC_MAX = 1 < < 7 ,
2010-05-01 22:47:47 +00:00
} ;
2011-09-03 03:49:43 +00:00
# define STRM_VERT 0
# define STRM_COL 1
# define STRM_TC0 2
# define STRM_TC1 3
# define STRM_TC2 4
# define STRM_TC3 5
# define STRM_NORM 6
# define STRM_NORMS 7
# define STRM_NORMT 8
# define STRM_BONENUM 9
# define STRM_BONEWEIGHT 10
# define STRM_MAX 11
2011-12-23 03:12:29 +00:00
static IDirect3DVertexDeclaration9 * vertexdecls [ D3D_VDEC_MAX ] ;
2010-05-01 22:47:47 +00:00
2011-03-12 13:51:40 +00:00
static void BE_ApplyTMUState ( unsigned int tu , unsigned int flags )
{
2014-10-05 20:04:11 +00:00
unsigned int delta = shaderstate . tmuflags [ tu ] ^ flags ;
if ( ! delta )
return ;
if ( delta & SHADER_PASS_CLAMP )
2011-03-12 13:51:40 +00:00
{
if ( flags & SHADER_PASS_CLAMP )
{
IDirect3DDevice9_SetSamplerState ( pD3DDev9 , tu , D3DSAMP_ADDRESSU , D3DTADDRESS_CLAMP ) ;
IDirect3DDevice9_SetSamplerState ( pD3DDev9 , tu , D3DSAMP_ADDRESSV , D3DTADDRESS_CLAMP ) ;
IDirect3DDevice9_SetSamplerState ( pD3DDev9 , tu , D3DSAMP_ADDRESSW , D3DTADDRESS_CLAMP ) ;
}
else
{
IDirect3DDevice9_SetSamplerState ( pD3DDev9 , tu , D3DSAMP_ADDRESSU , D3DTADDRESS_WRAP ) ;
IDirect3DDevice9_SetSamplerState ( pD3DDev9 , tu , D3DSAMP_ADDRESSV , D3DTADDRESS_WRAP ) ;
IDirect3DDevice9_SetSamplerState ( pD3DDev9 , tu , D3DSAMP_ADDRESSW , D3DTADDRESS_WRAP ) ;
}
}
2014-10-05 20:04:11 +00:00
if ( delta & ( SHADER_PASS_NOMIPMAP | SHADER_PASS_NEAREST | SHADER_PASS_LINEAR | SHADER_PASS_UIPIC ) )
2011-03-12 13:51:40 +00:00
{
2014-10-05 20:04:11 +00:00
int min , mip , mag ;
int * filter = ( flags & SHADER_PASS_UIPIC ) ? shaderstate . picfilter : shaderstate . mipfilter ;
if ( ( filter [ 2 ] & & ! ( flags & SHADER_PASS_NEAREST ) ) | | ( flags & SHADER_PASS_LINEAR ) )
2015-05-03 19:57:46 +00:00
mag = D3DTEXF_ANISOTROPIC ; //D3DTEXF_LINEAR;
2011-03-12 13:51:40 +00:00
else
2014-10-05 20:04:11 +00:00
mag = D3DTEXF_POINT ;
if ( filter [ 1 ] = = - 1 | | ( flags & IF_NOMIPMAP ) )
mip = D3DTEXF_NONE ;
else if ( ( filter [ 1 ] & & ! ( flags & SHADER_PASS_NEAREST ) ) | | ( flags & SHADER_PASS_LINEAR ) )
2015-05-03 19:57:46 +00:00
mip = D3DTEXF_ANISOTROPIC ; //D3DTEXF_LINEAR;
2014-10-05 20:04:11 +00:00
else
mip = D3DTEXF_POINT ;
if ( ( filter [ 0 ] & & ! ( flags & SHADER_PASS_NEAREST ) ) | | ( flags & SHADER_PASS_LINEAR ) )
2015-05-03 19:57:46 +00:00
min = D3DTEXF_ANISOTROPIC ; //D3DTEXF_LINEAR;
2014-10-05 20:04:11 +00:00
else
min = D3DTEXF_POINT ;
IDirect3DDevice9_SetSamplerState ( pD3DDev9 , tu , D3DSAMP_MINFILTER , min ) ;
IDirect3DDevice9_SetSamplerState ( pD3DDev9 , tu , D3DSAMP_MIPFILTER , mip ) ;
IDirect3DDevice9_SetSamplerState ( pD3DDev9 , tu , D3DSAMP_MAGFILTER , mag ) ;
}
shaderstate . tmuflags [ tu ] = flags ;
}
//d3d9 is all sampler state
void D3D9_UpdateFiltering ( image_t * imagelist , int filtermip [ 3 ] , int filterpic [ 3 ] , int mipcap [ 2 ] , float anis )
{
int i ;
memcpy ( shaderstate . mipfilter , filtermip , sizeof ( shaderstate . mipfilter ) ) ;
memcpy ( shaderstate . picfilter , filterpic , sizeof ( shaderstate . picfilter ) ) ;
for ( i = 0 ; i < MAX_TMUS ; i + + )
{
shaderstate . tmuflags [ i ] = ~ shaderstate . tmuflags [ i ] ;
BE_ApplyTMUState ( i , ~ shaderstate . tmuflags [ i ] ) ;
2015-05-03 19:57:46 +00:00
IDirect3DDevice9_SetSamplerState ( pD3DDev9 , i , D3DSAMP_MAXANISOTROPY , anis ) ;
2011-03-12 13:51:40 +00:00
}
}
2010-11-06 23:05:29 +00:00
2012-09-30 05:52:03 +00:00
static void BE_ApplyShaderBits ( unsigned int bits )
2009-11-04 21:44:48 +00:00
{
2010-05-01 22:47:47 +00:00
unsigned int delta ;
2010-11-22 02:03:28 +00:00
2011-04-23 20:37:20 +00:00
if ( shaderstate . flags & ( BEF_FORCEADDITIVE | BEF_FORCETRANSPARENT | BEF_FORCENODEPTH | BEF_FORCEDEPTHTEST | BEF_FORCEDEPTHWRITE ) )
2010-11-22 02:03:28 +00:00
{
if ( shaderstate . flags & BEF_FORCEADDITIVE )
bits = ( bits & ~ ( SBITS_MISC_DEPTHWRITE | SBITS_BLEND_BITS | SBITS_ATEST_BITS ) )
2011-04-23 20:37:20 +00:00
| ( SBITS_SRCBLEND_SRC_ALPHA | SBITS_DSTBLEND_ONE ) ;
else if ( shaderstate . flags & BEF_FORCETRANSPARENT )
{
if ( ( bits & SBITS_BLEND_BITS ) = = ( SBITS_SRCBLEND_ONE | SBITS_DSTBLEND_ZERO ) | | ! ( bits & SBITS_BLEND_BITS ) ) /*if transparency is forced, clear alpha test bits*/
bits = ( bits & ~ ( SBITS_MISC_DEPTHWRITE | SBITS_BLEND_BITS | SBITS_ATEST_BITS ) )
| ( SBITS_SRCBLEND_SRC_ALPHA | SBITS_DSTBLEND_ONE_MINUS_SRC_ALPHA ) ;
}
2010-11-22 02:03:28 +00:00
if ( shaderstate . flags & BEF_FORCENODEPTH ) /*EF_NODEPTHTEST dp extension*/
bits | = SBITS_MISC_NODEPTHTEST ;
else
{
if ( shaderstate . flags & BEF_FORCEDEPTHTEST )
bits & = ~ SBITS_MISC_NODEPTHTEST ;
if ( shaderstate . flags & BEF_FORCEDEPTHWRITE )
bits | = SBITS_MISC_DEPTHWRITE ;
}
}
2012-11-27 03:23:19 +00:00
# ifdef FORCESTATE
delta = ~ 0 ;
# else
2010-05-01 22:47:47 +00:00
delta = bits ^ shaderstate . shaderbits ;
2012-11-27 03:23:19 +00:00
# endif
2010-05-01 22:47:47 +00:00
if ( ! delta )
return ;
shaderstate . shaderbits = bits ;
if ( delta & SBITS_BLEND_BITS )
{
if ( bits & SBITS_BLEND_BITS )
{
2010-11-06 23:05:29 +00:00
D3DBLEND src ;
D3DBLEND dst ;
2010-05-01 22:47:47 +00:00
switch ( bits & SBITS_SRCBLEND_BITS )
{
case SBITS_SRCBLEND_ZERO : src = D3DBLEND_ZERO ; break ;
case SBITS_SRCBLEND_ONE : src = D3DBLEND_ONE ; break ;
case SBITS_SRCBLEND_DST_COLOR : src = D3DBLEND_DESTCOLOR ; break ;
case SBITS_SRCBLEND_ONE_MINUS_DST_COLOR : src = D3DBLEND_INVDESTCOLOR ; break ;
case SBITS_SRCBLEND_SRC_ALPHA : src = D3DBLEND_SRCALPHA ; break ;
case SBITS_SRCBLEND_ONE_MINUS_SRC_ALPHA : src = D3DBLEND_INVSRCALPHA ; break ;
case SBITS_SRCBLEND_DST_ALPHA : src = D3DBLEND_DESTALPHA ; break ;
case SBITS_SRCBLEND_ONE_MINUS_DST_ALPHA : src = D3DBLEND_INVDESTALPHA ; break ;
case SBITS_SRCBLEND_ALPHA_SATURATE : src = D3DBLEND_SRCALPHASAT ; break ;
default : Sys_Error ( " Bad shader blend src \n " ) ; return ;
}
switch ( bits & SBITS_DSTBLEND_BITS )
{
case SBITS_DSTBLEND_ZERO : dst = D3DBLEND_ZERO ; break ;
case SBITS_DSTBLEND_ONE : dst = D3DBLEND_ONE ; break ;
case SBITS_DSTBLEND_SRC_ALPHA : dst = D3DBLEND_SRCALPHA ; break ;
case SBITS_DSTBLEND_ONE_MINUS_SRC_ALPHA : dst = D3DBLEND_INVSRCALPHA ; break ;
case SBITS_DSTBLEND_DST_ALPHA : dst = D3DBLEND_DESTALPHA ; break ;
case SBITS_DSTBLEND_ONE_MINUS_DST_ALPHA : dst = D3DBLEND_INVDESTALPHA ; break ;
case SBITS_DSTBLEND_SRC_COLOR : dst = D3DBLEND_SRCCOLOR ; break ;
case SBITS_DSTBLEND_ONE_MINUS_SRC_COLOR : dst = D3DBLEND_INVSRCCOLOR ; break ;
default : Sys_Error ( " Bad shader blend dst \n " ) ; return ;
}
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHABLENDENABLE , TRUE ) ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_SRCBLEND , src ) ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_DESTBLEND , dst ) ;
}
else
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHABLENDENABLE , FALSE ) ;
}
if ( delta & SBITS_ATEST_BITS )
{
switch ( bits & SBITS_ATEST_BITS )
{
case SBITS_ATEST_NONE :
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHATESTENABLE , FALSE ) ;
// IDirect3DDevice9_SetRenderState(pD3DDev9, D3DRS_ALPHAREF, 0);
// IDirect3DDevice9_SetRenderState(pD3DDev9, D3DRS_ALPHAFUNC, 0);
break ;
case SBITS_ATEST_GT0 :
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHATESTENABLE , TRUE ) ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHAREF , 0 ) ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHAFUNC , D3DCMP_GREATER ) ;
break ;
case SBITS_ATEST_LT128 :
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHATESTENABLE , TRUE ) ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHAREF , 128 ) ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHAFUNC , D3DCMP_LESS ) ;
break ;
case SBITS_ATEST_GE128 :
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHATESTENABLE , TRUE ) ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHAREF , 128 ) ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ALPHAFUNC , D3DCMP_GREATEREQUAL ) ;
break ;
2009-11-04 21:44:48 +00:00
}
2010-05-01 22:47:47 +00:00
}
if ( delta & SBITS_MISC_DEPTHWRITE )
{
if ( bits & SBITS_MISC_DEPTHWRITE )
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ZWRITEENABLE , TRUE ) ;
else
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ZWRITEENABLE , FALSE ) ;
}
if ( delta & SBITS_MISC_NODEPTHTEST )
{
if ( bits & SBITS_MISC_NODEPTHTEST )
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ZENABLE , FALSE ) ;
else
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ZENABLE , TRUE ) ;
}
if ( delta & ( SBITS_MISC_DEPTHEQUALONLY | SBITS_MISC_DEPTHCLOSERONLY ) )
{
switch ( bits & ( SBITS_MISC_DEPTHEQUALONLY | SBITS_MISC_DEPTHCLOSERONLY ) )
{
default :
case 0 :
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ZFUNC , D3DCMP_LESSEQUAL ) ;
break ;
case SBITS_MISC_DEPTHEQUALONLY :
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ZFUNC , D3DCMP_EQUAL ) ;
break ;
case SBITS_MISC_DEPTHCLOSERONLY :
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_ZFUNC , D3DCMP_LESS ) ;
break ;
2009-11-04 21:44:48 +00:00
}
2010-05-01 22:47:47 +00:00
}
2012-01-01 02:26:42 +00:00
if ( delta & ( SBITS_MASK_BITS ) )
{
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_COLORWRITEENABLE ,
( ( bits & SBITS_MASK_RED ) ? 0 : D3DCOLORWRITEENABLE_RED ) |
( ( bits & SBITS_MASK_GREEN ) ? 0 : D3DCOLORWRITEENABLE_GREEN ) |
( ( bits & SBITS_MASK_BLUE ) ? 0 : D3DCOLORWRITEENABLE_BLUE ) |
( ( bits & SBITS_MASK_ALPHA ) ? 0 : D3DCOLORWRITEENABLE_ALPHA ) ) ;
}
2010-05-01 22:47:47 +00:00
}
2012-09-30 05:52:03 +00:00
void D3D9BE_Reset ( qboolean before )
2011-06-16 02:03:57 +00:00
{
int i , tmu ;
if ( before )
{
IDirect3DDevice9_SetVertexDeclaration ( pD3DDev9 , NULL ) ;
shaderstate . curvertdecl = 0 ;
2011-09-03 03:49:43 +00:00
for ( i = 0 ; i < STRM_MAX ; i + + )
2011-06-16 02:03:57 +00:00
IDirect3DDevice9_SetStreamSource ( pD3DDev9 , i , NULL , 0 , 0 ) ;
IDirect3DDevice9_SetIndices ( pD3DDev9 , NULL ) ;
if ( shaderstate . dynxyz_buff )
IDirect3DVertexBuffer9_Release ( shaderstate . dynxyz_buff ) ;
shaderstate . dynxyz_buff = NULL ;
2012-11-27 03:23:19 +00:00
for ( tmu = 0 ; tmu < MAX_TC_TMUS ; tmu + + )
2011-06-16 02:03:57 +00:00
{
if ( shaderstate . dynst_buff [ tmu ] )
IDirect3DVertexBuffer9_Release ( shaderstate . dynst_buff [ tmu ] ) ;
shaderstate . dynst_buff [ tmu ] = NULL ;
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( shaderstate . dynnorm_buff )
IDirect3DVertexBuffer9_Release ( shaderstate . dynnorm_buff ) ;
shaderstate . dynnorm_buff = NULL ;
2011-06-16 02:03:57 +00:00
if ( shaderstate . dyncol_buff )
IDirect3DVertexBuffer9_Release ( shaderstate . dyncol_buff ) ;
shaderstate . dyncol_buff = NULL ;
if ( shaderstate . dynidx_buff )
IDirect3DIndexBuffer9_Release ( shaderstate . dynidx_buff ) ;
shaderstate . dynidx_buff = NULL ;
for ( i = 0 ; i < D3D_VDEC_MAX ; i + + )
{
if ( vertexdecls [ i ] )
IDirect3DVertexDeclaration9_Release ( vertexdecls [ i ] ) ;
vertexdecls [ i ] = NULL ;
}
}
else
{
2011-09-03 03:49:43 +00:00
D3DVERTEXELEMENT9 decl [ 13 ] , declend = D3DDECL_END ( ) ;
2011-06-16 02:03:57 +00:00
int elements ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( shaderstate . dynidx_buff )
return ;
2011-06-16 02:03:57 +00:00
for ( i = 0 ; i < D3D_VDEC_MAX ; i + + )
{
elements = 0 ;
2011-09-03 03:49:43 +00:00
decl [ elements ] . Stream = STRM_VERT ;
2011-06-16 02:03:57 +00:00
decl [ elements ] . Offset = 0 ;
decl [ elements ] . Type = D3DDECLTYPE_FLOAT3 ;
decl [ elements ] . Method = D3DDECLMETHOD_DEFAULT ;
decl [ elements ] . Usage = D3DDECLUSAGE_POSITION ;
decl [ elements ] . UsageIndex = 0 ;
elements + + ;
if ( i & D3D_VDEC_COL4B )
{
2011-09-03 03:49:43 +00:00
decl [ elements ] . Stream = STRM_COL ;
2011-06-16 02:03:57 +00:00
decl [ elements ] . Offset = 0 ;
decl [ elements ] . Type = D3DDECLTYPE_D3DCOLOR ;
decl [ elements ] . Method = D3DDECLMETHOD_DEFAULT ;
decl [ elements ] . Usage = D3DDECLUSAGE_COLOR ;
decl [ elements ] . UsageIndex = 0 ;
elements + + ;
}
2011-09-03 03:49:43 +00:00
if ( i & D3D_VDEC_NORM )
2011-06-16 02:03:57 +00:00
{
2011-09-03 03:49:43 +00:00
decl [ elements ] . Stream = STRM_NORM ;
2011-06-16 02:03:57 +00:00
decl [ elements ] . Offset = 0 ;
2011-09-03 03:49:43 +00:00
decl [ elements ] . Type = D3DDECLTYPE_FLOAT3 ;
2011-06-16 02:03:57 +00:00
decl [ elements ] . Method = D3DDECLMETHOD_DEFAULT ;
2011-09-03 03:49:43 +00:00
decl [ elements ] . Usage = D3DDECLUSAGE_NORMAL ;
decl [ elements ] . UsageIndex = 0 ;
2011-06-16 02:03:57 +00:00
elements + + ;
2011-09-03 03:49:43 +00:00
decl [ elements ] . Stream = STRM_NORMS ;
2011-06-16 02:03:57 +00:00
decl [ elements ] . Offset = 0 ;
2011-09-03 03:49:43 +00:00
decl [ elements ] . Type = D3DDECLTYPE_FLOAT3 ;
2011-06-16 02:03:57 +00:00
decl [ elements ] . Method = D3DDECLMETHOD_DEFAULT ;
2011-09-03 03:49:43 +00:00
decl [ elements ] . Usage = D3DDECLUSAGE_TANGENT ;
decl [ elements ] . UsageIndex = 0 ;
2011-06-16 02:03:57 +00:00
elements + + ;
2011-09-03 03:49:43 +00:00
decl [ elements ] . Stream = STRM_NORMT ;
2011-06-16 02:03:57 +00:00
decl [ elements ] . Offset = 0 ;
2011-09-03 03:49:43 +00:00
decl [ elements ] . Type = D3DDECLTYPE_FLOAT3 ;
2011-06-16 02:03:57 +00:00
decl [ elements ] . Method = D3DDECLMETHOD_DEFAULT ;
2011-09-03 03:49:43 +00:00
decl [ elements ] . Usage = D3DDECLUSAGE_BINORMAL ;
decl [ elements ] . UsageIndex = 0 ;
2011-06-16 02:03:57 +00:00
elements + + ;
}
2011-09-03 03:49:43 +00:00
2012-11-27 03:23:19 +00:00
for ( tmu = 0 ; tmu < MAX_TC_TMUS ; tmu + + )
2011-06-16 02:03:57 +00:00
{
if ( i & ( D3D_VDEC_ST0 < < tmu ) )
{
2011-09-03 03:49:43 +00:00
decl [ elements ] . Stream = STRM_TC0 + tmu ;
2011-06-16 02:03:57 +00:00
decl [ elements ] . Offset = 0 ;
decl [ elements ] . Type = D3DDECLTYPE_FLOAT2 ;
decl [ elements ] . Method = D3DDECLMETHOD_DEFAULT ;
decl [ elements ] . Usage = D3DDECLUSAGE_TEXCOORD ;
decl [ elements ] . UsageIndex = tmu ;
elements + + ;
}
}
2011-09-03 03:49:43 +00:00
if ( i & D3D_VDEC_SKEL )
{
decl [ elements ] . Stream = STRM_BONEWEIGHT ;
decl [ elements ] . Offset = 0 ;
decl [ elements ] . Type = D3DDECLTYPE_FLOAT3 ;
decl [ elements ] . Method = D3DDECLMETHOD_DEFAULT ;
decl [ elements ] . Usage = D3DDECLUSAGE_BLENDWEIGHT ;
decl [ elements ] . UsageIndex = 0 ;
elements + + ;
decl [ elements ] . Stream = STRM_BONENUM ;
decl [ elements ] . Offset = 0 ;
decl [ elements ] . Type = D3DDECLTYPE_FLOAT3 ;
decl [ elements ] . Method = D3DDECLMETHOD_DEFAULT ;
decl [ elements ] . Usage = D3DDECLUSAGE_BLENDINDICES ;
decl [ elements ] . UsageIndex = 0 ;
elements + + ;
}
2011-06-16 02:03:57 +00:00
decl [ elements ] = declend ;
elements + + ;
IDirect3DDevice9_CreateVertexDeclaration ( pD3DDev9 , decl , & vertexdecls [ i ] ) ;
}
IDirect3DDevice9_CreateVertexBuffer ( pD3DDev9 , shaderstate . dynxyz_size , D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY , 0 , D3DPOOL_DEFAULT , & shaderstate . dynxyz_buff , NULL ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
for ( tmu = 0 ; tmu < MAX_TC_TMUS ; tmu + + )
2011-06-16 02:03:57 +00:00
IDirect3DDevice9_CreateVertexBuffer ( pD3DDev9 , shaderstate . dynst_size , D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY , 0 , D3DPOOL_DEFAULT , & shaderstate . dynst_buff [ tmu ] , NULL ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
IDirect3DDevice9_CreateVertexBuffer ( pD3DDev9 , shaderstate . dynnorm_size , D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY , 0 , D3DPOOL_DEFAULT , & shaderstate . dynnorm_buff , NULL ) ;
2011-06-16 02:03:57 +00:00
IDirect3DDevice9_CreateVertexBuffer ( pD3DDev9 , shaderstate . dyncol_size , D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY , 0 , D3DPOOL_DEFAULT , & shaderstate . dyncol_buff , NULL ) ;
IDirect3DDevice9_CreateIndexBuffer ( pD3DDev9 , shaderstate . dynidx_size , D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY , D3DFMT_QINDEX , D3DPOOL_DEFAULT , & shaderstate . dynidx_buff , NULL ) ;
for ( i = 0 ; i < MAX_TMUS ; i + + )
{
shaderstate . tmuflags [ i ] = ~ 0 ;
BE_ApplyTMUState ( i , 0 ) ;
}
/*force all state to change, thus setting a known state*/
shaderstate . shaderbits = ~ 0 ;
2012-09-30 05:52:03 +00:00
BE_ApplyShaderBits ( 0 ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
Surf_BuildLightmaps ( ) ;
2011-06-16 02:03:57 +00:00
}
}
2012-01-01 02:26:42 +00:00
static const char LIGHTPASS_SHADER [ ] = " \
{ \ n \
program rtlight \ n \
{ \ n \
map $ diffuse \ n \
blendfunc add \ n \
} \ n \
{ \ n \
map $ normalmap \ n \
} \ n \
{ \ n \
map $ specular \ n \
} \ n \
} " ;
2012-09-30 05:52:03 +00:00
void D3D9BE_Init ( void )
2010-11-13 17:22:46 +00:00
{
be_maxpasses = MAX_TMUS ;
memset ( & shaderstate , 0 , sizeof ( shaderstate ) ) ;
shaderstate . curvertdecl = - 1 ;
FTable_Init ( ) ;
shaderstate . dynxyz_size = sizeof ( vecV_t ) * DYNVBUFFSIZE ;
shaderstate . dyncol_size = sizeof ( byte_vec4_t ) * DYNVBUFFSIZE ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
shaderstate . dynnorm_size = sizeof ( vec3_t ) * 3 * DYNVBUFFSIZE ;
2010-11-13 17:22:46 +00:00
shaderstate . dynst_size = sizeof ( vec2_t ) * DYNVBUFFSIZE ;
shaderstate . dynidx_size = sizeof ( index_t ) * DYNIBUFFSIZE ;
2012-09-30 05:52:03 +00:00
D3D9BE_Reset ( false ) ;
2011-10-27 16:16:29 +00:00
2013-08-21 08:13:09 +00:00
shaderstate . shader_rtlight = R_RegisterShader ( " rtlight " , SUF_NONE , LIGHTPASS_SHADER ) ;
2012-01-01 02:26:42 +00:00
2011-10-27 16:16:29 +00:00
R_InitFlashblends ( ) ;
2010-11-13 17:22:46 +00:00
}
2010-11-02 23:17:25 +00:00
static void allocvertexbuffer ( IDirect3DVertexBuffer9 * buff , unsigned int bmaxsize , unsigned int * offset , void * * data , unsigned int bytes )
2010-05-01 22:47:47 +00:00
{
unsigned int boff ;
2010-11-02 23:17:25 +00:00
if ( * offset + bytes > bmaxsize )
2010-05-01 22:47:47 +00:00
{
boff = 0 ;
* offset = bytes ;
}
else
{
boff = * offset ;
* offset + = bytes ;
}
2010-11-02 23:17:25 +00:00
d3dcheck ( IDirect3DVertexBuffer9_Lock ( buff , boff , bytes , data , boff ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) ;
2010-05-01 22:47:47 +00:00
}
static unsigned int allocindexbuffer ( void * * dest , unsigned int entries )
{
unsigned int bytes = entries * sizeof ( index_t ) ;
unsigned int offset ;
if ( shaderstate . dynidx_offs + bytes > DYNIBUFFSIZE )
{
offset = 0 ;
shaderstate . dynidx_offs = 0 ;
2009-11-04 21:44:48 +00:00
}
else
2010-05-01 22:47:47 +00:00
{
offset = shaderstate . dynidx_offs ;
shaderstate . dynidx_offs + = bytes ;
}
2009-11-04 21:44:48 +00:00
2011-05-19 13:34:07 +00:00
d3dcheck ( IDirect3DIndexBuffer9_Lock ( shaderstate . dynidx_buff , offset , ( unsigned int ) entries , dest , offset ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) ;
2010-05-01 22:47:47 +00:00
return offset / sizeof ( index_t ) ;
}
2014-10-05 20:04:11 +00:00
static void BindTexture ( unsigned int tu , texid_t tex )
2010-11-10 03:32:47 +00:00
{
2014-10-05 20:04:11 +00:00
IDirect3DTexture9 * dt ;
if ( tex )
2010-11-10 03:32:47 +00:00
{
2014-10-05 20:04:11 +00:00
dt = tex - > ptr ;
shaderstate . curtexflags [ tu ] = tex - > flags & SHADER_PASS_IMAGE_FLAGS ;
}
else
dt = NULL ;
if ( shaderstate . curtex [ tu ] ! = dt )
{
shaderstate . curtex [ tu ] = dt ;
IDirect3DDevice9_SetTexture ( pD3DDev9 , tu , ( void * ) dt ) ;
2010-11-10 03:32:47 +00:00
}
}
2010-05-01 22:47:47 +00:00
static void SelectPassTexture ( unsigned int tu , shaderpass_t * pass )
{
2011-12-23 03:12:29 +00:00
int last ;
2012-07-07 05:17:43 +00:00
extern texid_t missing_texture ;
2011-12-23 03:12:29 +00:00
2010-05-01 22:47:47 +00:00
switch ( pass - > texgen )
2009-11-04 21:44:48 +00:00
{
2010-05-01 22:47:47 +00:00
default :
case T_GEN_DIFFUSE :
2014-10-05 20:04:11 +00:00
if ( shaderstate . curtexnums - > base )
BindTexture ( tu , shaderstate . curtexnums - > base ) ;
2012-07-07 05:17:43 +00:00
else
2014-10-05 20:04:11 +00:00
BindTexture ( tu , missing_texture ) ;
2010-05-01 22:47:47 +00:00
break ;
case T_GEN_NORMALMAP :
2014-10-05 20:04:11 +00:00
BindTexture ( tu , shaderstate . curtexnums - > bump ) ;
2009-11-04 21:44:48 +00:00
break ;
2010-05-01 22:47:47 +00:00
case T_GEN_SPECULAR :
2014-10-05 20:04:11 +00:00
BindTexture ( tu , shaderstate . curtexnums - > specular ) ;
2009-11-04 21:44:48 +00:00
break ;
2010-05-01 22:47:47 +00:00
case T_GEN_UPPEROVERLAY :
2014-10-05 20:04:11 +00:00
BindTexture ( tu , shaderstate . curtexnums - > upperoverlay ) ;
2009-11-04 21:44:48 +00:00
break ;
2010-05-01 22:47:47 +00:00
case T_GEN_LOWEROVERLAY :
2014-10-05 20:04:11 +00:00
BindTexture ( tu , shaderstate . curtexnums - > loweroverlay ) ;
2010-05-01 22:47:47 +00:00
break ;
case T_GEN_FULLBRIGHT :
2014-10-05 20:04:11 +00:00
BindTexture ( tu , shaderstate . curtexnums - > fullbright ) ;
2010-05-01 22:47:47 +00:00
break ;
case T_GEN_ANIMMAP :
2014-10-05 20:04:11 +00:00
BindTexture ( tu , pass - > anim_frames [ ( int ) ( pass - > anim_fps * shaderstate . curtime ) % pass - > anim_numframes ] ) ;
2010-05-01 22:47:47 +00:00
break ;
case T_GEN_SINGLEMAP :
2014-10-05 20:04:11 +00:00
BindTexture ( tu , pass - > anim_frames [ 0 ] ) ;
2010-05-01 22:47:47 +00:00
break ;
case T_GEN_DELUXMAP :
2014-10-05 20:04:11 +00:00
BindTexture ( tu , shaderstate . curdeluxmap ) ;
2010-05-01 22:47:47 +00:00
break ;
case T_GEN_LIGHTMAP :
2014-10-05 20:04:11 +00:00
BindTexture ( tu , shaderstate . curlightmap ) ;
2010-05-01 22:47:47 +00:00
break ;
/*case T_GEN_CURRENTRENDER:
2010-11-02 23:17:25 +00:00
FIXME : no code to grab the current screen and convert to a texture
2010-05-01 22:47:47 +00:00
break ; */
case T_GEN_VIDEOMAP :
2014-10-05 20:04:11 +00:00
BindTexture ( tu , Media_UpdateForShader ( pass - > cin ) ) ;
2009-11-04 21:44:48 +00:00
break ;
}
2014-10-05 20:04:11 +00:00
BE_ApplyTMUState ( tu , shaderstate . curtexflags [ tu ] | pass - > flags ) ;
2010-11-02 23:17:25 +00:00
2011-12-23 03:12:29 +00:00
if ( tu = = 0 )
{
if ( shaderstate . passsinglecolour )
{
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_CONSTANT , shaderstate . passcolour ) ;
last = D3DTA_CONSTANT ;
2015-07-31 13:23:32 +00:00
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_COLORVERTEX , FALSE ) ;
2011-12-23 03:12:29 +00:00
}
else
{
2015-07-31 13:23:32 +00:00
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_COLORVERTEX , TRUE ) ;
// IDirect3DDevice9_SetRenderState(pD3DDev9, D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1);
2011-12-23 03:12:29 +00:00
last = D3DTA_DIFFUSE ;
}
}
else
last = D3DTA_CURRENT ;
2010-05-01 22:47:47 +00:00
switch ( pass - > blendmode )
{
2011-03-02 03:43:38 +00:00
case PBM_DOTPRODUCT :
2011-12-23 03:12:29 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG1 , last ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG2 , D3DTA_TEXTURE ) ;
2010-05-01 22:47:47 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLOROP , D3DTOP_DOTPRODUCT3 ) ;
2010-11-10 03:32:47 +00:00
2011-12-23 03:12:29 +00:00
// IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_ALPHAARG1, last);
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG2 , D3DTA_TEXTURE ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAOP , D3DTOP_SELECTARG2 ) ;
2010-05-01 22:47:47 +00:00
break ;
2011-03-02 03:43:38 +00:00
case PBM_REPLACE :
2011-12-23 03:12:29 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG1 , last ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG2 , D3DTA_TEXTURE ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLOROP , D3DTOP_SELECTARG2 ) ;
2010-11-10 03:32:47 +00:00
2010-11-22 02:03:28 +00:00
if ( shaderstate . flags & ( BEF_FORCETRANSPARENT | BEF_FORCEADDITIVE ) )
{
2011-12-23 03:12:29 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG1 , last ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG2 , D3DTA_TEXTURE ) ;
2010-11-22 02:03:28 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAOP , D3DTOP_MODULATE ) ;
}
else
{
2011-12-23 03:12:29 +00:00
// IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_ALPHAARG1, last);
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG2 , D3DTA_TEXTURE ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAOP , D3DTOP_SELECTARG2 ) ;
2010-11-22 02:03:28 +00:00
}
2010-05-01 22:47:47 +00:00
break ;
2011-03-02 03:43:38 +00:00
case PBM_ADD :
2011-12-23 03:12:29 +00:00
if ( tu = = 0 )
goto forcemod ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG1 , last ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG2 , D3DTA_TEXTURE ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLOROP , D3DTOP_ADD ) ;
2010-11-10 03:32:47 +00:00
2011-12-23 03:12:29 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG1 , last ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG2 , D3DTA_TEXTURE ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAOP , D3DTOP_SELECTARG1 ) ;
2010-05-01 22:47:47 +00:00
break ;
2011-03-02 03:43:38 +00:00
case PBM_DECAL :
2010-11-10 03:32:47 +00:00
if ( ! tu )
goto forcemod ;
2011-12-23 03:12:29 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG1 , last ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG2 , D3DTA_TEXTURE ) ;
2010-11-10 03:32:47 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLOROP , D3DTOP_BLENDTEXTUREALPHA ) ;
2014-03-30 08:55:06 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG1 , last ) ;
// IDirect3DDevice9_SetTextureStageState(pD3DDev9, tu, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAOP , D3DTOP_SELECTARG1 ) ;
2010-05-01 22:47:47 +00:00
break ;
2011-03-03 13:32:27 +00:00
case PBM_OVERBRIGHT :
2011-12-23 03:12:29 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG1 , last ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG2 , D3DTA_TEXTURE ) ;
2011-03-03 13:32:27 +00:00
{
extern cvar_t gl_overbright ;
switch ( gl_overbright . ival )
{
case 1 :
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLOROP , D3DTOP_MODULATE2X ) ;
break ;
case 2 :
case 3 :
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLOROP , D3DTOP_MODULATE4X ) ;
break ;
default :
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLOROP , D3DTOP_MODULATE ) ;
break ;
}
}
2011-12-23 03:12:29 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG1 , last ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG2 , D3DTA_TEXTURE ) ;
2011-03-03 13:32:27 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAOP , D3DTOP_MODULATE ) ;
break ;
2010-05-01 22:47:47 +00:00
default :
2011-03-02 03:43:38 +00:00
case PBM_MODULATE :
2010-11-10 03:32:47 +00:00
forcemod :
2011-12-23 03:12:29 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG1 , last ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLORARG2 , D3DTA_TEXTURE ) ;
2010-05-01 22:47:47 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_COLOROP , D3DTOP_MODULATE ) ;
2010-11-10 03:32:47 +00:00
2011-12-23 03:12:29 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG1 , last ) ;
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAARG2 , D3DTA_TEXTURE ) ;
2010-11-10 03:32:47 +00:00
IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tu , D3DTSS_ALPHAOP , D3DTOP_MODULATE ) ;
2010-05-01 22:47:47 +00:00
break ;
}
}
2009-11-04 21:44:48 +00:00
2011-12-23 03:12:29 +00:00
static void colourgenbyte ( const shaderpass_t * pass , int cnt , byte_vec4_t * srcb , vec4_t * srcf , byte_vec4_t * dst , const mesh_t * mesh )
2010-05-01 22:47:47 +00:00
{
D3DCOLOR block ;
switch ( pass - > rgbgen )
2009-11-04 21:44:48 +00:00
{
2010-05-01 22:47:47 +00:00
case RGB_GEN_ENTITY :
block = D3DCOLOR_COLORVALUE ( shaderstate . curentity - > shaderRGBAf [ 0 ] , shaderstate . curentity - > shaderRGBAf [ 1 ] , shaderstate . curentity - > shaderRGBAf [ 2 ] , shaderstate . curentity - > shaderRGBAf [ 3 ] ) ;
while ( ( cnt ) - - )
{
( ( D3DCOLOR * ) dst ) [ cnt ] = block ;
}
break ;
case RGB_GEN_ONE_MINUS_ENTITY :
block = D3DCOLOR_COLORVALUE ( 1 - shaderstate . curentity - > shaderRGBAf [ 0 ] , 1 - shaderstate . curentity - > shaderRGBAf [ 1 ] , 1 - shaderstate . curentity - > shaderRGBAf [ 2 ] , 1 - shaderstate . curentity - > shaderRGBAf [ 3 ] ) ;
while ( ( cnt ) - - )
{
( ( D3DCOLOR * ) dst ) [ cnt ] = block ;
}
break ;
2011-10-27 16:16:29 +00:00
case RGB_GEN_VERTEX_LIGHTING :
case RGB_GEN_VERTEX_EXACT :
2011-12-23 03:12:29 +00:00
if ( srcb )
{
while ( ( cnt ) - - )
{
qbyte r , g , b ;
r = srcb [ cnt ] [ 0 ] ;
g = srcb [ cnt ] [ 1 ] ;
b = srcb [ cnt ] [ 2 ] ;
dst [ cnt ] [ 0 ] = b ;
dst [ cnt ] [ 1 ] = g ;
dst [ cnt ] [ 2 ] = r ;
}
}
else if ( srcf )
2010-05-01 22:47:47 +00:00
{
2010-11-10 03:32:47 +00:00
while ( ( cnt ) - - )
{
2011-12-23 03:12:29 +00:00
int r , g , b ;
r = srcf [ cnt ] [ 0 ] * 255 ;
g = srcf [ cnt ] [ 1 ] * 255 ;
b = srcf [ cnt ] [ 2 ] * 255 ;
dst [ cnt ] [ 0 ] = bound ( 0 , b , 255 ) ;
dst [ cnt ] [ 1 ] = bound ( 0 , g , 255 ) ;
dst [ cnt ] [ 2 ] = bound ( 0 , r , 255 ) ;
2010-11-10 03:32:47 +00:00
}
}
else
2011-12-23 03:12:29 +00:00
goto identity ;
break ;
case RGB_GEN_ONE_MINUS_VERTEX :
if ( srcb )
2010-11-10 03:32:47 +00:00
{
while ( ( cnt ) - - )
{
qbyte r , g , b ;
2011-12-23 03:12:29 +00:00
r = 255 - srcb [ cnt ] [ 0 ] ;
g = 255 - srcb [ cnt ] [ 1 ] ;
b = 255 - srcb [ cnt ] [ 2 ] ;
2010-11-10 03:32:47 +00:00
dst [ cnt ] [ 0 ] = b ;
dst [ cnt ] [ 1 ] = g ;
dst [ cnt ] [ 2 ] = r ;
}
2010-05-01 22:47:47 +00:00
}
2011-12-23 03:12:29 +00:00
else if ( srcf )
2010-05-01 22:47:47 +00:00
{
2011-12-23 03:12:29 +00:00
while ( ( cnt ) - - )
{
int r , g , b ;
r = 255 - srcf [ cnt ] [ 0 ] * 255 ;
g = 255 - srcf [ cnt ] [ 1 ] * 255 ;
b = 255 - srcf [ cnt ] [ 2 ] * 255 ;
dst [ cnt ] [ 0 ] = bound ( 0 , b , 255 ) ;
dst [ cnt ] [ 1 ] = bound ( 0 , g , 255 ) ;
dst [ cnt ] [ 2 ] = bound ( 0 , r , 255 ) ;
}
2010-05-01 22:47:47 +00:00
}
2011-12-23 03:12:29 +00:00
else
goto identity ;
2010-05-01 22:47:47 +00:00
break ;
case RGB_GEN_IDENTITY_LIGHTING :
//compensate for overbrights
2011-03-12 13:51:40 +00:00
block = D3DCOLOR_RGBA ( 255 , 255 , 255 , 255 ) ; //shaderstate.identitylighting
2010-05-01 22:47:47 +00:00
while ( ( cnt ) - - )
{
2011-03-12 13:51:40 +00:00
( ( D3DCOLOR * ) dst ) [ cnt ] = block ;
2010-05-01 22:47:47 +00:00
}
break ;
2009-11-04 21:44:48 +00:00
default :
2011-12-23 03:12:29 +00:00
identity :
2010-05-01 22:47:47 +00:00
case RGB_GEN_IDENTITY :
block = D3DCOLOR_RGBA ( 255 , 255 , 255 , 255 ) ;
while ( ( cnt ) - - )
{
( ( D3DCOLOR * ) dst ) [ cnt ] = block ;
}
2009-11-04 21:44:48 +00:00
break ;
2010-05-01 22:47:47 +00:00
case RGB_GEN_CONST :
block = D3DCOLOR_COLORVALUE ( pass - > rgbgen_func . args [ 0 ] , pass - > rgbgen_func . args [ 1 ] , pass - > rgbgen_func . args [ 2 ] , 1 ) ;
while ( ( cnt ) - - )
{
( ( D3DCOLOR * ) dst ) [ cnt ] = block ;
}
break ;
case RGB_GEN_LIGHTING_DIFFUSE :
//collect lighting details for mobile entities
2010-11-02 23:17:25 +00:00
if ( ! mesh - > normals_array )
2010-05-01 22:47:47 +00:00
{
block = D3DCOLOR_RGBA ( 255 , 255 , 255 , 255 ) ;
while ( ( cnt ) - - )
{
( ( D3DCOLOR * ) dst ) [ cnt ] = block ;
}
}
2010-11-02 23:17:25 +00:00
else
2010-05-01 22:47:47 +00:00
{
2011-07-30 14:14:56 +00:00
R_LightArraysByte_BGR ( shaderstate . curentity , mesh - > xyz_array , dst , cnt , mesh - > normals_array ) ;
2010-11-02 23:17:25 +00:00
}
2010-05-01 22:47:47 +00:00
break ;
case RGB_GEN_WAVE :
{
float * table ;
float c ;
table = FTableForFunc ( pass - > rgbgen_func . type ) ;
c = pass - > rgbgen_func . args [ 2 ] + shaderstate . curtime * pass - > rgbgen_func . args [ 3 ] ;
c = FTABLE_EVALUATE ( table , c ) * pass - > rgbgen_func . args [ 1 ] + pass - > rgbgen_func . args [ 0 ] ;
c = bound ( 0.0f , c , 1.0f ) ;
block = D3DCOLOR_COLORVALUE ( c , c , c , 1 ) ;
while ( ( cnt ) - - )
{
( ( D3DCOLOR * ) dst ) [ cnt ] = block ;
}
}
2009-11-04 21:44:48 +00:00
break ;
2010-05-01 22:47:47 +00:00
case RGB_GEN_TOPCOLOR :
case RGB_GEN_BOTTOMCOLOR :
2011-10-27 16:16:29 +00:00
# ifdef warningmsg
# pragma warningmsg("fix 24bit player colours")
2011-05-29 04:26:29 +00:00
# endif
2010-05-01 22:47:47 +00:00
block = D3DCOLOR_RGBA ( 255 , 255 , 255 , 255 ) ;
while ( ( cnt ) - - )
{
( ( D3DCOLOR * ) dst ) [ cnt ] = block ;
}
// Con_Printf("RGB_GEN %i not supported\n", pass->rgbgen);
2009-11-04 21:44:48 +00:00
break ;
}
}
2011-12-23 03:12:29 +00:00
static void alphagenbyte ( const shaderpass_t * pass , int cnt , byte_vec4_t * srcb , vec4_t * srcf , byte_vec4_t * dst , const mesh_t * mesh )
2009-11-04 21:44:48 +00:00
{
2010-11-02 23:17:25 +00:00
/*FIXME: Skip this if the rgbgen did it*/
2010-05-01 22:47:47 +00:00
float * table ;
unsigned char t ;
float f ;
vec3_t v1 , v2 ;
2009-11-04 21:44:48 +00:00
2010-05-01 22:47:47 +00:00
switch ( pass - > alphagen )
{
default :
case ALPHA_GEN_IDENTITY :
2010-11-22 02:03:28 +00:00
if ( shaderstate . flags & BEF_FORCETRANSPARENT )
{
f = shaderstate . curentity - > shaderRGBAf [ 3 ] ;
if ( f < 0 )
t = 0 ;
else if ( f > = 1 )
t = 255 ;
else
t = f * 255 ;
while ( cnt - - )
dst [ cnt ] [ 3 ] = t ;
}
else
{
while ( cnt - - )
dst [ cnt ] [ 3 ] = 255 ;
}
2010-05-01 22:47:47 +00:00
break ;
2009-11-04 21:44:48 +00:00
2010-05-01 22:47:47 +00:00
case ALPHA_GEN_CONST :
t = pass - > alphagen_func . args [ 0 ] * 255 ;
while ( cnt - - )
dst [ cnt ] [ 3 ] = t ;
break ;
2009-11-04 21:44:48 +00:00
2010-05-01 22:47:47 +00:00
case ALPHA_GEN_WAVE :
table = FTableForFunc ( pass - > alphagen_func . type ) ;
f = pass - > alphagen_func . args [ 2 ] + shaderstate . curtime * pass - > alphagen_func . args [ 3 ] ;
f = FTABLE_EVALUATE ( table , f ) * pass - > alphagen_func . args [ 1 ] + pass - > alphagen_func . args [ 0 ] ;
t = bound ( 0.0f , f , 1.0f ) * 255 ;
while ( cnt - - )
dst [ cnt ] [ 3 ] = t ;
break ;
2009-11-04 21:44:48 +00:00
2010-05-01 22:47:47 +00:00
case ALPHA_GEN_PORTAL :
//FIXME: should this be per-vert?
VectorAdd ( mesh - > xyz_array [ 0 ] , shaderstate . curentity - > origin , v1 ) ;
VectorSubtract ( r_origin , v1 , v2 ) ;
f = VectorLength ( v2 ) * ( 1.0 / 255.0 ) ;
t = bound ( 0.0f , f , 1.0f ) * 255 ;
2009-11-04 21:44:48 +00:00
2010-05-01 22:47:47 +00:00
while ( cnt - - )
dst [ cnt ] [ 3 ] = t ;
break ;
2009-11-04 21:44:48 +00:00
2010-05-01 22:47:47 +00:00
case ALPHA_GEN_VERTEX :
2011-12-23 03:12:29 +00:00
if ( srcb )
2010-05-01 22:47:47 +00:00
{
while ( cnt - - )
{
2011-12-23 03:12:29 +00:00
dst [ cnt ] [ 3 ] = srcb [ cnt ] [ 3 ] ;
2010-05-01 22:47:47 +00:00
}
}
2011-12-23 03:12:29 +00:00
else if ( srcf )
{
while ( cnt - - )
{
dst [ cnt ] [ 3 ] = bound ( 0 , srcf [ cnt ] [ 3 ] * 255 , 255 ) ;
}
}
else
2010-05-01 22:47:47 +00:00
{
2011-12-23 03:12:29 +00:00
while ( cnt - - )
{
dst [ cnt ] [ 3 ] = 255 ;
}
2010-05-01 22:47:47 +00:00
}
2009-11-04 21:44:48 +00:00
break ;
2010-05-01 22:47:47 +00:00
case ALPHA_GEN_ENTITY :
t = bound ( 0 , shaderstate . curentity - > shaderRGBAf [ 3 ] , 1 ) * 255 ;
while ( cnt - - )
{
dst [ cnt ] [ 3 ] = t ;
}
2009-11-07 13:29:15 +00:00
break ;
2010-05-01 22:47:47 +00:00
2010-11-10 03:32:47 +00:00
case ALPHA_GEN_SPECULAR :
2010-05-01 22:47:47 +00:00
{
2010-11-10 03:32:47 +00:00
int i ;
2010-05-01 22:47:47 +00:00
VectorSubtract ( r_origin , shaderstate . curentity - > origin , v1 ) ;
2011-05-19 13:34:07 +00:00
if ( ! Matrix3_Compare ( shaderstate . curentity - > axis , ( void * ) axisDefault ) )
2010-05-01 22:47:47 +00:00
{
2010-11-10 03:32:47 +00:00
Matrix3_Multiply_Vec3 ( shaderstate . curentity - > axis , v2 , v2 ) ;
2010-05-01 22:47:47 +00:00
}
else
{
VectorCopy ( v1 , v2 ) ;
}
for ( i = 0 ; i < cnt ; i + + )
{
VectorSubtract ( v2 , mesh - > xyz_array [ i ] , v1 ) ;
f = DotProduct ( v1 , mesh - > normals_array [ i ] ) * Q_rsqrt ( DotProduct ( v1 , v1 ) ) ;
f = f * f * f * f * f ;
2010-11-10 03:32:47 +00:00
dst [ i ] [ 3 ] = bound ( 0.0f , ( int ) ( f * 255 ) , 255 ) ;
2010-05-01 22:47:47 +00:00
}
}
2010-11-10 03:32:47 +00:00
break ;
2009-11-07 13:29:15 +00:00
}
2010-05-01 22:47:47 +00:00
}
2010-10-02 02:25:39 +00:00
static unsigned int BE_GenerateColourMods ( unsigned int vertcount , const shaderpass_t * pass )
2010-05-01 22:47:47 +00:00
{
unsigned int ret = 0 ;
unsigned char * map ;
const mesh_t * m ;
2010-10-02 02:25:39 +00:00
unsigned int mno ;
2010-05-01 22:47:47 +00:00
2010-11-02 23:17:25 +00:00
m = shaderstate . meshlist [ 0 ] ;
2014-03-30 08:55:06 +00:00
if ( pass - > flags & SHADER_PASS_NOCOLORARRAY )
2009-11-07 13:29:15 +00:00
{
2010-11-06 23:05:29 +00:00
shaderstate . passsinglecolour = true ;
2010-05-01 22:47:47 +00:00
shaderstate . passcolour = D3DCOLOR_RGBA ( 255 , 255 , 255 , 255 ) ;
2011-12-23 03:12:29 +00:00
colourgenbyte ( pass , 1 , ( byte_vec4_t * ) & shaderstate . passcolour , NULL , ( byte_vec4_t * ) & shaderstate . passcolour , m ) ;
alphagenbyte ( pass , 1 , ( byte_vec4_t * ) & shaderstate . passcolour , NULL , ( byte_vec4_t * ) & shaderstate . passcolour , m ) ;
2010-11-06 23:05:29 +00:00
/*FIXME: just because there's no rgba set, there's no reason to assume it should be a single colour (unshaded ents)*/
2011-09-03 03:49:43 +00:00
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_COL , NULL , 0 , 0 ) ) ;
2009-11-04 21:44:48 +00:00
}
2010-11-06 23:05:29 +00:00
else
2009-11-04 21:44:48 +00:00
{
2010-11-02 23:17:25 +00:00
shaderstate . passsinglecolour = false ;
2010-05-01 22:47:47 +00:00
ret | = D3D_VDEC_COL4B ;
2013-08-27 13:18:09 +00:00
if ( shaderstate . batchvbo & & ( m - > colors4f_array [ 0 ] & &
2011-10-27 16:16:29 +00:00
( ( pass - > rgbgen = = RGB_GEN_VERTEX_LIGHTING ) | |
( pass - > rgbgen = = RGB_GEN_VERTEX_EXACT ) | |
2011-12-23 03:12:29 +00:00
( pass - > rgbgen = = RGB_GEN_ONE_MINUS_VERTEX ) ) & &
2010-11-11 18:22:49 +00:00
( pass - > alphagen = = ALPHA_GEN_VERTEX ) ) )
2010-11-06 23:05:29 +00:00
{
2013-08-27 13:18:09 +00:00
//fixme
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_COL , shaderstate . batchvbo - > colours [ 0 ] . d3d . buff , shaderstate . batchvbo - > colours [ 0 ] . d3d . offs , sizeof ( vbovdata_t ) ) ) ;
2010-11-06 23:05:29 +00:00
}
else
{
2011-12-23 03:12:29 +00:00
allocvertexbuffer ( shaderstate . dyncol_buff , shaderstate . dyncol_size , & shaderstate . dyncol_offs , ( void * * ) & map , vertcount * sizeof ( D3DCOLOR ) ) ;
2010-11-06 23:05:29 +00:00
for ( vertcount = 0 , mno = 0 ; mno < shaderstate . nummeshes ; mno + + )
{
m = shaderstate . meshlist [ mno ] ;
2013-08-27 13:18:09 +00:00
colourgenbyte ( pass , m - > numvertexes , m - > colors4b_array , m - > colors4f_array [ 0 ] , ( byte_vec4_t * ) map , m ) ;
alphagenbyte ( pass , m - > numvertexes , m - > colors4b_array , m - > colors4f_array [ 0 ] , ( byte_vec4_t * ) map , m ) ;
2010-11-06 23:05:29 +00:00
map + = m - > numvertexes * 4 ;
vertcount + = m - > numvertexes ;
2009-11-07 13:29:15 +00:00
}
2011-12-23 03:12:29 +00:00
d3dcheck ( IDirect3DVertexBuffer9_Unlock ( shaderstate . dyncol_buff ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_COL , shaderstate . dyncol_buff , shaderstate . dyncol_offs - vertcount * sizeof ( D3DCOLOR ) , sizeof ( D3DCOLOR ) ) ) ;
2009-11-07 13:29:15 +00:00
}
}
2010-05-01 22:47:47 +00:00
return ret ;
}
/*********************************************************************************************************/
/*========================================== texture coord generation =====================================*/
2011-05-19 13:34:07 +00:00
static void tcgen_environment ( float * st , unsigned int numverts , float * xyz , float * normal )
2010-05-01 22:47:47 +00:00
{
int i ;
vec3_t viewer , reflected ;
float d ;
vec3_t rorg ;
RotateLightVector ( shaderstate . curentity - > axis , shaderstate . curentity - > origin , r_origin , rorg ) ;
2011-05-19 13:34:07 +00:00
for ( i = 0 ; i < numverts ; i + + , xyz + = 3 , normal + = 3 , st + = 2 )
2010-05-01 22:47:47 +00:00
{
VectorSubtract ( rorg , xyz , viewer ) ;
VectorNormalizeFast ( viewer ) ;
d = DotProduct ( normal , viewer ) ;
reflected [ 0 ] = normal [ 0 ] * 2 * d - viewer [ 0 ] ;
reflected [ 1 ] = normal [ 1 ] * 2 * d - viewer [ 1 ] ;
reflected [ 2 ] = normal [ 2 ] * 2 * d - viewer [ 2 ] ;
st [ 0 ] = 0.5 + reflected [ 1 ] * 0.5 ;
st [ 1 ] = 0.5 - reflected [ 2 ] * 0.5 ;
}
}
static float * tcgen ( const shaderpass_t * pass , int cnt , float * dst , const mesh_t * mesh )
{
int i ;
vecV_t * src ;
switch ( pass - > tcgen )
{
default :
case TC_GEN_BASE :
return ( float * ) mesh - > st_array ;
case TC_GEN_LIGHTMAP :
return ( float * ) mesh - > lmst_array ;
case TC_GEN_NORMAL :
return ( float * ) mesh - > normals_array ;
case TC_GEN_SVECTOR :
return ( float * ) mesh - > snormals_array ;
case TC_GEN_TVECTOR :
return ( float * ) mesh - > tnormals_array ;
case TC_GEN_ENVIRONMENT :
tcgen_environment ( dst , cnt , ( float * ) mesh - > xyz_array , ( float * ) mesh - > normals_array ) ;
return dst ;
2010-11-10 03:32:47 +00:00
case TC_GEN_DOTPRODUCT :
return dst ; //mesh->st_array[0];
2010-05-01 22:47:47 +00:00
case TC_GEN_VECTOR :
src = mesh - > xyz_array ;
for ( i = 0 ; i < cnt ; i + + , dst + = 2 )
{
static vec3_t tc_gen_s = { 1.0f , 0.0f , 0.0f } ;
static vec3_t tc_gen_t = { 0.0f , 1.0f , 0.0f } ;
dst [ 0 ] = DotProduct ( tc_gen_s , src [ i ] ) ;
dst [ 1 ] = DotProduct ( tc_gen_t , src [ i ] ) ;
}
return dst ;
}
}
/*src and dst can be the same address when tcmods are chained*/
static void tcmod ( const tcmod_t * tcmod , int cnt , const float * src , float * dst , const mesh_t * mesh )
{
float * table ;
float t1 , t2 ;
float cost , sint ;
int j ;
# define R_FastSin(x) sin((x)*(2*M_PI))
switch ( tcmod - > type )
{
case SHADER_TCMOD_ROTATE :
cost = tcmod - > args [ 0 ] * shaderstate . curtime ;
sint = R_FastSin ( cost ) ;
cost = R_FastSin ( cost + 0.25 ) ;
for ( j = 0 ; j < cnt ; j + + , dst + = 2 , src + = 2 )
{
t1 = cost * ( src [ 0 ] - 0.5f ) - sint * ( src [ 1 ] - 0.5f ) + 0.5f ;
t2 = cost * ( src [ 1 ] - 0.5f ) + sint * ( src [ 0 ] - 0.5f ) + 0.5f ;
dst [ 0 ] = t1 ;
dst [ 1 ] = t2 ;
}
break ;
case SHADER_TCMOD_SCALE :
t1 = tcmod - > args [ 0 ] ;
t2 = tcmod - > args [ 1 ] ;
for ( j = 0 ; j < cnt ; j + + , dst + = 2 , src + = 2 )
{
dst [ 0 ] = src [ 0 ] * t1 ;
dst [ 1 ] = src [ 1 ] * t2 ;
}
break ;
case SHADER_TCMOD_TURB :
t1 = tcmod - > args [ 2 ] + shaderstate . curtime * tcmod - > args [ 3 ] ;
t2 = tcmod - > args [ 1 ] ;
for ( j = 0 ; j < cnt ; j + + , dst + = 2 , src + = 2 )
{
dst [ 0 ] = src [ 0 ] + R_FastSin ( src [ 0 ] * t2 + t1 ) * t2 ;
dst [ 1 ] = src [ 1 ] + R_FastSin ( src [ 1 ] * t2 + t1 ) * t2 ;
}
break ;
case SHADER_TCMOD_STRETCH :
table = FTableForFunc ( tcmod - > args [ 0 ] ) ;
t2 = tcmod - > args [ 3 ] + shaderstate . curtime * tcmod - > args [ 4 ] ;
t1 = FTABLE_EVALUATE ( table , t2 ) * tcmod - > args [ 2 ] + tcmod - > args [ 1 ] ;
t1 = t1 ? 1.0f / t1 : 1.0f ;
t2 = 0.5f - 0.5f * t1 ;
for ( j = 0 ; j < cnt ; j + + , dst + = 2 , src + = 2 )
{
dst [ 0 ] = src [ 0 ] * t1 + t2 ;
dst [ 1 ] = src [ 1 ] * t1 + t2 ;
}
break ;
case SHADER_TCMOD_SCROLL :
t1 = tcmod - > args [ 0 ] * shaderstate . curtime ;
t2 = tcmod - > args [ 1 ] * shaderstate . curtime ;
for ( j = 0 ; j < cnt ; j + + , dst + = 2 , src + = 2 )
{
dst [ 0 ] = src [ 0 ] + t1 ;
dst [ 1 ] = src [ 1 ] + t2 ;
}
break ;
case SHADER_TCMOD_TRANSFORM :
for ( j = 0 ; j < cnt ; j + + , dst + = 2 , src + = 2 )
{
t1 = src [ 0 ] ;
t2 = src [ 1 ] ;
dst [ 0 ] = t1 * tcmod - > args [ 0 ] + t2 * tcmod - > args [ 2 ] + tcmod - > args [ 4 ] ;
dst [ 1 ] = t2 * tcmod - > args [ 1 ] + t1 * tcmod - > args [ 3 ] + tcmod - > args [ 5 ] ;
}
break ;
default :
break ;
}
}
2010-11-02 23:17:25 +00:00
static void GenerateTCMods ( const shaderpass_t * pass , float * dest )
2010-05-01 22:47:47 +00:00
{
2010-11-02 23:17:25 +00:00
mesh_t * mesh ;
2011-05-19 13:34:07 +00:00
unsigned int mno ;
// unsigned int fvertex = 0; //unused variable
2010-11-02 23:17:25 +00:00
int i ;
float * src ;
for ( mno = 0 ; mno < shaderstate . nummeshes ; mno + + )
2010-05-01 22:47:47 +00:00
{
2010-11-02 23:17:25 +00:00
mesh = shaderstate . meshlist [ mno ] ;
2012-12-04 19:37:57 +00:00
src = tcgen ( pass , mesh - > numvertexes , dest + mesh - > vbofirstvert * 2 , mesh ) ;
2010-05-01 22:47:47 +00:00
//tcgen might return unmodified info
if ( pass - > numtcmods )
2009-11-07 13:29:15 +00:00
{
2012-12-04 19:37:57 +00:00
tcmod ( & pass - > tcmods [ 0 ] , mesh - > numvertexes , src , dest + mesh - > vbofirstvert * 2 , mesh ) ;
2010-05-01 22:47:47 +00:00
for ( i = 1 ; i < pass - > numtcmods ; i + + )
2009-11-07 13:29:15 +00:00
{
2012-12-04 19:37:57 +00:00
tcmod ( & pass - > tcmods [ i ] , mesh - > numvertexes , dest + mesh - > vbofirstvert * 2 , dest + mesh - > vbofirstvert * 2 , mesh ) ;
2009-11-07 13:29:15 +00:00
}
}
2010-05-01 22:47:47 +00:00
else if ( src ! = dest )
{
2012-12-04 19:37:57 +00:00
memcpy ( dest + mesh - > vbofirstvert * 2 , src , sizeof ( vec2_t ) * mesh - > numvertexes ) ;
2010-05-01 22:47:47 +00:00
}
2012-12-04 19:37:57 +00:00
// dest += mesh->numvertexes*2;
2010-05-01 22:47:47 +00:00
}
}
//end texture coords
/*******************************************************************************************************************/
2011-05-19 13:34:07 +00:00
static void deformgen ( const deformv_t * deformv , int cnt , vecV_t * src , vecV_t * dst , const mesh_t * mesh )
2010-11-10 03:32:47 +00:00
{
float * table ;
int j , k ;
float args [ 4 ] ;
float deflect ;
switch ( deformv - > type )
{
default :
case DEFORMV_NONE :
2011-05-19 13:34:07 +00:00
if ( src ! = dst )
2010-11-10 03:32:47 +00:00
memcpy ( dst , src , sizeof ( * src ) * cnt ) ;
break ;
case DEFORMV_WAVE :
if ( ! mesh - > normals_array )
{
2011-05-19 13:34:07 +00:00
if ( src ! = dst )
2010-11-10 03:32:47 +00:00
memcpy ( dst , src , sizeof ( * src ) * cnt ) ;
return ;
}
args [ 0 ] = deformv - > func . args [ 0 ] ;
args [ 1 ] = deformv - > func . args [ 1 ] ;
args [ 3 ] = deformv - > func . args [ 2 ] + deformv - > func . args [ 3 ] * shaderstate . curtime ;
table = FTableForFunc ( deformv - > func . type ) ;
for ( j = 0 ; j < cnt ; j + + )
{
deflect = deformv - > args [ 0 ] * ( src [ j ] [ 0 ] + src [ j ] [ 1 ] + src [ j ] [ 2 ] ) + args [ 3 ] ;
deflect = FTABLE_EVALUATE ( table , deflect ) * args [ 1 ] + args [ 0 ] ;
// Deflect vertex along its normal by wave amount
VectorMA ( src [ j ] , deflect , mesh - > normals_array [ j ] , dst [ j ] ) ;
}
break ;
case DEFORMV_NORMAL :
//normal does not actually move the verts, but it does change the normals array
//we don't currently support that.
2011-05-19 13:34:07 +00:00
if ( src ! = dst )
2010-11-10 03:32:47 +00:00
memcpy ( dst , src , sizeof ( * src ) * cnt ) ;
/*
args [ 0 ] = deformv - > args [ 1 ] * shaderstate . curtime ;
for ( j = 0 ; j < cnt ; j + + )
{
args [ 1 ] = normalsArray [ j ] [ 2 ] * args [ 0 ] ;
deflect = deformv - > args [ 0 ] * R_FastSin ( args [ 1 ] ) ;
normalsArray [ j ] [ 0 ] * = deflect ;
deflect = deformv - > args [ 0 ] * R_FastSin ( args [ 1 ] + 0.25 ) ;
normalsArray [ j ] [ 1 ] * = deflect ;
VectorNormalizeFast ( normalsArray [ j ] ) ;
}
*/ break ;
case DEFORMV_MOVE :
table = FTableForFunc ( deformv - > func . type ) ;
deflect = deformv - > func . args [ 2 ] + shaderstate . curtime * deformv - > func . args [ 3 ] ;
deflect = FTABLE_EVALUATE ( table , deflect ) * deformv - > func . args [ 1 ] + deformv - > func . args [ 0 ] ;
for ( j = 0 ; j < cnt ; j + + )
VectorMA ( src [ j ] , deflect , deformv - > args , dst [ j ] ) ;
break ;
case DEFORMV_BULGE :
args [ 0 ] = deformv - > args [ 0 ] / ( 2 * M_PI ) ;
args [ 1 ] = deformv - > args [ 1 ] ;
args [ 2 ] = shaderstate . curtime * deformv - > args [ 2 ] / ( 2 * M_PI ) ;
for ( j = 0 ; j < cnt ; j + + )
{
deflect = R_FastSin ( mesh - > st_array [ j ] [ 0 ] * args [ 0 ] + args [ 2 ] ) * args [ 1 ] ;
dst [ j ] [ 0 ] = src [ j ] [ 0 ] + deflect * mesh - > normals_array [ j ] [ 0 ] ;
dst [ j ] [ 1 ] = src [ j ] [ 1 ] + deflect * mesh - > normals_array [ j ] [ 1 ] ;
dst [ j ] [ 2 ] = src [ j ] [ 2 ] + deflect * mesh - > normals_array [ j ] [ 2 ] ;
}
break ;
case DEFORMV_AUTOSPRITE :
if ( mesh - > numindexes < 6 )
break ;
for ( j = 0 ; j < cnt - 3 ; j + = 4 , src + = 4 , dst + = 4 )
{
vec3_t mid , d ;
float radius ;
mid [ 0 ] = 0.25 * ( src [ 0 ] [ 0 ] + src [ 1 ] [ 0 ] + src [ 2 ] [ 0 ] + src [ 3 ] [ 0 ] ) ;
mid [ 1 ] = 0.25 * ( src [ 0 ] [ 1 ] + src [ 1 ] [ 1 ] + src [ 2 ] [ 1 ] + src [ 3 ] [ 1 ] ) ;
mid [ 2 ] = 0.25 * ( src [ 0 ] [ 2 ] + src [ 1 ] [ 2 ] + src [ 2 ] [ 2 ] + src [ 3 ] [ 2 ] ) ;
VectorSubtract ( src [ 0 ] , mid , d ) ;
radius = 2 * VectorLength ( d ) ;
for ( k = 0 ; k < 4 ; k + + )
{
dst [ k ] [ 0 ] = mid [ 0 ] + radius * ( ( mesh - > st_array [ k ] [ 0 ] - 0.5 ) * r_refdef . m_view [ 0 + 0 ] - ( mesh - > st_array [ k ] [ 1 ] - 0.5 ) * r_refdef . m_view [ 0 + 1 ] ) ;
dst [ k ] [ 1 ] = mid [ 1 ] + radius * ( ( mesh - > st_array [ k ] [ 0 ] - 0.5 ) * r_refdef . m_view [ 4 + 0 ] - ( mesh - > st_array [ k ] [ 1 ] - 0.5 ) * r_refdef . m_view [ 4 + 1 ] ) ;
dst [ k ] [ 2 ] = mid [ 2 ] + radius * ( ( mesh - > st_array [ k ] [ 0 ] - 0.5 ) * r_refdef . m_view [ 8 + 0 ] - ( mesh - > st_array [ k ] [ 1 ] - 0.5 ) * r_refdef . m_view [ 8 + 1 ] ) ;
}
}
break ;
case DEFORMV_AUTOSPRITE2 :
if ( mesh - > numindexes < 6 )
break ;
for ( k = 0 ; k < mesh - > numindexes ; k + = 6 )
{
int long_axis , short_axis ;
vec3_t axis ;
float len [ 3 ] ;
mat3_t m0 , m1 , m2 , result ;
float * quad [ 4 ] ;
vec3_t rot_centre , tv ;
quad [ 0 ] = ( float * ) ( dst + mesh - > indexes [ k + 0 ] ) ;
quad [ 1 ] = ( float * ) ( dst + mesh - > indexes [ k + 1 ] ) ;
quad [ 2 ] = ( float * ) ( dst + mesh - > indexes [ k + 2 ] ) ;
for ( j = 2 ; j > = 0 ; j - - )
{
quad [ 3 ] = ( float * ) ( dst + mesh - > indexes [ k + 3 + j ] ) ;
2011-05-19 13:34:07 +00:00
if ( ! VectorEquals ( quad [ 3 ] , quad [ 0 ] ) & &
2010-11-10 03:32:47 +00:00
! VectorEquals ( quad [ 3 ] , quad [ 1 ] ) & &
! VectorEquals ( quad [ 3 ] , quad [ 2 ] ) )
{
break ;
}
}
// build a matrix were the longest axis of the billboard is the Y-Axis
VectorSubtract ( quad [ 1 ] , quad [ 0 ] , m0 [ 0 ] ) ;
VectorSubtract ( quad [ 2 ] , quad [ 0 ] , m0 [ 1 ] ) ;
VectorSubtract ( quad [ 2 ] , quad [ 1 ] , m0 [ 2 ] ) ;
len [ 0 ] = DotProduct ( m0 [ 0 ] , m0 [ 0 ] ) ;
len [ 1 ] = DotProduct ( m0 [ 1 ] , m0 [ 1 ] ) ;
len [ 2 ] = DotProduct ( m0 [ 2 ] , m0 [ 2 ] ) ;
if ( ( len [ 2 ] > len [ 1 ] ) & & ( len [ 2 ] > len [ 0 ] ) )
{
if ( len [ 1 ] > len [ 0 ] )
{
long_axis = 1 ;
short_axis = 0 ;
}
else
{
long_axis = 0 ;
short_axis = 1 ;
}
}
else if ( ( len [ 1 ] > len [ 2 ] ) & & ( len [ 1 ] > len [ 0 ] ) )
{
if ( len [ 2 ] > len [ 0 ] )
{
long_axis = 2 ;
short_axis = 0 ;
}
else
{
long_axis = 0 ;
short_axis = 2 ;
}
}
else //if ( (len[0] > len[1]) && (len[0] > len[2]) )
{
if ( len [ 2 ] > len [ 1 ] )
{
long_axis = 2 ;
short_axis = 1 ;
}
else
{
long_axis = 1 ;
short_axis = 2 ;
}
}
if ( DotProduct ( m0 [ long_axis ] , m0 [ short_axis ] ) )
{
VectorNormalize2 ( m0 [ long_axis ] , axis ) ;
VectorCopy ( axis , m0 [ 1 ] ) ;
if ( axis [ 0 ] | | axis [ 1 ] )
{
VectorVectors ( m0 [ 1 ] , m0 [ 2 ] , m0 [ 0 ] ) ;
}
else
{
VectorVectors ( m0 [ 1 ] , m0 [ 0 ] , m0 [ 2 ] ) ;
}
}
else
{
VectorNormalize2 ( m0 [ long_axis ] , axis ) ;
VectorNormalize2 ( m0 [ short_axis ] , m0 [ 0 ] ) ;
VectorCopy ( axis , m0 [ 1 ] ) ;
CrossProduct ( m0 [ 0 ] , m0 [ 1 ] , m0 [ 2 ] ) ;
}
for ( j = 0 ; j < 3 ; j + + )
rot_centre [ j ] = ( quad [ 0 ] [ j ] + quad [ 1 ] [ j ] + quad [ 2 ] [ j ] + quad [ 3 ] [ j ] ) * 0.25 ;
if ( shaderstate . curentity )
{
VectorAdd ( shaderstate . curentity - > origin , rot_centre , tv ) ;
}
else
{
VectorCopy ( rot_centre , tv ) ;
}
VectorSubtract ( r_origin , tv , tv ) ;
// filter any longest-axis-parts off the camera-direction
deflect = - DotProduct ( tv , axis ) ;
VectorMA ( tv , deflect , axis , m1 [ 2 ] ) ;
VectorNormalizeFast ( m1 [ 2 ] ) ;
VectorCopy ( axis , m1 [ 1 ] ) ;
CrossProduct ( m1 [ 1 ] , m1 [ 2 ] , m1 [ 0 ] ) ;
Matrix3_Transpose ( m1 , m2 ) ;
Matrix3_Multiply ( m2 , m0 , result ) ;
for ( j = 0 ; j < 4 ; j + + )
{
VectorSubtract ( quad [ j ] , rot_centre , tv ) ;
2011-05-19 13:34:07 +00:00
Matrix3_Multiply_Vec3 ( ( void * ) result , tv , quad [ j ] ) ;
2010-11-10 03:32:47 +00:00
VectorAdd ( rot_centre , quad [ j ] , quad [ j ] ) ;
}
}
break ;
// case DEFORMV_PROJECTION_SHADOW:
// break;
}
}
2010-05-01 22:47:47 +00:00
/*does not do the draw call, does not consider indicies (except for billboard generation) */
2010-11-06 23:05:29 +00:00
static qboolean BE_DrawMeshChain_SetupPass ( shaderpass_t * pass , unsigned int vertcount )
2010-05-01 22:47:47 +00:00
{
int vdec ;
void * map ;
int i ;
2010-11-06 23:05:29 +00:00
unsigned int passno = 0 , tmu ;
2010-05-01 22:47:47 +00:00
int lastpass = pass - > numMergedPasses ;
for ( i = 0 ; i < lastpass ; i + + )
{
2015-05-03 19:57:46 +00:00
if ( pass [ i ] . texgen = = T_GEN_UPPEROVERLAY & & ! TEXLOADED ( shaderstate . curtexnums - > upperoverlay ) )
2010-05-01 22:47:47 +00:00
continue ;
2015-05-03 19:57:46 +00:00
if ( pass [ i ] . texgen = = T_GEN_LOWEROVERLAY & & ! TEXLOADED ( shaderstate . curtexnums - > loweroverlay ) )
2010-05-01 22:47:47 +00:00
continue ;
2015-05-03 19:57:46 +00:00
if ( pass [ i ] . texgen = = T_GEN_FULLBRIGHT & & ! TEXLOADED ( shaderstate . curtexnums - > fullbright ) )
2010-05-01 22:47:47 +00:00
continue ;
break ;
}
if ( i = = lastpass )
2010-11-10 03:32:47 +00:00
return false ;
2010-05-01 22:47:47 +00:00
/*all meshes in a chain must have the same features*/
vdec = 0 ;
/*we only use one colour, generated from the first pass*/
2010-10-02 02:25:39 +00:00
vdec | = BE_GenerateColourMods ( vertcount , pass ) ;
2010-05-01 22:47:47 +00:00
2010-11-06 23:05:29 +00:00
tmu = 0 ;
/*activate tmus*/
for ( passno = 0 ; passno < lastpass ; passno + + )
2010-05-01 22:47:47 +00:00
{
2015-05-03 19:57:46 +00:00
if ( pass [ passno ] . texgen = = T_GEN_UPPEROVERLAY & & ! TEXLOADED ( shaderstate . curtexnums - > upperoverlay ) )
2010-11-06 23:05:29 +00:00
continue ;
2015-05-03 19:57:46 +00:00
if ( pass [ passno ] . texgen = = T_GEN_LOWEROVERLAY & & ! TEXLOADED ( shaderstate . curtexnums - > loweroverlay ) )
2010-11-06 23:05:29 +00:00
continue ;
2015-05-03 19:57:46 +00:00
if ( pass [ passno ] . texgen = = T_GEN_FULLBRIGHT & & ! TEXLOADED ( shaderstate . curtexnums - > fullbright ) )
2010-11-06 23:05:29 +00:00
continue ;
SelectPassTexture ( tmu , pass + passno ) ;
2010-05-01 22:47:47 +00:00
2010-11-06 23:05:29 +00:00
vdec | = D3D_VDEC_ST0 < < tmu ;
2011-12-23 03:12:29 +00:00
if ( shaderstate . batchvbo & & pass [ passno ] . tcgen = = TC_GEN_BASE & & ! pass [ passno ] . numtcmods )
2012-07-05 19:42:36 +00:00
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC0 + tmu , shaderstate . batchvbo - > texcoord . d3d . buff , shaderstate . batchvbo - > texcoord . d3d . offs , sizeof ( vbovdata_t ) ) ) ;
2011-12-23 03:12:29 +00:00
else if ( shaderstate . batchvbo & & pass [ passno ] . tcgen = = TC_GEN_LIGHTMAP & & ! pass [ passno ] . numtcmods )
2012-07-05 19:42:36 +00:00
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC0 + tmu , shaderstate . batchvbo - > lmcoord [ 0 ] . d3d . buff , shaderstate . batchvbo - > lmcoord [ 0 ] . d3d . offs , sizeof ( vbovdata_t ) ) ) ;
2011-12-23 03:12:29 +00:00
else
{
allocvertexbuffer ( shaderstate . dynst_buff [ tmu ] , shaderstate . dynst_size , & shaderstate . dynst_offs [ tmu ] , & map , vertcount * sizeof ( vec2_t ) ) ;
GenerateTCMods ( pass + passno , map ) ;
d3dcheck ( IDirect3DVertexBuffer9_Unlock ( shaderstate . dynst_buff [ tmu ] ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC0 + tmu , shaderstate . dynst_buff [ tmu ] , shaderstate . dynst_offs [ tmu ] - vertcount * sizeof ( vec2_t ) , sizeof ( vec2_t ) ) ) ;
}
2010-11-06 23:05:29 +00:00
tmu + + ;
2010-05-01 22:47:47 +00:00
}
2010-11-06 23:05:29 +00:00
/*deactivate any extras*/
2010-11-10 03:32:47 +00:00
for ( ; tmu < shaderstate . lastpasscount ; )
2010-05-01 22:47:47 +00:00
{
2011-09-03 03:49:43 +00:00
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC0 + tmu , NULL , 0 , 0 ) ) ;
2010-11-10 03:32:47 +00:00
BindTexture ( tmu , NULL ) ;
2010-11-06 23:05:29 +00:00
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tmu , D3DTSS_COLOROP , D3DTOP_DISABLE ) ) ;
2013-08-27 13:18:09 +00:00
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , tmu , D3DTSS_ALPHAOP , D3DTOP_DISABLE ) ) ;
2010-11-10 03:32:47 +00:00
tmu + + ;
2010-05-01 22:47:47 +00:00
}
2010-11-06 23:05:29 +00:00
shaderstate . lastpasscount = tmu ;
2010-05-01 22:47:47 +00:00
2011-05-19 13:34:07 +00:00
// if (meshchain->normals_array &&
// meshchain->2 &&
2010-05-01 22:47:47 +00:00
// meshchain->tnormals_array)
// vdec |= D3D_VDEC_NORMS;
if ( vdec ! = shaderstate . curvertdecl )
{
shaderstate . curvertdecl = vdec ;
2010-11-02 23:17:25 +00:00
d3dcheck ( IDirect3DDevice9_SetVertexDeclaration ( pD3DDev9 , vertexdecls [ shaderstate . curvertdecl ] ) ) ;
2010-05-01 22:47:47 +00:00
}
2012-09-30 05:52:03 +00:00
BE_ApplyShaderBits ( pass - > shaderbits ) ;
2010-11-06 23:05:29 +00:00
return true ;
2010-05-01 22:47:47 +00:00
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
static void BE_SubmitMeshChain ( unsigned int vertbase , unsigned int firstvert , unsigned int vertcount , unsigned int idxfirst , int unsigned idxcount )
2011-12-23 03:12:29 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( shaderstate . flags & BEF_LINES )
IDirect3DDevice9_DrawIndexedPrimitive ( pD3DDev9 , D3DPT_LINELIST , vertbase , firstvert , vertcount , idxfirst , idxcount / 2 ) ;
else
IDirect3DDevice9_DrawIndexedPrimitive ( pD3DDev9 , D3DPT_TRIANGLELIST , vertbase , firstvert , vertcount , idxfirst , idxcount / 3 ) ;
RQuantAdd ( RQUANT_DRAWS , 1 ) ;
2011-12-23 03:12:29 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
RQuantAdd ( RQUANT_PRIMITIVEINDICIES , idxcount ) ;
2011-12-23 03:12:29 +00:00
}
2011-09-03 03:49:43 +00:00
static void BE_ApplyUniforms ( program_t * prog , int permu )
{
2012-11-27 03:23:19 +00:00
int h ;
2011-09-03 03:49:43 +00:00
int i ;
2012-11-27 03:23:19 +00:00
IDirect3DDevice9_SetVertexShader ( pD3DDev9 , prog - > permu [ permu ] . handle . hlsl . vert ) ;
IDirect3DDevice9_SetPixelShader ( pD3DDev9 , prog - > permu [ permu ] . handle . hlsl . frag ) ;
2011-09-03 03:49:43 +00:00
for ( i = 0 ; i < prog - > numparams ; i + + )
{
2012-11-27 03:23:19 +00:00
h = prog - > permu [ permu ] . parm [ i ] ;
2011-09-03 03:49:43 +00:00
switch ( prog - > parm [ i ] . type )
{
case SP_M_PROJECTION :
2012-11-27 03:23:19 +00:00
IDirect3DDevice9_SetVertexShaderConstantF ( pD3DDev9 , h , d3d_trueprojection , 4 ) ;
2011-09-03 03:49:43 +00:00
break ;
case SP_M_VIEW :
2012-11-27 03:23:19 +00:00
IDirect3DDevice9_SetVertexShaderConstantF ( pD3DDev9 , h , r_refdef . m_view , 4 ) ;
2011-09-03 03:49:43 +00:00
break ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
case SP_M_MODEL :
IDirect3DDevice9_SetVertexShaderConstantF ( pD3DDev9 , h , shaderstate . m_model , 4 ) ;
break ;
2011-09-03 03:49:43 +00:00
case SP_V_EYEPOS :
2012-11-27 03:23:19 +00:00
IDirect3DDevice9_SetPixelShaderConstantF ( pD3DDev9 , h , r_origin , 1 ) ;
2011-09-03 03:49:43 +00:00
break ;
case SP_E_EYEPOS :
{
vec4_t t2 ;
float m16 [ 16 ] ;
Matrix4x4_CM_ModelMatrixFromAxis ( m16 , shaderstate . curentity - > axis [ 0 ] , shaderstate . curentity - > axis [ 1 ] , shaderstate . curentity - > axis [ 2 ] , shaderstate . curentity - > origin ) ;
Matrix4x4_CM_Transform3 ( m16 , r_origin , t2 ) ;
2012-11-27 03:23:19 +00:00
IDirect3DDevice9_SetPixelShaderConstantF ( pD3DDev9 , h , t2 , 1 ) ;
2011-09-03 03:49:43 +00:00
}
break ;
case SP_E_TIME :
{
vec4_t t1 = { shaderstate . curtime } ;
2012-11-27 03:23:19 +00:00
IDirect3DDevice9_SetPixelShaderConstantF ( pD3DDev9 , h , t1 , 1 ) ;
2011-09-03 03:49:43 +00:00
}
break ;
case SP_M_MODELVIEWPROJECTION :
{
float mv [ 16 ] , mvp [ 16 ] ;
Matrix4_Multiply ( r_refdef . m_view , shaderstate . m_model , mv ) ;
Matrix4_Multiply ( d3d_trueprojection , mv , mvp ) ;
2012-11-27 03:23:19 +00:00
IDirect3DDevice9_SetVertexShaderConstantF ( pD3DDev9 , h , mvp , 4 ) ;
2011-09-03 03:49:43 +00:00
}
break ;
2012-01-01 02:26:42 +00:00
case SP_LIGHTPOSITION :
{
/*light position in model space*/
float inv [ 16 ] ;
vec3_t t2 ;
qboolean Matrix4_Invert ( const float * m , float * out ) ;
Matrix4_Invert ( shaderstate . m_model , inv ) ;
Matrix4x4_CM_Transform3 ( inv , shaderstate . curdlight - > origin , t2 ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
IDirect3DDevice9_SetVertexShaderConstantF ( pD3DDev9 , h , t2 , 1 ) ;
2012-01-01 02:26:42 +00:00
break ;
}
case SP_LIGHTRADIUS :
2012-11-27 03:23:19 +00:00
IDirect3DDevice9_SetPixelShaderConstantF ( pD3DDev9 , h , & shaderstate . curdlight - > radius , 1 ) ;
2012-01-01 02:26:42 +00:00
break ;
case SP_LIGHTCOLOUR :
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
IDirect3DDevice9_SetPixelShaderConstantF ( pD3DDev9 , h , shaderstate . curdlight_colours , 1 ) ;
break ;
case SP_E_L_DIR :
IDirect3DDevice9_SetVertexShaderConstantF ( pD3DDev9 , h , shaderstate . curentity - > light_dir , 1 ) ;
break ;
case SP_E_L_MUL :
IDirect3DDevice9_SetVertexShaderConstantF ( pD3DDev9 , h , shaderstate . curentity - > light_range , 1 ) ;
break ;
case SP_E_L_AMBIENT :
IDirect3DDevice9_SetVertexShaderConstantF ( pD3DDev9 , h , shaderstate . curentity - > light_avg , 1 ) ;
2012-01-01 02:26:42 +00:00
break ;
2011-09-03 03:49:43 +00:00
case SP_E_COLOURS :
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
IDirect3DDevice9_SetPixelShaderConstantF ( pD3DDev9 , h , shaderstate . curentity - > shaderRGBAf , 1 ) ;
break ;
2011-09-03 03:49:43 +00:00
case SP_E_COLOURSIDENT :
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( shaderstate . flags & BEF_FORCECOLOURMOD )
{
vec4_t tmp = { 1 , 1 , 1 , shaderstate . curentity - > shaderRGBAf [ 3 ] } ;
IDirect3DDevice9_SetPixelShaderConstantF ( pD3DDev9 , h , tmp , 1 ) ;
}
else
IDirect3DDevice9_SetPixelShaderConstantF ( pD3DDev9 , h , shaderstate . curentity - > shaderRGBAf , 1 ) ;
break ;
2011-09-03 03:49:43 +00:00
case SP_E_TOPCOLOURS :
case SP_E_BOTTOMCOLOURS :
case SP_M_ENTBONES :
case SP_M_MODELVIEW :
case SP_RENDERTEXTURESCALE :
case SP_FIRSTIMMEDIATE :
case SP_CONSTI :
case SP_CONSTF :
case SP_CVARI :
case SP_CVARF :
case SP_CVAR3F :
case SP_TEXTURE :
Con_Printf ( " shader property %i not implemented \n " , prog - > parm [ i ] . type ) ;
break ;
}
}
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
static void BE_RenderMeshProgram ( shader_t * s , unsigned int vertbase , unsigned int vertfirst , unsigned int vertcount , unsigned int idxfirst , unsigned int idxcount )
2011-03-31 02:32:32 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
int vdec = D3D_VDEC_ST0 | D3D_VDEC_ST1 | D3D_VDEC_NORM ;
2011-09-03 03:49:43 +00:00
int passno ;
2012-01-01 02:26:42 +00:00
int perm = 0 ;
program_t * p = s - > prog ;
2011-03-31 02:32:32 +00:00
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( shaderstate . batchvbo & & shaderstate . batchvbo - > numbones )
{
2014-11-05 05:54:29 +00:00
if ( p - > permu [ perm | PERMUTATION_SKELETAL ] . handle . hlsl . vert )
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
perm | = PERMUTATION_SKELETAL ;
else
return ;
}
2012-11-27 03:23:19 +00:00
if ( TEXVALID ( shaderstate . curtexnums - > bump ) & & p - > permu [ perm | PERMUTATION_BUMPMAP ] . handle . hlsl . vert )
2012-01-01 02:26:42 +00:00
perm | = PERMUTATION_BUMPMAP ;
2012-11-27 03:23:19 +00:00
if ( TEXVALID ( shaderstate . curtexnums - > fullbright ) & & p - > permu [ perm | PERMUTATION_FULLBRIGHT ] . handle . hlsl . vert )
2012-01-01 02:26:42 +00:00
perm | = PERMUTATION_FULLBRIGHT ;
2015-05-03 19:57:46 +00:00
if ( p - > permu [ perm | PERMUTATION_UPPERLOWER ] . handle . hlsl . vert & & ( TEXLOADED ( shaderstate . curtexnums - > upperoverlay ) | | TEXLOADED ( shaderstate . curtexnums - > loweroverlay ) ) )
2012-04-24 07:59:11 +00:00
perm | = PERMUTATION_UPPERLOWER ;
2014-03-30 08:55:06 +00:00
if ( r_refdef . globalfog . density & & p - > permu [ perm | PERMUTATION_FOG ] . handle . hlsl . vert )
2012-01-01 02:26:42 +00:00
perm | = PERMUTATION_FOG ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( p - > permu [ perm | PERMUTATION_FRAMEBLEND ] . handle . hlsl . vert & & shaderstate . batchvbo & & shaderstate . batchvbo - > coord2 . d3d . buff )
perm | = PERMUTATION_FRAMEBLEND ;
2015-05-03 19:57:46 +00:00
// if (p->permu[perm|PERMUTATION_DELUXE].handle.hlsl.vert && TEXVALID(shaderstate.curtexnums->bump) && shaderstate.curbatch->lightmap[0] >= 0 && lightmap[shaderstate.curbatch->lightmap[0]]->hasdeluxe)
// perm |= PERMUTATION_DELUXE;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( shaderstate . curbatch - > lightmap [ 1 ] > = 0 & & p - > permu [ perm | PERMUTATION_LIGHTSTYLES ] . handle . hlsl . vert )
perm | = PERMUTATION_LIGHTSTYLES ;
2011-09-03 03:49:43 +00:00
2012-01-01 02:26:42 +00:00
BE_ApplyUniforms ( p , perm ) ;
2011-09-03 03:49:43 +00:00
2012-01-01 02:26:42 +00:00
2012-09-30 05:52:03 +00:00
BE_ApplyShaderBits ( s - > passes - > shaderbits ) ;
2011-09-03 03:49:43 +00:00
/*activate tmus*/
for ( passno = 0 ; passno < s - > numpasses ; passno + + )
{
SelectPassTexture ( passno , s - > passes + passno ) ;
}
/*deactivate any extras*/
for ( ; passno < shaderstate . lastpasscount ; passno + + )
{
BindTexture ( passno , NULL ) ;
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , passno , D3DTSS_COLOROP , D3DTOP_DISABLE ) ) ;
2013-08-27 13:18:09 +00:00
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , passno , D3DTSS_ALPHAOP , D3DTOP_DISABLE ) ) ;
2011-09-03 03:49:43 +00:00
}
shaderstate . lastpasscount = passno ;
/*colours*/
if ( vdec & D3D_VDEC_COL4B )
{
2011-12-23 03:12:29 +00:00
if ( shaderstate . batchvbo )
2013-08-27 13:18:09 +00:00
{
//fixme
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_COL , shaderstate . batchvbo - > colours [ 0 ] . d3d . buff , shaderstate . batchvbo - > colours [ 0 ] . d3d . offs , sizeof ( vbovdata_t ) ) ) ;
}
2011-12-23 03:12:29 +00:00
else
2011-09-03 03:49:43 +00:00
{
2011-12-23 03:12:29 +00:00
int mno , v ;
void * map ;
mesh_t * m ;
allocvertexbuffer ( shaderstate . dynst_buff [ 0 ] , shaderstate . dynst_size , & shaderstate . dynst_offs [ 0 ] , & map , vertcount * sizeof ( byte_vec4_t ) ) ;
for ( mno = 0 , vertcount = 0 ; mno < shaderstate . nummeshes ; mno + + )
2011-09-03 03:49:43 +00:00
{
2011-12-23 03:12:29 +00:00
byte_vec4_t * dest = ( byte_vec4_t * ) ( ( char * ) map + vertcount * sizeof ( byte_vec4_t ) ) ;
m = shaderstate . meshlist [ mno ] ;
2013-08-27 13:18:09 +00:00
if ( m - > colors4f_array [ 0 ] )
2011-09-03 03:49:43 +00:00
{
2011-12-23 03:12:29 +00:00
for ( v = 0 ; v < m - > numvertexes ; v + + )
{
2013-08-27 13:18:09 +00:00
//fixme:
dest [ v ] [ 0 ] = bound ( 0 , m - > colors4f_array [ 0 ] [ v ] [ 0 ] * 255 , 255 ) ;
dest [ v ] [ 1 ] = bound ( 0 , m - > colors4f_array [ 0 ] [ v ] [ 1 ] * 255 , 255 ) ;
dest [ v ] [ 2 ] = bound ( 0 , m - > colors4f_array [ 0 ] [ v ] [ 2 ] * 255 , 255 ) ;
dest [ v ] [ 3 ] = bound ( 0 , m - > colors4f_array [ 0 ] [ v ] [ 3 ] * 255 , 255 ) ;
2011-12-23 03:12:29 +00:00
}
2011-09-03 03:49:43 +00:00
}
2011-12-23 03:12:29 +00:00
else if ( m - > colors4b_array )
memcpy ( dest , m - > colors4b_array , m - > numvertexes * sizeof ( byte_vec4_t ) ) ;
else
memset ( dest , 0 , m - > numvertexes * sizeof ( byte_vec4_t ) ) ;
vertcount + = m - > numvertexes ;
2011-09-03 03:49:43 +00:00
}
2011-12-23 03:12:29 +00:00
d3dcheck ( IDirect3DVertexBuffer9_Unlock ( shaderstate . dynst_buff [ 0 ] ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC0 , shaderstate . dynst_buff [ 0 ] , shaderstate . dynst_offs [ 0 ] - vertcount * sizeof ( byte_vec4_t ) , sizeof ( byte_vec4_t ) ) ) ;
2011-09-03 03:49:43 +00:00
}
}
/*texture coords*/
if ( vdec & D3D_VDEC_ST0 )
{
2011-12-23 03:12:29 +00:00
if ( shaderstate . batchvbo )
2012-07-05 19:42:36 +00:00
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC0 , shaderstate . batchvbo - > texcoord . d3d . buff , shaderstate . batchvbo - > texcoord . d3d . offs , sizeof ( vbovdata_t ) ) ) ;
2011-12-23 03:12:29 +00:00
else
2011-09-03 03:49:43 +00:00
{
2011-12-23 03:12:29 +00:00
int mno ;
void * map ;
mesh_t * m ;
allocvertexbuffer ( shaderstate . dynst_buff [ 0 ] , shaderstate . dynst_size , & shaderstate . dynst_offs [ 0 ] , & map , vertcount * sizeof ( vec2_t ) ) ;
for ( mno = 0 , vertcount = 0 ; mno < shaderstate . nummeshes ; mno + + )
{
vec2_t * dest = ( vec2_t * ) ( ( char * ) map + vertcount * sizeof ( vec2_t ) ) ;
m = shaderstate . meshlist [ mno ] ;
memcpy ( dest , m - > st_array , m - > numvertexes * sizeof ( vec2_t ) ) ;
vertcount + = m - > numvertexes ;
}
d3dcheck ( IDirect3DVertexBuffer9_Unlock ( shaderstate . dynst_buff [ 0 ] ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC0 , shaderstate . dynst_buff [ 0 ] , shaderstate . dynst_offs [ 0 ] - vertcount * sizeof ( vec2_t ) , sizeof ( vec2_t ) ) ) ;
2011-09-03 03:49:43 +00:00
}
}
/*lm coords*/
if ( vdec & D3D_VDEC_ST1 )
{
2011-12-23 03:12:29 +00:00
if ( shaderstate . batchvbo )
2012-07-05 19:42:36 +00:00
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC1 , shaderstate . batchvbo - > lmcoord [ 0 ] . d3d . buff , shaderstate . batchvbo - > lmcoord [ 0 ] . d3d . offs , sizeof ( vbovdata_t ) ) ) ;
2011-12-23 03:12:29 +00:00
else
2011-09-03 03:49:43 +00:00
{
2011-12-23 03:12:29 +00:00
int mno ;
void * map ;
mesh_t * m ;
allocvertexbuffer ( shaderstate . dynst_buff [ 1 ] , shaderstate . dynst_size , & shaderstate . dynst_offs [ 1 ] , & map , vertcount * sizeof ( vec2_t ) ) ;
for ( mno = 0 , vertcount = 0 ; mno < shaderstate . nummeshes ; mno + + )
{
vec2_t * dest = ( vec2_t * ) ( ( char * ) map + vertcount * sizeof ( vec2_t ) ) ;
m = shaderstate . meshlist [ mno ] ;
memcpy ( dest , m - > lmst_array , m - > numvertexes * sizeof ( vec2_t ) ) ;
vertcount + = m - > numvertexes ;
}
d3dcheck ( IDirect3DVertexBuffer9_Unlock ( shaderstate . dynst_buff [ 1 ] ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC1 , shaderstate . dynst_buff [ 1 ] , shaderstate . dynst_offs [ 1 ] - vertcount * sizeof ( vec2_t ) , sizeof ( vec2_t ) ) ) ;
2011-09-03 03:49:43 +00:00
}
}
/*normals/tangents/bitangents*/
if ( vdec & D3D_VDEC_NORM )
{
2012-01-01 02:26:42 +00:00
if ( shaderstate . batchvbo )
{
2012-07-05 19:42:36 +00:00
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_NORM , shaderstate . batchvbo - > normals . d3d . buff , shaderstate . batchvbo - > normals . d3d . offs , sizeof ( vbovdata_t ) ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_NORMS , shaderstate . batchvbo - > svector . d3d . buff , shaderstate . batchvbo - > svector . d3d . offs , sizeof ( vbovdata_t ) ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_NORMT , shaderstate . batchvbo - > tvector . d3d . buff , shaderstate . batchvbo - > tvector . d3d . offs , sizeof ( vbovdata_t ) ) ) ;
2012-01-01 02:26:42 +00:00
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
else if ( shaderstate . meshlist [ 0 ] - > normals_array & & shaderstate . meshlist [ 0 ] - > snormals_array & & shaderstate . meshlist [ 0 ] - > tnormals_array )
2012-01-01 02:26:42 +00:00
{
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
int mno ;
void * map ;
mesh_t * m ;
int tv = vertcount ;
allocvertexbuffer ( shaderstate . dynnorm_buff , shaderstate . dynnorm_size , & shaderstate . dynnorm_offs , & map , vertcount * 3 * sizeof ( vec3_t ) ) ;
for ( mno = 0 , vertcount = 0 ; mno < shaderstate . nummeshes ; mno + + )
{
float * dest ;
m = shaderstate . meshlist [ mno ] ;
dest = ( float * ) ( ( char * ) map + vertcount * sizeof ( vec3_t ) ) ;
memcpy ( dest , m - > normals_array , m - > numvertexes * sizeof ( vec3_t ) ) ;
dest + = tv * 3 ;
memcpy ( dest , m - > snormals_array , m - > numvertexes * sizeof ( vec3_t ) ) ;
dest + = tv * 3 ;
memcpy ( dest , m - > tnormals_array , m - > numvertexes * sizeof ( vec3_t ) ) ;
vertcount + = m - > numvertexes ;
}
d3dcheck ( IDirect3DVertexBuffer9_Unlock ( shaderstate . dynnorm_buff ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_NORM , shaderstate . dynnorm_buff , shaderstate . dynnorm_offs - vertcount * sizeof ( vec3_t ) * 3 , sizeof ( vec3_t ) ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_NORMS , shaderstate . dynnorm_buff , shaderstate . dynnorm_offs - vertcount * sizeof ( vec3_t ) * 2 , sizeof ( vec3_t ) ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_NORMT , shaderstate . dynnorm_buff , shaderstate . dynnorm_offs - vertcount * sizeof ( vec3_t ) * 1 , sizeof ( vec3_t ) ) ) ;
2012-01-01 02:26:42 +00:00
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
else
vdec & = ~ D3D_VDEC_NORM ;
2011-09-03 03:49:43 +00:00
}
/*bone weights+indexes*/
if ( vdec & D3D_VDEC_SKEL )
{
/*FIXME*/
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
vdec & = ~ D3D_VDEC_SKEL ;
2011-09-03 03:49:43 +00:00
}
if ( vdec ! = shaderstate . curvertdecl )
{
shaderstate . curvertdecl = vdec ;
d3dcheck ( IDirect3DDevice9_SetVertexDeclaration ( pD3DDev9 , vertexdecls [ shaderstate . curvertdecl ] ) ) ;
}
2011-03-31 02:32:32 +00:00
2011-05-19 13:34:07 +00:00
// IDirect3DDevice9_SetVertexShaderConstantF(pD3DDev9,
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
BE_SubmitMeshChain ( vertbase , vertfirst , vertcount , idxfirst , idxcount ) ;
2011-03-31 02:32:32 +00:00
IDirect3DDevice9_SetVertexShader ( pD3DDev9 , NULL ) ;
IDirect3DDevice9_SetPixelShader ( pD3DDev9 , NULL ) ;
}
2012-09-30 05:52:03 +00:00
void D3D9BE_Cull ( unsigned int cullflags )
2010-11-11 18:22:49 +00:00
{
2015-07-31 13:23:32 +00:00
if ( shaderstate . flags & BEF_FORCETWOSIDED )
cullflags = 0 ;
else if ( cullflags )
cullflags ^ = r_refdef . flipcull ;
2010-11-11 18:22:49 +00:00
if ( shaderstate . curcull ! = cullflags )
{
shaderstate . curcull = cullflags ;
if ( shaderstate . curcull & 1 )
{
if ( shaderstate . curcull & SHADER_CULL_FRONT )
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_CULLMODE , D3DCULL_CW ) ;
else if ( shaderstate . curcull & SHADER_CULL_BACK )
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_CULLMODE , D3DCULL_CCW ) ;
else
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_CULLMODE , D3DCULL_NONE ) ;
}
else
{
if ( shaderstate . curcull & SHADER_CULL_FRONT )
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_CULLMODE , D3DCULL_CCW ) ;
else if ( shaderstate . curcull & SHADER_CULL_BACK )
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_CULLMODE , D3DCULL_CW ) ;
else
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_CULLMODE , D3DCULL_NONE ) ;
}
}
}
2010-10-02 02:25:39 +00:00
static void BE_DrawMeshChain_Internal ( void )
2010-05-01 22:47:47 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
unsigned int vertbase , vertfirst , vertcount , idxcount , idxfirst ;
2010-05-01 22:47:47 +00:00
mesh_t * m ;
void * map ;
int i ;
2010-11-02 23:17:25 +00:00
unsigned int mno ;
2010-05-01 22:47:47 +00:00
unsigned int passno = 0 ;
shaderpass_t * pass = shaderstate . curshader - > passes ;
2011-06-16 02:03:57 +00:00
extern cvar_t r_polygonoffset_submodel_factor ;
2011-04-23 20:37:20 +00:00
float pushdepth ;
// float pushfactor;
2010-05-01 22:47:47 +00:00
2012-09-30 05:52:03 +00:00
D3D9BE_Cull ( shaderstate . curshader - > flags & ( SHADER_CULL_FRONT | SHADER_CULL_BACK ) ) ;
2011-06-16 02:03:57 +00:00
pushdepth = ( shaderstate . curshader - > polyoffset . factor + ( ( shaderstate . flags & BEF_PUSHDEPTH ) ? r_polygonoffset_submodel_factor . value : 0 ) ) / 0xffff ;
2011-04-23 20:37:20 +00:00
if ( pushdepth ! = shaderstate . depthbias )
{
shaderstate . depthbias = pushdepth ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_DEPTHBIAS , * ( DWORD * ) & shaderstate . depthbias ) ;
}
// pushdepth = shaderstate.curshader->polyoffset.unit/-1;// + ((shaderstate.flags & BEF_PUSHDEPTH)?8:0);
// pushfactor = shaderstate.curshader->polyoffset.factor/-1;
// if (pushfactor != shaderstate.depthfactor)
// {
// shaderstate.depthfactor = pushfactor;
// IDirect3DDevice9_SetRenderState(pD3DDev9, D3DRS_SLOPESCALEDEPTHBIAS, *(DWORD*)&shaderstate.depthfactor);
// }
2010-11-10 03:32:47 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
//if anything is dynamic ALL must be dynamic
//might want to flag this for multi-mesh batches on pre-t&l cards too, so that there's no gaps.
if ( shaderstate . curshader - > numdeforms )
shaderstate . batchvbo = NULL ;
2011-12-23 03:12:29 +00:00
if ( shaderstate . batchvbo )
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
vertfirst = 0 ;
2011-12-23 03:12:29 +00:00
vertcount = shaderstate . batchvbo - > vertcount ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
idxfirst = 0 ;
2011-12-23 03:12:29 +00:00
idxcount = shaderstate . batchvbo - > indexcount ;
}
else
2010-05-01 22:47:47 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
vertfirst = 0 ;
2011-12-23 03:12:29 +00:00
for ( mno = 0 , vertcount = 0 , idxcount = 0 ; mno < shaderstate . nummeshes ; mno + + )
{
m = shaderstate . meshlist [ mno ] ;
vertcount + = m - > numvertexes ;
idxcount + = m - > numindexes ;
}
2010-05-01 22:47:47 +00:00
}
/*vertex buffers are common to all passes*/
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( shaderstate . batchvbo )
2010-05-01 22:47:47 +00:00
{
2012-07-05 19:42:36 +00:00
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_VERT , shaderstate . batchvbo - > coord . d3d . buff , shaderstate . batchvbo - > coord . d3d . offs , sizeof ( vbovdata_t ) ) ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
vertfirst = 0 ;
2011-12-23 03:12:29 +00:00
}
else
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
vertfirst = 0 ;
2011-12-23 03:12:29 +00:00
allocvertexbuffer ( shaderstate . dynxyz_buff , shaderstate . dynxyz_size , & shaderstate . dynxyz_offs , & map , vertcount * sizeof ( vecV_t ) ) ;
for ( mno = 0 , vertcount = 0 ; mno < shaderstate . nummeshes ; mno + + )
2010-11-10 03:32:47 +00:00
{
2011-12-23 03:12:29 +00:00
vecV_t * dest = ( vecV_t * ) ( ( char * ) map + vertcount * sizeof ( vecV_t ) ) ;
m = shaderstate . meshlist [ mno ] ;
deformgen ( & shaderstate . curshader - > deforms [ 0 ] , m - > numvertexes , m - > xyz_array , dest , m ) ;
for ( i = 1 ; i < shaderstate . curshader - > numdeforms ; i + + )
{
deformgen ( & shaderstate . curshader - > deforms [ i ] , m - > numvertexes , dest , dest , m ) ;
}
vertcount + = m - > numvertexes ;
2010-11-10 03:32:47 +00:00
}
2011-12-23 03:12:29 +00:00
d3dcheck ( IDirect3DVertexBuffer9_Unlock ( shaderstate . dynxyz_buff ) ) ;
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_VERT , shaderstate . dynxyz_buff , shaderstate . dynxyz_offs - vertcount * sizeof ( vecV_t ) , sizeof ( vecV_t ) ) ) ;
2010-05-01 22:47:47 +00:00
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
/*index buffers are also common (note that we may still need to stream these when dealing with bsp geometry, to cope with gaps. this is faster than using multiple draw calls.)*/
2011-12-23 03:12:29 +00:00
if ( shaderstate . batchvbo )
2010-05-01 22:47:47 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( shaderstate . nummeshes ! = 1 )
{ //in this case, the vertex data is static, but the index data can have gaps.
//we're streaming index buffer data only so that we can avoid repeated draw calls. if this stuff was properly built in the first place we wouldn't need to do this. :s
idxcount = 0 ;
for ( mno = 0 ; mno < shaderstate . nummeshes ; mno + + )
{
m = shaderstate . meshlist [ mno ] ;
idxcount + = m - > numindexes ;
}
idxfirst = allocindexbuffer ( & map , idxcount ) ;
for ( mno = 0 ; mno < shaderstate . nummeshes ; mno + + )
{
m = shaderstate . meshlist [ mno ] ;
for ( i = 0 ; i < m - > numindexes ; i + + )
( ( index_t * ) map ) [ i ] = m - > vbofirstvert + m - > indexes [ i ] ;
map = ( char * ) map + m - > numindexes * sizeof ( index_t ) ;
}
d3dcheck ( IDirect3DIndexBuffer9_Unlock ( shaderstate . dynidx_buff ) ) ;
d3dcheck ( IDirect3DDevice9_SetIndices ( pD3DDev9 , shaderstate . dynidx_buff ) ) ;
//we could constrain vertfirst+vertcount, but I suspect those only matter on pre t&l cards, of which there are very few.
vertbase = 0 ;
}
else
{
m = shaderstate . meshlist [ 0 ] ;
vertbase = 0 ; //-m->vbofirstvert;
idxfirst = m - > vbofirstelement ;
idxcount = m - > numindexes ;
vertfirst = m - > vbofirstvert ;
vertcount = m - > numvertexes ;
d3dcheck ( IDirect3DDevice9_SetIndices ( pD3DDev9 , shaderstate . batchvbo - > indicies . d3d . buff ) ) ;
}
2011-12-23 03:12:29 +00:00
}
else
{
idxfirst = allocindexbuffer ( & map , idxcount ) ;
for ( mno = 0 , vertcount = 0 ; mno < shaderstate . nummeshes ; mno + + )
{
m = shaderstate . meshlist [ mno ] ;
for ( i = 0 ; i < m - > numindexes ; i + + )
( ( index_t * ) map ) [ i ] = m - > indexes [ i ] + vertcount ;
map = ( char * ) map + m - > numindexes * sizeof ( index_t ) ;
vertcount + = m - > numvertexes ;
}
d3dcheck ( IDirect3DIndexBuffer9_Unlock ( shaderstate . dynidx_buff ) ) ;
d3dcheck ( IDirect3DDevice9_SetIndices ( pD3DDev9 , shaderstate . dynidx_buff ) ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
vertbase = 0 ;
2010-05-01 22:47:47 +00:00
}
2010-11-11 18:22:49 +00:00
2011-03-31 02:32:32 +00:00
switch ( shaderstate . mode )
2010-05-01 22:47:47 +00:00
{
2012-01-01 02:26:42 +00:00
case BEM_LIGHT :
2012-10-10 22:58:51 +00:00
if ( shaderstate . shader_rtlight - > prog )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
BE_RenderMeshProgram ( shaderstate . shader_rtlight , vertbase , vertfirst , vertcount , idxfirst , idxcount ) ;
break ;
case BEM_DEPTHDARK :
shaderstate . lastpasscount = 0 ;
i = 0 ;
if ( i ! = shaderstate . curvertdecl )
{
shaderstate . curvertdecl = i ;
d3dcheck ( IDirect3DDevice9_SetVertexDeclaration ( pD3DDev9 , vertexdecls [ shaderstate . curvertdecl ] ) ) ;
}
/*deactivate any extras*/
for ( passno = 1 ; passno < shaderstate . lastpasscount ; )
{
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC0 + passno , NULL , 0 , 0 ) ) ;
BindTexture ( passno , NULL ) ;
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , passno , D3DTSS_COLOROP , D3DTOP_DISABLE ) ) ;
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , passno , D3DTSS_ALPHAOP , D3DTOP_DISABLE ) ) ;
passno + + ;
}
BindTexture ( passno , NULL ) ;
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , 0 , D3DTSS_COLOROP , D3DTOP_SELECTARG1 ) ) ;
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , 0 , D3DTSS_COLORARG1 , D3DTA_CONSTANT ) ) ;
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , 0 , D3DTSS_CONSTANT , D3DCOLOR_RGBA ( 0 , 0 , 0 , 255 ) ) ) ;
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , 0 , D3DTSS_ALPHAOP , D3DTOP_DISABLE ) ) ;
shaderstate . lastpasscount = 1 ;
BE_ApplyShaderBits ( SBITS_MISC_DEPTHWRITE ) ;
BE_SubmitMeshChain ( vertbase , vertfirst , vertcount , idxfirst , idxcount ) ;
break ;
case BEM_STENCIL :
2012-01-01 02:26:42 +00:00
break ;
2011-03-31 02:32:32 +00:00
case BEM_DEPTHONLY :
2011-06-22 13:58:35 +00:00
shaderstate . lastpasscount = 0 ;
i = 0 ;
if ( i ! = shaderstate . curvertdecl )
{
shaderstate . curvertdecl = i ;
d3dcheck ( IDirect3DDevice9_SetVertexDeclaration ( pD3DDev9 , vertexdecls [ shaderstate . curvertdecl ] ) ) ;
}
2010-11-11 18:22:49 +00:00
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_COLORWRITEENABLE , 0 ) ;
/*deactivate any extras*/
for ( passno = 0 ; passno < shaderstate . lastpasscount ; )
{
2011-09-03 03:49:43 +00:00
d3dcheck ( IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_TC0 + passno , NULL , 0 , 0 ) ) ;
2010-11-11 18:22:49 +00:00
BindTexture ( passno , NULL ) ;
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , passno , D3DTSS_COLOROP , D3DTOP_DISABLE ) ) ;
2013-08-27 13:18:09 +00:00
d3dcheck ( IDirect3DDevice9_SetTextureStageState ( pD3DDev9 , passno , D3DTSS_ALPHAOP , D3DTOP_DISABLE ) ) ;
2010-11-11 18:22:49 +00:00
passno + + ;
}
shaderstate . lastpasscount = 0 ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
BE_ApplyShaderBits ( SBITS_MISC_DEPTHWRITE ) ;
BE_SubmitMeshChain ( vertbase , vertfirst , vertcount , idxfirst , idxcount ) ;
2010-11-11 18:22:49 +00:00
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_COLORWRITEENABLE , D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_ALPHA ) ;
2011-03-31 02:32:32 +00:00
break ;
default :
case BEM_STANDARD :
if ( shaderstate . curshader - > prog )
2010-11-11 18:22:49 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
BE_RenderMeshProgram ( shaderstate . curshader , vertbase , vertfirst , vertcount , idxfirst , idxcount ) ;
2011-03-31 02:32:32 +00:00
}
else
{
/*now go through and flush each pass*/
for ( passno = 0 ; passno < shaderstate . curshader - > numpasses ; passno + = pass - > numMergedPasses )
{
if ( ! BE_DrawMeshChain_SetupPass ( pass + passno , vertcount ) )
continue ;
# ifdef BENCH
shaderstate . bench . draws + + ;
if ( shaderstate . bench . clamp & & shaderstate . bench . clamp < shaderstate . bench . draws )
continue ;
# endif
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
BE_SubmitMeshChain ( vertbase , vertfirst , vertcount , idxfirst , idxcount ) ;
2011-12-23 03:12:29 +00:00
// d3dcheck(IDirect3DDevice9_DrawIndexedPrimitive(pD3DDev9, D3DPT_TRIANGLELIST, 0, 0, vertcount, idxfirst, idxcount/3));
2011-03-31 02:32:32 +00:00
}
2010-11-11 18:22:49 +00:00
}
2011-03-31 02:32:32 +00:00
break ;
2009-11-04 21:44:48 +00:00
}
2009-11-07 13:29:15 +00:00
}
2009-11-04 21:44:48 +00:00
2012-09-30 05:52:03 +00:00
void D3D9BE_SelectMode ( backendmode_t mode )
2009-11-04 21:44:48 +00:00
{
2010-11-02 23:17:25 +00:00
shaderstate . mode = mode ;
2012-01-01 02:26:42 +00:00
if ( mode = = BEM_STENCIL )
2012-09-30 05:52:03 +00:00
BE_ApplyShaderBits ( SBITS_MASK_BITS ) ;
2012-01-01 02:26:42 +00:00
}
2014-10-05 20:04:11 +00:00
qboolean D3D9BE_SelectDLight ( dlight_t * dl , vec3_t colour , vec3_t axis [ 3 ] , unsigned int lmode )
2012-01-01 02:26:42 +00:00
{
shaderstate . curdlight = dl ;
VectorCopy ( colour , shaderstate . curdlight_colours ) ;
2013-10-08 16:13:18 +00:00
if ( lmode ! = LSHADER_STANDARD )
return false ;
return true ;
2012-01-01 02:26:42 +00:00
}
2012-09-30 05:52:03 +00:00
void D3D9BE_SelectEntity ( entity_t * ent )
2012-01-01 02:26:42 +00:00
{
shaderstate . curentity = ent ;
BE_RotateForEntity ( ent , ent - > model ) ;
2009-11-04 21:44:48 +00:00
}
2012-07-05 19:42:36 +00:00
# if 1
2012-09-30 05:52:03 +00:00
static void D3D9BE_GenBatchVBOs ( vbo_t * * vbochain , batch_t * firstbatch , batch_t * stopbatch )
2012-07-05 19:42:36 +00:00
{
int maxvboelements ;
int maxvboverts ;
int vert = 0 , idx = 0 ;
batch_t * batch ;
vbo_t * vbo ;
int i , j ;
mesh_t * m ;
IDirect3DVertexBuffer9 * vbuff ;
IDirect3DIndexBuffer9 * ebuff ;
index_t * vboedata ;
vbovdata_t * vbovdata ;
vbo = Z_Malloc ( sizeof ( * vbo ) ) ;
maxvboverts = 0 ;
maxvboelements = 0 ;
for ( batch = firstbatch ; batch ! = stopbatch ; batch = batch - > next )
{
for ( i = 0 ; i < batch - > maxmeshes ; i + + )
{
m = batch - > mesh [ i ] ;
maxvboelements + = m - > numindexes ;
maxvboverts + = m - > numvertexes ;
}
}
IDirect3DDevice9_CreateIndexBuffer ( pD3DDev9 , sizeof ( index_t ) * maxvboelements , 0 , D3DFMT_QINDEX , D3DPOOL_MANAGED , & ebuff , NULL ) ;
IDirect3DDevice9_CreateVertexBuffer ( pD3DDev9 , sizeof ( * vbovdata ) * maxvboverts , D3DUSAGE_WRITEONLY , 0 , D3DPOOL_MANAGED , & vbuff , NULL ) ;
vbovdata = NULL ;
vbo - > coord . d3d . buff = vbuff ;
vbo - > coord . d3d . offs = ( quintptr_t ) & vbovdata - > coord ;
vbo - > texcoord . d3d . buff = vbuff ;
vbo - > texcoord . d3d . offs = ( quintptr_t ) & vbovdata - > tex ;
vbo - > lmcoord [ 0 ] . d3d . buff = vbuff ;
vbo - > lmcoord [ 0 ] . d3d . offs = ( quintptr_t ) & vbovdata - > lm ;
vbo - > normals . d3d . buff = vbuff ;
vbo - > normals . d3d . offs = ( quintptr_t ) & vbovdata - > ndir ;
vbo - > svector . d3d . buff = vbuff ;
vbo - > svector . d3d . offs = ( quintptr_t ) & vbovdata - > sdir ;
vbo - > tvector . d3d . buff = vbuff ;
vbo - > tvector . d3d . offs = ( quintptr_t ) & vbovdata - > tdir ;
2013-08-27 13:18:09 +00:00
vbo - > colours [ 0 ] . d3d . buff = vbuff ;
vbo - > colours [ 0 ] . d3d . offs = ( quintptr_t ) & vbovdata - > colorsb ;
2012-07-05 19:42:36 +00:00
vbo - > indicies . d3d . buff = ebuff ;
vbo - > indicies . d3d . offs = 0 ;
IDirect3DIndexBuffer9_Lock ( ebuff , 0 , sizeof ( index_t ) * maxvboelements , & vboedata , D3DLOCK_DISCARD ) ;
IDirect3DVertexBuffer9_Lock ( vbuff , 0 , sizeof ( * vbovdata ) * maxvboverts , & vbovdata , D3DLOCK_DISCARD ) ;
for ( batch = firstbatch ; batch ! = stopbatch ; batch = batch - > next )
{
batch - > vbo = vbo ;
for ( j = 0 ; j < batch - > maxmeshes ; j + + )
{
m = batch - > mesh [ j ] ;
m - > vbofirstvert = vert ;
for ( i = 0 ; i < m - > numvertexes ; i + + )
{
VectorCopy ( m - > xyz_array [ i ] , vbovdata - > coord ) ;
vbovdata - > coord [ 3 ] = 1 ;
Vector2Copy ( m - > st_array [ i ] , vbovdata - > tex ) ;
Vector2Copy ( m - > lmst_array [ 0 ] [ i ] , vbovdata - > lm ) ;
VectorCopy ( m - > normals_array [ i ] , vbovdata - > ndir ) ;
VectorCopy ( m - > snormals_array [ i ] , vbovdata - > sdir ) ;
VectorCopy ( m - > tnormals_array [ i ] , vbovdata - > tdir ) ;
2013-08-27 13:18:09 +00:00
Vector4Scale ( m - > colors4f_array [ 0 ] [ i ] , 255 , vbovdata - > colorsb ) ;
2012-07-05 19:42:36 +00:00
vbovdata + + ;
}
m - > vbofirstelement = idx ;
for ( i = 0 ; i < m - > numindexes ; i + + )
{
* vboedata + + = vert + m - > indexes [ i ] ;
}
idx + = m - > numindexes ;
vert + = m - > numvertexes ;
}
}
2012-12-04 19:37:57 +00:00
vbo - > indexcount = idx ;
vbo - > vertcount = vert ;
2012-07-05 19:42:36 +00:00
IDirect3DIndexBuffer9_Unlock ( ebuff ) ;
IDirect3DVertexBuffer9_Unlock ( vbuff ) ;
vbo - > next = * vbochain ;
* vbochain = vbo ;
}
2012-09-30 05:52:03 +00:00
void D3D9BE_GenBrushModelVBO ( model_t * mod )
2012-07-05 19:42:36 +00:00
{
unsigned int vcount ;
batch_t * batch , * fbatch ;
int sortid ;
int i ;
fbatch = NULL ;
vcount = 0 ;
for ( sortid = 0 ; sortid < SHADER_SORT_COUNT ; sortid + + )
{
if ( ! mod - > batches [ sortid ] )
continue ;
for ( fbatch = batch = mod - > batches [ sortid ] ; batch ! = NULL ; batch = batch - > next )
{
//firstmesh got reused as the number of verticies in each batch
if ( vcount + batch - > firstmesh > MAX_INDICIES )
{
2012-09-30 05:52:03 +00:00
D3D9BE_GenBatchVBOs ( & mod - > vbos , fbatch , batch ) ;
2012-07-05 19:42:36 +00:00
fbatch = batch ;
vcount = 0 ;
}
for ( i = 0 ; i < batch - > maxmeshes ; i + + )
vcount + = batch - > mesh [ i ] - > numvertexes ;
}
2012-09-30 05:52:03 +00:00
D3D9BE_GenBatchVBOs ( & mod - > vbos , fbatch , batch ) ;
2012-07-05 19:42:36 +00:00
}
}
# else
2009-11-07 13:29:15 +00:00
/*Generates an optimised vbo for each of the given model's textures*/
2012-09-30 05:52:03 +00:00
void D3D9BE_GenBrushModelVBO ( model_t * mod )
2009-11-07 13:29:15 +00:00
{
2012-07-05 19:42:36 +00:00
# if 1
2010-05-01 22:47:47 +00:00
unsigned int maxvboverts ;
unsigned int maxvboelements ;
unsigned int t ;
unsigned int i ;
unsigned int v ;
unsigned int vcount , ecount ;
unsigned int pervertsize ; //erm, that name wasn't intentional
unsigned int meshes ;
vbo_t * vbo ;
2011-12-23 03:12:29 +00:00
index_t * vboedata ;
2010-05-01 22:47:47 +00:00
mesh_t * m ;
char * vbovdata ;
2011-12-23 03:12:29 +00:00
IDirect3DVertexBuffer9 * vbuff ;
IDirect3DIndexBuffer9 * ebuff ;
vecV_t * coord ;
vec2_t * texcoord ;
vec2_t * lmcoord ;
vec3_t * normals ;
vec3_t * svector ;
vec3_t * tvector ;
byte_vec4_t * colours ;
2011-05-19 13:34:07 +00:00
2010-05-01 22:47:47 +00:00
if ( ! mod - > numsurfaces )
return ;
for ( t = 0 ; t < mod - > numtextures ; t + + )
{
if ( ! mod - > textures [ t ] )
continue ;
vbo = & mod - > textures [ t ] - > vbo ;
BE_ClearVBO ( vbo ) ;
maxvboverts = 0 ;
maxvboelements = 0 ;
meshes = 0 ;
for ( i = 0 ; i < mod - > numsurfaces ; i + + )
{
if ( mod - > surfaces [ i ] . texinfo - > texture ! = mod - > textures [ t ] )
continue ;
m = mod - > surfaces [ i ] . mesh ;
if ( ! m )
continue ;
meshes + + ;
maxvboelements + = m - > numindexes ;
maxvboverts + = m - > numvertexes ;
}
# if sizeof_index_t == 2
2012-07-05 19:42:36 +00:00
if ( maxvboverts > ( 1u < < ( sizeof ( index_t ) * 8 ) ) - 1 )
2010-05-01 22:47:47 +00:00
continue ;
# endif
if ( ! maxvboverts )
continue ;
//fixme: stop this from leaking!
vcount = 0 ;
ecount = 0 ;
pervertsize = sizeof ( vecV_t ) + //coord
sizeof ( vec2_t ) + //tex
sizeof ( vec2_t ) + //lm
sizeof ( vec3_t ) + //normal
sizeof ( vec3_t ) + //sdir
sizeof ( vec3_t ) + //tdir
sizeof ( vec4_t ) ; //colours
2011-12-23 03:12:29 +00:00
IDirect3DDevice9_CreateIndexBuffer ( pD3DDev9 , sizeof ( index_t ) * maxvboelements , 0 , D3DFMT_QINDEX , D3DPOOL_MANAGED , & ebuff , NULL ) ;
IDirect3DDevice9_CreateVertexBuffer ( pD3DDev9 , pervertsize * maxvboverts , D3DUSAGE_WRITEONLY , 0 , D3DPOOL_MANAGED , & vbuff , NULL ) ;
IDirect3DIndexBuffer9_Lock ( ebuff , 0 , sizeof ( index_t ) * maxvboelements , & vboedata , D3DLOCK_DISCARD ) ;
IDirect3DVertexBuffer9_Lock ( vbuff , 0 , pervertsize * maxvboverts , & vbovdata , D3DLOCK_DISCARD ) ;
vbo - > vertdata = vbuff ;
vbo - > indexcount = maxvboelements ;
vbo - > vertcount = maxvboverts ;
vbo - > coord . d3d . buff = vbuff ;
vbo - > coord . d3d . offs = 0 ;
vbo - > texcoord . d3d . buff = vbuff ;
vbo - > texcoord . d3d . offs = vbo - > coord . d3d . offs + maxvboverts * sizeof ( vecV_t ) ;
vbo - > lmcoord . d3d . buff = vbuff ;
vbo - > lmcoord . d3d . offs = vbo - > texcoord . d3d . offs + maxvboverts * sizeof ( vec2_t ) ;
vbo - > normals . d3d . buff = vbuff ;
vbo - > normals . d3d . offs = vbo - > lmcoord . d3d . offs + maxvboverts * sizeof ( vec2_t ) ;
vbo - > svector . d3d . buff = vbuff ;
vbo - > svector . d3d . offs = vbo - > normals . d3d . offs + maxvboverts * sizeof ( vec3_t ) ;
vbo - > tvector . d3d . buff = vbuff ;
vbo - > tvector . d3d . offs = vbo - > svector . d3d . offs + maxvboverts * sizeof ( vec3_t ) ;
vbo - > colours . d3d . buff = vbuff ;
vbo - > colours . d3d . offs = vbo - > tvector . d3d . offs + maxvboverts * sizeof ( vec3_t ) ;
vbo - > indicies . d3d . buff = ebuff ;
vbo - > indicies . d3d . offs = 0 ;
coord = ( void * ) ( vbovdata + vbo - > coord . d3d . offs ) ;
texcoord = ( void * ) ( vbovdata + vbo - > texcoord . d3d . offs ) ;
lmcoord = ( void * ) ( vbovdata + vbo - > lmcoord . d3d . offs ) ;
normals = ( void * ) ( vbovdata + vbo - > normals . d3d . offs ) ;
svector = ( void * ) ( vbovdata + vbo - > svector . d3d . offs ) ;
tvector = ( void * ) ( vbovdata + vbo - > tvector . d3d . offs ) ;
colours = ( void * ) ( vbovdata + vbo - > colours . d3d . offs ) ;
2010-05-01 22:47:47 +00:00
vbo - > meshcount = meshes ;
vbo - > meshlist = BZ_Malloc ( meshes * sizeof ( * vbo - > meshlist ) ) ;
meshes = 0 ;
for ( i = 0 ; i < mod - > numsurfaces ; i + + )
{
if ( mod - > surfaces [ i ] . texinfo - > texture ! = mod - > textures [ t ] )
continue ;
m = mod - > surfaces [ i ] . mesh ;
if ( ! m )
continue ;
mod - > surfaces [ i ] . mark = & vbo - > meshlist [ meshes + + ] ;
* mod - > surfaces [ i ] . mark = NULL ;
m - > vbofirstvert = vcount ;
m - > vbofirstelement = ecount ;
for ( v = 0 ; v < m - > numindexes ; v + + )
2011-12-23 03:12:29 +00:00
vboedata [ ecount + + ] = vcount + m - > indexes [ v ] ;
2010-05-01 22:47:47 +00:00
for ( v = 0 ; v < m - > numvertexes ; v + + )
{
2011-12-23 03:12:29 +00:00
coord [ vcount + v ] [ 0 ] = m - > xyz_array [ v ] [ 0 ] ;
coord [ vcount + v ] [ 1 ] = m - > xyz_array [ v ] [ 1 ] ;
coord [ vcount + v ] [ 2 ] = m - > xyz_array [ v ] [ 2 ] ;
coord [ vcount + v ] [ 3 ] = 1 ;
2010-05-01 22:47:47 +00:00
if ( m - > st_array )
{
2011-12-23 03:12:29 +00:00
texcoord [ vcount + v ] [ 0 ] = m - > st_array [ v ] [ 0 ] ;
texcoord [ vcount + v ] [ 1 ] = m - > st_array [ v ] [ 1 ] ;
2010-05-01 22:47:47 +00:00
}
if ( m - > lmst_array )
{
2011-12-23 03:12:29 +00:00
lmcoord [ vcount + v ] [ 0 ] = m - > lmst_array [ v ] [ 0 ] ;
lmcoord [ vcount + v ] [ 1 ] = m - > lmst_array [ v ] [ 1 ] ;
2010-05-01 22:47:47 +00:00
}
if ( m - > normals_array )
{
2011-12-23 03:12:29 +00:00
normals [ vcount + v ] [ 0 ] = m - > normals_array [ v ] [ 0 ] ;
normals [ vcount + v ] [ 1 ] = m - > normals_array [ v ] [ 1 ] ;
normals [ vcount + v ] [ 2 ] = m - > normals_array [ v ] [ 2 ] ;
2010-05-01 22:47:47 +00:00
}
if ( m - > snormals_array )
{
2011-12-23 03:12:29 +00:00
svector [ vcount + v ] [ 0 ] = m - > snormals_array [ v ] [ 0 ] ;
svector [ vcount + v ] [ 1 ] = m - > snormals_array [ v ] [ 1 ] ;
svector [ vcount + v ] [ 2 ] = m - > snormals_array [ v ] [ 2 ] ;
2010-05-01 22:47:47 +00:00
}
if ( m - > tnormals_array )
{
2011-12-23 03:12:29 +00:00
tvector [ vcount + v ] [ 0 ] = m - > tnormals_array [ v ] [ 0 ] ;
tvector [ vcount + v ] [ 1 ] = m - > tnormals_array [ v ] [ 1 ] ;
tvector [ vcount + v ] [ 2 ] = m - > tnormals_array [ v ] [ 2 ] ;
}
if ( m - > colors4b_array )
{
colours [ vcount + v ] [ 0 ] = m - > colors4b_array [ v ] [ 0 ] ;
colours [ vcount + v ] [ 1 ] = m - > colors4b_array [ v ] [ 1 ] ;
colours [ vcount + v ] [ 2 ] = m - > colors4b_array [ v ] [ 2 ] ;
colours [ vcount + v ] [ 3 ] = m - > colors4b_array [ v ] [ 3 ] ;
2010-05-01 22:47:47 +00:00
}
2013-08-27 13:18:09 +00:00
if ( m - > colors4f_array [ 0 ] )
2010-05-01 22:47:47 +00:00
{
2013-08-27 13:18:09 +00:00
colours [ vcount + v ] [ 0 ] = m - > colors4f_array [ 0 ] [ v ] [ 0 ] * 255 ;
colours [ vcount + v ] [ 1 ] = m - > colors4f_array [ 0 ] [ v ] [ 1 ] * 255 ;
colours [ vcount + v ] [ 2 ] = m - > colors4f_array [ 0 ] [ v ] [ 2 ] * 255 ;
colours [ vcount + v ] [ 3 ] = m - > colors4f_array [ 0 ] [ v ] [ 3 ] * 255 ;
2010-05-01 22:47:47 +00:00
}
}
vcount + = v ;
}
2011-12-23 03:12:29 +00:00
IDirect3DIndexBuffer9_Unlock ( ebuff ) ;
IDirect3DVertexBuffer9_Unlock ( vbuff ) ;
2010-05-01 22:47:47 +00:00
}
2012-05-09 15:30:53 +00:00
# endif
2009-11-07 13:29:15 +00:00
}
2012-07-05 19:42:36 +00:00
# endif
2009-11-07 13:29:15 +00:00
/*Wipes a vbo*/
2012-09-30 05:52:03 +00:00
void D3D9BE_ClearVBO ( vbo_t * vbo )
2009-11-04 21:44:48 +00:00
{
2012-07-05 19:42:36 +00:00
IDirect3DVertexBuffer9 * vbuff = vbo - > coord . d3d . buff ;
2011-12-23 03:12:29 +00:00
IDirect3DIndexBuffer9 * ebuff = vbo - > indicies . d3d . buff ;
if ( vbuff )
IDirect3DVertexBuffer9_Release ( vbuff ) ;
if ( ebuff )
IDirect3DIndexBuffer9_Release ( ebuff ) ;
2012-07-05 19:42:36 +00:00
vbo - > coord . d3d . buff = NULL ;
2011-12-23 03:12:29 +00:00
vbo - > indicies . d3d . buff = NULL ;
2012-07-05 19:42:36 +00:00
free ( vbo ) ;
2009-11-04 23:20:50 +00:00
}
2009-11-07 13:29:15 +00:00
/*upload all lightmaps at the start to reduce lags*/
2012-09-30 05:52:03 +00:00
static void BE_UploadLightmaps ( qboolean force )
2009-11-07 13:29:15 +00:00
{
int i ;
2012-07-05 19:42:36 +00:00
lightmapinfo_t * lm ;
2009-11-07 13:29:15 +00:00
2010-11-02 23:17:25 +00:00
for ( i = 0 ; i < numlightmaps ; i + + )
2009-11-07 13:29:15 +00:00
{
2012-07-05 19:42:36 +00:00
lm = lightmap [ i ] ;
if ( ! lm )
2009-11-07 13:29:15 +00:00
continue ;
2010-11-02 23:17:25 +00:00
if ( force )
2009-11-07 13:29:15 +00:00
{
2012-07-05 19:42:36 +00:00
lm - > rectchange . l = 0 ;
lm - > rectchange . t = 0 ;
2012-07-07 05:17:43 +00:00
lm - > rectchange . w = lm - > width ;
lm - > rectchange . h = lm - > height ;
2009-11-07 13:29:15 +00:00
}
2010-05-01 22:47:47 +00:00
2009-11-07 13:29:15 +00:00
if ( lightmap [ i ] - > modified )
{
2014-10-05 20:04:11 +00:00
extern cvar_t gl_lightmap_nearest ;
IDirect3DTexture9 * tex ;
2010-05-01 22:47:47 +00:00
D3DLOCKED_RECT lock ;
RECT rect ;
2012-07-05 19:42:36 +00:00
glRect_t * theRect = & lm - > rectchange ;
2010-05-01 22:47:47 +00:00
int r ;
2014-10-05 20:04:11 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( ! TEXLOADED ( lm - > lightmap_texture ) )
lm - > lightmap_texture = Image_CreateTexture ( " ***lightmap*** " , NULL , ( gl_lightmap_nearest . ival ? IF_NEAREST : IF_LINEAR ) | IF_NOMIPMAP ) ;
2014-10-05 20:04:11 +00:00
tex = lm - > lightmap_texture - > ptr ;
2011-10-27 16:16:29 +00:00
if ( ! tex )
2010-05-01 22:47:47 +00:00
{
2014-10-05 20:04:11 +00:00
IDirect3DDevice9_CreateTexture ( pD3DDev9 , lm - > width , lm - > height , 1 , 0 , D3DFMT_A8R8G8B8 , D3DPOOL_MANAGED , & tex , NULL ) ;
2011-10-27 16:16:29 +00:00
if ( ! tex )
continue ;
2014-10-05 20:04:11 +00:00
lm - > lightmap_texture - > ptr = tex ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
lm - > lightmap_texture - > status = TEX_LOADED ;
2010-05-01 22:47:47 +00:00
}
2011-10-27 16:16:29 +00:00
2012-07-05 19:42:36 +00:00
lm - > modified = 0 ;
2011-10-27 16:16:29 +00:00
rect . left = theRect - > l ;
rect . right = theRect - > l + theRect - > w ;
rect . top = theRect - > t ;
rect . bottom = theRect - > t + theRect - > h ;
IDirect3DTexture9_LockRect ( tex , 0 , & lock , & rect , 0 ) ;
for ( r = 0 ; r < lightmap [ i ] - > rectchange . h ; r + + )
{
2012-07-07 05:17:43 +00:00
memcpy ( ( char * ) lock . pBits + r * lock . Pitch , lightmap [ i ] - > lightmaps + ( theRect - > l + ( ( r + theRect - > t ) * lm - > width ) ) * lightmap_bytes , lightmap [ i ] - > rectchange . w * lightmap_bytes ) ;
2011-10-27 16:16:29 +00:00
}
IDirect3DTexture9_UnlockRect ( tex , 0 ) ;
2012-07-07 05:17:43 +00:00
theRect - > l = lm - > width ;
theRect - > t = lm - > height ;
2011-10-27 16:16:29 +00:00
theRect - > h = 0 ;
theRect - > w = 0 ;
2010-11-02 23:17:25 +00:00
}
}
}
2010-05-01 22:47:47 +00:00
2012-09-30 05:52:03 +00:00
void D3D9BE_UploadAllLightmaps ( void )
2010-11-02 23:17:25 +00:00
{
BE_UploadLightmaps ( true ) ;
}
2012-09-30 05:52:03 +00:00
qboolean D3D9BE_LightCullModel ( vec3_t org , model_t * model )
2010-11-02 23:17:25 +00:00
{
# ifdef RTLIGHTS
if ( ( shaderstate . mode = = BEM_LIGHT | | shaderstate . mode = = BEM_STENCIL ) )
{
/*true if hidden from current light*/
/*we have no rtlight support, so mneh*/
}
# endif
return false ;
}
2012-09-30 05:52:03 +00:00
batch_t * D3D9BE_GetTempBatch ( void )
2010-11-02 23:17:25 +00:00
{
2010-11-06 23:05:29 +00:00
if ( shaderstate . wbatch > = shaderstate . maxwbatches )
{
shaderstate . wbatch + + ;
return NULL ;
}
return & shaderstate . wbatches [ shaderstate . wbatch + + ] ;
2010-11-02 23:17:25 +00:00
}
static void BE_RotateForEntity ( const entity_t * e , const model_t * mod )
{
float mv [ 16 ] ;
2011-09-03 03:49:43 +00:00
float * m = shaderstate . m_model ;
2010-11-02 23:17:25 +00:00
2010-11-11 18:22:49 +00:00
shaderstate . curentity = e ;
2010-11-02 23:17:25 +00:00
m [ 0 ] = e - > axis [ 0 ] [ 0 ] ;
m [ 1 ] = e - > axis [ 0 ] [ 1 ] ;
m [ 2 ] = e - > axis [ 0 ] [ 2 ] ;
m [ 3 ] = 0 ;
m [ 4 ] = e - > axis [ 1 ] [ 0 ] ;
m [ 5 ] = e - > axis [ 1 ] [ 1 ] ;
m [ 6 ] = e - > axis [ 1 ] [ 2 ] ;
m [ 7 ] = 0 ;
m [ 8 ] = e - > axis [ 2 ] [ 0 ] ;
m [ 9 ] = e - > axis [ 2 ] [ 1 ] ;
m [ 10 ] = e - > axis [ 2 ] [ 2 ] ;
m [ 11 ] = 0 ;
m [ 12 ] = e - > origin [ 0 ] ;
m [ 13 ] = e - > origin [ 1 ] ;
m [ 14 ] = e - > origin [ 2 ] ;
m [ 15 ] = 1 ;
if ( e - > scale ! = 1 & & e - > scale ! = 0 ) //hexen 2 stuff
{
2014-09-17 03:04:08 +00:00
# ifdef HEXEN2
2010-11-02 23:17:25 +00:00
float z ;
float escale ;
escale = e - > scale ;
switch ( e - > drawflags & SCALE_TYPE_MASKIN )
{
default :
case SCALE_TYPE_UNIFORM :
VectorScale ( ( m + 0 ) , escale , ( m + 0 ) ) ;
VectorScale ( ( m + 4 ) , escale , ( m + 4 ) ) ;
VectorScale ( ( m + 8 ) , escale , ( m + 8 ) ) ;
break ;
case SCALE_TYPE_XYONLY :
VectorScale ( ( m + 0 ) , escale , ( m + 0 ) ) ;
VectorScale ( ( m + 4 ) , escale , ( m + 4 ) ) ;
break ;
case SCALE_TYPE_ZONLY :
VectorScale ( ( m + 8 ) , escale , ( m + 8 ) ) ;
break ;
}
if ( mod & & ( e - > drawflags & SCALE_TYPE_MASKIN ) ! = SCALE_TYPE_XYONLY )
{
switch ( e - > drawflags & SCALE_ORIGIN_MASKIN )
2009-11-07 13:29:15 +00:00
{
2010-11-02 23:17:25 +00:00
case SCALE_ORIGIN_CENTER :
z = ( ( mod - > maxs [ 2 ] + mod - > mins [ 2 ] ) * ( 1 - escale ) ) / 2 ;
VectorMA ( ( m + 12 ) , z , e - > axis [ 2 ] , ( m + 12 ) ) ;
break ;
case SCALE_ORIGIN_BOTTOM :
VectorMA ( ( m + 12 ) , mod - > mins [ 2 ] * ( 1 - escale ) , e - > axis [ 2 ] , ( m + 12 ) ) ;
break ;
case SCALE_ORIGIN_TOP :
VectorMA ( ( m + 12 ) , - mod - > maxs [ 2 ] , e - > axis [ 2 ] , ( m + 12 ) ) ;
break ;
2009-11-07 13:29:15 +00:00
}
}
2014-09-17 03:04:08 +00:00
# else
VectorScale ( ( m + 0 ) , e - > scale , ( m + 0 ) ) ;
VectorScale ( ( m + 4 ) , e - > scale , ( m + 4 ) ) ;
VectorScale ( ( m + 8 ) , e - > scale , ( m + 8 ) ) ;
# endif
2010-11-02 23:17:25 +00:00
}
else if ( mod & & ! strcmp ( mod - > name , " progs/eyes.mdl " ) )
{
/*resize eyes, to make them easier to see*/
m [ 14 ] - = ( 22 + 8 ) ;
VectorScale ( ( m + 0 ) , 2 , ( m + 0 ) ) ;
VectorScale ( ( m + 4 ) , 2 , ( m + 4 ) ) ;
VectorScale ( ( m + 8 ) , 2 , ( m + 8 ) ) ;
}
if ( mod & & ! ruleset_allow_larger_models . ival & & mod - > clampscale ! = 1 )
{ //possibly this should be on a per-frame basis, but that's a real pain to do
Con_DPrintf ( " Rescaling %s by %f \n " , mod - > name , mod - > clampscale ) ;
VectorScale ( ( m + 0 ) , mod - > clampscale , ( m + 0 ) ) ;
VectorScale ( ( m + 4 ) , mod - > clampscale , ( m + 4 ) ) ;
VectorScale ( ( m + 8 ) , mod - > clampscale , ( m + 8 ) ) ;
}
2010-05-01 22:47:47 +00:00
2014-03-31 17:06:41 +00:00
if ( e - > flags & RF_WEAPONMODEL )
2010-11-02 23:17:25 +00:00
{
/*FIXME: no bob*/
float iv [ 16 ] ;
Matrix4_Invert ( r_refdef . m_view , iv ) ;
2011-07-31 11:18:49 +00:00
Matrix4x4_CM_NewRotation ( 90 , 1 , 0 , 0 ) ;
2010-11-02 23:17:25 +00:00
Matrix4_Multiply ( iv , m , mv ) ;
2011-07-31 11:18:49 +00:00
Matrix4_Multiply ( mv , Matrix4x4_CM_NewRotation ( - 90 , 1 , 0 , 0 ) , iv ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
Matrix4_Multiply ( iv , Matrix4x4_CM_NewRotation ( 90 , 0 , 0 , 1 ) , m ) ;
2010-11-02 23:17:25 +00:00
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
IDirect3DDevice9_SetTransform ( pD3DDev9 , D3DTS_WORLD , ( D3DMATRIX * ) m ) ;
2010-11-02 23:17:25 +00:00
}
else
{
IDirect3DDevice9_SetTransform ( pD3DDev9 , D3DTS_WORLD , ( D3DMATRIX * ) m ) ;
2009-11-07 13:29:15 +00:00
}
2010-11-22 02:03:28 +00:00
{
D3DVIEWPORT9 vport ;
IDirect3DDevice9_GetViewport ( pD3DDev9 , & vport ) ;
2014-03-31 17:06:41 +00:00
vport . MaxZ = ( e - > flags & RF_DEPTHHACK ) ? 0.333 : 1 ;
2010-11-22 02:03:28 +00:00
IDirect3DDevice9_SetViewport ( pD3DDev9 , & vport ) ;
}
2009-11-07 13:29:15 +00:00
}
2012-09-30 05:52:03 +00:00
void D3D9BE_SubmitBatch ( batch_t * batch )
2009-11-07 13:29:15 +00:00
{
2015-05-03 19:57:46 +00:00
shader_t * shader = batch - > shader ;
2010-11-02 23:17:25 +00:00
shaderstate . nummeshes = batch - > meshes - batch - > firstmesh ;
if ( ! shaderstate . nummeshes )
return ;
if ( shaderstate . curentity ! = batch - > ent )
2009-11-07 13:29:15 +00:00
{
2010-11-02 23:17:25 +00:00
BE_RotateForEntity ( batch - > ent , batch - > ent - > model ) ;
2010-11-11 18:22:49 +00:00
shaderstate . curtime = r_refdef . time - shaderstate . curentity - > shaderTime ;
2009-11-07 13:29:15 +00:00
}
2012-05-09 15:30:53 +00:00
shaderstate . batchvbo = batch - > vbo ;
2010-11-02 23:17:25 +00:00
shaderstate . meshlist = batch - > mesh + batch - > firstmesh ;
2015-05-03 19:57:46 +00:00
shaderstate . curshader = shader ;
if ( batch - > skin )
shaderstate . curtexnums = batch - > skin ;
else if ( shader - > numdefaulttextures )
shaderstate . curtexnums = shader - > defaulttextures + ( ( int ) ( shader - > defaulttextures_fps * shaderstate . curtime ) % shader - > numdefaulttextures ) ;
else
shaderstate . curtexnums = shader - > defaulttextures ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
shaderstate . curbatch = batch ;
2010-11-22 02:03:28 +00:00
shaderstate . flags = batch - > flags ;
2014-10-05 20:04:11 +00:00
if ( ( unsigned ) batch - > lightmap [ 0 ] < ( unsigned ) numlightmaps )
2012-07-05 19:42:36 +00:00
shaderstate . curlightmap = lightmap [ batch - > lightmap [ 0 ] ] - > lightmap_texture ;
2014-10-05 20:04:11 +00:00
else
shaderstate . curlightmap = r_nulltex ;
2010-11-02 23:17:25 +00:00
BE_DrawMeshChain_Internal ( ) ;
}
2012-09-30 05:52:03 +00:00
void D3D9BE_DrawMesh_List ( shader_t * shader , int nummeshes , mesh_t * * meshlist , vbo_t * vbo , texnums_t * texnums , unsigned int beflags )
2010-11-02 23:17:25 +00:00
{
2011-12-23 03:12:29 +00:00
shaderstate . batchvbo = vbo ;
2010-11-02 23:17:25 +00:00
shaderstate . curshader = shader ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( texnums )
shaderstate . curtexnums = texnums ;
else if ( shader - > numdefaulttextures )
shaderstate . curtexnums = shader - > defaulttextures + ( ( int ) ( shader - > defaulttextures_fps * shaderstate . curtime ) % shader - > numdefaulttextures ) ;
else
shaderstate . curtexnums = shader - > defaulttextures ;
2010-11-02 23:17:25 +00:00
shaderstate . curlightmap = r_nulltex ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
shaderstate . curbatch = & shaderstate . dummybatch ;
2010-11-02 23:17:25 +00:00
shaderstate . meshlist = meshlist ;
shaderstate . nummeshes = nummeshes ;
2011-04-23 20:37:20 +00:00
shaderstate . flags = beflags ;
2010-11-02 23:17:25 +00:00
BE_DrawMeshChain_Internal ( ) ;
}
2015-05-03 19:57:46 +00:00
void D3D9BE_DrawMesh_Single ( shader_t * shader , mesh_t * meshchain , vbo_t * vbo , unsigned int beflags )
2010-11-02 23:17:25 +00:00
{
2011-12-23 03:12:29 +00:00
shaderstate . batchvbo = vbo ;
2010-11-11 18:22:49 +00:00
shaderstate . curtime = realtime ;
2010-11-02 23:17:25 +00:00
shaderstate . curshader = shader ;
2015-05-03 19:57:46 +00:00
if ( shader - > numdefaulttextures )
shaderstate . curtexnums = shader - > defaulttextures + ( ( int ) ( shader - > defaulttextures_fps * shaderstate . curtime ) % shader - > numdefaulttextures ) ;
else
shaderstate . curtexnums = shader - > defaulttextures ;
2010-11-02 23:17:25 +00:00
shaderstate . curlightmap = r_nulltex ;
shaderstate . meshlist = & meshchain ;
shaderstate . nummeshes = 1 ;
2011-04-23 20:37:20 +00:00
shaderstate . flags = beflags ;
2010-11-02 23:17:25 +00:00
BE_DrawMeshChain_Internal ( ) ;
2009-11-07 13:29:15 +00:00
}
2010-11-02 23:17:25 +00:00
static void BE_SubmitMeshesSortList ( batch_t * sortlist )
2009-11-07 13:29:15 +00:00
{
2010-11-02 23:17:25 +00:00
batch_t * batch ;
for ( batch = sortlist ; batch ; batch = batch - > next )
2009-11-07 13:29:15 +00:00
{
2010-11-02 23:17:25 +00:00
if ( batch - > meshes = = batch - > firstmesh )
2009-11-07 13:29:15 +00:00
continue ;
2010-11-02 23:17:25 +00:00
if ( batch - > buildmeshes )
batch - > buildmeshes ( batch ) ;
if ( batch - > shader - > flags & SHADER_NODLIGHT )
2013-10-08 16:13:18 +00:00
if ( shaderstate . mode = = BEM_LIGHT )
2010-11-02 23:17:25 +00:00
continue ;
if ( batch - > shader - > flags & SHADER_SKY )
{
2011-09-03 03:49:43 +00:00
if ( ! batch - > shader - > prog )
{
if ( shaderstate . mode = = BEM_STANDARD )
R_DrawSkyChain ( batch ) ;
continue ;
}
2010-11-02 23:17:25 +00:00
}
2009-11-07 13:29:15 +00:00
2010-11-02 23:17:25 +00:00
BE_SubmitBatch ( batch ) ;
2009-11-07 13:29:15 +00:00
}
2010-11-02 23:17:25 +00:00
}
2009-11-07 13:29:15 +00:00
2010-11-11 18:22:49 +00:00
/*generates a new modelview matrix, as well as vpn vectors*/
static void R_MirrorMatrix ( plane_t * plane )
{
float mirror [ 16 ] ;
float view [ 16 ] ;
float result [ 16 ] ;
vec3_t pnorm ;
VectorNegate ( plane - > normal , pnorm ) ;
mirror [ 0 ] = 1 - 2 * pnorm [ 0 ] * pnorm [ 0 ] ;
mirror [ 1 ] = - 2 * pnorm [ 0 ] * pnorm [ 1 ] ;
mirror [ 2 ] = - 2 * pnorm [ 0 ] * pnorm [ 2 ] ;
mirror [ 3 ] = 0 ;
mirror [ 4 ] = - 2 * pnorm [ 1 ] * pnorm [ 0 ] ;
mirror [ 5 ] = 1 - 2 * pnorm [ 1 ] * pnorm [ 1 ] ;
mirror [ 6 ] = - 2 * pnorm [ 1 ] * pnorm [ 2 ] ;
mirror [ 7 ] = 0 ;
mirror [ 8 ] = - 2 * pnorm [ 2 ] * pnorm [ 0 ] ;
mirror [ 9 ] = - 2 * pnorm [ 2 ] * pnorm [ 1 ] ;
mirror [ 10 ] = 1 - 2 * pnorm [ 2 ] * pnorm [ 2 ] ;
mirror [ 11 ] = 0 ;
mirror [ 12 ] = - 2 * pnorm [ 0 ] * plane - > dist ;
mirror [ 13 ] = - 2 * pnorm [ 1 ] * plane - > dist ;
mirror [ 14 ] = - 2 * pnorm [ 2 ] * plane - > dist ;
mirror [ 15 ] = 1 ;
view [ 0 ] = vpn [ 0 ] ;
view [ 1 ] = vpn [ 1 ] ;
view [ 2 ] = vpn [ 2 ] ;
view [ 3 ] = 0 ;
view [ 4 ] = - vright [ 0 ] ;
view [ 5 ] = - vright [ 1 ] ;
view [ 6 ] = - vright [ 2 ] ;
view [ 7 ] = 0 ;
view [ 8 ] = vup [ 0 ] ;
view [ 9 ] = vup [ 1 ] ;
view [ 10 ] = vup [ 2 ] ;
view [ 11 ] = 0 ;
view [ 12 ] = r_refdef . vieworg [ 0 ] ;
view [ 13 ] = r_refdef . vieworg [ 1 ] ;
view [ 14 ] = r_refdef . vieworg [ 2 ] ;
view [ 15 ] = 1 ;
VectorMA ( r_refdef . vieworg , 0.25 , plane - > normal , r_refdef . pvsorigin ) ;
Matrix4_Multiply ( mirror , view , result ) ;
vpn [ 0 ] = result [ 0 ] ;
vpn [ 1 ] = result [ 1 ] ;
vpn [ 2 ] = result [ 2 ] ;
vright [ 0 ] = - result [ 4 ] ;
vright [ 1 ] = - result [ 5 ] ;
vright [ 2 ] = - result [ 6 ] ;
vup [ 0 ] = result [ 8 ] ;
vup [ 1 ] = result [ 9 ] ;
vup [ 2 ] = result [ 10 ] ;
r_refdef . vieworg [ 0 ] = result [ 12 ] ;
r_refdef . vieworg [ 1 ] = result [ 13 ] ;
r_refdef . vieworg [ 2 ] = result [ 14 ] ;
}
static entity_t * R_NearestPortal ( plane_t * plane )
{
int i ;
entity_t * best = NULL ;
float dist , bestd = 0 ;
for ( i = 0 ; i < cl_numvisedicts ; i + + )
{
if ( cl_visedicts [ i ] . rtype = = RT_PORTALSURFACE )
{
dist = DotProduct ( cl_visedicts [ i ] . origin , plane - > normal ) - plane - > dist ;
dist = fabs ( dist ) ;
if ( dist < 64 & & ( ! best | | dist < bestd ) )
best = & cl_visedicts [ i ] ;
}
}
return best ;
}
static void TransformCoord ( vec3_t in , vec3_t planea [ 3 ] , vec3_t planeo , vec3_t viewa [ 3 ] , vec3_t viewo , vec3_t result )
{
int i ;
vec3_t local ;
vec3_t transformed ;
float d ;
local [ 0 ] = in [ 0 ] - planeo [ 0 ] ;
local [ 1 ] = in [ 1 ] - planeo [ 1 ] ;
local [ 2 ] = in [ 2 ] - planeo [ 2 ] ;
VectorClear ( transformed ) ;
for ( i = 0 ; i < 3 ; i + + )
{
d = DotProduct ( local , planea [ i ] ) ;
VectorMA ( transformed , d , viewa [ i ] , transformed ) ;
}
result [ 0 ] = transformed [ 0 ] + viewo [ 0 ] ;
result [ 1 ] = transformed [ 1 ] + viewo [ 1 ] ;
result [ 2 ] = transformed [ 2 ] + viewo [ 2 ] ;
}
static void TransformDir ( vec3_t in , vec3_t planea [ 3 ] , vec3_t viewa [ 3 ] , vec3_t result )
{
int i ;
float d ;
vec3_t tmp ;
VectorCopy ( in , tmp ) ;
VectorClear ( result ) ;
for ( i = 0 ; i < 3 ; i + + )
{
d = DotProduct ( tmp , planea [ i ] ) ;
VectorMA ( result , d , viewa [ i ] , result ) ;
}
}
2011-05-19 13:34:07 +00:00
static void R_RenderScene ( void )
2010-11-11 18:22:49 +00:00
{
2011-09-03 03:49:43 +00:00
IDirect3DDevice9_SetTransform ( pD3DDev9 , D3DTS_PROJECTION , ( D3DMATRIX * ) d3d_trueprojection ) ;
2010-11-11 18:22:49 +00:00
IDirect3DDevice9_SetTransform ( pD3DDev9 , D3DTS_VIEW , ( D3DMATRIX * ) r_refdef . m_view ) ;
R_SetFrustum ( r_refdef . m_projection , r_refdef . m_view ) ;
Surf_DrawWorld ( ) ;
}
static void R_DrawPortal ( batch_t * batch , batch_t * * blist )
{
entity_t * view ;
float glplane [ 4 ] ;
plane_t plane ;
refdef_t oldrefdef ;
mesh_t * mesh = batch - > mesh [ batch - > firstmesh ] ;
int sort ;
if ( r_refdef . recurse )
return ;
VectorCopy ( mesh - > normals_array [ 0 ] , plane . normal ) ;
plane . dist = DotProduct ( mesh - > xyz_array [ 0 ] , plane . normal ) ;
//if we're too far away from the surface, don't draw anything
if ( batch - > shader - > flags & SHADER_AGEN_PORTAL )
{
/*there's a portal alpha blend on that surface, that fades out after this distance*/
if ( DotProduct ( r_refdef . vieworg , plane . normal ) - plane . dist > batch - > shader - > portaldist )
return ;
}
//if we're behind it, then also don't draw anything.
if ( DotProduct ( r_refdef . vieworg , plane . normal ) - plane . dist < 0 )
return ;
view = R_NearestPortal ( & plane ) ;
//if (!view)
// return;
oldrefdef = r_refdef ;
r_refdef . recurse = true ;
r_refdef . externalview = true ;
if ( ! view | | VectorCompare ( view - > origin , view - > oldorigin ) )
{
2013-10-08 14:28:11 +00:00
r_refdef . flipcull ^ = SHADER_CULL_FLIP ;
2010-11-11 18:22:49 +00:00
R_MirrorMatrix ( & plane ) ;
}
else
{
float d ;
vec3_t paxis [ 3 ] , porigin , vaxis [ 3 ] , vorg ;
void PerpendicularVector ( vec3_t dst , const vec3_t src ) ;
/*calculate where the surface is meant to be*/
VectorCopy ( mesh - > normals_array [ 0 ] , paxis [ 0 ] ) ;
PerpendicularVector ( paxis [ 1 ] , paxis [ 0 ] ) ;
CrossProduct ( paxis [ 0 ] , paxis [ 1 ] , paxis [ 2 ] ) ;
d = DotProduct ( view - > origin , plane . normal ) - plane . dist ;
VectorMA ( view - > origin , - d , paxis [ 0 ] , porigin ) ;
/*grab the camera origin*/
VectorNegate ( view - > axis [ 0 ] , vaxis [ 0 ] ) ;
VectorNegate ( view - > axis [ 1 ] , vaxis [ 1 ] ) ;
VectorCopy ( view - > axis [ 2 ] , vaxis [ 2 ] ) ;
VectorCopy ( view - > oldorigin , vorg ) ;
VectorCopy ( vorg , r_refdef . pvsorigin ) ;
/*rotate it a bit*/
RotatePointAroundVector ( vaxis [ 1 ] , vaxis [ 0 ] , view - > axis [ 1 ] , sin ( realtime ) * 4 ) ;
CrossProduct ( vaxis [ 0 ] , vaxis [ 1 ] , vaxis [ 2 ] ) ;
TransformCoord ( oldrefdef . vieworg , paxis , porigin , vaxis , vorg , r_refdef . vieworg ) ;
TransformDir ( vpn , paxis , vaxis , vpn ) ;
TransformDir ( vright , paxis , vaxis , vright ) ;
TransformDir ( vup , paxis , vaxis , vup ) ;
}
2011-07-31 11:18:49 +00:00
Matrix4x4_CM_ModelViewMatrixFromAxis ( r_refdef . m_view , vpn , vright , vup , r_refdef . vieworg ) ;
2010-11-11 18:22:49 +00:00
VectorAngles ( vpn , vup , r_refdef . viewangles ) ;
VectorCopy ( r_refdef . vieworg , r_origin ) ;
/*FIXME: the batch stuff should be done in renderscene*/
/*fixup the first mesh index*/
for ( sort = 0 ; sort < SHADER_SORT_COUNT ; sort + + )
for ( batch = blist [ sort ] ; batch ; batch = batch - > next )
{
batch - > firstmesh = batch - > meshes ;
}
/*FIXME: can we get away with stenciling the screen?*/
/*Add to frustum culling instead of clip planes?*/
glplane [ 0 ] = plane . normal [ 0 ] ;
glplane [ 1 ] = plane . normal [ 1 ] ;
glplane [ 2 ] = plane . normal [ 2 ] ;
glplane [ 3 ] = - plane . dist ;
IDirect3DDevice9_SetClipPlane ( pD3DDev9 , 0 , glplane ) ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_CLIPPLANEENABLE , D3DCLIPPLANE0 ) ;
R_RenderScene ( ) ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_CLIPPLANEENABLE , 0 ) ;
for ( sort = 0 ; sort < SHADER_SORT_COUNT ; sort + + )
for ( batch = blist [ sort ] ; batch ; batch = batch - > next )
{
batch - > firstmesh = 0 ;
}
r_refdef = oldrefdef ;
/*broken stuff*/
AngleVectors ( r_refdef . viewangles , vpn , vright , vup ) ;
VectorCopy ( r_refdef . vieworg , r_origin ) ;
2011-09-03 03:49:43 +00:00
IDirect3DDevice9_SetTransform ( pD3DDev9 , D3DTS_PROJECTION , ( D3DMATRIX * ) d3d_trueprojection ) ;
2010-11-11 18:22:49 +00:00
IDirect3DDevice9_SetTransform ( pD3DDev9 , D3DTS_VIEW , ( D3DMATRIX * ) r_refdef . m_view ) ;
R_SetFrustum ( r_refdef . m_projection , r_refdef . m_view ) ;
}
static void BE_SubmitMeshesPortals ( batch_t * * worldlist , batch_t * dynamiclist )
{
batch_t * batch , * old ;
int i ;
/*attempt to draw portal shaders*/
if ( shaderstate . mode = = BEM_STANDARD )
{
for ( i = 0 ; i < 2 ; i + + )
{
for ( batch = i ? dynamiclist : worldlist [ SHADER_SORT_PORTAL ] ; batch ; batch = batch - > next )
{
if ( batch - > meshes = = batch - > firstmesh )
continue ;
if ( batch - > buildmeshes )
batch - > buildmeshes ( batch ) ;
/*draw already-drawn portals as depth-only, to ensure that their contents are not harmed*/
2011-04-20 23:34:13 +00:00
BE_SelectMode ( BEM_DEPTHONLY ) ;
2010-11-11 18:22:49 +00:00
for ( old = worldlist [ SHADER_SORT_PORTAL ] ; old & & old ! = batch ; old = old - > next )
{
if ( old - > meshes = = old - > firstmesh )
continue ;
BE_SubmitBatch ( old ) ;
}
if ( ! old )
{
for ( old = dynamiclist ; old ! = batch ; old = old - > next )
{
if ( old - > meshes = = old - > firstmesh )
continue ;
BE_SubmitBatch ( old ) ;
}
}
2011-04-20 23:34:13 +00:00
BE_SelectMode ( BEM_STANDARD ) ;
2010-11-11 18:22:49 +00:00
R_DrawPortal ( batch , worldlist ) ;
/*clear depth again*/
IDirect3DDevice9_Clear ( pD3DDev9 , 0 , NULL , D3DCLEAR_ZBUFFER , D3DCOLOR_XRGB ( 0 , 0 , 0 ) , 1 , 0 ) ;
}
}
}
}
2012-09-30 05:52:03 +00:00
void D3D9BE_SubmitMeshes ( qboolean drawworld , batch_t * * blist , int first , int stop )
2010-11-02 23:17:25 +00:00
{
model_t * model = cl . worldmodel ;
int i ;
2012-01-01 02:26:42 +00:00
for ( i = first ; i < stop ; i + + )
2010-11-02 23:17:25 +00:00
{
if ( drawworld )
{
2010-11-11 18:22:49 +00:00
if ( i = = SHADER_SORT_PORTAL /*&& !r_noportals.ival*/ & & ! r_refdef . recurse )
BE_SubmitMeshesPortals ( model - > batches , blist [ i ] ) ;
2010-11-02 23:17:25 +00:00
BE_SubmitMeshesSortList ( model - > batches [ i ] ) ;
}
BE_SubmitMeshesSortList ( blist [ i ] ) ;
}
2009-11-07 13:29:15 +00:00
}
2012-01-01 02:26:42 +00:00
# ifdef RTLIGHTS
2012-09-30 05:52:03 +00:00
void D3D9BE_BaseEntTextures ( void )
2012-01-01 02:26:42 +00:00
{
batch_t * batches [ SHADER_SORT_COUNT ] ;
2013-10-08 16:13:18 +00:00
BE_GenModelBatches ( batches , shaderstate . curdlight , shaderstate . mode ) ;
2012-09-30 05:52:03 +00:00
D3D9BE_SubmitMeshes ( false , batches , SHADER_SORT_PORTAL , SHADER_SORT_DECAL ) ;
2012-01-01 02:26:42 +00:00
BE_SelectEntity ( & r_worldentity ) ;
}
2012-09-30 05:52:03 +00:00
void D3D9BE_RenderShadowBuffer ( unsigned int numverts , IDirect3DVertexBuffer9 * vbuf , unsigned int numindicies , IDirect3DIndexBuffer9 * ibuf )
2012-01-01 02:26:42 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
float pushdepth ;
extern cvar_t r_polygonoffset_submodel_factor ;
// D3D9BE_Cull(0);//shaderstate.curshader->flags & (SHADER_CULL_FRONT | SHADER_CULL_BACK));
pushdepth = ( shaderstate . curshader - > polyoffset . factor + ( ( 0 /*shaderstate.flags & BEF_PUSHDEPTH*/ ) ? r_polygonoffset_submodel_factor . value : 0 ) ) / 0xffff ;
if ( pushdepth ! = shaderstate . depthbias )
{
shaderstate . depthbias = pushdepth ;
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_DEPTHBIAS , * ( DWORD * ) & shaderstate . depthbias ) ;
}
2012-01-01 02:26:42 +00:00
IDirect3DDevice9_SetStreamSource ( pD3DDev9 , STRM_VERT , vbuf , 0 , sizeof ( vecV_t ) ) ;
IDirect3DDevice9_SetIndices ( pD3DDev9 , ibuf ) ;
if ( 0 ! = shaderstate . curvertdecl )
{
shaderstate . curvertdecl = 0 ;
d3dcheck ( IDirect3DDevice9_SetVertexDeclaration ( pD3DDev9 , vertexdecls [ shaderstate . curvertdecl ] ) ) ;
}
IDirect3DDevice9_DrawIndexedPrimitive ( pD3DDev9 , D3DPT_TRIANGLELIST , 0 , 0 , numverts , 0 , numindicies / 3 ) ;
}
# endif
2012-09-30 05:52:03 +00:00
void D3D9BE_DrawWorld ( qboolean drawworld , qbyte * vis )
2009-11-07 13:29:15 +00:00
{
2010-11-02 23:17:25 +00:00
batch_t * batches [ SHADER_SORT_COUNT ] ;
2009-11-07 13:29:15 +00:00
RSpeedLocals ( ) ;
2010-11-11 18:22:49 +00:00
shaderstate . curentity = NULL ;
2010-11-06 23:05:29 +00:00
if ( ! r_refdef . recurse )
{
if ( shaderstate . wbatch > shaderstate . maxwbatches )
{
int newm = shaderstate . wbatch ;
shaderstate . wbatches = BZ_Realloc ( shaderstate . wbatches , newm * sizeof ( * shaderstate . wbatches ) ) ;
memset ( shaderstate . wbatches + shaderstate . maxwbatches , 0 , ( newm - shaderstate . maxwbatches ) * sizeof ( * shaderstate . wbatches ) ) ;
shaderstate . maxwbatches = newm ;
}
shaderstate . wbatch = 0 ;
}
2013-10-08 16:13:18 +00:00
shaderstate . curdlight = NULL ;
BE_GenModelBatches ( batches , shaderstate . curdlight , BEM_STANDARD ) ;
2010-11-02 23:17:25 +00:00
2012-07-07 05:17:43 +00:00
if ( drawworld )
2010-11-10 03:32:47 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
float shaderstate_identitylighting ;
2010-11-10 03:32:47 +00:00
BE_UploadLightmaps ( false ) ;
//make sure the world draws correctly
r_worldentity . shaderRGBAf [ 0 ] = 1 ;
r_worldentity . shaderRGBAf [ 1 ] = 1 ;
r_worldentity . shaderRGBAf [ 2 ] = 1 ;
r_worldentity . shaderRGBAf [ 3 ] = 1 ;
r_worldentity . axis [ 0 ] [ 0 ] = 1 ;
r_worldentity . axis [ 1 ] [ 1 ] = 1 ;
r_worldentity . axis [ 2 ] [ 2 ] = 1 ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# ifdef RTLIGHTS
if ( drawworld & & r_shadow_realtime_world . ival )
shaderstate_identitylighting = r_shadow_realtime_world_lightmaps . value ;
else
# endif
shaderstate_identitylighting = 1 ;
shaderstate_identitylighting * = r_refdef . hdr_value ;
// shaderstate_identitylightmap = shaderstate.identitylighting / (1<<gl_overbright.ival);
if ( shaderstate_identitylighting = = 0 )
BE_SelectMode ( BEM_DEPTHDARK ) ;
else
BE_SelectMode ( BEM_STANDARD ) ;
2010-11-10 03:32:47 +00:00
RSpeedRemark ( ) ;
2012-09-30 05:52:03 +00:00
D3D9BE_SubmitMeshes ( true , batches , SHADER_SORT_PORTAL , SHADER_SORT_DECAL ) ;
2010-11-10 03:32:47 +00:00
RSpeedEnd ( RSPEED_WORLD ) ;
2012-01-01 02:26:42 +00:00
# ifdef RTLIGHTS
2012-07-07 05:17:43 +00:00
if ( vis )
{
RSpeedRemark ( ) ;
2012-09-30 05:52:03 +00:00
D3D9BE_SelectEntity ( & r_worldentity ) ;
2012-07-07 05:17:43 +00:00
Sh_DrawLights ( vis ) ;
RSpeedEnd ( RSPEED_STENCILSHADOWS ) ;
}
2012-01-01 02:26:42 +00:00
# endif
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
BE_SelectMode ( BEM_STANDARD ) ;
2012-09-30 05:52:03 +00:00
D3D9BE_SubmitMeshes ( true , batches , SHADER_SORT_DECAL , SHADER_SORT_COUNT ) ;
2010-11-10 03:32:47 +00:00
}
else
{
RSpeedRemark ( ) ;
2012-09-30 05:52:03 +00:00
D3D9BE_SubmitMeshes ( false , batches , SHADER_SORT_PORTAL , SHADER_SORT_COUNT ) ;
2010-11-10 03:32:47 +00:00
RSpeedEnd ( RSPEED_DRAWENTITIES ) ;
}
2010-11-02 23:17:25 +00:00
2011-10-27 16:16:29 +00:00
R_RenderDlights ( ) ;
2011-07-30 14:14:56 +00:00
2010-11-02 23:17:25 +00:00
BE_RotateForEntity ( & r_worldentity , NULL ) ;
2009-11-07 13:29:15 +00:00
}
2015-03-03 00:14:43 +00:00
void D3D9BE_VBO_Begin ( vbobctx_t * ctx , size_t maxsize )
2013-04-06 03:36:00 +00:00
{
}
2015-03-03 00:14:43 +00:00
void D3D9BE_VBO_Data ( vbobctx_t * ctx , void * data , size_t size , vboarray_t * varray )
2013-04-06 03:36:00 +00:00
{
}
2015-03-03 00:14:43 +00:00
void D3D9BE_VBO_Finish ( vbobctx_t * ctx , void * edata , size_t esize , vboarray_t * earray )
2013-04-06 03:36:00 +00:00
{
}
void D3D9BE_VBO_Destroy ( vboarray_t * vearray )
{
}
2009-11-07 13:29:15 +00:00
2013-06-23 02:17:02 +00:00
void D3D9BE_Scissor ( srect_t * srect )
{
RECT rect ;
if ( srect )
{
2015-07-31 13:23:32 +00:00
rect . left = ( srect - > x ) * vid . fbpwidth ;
rect . right = ( srect - > x + srect - > width ) * vid . fbpwidth ;
rect . top = ( srect - > y ) * vid . fbpheight ;
rect . bottom = ( srect - > y + srect - > height ) * vid . fbpheight ;
2013-06-23 02:17:02 +00:00
}
else
{
rect . left = 0 ;
rect . right = vid . pixelwidth ;
rect . top = 0 ;
rect . bottom = vid . pixelheight ;
}
IDirect3DDevice9_SetScissorRect ( pD3DDev9 , & rect ) ;
2015-07-31 13:23:32 +00:00
IDirect3DDevice9_SetRenderState ( pD3DDev9 , D3DRS_SCISSORTESTENABLE , TRUE ) ;
2013-06-23 02:17:02 +00:00
}
2009-11-04 23:20:50 +00:00
# endif