Optimize some of the frequently used CON commands that have nasty overhead

git-svn-id: https://svn.eduke32.com/eduke32@428 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-12-18 08:37:12 +00:00
parent cb90dc8c83
commit d93dde5a59
8 changed files with 804 additions and 952 deletions

View file

@ -1069,7 +1069,7 @@ static void moveplayers(void) //Players
otherx = 0;
}
execute(&i,&s->yvel,&otherx);
execute(i,s->yvel,otherx);
if (ud.multimode > 1)
if (sprite[ps[otherp].i].extra > 0)
@ -2302,11 +2302,11 @@ CLEAR_THE_BOLT:
case STEAM__STATIC:
case CEILINGSTEAM__STATIC:
p = findplayer(s, &x);
execute(&i,&p,&x);
execute(i,p,x);
goto BOLT;
case WATERBUBBLEMAKER__STATIC:
p = findplayer(s, &x);
execute(&i,&p,&x);
execute(i,p,x);
goto BOLT;
}
@ -2772,7 +2772,7 @@ static void moveweapons(void)
if (thisprojectile[i].workslike & PROJECTILE_FLAG_HITSCAN)
{
p = findplayer(s,&x);
execute(&i,&p,&x);
execute(i,p,x);
goto BOLT;
}
@ -3133,7 +3133,7 @@ static void moveweapons(void)
case SHOTSPARK1__STATIC:
p = findplayer(s,&x);
execute(&i,&p,&x);
execute(i,p,x);
goto BOLT;
}
}
@ -4808,7 +4808,7 @@ DETONATEB:
p = findplayer(s,&x);
execute(&i,&p,&x);
execute(i,p,x);
BOLT:
@ -5249,7 +5249,7 @@ static void moveexplosions(void) // STATNUM 5
case TRANSPORTERSTAR__STATIC:
case TRANSPORTERBEAM__STATIC:
p = findplayer(s,&x);
execute(&i,&p,&x);
execute(i,p,x);
goto BOLT;
case SHELL__STATIC:

View file

@ -122,7 +122,7 @@ extern void getglobalz(short sActor);
extern void makeitfall(short sActor);
extern void loadefs(char *fn);
extern short furthestangle(short sActor,short angs);
extern void execute(const short *sActor,const short *sPlayer,const long *lDist);
extern void execute(int iActor,int iPlayer,long lDist);
extern void overwritesprite(long thex,long they,short tilenum,signed char shade,char stat,char dapalnum);
extern inline int gametext(int x,int y,char *t,char s,short dabits);
extern inline int gametextpal(int x,int y,char *t,char s,char p);

View file

