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 // this is checked against http://eduke32.com/VERSION
#define BUILDDATE " 20080825" #define BUILDDATE " 20080826"
#define APPNAME "EDuke32" #define APPNAME "EDuke32"
#define VERSION " 1.5.0devel" #define VERSION " 1.5.0devel"
#define HEAD2 APPNAME VERSION BUILDDATE #define HEAD2 APPNAME VERSION BUILDDATE

View file

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

View file

@ -1006,18 +1006,6 @@ void freehash()
HASH_free(&gamevarH); HASH_free(&gamevarH);
HASH_free(&arrayH); HASH_free(&arrayH);
HASH_free(&labelH); 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) static int increasescriptsize(int size)
@ -1469,7 +1457,7 @@ static void getlabel(void)
i = 0; i = 0;
while (ispecial(*textptr) == 0 && *textptr!='['&& *textptr!=']' && *textptr!='\t' && *textptr!='\n' && *textptr!='\r') 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; label[(labelcnt<<6)+i] = 0;
if (!(error || warning) && g_ScriptDebug > 1) if (!(error || warning) && g_ScriptDebug > 1)
@ -1494,10 +1482,7 @@ static int keyword(void)
i = 0; i = 0;
while (isaltok(*temptextptr)) while (isaltok(*temptextptr))
{ tempbuf[i++] = *(temptextptr++);
tempbuf[i] = *(temptextptr++);
i++;
}
tempbuf[i] = 0; tempbuf[i] = 0;
return HASH_find(&keywH,tempbuf); return HASH_find(&keywH,tempbuf);
} }
@ -1578,7 +1563,7 @@ static void transvartype(int type)
getlabel(); getlabel();
return; return;
} }
else if ((*textptr == '-') && !isdigit(*(textptr+1))) else if ((*textptr == '-')/* && !isdigit(*(textptr+1))*/)
{ {
if (!type) if (!type)
{ {
@ -2069,20 +2054,6 @@ static int parsecommand(void)
ReportError(ERROR_ISAKEYWORD); ReportError(ERROR_ISAKEYWORD);
return 0; 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); //printf("Translating number '%.20s'\n",textptr);
transnum(LABEL_DEFINE); // get initial value transnum(LABEL_DEFINE); // get initial value
@ -5507,6 +5478,7 @@ void loadefs(const char *filenam)
char *mptr; char *mptr;
int i; int i;
int fs,fp; int fs,fp;
int startcompiletime;
clearbuf(apScriptGameEvent,MAXGAMEEVENTS,0L); clearbuf(apScriptGameEvent,MAXGAMEEVENTS,0L);
@ -5551,6 +5523,8 @@ void loadefs(const char *filenam)
initprintf("Compiling: %s (%d bytes)\n",filenam,fs); initprintf("Compiling: %s (%d bytes)\n",filenam,fs);
startcompiletime = getticks();
mptr = (char *)Bmalloc(fs+1); mptr = (char *)Bmalloc(fs+1);
if (!mptr) if (!mptr)
{ {
@ -5649,10 +5623,25 @@ void loadefs(const char *filenam)
{ {
int j=0, k=0; 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; total_lines += line_number;
increasescriptsize(scriptptr-script+1); 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("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); 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,11 +462,9 @@ 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); initprintf("%s:%d: error: variable name `%s' exceeds limit of %d characters.\n",compilefile,line_number,pszLabel, MAXVARLABEL);
return 0; return 0;
} }
for (i=0;i<iGameVarCount;i++) i = HASH_find(&gamevarH,pszLabel);
{
if (aGameVars[i].szLabel != NULL && !aGameVars[i].bReset) if (i >= 0 && !aGameVars[i].bReset)
{
if (Bstrcmp(pszLabel,aGameVars[i].szLabel) == 0)
{ {
// found it... // found it...
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_INTPTR|GAMEVAR_FLAG_SHORTPTR|GAMEVAR_FLAG_CHARPTR)) if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_INTPTR|GAMEVAR_FLAG_SHORTPTR|GAMEVAR_FLAG_CHARPTR))
@ -477,15 +475,7 @@ int AddGameVar(const char *pszLabel, int lValue, unsigned int dwFlags)
initprintf("%s:%d: warning: cannot redefine internal gamevar `%s'.\n",compilefile,line_number,label+(labelcnt<<6)); initprintf("%s:%d: warning: cannot redefine internal gamevar `%s'.\n",compilefile,line_number,label+(labelcnt<<6));
return 0; return 0;
} }
else if ((aGameVars[i].dwFlags & GAMEVAR_FLAG_DEFAULT) || (aGameVars[i].dwFlags & GAMEVAR_FLAG_SYSTEM)) 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 // it's a duplicate in error
warning++; warning++;
@ -493,8 +483,9 @@ int AddGameVar(const char *pszLabel, int lValue, unsigned int dwFlags)
return 0; return 0;
} }
} }
} if (i == -1)
} i = iGameVarCount;
if (i < MAXGAMEVARS) if (i < MAXGAMEVARS)
{ {
// Set values // 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 UNSELMENUSHADE 10
#define DISABLEDMENUSHADE 20 #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 MENUHIGHLIGHT(x) probey==x?-(sintable[(totalclock<<4)&2047]>>12):probey-x>=0?(probey-x)<<2:-((probey-x)<<2)
#define SHX(X) 0 #define SHX(X) 0