Brightskins tweak, more whitespace

git-svn-id: https://svn.eduke32.com/eduke32@29 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-04-16 03:42:36 +00:00
parent e3d40c7b51
commit b11595ad2e
13 changed files with 589 additions and 593 deletions

View file

@ -107,11 +107,11 @@ void addammo( short weapon,struct player_struct *p,short amount)
void addweaponnoswitch( struct player_struct *p, short weapon) void addweaponnoswitch( struct player_struct *p, short weapon)
{ {
if ( p->gotweapon[weapon] == 0 ) if ( p->gotweapon[weapon] == 0 )
{ {
p->gotweapon[weapon] = 1; p->gotweapon[weapon] = 1;
if(weapon == SHRINKER_WEAPON) if(weapon == SHRINKER_WEAPON)
p->gotweapon[GROW_WEAPON] = 1; p->gotweapon[GROW_WEAPON] = 1;
} }
switch(weapon) switch(weapon)
{ {
@ -130,7 +130,7 @@ void addweapon( struct player_struct *p,short weapon)
short snum; short snum;
snum = sprite[p->i].yvel; snum = sprite[p->i].yvel;
addweaponnoswitch(p,weapon); addweaponnoswitch(p,weapon);
if (p->reloading) return; if (p->reloading) return;
@ -210,8 +210,8 @@ void checkavailweapon( struct player_struct *p )
weap = p->curr_weapon; weap = p->curr_weapon;
if( p->gotweapon[weap] && p->ammo_amount[weap] > 0 ) if( p->gotweapon[weap] && p->ammo_amount[weap] > 0 )
return; return;
if( p->gotweapon[weap] && !(p->weaponswitch & 2)) if( p->gotweapon[weap] && !(p->weaponswitch & 2))
return; return;
snum = sprite[p->i].yvel; snum = sprite[p->i].yvel;
@ -2515,24 +2515,24 @@ void moveweapons(void)
} }
} }
/* if(thisprojectile[i].workslike & 8192) /* if(thisprojectile[i].workslike & 8192)
{ {
for(k=-3;k<2;k++) for(k=-3;k<2;k++)
{ {
x = EGS(s->sectnum, x = EGS(s->sectnum,
s->x+((k*sintable[(s->ang+512)&2047])>>9), s->x+((k*sintable[(s->ang+512)&2047])>>9),
s->y+((k*sintable[s->ang&2047])>>9), s->y+((k*sintable[s->ang&2047])>>9),
s->z+((k*ksgn(s->zvel))*klabs(s->zvel/24)),s->picnum,-40+(k<<2), // FIRELASER s->z+((k*ksgn(s->zvel))*klabs(s->zvel/24)),s->picnum,-40+(k<<2), // FIRELASER
s->xrepeat,s->yrepeat,0,0,0,s->owner,5); s->xrepeat,s->yrepeat,0,0,0,s->owner,5);
sprite[x].cstat = 128; sprite[x].cstat = 128;
sprite[x].pal = s->pal; sprite[x].pal = s->pal;
} }
} }
else */ else */
if(thisprojectile[i].workslike & PROJECTILE_FLAG_SPIT) if(s->zvel < 6144) if(thisprojectile[i].workslike & PROJECTILE_FLAG_SPIT) if(s->zvel < 6144)
s->zvel += gc-112; s->zvel += gc-112;
if(thisprojectile[i].workslike & PROJECTILE_FLAG_WATERBUBBLES && sector[s->sectnum].lotag == 2 && rnd(140)) if(thisprojectile[i].workslike & PROJECTILE_FLAG_WATERBUBBLES && sector[s->sectnum].lotag == 2 && rnd(140))

View file

@ -1843,33 +1843,33 @@ void Keys3d(void)
{ {
case 0: case 0:
strcpy(tempbuf,"Wall picnum: "); strcpy(tempbuf,"Wall picnum: ");
i = getnumber256(tempbuf,wall[searchwall].picnum,MAXTILES-1,0); i = getnumber256(tempbuf,wall[searchwall].picnum,MAXTILES-1,0);
if(tilesizx[i] != 0) if(tilesizx[i] != 0)
wall[searchwall].picnum = i; wall[searchwall].picnum = i;
break; break;
case 1: case 1:
strcpy(tempbuf,"Sector ceiling picnum: "); strcpy(tempbuf,"Sector ceiling picnum: ");
i = getnumber256(tempbuf,sector[searchsector].ceilingpicnum,MAXTILES-1,0); i = getnumber256(tempbuf,sector[searchsector].ceilingpicnum,MAXTILES-1,0);
if(tilesizx[i] != 0) if(tilesizx[i] != 0)
sector[searchsector].ceilingpicnum = i; sector[searchsector].ceilingpicnum = i;
break; break;
case 2: case 2:
strcpy(tempbuf,"Sector floor picnum: "); strcpy(tempbuf,"Sector floor picnum: ");
i = getnumber256(tempbuf,sector[searchsector].floorpicnum,MAXTILES-1,0); i = getnumber256(tempbuf,sector[searchsector].floorpicnum,MAXTILES-1,0);
if(tilesizx[i] != 0) if(tilesizx[i] != 0)
sector[searchsector].floorpicnum = i; sector[searchsector].floorpicnum = i;
break; break;
case 3: case 3:
strcpy(tempbuf,"Sprite picnum: "); strcpy(tempbuf,"Sprite picnum: ");
i = getnumber256(tempbuf,sprite[searchwall].picnum,MAXTILES-1,0); i = getnumber256(tempbuf,sprite[searchwall].picnum,MAXTILES-1,0);
if(tilesizx[i] != 0) if(tilesizx[i] != 0)
sprite[searchwall].picnum = i; sprite[searchwall].picnum = i;
break; break;
case 4: case 4:
strcpy(tempbuf,"Masked wall picnum: "); strcpy(tempbuf,"Masked wall picnum: ");
i = getnumber256(tempbuf,wall[searchwall].overpicnum,MAXTILES-1,0); i = getnumber256(tempbuf,wall[searchwall].overpicnum,MAXTILES-1,0);
if(tilesizx[i] != 0) if(tilesizx[i] != 0)
wall[searchwall].overpicnum = i; wall[searchwall].overpicnum = i;
break; break;
} }
asksave = 1; asksave = 1;
@ -3355,12 +3355,12 @@ void Keys2d(void)
Bsprintf(tempbuf,"Delete all sprites of picnum: "); Bsprintf(tempbuf,"Delete all sprites of picnum: ");
i = getnumber16(tempbuf,-1,MAXSPRITES-1,1); i = getnumber16(tempbuf,-1,MAXSPRITES-1,1);
if (i >= 0) if (i >= 0)
{ {
for(j=0;j<MAXSPRITES-1;j++) for(j=0;j<MAXSPRITES-1;j++)
if(sprite[j].picnum == i) if(sprite[j].picnum == i)
deletesprite(j); deletesprite(j);
printmessage16("Sprites deleted."); printmessage16("Sprites deleted.");
} }
} }
getpoint(searchx,searchy,&mousxplc,&mousyplc); getpoint(searchx,searchy,&mousxplc,&mousyplc);
@ -3510,40 +3510,40 @@ void Keys2d(void)
{ {
if (pointhighlight >= 16384) if (pointhighlight >= 16384)
{ {
keystatus[0x1f] = 0; keystatus[0x1f] = 0;
Bsprintf(tempbuf,"Sprite (%d) xrepeat: ",cursprite); Bsprintf(tempbuf,"Sprite (%d) xrepeat: ",cursprite);
sprite[cursprite].xrepeat=getnumber16(tempbuf, sprite[cursprite].xrepeat, 256,0); sprite[cursprite].xrepeat=getnumber16(tempbuf, sprite[cursprite].xrepeat, 256,0);
Bsprintf(tempbuf,"Sprite (%d) yrepeat: ",cursprite); Bsprintf(tempbuf,"Sprite (%d) yrepeat: ",cursprite);
sprite[cursprite].yrepeat=getnumber16(tempbuf, sprite[cursprite].yrepeat, 256,0); sprite[cursprite].yrepeat=getnumber16(tempbuf, sprite[cursprite].yrepeat, 256,0);
Bsprintf(tempbuf,"Sprite (%d) updated",i); Bsprintf(tempbuf,"Sprite (%d) updated",i);
printmessage16(tempbuf); printmessage16(tempbuf);
} }
} }
if(keystatus[KEYSC_QUOTE] && keystatus[KEYSC_F]) // ' F if(keystatus[KEYSC_QUOTE] && keystatus[KEYSC_F]) // ' F
{ {
keystatus[KEYSC_F] = 0; keystatus[KEYSC_F] = 0;
j = 0; j = 0;
for(i=0;i<MAXSECTORS;i++) for(i=0;i<MAXSECTORS;i++)
{ {
if(tilesizx[sector[i].ceilingpicnum] <= 0) if(tilesizx[sector[i].ceilingpicnum] <= 0)
sector[i].ceilingpicnum = 0,j++; sector[i].ceilingpicnum = 0,j++;
if(tilesizx[sector[i].floorpicnum] <= 0) if(tilesizx[sector[i].floorpicnum] <= 0)
sector[i].floorpicnum = 0,j++; sector[i].floorpicnum = 0,j++;
} }
for(i=0;i<MAXWALLS;i++) for(i=0;i<MAXWALLS;i++)
{ {
if(tilesizx[wall[i].picnum] <= 0) if(tilesizx[wall[i].picnum] <= 0)
wall[i].picnum = 0,j++; wall[i].picnum = 0,j++;
if(tilesizx[wall[i].overpicnum] <= 0) if(tilesizx[wall[i].overpicnum] <= 0)
wall[i].overpicnum = 0,j++; wall[i].overpicnum = 0,j++;
} }
for(i=0;i<MAXSPRITES;i++) for(i=0;i<MAXSPRITES;i++)
{ {
if(tilesizx[sprite[i].picnum] <= 0) if(tilesizx[sprite[i].picnum] <= 0)
sprite[i].picnum = 0,j++; sprite[i].picnum = 0,j++;
} }
Bsprintf(tempbuf,"Replaced %d invalid tiles",j); Bsprintf(tempbuf,"Replaced %d invalid tiles",j);
printmessage16(tempbuf); printmessage16(tempbuf);
} }
@ -4275,7 +4275,7 @@ int ExtInit(void)
defsfilename = getenv("DUKE3DDEF"); defsfilename = getenv("DUKE3DDEF");
initprintf("Using %s as definitions file\n", defsfilename); initprintf("Using %s as definitions file\n", defsfilename);
} }
loadgroupfiles(defsfilename); loadgroupfiles(defsfilename);
bpp = 8; bpp = 8;
if (loadsetup("build.cfg") < 0) initprintf("Configuration file not found, using defaults.\n"), rv = 1; if (loadsetup("build.cfg") < 0) initprintf("Configuration file not found, using defaults.\n"), rv = 1;

