2004-08-23 00:15:46 +00:00
//DMW
/*
F1 will return to progs . src
F2 will try to open a file with the name of which is on that line . ( excluding comments / tabs ) . Needs conditions .
F3 will give a prompt for typing in a value name to see the value .
F4 will save
F5 will run ( unbreak ) .
F6 will list the stack .
F7 will compile .
F8 will move execution
F9 will set a break point .
2015-02-02 08:01:53 +00:00
F10 will step over .
F11 will step into .
2004-08-23 00:15:46 +00:00
*/
# include "quakedef.h"
# ifdef TEXTEDITOR
2014-10-05 20:04:11 +00:00
# include "pr_common.h"
2012-11-27 03:23:19 +00:00
# ifdef _WIN32
# define editaddcr_default "1"
# else
# define editaddcr_default "0"
# endif
2014-05-16 17:45:37 +00:00
//#if defined(ANDROID) || defined(SERVERONLY)
2012-11-27 03:23:19 +00:00
# define debugger_default "0"
2014-05-16 17:45:37 +00:00
//#else
//#define debugger_default "1"
//#endif
2012-11-27 03:23:19 +00:00
static cvar_t editstripcr = CVARD ( " edit_stripcr " , " 1 " , " remove \\ r from eols (on load) " ) ;
static cvar_t editaddcr = CVARD ( " edit_addcr " , editaddcr_default , " make sure that each line ends with a \\ r (on save) " ) ;
static cvar_t edittabspacing = CVARD ( " edit_tabsize " , " 4 " , " How wide tab alignment is " ) ;
2014-05-16 17:45:37 +00:00
cvar_t pr_debugger = CVARAFD ( " pr_debugger " , debugger_default , " debugger " , CVAR_SAVE , " When enabled, QC errors and debug events will enable step-by-step tracing. " ) ;
2013-03-12 22:53:23 +00:00
extern cvar_t pr_sourcedir ;
2004-08-23 00:15:46 +00:00
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
static pubprogfuncs_t * editprogfuncs ;
2004-08-23 00:15:46 +00:00
typedef struct fileblock_s {
struct fileblock_s * next ;
struct fileblock_s * prev ;
int allocatedlength ;
int datalength ;
int flags ;
char * data ;
} fileblock_t ;
# define FB_BREAK 1
2009-07-11 20:56:09 +00:00
static fileblock_t * cursorblock , * firstblock , * executionblock , * viewportystartblock ;
2004-08-23 00:15:46 +00:00
2011-05-20 04:10:46 +00:00
static void * E_Malloc ( int size )
2004-08-23 00:15:46 +00:00
{
char * mem ;
mem = Z_Malloc ( size ) ;
if ( ! mem )
Sys_Error ( " Failed to allocate enough mem for editor \n " ) ;
return mem ;
}
2011-05-20 04:10:46 +00:00
static void E_Free ( void * mem )
2004-08-23 00:15:46 +00:00
{
Z_Free ( mem ) ;
}
# define GETBLOCK(s, ret) ret = (void *)E_Malloc(sizeof(fileblock_t) + s);ret->allocatedlength = s;ret->data = (char *)ret + sizeof(fileblock_t)
2012-11-27 03:23:19 +00:00
fileblock_t * GenAsm ( int statement )
{
char linebuf [ 256 ] ;
fileblock_t * b ;
int l ;
------------------------------------------------------------------------
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 ( ! editprogfuncs )
return NULL ;
editprogfuncs - > GenerateStatementString ( editprogfuncs , statement , linebuf , sizeof ( linebuf ) ) ;
2012-11-27 03:23:19 +00:00
l = strlen ( linebuf ) ;
b = E_Malloc ( sizeof ( fileblock_t ) + l ) ;
b - > allocatedlength = l ;
b - > datalength = l ;
b - > data = ( char * ) b + sizeof ( fileblock_t ) ;
memcpy ( b - > data , linebuf , l ) ;
return b ;
}
2004-08-23 00:15:46 +00:00
2011-05-20 04:10:46 +00:00
static char OpenEditorFile [ 256 ] ;
2004-08-23 00:15:46 +00:00
qboolean editoractive ; //(export)
qboolean editormodal ; //doesn't return. (export)
2015-02-02 08:01:53 +00:00
int editorstep ;
2011-05-20 04:10:46 +00:00
static qboolean madechanges ;
2012-11-27 03:23:19 +00:00
static qboolean editenabled ;
2011-05-20 04:10:46 +00:00
static qboolean insertkeyhit = true ;
static qboolean useeval ;
2012-11-27 03:23:19 +00:00
static qboolean stepasm ;
2004-08-23 00:15:46 +00:00
2011-05-20 04:10:46 +00:00
static char evalstring [ 256 ] ;
2004-08-23 00:15:46 +00:00
2011-05-20 04:10:46 +00:00
static int executionlinenum ; //step by step debugger
static int cursorlinenum , cursorx ;
2004-08-23 00:15:46 +00:00
2011-05-20 04:10:46 +00:00
static int viewportx ;
static int viewporty ;
2004-08-23 00:15:46 +00:00
2005-12-21 03:07:33 +00:00
static int VFS_GETC ( vfsfile_t * fp )
{
unsigned char c ;
VFS_READ ( fp , & c , 1 ) ;
return c ;
}
2004-08-23 00:15:46 +00:00
//newsize = number of chars, EXCLUDING terminator.
2011-05-20 04:10:46 +00:00
static void MakeNewSize ( fileblock_t * block , int newsize ) //this is used to resize a block. It allocates a new one, copys the data frees the old one and links it into the right place
2004-08-23 00:15:46 +00:00
//it is called when the user is typing
{
fileblock_t * newblock ;
newsize = ( newsize + 4 ) & ~ 3 ; //We allocate a bit extra, so we don't need to keep finding a new block for each and every character.
if ( block - > allocatedlength > = newsize )
return ; //Ignore. This block is too large already. Don't bother resizeing, cos that's pretty much pointless.
GETBLOCK ( newsize , newblock ) ;
memcpy ( newblock - > data , block - > data , block - > datalength ) ;
newblock - > prev = block - > prev ;
newblock - > next = block - > next ;
if ( newblock - > prev )
newblock - > prev - > next = newblock ;
if ( newblock - > next )
newblock - > next - > prev = newblock ;
newblock - > datalength = block - > datalength ;
newblock - > flags = block - > flags ;
E_Free ( block ) ;
if ( firstblock = = block )
firstblock = newblock ;
if ( cursorblock = = block )
cursorblock = newblock ;
}
2011-05-20 04:10:46 +00:00
static int positionacross ;
static void GetCursorpos ( void )
2004-08-23 00:15:46 +00:00
{
int a ;
char * s ;
int ts = edittabspacing . value ;
if ( ts < 1 )
ts = 4 ;
for ( a = 0 , positionacross = 0 , s = cursorblock - > data ; a < cursorx & & * s ; s + + , a + + )
{
if ( * s = = ' \t ' )
{
positionacross + = ts ;
positionacross - = cursorx % ts ;
}
else
positionacross + + ;
}
// positionacross = cursorofs;
}
2011-05-20 04:10:46 +00:00
static void SetCursorpos ( void )
2004-08-23 00:15:46 +00:00
{
int a = 0 ;
char * s ;
int ts = edittabspacing . value ;
if ( ts < 1 )
ts = 4 ;
for ( cursorx = 0 , s = cursorblock - > data ; cursorx < positionacross & & * s ; s + + , a + + )
2005-12-21 03:07:33 +00:00
{
2004-08-23 00:15:46 +00:00
if ( * s = = ' \t ' )
{
cursorx + = ts ;
cursorx - = cursorx % ts ;
}
else
cursorx + + ;
}
cursorx = a ;
//just in case
if ( cursorx > cursorblock - > datalength )
cursorx = cursorblock - > datalength ;
}
2011-05-20 04:10:46 +00:00
static void CloseEditor ( void )
2004-08-23 00:15:46 +00:00
{
fileblock_t * b ;
2013-10-08 14:28:11 +00:00
Key_Dest_Remove ( kdm_editor ) ;
2004-08-23 00:15:46 +00:00
editoractive = false ;
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
editprogfuncs = NULL ;
2013-06-23 02:17:02 +00:00
cursorblock = NULL ;
2004-08-23 00:15:46 +00:00
if ( ! firstblock )
return ;
OpenEditorFile [ 0 ] = ' \0 ' ;
2012-11-27 03:23:19 +00:00
while ( firstblock )
2004-08-23 00:15:46 +00:00
{
2012-11-27 03:23:19 +00:00
b = firstblock ;
firstblock = firstblock - > next ;
E_Free ( b ) ;
2004-08-23 00:15:46 +00:00
}
madechanges = false ;
2005-05-26 12:55:34 +00:00
editormodal = false ;
2015-02-02 08:01:53 +00:00
editorstep = DEBUG_TRACE_OFF ;
2004-08-23 00:15:46 +00:00
firstblock = NULL ;
2013-10-08 14:28:11 +00:00
executionlinenum = 0 ;
2004-08-23 00:15:46 +00:00
}
2011-05-20 04:10:46 +00:00
static qboolean EditorSaveFile ( char * s ) //returns true if succesful
2004-08-23 00:15:46 +00:00
{
// FILE *F;
fileblock_t * b ;
int len = 0 ;
int pos = 0 ;
char * data ;
------------------------------------------------------------------------
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
char native [ MAX_OSPATH ] ;
if ( ! FS_NativePath ( s , FS_GAMEONLY , native , sizeof ( native ) ) )
Con_Printf ( " Not saving. \n " ) ;
Con_Printf ( " Saving to \" %s \" \n " , native ) ;
2004-08-23 00:15:46 +00:00
for ( b = firstblock ; b ; b = b - > next ) //find total length required.
{
len + = b - > datalength ;
len + = 2 ; //extra for \n
}
data = Hunk_TempAlloc ( len ) ;
for ( b = firstblock ; b ; b = b - > next ) //find total length required.
{
memcpy ( data + pos , b - > data , b - > datalength ) ;
pos + = b - > datalength ;
2009-11-04 21:16:50 +00:00
if ( editaddcr . ival )
2004-08-23 00:15:46 +00:00
{
data [ pos ] = ' \r ' ;
pos + + ;
}
data [ pos ] = ' \n ' ;
pos + + ;
}
2015-06-04 06:15:14 +00:00
COM_WriteFile ( s , FS_GAMEONLY , data , len ) ;
------------------------------------------------------------------------
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
2004-08-23 00:15:46 +00:00
madechanges = false ;
2012-11-27 03:23:19 +00:00
editenabled = true ;
2013-10-08 14:28:11 +00:00
executionlinenum = 0 ;
2004-08-23 00:15:46 +00:00
return true ;
}
2011-05-20 04:10:46 +00:00
static void EditorNewFile ( void )
2004-08-23 00:15:46 +00:00
{
2012-11-27 03:23:19 +00:00
fileblock_t * b ;
while ( firstblock )
{
b = firstblock ;
firstblock = firstblock - > next ;
E_Free ( b ) ;
}
2005-12-21 03:07:33 +00:00
GETBLOCK ( 64 , firstblock ) ;
2004-08-23 00:15:46 +00:00
GETBLOCK ( 64 , firstblock - > next ) ;
firstblock - > next - > prev = firstblock ;
cursorblock = firstblock ;
cursorlinenum = 0 ;
cursorx = 0 ;
viewportystartblock = NULL ;
madechanges = true ;
2013-10-08 14:28:11 +00:00
executionlinenum = 0 ;
2004-08-23 00:15:46 +00:00
2013-10-08 14:28:11 +00:00
Key_Dest_Add ( kdm_editor ) ;
2004-08-23 00:15:46 +00:00
editoractive = true ;
2012-11-27 03:23:19 +00:00
editenabled = true ;
2004-08-23 00:15:46 +00:00
}
2015-02-02 08:01:53 +00:00
static void EditorOpenFile ( const char * name , qboolean readonly )
2004-08-23 00:15:46 +00:00
{
int i ;
char line [ 8192 ] ;
int len , flen , pos = 0 ;
2005-12-21 03:07:33 +00:00
vfsfile_t * F ;
fileblock_t * b ;
2013-03-12 23:24:15 +00:00
char * prname ;
pubprogfuncs_t * epf = editprogfuncs ;
2005-12-21 03:07:33 +00:00
CloseEditor ( ) ;
2004-08-23 00:15:46 +00:00
strcpy ( OpenEditorFile , name ) ;
2005-12-21 03:07:33 +00:00
if ( ! ( F = FS_OpenVFS ( OpenEditorFile , " rb " , FS_GAME ) ) )
2004-08-23 00:15:46 +00:00
{
2013-03-12 22:53:23 +00:00
Q_snprintfz ( OpenEditorFile , sizeof ( OpenEditorFile ) , " %s/%s " , pr_sourcedir . string , name ) ;
2005-12-21 03:07:33 +00:00
if ( ! ( F = FS_OpenVFS ( OpenEditorFile , " rb " , FS_GAME ) ) )
2004-08-23 00:15:46 +00:00
{
2005-12-21 03:07:33 +00:00
Con_Printf ( " Couldn't open file \" %s \" \n A new file will be created \n " , name ) ;
strcpy ( OpenEditorFile , name ) ;
2013-10-08 14:28:11 +00:00
Key_Dest_Add ( kdm_console ) ;
2005-12-21 03:07:33 +00:00
EditorNewFile ( ) ;
return ;
2004-08-23 00:15:46 +00:00
}
}
i = 1 ;
2005-12-21 03:07:33 +00:00
2013-03-12 23:24:15 +00:00
prname = OpenEditorFile ;
if ( ! strncmp ( prname , " src/ " , 4 ) )
prname + = 4 ;
if ( ! strncmp ( prname , " source/ " , 7 ) )
prname + = 7 ;
2005-12-21 03:07:33 +00:00
flen = VFS_GETLEN ( F ) ;
2004-08-23 00:15:46 +00:00
while ( pos < flen )
{
len = 0 ;
for ( ; ; )
{
2006-03-10 03:50:23 +00:00
if ( pos + len > = flen | | len > sizeof ( line ) - 16 )
2004-08-23 00:15:46 +00:00
break ;
2005-12-21 03:07:33 +00:00
line [ len ] = VFS_GETC ( F ) ;
2004-08-23 00:15:46 +00:00
if ( line [ len ] = = ' \n ' )
break ;
len + + ;
}
pos + = len ;
pos + + ; //and a \n
2009-11-04 21:16:50 +00:00
if ( editstripcr . ival )
2004-08-23 00:15:46 +00:00
{
if ( line [ len - 1 ] = = ' \r ' )
len - - ;
}
b = firstblock ;
GETBLOCK ( len + 1 , firstblock ) ;
firstblock - > prev = b ;
if ( b )
b - > next = firstblock ;
firstblock - > datalength = len ;
memcpy ( firstblock - > data , line , len ) ;
2013-03-12 23:24:15 +00:00
if ( epf )
2005-08-03 23:14:59 +00:00
{
2013-03-12 23:24:15 +00:00
if ( epf - > ToggleBreak ( epf , prname , i , 3 ) )
2005-08-03 23:14:59 +00:00
{
2005-12-21 03:07:33 +00:00
firstblock - > flags | = FB_BREAK ;
2005-08-03 23:14:59 +00:00
}
}
2014-10-05 20:04:11 +00:00
# ifndef CLIENTONLY
2005-08-03 23:14:59 +00:00
else
2004-08-23 00:15:46 +00:00
{
2005-08-03 23:14:59 +00:00
if ( svprogfuncs )
{
2013-03-12 23:24:15 +00:00
if ( svprogfuncs - > ToggleBreak ( svprogfuncs , prname , i , 3 ) )
2005-08-03 23:14:59 +00:00
{
2005-12-21 03:07:33 +00:00
firstblock - > flags | = FB_BREAK ;
2005-08-03 23:14:59 +00:00
}
}
2004-08-23 00:15:46 +00:00
}
2014-10-05 20:04:11 +00:00
# endif
2004-08-23 00:15:46 +00:00
i + + ;
}
if ( firstblock = = NULL )
{
2005-12-21 03:07:33 +00:00
GETBLOCK ( 10 , firstblock ) ;
}
2004-08-23 00:15:46 +00:00
else
for ( ; firstblock - > prev ; firstblock = firstblock - > prev ) ;
2005-12-21 03:07:33 +00:00
VFS_CLOSE ( F ) ;
2004-08-23 00:15:46 +00:00
cursorblock = firstblock ;
cursorx = 0 ;
viewportystartblock = NULL ;
madechanges = false ;
2013-10-08 14:28:11 +00:00
executionlinenum = 0 ;
2012-11-27 03:23:19 +00:00
editenabled = ! readonly ;
2004-08-23 00:15:46 +00:00
2013-10-08 14:28:11 +00:00
Key_Dest_Add ( kdm_editor ) ;
2004-08-23 00:15:46 +00:00
editoractive = true ;
2013-03-12 23:24:15 +00:00
editprogfuncs = epf ;
2004-08-23 00:15:46 +00:00
}
2012-11-27 03:23:19 +00:00
extern qboolean keydown [ K_MAX ] ;
2009-07-25 11:05:06 +00:00
void Editor_Key ( int key , int unicode )
2004-08-23 00:15:46 +00:00
{
int i ;
2012-11-27 03:23:19 +00:00
fileblock_t * nb ;
2004-08-23 00:15:46 +00:00
if ( keybindings [ key ] [ 0 ] )
if ( ! strcmp ( keybindings [ key ] [ 0 ] , " toggleconsole " ) )
{
2013-10-08 14:28:11 +00:00
Key_Dest_Add ( kdm_console ) ;
2004-08-23 00:15:46 +00:00
return ;
}
/* if (CmdAfterSave)
{
switch ( key )
{
case ' Y ' :
case ' y ' :
if ( ! EditorSaveFile ( OpenEditorFile ) )
{
Con_Printf ( " Couldn't save file \" %s \" \n " , OpenEditorFile ) ;
key_dest = key_console ;
}
else if ( ! CmdAfterSaveCalled )
{
CmdAfterSaveCalled = true ;
( * CmdAfterSave ) ( ) ;
CmdAfterSaveCalled = false ;
}
CmdAfterSave = NULL ;
break ;
case ' N ' :
2005-12-21 03:07:33 +00:00
case ' n ' :
2004-08-23 00:15:46 +00:00
( * CmdAfterSave ) ( ) ;
CmdAfterSave = NULL ;
break ;
case ' C ' :
case ' c ' :
CmdAfterSave = NULL ;
break ;
}
return ;
}
*/
if ( key = = K_SHIFT )
return ;
2012-11-27 03:23:19 +00:00
if ( useeval )
2004-08-23 00:15:46 +00:00
{
switch ( key )
{
case K_ESCAPE :
2005-05-26 12:55:34 +00:00
if ( editprogfuncs )
2015-02-02 08:01:53 +00:00
editprogfuncs - > debug_trace = DEBUG_TRACE_OFF ;
2005-05-26 12:55:34 +00:00
useeval = false ;
2012-11-27 03:23:19 +00:00
return ;
2005-05-26 12:55:34 +00:00
case K_F3 :
2004-08-23 00:15:46 +00:00
useeval = false ;
2012-11-27 03:23:19 +00:00
return ;
2004-08-23 00:15:46 +00:00
case K_DEL :
evalstring [ 0 ] = ' \0 ' ;
2012-11-27 03:23:19 +00:00
return ;
2004-08-23 00:15:46 +00:00
case K_BACKSPACE :
i = strlen ( evalstring ) ;
if ( i < 1 )
2012-11-27 03:23:19 +00:00
return ;
2004-08-23 00:15:46 +00:00
evalstring [ i - 1 ] = ' \0 ' ;
2012-11-27 03:23:19 +00:00
return ;
2004-08-23 00:15:46 +00:00
default :
2009-07-25 11:05:06 +00:00
if ( unicode )
{
i = strlen ( evalstring ) ;
evalstring [ i ] = unicode ;
evalstring [ i + 1 ] = ' \0 ' ;
}
2012-11-27 03:23:19 +00:00
return ;
case K_F5 :
case K_F9 :
case K_F11 :
case K_MWHEELUP :
case K_UPARROW :
case K_PGUP :
case K_MWHEELDOWN :
case K_DOWNARROW :
case K_PGDN :
case K_LEFTARROW :
case K_RIGHTARROW :
2004-08-23 00:15:46 +00:00
break ;
}
}
/* if (ctrl_down && (key == 'c' || key == K_INS))
key = K_F9 ;
if ( ( ctrl_down & & key = = ' v ' ) | | ( shift_down & & key = = K_INS ) )
key = K_F10 ;
*/
switch ( key )
{
2013-05-11 14:02:55 +00:00
case K_LSHIFT :
case K_RSHIFT :
2004-08-23 00:15:46 +00:00
break ;
2013-04-13 08:15:18 +00:00
case K_LALT :
case K_RALT :
2004-08-23 00:15:46 +00:00
break ;
2013-05-11 14:02:55 +00:00
case K_LCTRL :
case K_RCTRL :
2004-08-23 00:15:46 +00:00
break ;
2011-05-20 04:10:46 +00:00
case K_MWHEELUP :
case K_UPARROW :
2004-08-23 00:15:46 +00:00
case K_PGUP :
2013-10-08 14:28:11 +00:00
if ( ! cursorblock )
break ;
2004-08-23 00:15:46 +00:00
GetCursorpos ( ) ;
{
2011-05-20 04:10:46 +00:00
int a ;
if ( key = = K_PGUP )
a = ( vid . height / 8 ) / 2 ;
else if ( key = = K_MWHEELUP )
a = 5 ;
else
a = 1 ;
while ( a )
{
a - - ;
if ( cursorblock - > prev )
{
cursorblock = cursorblock - > prev ;
cursorlinenum - - ;
}
2012-11-27 03:23:19 +00:00
else if ( cursorlinenum > 1 )
{
cursorlinenum - - ;
nb = GenAsm ( cursorlinenum ) ;
nb - > next = cursorblock ;
cursorblock - > prev = nb ;
firstblock = cursorblock = nb ;
}
2011-05-20 04:10:46 +00:00
}
2004-08-23 00:15:46 +00:00
}
SetCursorpos ( ) ;
break ;
2011-05-20 04:10:46 +00:00
case K_MWHEELDOWN :
case K_DOWNARROW :
2004-08-23 00:15:46 +00:00
case K_PGDN :
GetCursorpos ( ) ;
2011-05-20 04:10:46 +00:00
{
int a ;
if ( key = = K_PGDN )
a = ( vid . height / 8 ) / 2 ;
else if ( key = = K_MWHEELDOWN )
a = 5 ;
else
a = 1 ;
2004-08-23 00:15:46 +00:00
while ( a )
{
a - - ;
if ( cursorblock - > next )
{
cursorblock = cursorblock - > next ;
cursorlinenum + + ;
}
2012-11-27 03:23:19 +00:00
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
nb = GenAsm ( cursorlinenum + 1 ) ;
if ( nb )
{
cursorlinenum + + ;
nb - > prev = cursorblock ;
cursorblock - > next = nb ;
cursorblock = nb ;
}
2012-11-27 03:23:19 +00:00
}
2004-08-23 00:15:46 +00:00
}
}
SetCursorpos ( ) ;
break ;
// case K_BACK:
case K_F1 :
------------------------------------------------------------------------
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
Con_Printf (
" Editor help: \n "
" F1: Show help \n "
" F2: Open file named on cursor line \n "
" F3: Toggle expression evaluator \n "
" F4: Save file \n "
2013-08-21 07:14:39 +00:00
" F5: Stop tracing (resume) \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
" F6: Print stack trace \n "
" F7: Save file and recompile \n "
" F8: Change current point of execution \n "
" F9: Set breakpoint \n "
" F10: Save file, recompile, reload vm \n "
" F11: Single step \n "
" F12: \n "
" Escape: Abort call, close editor \n "
) ;
Cbuf_AddText ( " toggleconsole \n " , RESTRICT_LOCAL ) ;
2004-08-23 00:15:46 +00:00
break ;
// case K_FORWARD:
case K_F2 :
{
char file [ 1024 ] ;
char * s ;
Q_strncpyz ( file , cursorblock - > data , sizeof ( file ) ) ;
s = file ;
while ( * s )
{
if ( ( * s = = ' / ' & & s [ 1 ] = = ' / ' ) | | ( * s = = ' \t ' ) )
{
* s = ' \0 ' ;
break ;
2005-12-21 03:07:33 +00:00
}
2004-08-23 00:15:46 +00:00
s + + ;
}
if ( * file )
2012-11-27 03:23:19 +00:00
EditorOpenFile ( file , false ) ;
2004-08-23 00:15:46 +00:00
}
break ;
case K_F3 :
2006-03-10 03:50:23 +00:00
if ( editprogfuncs )
useeval = true ;
2004-08-23 00:15:46 +00:00
break ;
case K_F4 :
EditorSaveFile ( OpenEditorFile ) ;
break ;
2011-10-27 15:46:36 +00:00
case K_F5 : /*stop debugging*/
2004-08-23 00:15:46 +00:00
editormodal = false ;
2015-02-02 08:01:53 +00:00
editorstep = DEBUG_TRACE_OFF ;
2004-08-23 00:15:46 +00:00
break ;
case K_F6 :
if ( editprogfuncs )
2014-05-30 03:57:30 +00:00
PR_StackTrace ( editprogfuncs , 2 ) ;
2004-08-23 00:15:46 +00:00
break ;
2011-10-27 15:46:36 +00:00
case K_F7 : /*save+recompile*/
2004-08-23 00:15:46 +00:00
EditorSaveFile ( OpenEditorFile ) ;
------------------------------------------------------------------------
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 ( ! editprogfuncs )
Cbuf_AddText ( " compile; toggleconsole \n " , RESTRICT_LOCAL ) ;
2004-08-23 00:15:46 +00:00
break ;
2011-10-27 15:46:36 +00:00
case K_F8 : /*move execution point to here - I hope you move to the same function!*/
2004-08-23 00:15:46 +00:00
executionlinenum = cursorlinenum ;
executionblock = cursorblock ;
break ;
2011-10-27 15:46:36 +00:00
case K_F9 : /*set breakpoint*/
2004-08-23 00:15:46 +00:00
{
int f = 0 ;
2013-03-12 23:24:15 +00:00
char * fname = OpenEditorFile ;
if ( ! strncmp ( fname , " src/ " , 4 ) )
fname + = 4 ;
if ( ! strncmp ( fname , " source/ " , 7 ) )
fname + = 7 ;
2006-03-10 03:50:23 +00:00
if ( editprogfuncs )
{
2013-03-12 23:24:15 +00:00
if ( editprogfuncs - > ToggleBreak ( editprogfuncs , fname , cursorlinenum , 2 ) )
2006-03-10 03:50:23 +00:00
f | = 1 ;
else
f | = 2 ;
}
2005-08-03 23:14:59 +00:00
# ifndef CLIENTONLY
2006-03-10 03:50:23 +00:00
else if ( svprogfuncs )
{
2013-03-12 23:24:15 +00:00
if ( svprogfuncs - > ToggleBreak ( svprogfuncs , fname , cursorlinenum , 2 ) )
2006-03-10 03:50:23 +00:00
f | = 1 ;
else
f | = 2 ;
}
2004-08-23 00:15:46 +00:00
# endif
2006-03-10 03:50:23 +00:00
if ( f & 1 )
cursorblock - > flags | = FB_BREAK ;
else
cursorblock - > flags & = ~ FB_BREAK ;
2004-08-23 00:15:46 +00:00
}
break ;
2015-02-02 08:01:53 +00:00
case K_F10 :
editormodal = false ;
editorstep = DEBUG_TRACE_OVER ;
2004-08-23 00:15:46 +00:00
break ;
2011-10-27 15:46:36 +00:00
case K_F11 : //single step
2004-08-23 00:15:46 +00:00
editormodal = false ;
2015-02-02 08:01:53 +00:00
editorstep = DEBUG_TRACE_INTO ;
break ;
case K_F12 : //save+apply changes, supposedly
EditorSaveFile ( OpenEditorFile ) ;
Cbuf_AddText ( " applycompile \n " , RESTRICT_LOCAL ) ;
2004-08-23 00:15:46 +00:00
break ;
// case K_STOP:
case K_ESCAPE :
2013-10-08 14:28:11 +00:00
if ( editprogfuncs & & editormodal )
{
2006-09-18 22:52:33 +00:00
editprogfuncs - > AbortStack ( editprogfuncs ) ;
2013-10-08 14:28:11 +00:00
CloseEditor ( ) ;
executionlinenum = 0 ;
stepasm = true ;
}
else
CloseEditor ( ) ;
2013-06-23 02:17:02 +00:00
editormodal = false ;
2015-02-02 08:01:53 +00:00
editorstep = DEBUG_TRACE_ABORT ;
2004-08-23 00:15:46 +00:00
break ;
case K_HOME :
cursorx = 0 ;
break ;
case K_END :
cursorx = cursorblock - > datalength ;
break ;
case K_LEFTARROW :
cursorx - - ;
2013-05-11 14:02:55 +00:00
if ( keydown [ K_LCTRL ] | | keydown [ K_RCTRL ] )
2012-11-27 03:23:19 +00:00
{
//skip additional whitespace
while ( cursorx > 0 & & ( cursorblock - > data [ cursorx - 1 ] = = ' ' | | cursorblock - > data [ cursorx - 1 ] < = ' \t ' ) )
cursorx - - ;
//skip over the word, to the start of it
while ( cursorx > 0 & & ( ( cursorblock - > data [ cursorx - 1 ] > = ' a ' & & cursorblock - > data [ cursorx - 1 ] < = ' z ' ) | |
( cursorblock - > data [ cursorx - 1 ] > = ' A ' & & cursorblock - > data [ cursorx - 1 ] < = ' Z ' ) | |
( cursorblock - > data [ cursorx - 1 ] > = ' 0 ' & & cursorblock - > data [ cursorx - 1 ] < = ' 9 ' ) ) )
cursorx - - ;
}
2004-08-23 00:15:46 +00:00
if ( cursorx < 0 )
cursorx = 0 ;
break ;
case K_RIGHTARROW :
2013-05-11 14:02:55 +00:00
if ( keydown [ K_LCTRL ] | | keydown [ K_RCTRL ] )
2012-11-27 03:23:19 +00:00
{
while ( cursorx + 1 < cursorblock - > datalength & & ( ( cursorblock - > data [ cursorx ] > = ' a ' & & cursorblock - > data [ cursorx ] < = ' z ' ) | |
( cursorblock - > data [ cursorx ] > = ' A ' & & cursorblock - > data [ cursorx ] < = ' Z ' ) | |
( cursorblock - > data [ cursorx ] > = ' 0 ' & & cursorblock - > data [ cursorx ] < = ' 9 ' ) ) )
cursorx + + ;
cursorx + + ;
while ( cursorx + 1 < cursorblock - > datalength & & ( cursorblock - > data [ cursorx ] = = ' ' | | cursorblock - > data [ cursorx ] < = ' \t ' ) )
cursorx + + ;
}
else
{
cursorx + + ;
if ( cursorx > cursorblock - > datalength )
cursorx = cursorblock - > datalength ;
}
2004-08-23 00:15:46 +00:00
break ;
case K_BACKSPACE :
cursorx - - ;
if ( cursorx < 0 )
{
fileblock_t * b = cursorblock ;
if ( b = = firstblock ) //no line above to remove to
{
cursorx = 0 ;
break ;
}
2012-11-27 03:23:19 +00:00
if ( editenabled )
{
cursorlinenum - = 1 ;
madechanges = true ;
2004-08-23 00:15:46 +00:00
2012-11-27 03:23:19 +00:00
cursorblock = b - > prev ;
2004-08-23 00:15:46 +00:00
2012-11-27 03:23:19 +00:00
MakeNewSize ( cursorblock , b - > datalength + cursorblock - > datalength + 5 ) ;
2004-08-23 00:15:46 +00:00
2012-11-27 03:23:19 +00:00
cursorx = cursorblock - > datalength ;
memcpy ( cursorblock - > data + cursorblock - > datalength , b - > data , b - > datalength ) ;
cursorblock - > datalength + = b - > datalength ;
2004-08-23 00:15:46 +00:00
2012-11-27 03:23:19 +00:00
cursorblock - > next = b - > next ;
if ( b - > next )
b - > next - > prev = cursorblock ;
// cursorblock->prev->next = cursorblock->next;
// cursorblock->next->prev = cursorblock->prev;
2004-08-23 00:15:46 +00:00
2012-11-27 03:23:19 +00:00
E_Free ( b ) ;
// cursorblock = b;
}
else
{
cursorblock = cursorblock - > prev ;
cursorx = cursorblock - > datalength ;
}
2004-08-23 00:15:46 +00:00
break ;
}
case K_DEL : //bksp falls through.
2012-11-27 03:23:19 +00:00
if ( editenabled )
2004-08-23 00:15:46 +00:00
{
int a ;
fileblock_t * b ;
cursorlinenum = - 1 ;
madechanges = true ;
//FIXME: does this work right?
if ( ! cursorblock - > datalength & & cursorblock - > next & & cursorblock - > prev ) //blank line
2005-12-21 03:07:33 +00:00
{
2004-08-23 00:15:46 +00:00
b = cursorblock ;
2005-12-21 03:07:33 +00:00
if ( b - > next )
2004-08-23 00:15:46 +00:00
b - > next - > prev = b - > prev ;
if ( b - > prev )
2005-12-21 03:07:33 +00:00
b - > prev - > next = b - > next ;
2004-08-23 00:15:46 +00:00
if ( cursorblock - > next )
cursorblock = cursorblock - > next ;
else
cursorblock = cursorblock - > prev ;
E_Free ( b ) ;
}
else
{
for ( a = cursorx ; a < cursorblock - > datalength ; a + + )
cursorblock - > data [ a ] = cursorblock - > data [ a + 1 ] ;
cursorblock - > datalength - - ;
}
2006-03-10 03:50:23 +00:00
if ( cursorx > cursorblock - > datalength )
cursorx = cursorblock - > datalength ;
2004-08-23 00:15:46 +00:00
}
break ;
2005-12-21 03:07:33 +00:00
case K_ENTER :
2013-05-03 04:28:08 +00:00
case K_KP_ENTER :
2012-11-27 03:23:19 +00:00
if ( editenabled )
2004-08-23 00:15:46 +00:00
{
fileblock_t * b = cursorblock ;
cursorlinenum = - 1 ;
madechanges = true ;
2006-03-10 03:50:23 +00:00
GETBLOCK ( b - > datalength - cursorx , cursorblock ) ;
2004-08-23 00:15:46 +00:00
cursorblock - > next = b - > next ;
cursorblock - > prev = b ;
b - > next = cursorblock ;
if ( cursorblock - > next )
cursorblock - > next - > prev = cursorblock ;
if ( cursorblock - > prev )
cursorblock - > prev - > next = cursorblock ;
2006-03-10 03:50:23 +00:00
cursorblock - > datalength = b - > datalength - cursorx ;
memcpy ( cursorblock - > data , b - > data + cursorx , cursorblock - > datalength ) ;
b - > datalength = cursorx ;
2004-08-23 00:15:46 +00:00
cursorx = 0 ;
}
2012-11-27 03:23:19 +00:00
else if ( cursorblock - > next )
{
cursorblock = cursorblock - > next ;
cursorlinenum + + ;
cursorx = 0 ;
}
2004-08-23 00:15:46 +00:00
break ;
case K_INS :
insertkeyhit = insertkeyhit ? false : true ;
break ;
default :
2012-11-27 03:23:19 +00:00
if ( ! editenabled )
break ;
2009-07-25 11:05:06 +00:00
if ( unicode < ' ' & & unicode ! = ' \t ' ) //we deem these as unprintable
2012-11-27 03:23:19 +00:00
break ;
2004-08-23 00:15:46 +00:00
if ( insertkeyhit ) //insert a char
{
char * s ;
madechanges = true ;
MakeNewSize ( cursorblock , cursorblock - > datalength + 5 ) ; //allocate a bit extra, so we don't need to keep resizing it and shifting loads a data about
s = cursorblock - > data + cursorblock - > datalength ;
while ( s > = cursorblock - > data + cursorx )
{
s [ 1 ] = s [ 0 ] ;
s - - ;
}
cursorx + + ;
cursorblock - > datalength + + ;
2009-07-25 11:05:06 +00:00
* ( s + 1 ) = unicode ;
2004-08-23 00:15:46 +00:00
}
else //over write a char
2005-12-21 03:07:33 +00:00
{
2004-08-23 00:15:46 +00:00
MakeNewSize ( cursorblock , cursorblock - > datalength + 5 ) ; //not really needed
2005-12-21 03:07:33 +00:00
2009-07-25 11:05:06 +00:00
cursorblock - > data [ cursorx ] = unicode ;
2004-08-23 00:15:46 +00:00
cursorx + + ;
2006-03-10 03:50:23 +00:00
if ( cursorx > cursorblock - > datalength )
cursorblock - > datalength = cursorx ;
2004-08-23 00:15:46 +00:00
}
break ;
}
}
2012-11-27 03:23:19 +00:00
static void Draw_Line ( int vy , fileblock_t * b , int cursorx )
2004-08-23 00:15:46 +00:00
{
2012-11-27 03:23:19 +00:00
int nx = 0 ;
int y ;
------------------------------------------------------------------------
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
char * tooltip = NULL , * t ;
2012-11-27 03:23:19 +00:00
int nnx ;
2004-08-23 00:15:46 +00:00
qbyte * d = b - > data ;
2011-05-20 04:10:46 +00:00
qbyte * c ;
int i ;
2012-11-27 03:23:19 +00:00
int smx = ( mousecursor_x * vid . pixelwidth ) / vid . width , smy = ( mousecursor_y * vid . pixelheight ) / vid . height ;
unsigned int colour ;
2004-08-23 00:15:46 +00:00
int ts = edittabspacing . value ;
2012-11-27 03:23:19 +00:00
char linebuf [ 128 ] ;
2004-08-23 00:15:46 +00:00
2011-05-20 04:10:46 +00:00
if ( cursorx > = 0 )
c = d + cursorx ;
2004-08-23 00:15:46 +00:00
else
2011-05-20 04:10:46 +00:00
c = NULL ;
2004-08-23 00:15:46 +00:00
2013-12-29 22:48:28 +00:00
Font_BeginString ( font_default , nx , vy , & nx , & y ) ;
2004-08-23 00:15:46 +00:00
if ( ts < 1 )
ts = 4 ;
ts * = 8 ;
2012-11-27 03:23:19 +00:00
//figure out the colour
2004-08-23 00:15:46 +00:00
if ( b - > flags & ( FB_BREAK ) )
{
2012-11-27 03:23:19 +00:00
if ( executionblock = = b )
colour = COLOR_MAGENTA < < CON_FGSHIFT ;
else
colour = COLOR_RED < < CON_FGSHIFT ;
}
else
{
if ( executionblock = = b )
colour = COLOR_YELLOW < < CON_FGSHIFT ; //yellow
2004-08-23 00:15:46 +00:00
else
2012-11-27 03:23:19 +00:00
colour = COLOR_WHITE < < CON_FGSHIFT ;
2004-08-23 00:15:46 +00:00
}
2012-11-27 03:23:19 +00:00
//if this line currently holds the mouse cursor, figure out the word that is highighted, and evaluate that word for debugging.
//self.ammo_shells is just 'self' if you highlight 'self', but if you highlight ammo_shells, it'll include the self, for easy debugging.
//use the f3 evaulator for more explicit debugging.
if ( editprogfuncs & & smy > = y & & smy < y + Font_CharHeight ( ) )
{
int e , s ;
nx = - viewportx ;
for ( i = 0 ; i < b - > datalength ; i + + )
{
if ( d [ i ] = = ' \t ' )
{
nnx = nx + ts ;
nnx - = ( nnx - - viewportx ) % ts ;
}
else
2015-07-14 14:47:00 +00:00
nnx = Font_CharEndCoord ( font_default , nx , colour , ( int ) d [ i ] ) ;
2012-11-27 03:23:19 +00:00
if ( smx > = nx & & smx < = nnx )
{
for ( s = i ; s > 0 ; )
{
if ( ( d [ s - 1 ] > = ' a ' & & d [ s - 1 ] < = ' z ' ) | |
( d [ s - 1 ] > = ' A ' & & d [ s - 1 ] < = ' Z ' ) | |
( d [ s - 1 ] > = ' 0 ' & & d [ s - 1 ] < = ' 9 ' ) | |
d [ s - 1 ] = = ' . ' | | d [ s - 1 ] = = ' _ ' )
s - - ;
else
break ;
}
for ( e = i ; e < b - > datalength ; )
{
if ( ( d [ e ] > = ' a ' & & d [ e ] < = ' z ' ) | |
( d [ e ] > = ' A ' & & d [ e ] < = ' Z ' ) | |
( d [ e ] > = ' 0 ' & & d [ e ] < = ' 9 ' ) | |
/*d[e] == '.' ||*/ d [ e ] = = ' _ ' )
e + + ;
else
break ;
}
if ( e > = s + sizeof ( linebuf ) )
e = s + sizeof ( linebuf ) - 1 ;
memcpy ( linebuf , d + s , e - s ) ;
linebuf [ e - s ] = 0 ;
if ( * linebuf )
tooltip = editprogfuncs - > EvaluateDebugString ( editprogfuncs , linebuf ) ;
break ;
}
nx = nnx ;
}
}
nx = - viewportx ;
2011-05-20 04:10:46 +00:00
2004-08-23 00:15:46 +00:00
for ( i = 0 ; i < b - > datalength ; i + + )
{
if ( * d = = ' \t ' )
{
2011-05-20 04:10:46 +00:00
if ( d = = c )
2012-11-27 03:23:19 +00:00
{
2015-07-14 14:47:00 +00:00
int e = Font_DrawChar ( nx , y , CON_WHITEMASK | CON_BLINKTEXT , ( int ) 0xe00b ) ;
2012-11-27 03:23:19 +00:00
if ( e > = vid . pixelwidth )
viewportx + = e - vid . pixelwidth ;
if ( nx < 0 )
{
viewportx - = - nx ;
if ( viewportx < 0 )
viewportx = 0 ;
}
}
2004-08-23 00:15:46 +00:00
nx + = ts ;
2012-11-27 03:23:19 +00:00
nx - = ( nx - - viewportx ) % ts ;
2005-12-21 03:07:33 +00:00
d + + ;
continue ;
2004-08-23 00:15:46 +00:00
}
2012-11-27 03:23:19 +00:00
if ( nx < = ( int ) vid . pixelwidth | | cursorx > = 0 )
2015-07-14 14:47:00 +00:00
nnx = Font_DrawChar ( nx , y , colour , ( int ) * d ) ;
2011-05-20 04:10:46 +00:00
else nnx = vid . pixelwidth ;
if ( d = = c )
2012-11-27 03:23:19 +00:00
{
2015-07-14 14:47:00 +00:00
int e = Font_DrawChar ( nx , y , CON_WHITEMASK | CON_BLINKTEXT , ( int ) 0xe00b ) ;
2012-11-27 03:23:19 +00:00
if ( e > = vid . pixelwidth )
viewportx + = e - vid . pixelwidth ;
if ( nx < 0 )
{
viewportx - = - nx ;
if ( viewportx < 0 )
viewportx = 0 ;
}
}
2011-05-20 04:10:46 +00:00
nx = nnx ;
2004-08-23 00:15:46 +00:00
d + + ;
2005-12-21 03:07:33 +00:00
}
2011-05-20 04:10:46 +00:00
/*we didn't do the cursor! stick it at the end*/
if ( c & & c > = d )
2012-11-27 03:23:19 +00:00
{
2015-07-14 14:47:00 +00:00
int e = Font_DrawChar ( nx , y , CON_WHITEMASK | CON_BLINKTEXT , ( int ) 0xe00b ) ;
2012-11-27 03:23:19 +00:00
if ( e > = vid . pixelwidth )
viewportx + = e - vid . pixelwidth ;
if ( nx < 0 )
{
viewportx - = - nx ;
if ( viewportx < 0 )
viewportx = 0 ;
}
}
2011-05-20 04:10:46 +00:00
2012-11-27 03:23:19 +00:00
if ( tooltip )
{
------------------------------------------------------------------------
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
nx = ( ( mousecursor_x + 16 ) * vid . pixelwidth ) / vid . width ;
2012-11-27 03:23:19 +00:00
while ( * tooltip )
{
------------------------------------------------------------------------
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
for ( t = tooltip , smx = nx ; * tooltip ; tooltip + + )
2012-11-27 03:23:19 +00:00
{
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( * tooltip = = ' \n ' )
break ;
2015-07-14 14:47:00 +00:00
smx = Font_CharEndCoord ( font_default , smx , ( COLOR_CYAN < < CON_FGSHIFT ) , * tooltip ) ;
2012-11-27 03:23:19 +00:00
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
y = Font_CharHeight ( ) ;
2013-12-29 22:48:28 +00:00
Font_EndString ( font_default ) ;
------------------------------------------------------------------------
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
R2D_ImageColours ( 0 , 0 , 0 , 1 ) ;
R2D_FillBlock ( ( ( nx ) * vid . width ) / vid . pixelwidth , ( ( smy ) * vid . height ) / vid . pixelheight , ( ( smx - nx ) * vid . width ) / vid . pixelwidth , ( y * vid . height ) / vid . pixelheight ) ;
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
2013-12-29 22:48:28 +00:00
Font_BeginString ( font_default , nx , vy , & y , & y ) ;
------------------------------------------------------------------------
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
for ( smx = nx ; t < tooltip ; t + + )
{
2015-07-14 14:47:00 +00:00
smx = Font_DrawChar ( smx , smy , ( COLOR_CYAN < < CON_FGSHIFT ) , * t ) ;
------------------------------------------------------------------------
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 ( * tooltip = = ' \n ' )
tooltip + + ;
smy + = Font_CharHeight ( ) ;
2012-11-27 03:23:19 +00:00
}
}
2013-12-29 22:48:28 +00:00
Font_EndString ( font_default ) ;
2004-08-23 00:15:46 +00:00
}
2011-05-20 04:10:46 +00:00
static fileblock_t * firstline ( void )
2004-08-23 00:15:46 +00:00
{
int lines ;
fileblock_t * b ;
lines = ( vid . height / 8 ) / 2 - 1 ;
b = cursorblock ;
if ( ! b )
return NULL ;
while ( 1 )
{
if ( ! b - > prev )
return b ;
b = b - > prev ;
lines - - ;
if ( lines < = 0 )
return b ;
}
return NULL ;
}
void Editor_Draw ( void )
{
int y ;
2011-05-20 04:10:46 +00:00
int c ;
2004-08-23 00:15:46 +00:00
fileblock_t * b ;
if ( ( editoractive & & cls . state = = ca_disconnected ) | | editormodal )
2011-03-31 01:14:01 +00:00
R2D_EditorBackground ( ) ;
2004-08-23 00:15:46 +00:00
if ( cursorlinenum < 0 ) //look for the cursor line num
{
cursorlinenum = 0 ;
for ( b = firstblock ; b ; b = b - > next )
{
cursorlinenum + + ;
if ( b = = cursorblock )
break ;
2005-12-21 03:07:33 +00:00
}
2004-08-23 00:15:46 +00:00
}
if ( ! viewportystartblock ) //look for the cursor line num
{
y = 0 ;
for ( viewportystartblock = firstblock ; viewportystartblock ; viewportystartblock = viewportystartblock - > prev )
{
y + + ;
if ( y = = viewporty )
break ;
2005-12-21 03:07:33 +00:00
}
2004-08-23 00:15:46 +00:00
}
if ( madechanges )
2009-11-04 21:16:50 +00:00
Draw_FunString ( vid . width - 8 , 0 , " ! " ) ;
2004-08-23 00:15:46 +00:00
if ( ! insertkeyhit )
2009-11-04 21:16:50 +00:00
Draw_FunString ( vid . width - 16 , 0 , " O " ) ;
2012-11-27 03:23:19 +00:00
if ( ! editenabled )
Draw_FunString ( vid . width - 24 , 0 , " R " ) ;
2009-11-04 21:16:50 +00:00
Draw_FunString ( 0 , 0 , va ( " %6i:%4i:%s " , cursorlinenum , cursorx + 1 , OpenEditorFile ) ) ;
2004-08-23 00:15:46 +00:00
if ( useeval )
{
if ( ! editprogfuncs )
useeval = false ;
else
{
2011-12-05 15:23:40 +00:00
char * eq , * term ;
2009-11-04 21:16:50 +00:00
Draw_FunString ( 0 , 8 , evalstring ) ;
2006-09-18 22:52:33 +00:00
eq = strchr ( evalstring , ' = ' ) ;
if ( eq )
{
2011-12-05 15:23:40 +00:00
term = strchr ( eq , ' ; ' ) ;
if ( ! term )
term = strchr ( eq , ' \n ' ) ;
if ( ! term )
term = strchr ( eq , ' \r ' ) ;
if ( term )
2006-09-18 22:52:33 +00:00
{
2011-12-05 15:23:40 +00:00
* term = ' \0 ' ;
2006-09-18 22:52:33 +00:00
eq = NULL ;
}
else
* eq = ' \0 ' ;
}
2009-11-04 21:16:50 +00:00
Draw_FunString ( vid . width / 2 , 8 , editprogfuncs - > EvaluateDebugString ( editprogfuncs , evalstring ) ) ;
2006-09-18 22:52:33 +00:00
if ( eq )
* eq = ' = ' ;
2004-08-23 00:15:46 +00:00
}
y = 16 ;
}
else
y = 8 ;
b = firstline ( ) ;
for ( ; b ; b = b - > next )
{
2011-05-20 04:10:46 +00:00
c = - 1 ;
2004-08-23 00:15:46 +00:00
if ( b = = cursorblock )
2012-11-27 03:23:19 +00:00
c = cursorx ;
Draw_Line ( y , b , c ) ;
2004-08-23 00:15:46 +00:00
y + = 8 ;
if ( y > vid . height )
break ;
}
2005-12-21 03:07:33 +00:00
2004-08-23 00:15:46 +00:00
/* if (CmdAfterSave)
{
if ( madechanges )
{
M_DrawTextBox ( 0 , 0 , 36 , 5 ) ;
M_PrintWhite ( 16 , 12 , OpenEditorFile ) ;
M_PrintWhite ( 16 , 28 , " Do you want to save the open file? " ) ;
M_PrintWhite ( 16 , 36 , " [Y]es/[N]o/[C]ancel " ) ;
}
else
{
if ( ! CmdAfterSaveCalled )
{
CmdAfterSaveCalled = true ;
( * CmdAfterSave ) ( ) ;
CmdAfterSaveCalled = false ;
}
CmdAfterSave = NULL ;
}
}
*/
}
2015-09-06 03:30:28 +00:00
int QCLibEditor ( pubprogfuncs_t * prfncs , const char * filename , int * line , int * statement , char * reason , pbool fatal )
2004-08-23 00:15:46 +00:00
{
2015-02-02 08:01:53 +00:00
const char * f1 , * f2 ;
if ( ! pr_debugger . ival )
{
Con_Printf ( " Set %s to trace \n " , pr_debugger . name ) ;
2015-09-06 03:30:28 +00:00
if ( fatal )
return DEBUG_TRACE_ABORT ;
2015-02-02 08:01:53 +00:00
return DEBUG_TRACE_OFF ; //get lost
}
//we can cope with no line info by displaying asm
if ( editormodal | | ! statement )
2015-09-06 03:30:28 +00:00
{
if ( fatal )
return DEBUG_TRACE_ABORT ;
2015-02-02 08:01:53 +00:00
return DEBUG_TRACE_OFF ; //whoops
2015-09-06 03:30:28 +00:00
}
2004-08-23 00:15:46 +00:00
2010-02-06 01:25:04 +00:00
if ( qrenderer = = QR_NONE )
2004-10-01 22:16:01 +00:00
{
int i ;
char buffer [ 8192 ] ;
char * r ;
2005-12-21 03:07:33 +00:00
vfsfile_t * f ;
2004-10-01 22:16:01 +00:00
2005-12-21 03:07:33 +00:00
f = FS_OpenVFS ( filename , " rb " , FS_GAME ) ;
2004-10-01 22:16:01 +00:00
if ( ! f )
2015-02-02 08:01:53 +00:00
Con_Printf ( " %s - %i \n " , filename , * line ) ;
2004-10-01 22:16:01 +00:00
else
{
2015-02-02 08:01:53 +00:00
for ( i = 0 ; i < * line ; i + + )
2004-10-01 22:16:01 +00:00
{
2005-12-21 03:07:33 +00:00
VFS_GETS ( f , buffer , sizeof ( buffer ) ) ;
2004-10-01 22:16:01 +00:00
}
if ( ( r = strchr ( buffer , ' \r ' ) ) )
{ r [ 0 ] = ' \n ' ; r [ 1 ] = ' \0 ' ; }
Con_Printf ( " %s " , buffer ) ;
2005-12-21 03:07:33 +00:00
VFS_CLOSE ( f ) ;
2004-10-01 22:16:01 +00:00
}
//PF_break(NULL);
2015-02-02 08:01:53 +00:00
return DEBUG_TRACE_OUT ;
2004-10-01 22:16:01 +00:00
}
2005-08-03 23:14:59 +00:00
editprogfuncs = prfncs ;
2011-05-20 04:10:46 +00:00
f1 = OpenEditorFile ;
f2 = filename ;
if ( ! strncmp ( f1 , " src/ " , 4 ) )
f1 + = 4 ;
if ( ! strncmp ( f2 , " src/ " , 4 ) )
f2 + = 4 ;
2013-03-12 22:53:23 +00:00
if ( ! strncmp ( f1 , " source/ " , 7 ) )
f1 + = 7 ;
if ( ! strncmp ( f2 , " source/ " , 7 ) )
f2 + = 7 ;
2012-11-27 03:23:19 +00:00
2015-02-02 08:01:53 +00:00
stepasm = ! line ;
2012-11-27 03:23:19 +00:00
if ( stepasm )
2004-08-23 00:15:46 +00:00
{
2012-11-27 03:23:19 +00:00
fileblock_t * nb , * lb ;
int i ;
EditorNewFile ( ) ;
E_Free ( firstblock - > next ) ;
E_Free ( firstblock ) ;
2015-02-02 08:01:53 +00:00
cursorlinenum = * statement ;
2012-11-27 03:23:19 +00:00
firstblock = GenAsm ( cursorlinenum ) ;
cursorblock = firstblock ;
2004-08-23 00:15:46 +00:00
2013-03-12 22:47:42 +00:00
for ( i = cursorlinenum ; i > 0 & & i > cursorlinenum - 20 ; )
2012-11-27 03:23:19 +00:00
{
i - - ;
firstblock - > prev = GenAsm ( i ) ;
firstblock - > prev - > next = firstblock ;
firstblock = firstblock - > prev ;
}
lb = cursorblock ;
for ( i = cursorlinenum ; i < cursorlinenum + 20 ; )
{
i + + ;
nb = GenAsm ( i ) ;
lb - > next = nb ;
nb - > prev = lb ;
lb = nb ;
}
2004-08-23 00:15:46 +00:00
}
2012-11-27 03:23:19 +00:00
else
{
if ( ! editoractive | | strcmp ( f1 , f2 ) )
{
if ( editoractive & & madechanges )
EditorSaveFile ( OpenEditorFile ) ;
2004-08-23 00:15:46 +00:00
2012-11-27 03:23:19 +00:00
EditorOpenFile ( filename , true ) ;
}
2015-02-02 08:01:53 +00:00
for ( cursorlinenum = 1 , cursorblock = firstblock ; cursorlinenum < * line & & cursorblock - > next ; cursorlinenum + + )
2012-11-27 03:23:19 +00:00
cursorblock = cursorblock - > next ;
}
executionlinenum = cursorlinenum ;
2004-08-23 00:15:46 +00:00
executionblock = cursorblock ;
{
2012-11-27 03:23:19 +00:00
double oldrealtime = realtime ;
2004-08-23 00:15:46 +00:00
editormodal = true ;
2015-02-02 08:01:53 +00:00
editorstep = DEBUG_TRACE_OFF ;
2004-08-23 00:15:46 +00:00
2005-05-26 12:55:34 +00:00
while ( editormodal & & editoractive & & editprogfuncs )
2004-08-23 00:15:46 +00:00
{
2012-11-27 03:23:19 +00:00
realtime = Sys_DoubleTime ( ) ;
2005-08-03 23:14:59 +00:00
// key_dest = key_editor;
2004-08-23 00:15:46 +00:00
scr_disabled_for_loading = false ;
SCR_UpdateScreen ( ) ;
Sys_SendKeyEvents ( ) ;
2012-11-27 03:23:19 +00:00
IN_Commands ( ) ;
2006-09-18 22:52:33 +00:00
S_ExtraUpdate ( ) ;
2004-08-23 00:15:46 +00:00
2014-07-02 03:20:40 +00:00
NET_Sleep ( 20 / 1000.0 , false ) ; //any os.
2004-08-23 00:15:46 +00:00
}
2012-11-27 03:23:19 +00:00
realtime = oldrealtime ;
2004-08-23 00:15:46 +00:00
editormodal = false ;
}
2012-11-27 03:23:19 +00:00
if ( stepasm )
2015-02-02 08:01:53 +00:00
{
2015-03-03 00:14:43 +00:00
if ( line )
* line = 0 ;
2015-02-02 08:01:53 +00:00
* statement = executionlinenum ;
}
2015-03-03 00:14:43 +00:00
else if ( line )
2015-02-02 08:01:53 +00:00
* line = executionlinenum ;
return editorstep ;
2004-08-23 00:15:46 +00:00
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
void Editor_ProgsKilled ( pubprogfuncs_t * dead )
2011-05-20 04:10:46 +00:00
{
if ( editprogfuncs = = dead )
{
editprogfuncs = NULL ;
editormodal = false ;
2015-02-02 08:01:53 +00:00
editorstep = DEBUG_TRACE_OFF ;
2011-05-20 04:10:46 +00:00
}
}
static void Editor_f ( void )
2004-08-23 00:15:46 +00:00
{
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
int argc = Cmd_Argc ( ) ;
if ( argc ! = 2 & & argc ! = 3 )
2005-08-14 03:55:08 +00:00
{
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
Con_Printf ( " edit <filename> [line] \n " ) ;
2005-08-14 03:55:08 +00:00
return ;
}
2006-03-10 03:50:23 +00:00
editprogfuncs = NULL ;
useeval = false ;
2012-11-27 03:23:19 +00:00
if ( editoractive & & madechanges )
2004-08-23 00:15:46 +00:00
EditorSaveFile ( OpenEditorFile ) ;
2012-11-27 03:23:19 +00:00
EditorOpenFile ( Cmd_Argv ( 1 ) , false ) ;
2004-08-23 00:15:46 +00:00
// EditorNewFile();
------------------------------------------------------------------------
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 ( argc = = 3 )
{
int line = atoi ( Cmd_Argv ( 2 ) ) ;
for ( cursorlinenum = 1 , cursorblock = firstblock ; cursorlinenum < line & & cursorblock - > next ; cursorlinenum + + )
cursorblock = cursorblock - > next ;
}
2004-08-23 00:15:46 +00:00
}
void Editor_Init ( void )
{
Cmd_AddCommand ( " edit " , Editor_f ) ;
2005-12-21 03:07:33 +00:00
2004-08-23 00:15:46 +00:00
Cvar_Register ( & editstripcr , " Text editor " ) ;
Cvar_Register ( & editaddcr , " Text editor " ) ;
Cvar_Register ( & edittabspacing , " Text editor " ) ;
2014-05-10 13:42:13 +00:00
Cvar_Register ( & pr_debugger , " Text editor " ) ;
2004-08-23 00:15:46 +00:00
}
# endif