diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 96ee94b29..fa7787c3b 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -542,7 +542,7 @@ inline int ssp(int i,unsigned int cliptype) //The set sprite function } #undef deletesprite -void deletespriteEVENT(int s) +void deletesprite_(int s) { if (apScriptGameEvent[EVENT_KILLIT]) { @@ -555,7 +555,7 @@ void deletespriteEVENT(int s) } deletesprite(s); } -#define deletesprite deletespriteEVENT +#define deletesprite deletesprite_ void insertspriteq(int i) { @@ -586,13 +586,12 @@ void lotsofmoneymailpaper(int sp, int n, int pic) void guts(int sp, int gtype, int n) { int gutz,floorz; - int i,a,j,sx,sy; + int i,a,j,sx = 32,sy = 32; // int pal; spritetype *s = &sprite[sp]; if (badguy(s) && s->xrepeat < 16) sx = sy = 8; - else sx = sy = 32; gutz = s->z-(8<<8); 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) { int gutz,floorz; - int i,a,j,sx,sy; + int i,a,j,sx = 32,sy = 32; spritetype *s = &sprite[sp]; if (badguy(s) && s->xrepeat < 16) sx = sy = 8; - else sx = sy = 32; gutz = s->z-(8<<8); 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]; while (i >= 0) @@ -812,6 +810,8 @@ int ifhitsectors(int sectnum) return -1; } +#define IFHITSECT j=ifhitsectors(s->sectnum);if(j >= 0) + int ifhitbyweapon(int sn) { int j,p; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index ca3cb004b..93323e0e7 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -6487,13 +6487,13 @@ static void DoSpriteSearch(int dir) // <0: backwards, >=0: forwards case 3: k = gs_sprite[1][3]; if (k != sprite[gs_cursprite].xrepeat && - k != sprite[gs_cursprite].yrepeat) + k != sprite[gs_cursprite].yrepeat) goto NEXTSPRITE; break; case 4: k = gs_sprite[1][4]; if (k != sprite[gs_cursprite].xoffset && - k != sprite[gs_cursprite].yoffset) + k != sprite[gs_cursprite].yoffset) goto NEXTSPRITE; break; case 5: k = sprite[gs_cursprite].picnum; break; @@ -6920,32 +6920,32 @@ static void Keys2d(void) if (wallsprite==2) DoSpriteSearch(-1); #if 0 - { - if (cursearchspritenum>0) cursearchspritenum--; - for (i=cursearchspritenum;i>=0;i--) - { + { + if (cursearchspritenum>0) cursearchspritenum--; + for (i=cursearchspritenum;i>=0;i--) + { - if ( - (sprite[i].picnum==sprite[cursearchsprite].picnum && - sprite[i].statnum==0) - &&((search_lotag==0)|| - (search_lotag!=0 && search_lotag==sprite[i].lotag)) - &&((search_hitag==0)|| - (search_hitag!=0 && search_hitag==sprite[i].hitag)) - ) - { - posx=sprite[i].x; - posy=sprite[i].y; - ang= sprite[i].ang; - printmessage16("< Sprite search: found"); - // curspritenum--; - keystatus[KEYSC_LBRACK]=0; - return; - } - cursearchspritenum--; - } - printmessage16("< Sprite search: none found"); + if ( + (sprite[i].picnum==sprite[cursearchsprite].picnum && + sprite[i].statnum==0) + &&((search_lotag==0)|| + (search_lotag!=0 && search_lotag==sprite[i].lotag)) + &&((search_hitag==0)|| + (search_hitag!=0 && search_hitag==sprite[i].hitag)) + ) + { + posx=sprite[i].x; + posy=sprite[i].y; + ang= sprite[i].ang; + printmessage16("< Sprite search: found"); + // curspritenum--; + keystatus[KEYSC_LBRACK]=0; + return; } + cursearchspritenum--; + } + printmessage16("< Sprite search: none found"); + } #endif } @@ -9172,14 +9172,14 @@ void faketimerhandler(void) horiz = ((horiz*7+(100-(daang>>1)))>>3); if (horiz < 100) horiz++; if (horiz > 100) horiz--; -/* - if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_5]) // ' 5 - { - keystatus[KEYSC_5]=0; - editstatus = 1; - sidemode = 2; - } - */ + /* + if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_5]) // ' 5 + { + keystatus[KEYSC_5]=0; + editstatus = 1; + sidemode = 2; + } + */ } extern short brightness; @@ -9986,10 +9986,11 @@ static void GenSearchSprite() char edittext[80]; static int col=0, row=0; 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; - static char *labels[7][3] = { + static char *labels[7][3] = + { {"X-coordinate", "Flags (hex)", "Angle (2048 degrees)"}, {"Y-coordinate", "Shade", "X-Velocity"}, {"Z-coordinate", "Pal", "Y-Velocity"}, @@ -9999,7 +10000,8 @@ static void GenSearchSprite() {"Lotag", "", "Extra"} }; - static int maxval[7][3] = { + static int maxval[7][3] = + { { 524288 , 65536 , 2048 }, { 524288 , 128 , 65536 }, { 8388608 , MAXPALOOKUPS, 65536 }, @@ -10009,7 +10011,8 @@ static void GenSearchSprite() { 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} }; @@ -10073,7 +10076,7 @@ static void GenSearchSprite() if (keystatus[KEYSC_LEFT]) { keystatus[KEYSC_LEFT] = 0; - if (col > 0) + if (col > 0) { printext16(xpos[col],ypos+row*8,11,0,disptext,0); col--; @@ -10113,7 +10116,7 @@ static void GenSearchSprite() keystatus[KEYSC_BS] = keystatus[KEYSC_DELETE] = 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); } diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 117626a1f..5561d4f1e 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -1149,10 +1149,14 @@ int32 CONFIG_GetMapBestTime(char *mapname) if (p) strcpy(m, 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.scripthandle < 0) return -1; - SCRIPT_GetNumber(ud.config.scripthandle, "MapTimes", m, &t); + SCRIPT_GetNumber(ud.config.scripthandle, "MapTimes", p, &t); return t; } @@ -1166,10 +1170,14 @@ int32 CONFIG_SetMapBestTime(char *mapname, int32 tm) if (p) strcpy(m, 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) return -1; - SCRIPT_PutNumber(ud.config.scripthandle, "MapTimes", mapname, tm, false, false); + SCRIPT_PutNumber(ud.config.scripthandle, "MapTimes", p, tm, false, false); return 0; } diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 11a021602..446df3de0 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -264,14 +264,13 @@ enum weapon_indexes { #define IFWITHIN(B,E) if((PN)>=(B) && (PN)<=(E)) -#define deletesprite deletespriteEVENT -void deletespriteEVENT(int s); +#define deletesprite deletesprite_ +void deletesprite_(int s); #define KILLIT(KX) {deletesprite(KX);goto BOLT;} #define IFMOVING if(ssp(i,CLIPMASK0)) #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) diff --git a/polymer/eduke32/source/funct.h b/polymer/eduke32/source/funct.h index 75fbccba9..a968688a9 100644 --- a/polymer/eduke32/source/funct.h +++ b/polymer/eduke32/source/funct.h @@ -179,7 +179,6 @@ extern void lotsofmoneymailpaper(int sp,int n,int pic); extern void guts(int sp,int gtype,int n); extern void setsectinterpolate(int i); extern void clearsectinterpolate(int i); -extern int ifhitsectors(int sectnum); extern int ifhitbyweapon(int sn); extern void moveobjects(void); extern void movecyclers(void); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 686cee61f..218754232 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -3798,7 +3798,7 @@ void displayrest(int smoothratio) else bits |= 1+32; 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); 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); } - 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)*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); if (ud.player_skill > 3 || (ud.multimode > 1 && !GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY))) @@ -13115,9 +13117,11 @@ FRAGBONUS: 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)*38)/10 + ); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); if (g_player[myconnectindex].ps->player_par < playerbest) gametext((320>>2)+71+(clockpad*24),yy+9,"New record!",0,2+8+16); @@ -13143,9 +13147,11 @@ FRAGBONUS: 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)*38)/10 + ); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); yy+=10; } diff --git a/polymer/eduke32/source/grpscan.c b/polymer/eduke32/source/grpscan.c index aaae289fe..66c5cbcd9 100644 --- a/polymer/eduke32/source/grpscan.c +++ b/polymer/eduke32/source/grpscan.c @@ -185,7 +185,7 @@ int ScanGroups(void) } fclose(fp); } - initprintf("Found %d recognized GRP files.\n",i); + initprintf("Found %d recognized GRP %s.\n",i,i>1?"files":"file"); return 0; } initprintf("Found no recognized GRP files!\n"); diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 23d0131e8..6b0961e1d 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -4372,7 +4372,7 @@ cheat_for_port_credits: break; } - for (m=first;m