@ -1689,32 +1689,32 @@ static void weapon_amounts(struct player_struct *p,long x,long y,long u)
if (p->subweapon&(1<<GROW_WEAPON))
weaponnum(SHRINKER_WEAPON,x+39,y+12,
p->ammo_amount[GROW_WEAPON],max_ammo_amount[GROW_WEAPON],
(!p->gotweapon[GROW_WEAPON]*9)+12-18*
(cw == GROW_WEAPON));
p->ammo_amount[GROW_WEAPON],max_ammo_amount[GROW_WEAPON],
(!p->gotweapon[GROW_WEAPON]*9)+12-18*
(cw == GROW_WEAPON));
else
weaponnum(SHRINKER_WEAPON,x+39,y+12,
p->ammo_amount[SHRINKER_WEAPON],max_ammo_amount[SHRINKER_WEAPON],
(!p->gotweapon[SHRINKER_WEAPON]*9)+12-18*
(cw == SHRINKER_WEAPON));
p->ammo_amount[SHRINKER_WEAPON],max_ammo_amount[SHRINKER_WEAPON],
(!p->gotweapon[SHRINKER_WEAPON]*9)+12-18*
(cw == SHRINKER_WEAPON));
}
if (u&256)
{
if (u != -1) patchstatusbar(158,178,162+29,178+6); //original code: (166,178,166+8,178+6);
weaponnum(DEVISTATOR_WEAPON,x+70,y,
p->ammo_amount[DEVISTATOR_WEAPON],max_ammo_amount[DEVISTATOR_WEAPON],
(!p->gotweapon[DEVISTATOR_WEAPON]*9)+12-18*
(cw == DEVISTATOR_WEAPON));
p->ammo_amount[DEVISTATOR_WEAPON],max_ammo_amount[DEVISTATOR_WEAPON],
(!p->gotweapon[DEVISTATOR_WEAPON]*9)+12-18*
(cw == DEVISTATOR_WEAPON));
}
if (u&512)
{
if (u != -1) patchstatusbar(158,184,162+29,184+6); //original code: (166,184,166+8,184+6);
weaponnum(TRIPBOMB_WEAPON,x+70,y+6,
p->ammo_amount[TRIPBOMB_WEAPON],max_ammo_amount[TRIPBOMB_WEAPON],
(!p->gotweapon[TRIPBOMB_WEAPON]*9)+12-18*
(cw == TRIPBOMB_WEAPON));
p->ammo_amount[TRIPBOMB_WEAPON],max_ammo_amount[TRIPBOMB_WEAPON],
(!p->gotweapon[TRIPBOMB_WEAPON]*9)+12-18*
(cw == TRIPBOMB_WEAPON));
}
if (u&65536L)
@ -1722,9 +1722,9 @@ static void weapon_amounts(struct player_struct *p,long x,long y,long u)
if (u != -1) patchstatusbar(158,190,162+29,190+6); //original code: (166,190,166+8,190+6);
weaponnum(-1,x+70,y+12,
p->ammo_amount[FREEZE_WEAPON],max_ammo_amount[FREEZE_WEAPON],
(!p->gotweapon[FREEZE_WEAPON]*9)+12-18*
(cw == FREEZE_WEAPON));
p->ammo_amount[FREEZE_WEAPON],max_ammo_amount[FREEZE_WEAPON],
(!p->gotweapon[FREEZE_WEAPON]*9)+12-18*
(cw == FREEZE_WEAPON));
}
}
@ -7398,7 +7398,7 @@ FOUNDCHEAT:
levnume--;
if ((VOLUMEONE && volnume > 0) || volnume > num_volumes-1 ||
levnume >= MAXLEVELS || level_file_names[volnume*MAXLEVELS+levnume] == NULL)
levnume >= MAXLEVELS || level_file_names[volnume*MAXLEVELS+levnume] == NULL)
{
ps[myconnectindex].cheat_phase = 0;
KB_FlushKeyBoardQueue();
@ -9709,24 +9709,24 @@ void app_main(int argc,char **argv)
if (atol(tempbuf) > BUILDDATE)
{
if (wm_ynbox("EDuke32","A new version of EDuke32 is available. "
"Browse to http://eduke32.sourceforge.net now?"))
"Browse to http://eduke32.sourceforge.net now?"))
{
SHELLEXECUTEINFOA sinfo;
SHELLEXECUTEINFOA sinfo;
char *p = "http://eduke32.sourceforge.net";
Bmemset(&sinfo, 0, sizeof(sinfo));
sinfo.cbSize = sizeof(sinfo);
sinfo.fMask = SEE_MASK_CLASSNAME;
sinfo.lpVerb = "open";
sinfo.lpFile = p;
sinfo.nShow = SW_SHOWNORMAL;
sinfo.lpClass = "http";
Bmemset(&sinfo, 0, sizeof(sinfo));
sinfo.cbSize = sizeof(sinfo);
sinfo.fMask = SEE_MASK_CLASSNAME;
sinfo.lpVerb = "open";
sinfo.lpFile = p;
sinfo.nShow = SW_SHOWNORMAL;
sinfo.lpClass = "http";
if(!ShellExecuteExA(&sinfo))
initprintf("update: error launching browser!\n");
if (!ShellExecuteExA(&sinfo))
initprintf("update: error launching browser!\n");
CONFIG_SetupMouse();
CONFIG_SetupJoystick();
CONFIG_WriteSetup();
CONFIG_WriteSetup();
gameexit(" ");
}
}

File diff suppressed because it is too large Load diff

View file

@ -494,7 +494,7 @@ static void dispnames(void)
minitext(c,48+(12*x),ud.savegame[x],2,10+16);
}
void clearfilenames(void)
static void clearfilenames(void)
{
klistfree(finddirs);
klistfree(findfiles);
@ -1391,7 +1391,9 @@ void menus(void)
ready2send = 1;
totalclock = ototalclock;
}
} else {
}
else
{
cmenu(300);
probey = last_threehundred;
}

View file

@ -1538,15 +1538,15 @@ extern int gotvote[MAXPLAYERS], votes[MAXPLAYERS], voting, vote_map, vote_episod
static void getlevelfromfilename(const char *fn, char *volume, char *level)
{
for ((*volume)=0;(*volume)<MAXVOLUMES;(*volume)++)
for (*volume=0;*volume<MAXVOLUMES;(*volume)++)
{
for ((*level)=0;(*level)<MAXLEVELS;(*level)++)
for (*level=0;*level<MAXLEVELS;(*level)++)
{
if (level_file_names[((*volume)*MAXLEVELS)+(*level)] != NULL)
if (!Bstrcasecmp(fn, level_file_names[((*volume)*MAXLEVELS)+(*level)]))
if (level_file_names[(*volume*MAXLEVELS)+*level] != NULL)
if (!Bstrcasecmp(fn, level_file_names[(*volume*MAXLEVELS)+*level]))
break;
}
if ((*level) != MAXLEVELS)
if (*level != MAXLEVELS)
break;
}
}