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

This commit is contained in:
terminx 2008-09-26 04:20:08 +00:00
parent a30229fcf2
commit 2057d2a9ff
8 changed files with 77 additions and 62 deletions

View file

@ -542,7 +542,7 @@ inline int ssp(int i,unsigned int cliptype) //The set sprite function
} }
#undef deletesprite #undef deletesprite
void deletespriteEVENT(int s) void deletesprite_(int s)
{ {
if (apScriptGameEvent[EVENT_KILLIT]) if (apScriptGameEvent[EVENT_KILLIT])
{ {
@ -555,7 +555,7 @@ void deletespriteEVENT(int s)
} }
deletesprite(s); deletesprite(s);
} }
#define deletesprite deletespriteEVENT #define deletesprite deletesprite_
void insertspriteq(int i) void insertspriteq(int i)
{ {
@ -586,13 +586,12 @@ void lotsofmoneymailpaper(int sp, int n, int pic)
void guts(int sp, int gtype, int n) void guts(int sp, int gtype, int n)
{ {
int gutz,floorz; int gutz,floorz;
int i,a,j,sx,sy; int i,a,j,sx = 32,sy = 32;
// int pal; // int pal;
spritetype *s = &sprite[sp]; spritetype *s = &sprite[sp];
if (badguy(s) && s->xrepeat < 16) if (badguy(s) && s->xrepeat < 16)
sx = sy = 8; sx = sy = 8;
else sx = sy = 32;
gutz = s->z-(8<<8); gutz = s->z-(8<<8);
floorz = getflorzofslope(s->sectnum,s->x,s->y); floorz = getflorzofslope(s->sectnum,s->x,s->y);
@ -625,12 +624,11 @@ void guts(int sp, int gtype, int n)
void gutsdir(int sp, int gtype, int n) void gutsdir(int sp, int gtype, int n)
{ {
int gutz,floorz; int gutz,floorz;
int i,a,j,sx,sy; int i,a,j,sx = 32,sy = 32;
spritetype *s = &sprite[sp]; spritetype *s = &sprite[sp];
if (badguy(s) && s->xrepeat < 16) if (badguy(s) && s->xrepeat < 16)
sx = sy = 8; sx = sy = 8;
else sx = sy = 32;
gutz = s->z-(8<<8); gutz = s->z-(8<<8);
floorz = getflorzofslope(s->sectnum,s->x,s->y); floorz = getflorzofslope(s->sectnum,s->x,s->y);
@ -800,7 +798,7 @@ static void movefta(void)
} }
} }
int ifhitsectors(int sectnum) static inline int ifhitsectors(int sectnum)
{ {
int i = headspritestat[5]; int i = headspritestat[5];
while (i >= 0) while (i >= 0)
@ -812,6 +810,8 @@ int ifhitsectors(int sectnum)
return -1; return -1;
} }
#define IFHITSECT j=ifhitsectors(s->sectnum);if(j >= 0)
int ifhitbyweapon(int sn) int ifhitbyweapon(int sn)
{ {
int j,p; int j,p;

View file

@ -6487,13 +6487,13 @@ static void DoSpriteSearch(int dir) // <0: backwards, >=0: forwards
case 3: case 3:
k = gs_sprite[1][3]; k = gs_sprite[1][3];
if (k != sprite[gs_cursprite].xrepeat && if (k != sprite[gs_cursprite].xrepeat &&
k != sprite[gs_cursprite].yrepeat) k != sprite[gs_cursprite].yrepeat)
goto NEXTSPRITE; goto NEXTSPRITE;
break; break;
case 4: case 4:
k = gs_sprite[1][4]; k = gs_sprite[1][4];
if (k != sprite[gs_cursprite].xoffset && if (k != sprite[gs_cursprite].xoffset &&
k != sprite[gs_cursprite].yoffset) k != sprite[gs_cursprite].yoffset)
goto NEXTSPRITE; goto NEXTSPRITE;
break; break;
case 5: k = sprite[gs_cursprite].picnum; break; case 5: k = sprite[gs_cursprite].picnum; break;
@ -6920,32 +6920,32 @@ static void Keys2d(void)
if (wallsprite==2) if (wallsprite==2)
DoSpriteSearch(-1); DoSpriteSearch(-1);
#if 0 #if 0
{ {
if (cursearchspritenum>0) cursearchspritenum--; if (cursearchspritenum>0) cursearchspritenum--;
for (i=cursearchspritenum;i>=0;i--) for (i=cursearchspritenum;i>=0;i--)
{ {
if ( if (
(sprite[i].picnum==sprite[cursearchsprite].picnum && (sprite[i].picnum==sprite[cursearchsprite].picnum &&
sprite[i].statnum==0) sprite[i].statnum==0)
&&((search_lotag==0)|| &&((search_lotag==0)||
(search_lotag!=0 && search_lotag==sprite[i].lotag)) (search_lotag!=0 && search_lotag==sprite[i].lotag))
&&((search_hitag==0)|| &&((search_hitag==0)||
(search_hitag!=0 && search_hitag==sprite[i].hitag)) (search_hitag!=0 && search_hitag==sprite[i].hitag))
) )
{ {
posx=sprite[i].x; posx=sprite[i].x;
posy=sprite[i].y; posy=sprite[i].y;
ang= sprite[i].ang; ang= sprite[i].ang;
printmessage16("< Sprite search: found"); printmessage16("< Sprite search: found");
// curspritenum--; // curspritenum--;
keystatus[KEYSC_LBRACK]=0; keystatus[KEYSC_LBRACK]=0;
return; return;
}
cursearchspritenum--;
}
printmessage16("< Sprite search: none found");
} }
cursearchspritenum--;
}
printmessage16("< Sprite search: none found");
}
#endif #endif
} }
@ -9172,14 +9172,14 @@ void faketimerhandler(void)
horiz = ((horiz*7+(100-(daang>>1)))>>3); horiz = ((horiz*7+(100-(daang>>1)))>>3);
if (horiz < 100) horiz++; if (horiz < 100) horiz++;
if (horiz > 100) horiz--; if (horiz > 100) horiz--;
/* /*
if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_5]) // ' 5 if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_5]) // ' 5
{ {
keystatus[KEYSC_5]=0; keystatus[KEYSC_5]=0;
editstatus = 1; editstatus = 1;
sidemode = 2; sidemode = 2;
} }
*/ */
} }
extern short brightness; extern short brightness;
@ -9986,10 +9986,11 @@ static void GenSearchSprite()
char edittext[80]; char edittext[80];
static int col=0, row=0; static int col=0, row=0;
int i, j, k; int i, j, k;
int rowmax[3]={6,5,6}, dispwidth[3] = {24,24,28}; int rowmax[3]={6,5,6}, dispwidth[3] = {24,24,28};
int xpos[3] = {8,200,400}, ypos = ydim-STATUS2DSIZ+48; int xpos[3] = {8,200,400}, ypos = ydim-STATUS2DSIZ+48;
static char *labels[7][3] = { static char *labels[7][3] =
{
{"X-coordinate", "Flags (hex)", "Angle (2048 degrees)"}, {"X-coordinate", "Flags (hex)", "Angle (2048 degrees)"},
{"Y-coordinate", "Shade", "X-Velocity"}, {"Y-coordinate", "Shade", "X-Velocity"},
{"Z-coordinate", "Pal", "Y-Velocity"}, {"Z-coordinate", "Pal", "Y-Velocity"},
@ -9999,7 +10000,8 @@ static void GenSearchSprite()
{"Lotag", "", "Extra"} {"Lotag", "", "Extra"}
}; };
static int maxval[7][3] = { static int maxval[7][3] =
{
{ 524288 , 65536 , 2048 }, { 524288 , 65536 , 2048 },
{ 524288 , 128 , 65536 }, { 524288 , 128 , 65536 },
{ 8388608 , MAXPALOOKUPS, 65536 }, { 8388608 , MAXPALOOKUPS, 65536 },
@ -10009,7 +10011,8 @@ static void GenSearchSprite()
{ 65536 , 0 , 65536 } { 65536 , 0 , 65536 }
}; };
static char sign[7][3] = { static char sign[7][3] =
{
{1,0,1}, {1,1,1}, {1,0,1}, {0,0,1}, {0,1,0}, {0,0,0}, {0,0,1} {1,0,1}, {1,1,1}, {1,0,1}, {0,0,1}, {0,1,0}, {0,0,0}, {0,0,1}
}; };
@ -10073,7 +10076,7 @@ static void GenSearchSprite()
if (keystatus[KEYSC_LEFT]) if (keystatus[KEYSC_LEFT])
{ {
keystatus[KEYSC_LEFT] = 0; keystatus[KEYSC_LEFT] = 0;
if (col > 0) if (col > 0)
{ {
printext16(xpos[col],ypos+row*8,11,0,disptext,0); printext16(xpos[col],ypos+row*8,11,0,disptext,0);
col--; col--;
@ -10113,7 +10116,7 @@ static void GenSearchSprite()
keystatus[KEYSC_BS] = keystatus[KEYSC_DELETE] = 0; keystatus[KEYSC_BS] = keystatus[KEYSC_DELETE] = 0;
gs_spritewhat[col][row] = 0; gs_spritewhat[col][row] = 0;
if (col == 1 && row == 5) // picnum if (col == 1 && row == 5) // picnum
printext16(xpos[1], ypos-2*8, 14, 0, " ", 0); printext16(xpos[1], ypos-2*8, 14, 0, " ", 0);
} }

View file

@ -1149,10 +1149,14 @@ int32 CONFIG_GetMapBestTime(char *mapname)
if (p) strcpy(m, p); if (p) strcpy(m, p);
for (p=m;*p;p++) *p = tolower(*p); for (p=m;*p;p++) *p = tolower(*p);
// cheap hack because SCRIPT_GetNumber doesn't like the slashes
p = m;
while (*p == '/') p++;
if (!ud.config.setupread) return -1; if (!ud.config.setupread) return -1;
if (ud.config.scripthandle < 0) return -1; if (ud.config.scripthandle < 0) return -1;
SCRIPT_GetNumber(ud.config.scripthandle, "MapTimes", m, &t);
SCRIPT_GetNumber(ud.config.scripthandle, "MapTimes", p, &t);
return t; return t;
} }
@ -1166,10 +1170,14 @@ int32 CONFIG_SetMapBestTime(char *mapname, int32 tm)
if (p) strcpy(m, p); if (p) strcpy(m, p);
for (p=m;*p;p++) *p = tolower(*p); for (p=m;*p;p++) *p = tolower(*p);
// cheap hack because SCRIPT_GetNumber doesn't like the slashes
p = m;
while (*p == '/') p++;
if (ud.config.scripthandle < 0) ud.config.scripthandle = SCRIPT_Init(setupfilename); if (ud.config.scripthandle < 0) ud.config.scripthandle = SCRIPT_Init(setupfilename);
if (ud.config.scripthandle < 0) return -1; if (ud.config.scripthandle < 0) return -1;
SCRIPT_PutNumber(ud.config.scripthandle, "MapTimes", mapname, tm, false, false); SCRIPT_PutNumber(ud.config.scripthandle, "MapTimes", p, tm, false, false);
return 0; return 0;
} }