View file

@ -229,7 +229,7 @@ void CONFIG_SetDefaults( void )
ud.m_ffire = 1; ud.m_ffire = 1;
ud.levelstats = 0; ud.levelstats = 0;
ud.drawweapon = 1; ud.drawweapon = 1;
ud.brightskins = 0; ud.brightskins = 0;
ShowOpponentWeapons = 0; ShowOpponentWeapons = 0;
Bstrcpy(ud.rtsname, "DUKE.RTS"); Bstrcpy(ud.rtsname, "DUKE.RTS");
Bstrcpy(myname, "Duke"); Bstrcpy(myname, "Duke");

View file

@ -502,31 +502,31 @@ void getpackets(void)
if (enterlevel(MODE_GAME)) backtomenu(); if (enterlevel(MODE_GAME)) backtomenu();
break; break;
case 6: case 6:
//slaves in M/S mode only send to master //slaves in M/S mode only send to master
//Master re-transmits message to all others //Master re-transmits message to all others
if ((!networkmode) && (myconnectindex == connecthead)) if ((!networkmode) && (myconnectindex == connecthead))
for(i=connectpoint2[connecthead];i>=0;i=connectpoint2[i]) for(i=connectpoint2[connecthead];i>=0;i=connectpoint2[i])
if (i != other) sendpacket(i,packbuf,packbufleng); if (i != other) sendpacket(i,packbuf,packbufleng);
if (packbuf[2] != BYTEVERSION) if (packbuf[2] != BYTEVERSION)
gameexit("\nYou cannot play Duke with different versions."); gameexit("\nYou cannot play Duke with different versions.");
other = packbuf[1]; other = packbuf[1];
for (i=3;packbuf[i];i++) for (i=3;packbuf[i];i++)
ud.user_name[other][i-3] = packbuf[i]; ud.user_name[other][i-3] = packbuf[i];
ud.user_name[other][i-3] = 0; ud.user_name[other][i-3] = 0;
i++; i++;
j = i; //This used to be Duke packet #9... now concatenated with Duke packet #6 j = i; //This used to be Duke packet #9... now concatenated with Duke packet #6
for (;i-j<10;i++) ud.wchoice[other][i-j] = packbuf[i]; for (;i-j<10;i++) ud.wchoice[other][i-j] = packbuf[i];
ps[other].aim_mode = packbuf[i++]; ps[other].aim_mode = packbuf[i++];
ps[other].auto_aim = packbuf[i++]; ps[other].auto_aim = packbuf[i++];
ps[other].weaponswitch = packbuf[i++]; ps[other].weaponswitch = packbuf[i++];
break; break;
case 7: case 7:
//slaves in M/S mode only send to master //slaves in M/S mode only send to master
//Master re-transmits message to all others //Master re-transmits message to all others
@ -1870,7 +1870,7 @@ void tics(void)
i = totalclock; i = totalclock;
if (i != frameval[framecnt]) if (i != frameval[framecnt])
{ {
j=(TICRATE*AVERAGEFRAMES)/(i-frameval[framecnt]); j=(TICRATE*AVERAGEFRAMES)/(i-frameval[framecnt]);
Bsprintf(b,"%ld",j>0?j:0); Bsprintf(b,"%ld",j>0?j:0);
/* printext256(windowx1,windowy1,31,-21,b,1); */ /* printext256(windowx1,windowy1,31,-21,b,1); */
minitext(320-strlen(b)*4,ud.multimode>1&&ud.multimode<5?9:ud.multimode>4?17:1,b,(TICRATE*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?2:0,26); minitext(320-strlen(b)*4,ud.multimode>1&&ud.multimode<5?9:ud.multimode>4?17:1,b,(TICRATE*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?2:0,26);
@ -2525,24 +2525,24 @@ void palto(char r,char g,char b,long e)
int i; int i;
char temparray[768]; char temparray[768];
long tc; long tc;
/* /*
for(i=0;i<768;i+=3) for(i=0;i<768;i+=3)
{ {
temparray[i ] = temparray[i ] =
ps[myconnectindex].palette[i+0]+((((long)r-(long)ps[myconnectindex].palette[i+0])*(long)(e&127))>>6); ps[myconnectindex].palette[i+0]+((((long)r-(long)ps[myconnectindex].palette[i+0])*(long)(e&127))>>6);
temparray[i+1] = temparray[i+1] =
ps[myconnectindex].palette[i+1]+((((long)g-(long)ps[myconnectindex].palette[i+1])*(long)(e&127))>>6); ps[myconnectindex].palette[i+1]+((((long)g-(long)ps[myconnectindex].palette[i+1])*(long)(e&127))>>6);
temparray[i+2] = temparray[i+2] =
ps[myconnectindex].palette[i+2]+((((long)b-(long)ps[myconnectindex].palette[i+2])*(long)(e&127))>>6); ps[myconnectindex].palette[i+2]+((((long)b-(long)ps[myconnectindex].palette[i+2])*(long)(e&127))>>6);
} }
*/ */
//setbrightness(ud.brightness>>2,temparray); //setbrightness(ud.brightness>>2,temparray);
setpalettefade(r,g,b,e&127); setpalettefade(r,g,b,e&127);
if (getrendermode() >= 3) pus = pub = NUMPAGES; // JBF 20040110: redraw the status bar next time if (getrendermode() >= 3) pus = pub = NUMPAGES; // JBF 20040110: redraw the status bar next time
if ((e&128) == 0) { if ((e&128) == 0) {
nextpage(); nextpage();
for (tc = totalclock; totalclock < tc + 4; handleevents(), getpackets() ); for (tc = totalclock; totalclock < tc + 4; handleevents(), getpackets() );
} }
} }
@ -3461,7 +3461,7 @@ short EGS(short whatsect,long s_x,long s_y,long s_z,short s_pn,signed char s_s,s
T1=T3=T4=T6=T7=T8=T9=0; T1=T3=T4=T6=T7=T8=T9=0;
actorspriteflags[i] = 0; actorspriteflags[i] = 0;
if( actorscrptr[s_pn] ) if( actorscrptr[s_pn] )
{ {
@ -3591,7 +3591,7 @@ short spawn( short j, short pn )
T1 = T2 = T3 = T4 = T5 = T6 = T7 = T8 = T9 = 0; T1 = T2 = T3 = T4 = T5 = T6 = T7 = T8 = T9 = 0;
actorspriteflags[i] = 0; actorspriteflags[i] = 0;
if( PN != SPEAKER && PN != LETTER && PN != DUCK && PN != TARGET && PN != TRIPBOMB && PN != VIEWSCREEN && PN != VIEWSCREEN2 && (CS&48) ) if( PN != SPEAKER && PN != LETTER && PN != DUCK && PN != TARGET && PN != TRIPBOMB && PN != VIEWSCREEN && PN != VIEWSCREEN2 && (CS&48) )
if( !(PN >= CRACK1 && PN <= CRACK4) ) if( !(PN >= CRACK1 && PN <= CRACK4) )
@ -5470,15 +5470,15 @@ void animatesprites(long x,long y,short a,long smoothratio)
if (checkspriteflags(i,SPRITE_FLAG_NOSHADE)) if (checkspriteflags(i,SPRITE_FLAG_NOSHADE))
l = sprite[j].shade; l = sprite[j].shade;
else else
{ {
if (sector[t->sectnum].ceilingstat&1) if (sector[t->sectnum].ceilingstat&1)
l = sector[t->sectnum].ceilingshade; l = sector[t->sectnum].ceilingshade;
else else
l = sector[t->sectnum].floorshade; l = sector[t->sectnum].floorshade;
if(l < -127) l = -127; if(l < -127) l = -127;
if(l > 128) l = 127; if(l > 128) l = 127;
} }
t->shade = l; t->shade = l;
} }
@ -5847,14 +5847,14 @@ PALONLY:
if( sector[sect].floorpal && sector[sect].floorpal < numl) if( sector[sect].floorpal && sector[sect].floorpal < numl)
t->pal = sector[sect].floorpal; t->pal = sector[sect].floorpal;
if(ud.brightskins)
t->shade = -32; // yes? no?
if(s->owner == -1) continue; if(s->owner == -1) continue;
if( t->z > hittype[i].floorz && t->xrepeat < 32 ) if( t->z > hittype[i].floorz && t->xrepeat < 32 )
t->z = hittype[i].floorz; t->z = hittype[i].floorz;
if(ud.brightskins)
t->shade -= 15;
break; break;
case JIBS1__STATIC: case JIBS1__STATIC:
@ -5883,9 +5883,6 @@ PALONLY:
case SCRAP3__STATIC: case SCRAP3__STATIC:
case SCRAP4__STATIC: case SCRAP4__STATIC:
case SCRAP5__STATIC: case SCRAP5__STATIC:
if(hittype[i].picnum == BLIMP && t->picnum == SCRAP1 && s->yvel >= 0) if(hittype[i].picnum == BLIMP && t->picnum == SCRAP1 && s->yvel >= 0)
t->picnum = s->yvel; t->picnum = s->yvel;
else t->picnum += T1; else t->picnum += T1;
@ -5902,7 +5899,6 @@ PALONLY:
break; break;
} }
default: default:
if( sector[sect].floorpal && sector[sect].floorpal < numl ) if( sector[sect].floorpal && sector[sect].floorpal < numl )
t->pal = sector[sect].floorpal; t->pal = sector[sect].floorpal;
break; break;
@ -6938,12 +6934,12 @@ void nonsharedkeys(void)
{ {
if(i == 5 && ps[myconnectindex].fta > 0 && ps[myconnectindex].ftq == 26) if(i == 5 && ps[myconnectindex].fta > 0 && ps[myconnectindex].ftq == 26)
{ {
i = (VOLUMEALL?num_volumes*11:6); i = (VOLUMEALL?num_volumes*11:6);
music_select++; music_select++;
while(!music_fn[0][music_select][0] && music_select < i) while(!music_fn[0][music_select][0] && music_select < i)
music_select++; music_select++;
if(music_select == i) if(music_select == i)
music_select = 0; music_select = 0;
Bstrcpy(&fta_quotes[26][0],"PLAYING "); Bstrcpy(&fta_quotes[26][0],"PLAYING ");
Bstrcat(&fta_quotes[26][0],&music_fn[0][music_select][0]); Bstrcat(&fta_quotes[26][0],&music_fn[0][music_select][0]);
FTA(26,&ps[myconnectindex]); FTA(26,&ps[myconnectindex]);
@ -7137,9 +7133,9 @@ FAKE_F3:
screencapt = 0; screencapt = 0;
if( lastsavedpos >= 0 ) if( lastsavedpos >= 0 )
{ {
/* inputloc = strlen(&ud.savegame[lastsavedpos][0]); /* inputloc = strlen(&ud.savegame[lastsavedpos][0]);
current_menu = 360+lastsavedpos; current_menu = 360+lastsavedpos;
probey = lastsavedpos; */ probey = lastsavedpos; */
if(ud.multimode > 1) if(ud.multimode > 1)
saveplayer(-1-(lastsavedpos)); saveplayer(-1-(lastsavedpos));
else saveplayer(lastsavedpos); else saveplayer(lastsavedpos);
@ -7193,23 +7189,23 @@ FAKE_F3:
if(lastsavedpos == -1) goto FAKE_F3; if(lastsavedpos == -1) goto FAKE_F3;
if( lastsavedpos >= 0 ) if( lastsavedpos >= 0 )
{ {
KB_FlushKeyboardQueue(); KB_FlushKeyboardQueue();
KB_ClearKeysDown(); KB_ClearKeysDown();
FX_StopAllSounds(); FX_StopAllSounds();
if(ud.multimode > 1) if(ud.multimode > 1)
{ {
loadplayer(-1-lastsavedpos); loadplayer(-1-lastsavedpos);
ps[myconnectindex].gm = MODE_GAME; ps[myconnectindex].gm = MODE_GAME;
} }
else else
{ {
i = loadplayer(lastsavedpos); i = loadplayer(lastsavedpos);
if(i == 0) if(i == 0)
ps[myconnectindex].gm = MODE_GAME; ps[myconnectindex].gm = MODE_GAME;
} }
} }
} }
if(KB_KeyPressed( sc_F10 )) if(KB_KeyPressed( sc_F10 ))
@ -8284,10 +8280,10 @@ void app_main(int argc,char **argv)
checkcommandline(argc,argv); checkcommandline(argc,argv);
if (VOLUMEALL) if (VOLUMEALL)
loadgroupfiles(duke3ddef); loadgroupfiles(duke3ddef);
initprintf("\n"); initprintf("\n");
if (condebug) if (condebug)
initprintf("CON debugging activated (%d).\n\n",condebug); initprintf("CON debugging activated (%d).\n\n",condebug);
@ -8350,22 +8346,22 @@ void app_main(int argc,char **argv)
if( setgamemode(ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP) < 0 ) if( setgamemode(ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP) < 0 )
{ {
int i = 0; int i = 0;
int xres[] = {800,640,320}; int xres[] = {800,640,320};
int yres[] = {600,480,240}; int yres[] = {600,480,240};
int bpp[] = {32,16,8}; int bpp[] = {32,16,8};
initprintf("Failure setting video mode %dx%dx%d %s! Attempting safer mode...", initprintf("Failure setting video mode %dx%dx%d %s! Attempting safer mode...",
ScreenWidth,ScreenHeight,ScreenBPP,ScreenMode?"fullscreen":"windowed"); ScreenWidth,ScreenHeight,ScreenBPP,ScreenMode?"fullscreen":"windowed");
/* ScreenMode = 0; // JBF: was 2 /* ScreenMode = 0; // JBF: was 2
ScreenWidth = 800; ScreenWidth = 800;
ScreenHeight = 600; // JBF: was 200 ScreenHeight = 600; // JBF: was 200
ScreenBPP = 32; */ ScreenBPP = 32; */
while(setgamemode(0,xres[i],yres[i],bpp[i]) < 0) { while(setgamemode(0,xres[i],yres[i],bpp[i]) < 0) {
i++; i++;
} }
ScreenWidth = xres[i]; ScreenWidth = xres[i];
ScreenHeight = yres[i]; ScreenHeight = yres[i];
ScreenBPP = bpp[i]; ScreenBPP = bpp[i];
} }
initprintf("Initializing OSD...\n"); initprintf("Initializing OSD...\n");
@ -8833,8 +8829,8 @@ RECHECK:
} }
else else
{ {
if(ud.recstat != 2) if(ud.recstat != 2)
menus(); menus();
if( ud.multimode > 1 ) if( ud.multimode > 1 )
{ {
ControlInfo noshareinfo; ControlInfo noshareinfo;
@ -9840,23 +9836,23 @@ void dobonus(char bonusonly)
playanm("RADLOGO.ANM",3); playanm("RADLOGO.ANM",3);
if( ud.lockout == 0 && !KB_KeyWaiting() ) if( ud.lockout == 0 && !KB_KeyWaiting() )
{ {
sound(ENDSEQVOL3SND5); sound(ENDSEQVOL3SND5);
while(issoundplaying(ENDSEQVOL3SND5)) { handleevents(); getpackets(); } while(issoundplaying(ENDSEQVOL3SND5)) { handleevents(); getpackets(); }
if(KB_KeyWaiting()) goto ENDANM; if(KB_KeyWaiting()) goto ENDANM;
sound(ENDSEQVOL3SND6); sound(ENDSEQVOL3SND6);
while(issoundplaying(ENDSEQVOL3SND6)) { handleevents(); getpackets(); } while(issoundplaying(ENDSEQVOL3SND6)) { handleevents(); getpackets(); }
if(KB_KeyWaiting()) goto ENDANM; if(KB_KeyWaiting()) goto ENDANM;
sound(ENDSEQVOL3SND7); sound(ENDSEQVOL3SND7);
while(issoundplaying(ENDSEQVOL3SND7)) { handleevents(); getpackets(); } while(issoundplaying(ENDSEQVOL3SND7)) { handleevents(); getpackets(); }
if(KB_KeyWaiting()) goto ENDANM; if(KB_KeyWaiting()) goto ENDANM;
sound(ENDSEQVOL3SND8); sound(ENDSEQVOL3SND8);
while(issoundplaying(ENDSEQVOL3SND8)) { handleevents(); getpackets(); } while(issoundplaying(ENDSEQVOL3SND8)) { handleevents(); getpackets(); }
if(KB_KeyWaiting()) goto ENDANM; if(KB_KeyWaiting()) goto ENDANM;
sound(ENDSEQVOL3SND9); sound(ENDSEQVOL3SND9);
while(issoundplaying(ENDSEQVOL3SND9)) { handleevents(); getpackets(); } while(issoundplaying(ENDSEQVOL3SND9)) { handleevents(); getpackets(); }
} }
KB_FlushKeyBoardQueue(); KB_FlushKeyBoardQueue();
totalclock = 0; totalclock = 0;

View file

@ -433,7 +433,7 @@ char *keyw[] = {
"dynamicremap", // 285 "dynamicremap", // 285
"setinput", // 286 "setinput", // 286
"getinput", // 287 "getinput", // 287
"save", // 288 "save", // 288
"<null>" "<null>"
}; };
@ -802,14 +802,14 @@ LABELS userdefslabels[]= {
}; };
LABELS inputlabels[]= { LABELS inputlabels[]= {
{ "avel", INPUT_AVEL, 0, 0 }, { "avel", INPUT_AVEL, 0, 0 },
{ "horz", INPUT_HORZ, 0, 0 }, { "horz", INPUT_HORZ, 0, 0 },
{ "fvel", INPUT_FVEL, 0, 0 }, { "fvel", INPUT_FVEL, 0, 0 },
{ "svel", INPUT_SVEL, 0, 0 }, { "svel", INPUT_SVEL, 0, 0 },
{ "bits", INPUT_BITS, 0, 0 }, { "bits", INPUT_BITS, 0, 0 },
{ "bits2", INPUT_BITS2, 0, 0 }, { "bits2", INPUT_BITS2, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST { "", -1, 0, 0 } // END OF LIST
}; };
void skipcomments(void) void skipcomments(void)
{ {
@ -3151,10 +3151,10 @@ char parsecommand(void)
break; break;
} }
case CON_SETINPUT: case CON_SETINPUT:
if(!CheckEventSync(current_event)) if(!CheckEventSync(current_event))
ReportError(WARNING_EVENTSYNC); ReportError(WARNING_EVENTSYNC);
case CON_GETINPUT: case CON_GETINPUT:
{ {
long lLabelID; long lLabelID;
@ -3463,7 +3463,7 @@ char parsecommand(void)
case CON_OPERATEMASTERSWITCHES: case CON_OPERATEMASTERSWITCHES:
case CON_CHECKACTIVATORMOTION: case CON_CHECKACTIVATORMOTION:
case CON_TIME: case CON_TIME:
case CON_INITTIMER: case CON_INITTIMER:
case CON_LOCKPLAYER: case CON_LOCKPLAYER:
case CON_SHOOTVAR: case CON_SHOOTVAR:
if(!CheckEventSync(current_event)) if(!CheckEventSync(current_event))
@ -3588,15 +3588,15 @@ char parsecommand(void)
switch(tw) switch(tw)
{ {
case CON_DIST: case CON_DIST:
case CON_LDIST: case CON_LDIST:
case CON_TXDIST: case CON_TXDIST:
case CON_GETANGLE: case CON_GETANGLE:
transvartype(GAMEVAR_FLAG_READONLY); transvartype(GAMEVAR_FLAG_READONLY);
break; break;
case CON_MULSCALE: case CON_MULSCALE:
transmultvars(2); transmultvars(2);
break; break;
} }
return 0; return 0;
@ -5899,59 +5899,59 @@ void ReportError(int iError)
} }
switch(iError) switch(iError)
{ {
case ERROR_CLOSEBRACKET: case ERROR_CLOSEBRACKET:
initprintf("%s:%ld: error: found more `}' than `{' before `%s'.\n",compilefile,line_number,tempbuf); initprintf("%s:%ld: error: found more `}' than `{' before `%s'.\n",compilefile,line_number,tempbuf);
break; break;
case ERROR_EVENTONLY: case ERROR_EVENTONLY:
initprintf("%s:%ld: error: command `%s' only valid during events.\n",compilefile,line_number,tempbuf); initprintf("%s:%ld: error: command `%s' only valid during events.\n",compilefile,line_number,tempbuf);
break; break;
case ERROR_EXCEEDSMAXTILES: case ERROR_EXCEEDSMAXTILES:
initprintf("%s:%ld: error: `%s' value exceeds MAXTILES. Maximum is %d.\n",compilefile,line_number,tempbuf,MAXTILES-1); initprintf("%s:%ld: error: `%s' value exceeds MAXTILES. Maximum is %d.\n",compilefile,line_number,tempbuf,MAXTILES-1);
break; break;
case ERROR_EXPECTEDKEYWORD: case ERROR_EXPECTEDKEYWORD:
initprintf("%s:%ld: error: expected a keyword but found `%s'.\n",compilefile,line_number,tempbuf); initprintf("%s:%ld: error: expected a keyword but found `%s'.\n",compilefile,line_number,tempbuf);
break; break;
case ERROR_FOUNDWITHIN: case ERROR_FOUNDWITHIN:
initprintf("%s:%ld: error: found `%s' within %s.\n",compilefile,line_number,tempbuf,parsing_event?"an event":parsing_actor?"an actor":"a state"); initprintf("%s:%ld: error: found `%s' within %s.\n",compilefile,line_number,tempbuf,parsing_event?"an event":parsing_actor?"an actor":"a state");
break; break;
case ERROR_ISAKEYWORD: case ERROR_ISAKEYWORD:
initprintf("%s:%ld: error: symbol `%s' is a keyword.\n",compilefile,line_number,label+(labelcnt<<6)); initprintf("%s:%ld: error: symbol `%s' is a keyword.\n",compilefile,line_number,label+(labelcnt<<6));
break; break;
case ERROR_NOENDSWITCH: case ERROR_NOENDSWITCH:
initprintf("%s:%ld: error: did not find `endswitch' before `%s'.\n",compilefile,line_number,label+(labelcnt<<6)); initprintf("%s:%ld: error: did not find `endswitch' before `%s'.\n",compilefile,line_number,label+(labelcnt<<6));
break; break;
case ERROR_NOTAGAMEDEF: case ERROR_NOTAGAMEDEF:
initprintf("%s:%ld: error: symbol `%s' is not a game definition.\n",compilefile,line_number,label+(labelcnt<<6)); initprintf("%s:%ld: error: symbol `%s' is not a game definition.\n",compilefile,line_number,label+(labelcnt<<6));
break; break;
case ERROR_NOTAGAMEVAR: case ERROR_NOTAGAMEVAR:
initprintf("%s:%ld: error: symbol `%s' is not a game variable.\n",compilefile,line_number,label+(labelcnt<<6)); initprintf("%s:%ld: error: symbol `%s' is not a game variable.\n",compilefile,line_number,label+(labelcnt<<6));
break; break;
case ERROR_OPENBRACKET: case ERROR_OPENBRACKET:
initprintf("%s:%ld: error: found more `{' than `}' before `%s'.\n",compilefile,line_number,tempbuf); initprintf("%s:%ld: error: found more `{' than `}' before `%s'.\n",compilefile,line_number,tempbuf);
break; break;
case ERROR_PARAMUNDEFINED: case ERROR_PARAMUNDEFINED:
initprintf("%s:%ld: error: parameter `%s' is undefined.\n",compilefile,line_number,tempbuf); initprintf("%s:%ld: error: parameter `%s' is undefined.\n",compilefile,line_number,tempbuf);
break; break;
case ERROR_SYMBOLNOTRECOGNIZED: case ERROR_SYMBOLNOTRECOGNIZED:
initprintf("%s:%ld: error: symbol `%s' is not recognized.\n",compilefile,line_number,label+(labelcnt<<6)); initprintf("%s:%ld: error: symbol `%s' is not recognized.\n",compilefile,line_number,label+(labelcnt<<6));
break; break;
case ERROR_SYNTAXERROR: case ERROR_SYNTAXERROR:
initprintf("%s:%ld: error: syntax error.\n",compilefile,line_number); initprintf("%s:%ld: error: syntax error.\n",compilefile,line_number);
break; break;
case ERROR_VARREADONLY: case ERROR_VARREADONLY:
initprintf("%s:%ld: error: variable `%s' is read-only.\n",compilefile,line_number,label+(labelcnt<<6)); initprintf("%s:%ld: error: variable `%s' is read-only.\n",compilefile,line_number,label+(labelcnt<<6));
break; break;
case ERROR_VARTYPEMISMATCH: case ERROR_VARTYPEMISMATCH:
initprintf("%s:%ld: error: variable `%s' is of the wrong type.\n",compilefile,line_number,label+(labelcnt<<6)); initprintf("%s:%ld: error: variable `%s' is of the wrong type.\n",compilefile,line_number,label+(labelcnt<<6));
break; break;
case WARNING_DUPLICATEDEFINITION: case WARNING_DUPLICATEDEFINITION:
initprintf("%s:%ld: warning: duplicate game definition `%s' ignored.\n",compilefile,line_number,label+(labelcnt<<6)); initprintf("%s:%ld: warning: duplicate game definition `%s' ignored.\n",compilefile,line_number,label+(labelcnt<<6));
break; break;
case WARNING_EVENTSYNC: case WARNING_EVENTSYNC:
initprintf("%s:%ld: warning: found `%s' within a local event.\n",compilefile,line_number,tempbuf); initprintf("%s:%ld: warning: found `%s' within a local event.\n",compilefile,line_number,tempbuf);
break; break;
case WARNING_LABELSONLY: case WARNING_LABELSONLY:
initprintf("%s:%ld: warning: expected a label, found a constant.\n",compilefile,line_number); initprintf("%s:%ld: warning: expected a label, found a constant.\n",compilefile,line_number);
break; break;
} }
} }

View file

@ -1876,44 +1876,44 @@ void DoInput(char bSet, long lVar1, long lLabelID, long lVar2, short sActor, sho
switch(lLabelID) switch(lLabelID)
{ {
case INPUT_AVEL: case INPUT_AVEL:
if(bSet) if(bSet)
sync[iPlayer].avel=lValue; sync[iPlayer].avel=lValue;
else else
SetGameVarID((int)lVar2, sync[iPlayer].avel, sActor, sPlayer); SetGameVarID((int)lVar2, sync[iPlayer].avel, sActor, sPlayer);
break; break;
case INPUT_HORZ: case INPUT_HORZ:
if(bSet) if(bSet)
sync[iPlayer].horz=lValue; sync[iPlayer].horz=lValue;
else else
SetGameVarID((int)lVar2, sync[iPlayer].horz, sActor, sPlayer); SetGameVarID((int)lVar2, sync[iPlayer].horz, sActor, sPlayer);
break; break;
case INPUT_FVEL: case INPUT_FVEL:
if(bSet) if(bSet)
sync[iPlayer].fvel=lValue; sync[iPlayer].fvel=lValue;
else else
SetGameVarID((int)lVar2, sync[iPlayer].fvel, sActor, sPlayer); SetGameVarID((int)lVar2, sync[iPlayer].fvel, sActor, sPlayer);
break; break;
case INPUT_SVEL: case INPUT_SVEL:
if(bSet) if(bSet)
sync[iPlayer].svel=lValue; sync[iPlayer].svel=lValue;
else else
SetGameVarID((int)lVar2, sync[iPlayer].svel, sActor, sPlayer); SetGameVarID((int)lVar2, sync[iPlayer].svel, sActor, sPlayer);
break; break;
case INPUT_BITS: case INPUT_BITS:
if(bSet) if(bSet)
sync[iPlayer].bits=lValue; sync[iPlayer].bits=lValue;
else else
SetGameVarID((int)lVar2, sync[iPlayer].bits, sActor, sPlayer); SetGameVarID((int)lVar2, sync[iPlayer].bits, sActor, sPlayer);
break; break;
case INPUT_BITS2: case INPUT_BITS2:
if(bSet) if(bSet)
sync[iPlayer].bits2=lValue; sync[iPlayer].bits2=lValue;
else else
SetGameVarID((int)lVar2, sync[iPlayer].bits2, sActor, sPlayer); SetGameVarID((int)lVar2, sync[iPlayer].bits2, sActor, sPlayer);
break; break;
default: default:
break; break;
} }
return; return;
} }
@ -4403,14 +4403,14 @@ SKIPJIBS:
switch(tw) switch(tw)
{ {
case CON_SOUNDONCEVAR: case CON_SOUNDONCEVAR:
if(!isspritemakingsound(g_i,sound)) if(!isspritemakingsound(g_i,sound))
spritesound((short)sound,g_i); spritesound((short)sound,g_i);
break; break;
case CON_GLOBALSOUNDVAR: case CON_GLOBALSOUNDVAR:
spritesound((short)sound,ps[screenpeek].i); spritesound((short)sound,ps[screenpeek].i);
break; break;
case CON_STOPSOUNDVAR: case CON_STOPSOUNDVAR:
if(isspritemakingsound(g_i,sound)) if(isspritemakingsound(g_i,sound))
stopspritesound((short)sound,g_i); stopspritesound((short)sound,g_i);
break; break;
case CON_SOUNDVAR: case CON_SOUNDVAR:
@ -4774,37 +4774,37 @@ SKIPJIBS:
g_sp->cstat = (short) *insptr++; g_sp->cstat = (short) *insptr++;
break; break;
case CON_SAVE: case CON_SAVE:
{ {
int i; int i;
time_t curtime; time_t curtime;
insptr++;
i = *insptr++;
if(movesperpacket == 4 && connecthead != myconnectindex)
break;
lastsavedpos = i;
curtime = time(NULL);
Bstrcpy(tempbuf,asctime(localtime(&curtime)));
clearbuf(ud.savegame[lastsavedpos],sizeof(ud.savegame[lastsavedpos]),0);
Bsprintf(ud.savegame[lastsavedpos],"Auto");
for(i=0;i<13;i++)
Bmemcpy(&ud.savegame[lastsavedpos][i+4],&tempbuf[i+3],sizeof(tempbuf[i+3]));
ud.savegame[lastsavedpos][i+4] = '\0';
OSD_Printf("Saving to slot %d\n",lastsavedpos);
KB_FlushKeyboardQueue();
screencapt = 1;
displayrooms(myconnectindex,65536);
//savetemp("duke3d.tmp",waloff[TILE_SAVESHOT],160*100);
screencapt = 0;
if(ud.multimode > 1)
saveplayer(-1-(lastsavedpos));
else saveplayer(lastsavedpos);
insptr++;
i = *insptr++;
if(movesperpacket == 4 && connecthead != myconnectindex)
break; break;
}
lastsavedpos = i;
curtime = time(NULL);
Bstrcpy(tempbuf,asctime(localtime(&curtime)));
clearbuf(ud.savegame[lastsavedpos],sizeof(ud.savegame[lastsavedpos]),0);
Bsprintf(ud.savegame[lastsavedpos],"Auto");
for(i=0;i<13;i++)
Bmemcpy(&ud.savegame[lastsavedpos][i+4],&tempbuf[i+3],sizeof(tempbuf[i+3]));
ud.savegame[lastsavedpos][i+4] = '\0';
OSD_Printf("Saving to slot %d\n",lastsavedpos);
KB_FlushKeyboardQueue();
screencapt = 1;
displayrooms(myconnectindex,65536);
//savetemp("duke3d.tmp",waloff[TILE_SAVESHOT],160*100);
screencapt = 0;
if(ud.multimode > 1)
saveplayer(-1-(lastsavedpos));
else saveplayer(lastsavedpos);
break;
}
case CON_IFMOVE: case CON_IFMOVE:
insptr++; insptr++;
parseifelse(g_t[1] == *insptr); parseifelse(g_t[1] == *insptr);
@ -5522,8 +5522,8 @@ good:
break; break;
} }
case CON_SETINPUT: case CON_SETINPUT:
case CON_GETINPUT: case CON_GETINPUT:
{ {
// syntax [gs]etplayer[<var>].x <VAR> // syntax [gs]etplayer[<var>].x <VAR>
// <varid> <xxxid> <varid> // <varid> <xxxid> <varid>

View file

@ -2491,7 +2491,7 @@ cheat_for_port_credits:
gltexapplyprops(); gltexapplyprops();
break; break;
case 7: case 7:
if (bpp==8) break; if (bpp==8) break;
cmenu(230); cmenu(230);
break; break;
#endif #endif
@ -3331,7 +3331,7 @@ cheat_for_port_credits:
break; break;
case 4: case 4:
if(SoundToggle && (FXDevice >= 0)) { VoiceToggle = (VoiceToggle == 2) ? 0 : VoiceToggle+1; } if(SoundToggle && (FXDevice >= 0)) { VoiceToggle = (VoiceToggle == 2) ? 0 : VoiceToggle+1; }
onbar = 0; onbar = 0;
break; break;
case 5: case 5:
@ -3389,7 +3389,7 @@ cheat_for_port_credits:
menutext(c,50+16+16+16+16+16+16,SHX(-8),(FXDevice<0)||SoundToggle==0,"FLIP STEREO"); menutext(c,50+16+16+16+16+16+16,SHX(-8),(FXDevice<0)||SoundToggle==0,"FLIP STEREO");
{ char *s[] = { "OFF", "LOCAL", "ALL" }; { char *s[] = { "OFF", "LOCAL", "ALL" };
menutext(c+160+40,50+16+16+16+16,0,(FXDevice<0)||SoundToggle==0,s[VoiceToggle]); } menutext(c+160+40,50+16+16+16+16,0,(FXDevice<0)||SoundToggle==0,s[VoiceToggle]); }
if(AmbienceToggle) menutext(c+160+40,50+16+16+16+16+16,0,(FXDevice<0)||SoundToggle==0,"ON"); if(AmbienceToggle) menutext(c+160+40,50+16+16+16+16+16,0,(FXDevice<0)||SoundToggle==0,"ON");
else menutext(c+160+40,50+16+16+16+16+16,0,(FXDevice<0)||SoundToggle==0,"OFF"); else menutext(c+160+40,50+16+16+16+16+16,0,(FXDevice<0)||SoundToggle==0,"OFF");

View file

@ -382,7 +382,7 @@ int osdcmd_setvar(const osdfuncparm_t *parm)
SetGameVarID(i, varval, ps[myconnectindex].i, myconnectindex); SetGameVarID(i, varval, ps[myconnectindex].i, myconnectindex);
} }
return OSDCMD_OK; return OSDCMD_OK;
} }
int osdcmd_addpath(const osdfuncparm_t *parm) int osdcmd_addpath(const osdfuncparm_t *parm)
{ {

View file

@ -2113,29 +2113,29 @@ char animateaccess(short gs,short snum)
void myospalw(long x, long y, short tilenum, signed char shade, char orientation, char p) void myospalw(long x, long y, short tilenum, signed char shade, char orientation, char p)
{ {
if(!ud.drawweapon) if(!ud.drawweapon)
return; return;
else if(ud.drawweapon == 1) else if(ud.drawweapon == 1)
myospal(x,y,tilenum,shade,orientation,p); myospal(x,y,tilenum,shade,orientation,p);
else if(ud.drawweapon == 2) else if(ud.drawweapon == 2)
{ {
switch(g_currentweapon) switch(g_currentweapon)
{ {
case PISTOL_WEAPON: case PISTOL_WEAPON:
case CHAINGUN_WEAPON: case CHAINGUN_WEAPON:
case RPG_WEAPON: case RPG_WEAPON:
case FREEZE_WEAPON: case FREEZE_WEAPON:
case SHRINKER_WEAPON: case SHRINKER_WEAPON:
case GROW_WEAPON: case GROW_WEAPON:
case DEVISTATOR_WEAPON: case DEVISTATOR_WEAPON:
case TRIPBOMB_WEAPON: case TRIPBOMB_WEAPON:
case HANDREMOTE_WEAPON: case HANDREMOTE_WEAPON:
case HANDBOMB_WEAPON: case HANDBOMB_WEAPON:
case SHOTGUN_WEAPON: case SHOTGUN_WEAPON:
rotatesprite(160<<16,(180+(ps[screenpeek].weapon_pos*ps[screenpeek].weapon_pos))<<16,scale(65536,ud.statusbarscale,100),0,weapon_sprites[g_currentweapon],0,0,2,windowx1,windowy1,windowx2,windowy2); rotatesprite(160<<16,(180+(ps[screenpeek].weapon_pos*ps[screenpeek].weapon_pos))<<16,scale(65536,ud.statusbarscale,100),0,weapon_sprites[g_currentweapon],0,0,2,windowx1,windowy1,windowx2,windowy2);
break; break;
} }
} }
} }
short fistsign; short fistsign;
@ -2285,14 +2285,14 @@ void displayweapon(short snum)
looking_arc += ((*kb)<<3); looking_arc += ((*kb)<<3);
else if((*kb) < 4) else if((*kb) < 4)
myospalw(weapon_xoffset+142-(p->look_ang>>1), myospalw(weapon_xoffset+142-(p->look_ang>>1),
looking_arc+234-gun_pos,HANDHOLDINGLASER+3,gs,o,pal); looking_arc+234-gun_pos,HANDHOLDINGLASER+3,gs,o,pal);
myospalw(weapon_xoffset+130-(p->look_ang>>1), myospalw(weapon_xoffset+130-(p->look_ang>>1),
looking_arc+249-gun_pos, looking_arc+249-gun_pos,
HANDHOLDINGLASER+((*kb)>>2),gs,o,pal); HANDHOLDINGLASER+((*kb)>>2),gs,o,pal);
myospalw(weapon_xoffset+152-(p->look_ang>>1), myospalw(weapon_xoffset+152-(p->look_ang>>1),
looking_arc+249-gun_pos, looking_arc+249-gun_pos,
HANDHOLDINGLASER+((*kb)>>2),gs,o|4,pal); HANDHOLDINGLASER+((*kb)>>2),gs,o|4,pal);
} }
break; break;
@ -2314,12 +2314,12 @@ void displayweapon(short snum)
if(*kb < 8) if(*kb < 8)
{ {
myospalw(weapon_xoffset+164,(looking_arc<<1)+176-gun_pos, myospalw(weapon_xoffset+164,(looking_arc<<1)+176-gun_pos,
RPGGUN+((*kb)>>1),gs,o,pal); RPGGUN+((*kb)>>1),gs,o,pal);
} }
} }
myospalw(weapon_xoffset+164,(looking_arc<<1)+176-gun_pos, myospalw(weapon_xoffset+164,(looking_arc<<1)+176-gun_pos,
RPGGUN,gs,o,pal); RPGGUN,gs,o,pal);
} }
break; break;
@ -2342,13 +2342,13 @@ void displayweapon(short snum)
case 1: case 1:
case 2: case 2:
myospalw(weapon_xoffset+168-(p->look_ang>>1),looking_arc+201-gun_pos, myospalw(weapon_xoffset+168-(p->look_ang>>1),looking_arc+201-gun_pos,
SHOTGUN+2,-128,o,pal); SHOTGUN+2,-128,o,pal);
case 0: case 0:
case 6: case 6:
case 7: case 7:
case 8: case 8:
myospalw(weapon_xoffset+146-(p->look_ang>>1),looking_arc+202-gun_pos, myospalw(weapon_xoffset+146-(p->look_ang>>1),looking_arc+202-gun_pos,
SHOTGUN,gs,o,pal); SHOTGUN,gs,o,pal);
break; break;
case 3: case 3:
case 4: case 4:
@ -2363,45 +2363,45 @@ void displayweapon(short snum)
weapon_xoffset += 20; weapon_xoffset += 20;
myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+194-gun_pos, myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+194-gun_pos,
SHOTGUN+1+((*(kb)-1)>>1),-128,o,pal); SHOTGUN+1+((*(kb)-1)>>1),-128,o,pal);
} }
myospalw(weapon_xoffset+158-(p->look_ang>>1),looking_arc+220-gun_pos, myospalw(weapon_xoffset+158-(p->look_ang>>1),looking_arc+220-gun_pos,
SHOTGUN+3,gs,o,pal); SHOTGUN+3,gs,o,pal);
break; break;
case 13: case 13:
case 14: case 14:
case 15: case 15:
myospalw(32+weapon_xoffset+166-(p->look_ang>>1),looking_arc+210-gun_pos, myospalw(32+weapon_xoffset+166-(p->look_ang>>1),looking_arc+210-gun_pos,
SHOTGUN+4,gs,o,pal); SHOTGUN+4,gs,o,pal);
break; break;
case 16: case 16:
case 17: case 17:
case 18: case 18:
case 19: case 19:
myospalw(64+weapon_xoffset+170-(p->look_ang>>1),looking_arc+196-gun_pos, myospalw(64+weapon_xoffset+170-(p->look_ang>>1),looking_arc+196-gun_pos,
SHOTGUN+5,gs,o,pal); SHOTGUN+5,gs,o,pal);
break; break;
case 20: case 20:
case 21: case 21:
case 22: case 22:
case 23: case 23:
myospalw(64+weapon_xoffset+176-(p->look_ang>>1),looking_arc+196-gun_pos, myospalw(64+weapon_xoffset+176-(p->look_ang>>1),looking_arc+196-gun_pos,
SHOTGUN+6,gs,o,pal); SHOTGUN+6,gs,o,pal);
break; break;
case 24: case 24:
case 25: case 25:
case 26: case 26:
case 27: case 27:
myospalw(64+weapon_xoffset+170-(p->look_ang>>1),looking_arc+196-gun_pos, myospalw(64+weapon_xoffset+170-(p->look_ang>>1),looking_arc+196-gun_pos,
SHOTGUN+5,gs,o,pal); SHOTGUN+5,gs,o,pal);
break; break;
case 28: case 28:
case 29: case 29:
case 30: case 30:
myospalw(32+weapon_xoffset+156-(p->look_ang>>1),looking_arc+206-gun_pos, myospalw(32+weapon_xoffset+156-(p->look_ang>>1),looking_arc+206-gun_pos,
SHOTGUN+4,gs,o,pal); SHOTGUN+4,gs,o,pal);
break; break;
} }
} }
@ -2425,12 +2425,12 @@ void displayweapon(short snum)
if(*kb > 0 && sprite[p->i].pal != 1) weapon_xoffset += 1-(rand()&3); if(*kb > 0 && sprite[p->i].pal != 1) weapon_xoffset += 1-(rand()&3);
myospalw(weapon_xoffset+168-(p->look_ang>>1),looking_arc+260-gun_pos, myospalw(weapon_xoffset+168-(p->look_ang>>1),looking_arc+260-gun_pos,
CHAINGUN,gs,o,pal); CHAINGUN,gs,o,pal);
switch(*kb) switch(*kb)
{ {
case 0: case 0:
myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos, myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos,
CHAINGUN+1,gs,o,pal); CHAINGUN+1,gs,o,pal);
break; break;
default: default:
if(*kb > *aplWeaponFireDelay[CHAINGUN_WEAPON] && *kb < *aplWeaponTotalTime[CHAINGUN_WEAPON]) if(*kb > *aplWeaponFireDelay[CHAINGUN_WEAPON] && *kb < *aplWeaponTotalTime[CHAINGUN_WEAPON])
@ -2438,21 +2438,21 @@ void displayweapon(short snum)
i = 0; i = 0;
if(sprite[p->i].pal != 1) i = rand()&7; if(sprite[p->i].pal != 1) i = rand()&7;
myospalw(i+weapon_xoffset-4+140-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, myospalw(i+weapon_xoffset-4+140-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos,
CHAINGUN+5+((*kb-4)/5),gs,o,pal); CHAINGUN+5+((*kb-4)/5),gs,o,pal);
if(sprite[p->i].pal != 1) i = rand()&7; if(sprite[p->i].pal != 1) i = rand()&7;
myospalw(i+weapon_xoffset-4+184-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, myospalw(i+weapon_xoffset-4+184-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos,
CHAINGUN+5+((*kb-4)/5),gs,o,pal); CHAINGUN+5+((*kb-4)/5),gs,o,pal);
} }
if(*kb < *aplWeaponTotalTime[CHAINGUN_WEAPON]-2) if(*kb < *aplWeaponTotalTime[CHAINGUN_WEAPON]-2)
{ {
i = rand()&7; i = rand()&7;
myospalw(i+weapon_xoffset-4+162-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos, myospalw(i+weapon_xoffset-4+162-(p->look_ang>>1),i+looking_arc-((*kb)>>1)+208-gun_pos,
CHAINGUN+5+((*kb-2)/5),gs,o,pal); CHAINGUN+5+((*kb-2)/5),gs,o,pal);
myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos, myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos,
CHAINGUN+1+((*kb)>>1),gs,o,pal); CHAINGUN+1+((*kb)>>1),gs,o,pal);
} }
else myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos, else myospalw(weapon_xoffset+178-(p->look_ang>>1),looking_arc+233-gun_pos,
CHAINGUN+1,gs,o,pal); CHAINGUN+1,gs,o,pal);
break; break;
} }
} }
@ -2655,21 +2655,21 @@ void displayweapon(short snum)
} }
myospalw(weapon_xoffset+184-(p->look_ang>>1), myospalw(weapon_xoffset+184-(p->look_ang>>1),
looking_arc+240-gun_pos,SHRINKER+3+((*kb)&3),-32, looking_arc+240-gun_pos,SHRINKER+3+((*kb)&3),-32,
o,2); o,2);
myospalw(weapon_xoffset+188-(p->look_ang>>1), myospalw(weapon_xoffset+188-(p->look_ang>>1),
looking_arc+240-gun_pos,SHRINKER-1,gs,o,pal); looking_arc+240-gun_pos,SHRINKER-1,gs,o,pal);
} }
else else
{ {
myospalw(weapon_xoffset+184-(p->look_ang>>1), myospalw(weapon_xoffset+184-(p->look_ang>>1),
looking_arc+240-gun_pos,SHRINKER+2, looking_arc+240-gun_pos,SHRINKER+2,
16-(sintable[p->random_club_frame&2047]>>10), 16-(sintable[p->random_club_frame&2047]>>10),
o,2); o,2);
myospalw(weapon_xoffset+188-(p->look_ang>>1), myospalw(weapon_xoffset+188-(p->look_ang>>1),
looking_arc+240-gun_pos,SHRINKER-2,gs,o,pal); looking_arc+240-gun_pos,SHRINKER-2,gs,o,pal);
} }
} }
} }
@ -2696,22 +2696,22 @@ void displayweapon(short snum)
} }
myospalw(weapon_xoffset+184-(p->look_ang>>1), myospalw(weapon_xoffset+184-(p->look_ang>>1),
looking_arc+240-gun_pos,SHRINKER+3+((*kb)&3),-32, looking_arc+240-gun_pos,SHRINKER+3+((*kb)&3),-32,
o,0); o,0);
myospalw(weapon_xoffset+188-(p->look_ang>>1), myospalw(weapon_xoffset+188-(p->look_ang>>1),
looking_arc+240-gun_pos,SHRINKER+1,gs,o,pal); looking_arc+240-gun_pos,SHRINKER+1,gs,o,pal);
} }
else else
{ {
myospalw(weapon_xoffset+184-(p->look_ang>>1), myospalw(weapon_xoffset+184-(p->look_ang>>1),
looking_arc+240-gun_pos,SHRINKER+2, looking_arc+240-gun_pos,SHRINKER+2,
16-(sintable[p->random_club_frame&2047]>>10), 16-(sintable[p->random_club_frame&2047]>>10),
o,0); o,0);
myospalw(weapon_xoffset+188-(p->look_ang>>1), myospalw(weapon_xoffset+188-(p->look_ang>>1),
looking_arc+240-gun_pos,SHRINKER,gs,o,pal); looking_arc+240-gun_pos,SHRINKER,gs,o,pal);
} }
} }
break; break;

