mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 05:41:52 +00:00
extra files needed for windows gui compiler.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@41 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
f0aef8bb6e
commit
ecf8930ed2
3 changed files with 1767 additions and 0 deletions
2
engine/qclib/gui.h
Normal file
2
engine/qclib/gui.h
Normal file
|
@ -0,0 +1,2 @@
|
|||
void GoToDefinition(char *name);
|
||||
void EditFile(char *name, int line);
|
1721
engine/qclib/qccgui.c
Normal file
1721
engine/qclib/qccgui.c
Normal file
File diff suppressed because it is too large
Load diff
44
engine/qclib/qccguistuff.c
Normal file
44
engine/qclib/qccguistuff.c
Normal file
|
@ -0,0 +1,44 @@
|
|||
#include "qcc.h"
|
||||
#include "gui.h"
|
||||
|
||||
void GoToDefinition(char *name)
|
||||
{
|
||||
QCC_def_t *def;
|
||||
QCC_dfunction_t *fnc;
|
||||
|
||||
char *strip; //trim whitespace (for convieniance).
|
||||
while (*name <= ' ' && *name)
|
||||
name++;
|
||||
for (strip = name + strlen(name)-1; *strip; strip++)
|
||||
{
|
||||
if (*strip <= ' ')
|
||||
*strip = '\0';
|
||||
else //got some part of a word
|
||||
break;
|
||||
}
|
||||
|
||||
if (!globalstable.numbuckets)
|
||||
{
|
||||
MessageBox(NULL, "You need to compile first.", "Not found", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
def = QCC_PR_GetDef(NULL, name, NULL, false, 0);
|
||||
|
||||
if (def)
|
||||
{
|
||||
if (def->type->type == ev_function && def->constant)
|
||||
{
|
||||
fnc = &functions[((int *)qcc_pr_globals)[def->ofs]];
|
||||
if (fnc->first_statement>=0)
|
||||
{
|
||||
EditFile(fnc->s_file+strings, statement_linenums[fnc->first_statement]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
EditFile(def->s_file+strings, def->s_line-1);
|
||||
}
|
||||
else
|
||||
MessageBox(NULL, "Global instance of var was not found", "Not found", 0);
|
||||
}
|
Loading…
Reference in a new issue