View file

@ -264,14 +264,13 @@ enum weapon_indexes {
#define IFWITHIN(B,E) if((PN)>=(B) && (PN)<=(E)) #define IFWITHIN(B,E) if((PN)>=(B) && (PN)<=(E))
#define deletesprite deletespriteEVENT #define deletesprite deletesprite_
void deletespriteEVENT(int s); void deletesprite_(int s);
#define KILLIT(KX) {deletesprite(KX);goto BOLT;} #define KILLIT(KX) {deletesprite(KX);goto BOLT;}
#define IFMOVING if(ssp(i,CLIPMASK0)) #define IFMOVING if(ssp(i,CLIPMASK0))
#define IFHIT j=ifhitbyweapon(i);if(j >= 0) #define IFHIT j=ifhitbyweapon(i);if(j >= 0)
#define IFHITSECT j=ifhitsectors(s->sectnum);if(j >= 0)
#define AFLAMABLE(X) (X==BOX||X==TREE1||X==TREE2||X==TIRE||X==CONE) #define AFLAMABLE(X) (X==BOX||X==TREE1||X==TREE2||X==TIRE||X==CONE)

View file

@ -179,7 +179,6 @@ extern void lotsofmoneymailpaper(int sp,int n,int pic);
extern void guts(int sp,int gtype,int n); extern void guts(int sp,int gtype,int n);
extern void setsectinterpolate(int i); extern void setsectinterpolate(int i);
extern void clearsectinterpolate(int i); extern void clearsectinterpolate(int i);
extern int ifhitsectors(int sectnum);
extern int ifhitbyweapon(int sn); extern int ifhitbyweapon(int sn);
extern void moveobjects(void); extern void moveobjects(void);
extern void movecyclers(void); extern void movecyclers(void);

View file

@ -3798,7 +3798,7 @@ void displayrest(int smoothratio)
else bits |= 1+32; else bits |= 1+32;
if (map[(ud.volume_number*MAXLEVELS) + ud.level_number].name != NULL) if (map[(ud.volume_number*MAXLEVELS) + ud.level_number].name != NULL)
{ {
if (currentboardfilename[0] != 0) if (currentboardfilename[0] != 0 && ud.volume_number == 0 && ud.level_number == 7)
menutext_(160,75,(sintable[(totalclock<<5)&2047]>>11),0,currentboardfilename,bits); menutext_(160,75,(sintable[(totalclock<<5)&2047]>>11),0,currentboardfilename,bits);
else menutext_(160,75,(sintable[(totalclock<<5)&2047]>>11),0,map[(ud.volume_number*MAXLEVELS) + ud.level_number].name,bits); else menutext_(160,75,(sintable[(totalclock<<5)&2047]>>11),0,map[(ud.volume_number*MAXLEVELS) + ud.level_number].name,bits);
} }
@ -3902,9 +3902,11 @@ void displayrest(int smoothratio)
j = scale(2,ud.config.ScreenWidth,320); j = scale(2,ud.config.ScreenWidth,320);
} }
Bsprintf(tempbuf,"T:^15%d:%02d", Bsprintf(tempbuf,"T:^15%d:%02d.%02d",
(g_player[myconnectindex].ps->player_par/(26*60)), (g_player[myconnectindex].ps->player_par/(26*60)),
(g_player[myconnectindex].ps->player_par/26)%60); (g_player[myconnectindex].ps->player_par/26)%60,
((g_player[myconnectindex].ps->player_par%26)*38)/10
);
gametext_z(9,STARTALPHANUM, j,scale(200-i,ud.config.ScreenHeight,200)-7-7-7,tempbuf,0,10,26,0, 0, xdim-1, ydim-1, 65536); gametext_z(9,STARTALPHANUM, j,scale(200-i,ud.config.ScreenHeight,200)-7-7-7,tempbuf,0,10,26,0, 0, xdim-1, ydim-1, 65536);
if (ud.player_skill > 3 || (ud.multimode > 1 && !GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY))) if (ud.player_skill > 3 || (ud.multimode > 1 && !GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY)))
@ -13115,9 +13117,11 @@ FRAGBONUS:
sound(PIPEBOMB_EXPLODE); sound(PIPEBOMB_EXPLODE);
} }
Bsprintf(tempbuf,"%0*d:%02d",clockpad, Bsprintf(tempbuf,"%0*d:%02d.%02d",clockpad,
(g_player[myconnectindex].ps->player_par/(26*60)), (g_player[myconnectindex].ps->player_par/(26*60)),
(g_player[myconnectindex].ps->player_par/26)%60); (g_player[myconnectindex].ps->player_par/26)%60,
((g_player[myconnectindex].ps->player_par%26)*38)/10
);
gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16);
if (g_player[myconnectindex].ps->player_par < playerbest) if (g_player[myconnectindex].ps->player_par < playerbest)
gametext((320>>2)+71+(clockpad*24),yy+9,"New record!",0,2+8+16); gametext((320>>2)+71+(clockpad*24),yy+9,"New record!",0,2+8+16);
@ -13143,9 +13147,11 @@ FRAGBONUS:
if (playerbest > 0) if (playerbest > 0)
{ {
sprintf(tempbuf,"%0*d:%02d",clockpad, sprintf(tempbuf,"%0*d:%02d.%02d",clockpad,
(playerbest/(26*60)), (playerbest/(26*60)),
(playerbest/26)%60); (playerbest/26)%60,
((playerbest%26)*38)/10
);
gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16);
yy+=10; yy+=10;
} }

View file

@ -185,7 +185,7 @@ int ScanGroups(void)
} }
fclose(fp); fclose(fp);
} }
initprintf("Found %d recognized GRP files.\n",i); initprintf("Found %d recognized GRP %s.\n",i,i>1?"files":"file");
return 0; return 0;
} }
initprintf("Found no recognized GRP files!\n"); initprintf("Found no recognized GRP files!\n");

View file

@ -4372,7 +4372,7 @@ cheat_for_port_credits:
break; break;
} }
for (m=first;m<last;m++) for (m=first;m<last-1;m++)
{ {
int odx,dx,ody,dy; int odx,dx,ody,dy;
Bstrcpy(tempbuf,(char *)getjoyname(0,m)); Bstrcpy(tempbuf,(char *)getjoyname(0,m));