View file

@ -36,25 +36,25 @@ static int precachecount;
static void tloadtile(short tilenume, char type) static void tloadtile(short tilenume, char type)
{ {
if ((picanm[tilenume]&63) > 0) { if ((picanm[tilenume]&63) > 0) {
int i,j; int i,j;
if ((picanm[tilenume]&192)==192) { if ((picanm[tilenume]&192)==192) {
i = tilenume - (picanm[tilenume]&63); i = tilenume - (picanm[tilenume]&63);
j = tilenume; j = tilenume;
} else { } else {
i = tilenume; i = tilenume;
j = tilenume + (picanm[tilenume]&63); j = tilenume + (picanm[tilenume]&63);
} }
for (;i<=j;i++) { for (;i<=j;i++) {
if (!(gotpic[i>>3] & pow2char[i&7])) precachecount++; if (!(gotpic[i>>3] & pow2char[i&7])) precachecount++;
gotpic[i>>3] |= pow2char[i&7]; gotpic[i>>3] |= pow2char[i&7];
precachehightile[type][i>>3] |= pow2char[i&7]; precachehightile[type][i>>3] |= pow2char[i&7];
} }
} else { } else {
if (!(gotpic[tilenume>>3] & pow2char[tilenume&7])) precachecount++; if (!(gotpic[tilenume>>3] & pow2char[tilenume&7])) precachecount++;
gotpic[tilenume>>3] |= pow2char[tilenume&7]; gotpic[tilenume>>3] |= pow2char[tilenume&7];
precachehightile[type][tilenume>>3] |= pow2char[tilenume&7]; precachehightile[type][tilenume>>3] |= pow2char[tilenume&7];
} }
} }
void cachespritenum(short i) void cachespritenum(short i)
@ -162,17 +162,17 @@ void cachespritenum(short i)
case CAMERA1__STATIC: case CAMERA1__STATIC:
maxc = 5; maxc = 5;
break; break;
// caching of HUD sprites for weapons that may be in the level // caching of HUD sprites for weapons that may be in the level
case CHAINGUNSPRITE__STATIC: for (j=CHAINGUN; j<=CHAINGUN+7; j++) tloadtile(j,1); break; case CHAINGUNSPRITE__STATIC: for (j=CHAINGUN; j<=CHAINGUN+7; j++) tloadtile(j,1); break;
case RPGSPRITE__STATIC: for (j=RPGGUN; j<=RPGGUN+2; j++) tloadtile(j,1); break; case RPGSPRITE__STATIC: for (j=RPGGUN; j<=RPGGUN+2; j++) tloadtile(j,1); break;
case FREEZESPRITE__STATIC: for (j=FREEZE; j<=FREEZE+5; j++) tloadtile(j,1); break; case FREEZESPRITE__STATIC: for (j=FREEZE; j<=FREEZE+5; j++) tloadtile(j,1); break;
case GROWSPRITEICON__STATIC: case GROWSPRITEICON__STATIC:
case SHRINKERSPRITE__STATIC: for (j=SHRINKER-2; j<=SHRINKER+5; j++) tloadtile(j,1); break; case SHRINKERSPRITE__STATIC: for (j=SHRINKER-2; j<=SHRINKER+5; j++) tloadtile(j,1); break;
case HBOMBAMMO__STATIC: case HBOMBAMMO__STATIC:
case HEAVYHBOMB__STATIC: for (j=HANDREMOTE; j<=HANDREMOTE+5; j++) tloadtile(j,1); break; case HEAVYHBOMB__STATIC: for (j=HANDREMOTE; j<=HANDREMOTE+5; j++) tloadtile(j,1); break;
case TRIPBOMBSPRITE__STATIC: for (j=HANDHOLDINGLASER; j<=HANDHOLDINGLASER+4; j++) tloadtile(j,1); break; case TRIPBOMBSPRITE__STATIC: for (j=HANDHOLDINGLASER; j<=HANDHOLDINGLASER+4; j++) tloadtile(j,1); break;
case SHOTGUNSPRITE__STATIC: tloadtile(SHOTGUNSHELL,1); for (j=SHOTGUN; j<=SHOTGUN+6; j++) tloadtile(j,1); break; case SHOTGUNSPRITE__STATIC: tloadtile(SHOTGUNSHELL,1); for (j=SHOTGUN; j<=SHOTGUN+6; j++) tloadtile(j,1); break;
case DEVISTATORSPRITE__STATIC: for (j=DEVISTATOR; j<=DEVISTATOR+1; j++) tloadtile(j,1); break; case DEVISTATORSPRITE__STATIC: for (j=DEVISTATOR; j<=DEVISTATOR+1; j++) tloadtile(j,1); break;
} }
@ -275,12 +275,12 @@ void cacheit(void)
{ {
long i,j,k, pc=0; long i,j,k, pc=0;
long tc; long tc;
unsigned long starttime, endtime; unsigned long starttime, endtime;
if(ud.recstat == 2) if(ud.recstat == 2)
return; return;
starttime = getticks(); starttime = getticks();
precachenecessarysounds(); precachenecessarysounds();
@ -314,44 +314,44 @@ void cacheit(void)
} }
} }
tc = totalclock; tc = totalclock;
j = 0; j = 0;
for(i=0;i<MAXTILES;i++) { for(i=0;i<MAXTILES;i++) {
if (!(i&7) && !gotpic[i>>3]) { if (!(i&7) && !gotpic[i>>3]) {
i+=7; i+=7;
continue; continue;
} }
if(gotpic[i>>3] & pow2char[i&7]) { if(gotpic[i>>3] & pow2char[i&7]) {
if (waloff[i] == 0) if (waloff[i] == 0)
loadtile((short)i); loadtile((short)i);
if (useprecache) { if (useprecache) {
if (precachehightile[0][i>>3] & pow2char[i&7]) if (precachehightile[0][i>>3] & pow2char[i&7])
for (k=0; k<MAXPALOOKUPS; k++) for (k=0; k<MAXPALOOKUPS; k++)
polymost_precache(i,k,0); polymost_precache(i,k,0);
if (precachehightile[1][i>>3] & pow2char[i&7]) if (precachehightile[1][i>>3] & pow2char[i&7])
for (k=0; k<MAXPALOOKUPS; k++) for (k=0; k<MAXPALOOKUPS; k++)
polymost_precache(i,k,1); polymost_precache(i,k,1);
} }
j++; j++;
pc++; pc++;
} else continue; } else continue;
if((j&7) == 0) { handleevents(); getpackets(); } if((j&7) == 0) { handleevents(); getpackets(); }
if (totalclock - tc > TICRATE/4) { if (totalclock - tc > TICRATE/4) {
sprintf(tempbuf,"Loading textures ... %ld%%\n",min(100,100*pc/precachecount)); sprintf(tempbuf,"Loading textures ... %ld%%\n",min(100,100*pc/precachecount));
dofrontscreens(tempbuf); dofrontscreens(tempbuf);
tc = totalclock; tc = totalclock;
} }
} }
clearbufbyte(gotpic,sizeof(gotpic),0L); clearbufbyte(gotpic,sizeof(gotpic),0L);
endtime = getticks(); endtime = getticks();
OSD_Printf("Cache time: %dms\n", endtime-starttime); OSD_Printf("Cache time: %dms\n", endtime-starttime);
} }
void xyzmirror(short i,short wn) void xyzmirror(short i,short wn)
@ -1004,7 +1004,7 @@ void newgame(char vn,char ln,char sk)
short i; short i;
if(globalskillsound >= 0) if(globalskillsound >= 0)
while(issoundplaying(globalskillsound)) { handleevents(); getpackets(); } while(issoundplaying(globalskillsound)) { handleevents(); getpackets(); }
globalskillsound = -1; globalskillsound = -1;
waitforeverybody(); waitforeverybody();
@ -1113,7 +1113,7 @@ void resetpspritevars(char g)
{ {
aimmode[i] = ps[i].aim_mode; aimmode[i] = ps[i].aim_mode;
autoaim[i] = ps[i].auto_aim; autoaim[i] = ps[i].auto_aim;
weaponswitch[i] = ps[i].weaponswitch; weaponswitch[i] = ps[i].weaponswitch;
if(ud.multimode > 1 && (gametype_flags[ud.coop]&GAMETYPE_FLAG_PRESERVEINVENTORYDEATH) && ud.last_level >= 0) if(ud.multimode > 1 && (gametype_flags[ud.coop]&GAMETYPE_FLAG_PRESERVEINVENTORYDEATH) && ud.last_level >= 0)
{ {
for(j=0;j<MAX_WEAPONS;j++) for(j=0;j<MAX_WEAPONS;j++)
@ -1145,7 +1145,7 @@ void resetpspritevars(char g)
{ {
ps[i].aim_mode = aimmode[i]; ps[i].aim_mode = aimmode[i];
ps[i].auto_aim = autoaim[i]; ps[i].auto_aim = autoaim[i];
ps[i].weaponswitch = weaponswitch[i]; ps[i].weaponswitch = weaponswitch[i];
if(ud.multimode > 1 && (gametype_flags[ud.coop]&GAMETYPE_FLAG_PRESERVEINVENTORYDEATH) && ud.last_level >= 0) if(ud.multimode > 1 && (gametype_flags[ud.coop]&GAMETYPE_FLAG_PRESERVEINVENTORYDEATH) && ud.last_level >= 0)
{ {
for(j=0;j<MAX_WEAPONS;j++) for(j=0;j<MAX_WEAPONS;j++)

View file

@ -60,7 +60,7 @@ int loadpheader(char spot,struct savehead *saveh)
return(0); return(0);
corrupt: corrupt:
kclose(fil); kclose(fil);
return 1; return 1;
} }
@ -203,25 +203,25 @@ int loadplayer(signed char spot)
if (kdfread(&script[0],4,MAXSCRIPTSIZE,fil) != MAXSCRIPTSIZE) goto corrupt; if (kdfread(&script[0],4,MAXSCRIPTSIZE,fil) != MAXSCRIPTSIZE) goto corrupt;
for(i=0;i<MAXSCRIPTSIZE;i++) for(i=0;i<MAXSCRIPTSIZE;i++)
if( scriptptrs[i] ) if( scriptptrs[i] )
{ {
j = (long)script[i]+(long)&script[0]; j = (long)script[i]+(long)&script[0];
script[i] = j; script[i] = j;
} }
if (kdfread(&actorscrptr[0],4,MAXTILES,fil) != MAXTILES) goto corrupt; if (kdfread(&actorscrptr[0],4,MAXTILES,fil) != MAXTILES) goto corrupt;
for(i=0;i<MAXTILES;i++) for(i=0;i<MAXTILES;i++)
if(actorscrptr[i]) if(actorscrptr[i])
{ {
j = (long)actorscrptr[i]+(long)&script[0]; j = (long)actorscrptr[i]+(long)&script[0];
actorscrptr[i] = (long *)j; actorscrptr[i] = (long *)j;
} }
if (kdfread(&actorLoadEventScrptr[0],4,MAXTILES,fil) != MAXTILES) goto corrupt; if (kdfread(&actorLoadEventScrptr[0],4,MAXTILES,fil) != MAXTILES) goto corrupt;
for(i=0;i<MAXTILES;i++) for(i=0;i<MAXTILES;i++)
if(actorLoadEventScrptr[i]) if(actorLoadEventScrptr[i])
{ {
j = (long)actorLoadEventScrptr[i]+(long)&script[0]; j = (long)actorLoadEventScrptr[i]+(long)&script[0];
actorLoadEventScrptr[i] = (long *)j; actorLoadEventScrptr[i] = (long *)j;
} }
if (kdfread(&scriptptrs[0],1,MAXSPRITES,fil) != MAXSPRITES) goto corrupt; if (kdfread(&scriptptrs[0],1,MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
if (kdfread(&hittype[0],sizeof(struct weaponhit),MAXSPRITES,fil) != MAXSPRITES) goto corrupt; if (kdfread(&hittype[0],sizeof(struct weaponhit),MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
@ -326,7 +326,7 @@ int loadplayer(signed char spot)
{ {
for(x=0;x<numanimwalls;x++) for(x=0;x<numanimwalls;x++)
switch(dynamictostatic[wall[animwall[x].wallnum].picnum]) switch(dynamictostatic[wall[animwall[x].wallnum].picnum])
{ {
case FEMPIC1__STATIC: case FEMPIC1__STATIC:
wall[animwall[x].wallnum].picnum = BLANKSCREEN; wall[animwall[x].wallnum].picnum = BLANKSCREEN;
break; break;
@ -334,7 +334,7 @@ int loadplayer(signed char spot)
case FEMPIC3__STATIC: case FEMPIC3__STATIC:
wall[animwall[x].wallnum].picnum = SCREENBREAK6; wall[animwall[x].wallnum].picnum = SCREENBREAK6;
break; break;
} }
} }
numinterpolations = 0; numinterpolations = 0;
@ -345,31 +345,31 @@ int loadplayer(signed char spot)
{ {
switch(sprite[k].lotag) switch(sprite[k].lotag)
{ {
case 31: case 31:
setinterpolation(&sector[sprite[k].sectnum].floorz); setinterpolation(&sector[sprite[k].sectnum].floorz);
break; break;
case 32: case 32:
setinterpolation(&sector[sprite[k].sectnum].ceilingz); setinterpolation(&sector[sprite[k].sectnum].ceilingz);
break; break;
case 25: case 25:
setinterpolation(&sector[sprite[k].sectnum].floorz); setinterpolation(&sector[sprite[k].sectnum].floorz);
setinterpolation(&sector[sprite[k].sectnum].ceilingz); setinterpolation(&sector[sprite[k].sectnum].ceilingz);
break; break;
case 17: case 17:
setinterpolation(&sector[sprite[k].sectnum].floorz); setinterpolation(&sector[sprite[k].sectnum].floorz);
setinterpolation(&sector[sprite[k].sectnum].ceilingz); setinterpolation(&sector[sprite[k].sectnum].ceilingz);
break; break;
case 0: case 0:
case 5: case 5:
case 6: case 6:
case 11: case 11:
case 14: case 14:
case 15: case 15:
case 16: case 16:
case 26: case 26:
case 30: case 30:
setsectinterpolate(k); setsectinterpolate(k);
break; break;
} }
k = nextspritestat[k]; k = nextspritestat[k];
@ -396,7 +396,7 @@ int loadplayer(signed char spot)
return(0); return(0);
corrupt: corrupt:
Bsprintf(tempbuf,"Save game file \"%s\" is corrupt.",fnptr); Bsprintf(tempbuf,"Save game file \"%s\" is corrupt.",fnptr);
gameexit(tempbuf); gameexit(tempbuf);
return -1; return -1;
} }
@ -511,38 +511,38 @@ int saveplayer(signed char spot)
for(i=0;i<MAXSCRIPTSIZE;i++) for(i=0;i<MAXSCRIPTSIZE;i++)
if( scriptptrs[i] ) if( scriptptrs[i] )
{ {
j = script[i]+(long)&script[0]; j = script[i]+(long)&script[0];
script[i] = j; script[i] = j;
} }
for(i=0;i<MAXTILES;i++) for(i=0;i<MAXTILES;i++)
if(actorscrptr[i]) if(actorscrptr[i])
{ {
j = (long)actorscrptr[i]-(long)&script[0]; j = (long)actorscrptr[i]-(long)&script[0];
actorscrptr[i] = (long *)j; actorscrptr[i] = (long *)j;
} }
dfwrite(&actorscrptr[0],4,MAXTILES,fil); dfwrite(&actorscrptr[0],4,MAXTILES,fil);
for(i=0;i<MAXTILES;i++) for(i=0;i<MAXTILES;i++)
if(actorscrptr[i]) if(actorscrptr[i])
{ {
j = (long)actorscrptr[i]+(long)&script[0]; j = (long)actorscrptr[i]+(long)&script[0];
actorscrptr[i] = (long *)j; actorscrptr[i] = (long *)j;
} }
for(i=0;i<MAXTILES;i++) for(i=0;i<MAXTILES;i++)
if(actorLoadEventScrptr[i]) if(actorLoadEventScrptr[i])
{ {
j = (long)actorLoadEventScrptr[i]-(long)&script[0]; j = (long)actorLoadEventScrptr[i]-(long)&script[0];
actorLoadEventScrptr[i] = (long *)j; actorLoadEventScrptr[i] = (long *)j;
} }
dfwrite(&actorLoadEventScrptr[0],4,MAXTILES,fil); dfwrite(&actorLoadEventScrptr[0],4,MAXTILES,fil);
for(i=0;i<MAXTILES;i++) for(i=0;i<MAXTILES;i++)
if(actorLoadEventScrptr[i]) if(actorLoadEventScrptr[i])
{ {
j = (long)actorLoadEventScrptr[i]+(long)&script[0]; j = (long)actorLoadEventScrptr[i]+(long)&script[0];
actorLoadEventScrptr[i] = (long *)j; actorLoadEventScrptr[i] = (long *)j;
} }
for(i=0;i<MAXSPRITES;i++) for(i=0;i<MAXSPRITES;i++)

View file

@ -44,24 +44,24 @@ long backflag,numenvsnds;
void SoundStartup( void ) void SoundStartup( void )
{ {
int32 status; int32 status;
// if they chose None lets return // if they chose None lets return
if (FXDevice < 0) return; if (FXDevice < 0) return;
status = FX_Init( FXDevice, NumVoices, NumChannels, NumBits, MixRate ); status = FX_Init( FXDevice, NumVoices, NumChannels, NumBits, MixRate );
if ( status == FX_Ok ) { if ( status == FX_Ok ) {
FX_SetVolume( FXVolume ); FX_SetVolume( FXVolume );
if (ReverseStereo == 1) { if (ReverseStereo == 1) {
FX_SetReverseStereo(!FX_GetReverseStereo()); FX_SetReverseStereo(!FX_GetReverseStereo());
} }
status = FX_SetCallBack( testcallback ); status = FX_SetCallBack( testcallback );
} }
if ( status != FX_Ok ) { if ( status != FX_Ok ) {
sprintf(tempbuf, "Sound startup error: %s", FX_ErrorString( FX_Error )); sprintf(tempbuf, "Sound startup error: %s", FX_ErrorString( FX_Error ));
gameexit(tempbuf); gameexit(tempbuf);
} }
} }
/* /*
@ -74,17 +74,17 @@ void SoundStartup( void )
void SoundShutdown( void ) void SoundShutdown( void )
{ {
int32 status; int32 status;
// if they chose None lets return // if they chose None lets return
if (FXDevice < 0) if (FXDevice < 0)
return; return;
status = FX_Shutdown(); status = FX_Shutdown();
if ( status != FX_Ok ) { if ( status != FX_Ok ) {
sprintf(tempbuf, "Sound shutdown error: %s", FX_ErrorString( FX_Error )); sprintf(tempbuf, "Sound shutdown error: %s", FX_ErrorString( FX_Error ));
gameexit(tempbuf); gameexit(tempbuf);
} }
} }
/* /*
@ -275,9 +275,9 @@ int xyzsound(short num,short i,long x,long y,long z)
if( soundm[num]&4 ) if( soundm[num]&4 )
{ {
if(VoiceToggle==0) if(VoiceToggle==0)
return -1; return -1;
else if (ud.multimode > 1 && PN == APLAYER && sprite[i].yvel != screenpeek && (!(gametype_flags[ud.coop]&GAMETYPE_FLAG_COOPSOUND)?1:VoiceToggle!=2)) else if (ud.multimode > 1 && PN == APLAYER && sprite[i].yvel != screenpeek && (!(gametype_flags[ud.coop]&GAMETYPE_FLAG_COOPSOUND)?1:VoiceToggle!=2))
return -1; return -1;
for(j=0;j<NUM_SOUNDS;j++) for(j=0;j<NUM_SOUNDS;j++)
for(k=0;k<Sound[j].num;k++) for(k=0;k<Sound[j].num;k++)
if( (Sound[j].num > 0) && (soundm[j]&4) ) if( (Sound[j].num > 0) && (soundm[j]&4) )
@ -463,7 +463,7 @@ int spritesound(unsigned short num, short i)
void stopspritesound(short num, short i) void stopspritesound(short num, short i)
{ {
stopsound(num); stopsound(num);
} }
void stopsound(short num) void stopsound(short num)
@ -624,11 +624,11 @@ void clearsoundlocks(void)
int isspritemakingsound(short i, int num) int isspritemakingsound(short i, int num)
{ {
if (num < 0) num=0; // FIXME if (num < 0) num=0; // FIXME
return issoundplaying(num) > 0; return issoundplaying(num) > 0;
} }
int issoundplaying(int num) int issoundplaying(int num)
{ {
return Sound[num].num; return Sound[num].num;
} }