git-svn-id: https://svn.eduke32.com/eduke32@1034 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-08-26 08:39:45 +00:00
parent 69dbba841c
commit f0032888fe
5 changed files with 45 additions and 65 deletions

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//-------------------------------------------------------------------------
// this is checked against http://eduke32.com/VERSION
#define BUILDDATE " 20080825"
#define BUILDDATE " 20080826"
#define APPNAME "EDuke32"
#define VERSION " 1.5.0devel"
#define HEAD2 APPNAME VERSION BUILDDATE

View file

@ -10178,6 +10178,8 @@ static void Startup(void)
{
int i;
inittimer(TICRATE);
compilecons();
CONFIG_ReadKeys(); // we re-read the keys after compiling the CONs
@ -10306,8 +10308,6 @@ static void Startup(void)
for (i=0;i<joynumaxes;i++)
setjoydeadzone(i,ud.config.JoystickAnalogueDead[i],ud.config.JoystickAnalogueSaturate[i]);
inittimer(TICRATE);
//initprintf("* Hold Esc to Abort. *\n");
// initprintf("Loading art header...\n");

View file

@ -1006,18 +1006,6 @@ void freehash()
HASH_free(&gamevarH);
HASH_free(&arrayH);
HASH_free(&labelH);
HASH_free(&keywH);
freehashnames();
HASH_free(&sectorH);
HASH_free(&wallH);
HASH_free(&userdefH);
HASH_free(&projectileH);
HASH_free(&playerH);
HASH_free(&inputH);
HASH_free(&actorH);
HASH_free(&tspriteH);
}
static int increasescriptsize(int size)
@ -1469,7 +1457,7 @@ static void getlabel(void)
i = 0;
while (ispecial(*textptr) == 0 && *textptr!='['&& *textptr!=']' && *textptr!='\t' && *textptr!='\n' && *textptr!='\r')
label[(labelcnt<<6)+i++] = *(textptr++);
label[(labelcnt<<6)+(i++)] = *(textptr++);
label[(labelcnt<<6)+i] = 0;
if (!(error || warning) && g_ScriptDebug > 1)
@ -1494,10 +1482,7 @@ static int keyword(void)
i = 0;
while (isaltok(*temptextptr))
{
tempbuf[i] = *(temptextptr++);
i++;
}
tempbuf[i++] = *(temptextptr++);
tempbuf[i] = 0;
return HASH_find(&keywH,tempbuf);
}
@ -1578,7 +1563,7 @@ static void transvartype(int type)
getlabel();
return;
}
else if ((*textptr == '-') && !isdigit(*(textptr+1)))
else if ((*textptr == '-')/* && !isdigit(*(textptr+1))*/)
{
if (!type)
{
@ -2069,20 +2054,6 @@ static int parsecommand(void)
ReportError(ERROR_ISAKEYWORD);
return 0;
}
#if 0
for (i=0;i<iGameVarCount;i++)
{
if (aGameVars[i].szLabel != NULL)
{
if (Bstrcmp(label+(labelcnt<<6),aGameVars[i].szLabel) == 0)
{
warning++;
initprintf(" * WARNING.(L%d) duplicate Game definition `%s' ignored.\n",line_number,label+(labelcnt<<6));
break;
}
}
}
#endif
//printf("Translating number '%.20s'\n",textptr);
transnum(LABEL_DEFINE); // get initial value
@ -5507,6 +5478,7 @@ void loadefs(const char *filenam)
char *mptr;
int i;
int fs,fp;
int startcompiletime;
clearbuf(apScriptGameEvent,MAXGAMEEVENTS,0L);
@ -5551,6 +5523,8 @@ void loadefs(const char *filenam)
initprintf("Compiling: %s (%d bytes)\n",filenam,fs);
startcompiletime = getticks();
mptr = (char *)Bmalloc(fs+1);
if (!mptr)
{
@ -5649,10 +5623,25 @@ void loadefs(const char *filenam)
{
int j=0, k=0;
HASH_free(&keywH);
freehashnames();
HASH_free(&sectorH);
HASH_free(&wallH);
HASH_free(&userdefH);
HASH_free(&projectileH);
HASH_free(&playerH);
HASH_free(&inputH);
HASH_free(&actorH);
HASH_free(&tspriteH);
total_lines += line_number;
increasescriptsize(scriptptr-script+1);
initprintf("Compile completed in %dms\n",getticks()-startcompiletime);
initprintf("Compiled code size: %ld*%d bytes, version %s\n",(unsigned)(scriptptr-script),sizeof(intptr_t),(g_ScriptVersion == 14?"1.4+":"1.3D"));
initprintf("%ld/%ld labels, %d/%d variables\n",labelcnt,min((MAXSECTORS * sizeof(sectortype)/sizeof(int)),(MAXSPRITES * sizeof(spritetype)/(1<<6))),iGameVarCount,MAXGAMEVARS);

View file

@ -462,39 +462,30 @@ int AddGameVar(const char *pszLabel, int lValue, unsigned int dwFlags)
initprintf("%s:%d: error: variable name `%s' exceeds limit of %d characters.\n",compilefile,line_number,pszLabel, MAXVARLABEL);
return 0;
}
for (i=0;i<iGameVarCount;i++)
i = HASH_find(&gamevarH,pszLabel);
if (i >= 0 && !aGameVars[i].bReset)
{
if (aGameVars[i].szLabel != NULL && !aGameVars[i].bReset)
// found it...
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_INTPTR|GAMEVAR_FLAG_SHORTPTR|GAMEVAR_FLAG_CHARPTR))
{
if (Bstrcmp(pszLabel,aGameVars[i].szLabel) == 0)
{
// found it...
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_INTPTR|GAMEVAR_FLAG_SHORTPTR|GAMEVAR_FLAG_CHARPTR))
{
// warning++;
// initprintf("%s:%d: warning: Internal gamevar '%s' cannot be redefined.\n",compilefile,line_number,label+(labelcnt<<6));
ReportError(-1);
initprintf("%s:%d: warning: cannot redefine internal gamevar `%s'.\n",compilefile,line_number,label+(labelcnt<<6));
return 0;
}
else if ((aGameVars[i].dwFlags & GAMEVAR_FLAG_DEFAULT) || (aGameVars[i].dwFlags & GAMEVAR_FLAG_SYSTEM))
{
//Bsprintf(g_szBuf,"Replacing %s at %d",pszLabel,i);
//AddLog(g_szBuf);
//b=1;
// it's OK to replace
break;
}
else
{
// it's a duplicate in error
warning++;
ReportError(WARNING_DUPLICATEDEFINITION);
return 0;
}
}
// warning++;
// initprintf("%s:%d: warning: Internal gamevar '%s' cannot be redefined.\n",compilefile,line_number,label+(labelcnt<<6));
ReportError(-1);
initprintf("%s:%d: warning: cannot redefine internal gamevar `%s'.\n",compilefile,line_number,label+(labelcnt<<6));
return 0;
}
else if (!(aGameVars[i].dwFlags & GAMEVAR_FLAG_DEFAULT) && !(aGameVars[i].dwFlags & GAMEVAR_FLAG_SYSTEM))
{
// it's a duplicate in error
warning++;
ReportError(WARNING_DUPLICATEDEFINITION);
return 0;
}
}
if (i == -1)
i = iGameVarCount;
if (i < MAXGAMEVARS)
{
// Set values

View file

@ -455,7 +455,7 @@ static void modval(int min, int max,int *p,int dainc,int damodify)
#define UNSELMENUSHADE 10
#define DISABLEDMENUSHADE 20
#define MENUHIGHLIGHT(x) probey==x?-(sintable[(totalclock<<4)&2047]>>12):UNSELMENUSHADE
#define MENUHIGHLIGHT(x) probey==x?(sintable[(totalclock<<5)&2047]>>12):UNSELMENUSHADE
// #define MENUHIGHLIGHT(x) probey==x?-(sintable[(totalclock<<4)&2047]>>12):probey-x>=0?(probey-x)<<2:-((probey-x)<<2)
#define SHX(X) 0