2004-08-23 01:38:21 +00:00
//qc execution code.
//we have two conditions.
//one allows us to debug and trace through our code, the other doesn't.
//hopefully, the compiler will do a great job at optimising this code for us, where required.
//if it dosn't, then bum.
//the general overhead should be reduced significantly, and I would be supprised if it did run slower.
//run away loops are checked for ONLY on gotos and function calls. This might give a poorer check, but it will run faster overall.
//Appears to work fine.
# if INTSIZE == 16
# define reeval reeval16
# define pr_statements pr_statements16
# define fakeop fakeop16
# define dstatement_t dstatement16_t
# define sofs signed short
# elif INTSIZE == 32
# define reeval reeval32
# define pr_statements pr_statements32
# define fakeop fakeop32
# define dstatement_t dstatement32_t
# define sofs signed int
# elif INTSIZE == 24
# error INTSIZE should be set to 32.
# else
# error Bad cont size
# endif
------------------------------------------------------------------------
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 ENGINEPOINTER(p) ((char*)(p) - progfuncs->funcs.stringtable)
# define QCPOINTER(p) (eval_t *)(p->_int+progfuncs->funcs.stringtable)
# define QCPOINTERM(p) (eval_t *)((p)+progfuncs->funcs.stringtable)
2020-04-26 04:24:22 +00:00
# define QCPOINTERWRITEFAIL(p,sz) ((unsigned int)(p)-1 >= prinst.addressableused-1-(sz)) //disallows null writes
2016-07-12 00:40:13 +00:00
# define QCPOINTERREADFAIL(p,sz) ((unsigned int)(p) >= prinst.addressableused-(sz)) //permits null reads
2004-08-23 01:38:21 +00:00
2015-02-02 08:01:53 +00:00
2019-12-10 14:50:47 +00:00
# define QCFAULT return (prinst.pr_xstatement=(st-pr_statements)-1),PR_HandleFault
2016-11-15 22:22:04 +00:00
# define EVAL_FLOATISTRUE(ev) ((ev)->_int & 0x7fffffff) //mask away sign bit. This avoids using denormalized floats.
2015-02-02 08:01:53 +00:00
2015-09-01 04:45:15 +00:00
# ifdef __GNUC__
# define errorif(x) if(__builtin_expect(x,0))
# else
# define errorif(x) if(x)
# endif
2004-08-23 01:38:21 +00:00
//rely upon just st
{
# ifdef DEBUGABLE
s = st - pr_statements ;
s + = 1 ;
2012-11-27 03:23:19 +00:00
2015-09-01 04:45:15 +00:00
errorif ( prinst . watch_ptr & & prinst . watch_ptr - > _int ! = prinst . watch_old . _int )
2012-11-27 03:23:19 +00:00
{
//this will fire on the next instruction after the variable got changed.
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = s ;
2016-07-12 00:40:13 +00:00
if ( current_progstate - > linenums )
2020-01-09 15:35:40 +00:00
externs - > Printf ( " Watch point hit in %s:%u, \" %s \" changed " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , current_progstate - > linenums [ s - 1 ] , prinst . watch_name ) ;
2016-07-12 00:40:13 +00:00
else
2020-01-09 15:35:40 +00:00
externs - > Printf ( " Watch point hit in %s, \" %s \" changed " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , prinst . watch_name ) ;
------------------------------------------------------------------------
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
switch ( prinst . watch_type )
2012-11-27 03:23:19 +00:00
{
case ev_float :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " from %g to %g " , prinst . watch_old . _float , prinst . watch_ptr - > _float ) ;
2012-11-27 03:23:19 +00:00
break ;
2015-04-14 12:24:05 +00:00
case ev_vector :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " from '%g %g %g' to '%g %g %g' " , prinst . watch_old . _vector [ 0 ] , prinst . watch_old . _vector [ 1 ] , prinst . watch_old . _vector [ 2 ] , prinst . watch_ptr - > _vector [ 0 ] , prinst . watch_ptr - > _vector [ 1 ] , prinst . watch_ptr - > _vector [ 2 ] ) ;
2015-04-14 12:24:05 +00:00
break ;
2012-11-27 03:23:19 +00:00
default :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " from %i to %i " , prinst . watch_old . _int , prinst . watch_ptr - > _int ) ;
2012-11-27 03:23:19 +00:00
break ;
2015-04-14 12:24:05 +00:00
case ev_entity :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " from %i(%s) to %i(%s) " , prinst . watch_old . _int , PR_GetEdictClassname ( progfuncs , prinst . watch_old . _int ) , prinst . watch_ptr - > _int , PR_GetEdictClassname ( progfuncs , prinst . watch_ptr - > _int ) ) ;
2015-04-14 12:24:05 +00:00
break ;
2012-11-27 03:23:19 +00:00
case ev_function :
case ev_string :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " , now set to %s " , PR_ValueString ( progfuncs , prinst . watch_type , prinst . watch_ptr , false ) ) ;
2012-11-27 03:23:19 +00:00
break ;
}
2018-10-11 10:31:23 +00:00
externs - > Printf ( " . \n " ) ;
------------------------------------------------------------------------
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
prinst . watch_old = * prinst . watch_ptr ;
// prinst.watch_ptr = NULL;
2015-02-02 08:01:53 +00:00
progfuncs - > funcs . debug_trace = DEBUG_TRACE_INTO ; //this is what it's for
2012-11-27 03:23:19 +00:00
2015-09-06 03:30:28 +00:00
s = ShowStep ( progfuncs , s , " Watchpoint hit " , false ) ;
2015-02-02 08:01:53 +00:00
}
else if ( progfuncs - > funcs . debug_trace )
2015-09-06 03:30:28 +00:00
s = ShowStep ( progfuncs , s , NULL , false ) ;
2004-08-23 01:38:21 +00:00
st = pr_statements + s ;
2020-01-09 15:35:40 +00:00
prinst . pr_xfunction - > profile + = 1 ;
2004-08-23 01:38:21 +00:00
2015-02-02 08:01:53 +00:00
op = ( progfuncs - > funcs . debug_trace ? ( st - > op & ~ 0x8000 ) : st - > op ) ;
2004-08-23 01:38:21 +00:00
reeval :
# else
st + + ;
2015-02-02 08:01:53 +00:00
op = st - > op ;
2011-05-20 04:10:46 +00:00
# endif
2015-02-02 08:01:53 +00:00
switch ( op )
2004-08-23 01:38:21 +00:00
{
case OP_ADD_F :
OPC - > _float = OPA - > _float + OPB - > _float ;
break ;
case OP_ADD_V :
2005-11-29 13:30:20 +00:00
OPC - > _vector [ 0 ] = OPA - > _vector [ 0 ] + OPB - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = OPA - > _vector [ 1 ] + OPB - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = OPA - > _vector [ 2 ] + OPB - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
case OP_SUB_F :
OPC - > _float = OPA - > _float - OPB - > _float ;
break ;
case OP_SUB_V :
2005-11-29 13:30:20 +00:00
OPC - > _vector [ 0 ] = OPA - > _vector [ 0 ] - OPB - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = OPA - > _vector [ 1 ] - OPB - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = OPA - > _vector [ 2 ] - OPB - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
case OP_MUL_F :
OPC - > _float = OPA - > _float * OPB - > _float ;
break ;
case OP_MUL_V :
2005-11-29 13:30:20 +00:00
OPC - > _float = OPA - > _vector [ 0 ] * OPB - > _vector [ 0 ]
+ OPA - > _vector [ 1 ] * OPB - > _vector [ 1 ]
+ OPA - > _vector [ 2 ] * OPB - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
case OP_MUL_FV :
------------------------------------------------------------------------
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
tmpf = OPA - > _float ;
OPC - > _vector [ 0 ] = tmpf * OPB - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = tmpf * OPB - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = tmpf * OPB - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
case OP_MUL_VF :
------------------------------------------------------------------------
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
tmpf = OPB - > _float ;
OPC - > _vector [ 0 ] = tmpf * OPA - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = tmpf * OPA - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = tmpf * OPA - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
case OP_DIV_F :
2017-08-14 16:38:44 +00:00
/* errorif (OPB->_float == 0)
2014-05-20 02:23:37 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
externs - > Printf ( " Division by 0 in %s \n " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) ;
2017-08-14 16:38:44 +00:00
PR_StackTrace ( & progfuncs - > funcs , 1 ) ;
OPC - > _float = 0.0 ;
2014-05-20 02:23:37 +00:00
}
2017-08-14 16:38:44 +00:00
else
*/ OPC - > _float = OPA - > _float / OPB - > _float ;
2004-08-23 01:38:21 +00:00
break ;
case OP_DIV_VF :
------------------------------------------------------------------------
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
tmpf = OPB - > _float ;
2015-09-01 04:45:15 +00:00
/* errorif (!tmpf)
2014-05-20 02:23:37 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
externs - > Printf ( " Division by 0 in %s \n " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) ;
2017-08-14 16:38:44 +00:00
PR_StackTrace ( & progfuncs - > funcs , 1 ) ;
2014-05-20 02:23:37 +00:00
}
*/
OPC - > _vector [ 0 ] = OPA - > _vector [ 0 ] / tmpf ;
OPC - > _vector [ 1 ] = OPA - > _vector [ 1 ] / tmpf ;
OPC - > _vector [ 2 ] = OPA - > _vector [ 2 ] / tmpf ;
2004-08-23 01:38:21 +00:00
break ;
2011-07-08 18:59:48 +00:00
case OP_BITAND_F :
2004-08-23 01:38:21 +00:00
OPC - > _float = ( float ) ( ( int ) OPA - > _float & ( int ) OPB - > _float ) ;
break ;
2011-07-08 18:59:48 +00:00
case OP_BITOR_F :
2004-08-23 01:38:21 +00:00
OPC - > _float = ( float ) ( ( int ) OPA - > _float | ( int ) OPB - > _float ) ;
break ;
2011-07-08 18:59:48 +00:00
case OP_GE_F :
2004-08-23 01:38:21 +00:00
OPC - > _float = ( float ) ( OPA - > _float > = OPB - > _float ) ;
break ;
case OP_GE_I :
OPC - > _int = ( int ) ( OPA - > _int > = OPB - > _int ) ;
break ;
case OP_GE_IF :
2015-09-18 20:30:10 +00:00
OPC - > _int = ( float ) ( OPA - > _int > = OPB - > _float ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_GE_FI :
2015-09-18 20:30:10 +00:00
OPC - > _int = ( float ) ( OPA - > _float > = OPB - > _int ) ;
2004-08-23 01:38:21 +00:00
break ;
2011-07-08 18:59:48 +00:00
case OP_LE_F :
2004-08-23 01:38:21 +00:00
OPC - > _float = ( float ) ( OPA - > _float < = OPB - > _float ) ;
break ;
case OP_LE_I :
OPC - > _int = ( int ) ( OPA - > _int < = OPB - > _int ) ;
break ;
case OP_LE_IF :
2015-09-18 20:30:10 +00:00
OPC - > _int = ( float ) ( OPA - > _int < = OPB - > _float ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_LE_FI :
2015-09-18 20:30:10 +00:00
OPC - > _int = ( float ) ( OPA - > _float < = OPB - > _int ) ;
2004-08-23 01:38:21 +00:00
break ;
2011-07-08 18:59:48 +00:00
case OP_GT_F :
2004-08-23 01:38:21 +00:00
OPC - > _float = ( float ) ( OPA - > _float > OPB - > _float ) ;
break ;
case OP_GT_I :
OPC - > _int = ( int ) ( OPA - > _int > OPB - > _int ) ;
break ;
case OP_GT_IF :
2015-09-18 20:30:10 +00:00
OPC - > _int = ( float ) ( OPA - > _int > OPB - > _float ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_GT_FI :
2015-09-18 20:30:10 +00:00
OPC - > _int = ( float ) ( OPA - > _float > OPB - > _int ) ;
2004-08-23 01:38:21 +00:00
break ;
2011-07-08 18:59:48 +00:00
case OP_LT_F :
2004-08-23 01:38:21 +00:00
OPC - > _float = ( float ) ( OPA - > _float < OPB - > _float ) ;
break ;
case OP_LT_I :
OPC - > _int = ( int ) ( OPA - > _int < OPB - > _int ) ;
break ;
case OP_LT_IF :
2015-09-18 20:30:10 +00:00
OPC - > _int = ( float ) ( OPA - > _int < OPB - > _float ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_LT_FI :
2015-09-18 20:30:10 +00:00
OPC - > _int = ( float ) ( OPA - > _float < OPB - > _int ) ;
2004-08-23 01:38:21 +00:00
break ;
2011-07-08 18:59:48 +00:00
case OP_AND_F :
2016-11-15 22:22:04 +00:00
//original logic
//OPC->_float = (float)(OPA->_float && OPB->_float);
//deal with denormalized floats by ensuring that they're not 0 (ignoring sign bit).
//this avoids issues where the fpu treats denormalised floats as 0, or fpus that don't support denormals.
OPC - > _float = ( float ) ( EVAL_FLOATISTRUE ( OPA ) & & EVAL_FLOATISTRUE ( OPB ) ) ;
2004-08-23 01:38:21 +00:00
break ;
2011-07-08 18:59:48 +00:00
case OP_OR_F :
2016-11-15 22:22:04 +00:00
OPC - > _float = ( float ) ( EVAL_FLOATISTRUE ( OPA ) | | EVAL_FLOATISTRUE ( OPB ) ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_NOT_F :
2016-11-15 22:22:04 +00:00
OPC - > _float = ( float ) ( ! EVAL_FLOATISTRUE ( OPA ) ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_NOT_V :
2005-11-29 13:30:20 +00:00
OPC - > _float = ( float ) ( ! OPA - > _vector [ 0 ] & & ! OPA - > _vector [ 1 ] & & ! OPA - > _vector [ 2 ] ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_NOT_S :
------------------------------------------------------------------------
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
OPC - > _float = ( float ) ( ! ( OPA - > string ) | | ! * PR_StringToNative ( & progfuncs - > funcs , OPA - > string ) ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_NOT_FNC :
OPC - > _float = ( float ) ( ! ( OPA - > function & ~ 0xff000000 ) ) ;
break ;
case OP_NOT_ENT :
2015-09-01 04:45:15 +00:00
OPC - > _float = ( float ) ( ! ( OPA - > edict ) ) ; //(PROG_TO_EDICT(progfuncs, OPA->edict) == (edictrun_t *)sv_edicts);
2004-08-23 01:38:21 +00:00
break ;
2020-07-07 22:01:53 +00:00
case OP_NOT_I :
OPC - > _int = ! OPA - > _int ;
break ;
2004-08-23 01:38:21 +00:00
case OP_EQ_F :
OPC - > _float = ( float ) ( OPA - > _float = = OPB - > _float ) ;
break ;
case OP_EQ_IF :
2015-09-18 20:30:10 +00:00
OPC - > _int = ( float ) ( OPA - > _int = = OPB - > _float ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_EQ_FI :
2020-07-14 00:48:56 +00:00
OPC - > _int = ( float ) ( OPA - > _float = = OPB - > _int ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_EQ_V :
2005-11-29 13:30:20 +00:00
OPC - > _float = ( float ) ( ( OPA - > _vector [ 0 ] = = OPB - > _vector [ 0 ] ) & &
( OPA - > _vector [ 1 ] = = OPB - > _vector [ 1 ] ) & &
( OPA - > _vector [ 2 ] = = OPB - > _vector [ 2 ] ) ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_EQ_S :
if ( OPA - > string = = OPB - > string )
OPC - > _float = true ;
else if ( ! OPA - > string )
{
------------------------------------------------------------------------
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 ( ! OPB - > string | | ! * PR_StringToNative ( & progfuncs - > funcs , OPB - > string ) )
2004-08-23 01:38:21 +00:00
OPC - > _float = true ;
else
OPC - > _float = false ;
}
else if ( ! OPB - > string )
{
------------------------------------------------------------------------
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 ( ! OPA - > string | | ! * PR_StringToNative ( & progfuncs - > funcs , OPA - > string ) )
2004-08-23 01:38:21 +00:00
OPC - > _float = true ;
else
OPC - > _float = false ;
}
else
------------------------------------------------------------------------
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
OPC - > _float = ( float ) ( ! strcmp ( PR_StringToNative ( & progfuncs - > funcs , OPA - > string ) , PR_StringToNative ( & progfuncs - > funcs , OPB - > string ) ) ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_EQ_E :
OPC - > _float = ( float ) ( OPA - > _int = = OPB - > _int ) ;
break ;
case OP_EQ_FNC :
OPC - > _float = ( float ) ( OPA - > function = = OPB - > function ) ;
break ;
case OP_NE_F :
OPC - > _float = ( float ) ( OPA - > _float ! = OPB - > _float ) ;
break ;
case OP_NE_V :
2005-11-29 13:30:20 +00:00
OPC - > _float = ( float ) ( ( OPA - > _vector [ 0 ] ! = OPB - > _vector [ 0 ] ) | |
( OPA - > _vector [ 1 ] ! = OPB - > _vector [ 1 ] ) | |
( OPA - > _vector [ 2 ] ! = OPB - > _vector [ 2 ] ) ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_NE_S :
if ( OPA - > string = = OPB - > string )
OPC - > _float = false ;
else if ( ! OPA - > string )
{
------------------------------------------------------------------------
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 ( ! OPB - > string | | ! * ( PR_StringToNative ( & progfuncs - > funcs , OPB - > string ) ) )
2004-08-23 01:38:21 +00:00
OPC - > _float = false ;
else
OPC - > _float = true ;
}
else if ( ! OPB - > string )
{
------------------------------------------------------------------------
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 ( ! OPA - > string | | ! * PR_StringToNative ( & progfuncs - > funcs , OPA - > string ) )
2004-08-23 01:38:21 +00:00
OPC - > _float = false ;
else
OPC - > _float = true ;
}
else
------------------------------------------------------------------------
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
OPC - > _float = ( float ) ( strcmp ( PR_StringToNative ( & progfuncs - > funcs , OPA - > string ) , PR_StringToNative ( & progfuncs - > funcs , OPB - > string ) ) ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_NE_E :
OPC - > _float = ( float ) ( OPA - > _int ! = OPB - > _int ) ;
break ;
case OP_NE_FNC :
OPC - > _float = ( float ) ( OPA - > function ! = OPB - > function ) ;
break ;
//==================
case OP_STORE_IF :
OPB - > _float = ( float ) OPA - > _int ;
break ;
case OP_STORE_FI :
OPB - > _int = ( int ) OPA - > _float ;
break ;
2009-08-29 14:56:42 +00:00
2004-08-23 01:38:21 +00:00
case OP_STORE_F :
case OP_STORE_ENT :
case OP_STORE_FLD : // integers
case OP_STORE_S :
2009-08-29 14:56:42 +00:00
case OP_STORE_I :
2004-08-23 01:38:21 +00:00
case OP_STORE_FNC : // pointers
2009-08-29 14:56:42 +00:00
case OP_STORE_P :
2004-08-23 01:38:21 +00:00
OPB - > _int = OPA - > _int ;
break ;
case OP_STORE_V :
2005-11-29 13:30:20 +00:00
OPB - > _vector [ 0 ] = OPA - > _vector [ 0 ] ;
OPB - > _vector [ 1 ] = OPA - > _vector [ 1 ] ;
OPB - > _vector [ 2 ] = OPA - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
//store a value to a pointer
case OP_STOREP_IF :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( float ) ) )
2008-11-09 22:29:28 +00:00
{
2016-07-12 00:40:13 +00:00
if ( i = = - 1 )
2014-04-24 01:53:01 +00:00
break ;
2020-01-09 15:35:40 +00:00
QCFAULT ( & progfuncs - > funcs , " bad pointer write in %s " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) ;
2008-11-09 22:29:28 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2004-08-23 01:38:21 +00:00
ptr - > _float = ( float ) OPA - > _int ;
break ;
case OP_STOREP_FI :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( int ) ) )
2008-11-09 22:29:28 +00:00
{
2016-07-12 00:40:13 +00:00
if ( i = = - 1 )
2014-04-24 01:53:01 +00:00
break ;
2020-01-09 15:35:40 +00:00
QCFAULT ( & progfuncs - > funcs , " bad pointer write in %s " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) ;
2008-11-09 22:29:28 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2004-08-23 01:38:21 +00:00
ptr - > _int = ( int ) OPA - > _float ;
break ;
case OP_STOREP_I :
case OP_STOREP_F :
case OP_STOREP_ENT :
case OP_STOREP_FLD : // integers
case OP_STOREP_S :
case OP_STOREP_FNC : // pointers
2020-06-27 19:32:08 +00:00
i = OPB - > _int + OPC - > _int * sizeof ( ptr - > _int ) ;
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( ptr - > _int ) ) )
2008-11-09 22:29:28 +00:00
{
2020-06-27 19:32:08 +00:00
if ( ! ( ptr = PR_GetWriteTempStringPtr ( progfuncs , OPB - > _int , OPC - > _int * sizeof ( ptr - > _int ) , sizeof ( ptr - > _int ) ) ) )
{
if ( i = = - 1 )
break ;
if ( i = = 0 )
QCFAULT ( & progfuncs - > funcs , " bad pointer write in %s (null pointer) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) ;
else
QCFAULT ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , prinst . addressableused ) ;
}
2008-11-09 22:29:28 +00:00
}
2020-06-27 19:32:08 +00:00
else
ptr = QCPOINTERM ( i ) ;
2004-08-23 01:38:21 +00:00
ptr - > _int = OPA - > _int ;
break ;
case OP_STOREP_V :
2020-06-27 19:32:08 +00:00
i = OPB - > _int + ( OPC - > _int * sizeof ( ptr - > _int ) ) ;
2020-06-27 19:32:49 +00:00
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( pvec3_t ) ) )
2008-11-09 22:29:28 +00:00
{
2020-06-27 19:32:49 +00:00
if ( ! ( ptr = PR_GetWriteTempStringPtr ( progfuncs , OPB - > _int , OPC - > _int * sizeof ( ptr - > _int ) , sizeof ( pvec3_t ) ) ) )
2020-06-27 19:32:08 +00:00
{
if ( i = = - 1 )
break ;
QCFAULT ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , prinst . addressableused ) ;
}
2008-11-09 22:29:28 +00:00
}
2020-06-27 19:32:08 +00:00
else
ptr = QCPOINTERM ( i ) ;
2005-11-29 13:30:20 +00:00
ptr - > _vector [ 0 ] = OPA - > _vector [ 0 ] ;
ptr - > _vector [ 1 ] = OPA - > _vector [ 1 ] ;
ptr - > _vector [ 2 ] = OPA - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
case OP_STOREP_C : //store character in a string
2020-06-27 19:32:08 +00:00
i = OPB - > _int + ( OPC - > _int ) * sizeof ( char ) ;
2016-07-12 00:40:13 +00:00
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( char ) ) )
2008-11-09 22:29:28 +00:00
{
2020-06-27 19:32:08 +00:00
if ( ! ( ptr = PR_GetWriteTempStringPtr ( progfuncs , OPB - > _int , OPC - > _int * sizeof ( char ) , sizeof ( char ) ) ) )
{
if ( i = = - 1 )
break ;
QCFAULT ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , prinst . addressableused ) ;
}
2008-11-09 22:29:28 +00:00
}
2020-06-27 19:32:08 +00:00
else
ptr = QCPOINTERM ( i ) ;
2004-08-23 01:38:21 +00:00
* ( unsigned char * ) ptr = ( char ) OPA - > _float ;
break ;
2020-05-30 12:12:46 +00:00
case OP_STOREF_F :
case OP_STOREF_I :
case OP_STOREF_S :
errorif ( ( unsigned ) OPA - > edict > = ( unsigned ) num_edicts )
{
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_STOREF_? references invalid entity in %s \n " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
return prinst . pr_xstatement ;
break ;
}
ed = PROG_TO_EDICT_PB ( progfuncs , OPA - > edict ) ;
errorif ( ! ed | | ed - > readonly )
{ //boot it over to the debugger
# if INTSIZE == 16
ddef16_t * d = ED_GlobalAtOfs16 ( progfuncs , st - > a ) ;
# else
ddef32_t * d = ED_GlobalAtOfs32 ( progfuncs , st - > a ) ;
# endif
fdef_t * f = ED_FieldAtOfs ( progfuncs , OPB - > _int + progfuncs - > funcs . fieldadjust ) ;
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " assignment to read-only entity %i in %s (%s.%s) \n " , OPA - > edict , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , d ? PR_StringToNative ( & progfuncs - > funcs , d - > s_name ) : " ?? " , f ? f - > name : " ?? " ) )
return prinst . pr_xstatement ;
break ;
}
//Whilst the next block would technically be correct, we don't use it as it breaks too many quake mods.
# ifdef NOLEGACY
errorif ( ed - > ereftype = = ER_FREE )
{
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " assignment to free entity in %s " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
return prinst . pr_xstatement ;
break ;
}
# endif
i = OPB - > _int + progfuncs - > funcs . fieldadjust ;
errorif ( ( unsigned int ) i * 4 > = ed - > fieldsize ) //FIXME:lazy size check
{
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_STOREF_? references invalid field %i in %s \n " , OPB - > _int , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
return prinst . pr_xstatement ;
break ;
}
ptr = ( eval_t * ) ( ( ( int * ) edvars ( ed ) ) + i ) ;
ptr - > _int = OPC - > _int ;
break ;
case OP_STOREF_V :
errorif ( ( unsigned ) OPA - > edict > = ( unsigned ) num_edicts )
{
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_STOREF_? references invalid entity in %s \n " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
return prinst . pr_xstatement ;
break ;
}
ed = PROG_TO_EDICT_PB ( progfuncs , OPA - > edict ) ;
errorif ( ! ed | | ed - > readonly )
{ //boot it over to the debugger
# if INTSIZE == 16
ddef16_t * d = ED_GlobalAtOfs16 ( progfuncs , st - > a ) ;
# else
ddef32_t * d = ED_GlobalAtOfs32 ( progfuncs , st - > a ) ;
# endif
fdef_t * f = ED_FieldAtOfs ( progfuncs , OPB - > _int + progfuncs - > funcs . fieldadjust ) ;
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " assignment to read-only entity %i in %s (%s.%s) \n " , OPA - > edict , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , d ? PR_StringToNative ( & progfuncs - > funcs , d - > s_name ) : " ?? " , f ? f - > name : " ?? " ) )
return prinst . pr_xstatement ;
break ;
}
//Whilst the next block would technically be correct, we don't use it as it breaks too many quake mods.
# ifdef NOLEGACY
errorif ( ed - > ereftype = = ER_FREE )
{
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " assignment to free entity in %s " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
return prinst . pr_xstatement ;
break ;
}
# endif
i = OPB - > _int + progfuncs - > funcs . fieldadjust ;
errorif ( ( unsigned int ) i * 4 > = ed - > fieldsize ) //FIXME:lazy size check
{
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_STOREF_? references invalid field %i in %s \n " , OPB - > _int , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
return prinst . pr_xstatement ;
break ;
}
ptr = ( eval_t * ) ( ( ( int * ) edvars ( ed ) ) + i ) ;
ptr - > _vector [ 0 ] = OPC - > _vector [ 0 ] ;
ptr - > _vector [ 1 ] = OPC - > _vector [ 1 ] ;
ptr - > _vector [ 2 ] = OPC - > _vector [ 2 ] ;
break ;
2004-08-23 01:38:21 +00:00
//get a pointer to a field var
case OP_ADDRESS :
2015-09-01 04:45:15 +00:00
errorif ( ( unsigned ) OPA - > edict > = ( unsigned ) num_edicts )
2008-12-23 02:55:20 +00:00
{
2020-01-09 15:35:40 +00:00
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_ADDRESS references invalid entity in %s \n " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
2019-12-10 14:50:47 +00:00
return prinst . pr_xstatement ;
2013-04-13 08:15:18 +00:00
break ;
2008-12-23 02:55:20 +00:00
}
2018-04-06 17:21:15 +00:00
ed = PROG_TO_EDICT_PB ( progfuncs , OPA - > edict ) ;
2004-08-23 01:38:21 +00:00
# ifdef PARANOID
NUM_FOR_EDICT ( ed ) ; // make sure it's in range
# endif
2015-09-01 04:45:15 +00:00
errorif ( ! ed | | ed - > readonly )
2004-11-08 11:46:34 +00:00
{
2013-04-13 08:15:18 +00:00
2008-12-23 02:55:20 +00:00
//boot it over to the debugger
2010-02-06 01:25:04 +00:00
{
2017-08-14 16:38:44 +00:00
# if INTSIZE == 16
ddef16_t * d = ED_GlobalAtOfs16 ( progfuncs , st - > a ) ;
# else
ddef32_t * d = ED_GlobalAtOfs32 ( progfuncs , st - > a ) ;
# endif
fdef_t * f = ED_FieldAtOfs ( progfuncs , OPB - > _int + progfuncs - > funcs . fieldadjust ) ;
2020-01-09 15:35:40 +00:00
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " assignment to read-only entity %i in %s (%s.%s) \n " , OPA - > edict , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , d ? PR_StringToNative ( & progfuncs - > funcs , d - > s_name ) : " ?? " , f ? f - > name : " ?? " ) )
2019-12-10 14:50:47 +00:00
return prinst . pr_xstatement ;
2014-04-24 01:53:01 +00:00
OPC - > _int = ~ 0 ;
break ;
2010-02-06 01:25:04 +00:00
}
2004-11-08 11:46:34 +00:00
}
2005-11-26 03:02:55 +00:00
//Whilst the next block would technically be correct, we don't use it as it breaks too many quake mods.
2015-09-01 04:45:15 +00:00
# ifdef NOLEGACY
2015-09-14 15:20:09 +00:00
errorif ( ed - > ereftype = = ER_FREE )
2015-09-01 04:45:15 +00:00
{
2020-01-09 15:35:40 +00:00
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " assignment to free entity in %s " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
2019-12-10 14:50:47 +00:00
return prinst . pr_xstatement ;
2015-09-01 04:45:15 +00:00
break ;
}
# endif
2016-07-12 00:40:13 +00:00
i = OPB - > _int + progfuncs - > funcs . fieldadjust ;
# ifdef PARANOID
errorif ( ( unsigned int ) i * 4 > = ed - > fieldsize ) //FIXME:lazy size check
{
2020-01-09 15:35:40 +00:00
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_ADDRESS references invalid field %i in %s \n " , OPB - > _int , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
2019-12-10 14:50:47 +00:00
return prinst . pr_xstatement ;
2016-07-12 00:40:13 +00:00
OPC - > _int = 0 ;
break ;
}
# endif
OPC - > _int = ENGINEPOINTER ( ( ( ( int * ) edvars ( ed ) ) + i ) ) ;
2004-08-23 01:38:21 +00:00
break ;
//load a field to a value
2013-03-12 22:44:00 +00:00
case OP_LOAD_P :
2004-08-23 01:38:21 +00:00
case OP_LOAD_I :
case OP_LOAD_F :
case OP_LOAD_FLD :
case OP_LOAD_ENT :
case OP_LOAD_S :
case OP_LOAD_FNC :
2015-09-01 04:45:15 +00:00
errorif ( ( unsigned ) OPA - > edict > = ( unsigned ) num_edicts )
2013-03-12 22:32:25 +00:00
{
2020-01-09 15:35:40 +00:00
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_LOAD references invalid entity %i in %s \n " , OPA - > edict , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
2019-12-10 14:50:47 +00:00
return prinst . pr_xstatement ;
2014-10-11 19:39:45 +00:00
OPC - > _int = 0 ;
break ;
2013-03-12 22:32:25 +00:00
}
2018-04-06 17:21:15 +00:00
ed = PROG_TO_EDICT_PB ( progfuncs , OPA - > edict ) ;
2004-08-23 01:38:21 +00:00
# ifdef PARANOID
NUM_FOR_EDICT ( ed ) ; // make sure it's in range
# endif
2015-09-01 04:45:15 +00:00
# ifdef NOLEGACY
2015-09-14 15:20:09 +00:00
if ( ed - > ereftype = = ER_FREE )
2015-09-06 03:30:28 +00:00
{
2020-01-09 15:35:40 +00:00
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_LOAD references free entity %i in %s \n " , OPA - > edict , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
2019-12-10 14:50:47 +00:00
return prinst . pr_xstatement ;
2015-09-01 04:45:15 +00:00
OPC - > _int = 0 ;
2015-09-06 03:30:28 +00:00
}
2015-09-01 04:45:15 +00:00
else
# endif
{
2016-07-12 00:40:13 +00:00
i = OPB - > _int + progfuncs - > funcs . fieldadjust ;
errorif ( ( unsigned int ) i * 4 > = ed - > fieldsize ) //FIXME:lazy size check
{
2020-01-09 15:35:40 +00:00
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_LOAD references invalid field %i in %s \n " , OPB - > _int , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
2019-12-10 14:50:47 +00:00
return prinst . pr_xstatement ;
2016-07-12 00:40:13 +00:00
OPC - > _int = 0 ;
break ;
}
ptr = ( eval_t * ) ( ( ( int * ) edvars ( ed ) ) + i ) ;
2015-09-01 04:45:15 +00:00
OPC - > _int = ptr - > _int ;
}
2004-08-23 01:38:21 +00:00
break ;
case OP_LOAD_V :
2015-09-01 04:45:15 +00:00
errorif ( ( unsigned ) OPA - > edict > = ( unsigned ) num_edicts )
2013-03-12 22:32:25 +00:00
{
2020-01-09 15:35:40 +00:00
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_LOAD_V references invalid entity %i in %s \n " , OPA - > edict , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
2019-12-10 14:50:47 +00:00
return prinst . pr_xstatement ;
2014-10-11 19:39:45 +00:00
OPC - > _vector [ 0 ] = 0 ;
OPC - > _vector [ 1 ] = 0 ;
OPC - > _vector [ 2 ] = 0 ;
break ;
2013-03-12 22:32:25 +00:00
}
2018-04-06 17:21:15 +00:00
ed = PROG_TO_EDICT_PB ( progfuncs , OPA - > edict ) ;
2004-08-23 01:38:21 +00:00
# ifdef PARANOID
NUM_FOR_EDICT ( ed ) ; // make sure it's in range
# endif
2015-09-01 04:45:15 +00:00
# ifdef NOLEGACY
2015-09-14 15:20:09 +00:00
if ( ed - > ereftype = = ER_FREE )
2015-09-01 04:45:15 +00:00
{
2020-01-09 15:35:40 +00:00
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_LOAD references free entity %i in %s \n " , OPA - > edict , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
2019-12-10 14:50:47 +00:00
return prinst . pr_xstatement ;
2015-09-01 04:45:15 +00:00
OPC - > _vector [ 0 ] = 0 ;
OPC - > _vector [ 1 ] = 0 ;
OPC - > _vector [ 2 ] = 0 ;
}
else
# endif
{
2016-07-12 00:40:13 +00:00
i = OPB - > _int + progfuncs - > funcs . fieldadjust ;
errorif ( ( unsigned int ) i * 4 > = ed - > fieldsize ) //FIXME:lazy size check
{
2020-01-09 15:35:40 +00:00
if ( PR_ExecRunWarning ( & progfuncs - > funcs , st - pr_statements , " OP_LOAD references invalid field %i in %s \n " , OPB - > _int , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) )
2019-12-10 14:50:47 +00:00
return prinst . pr_xstatement ;
2016-07-12 00:40:13 +00:00
OPC - > _int = 0 ;
break ;
}
ptr = ( eval_t * ) ( ( ( int * ) edvars ( ed ) ) + i ) ;
2015-09-01 04:45:15 +00:00
OPC - > _vector [ 0 ] = ptr - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = ptr - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = ptr - > _vector [ 2 ] ;
}
2004-08-23 01:38:21 +00:00
break ;
2016-11-15 22:22:04 +00:00
2004-08-23 01:38:21 +00:00
//==================
2009-08-29 14:56:42 +00:00
case OP_IFNOT_S :
2004-08-23 01:38:21 +00:00
RUNAWAYCHECK ( ) ;
------------------------------------------------------------------------
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 ( ! OPA - > string | | ! PR_StringToNative ( & progfuncs - > funcs , OPA - > string ) )
2004-08-23 01:38:21 +00:00
st + = ( sofs ) st - > b - 1 ; // offset the s++
break ;
2009-08-29 14:56:42 +00:00
case OP_IFNOT_F :
RUNAWAYCHECK ( ) ;
2016-11-15 22:22:04 +00:00
if ( ! EVAL_FLOATISTRUE ( OPA ) )
2009-08-29 14:56:42 +00:00
st + = ( sofs ) st - > b - 1 ; // offset the s++
break ;
2016-11-15 22:22:04 +00:00
//WARNING: vanilla uses this for floats too, which results in a discrepancy with -0
2011-07-08 18:59:48 +00:00
case OP_IFNOT_I :
2004-08-23 01:38:21 +00:00
RUNAWAYCHECK ( ) ;
if ( ! OPA - > _int )
st + = ( sofs ) st - > b - 1 ; // offset the s++
break ;
2009-08-29 14:56:42 +00:00
case OP_IF_S :
2004-08-23 01:38:21 +00:00
RUNAWAYCHECK ( ) ;
------------------------------------------------------------------------
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 ( OPA - > string & & PR_StringToNative ( & progfuncs - > funcs , OPA - > string ) )
2004-08-23 01:38:21 +00:00
st + = ( sofs ) st - > b - 1 ; // offset the s++
break ;
2009-08-29 14:56:42 +00:00
case OP_IF_F :
RUNAWAYCHECK ( ) ;
2016-11-15 22:22:04 +00:00
if ( EVAL_FLOATISTRUE ( OPA ) )
2009-08-29 14:56:42 +00:00
st + = ( sofs ) st - > b - 1 ; // offset the s++
break ;
2016-11-15 22:22:04 +00:00
//WARNING: vanilla uses this for floats too, which results in a discrepancy with -0
2011-07-08 18:59:48 +00:00
case OP_IF_I :
2004-08-23 01:38:21 +00:00
RUNAWAYCHECK ( ) ;
if ( OPA - > _int )
st + = ( sofs ) st - > b - 1 ; // offset the s++
break ;
2016-11-15 22:22:04 +00:00
2004-08-23 01:38:21 +00:00
case OP_GOTO :
RUNAWAYCHECK ( ) ;
st + = ( sofs ) st - > a - 1 ; // offset the s++
break ;
case OP_CALL8H :
case OP_CALL7H :
case OP_CALL6H :
case OP_CALL5H :
case OP_CALL4H :
case OP_CALL3H :
case OP_CALL2H :
2005-11-29 13:30:20 +00:00
G_VECTOR ( OFS_PARM1 ) [ 0 ] = OPC - > _vector [ 0 ] ;
G_VECTOR ( OFS_PARM1 ) [ 1 ] = OPC - > _vector [ 1 ] ;
G_VECTOR ( OFS_PARM1 ) [ 2 ] = OPC - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
case OP_CALL1H :
2005-11-29 13:30:20 +00:00
G_VECTOR ( OFS_PARM0 ) [ 0 ] = OPB - > _vector [ 0 ] ;
G_VECTOR ( OFS_PARM0 ) [ 1 ] = OPB - > _vector [ 1 ] ;
G_VECTOR ( OFS_PARM0 ) [ 2 ] = OPB - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
case OP_CALL8 :
case OP_CALL7 :
case OP_CALL6 :
case OP_CALL5 :
case OP_CALL4 :
case OP_CALL3 :
case OP_CALL2 :
case OP_CALL1 :
case OP_CALL0 :
2011-10-03 02:45:44 +00:00
{
2012-11-27 03:23:19 +00:00
int callerprogs ;
int newpr ;
unsigned int fnum ;
RUNAWAYCHECK ( ) ;
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2004-08-23 01:38:21 +00:00
2015-02-02 08:01:53 +00:00
if ( op > OP_CALL8 )
progfuncs - > funcs . callargc = op - ( OP_CALL1H - 1 ) ;
2012-11-27 03:23:19 +00:00
else
2015-02-02 08:01:53 +00:00
progfuncs - > funcs . callargc = op - OP_CALL0 ;
2012-11-27 03:23:19 +00:00
fnum = OPA - > function ;
2004-08-23 01:38:21 +00:00
2014-03-31 17:06:41 +00:00
glob = NULL ; //try to derestrict it.
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
callerprogs = prinst . pr_typecurrent ; //so we can revert to the right caller.
2012-11-27 03:23:19 +00:00
newpr = ( fnum & 0xff000000 ) > > 24 ; //this is the progs index of the callee
fnum & = ~ 0xff000000 ; //the callee's function index.
2004-08-23 01:38:21 +00:00
2012-11-27 03:23:19 +00:00
//if it's an external call, switch now (before any function pointers are used)
2015-09-01 04:45:15 +00:00
errorif ( ! PR_SwitchProgsParms ( progfuncs , newpr ) | | ! fnum | | fnum > pr_progs - > numfunctions )
2011-10-03 02:45:44 +00:00
{
2013-03-17 12:16:06 +00:00
char * msg = fnum ? " OP_CALL references invalid function in %s \n " : " NULL function from qc (inside %s). \n " ;
2012-11-27 03:23:19 +00:00
PR_SwitchProgsParms ( progfuncs , callerprogs ) ;
2015-02-02 08:01:53 +00:00
glob = pr_globals ;
if ( ! progfuncs - > funcs . debug_trace )
2020-01-09 15:35:40 +00:00
QCFAULT ( & progfuncs - > funcs , msg , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) ;
2015-02-02 08:01:53 +00:00
//skip the instruction if they just try stepping over it anyway.
2014-05-30 03:57:30 +00:00
PR_StackTrace ( & progfuncs - > funcs , 0 ) ;
2020-01-09 15:35:40 +00:00
externs - > Printf ( msg , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) ;
2014-04-03 02:16:21 +00:00
2012-11-27 03:23:19 +00:00
pr_globals [ OFS_RETURN ] = 0 ;
pr_globals [ OFS_RETURN + 1 ] = 0 ;
pr_globals [ OFS_RETURN + 2 ] = 0 ;
break ;
2011-10-03 02:45:44 +00:00
}
2012-11-27 03:23:19 +00:00
2014-08-03 14:47:47 +00:00
newf = & pr_cp_functions [ fnum & ~ 0xff000000 ] ;
2012-11-27 03:23:19 +00:00
2015-02-02 08:01:53 +00:00
if ( newf - > first_statement < = 0 )
2012-11-27 03:23:19 +00:00
{ // negative statements are built in functions
/*calling a builtin in another progs may affect that other progs' globals instead, is the theory anyway, so args and stuff need to move over*/
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 ( prinst . pr_typecurrent ! = 0 )
2004-08-23 01:38:21 +00:00
{
2014-03-31 17:06:41 +00:00
//builtins quite hackily refer to only a single global.
//for builtins to affect the globals of other progs, we need to first switch to the progs that it will affect, so they'll be correct when we switch back
2012-11-27 03:23:19 +00:00
PR_SwitchProgsParms ( progfuncs , 0 ) ;
2004-08-23 01:38:21 +00:00
}
2012-11-27 03:23:19 +00:00
i = - newf - > first_statement ;
if ( i < externs - > numglobalbuiltins )
2004-08-23 01:38:21 +00:00
{
2015-01-21 18:18:37 +00:00
# ifndef QCGC
------------------------------------------------------------------------
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
prinst . numtempstringsstack = prinst . numtempstrings ;
2015-01-21 18:18:37 +00:00
# endif
------------------------------------------------------------------------
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
( * externs - > globalbuiltins [ i ] ) ( & progfuncs - > funcs , ( struct globalvars_s * ) current_progstate - > globals ) ;
2015-09-01 04:45:15 +00:00
//in case ed_alloc was called
num_edicts = sv_num_edicts ;
2004-08-23 01:38:21 +00:00
}
else
2020-08-13 08:39:48 +00:00
PR_RunError ( & progfuncs - > funcs , " Bad builtin call number - %i " , - newf - > first_statement ) ;
2012-11-27 03:23:19 +00:00
PR_SwitchProgsParms ( progfuncs , ( progsnum_t ) callerprogs ) ;
2014-03-31 17:06:41 +00:00
//decide weather non debugger wants to start debugging.
2020-01-09 15:35:40 +00:00
return prinst . pr_xstatement ;
2004-08-23 01:38:21 +00:00
}
2012-11-27 03:23:19 +00:00
s = PR_EnterFunction ( progfuncs , newf , callerprogs ) ;
st = & pr_statements [ s ] ;
2011-10-03 02:45:44 +00:00
}
2004-08-23 01:38:21 +00:00
2014-03-31 17:06:41 +00:00
//resume at the new statement, which might be in a different progs
return s ;
2004-08-23 01:38:21 +00:00
case OP_DONE :
case OP_RETURN :
RUNAWAYCHECK ( ) ;
2014-03-31 17:06:41 +00:00
glob [ OFS_RETURN ] = glob [ st - > a ] ;
glob [ OFS_RETURN + 1 ] = glob [ st - > a + 1 ] ;
glob [ OFS_RETURN + 2 ] = glob [ st - > a + 2 ] ;
2020-08-13 08:39:48 +00:00
2004-08-23 01:38:21 +00:00
s = PR_LeaveFunction ( progfuncs ) ;
st = & pr_statements [ s ] ;
2019-12-10 14:50:47 +00:00
if ( prinst . pr_depth = = prinst . exitdepth )
2020-01-10 12:23:25 +00:00
{
prinst . pr_xstatement = s ;
2014-03-31 17:06:41 +00:00
return - 1 ; // all done
2004-08-23 01:38:21 +00:00
}
2014-03-31 17:06:41 +00:00
return s ;
2004-08-23 01:38:21 +00:00
// break;
case OP_STATE :
------------------------------------------------------------------------
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
externs - > stateop ( & progfuncs - > funcs , OPA - > _float , OPB - > function ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_ADD_I :
OPC - > _int = OPA - > _int + OPB - > _int ;
break ;
case OP_ADD_FI :
OPC - > _float = OPA - > _float + ( float ) OPB - > _int ;
break ;
case OP_ADD_IF :
OPC - > _float = ( float ) OPA - > _int + OPB - > _float ;
break ;
case OP_SUB_I :
OPC - > _int = OPA - > _int - OPB - > _int ;
break ;
case OP_SUB_FI :
OPC - > _float = OPA - > _float - ( float ) OPB - > _int ;
break ;
case OP_SUB_IF :
OPC - > _float = ( float ) OPA - > _int - OPB - > _float ;
break ;
case OP_CONV_ITOF :
OPC - > _float = ( float ) OPA - > _int ;
break ;
case OP_CONV_FTOI :
OPC - > _int = ( int ) OPA - > _float ;
break ;
2020-07-13 17:48:16 +00:00
case OP_LOADP_ITOF :
2018-09-23 19:35:24 +00:00
i = OPA - > _int ;
errorif ( QCPOINTERREADFAIL ( i , sizeof ( char ) ) )
{
2020-01-09 15:35:40 +00:00
QCFAULT ( & progfuncs - > funcs , " bad pointer read in %s (%#x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , OPA - > _int ) ;
2018-09-23 19:35:24 +00:00
}
ptr = QCPOINTERM ( i ) ;
2004-08-23 01:38:21 +00:00
OPC - > _float = ( float ) ptr - > _int ;
break ;
2020-07-13 17:48:16 +00:00
case OP_LOADP_FTOI :
2018-09-23 19:35:24 +00:00
i = OPA - > _int ;
errorif ( QCPOINTERREADFAIL ( i , sizeof ( char ) ) )
{
2020-01-09 15:35:40 +00:00
QCFAULT ( & progfuncs - > funcs , " bad pointer read in %s (%#x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , OPA - > _int ) ;
2018-09-23 19:35:24 +00:00
}
ptr = QCPOINTERM ( i ) ;
2004-08-23 01:38:21 +00:00
OPC - > _int = ( int ) ptr - > _float ;
break ;
case OP_BITAND_I :
OPC - > _int = ( OPA - > _int & OPB - > _int ) ;
break ;
case OP_BITOR_I :
OPC - > _int = ( OPA - > _int | OPB - > _int ) ;
break ;
case OP_MUL_I :
OPC - > _int = OPA - > _int * OPB - > _int ;
break ;
case OP_DIV_I :
if ( OPB - > _int = = 0 ) //no division by zero allowed...
OPC - > _int = 0 ;
else
OPC - > _int = OPA - > _int / OPB - > _int ;
break ;
case OP_EQ_I :
OPC - > _int = ( OPA - > _int = = OPB - > _int ) ;
break ;
case OP_NE_I :
OPC - > _int = ( OPA - > _int ! = OPB - > _int ) ;
break ;
2011-07-08 18:59:48 +00:00
//array/structure reading/writing.
2005-03-28 00:11:59 +00:00
case OP_GLOBALADDRESS :
2011-09-03 03:49:43 +00:00
OPC - > _int = ENGINEPOINTER ( & OPA - > _int + OPB - > _int ) ; /*pointer arithmatic*/
2004-08-23 01:38:21 +00:00
break ;
2013-09-26 14:36:52 +00:00
case OP_ADD_PIW : //pointer to 32 bit (remember to *3 for vectors)
OPC - > _int = OPA - > _int + OPB - > _int * sizeof ( float ) ;
2004-08-23 01:38:21 +00:00
break ;
2005-08-03 23:14:59 +00:00
2004-08-23 01:38:21 +00:00
case OP_LOADA_I :
case OP_LOADA_F :
case OP_LOADA_FLD :
case OP_LOADA_ENT :
case OP_LOADA_S :
case OP_LOADA_FNC :
2017-11-04 04:01:33 +00:00
i = st - > a + OPB - > _int ;
2020-05-30 12:12:46 +00:00
if ( ( size_t ) i > = ( size_t ) ( current_progstate - > globals_bytes > > 2 ) )
2017-11-04 04:01:33 +00:00
{
2020-01-09 15:35:40 +00:00
QCFAULT ( & progfuncs - > funcs , " bad array read in %s (index %i) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , OPB - > _int ) ;
2017-11-04 04:01:33 +00:00
}
else
OPC - > _int = ( ( eval_t * ) & glob [ i ] ) - > _int ;
2004-08-23 01:38:21 +00:00
break ;
case OP_LOADA_V :
2017-11-04 04:01:33 +00:00
i = st - > a + OPB - > _int ;
2020-05-30 12:12:46 +00:00
if ( ( size_t ) ( i ) > = ( size_t ) ( current_progstate - > globals_bytes > > 2 ) - 2u )
2017-11-04 04:01:33 +00:00
{
2020-01-09 15:35:40 +00:00
QCFAULT ( & progfuncs - > funcs , " bad array read in %s (index %i) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , OPB - > _int ) ;
2017-11-04 04:01:33 +00:00
}
else
{
OPC - > _vector [ 0 ] = ( ( eval_t * ) & glob [ i ] ) - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = ( ( eval_t * ) & glob [ i ] ) - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = ( ( eval_t * ) & glob [ i ] ) - > _vector [ 2 ] ;
}
2004-08-23 01:38:21 +00:00
break ;
case OP_ADD_SF : //(char*)c = (char*)a + (float)b
OPC - > _int = OPA - > _int + ( int ) OPB - > _float ;
break ;
case OP_SUB_S : //(float)c = (char*)a - (char*)b
OPC - > _int = OPA - > _int - OPB - > _int ;
break ;
2014-09-05 19:17:57 +00:00
case OP_LOADP_C : //load character from a string/pointer
2020-06-27 19:32:08 +00:00
i = ( unsigned int ) OPA - > _int + ( int ) OPB - > _float ;
2016-07-12 00:40:13 +00:00
errorif ( QCPOINTERREADFAIL ( i , sizeof ( char ) ) )
2011-12-05 15:23:40 +00:00
{
2020-06-27 19:32:08 +00:00
if ( ! ( ptr = PR_GetReadTempStringPtr ( progfuncs , OPA - > _int , OPB - > _float , sizeof ( char ) ) ) )
2012-01-28 10:30:44 +00:00
{
2016-07-12 00:40:13 +00:00
if ( i = = - 1 )
{
OPC - > _int = 0 ;
break ;
}
2020-01-09 15:35:40 +00:00
QCFAULT ( & progfuncs - > funcs , " bad pointer read in %s (%i bytes into %s) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , ptr ) ;
2012-01-28 10:30:44 +00:00
}
2011-12-05 15:23:40 +00:00
}
2012-01-28 10:30:44 +00:00
else
ptr = QCPOINTERM ( i ) ;
2004-08-23 01:38:21 +00:00
OPC - > _float = * ( unsigned char * ) ptr ;
break ;
case OP_LOADP_I :
case OP_LOADP_F :
case OP_LOADP_FLD :
case OP_LOADP_ENT :
case OP_LOADP_S :
case OP_LOADP_FNC :
2011-12-05 15:23:40 +00:00
i = OPA - > _int + OPB - > _int * 4 ;
2016-07-12 00:40:13 +00:00
errorif ( QCPOINTERREADFAIL ( i , sizeof ( int ) ) )
2011-12-05 15:23:40 +00:00
{
2016-07-12 00:40:13 +00:00
if ( ! ( ptr = PR_GetReadTempStringPtr ( progfuncs , OPA - > _int , OPB - > _int * 4 , sizeof ( int ) ) ) )
2014-05-18 23:02:04 +00:00
{
2016-07-12 00:40:13 +00:00
if ( i = = - 1 )
{
OPC - > _int = 0 ;
break ;
}
2020-01-09 15:35:40 +00:00
QCFAULT ( & progfuncs - > funcs , " bad pointer read in %s (from %#x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i ) ;
2014-05-18 23:02:04 +00:00
}
2011-12-05 15:23:40 +00:00
}
2016-07-12 00:40:13 +00:00
else
ptr = QCPOINTERM ( i ) ;
2004-08-23 01:38:21 +00:00
OPC - > _int = ptr - > _int ;
break ;
case OP_LOADP_V :
2015-09-14 10:36:42 +00:00
i = OPA - > _int + OPB - > _int * 4 ; //NOTE: inconsistant, but a bit more practical for the qcc when structs etc are involved
2020-06-27 19:32:49 +00:00
errorif ( QCPOINTERREADFAIL ( i , sizeof ( pvec3_t ) ) )
2011-12-05 15:23:40 +00:00
{
2020-06-27 19:32:49 +00:00
if ( ! ( ptr = PR_GetReadTempStringPtr ( progfuncs , OPA - > _int , OPB - > _int * 4 , sizeof ( pvec3_t ) ) ) )
2014-05-18 23:02:04 +00:00
{
2016-07-12 00:40:13 +00:00
if ( i = = - 1 )
{
OPC - > _vector [ 0 ] = 0 ;
OPC - > _vector [ 1 ] = 0 ;
OPC - > _vector [ 2 ] = 0 ;
break ;
}
2020-01-09 15:35:40 +00:00
QCFAULT ( & progfuncs - > funcs , " bad pointer read in %s (from %#x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i ) ;
2014-05-18 23:02:04 +00:00
}
2011-12-05 15:23:40 +00:00
}
2016-07-12 00:40:13 +00:00
else
ptr = QCPOINTERM ( i ) ;
2005-11-29 13:30:20 +00:00
OPC - > _vector [ 0 ] = ptr - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = ptr - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = ptr - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
2015-02-02 08:01:53 +00:00
case OP_BITXOR_I :
2004-08-23 01:38:21 +00:00
OPC - > _int = OPA - > _int ^ OPB - > _int ;
break ;
case OP_RSHIFT_I :
OPC - > _int = OPA - > _int > > OPB - > _int ;
break ;
case OP_LSHIFT_I :
OPC - > _int = OPA - > _int < < OPB - > _int ;
break ;
2014-09-17 03:04:08 +00:00
//hexen2 arrays contain a prefix global set to (arraysize-1) inserted before the actual array data
//for vectors, this prefix is the number of vectors rather than the number of globals. this can cause issues with using OP_FETCH_GBL_V within structs.
2004-08-23 01:38:21 +00:00
case OP_FETCH_GBL_F :
case OP_FETCH_GBL_S :
case OP_FETCH_GBL_E :
case OP_FETCH_GBL_FNC :
2014-09-17 03:04:08 +00:00
i = OPB - > _float ;
2015-09-01 04:45:15 +00:00
errorif ( ( unsigned ) i > ( unsigned ) ( ( eval_t * ) & glob [ st - > a - 1 ] ) - > _int )
2004-08-23 01:38:21 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
------------------------------------------------------------------------
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
PR_RunError ( & progfuncs - > funcs , " array index out of bounds: %s[%d] (max %d) " , PR_GlobalStringNoContents ( progfuncs , st - > a ) , i , ( ( eval_t * ) & glob [ st - > a - 1 ] ) - > _int ) ;
2004-08-23 01:38:21 +00:00
}
2014-09-17 03:04:08 +00:00
OPC - > _int = ( ( eval_t * ) & glob [ st - > a + i ] ) - > _int ;
2004-08-23 01:38:21 +00:00
break ;
case OP_FETCH_GBL_V :
2014-09-17 03:04:08 +00:00
i = OPB - > _float ;
2015-09-01 04:45:15 +00:00
errorif ( ( unsigned ) i > ( unsigned ) ( ( eval_t * ) & glob [ st - > a - 1 ] ) - > _int )
2004-08-23 01:38:21 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
------------------------------------------------------------------------
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
PR_RunError ( & progfuncs - > funcs , " array index out of bounds: %s[%d] " , PR_GlobalStringNoContents ( progfuncs , st - > a ) , i ) ;
2004-08-23 01:38:21 +00:00
}
2014-09-17 03:04:08 +00:00
ptr = ( eval_t * ) & glob [ st - > a + i * 3 ] ;
OPC - > _vector [ 0 ] = ptr - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = ptr - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = ptr - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
case OP_CSTATE :
2020-01-09 15:35:40 +00:00
externs - > cstateop ( & progfuncs - > funcs , OPA - > _float , OPB - > _float , prinst . pr_xfunction - pr_cp_functions ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_CWSTATE :
2020-01-09 15:35:40 +00:00
externs - > cwstateop ( & progfuncs - > funcs , OPA - > _float , OPB - > _float , prinst . pr_xfunction - pr_cp_functions ) ;
2004-08-23 01:38:21 +00:00
break ;
case OP_THINKTIME :
2018-04-06 17:21:15 +00:00
externs - > thinktimeop ( & progfuncs - > funcs , ( struct edict_s * ) PROG_TO_EDICT_UB ( progfuncs , OPA - > edict ) , OPB - > _float ) ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
case OP_MULSTORE_F :
/*OPC->_float = */ OPB - > _float * = OPA - > _float ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
case OP_MULSTORE_VF :
tmpf = OPA - > _float ; //don't break on vec*=vec_x;
/*OPC->_vector[0] = */ OPB - > _vector [ 0 ] * = tmpf ;
/*OPC->_vector[1] = */ OPB - > _vector [ 1 ] * = tmpf ;
/*OPC->_vector[2] = */ OPB - > _vector [ 2 ] * = tmpf ;
break ;
case OP_MULSTOREP_F :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( float ) ) )
2011-12-05 15:23:40 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
PR_RunError ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , ( unsigned ) prinst . addressableused ) ;
2014-09-17 03:04:08 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2014-09-17 03:04:08 +00:00
OPC - > _float = ptr - > _float * = OPA - > _float ;
break ;
case OP_MULSTOREP_VF :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
2020-08-03 10:34:44 +00:00
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( pvec3_t ) ) )
2014-09-17 03:04:08 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
PR_RunError ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , ( unsigned ) prinst . addressableused ) ;
2011-12-05 15:23:40 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2014-09-17 03:04:08 +00:00
tmpf = OPA - > _float ; //don't break on vec*=vec_x;
OPC - > _vector [ 0 ] = ptr - > _vector [ 0 ] * = tmpf ;
OPC - > _vector [ 1 ] = ptr - > _vector [ 1 ] * = tmpf ;
OPC - > _vector [ 2 ] = ptr - > _vector [ 2 ] * = tmpf ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
case OP_DIVSTORE_F :
/*OPC->_float = */ OPB - > _float / = OPA - > _float ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
case OP_DIVSTOREP_F :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( float ) ) )
2011-12-05 15:23:40 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
PR_RunError ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , ( unsigned ) prinst . addressableused ) ;
2011-12-05 15:23:40 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2014-09-17 03:04:08 +00:00
OPC - > _float = ptr - > _float / = OPA - > _float ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
case OP_ADDSTORE_F :
/*OPC->_float = */ OPB - > _float + = OPA - > _float ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
case OP_ADDSTORE_V :
/*OPC->_vector[0] =*/ OPB - > _vector [ 0 ] + = OPA - > _vector [ 0 ] ;
/*OPC->_vector[1] =*/ OPB - > _vector [ 1 ] + = OPA - > _vector [ 1 ] ;
/*OPC->_vector[2] =*/ OPB - > _vector [ 2 ] + = OPA - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
case OP_ADDSTOREP_F :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( float ) ) )
2004-08-23 01:38:21 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
PR_RunError ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , ( unsigned ) prinst . addressableused ) ;
2004-08-23 01:38:21 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2014-09-17 03:04:08 +00:00
OPC - > _float = ptr - > _float + = OPA - > _float ;
break ;
case OP_ADDSTOREP_V :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
2020-08-03 10:34:44 +00:00
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( pvec3_t ) ) )
2004-08-23 01:38:21 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
PR_RunError ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , ( unsigned ) prinst . addressableused ) ;
2004-08-23 01:38:21 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2014-09-17 03:04:08 +00:00
OPC - > _vector [ 0 ] = ptr - > _vector [ 0 ] + = OPA - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = ptr - > _vector [ 1 ] + = OPA - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = ptr - > _vector [ 2 ] + = OPA - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
case OP_SUBSTORE_F :
/*OPC->_float = */ OPB - > _float - = OPA - > _float ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
case OP_SUBSTORE_V :
/*OPC->_vector[0] = */ OPB - > _vector [ 0 ] - = OPA - > _vector [ 0 ] ;
/*OPC->_vector[1] = */ OPB - > _vector [ 1 ] - = OPA - > _vector [ 1 ] ;
/*OPC->_vector[2] = */ OPB - > _vector [ 2 ] - = OPA - > _vector [ 2 ] ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
case OP_SUBSTOREP_F :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( float ) ) )
2004-08-23 01:38:21 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
PR_RunError ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , ( unsigned ) prinst . addressableused ) ;
2014-09-17 03:04:08 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2014-09-17 03:04:08 +00:00
OPC - > _float = ptr - > _float - = OPA - > _float ;
break ;
case OP_SUBSTOREP_V :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
2020-08-03 10:34:44 +00:00
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( pvec3_t ) ) )
2014-09-17 03:04:08 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
PR_RunError ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , ( unsigned ) prinst . addressableused ) ;
2014-09-17 03:04:08 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2014-09-17 03:04:08 +00:00
OPC - > _vector [ 0 ] = ptr - > _vector [ 0 ] - = OPA - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = ptr - > _vector [ 1 ] - = OPA - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = ptr - > _vector [ 2 ] - = OPA - > _vector [ 2 ] ;
break ;
case OP_BITSETSTORE_F :
OPB - > _float = ( int ) OPB - > _float | ( int ) OPA - > _float ;
break ;
case OP_BITSETSTOREP_F :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( float ) ) )
2014-09-17 03:04:08 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
PR_RunError ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , ( unsigned ) prinst . addressableused ) ;
2004-08-23 01:38:21 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2014-09-17 03:04:08 +00:00
ptr - > _float = ( int ) ptr - > _float | ( int ) OPA - > _float ;
break ;
case OP_BITCLRSTORE_F :
OPB - > _float = ( int ) OPB - > _float & ~ ( int ) OPA - > _float ;
break ;
case OP_BITCLRSTOREP_F :
2016-07-12 00:40:13 +00:00
i = OPB - > _int ;
errorif ( QCPOINTERWRITEFAIL ( i , sizeof ( float ) ) )
2014-09-17 03:04:08 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
PR_RunError ( & progfuncs - > funcs , " bad pointer write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , i , ( unsigned ) prinst . addressableused ) ;
2014-09-17 03:04:08 +00:00
}
2016-07-12 00:40:13 +00:00
ptr = QCPOINTERM ( i ) ;
2014-09-17 03:04:08 +00:00
ptr - > _float = ( int ) ptr - > _float & ~ ( int ) OPA - > _float ;
2004-08-23 01:38:21 +00:00
break ;
2014-09-17 03:04:08 +00:00
//for scaler randoms, prevent the random value from ever reaching 1
//this avoids issues when array[random()*array.length]
case OP_RAND0 :
OPC - > _float = ( rand ( ) & 0x7fff ) / ( ( float ) 0x8000 ) ;
break ;
case OP_RAND1 :
OPC - > _float = ( rand ( ) & 0x7fff ) / ( ( float ) 0x8000 ) * OPA - > _float ;
break ;
case OP_RAND2 : //backwards range shouldn't matter (except that it is b that is never reached, rather than the higher of the two)
OPC - > _float = OPA - > _float + ( rand ( ) & 0x7fff ) / ( ( float ) 0x8000 ) * ( OPB - > _float - OPA - > _float ) ;
break ;
//random vectors DO result in 0 to 1 inclusive, to try to ensure a more balanced range
case OP_RANDV0 :
OPC - > _vector [ 0 ] = ( rand ( ) & 0x7fff ) / ( ( float ) 0x7fff ) ;
OPC - > _vector [ 1 ] = ( rand ( ) & 0x7fff ) / ( ( float ) 0x7fff ) ;
OPC - > _vector [ 2 ] = ( rand ( ) & 0x7fff ) / ( ( float ) 0x7fff ) ;
break ;
case OP_RANDV1 :
OPC - > _vector [ 0 ] = ( rand ( ) & 0x7fff ) / ( ( float ) 0x7fff ) * OPA - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = ( rand ( ) & 0x7fff ) / ( ( float ) 0x7fff ) * OPA - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = ( rand ( ) & 0x7fff ) / ( ( float ) 0x7fff ) * OPA - > _vector [ 2 ] ;
break ;
case OP_RANDV2 : //backwards range shouldn't matter
OPC - > _vector [ 0 ] = OPA - > _vector [ 0 ] + ( rand ( ) & 0x7fff ) / ( ( float ) 0x7fff ) * ( OPB - > _vector [ 0 ] - OPA - > _vector [ 0 ] ) ;
OPC - > _vector [ 1 ] = OPA - > _vector [ 1 ] + ( rand ( ) & 0x7fff ) / ( ( float ) 0x7fff ) * ( OPB - > _vector [ 1 ] - OPA - > _vector [ 1 ] ) ;
OPC - > _vector [ 2 ] = OPA - > _vector [ 2 ] + ( rand ( ) & 0x7fff ) / ( ( float ) 0x7fff ) * ( OPB - > _vector [ 2 ] - OPA - > _vector [ 2 ] ) ;
break ;
2004-08-23 01:38:21 +00:00
case OP_SWITCH_F :
case OP_SWITCH_V :
case OP_SWITCH_S :
case OP_SWITCH_E :
case OP_SWITCH_FNC :
2014-09-17 03:04:08 +00:00
//the case opcodes depend upon the preceding switch.
//otherwise the switch itself is much like a goto
//don't embed the case/caserange checks directly into the switch so that custom caseranges can be potentially be implemented with hybrid emulation.
2015-02-02 08:01:53 +00:00
switchcomparison = op - OP_SWITCH_F ;
2014-09-17 03:04:08 +00:00
switchref = OPA ;
2004-08-23 01:38:21 +00:00
RUNAWAYCHECK ( ) ;
2014-09-17 03:04:08 +00:00
st + = ( sofs ) st - > b - 1 ; // offset the s++
2004-08-23 01:38:21 +00:00
break ;
2020-08-03 10:34:44 +00:00
case OP_SWITCH_I :
//the case opcodes depend upon the preceding switch.
//otherwise the switch itself is much like a goto
//don't embed the case/caserange checks directly into the switch so that custom caseranges can be potentially be implemented with hybrid emulation.
switchcomparison = OP_SWITCH_E - OP_SWITCH_F ;
switchref = OPA ;
RUNAWAYCHECK ( ) ;
st + = ( sofs ) st - > b - 1 ; // offset the s++
break ;
2004-08-23 01:38:21 +00:00
case OP_CASE :
2014-09-17 03:04:08 +00:00
//if the comparison is true, jump (back up) to the relevent code block
if ( casecmp [ switchcomparison ] ( progfuncs , switchref , OPA ) )
2004-08-23 01:38:21 +00:00
{
2014-09-17 03:04:08 +00:00
RUNAWAYCHECK ( ) ;
st + = ( sofs ) st - > b - 1 ; // -1 to offset the s++
2004-08-23 01:38:21 +00:00
}
break ;
case OP_CASERANGE :
2014-09-17 03:04:08 +00:00
//if the comparison is true, jump (back up) to the relevent code block
2016-07-12 00:40:13 +00:00
if ( casecmprange [ switchcomparison ] ( progfuncs , switchref , OPA , OPB ) )
2004-08-23 01:38:21 +00:00
{
2014-09-17 03:04:08 +00:00
RUNAWAYCHECK ( ) ;
st + = ( sofs ) st - > c - 1 ; // -1 to offset the s++
2004-08-23 01:38:21 +00:00
}
break ;
2005-02-28 07:16:19 +00:00
case OP_BITAND_IF :
OPC - > _int = ( OPA - > _int & ( int ) OPB - > _float ) ;
break ;
case OP_BITOR_IF :
OPC - > _int = ( OPA - > _int | ( int ) OPB - > _float ) ;
break ;
case OP_BITAND_FI :
OPC - > _int = ( ( int ) OPA - > _float & OPB - > _int ) ;
break ;
case OP_BITOR_FI :
OPC - > _int = ( ( int ) OPA - > _float | OPB - > _int ) ;
break ;
2004-08-23 01:38:21 +00:00
2005-02-28 07:16:19 +00:00
case OP_MUL_IF :
OPC - > _float = ( OPA - > _int * OPB - > _float ) ;
break ;
case OP_MUL_FI :
OPC - > _float = ( OPA - > _float * OPB - > _int ) ;
break ;
2004-08-23 01:38:21 +00:00
2005-02-28 07:16:19 +00:00
case OP_MUL_VI :
------------------------------------------------------------------------
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
tmpi = OPB - > _int ;
OPC - > _vector [ 0 ] = OPA - > _vector [ 0 ] * tmpi ;
2013-09-26 14:36:52 +00:00
OPC - > _vector [ 1 ] = OPA - > _vector [ 1 ] * tmpi ;
OPC - > _vector [ 2 ] = OPA - > _vector [ 2 ] * tmpi ;
2005-02-28 07:16:19 +00:00
break ;
case OP_MUL_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
tmpi = OPA - > _int ;
OPC - > _vector [ 0 ] = tmpi * OPB - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = tmpi * OPB - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = tmpi * OPB - > _vector [ 2 ] ;
2005-02-28 07:16:19 +00:00
break ;
case OP_DIV_IF :
OPC - > _float = ( OPA - > _int / OPB - > _float ) ;
break ;
case OP_DIV_FI :
OPC - > _float = ( OPA - > _float / OPB - > _int ) ;
break ;
2019-10-18 08:37:38 +00:00
case OP_MOD_I :
OPC - > _int = ( OPA - > _int % OPB - > _int ) ;
break ;
case OP_MOD_F :
OPC - > _float = OPA - > _float - OPB - > _float * ( int ) ( OPA - > _float / OPB - > _float ) ;
break ;
case OP_MOD_V :
OPC - > _vector [ 0 ] = OPA - > _vector [ 0 ] - OPB - > _vector [ 0 ] * ( int ) ( OPA - > _vector [ 0 ] / OPB - > _vector [ 0 ] ) ;
OPC - > _vector [ 1 ] = OPA - > _vector [ 1 ] - OPB - > _vector [ 1 ] * ( int ) ( OPA - > _vector [ 1 ] / OPB - > _vector [ 1 ] ) ;
OPC - > _vector [ 2 ] = OPA - > _vector [ 2 ] - OPB - > _vector [ 2 ] * ( int ) ( OPA - > _vector [ 2 ] / OPB - > _vector [ 2 ] ) ;
break ;
2005-02-28 07:16:19 +00:00
case OP_AND_I :
OPC - > _int = ( OPA - > _int & & OPB - > _int ) ;
break ;
case OP_OR_I :
OPC - > _int = ( OPA - > _int | | OPB - > _int ) ;
break ;
case OP_AND_IF :
OPC - > _int = ( OPA - > _int & & OPB - > _float ) ;
break ;
case OP_OR_IF :
OPC - > _int = ( OPA - > _int | | OPB - > _float ) ;
break ;
case OP_AND_FI :
OPC - > _int = ( OPA - > _float & & OPB - > _int ) ;
break ;
case OP_OR_FI :
OPC - > _int = ( OPA - > _float | | OPB - > _int ) ;
break ;
case OP_NE_IF :
OPC - > _int = ( OPA - > _int ! = OPB - > _float ) ;
break ;
case OP_NE_FI :
OPC - > _int = ( OPA - > _float ! = OPB - > _int ) ;
break ;
2012-11-27 03:23:19 +00:00
case OP_GADDRESS : //return glob[aint+bfloat]
2013-12-08 20:06:55 +00:00
//this instruction is not implemented due to the weirdness of it.
//its theoretically a more powerful load... but untyped?
2014-04-24 01:53:01 +00:00
//or is it meant to be an LEA instruction (that could simply be switched with OP_GLOAD_I)
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-01-09 15:35:40 +00:00
PR_RunError ( & progfuncs - > funcs , " OP_GADDRESS not implemented (found in %s) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) ;
2013-12-08 20:06:55 +00:00
break ;
2005-02-28 07:16:19 +00:00
case OP_GLOAD_I :
case OP_GLOAD_F :
case OP_GLOAD_FLD :
case OP_GLOAD_ENT :
case OP_GLOAD_S :
case OP_GLOAD_FNC :
2020-05-30 12:12:46 +00:00
errorif ( OPA - > _int < 0 | | OPA - > _int > = ( current_progstate - > globals_bytes > > 2 ) )
2013-12-08 20:06:55 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-05-30 12:12:46 +00:00
PR_RunError ( & progfuncs - > funcs , " bad indexed global read in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , OPA - > _int , current_progstate - > globals_bytes > > 2 ) ;
2013-12-08 20:06:55 +00:00
}
ptr = ( ( eval_t * ) & glob [ OPA - > _int ] ) ;
OPC - > _int = ptr - > _int ;
break ;
case OP_GLOAD_V :
2020-05-30 12:12:46 +00:00
errorif ( OPA - > _int < 0 | | OPA - > _int > = ( current_progstate - > globals_bytes > > 2 ) - 2u )
2013-12-08 20:06:55 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-05-30 12:12:46 +00:00
PR_RunError ( & progfuncs - > funcs , " bad indexed global read in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , OPA - > _int , current_progstate - > globals_bytes > > 2 ) ;
2013-12-08 20:06:55 +00:00
}
ptr = ( ( eval_t * ) & glob [ OPA - > _int ] ) ;
OPC - > _vector [ 0 ] = ptr - > _vector [ 0 ] ;
OPC - > _vector [ 1 ] = ptr - > _vector [ 1 ] ;
OPC - > _vector [ 2 ] = ptr - > _vector [ 2 ] ;
break ;
case OP_GSTOREP_I :
case OP_GSTOREP_F :
case OP_GSTOREP_ENT :
case OP_GSTOREP_FLD :
case OP_GSTOREP_S :
case OP_GSTOREP_FNC :
2020-05-30 12:12:46 +00:00
errorif ( OPB - > _int < 0 | | OPB - > _int > = ( current_progstate - > globals_bytes > > 2 ) )
2013-12-08 20:06:55 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-05-30 12:12:46 +00:00
PR_RunError ( & progfuncs - > funcs , " bad indexed global write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , OPB - > _int , current_progstate - > globals_bytes > > 2 ) ;
2013-12-08 20:06:55 +00:00
}
ptr = ( ( eval_t * ) & glob [ OPB - > _int ] ) ;
ptr - > _int = OPA - > _int ;
break ;
case OP_GSTOREP_V :
2020-05-30 12:12:46 +00:00
errorif ( OPB - > _int < 0 | | OPB - > _int > = ( current_progstate - > globals_bytes > > 2 ) - 2u )
2013-12-08 20:06:55 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2020-05-30 12:12:46 +00:00
PR_RunError ( & progfuncs - > funcs , " bad indexed global write in %s (%x >= %x) " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) , OPB - > _int , current_progstate - > globals_bytes > > 2 ) ;
2013-12-08 20:06:55 +00:00
}
ptr = ( ( eval_t * ) & glob [ OPB - > _int ] ) ;
ptr - > _vector [ 0 ] = OPA - > _vector [ 0 ] ;
ptr - > _vector [ 1 ] = OPA - > _vector [ 1 ] ;
ptr - > _vector [ 2 ] = OPA - > _vector [ 2 ] ;
2005-02-28 07:16:19 +00:00
break ;
case OP_BOUNDCHECK :
2015-09-01 04:45:15 +00:00
errorif ( ( unsigned int ) OPA - > _int < ( unsigned int ) st - > c | | ( unsigned int ) OPA - > _int > = ( unsigned int ) st - > b )
2005-02-28 07:16:19 +00:00
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Progs boundcheck failed. Value is %i. Must be %u<=value<%u \n " , OPA - > _int , st - > c , st - > b ) ;
2016-07-12 00:40:13 +00:00
QCFAULT ( & progfuncs - > funcs , " Progs boundcheck failed. Value is %i. Must be %u<=value<%u \n " , OPA - > _int , st - > c , st - > b ) ;
2015-02-02 08:01:53 +00:00
/* s=ShowStepf(progfuncs, st - pr_statements, "Progs boundcheck failed. Value is %i. Must be between %u and %u\n", OPA->_int, st->c, st->b);
------------------------------------------------------------------------
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 ( st = = pr_statements + s )
PR_RunError ( & progfuncs - > funcs , " unable to resume boundcheck " ) ;
st = pr_statements + s ;
2014-03-31 17:06:41 +00:00
return s ;
2015-02-02 08:01:53 +00:00
*/ }
2005-02-28 07:16:19 +00:00
break ;
2015-12-28 17:41:39 +00:00
case OP_PUSH :
OPC - > _int = ENGINEPOINTER ( & prinst . localstack [ prinst . localstack_used + prinst . spushed ] ) ;
prinst . spushed + = OPA - > _int ;
if ( prinst . spushed + prinst . localstack_used > = LOCALSTACK_SIZE )
2005-02-28 07:16:19 +00:00
{
2015-12-28 17:41:39 +00:00
prinst . spushed = 0 ;
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2015-12-28 17:41:39 +00:00
PR_RunError ( & progfuncs - > funcs , " Progs pushed too much " ) ;
2005-02-28 07:16:19 +00:00
}
break ;
2015-12-28 17:41:39 +00:00
/* case OP_POP:
2005-02-28 07:16:19 +00:00
pr_spushed - = OPA - > _int ;
if ( pr_spushed < 0 )
{
pr_spushed = 0 ;
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
2005-02-28 07:16:19 +00:00
PR_RunError ( progfuncs , " Progs poped more than it pushed " ) ;
}
break ;
2005-05-17 02:36:54 +00:00
*/
2004-08-23 01:38:21 +00:00
default :
2018-08-04 15:12:51 +00:00
if ( op & OP_BIT_BREAKPOINT ) //break point!
2004-08-23 01:38:21 +00:00
{
2018-08-04 15:12:51 +00:00
op & = ~ OP_BIT_BREAKPOINT ;
2015-02-02 08:01:53 +00:00
s = st - pr_statements ;
2019-12-10 14:50:47 +00:00
if ( prinst . pr_xstatement ! = s )
2015-02-02 08:01:53 +00:00
{
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = s ;
2020-01-09 15:35:40 +00:00
externs - > Printf ( " Break point hit in %s. \n " , PR_StringToNative ( & progfuncs - > funcs , prinst . pr_xfunction - > s_name ) ) ;
2015-09-06 03:30:28 +00:00
s = ShowStep ( progfuncs , s , NULL , false ) ;
2015-02-02 08:01:53 +00:00
st = & pr_statements [ s ] ; //let the user move execution
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = s = st - pr_statements ;
2018-08-04 15:12:51 +00:00
op = st - > op & ~ OP_BIT_BREAKPOINT ;
2015-02-02 08:01:53 +00:00
}
2004-08-23 01:38:21 +00:00
goto reeval ; //reexecute
}
2019-12-10 14:50:47 +00:00
prinst . pr_xstatement = st - pr_statements ;
------------------------------------------------------------------------
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
PR_RunError ( & progfuncs - > funcs , " Bad opcode %i " , st - > op ) ;
2004-08-23 01:38:21 +00:00
}
}
# undef reeval
# undef st
# undef pr_statements
# undef fakeop
# undef dstatement_t
# undef sofs
2011-09-03 03:49:43 +00:00
# undef OPCODE
2005-05-17 02:36:54 +00:00
# undef ENGINEPOINTER
# undef QCPOINTER
2005-05-17 09:50:54 +00:00
# undef QCPOINTERM