diff --git a/src/Makefile b/src/Makefile index ebc2c683b..4a5b39eda 100644 --- a/src/Makefile +++ b/src/Makefile @@ -801,30 +801,10 @@ $(OBJDIR)/SRB2.res: win32/Srb2win.rc win32/afxres.h win32/resource.h $(WINDRES) -i $< -O rc $(WINDRESFLAGS) --include-dir=win32 -o $@ -O coff ifdef SDL - ifdef MINGW $(OBJDIR)/win_dbg.o: win32/win_dbg.c $(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@ endif - -ifdef FILTERS -$(OBJDIR)/%.o: $(INTERFACE)/filter/%.c - @echo $< needs deps - $(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@ - -$(OBJDIR)/filters.o: $(INTERFACE)/filter/filters.c $(INTERFACE)/filter/filters.c \ - $(INTERFACE)/filter/filters.h - $(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@ - -$(OBJDIR)/hq2x.o: $(INTERFACE)/filter/hq2x.c $(INTERFACE)/filter/hq2x.c \ - $(INTERFACE)/filter/filters.h - $(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@ - -$(OBJDIR)/lq2x.o: $(INTERFACE)/filter/lq2x.c $(INTERFACE)/filter/lq2x.c \ - $(INTERFACE)/filter/filters.h $(INTERFACE)/filter/interp.h \ - $(INTERFACE)/filter/hq2x.h $(INTERFACE)/filter/lq2x.h - $(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@ -endif endif ############################################################# diff --git a/src/am_map.c b/src/am_map.c index 3c10f710d..64fad1e0e 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -28,14 +28,15 @@ #endif // For use if I do walls with outsides/insides -static const UINT8 REDS = (2*16); +static const UINT8 REDS = (8*16); static const UINT8 REDRANGE = 16; static const UINT8 GRAYS = (1*16); static const UINT8 GRAYSRANGE = 16; -static const UINT8 BROWNS = (15*16); -static const UINT8 YELLOWS = (5*16)+8; -static const UINT8 GREENS = (6*16); -static const UINT8 BLUES = (9*16); +static const UINT8 BROWNS = (3*16); +static const UINT8 YELLOWS = (7*16); +static const UINT8 GREENS = (10*16); +//static const UINT8 CYANS = (13*16); +static const UINT8 BLUES = (14*16); static const UINT8 DBLACK = 31; static const UINT8 DWHITE = 0; @@ -46,7 +47,7 @@ static const UINT8 DWHITE = 0; #define THOKWALLCOLORS REDS #define THOKWALLRANGE REDRANGE #define TSWALLCOLORS DWHITE -#define TSFINISHLINE GRAYS +#define TSFINISHLINE (GREENS + 2) #define TSFOFINFO (BLUES + 4) #define FDWALLCOLORS BROWNS #define CDWALLCOLORS YELLOWS @@ -264,9 +265,6 @@ static void AM_findMinMaxBoundaries(void) max_w = minimapinfo.map_w << MAPBITS; max_h = minimapinfo.map_h << MAPBITS; - max_w = (max_x >>= FRACTOMAPBITS) - (min_x >>= FRACTOMAPBITS); - max_h = (max_y >>= FRACTOMAPBITS) - (min_y >>= FRACTOMAPBITS); - a = FixedDiv(f_w<x, lines[i].v1->y) + FRACUNIT/2) >> FRACBITS; \ @@ -909,28 +940,35 @@ static void AM_drawGrid(INT32 color) static ffloor_t *AM_CompareFOFs(size_t i, ffloor_t *rover, ffloor_t *secondarystore) { ffloor_t *secondaryrover = NULL; + for (; rover; rover = rover->next) { fixed_t rovt1, rovt2; fixed_t rovb1, rovb2; + if (!(rover->flags & FF_EXISTS)) continue; if (!(rover->flags & FF_BLOCKPLAYER)) continue; + SLOPEPARAMS(*rover->t_slope, rovt1, rovt2, *rover->topheight) SLOPEPARAMS(*rover->b_slope, rovb1, rovb2, *rover->bottomheight) + for (secondaryrover = secondarystore; secondaryrover; secondaryrover = secondaryrover->next) { fixed_t sect1, sect2; fixed_t secb1, secb2; + if (!(secondaryrover->flags & FF_EXISTS)) continue; if (!(secondaryrover->flags & FF_BLOCKPLAYER)) continue; if (secondaryrover->secnum == rover->secnum) break; + SLOPEPARAMS(*secondaryrover->t_slope, sect1, sect2, *secondaryrover->topheight) SLOPEPARAMS(*secondaryrover->b_slope, secb1, secb2, *secondaryrover->bottomheight) + if (rovt1 != sect1) continue; if (rovt2 != sect2) @@ -939,8 +977,27 @@ static ffloor_t *AM_CompareFOFs(size_t i, ffloor_t *rover, ffloor_t *secondaryst continue; if (rovb2 != secb2) continue; + + // this is fucking horrible + INT32 damage1, damage2; + INT32 offroad1, offroad2; + INT32 special1, special2; + special1 = GETSECSPECIAL(sectors[rover->secnum].special, 1); + special2 = GETSECSPECIAL(sectors[secondaryrover->secnum].special, 1); + + damage1 = GetDamage(special1); + damage2 = GetDamage(special2); + offroad1 = GetOffroad(special1); + offroad2 = GetOffroad(special2); + + if (damage1 != damage2 + //|| sectors[rover->secnum].friction != sectors[secondaryrover->secnum].friction + || offroad1 != offroad2) + continue; + break; } + if (secondaryrover == NULL) break; } @@ -983,8 +1040,10 @@ static void AM_drawWalls(UINT8 pass) } continue; } + SLOPEPARAMS(lines[i].backsector->f_slope, backf1, backf2, lines[i].backsector->floorheight) SLOPEPARAMS(lines[i].backsector->c_slope, backc1, backc2, lines[i].backsector->ceilingheight) + if ((backf1 == backc1 && backf2 == backc2) // Back is thok barrier || (frontf1 == frontc1 && frontf2 == frontc2)) // Front is thok barrier { @@ -1003,29 +1062,28 @@ static void AM_drawWalls(UINT8 pass) } else { - //dont think kart even supports those idk? - /*if (lines[i].flags & (ML_IMPASSABLE|ML_BLOCKPLAYERS)) + if (lines[i].flags & ML_IMPASSIBLE) // (ML_IMPASSABLE|ML_BLOCKPLAYERS) { if (pass & PASS_SOLID) AM_drawMline(&l, TSWALLCOLORS); // Completely solid course boundary } - else if ((lines[i].flags & ML_MIDSOLID) + else if ((lines[i].flags & ML_EFFECT4) // ML_MIDSOLID && sides[lines->sidenum[0]].midtexture) { if (pass & PASS_SOLID) AM_drawMline(&l, TSWALLCOLORS); // solid midtexture, likely a course boundary - }*/ + } if ((backf1 != frontf1 && abs(backf1 - frontf1) > maxstep) || (backf2 != frontf2 && abs(backf2 - frontf2) > maxstep)) { if (pass & PASS_SOLID) AM_drawMline(&l, TSWALLCOLORS); // floor-wall, likely a course boundary } - /*else if (lines[i].special == 2001) // guh its a sector effect in kart idk how to make it work tbh lol + else if (GETSECSPECIAL(lines[i].frontsector->special, 4) == 10 || GETSECSPECIAL(lines[i].backsector->special, 4) == 10) { if (pass & PASS_SOLID) AM_drawMline(&l, TSFINISHLINE); // finish line - }*/ + } else if (backf1 != frontf1 || backf2 != frontf2) { if (pass & PASS_INTANGIBLE) @@ -1047,54 +1105,52 @@ static void AM_drawWalls(UINT8 pass) } else { - { - ffloor_t *rover = NULL; + ffloor_t *rover = NULL; - if (lines[i].frontsector->ffloors || lines[i].backsector->ffloors) + if (lines[i].frontsector->ffloors || lines[i].backsector->ffloors) + { + if (lines[i].backsector->ffloors == NULL) { - if (lines[i].backsector->ffloors == NULL) + // Check frontside for one solid + for (rover = lines[i].frontsector->ffloors; rover; rover = rover->next) { - // Check frontside for one solid - for (rover = lines[i].frontsector->ffloors; rover; rover = rover->next) - { - if (!(rover->flags & FF_EXISTS)) - continue; - if (!(rover->flags & FF_BLOCKPLAYER)) - continue; - break; - } - } - else if (lines[i].frontsector->ffloors == NULL) - { - // Check backside for one solid - for (rover = lines[i].backsector->ffloors; rover; rover = rover->next) - { - if (!(rover->flags & FF_EXISTS)) - continue; - if (!(rover->flags & FF_BLOCKPLAYER)) - continue; - break; - } - } - else - { - // Check to see if any secnums exist in one but not the other. - rover = AM_CompareFOFs(i, lines[i].frontsector->ffloors, lines[i].backsector->ffloors); - if (rover == NULL) - rover = AM_CompareFOFs(i, lines[i].backsector->ffloors, lines[i].frontsector->ffloors); + if (!(rover->flags & FF_EXISTS)) + continue; + if (!(rover->flags & FF_BLOCKPLAYER)) + continue; + break; } } - if (rover != NULL) + else if (lines[i].frontsector->ffloors == NULL) { - if (pass & PASS_FOF) - AM_drawMline(&l, TSFOFINFO); // a FOF is here but we don't know how to distinguish them yet + // Check backside for one solid + for (rover = lines[i].backsector->ffloors; rover; rover = rover->next) + { + if (!(rover->flags & FF_EXISTS)) + continue; + if (!(rover->flags & FF_BLOCKPLAYER)) + continue; + break; + } } - else if (!am_minigen) + else { - if (pass & PASS_INTANGIBLE) - AM_drawMline(&l, GRIDCOLORS); // likely low-relevance line + // Check to see if any secnums exist in one but not the other. + rover = AM_CompareFOFs(i, lines[i].frontsector->ffloors, lines[i].backsector->ffloors); + if (rover == NULL) + rover = AM_CompareFOFs(i, lines[i].backsector->ffloors, lines[i].frontsector->ffloors); } } + if (rover != NULL) + { + if (pass & PASS_FOF) + AM_drawMline(&l, TSFOFINFO); // a FOF is here but we don't know how to distinguish them yet + } + else if (!am_minigen) + { + if (pass & PASS_INTANGIBLE) + AM_drawMline(&l, GRIDCOLORS); // likely low-relevance line + } } } } @@ -1172,18 +1228,11 @@ static inline void AM_drawPlayers(void) player_t *p; INT32 color = GREENS; - if (!multiplayer) - { - AM_drawLineCharacter(player_arrow, NUMPLYRLINES, 16<mo->angle, DWHITE, plr->mo->x, plr->mo->y); - return; - } - - // multiplayer (how??) for (i = 0; i < MAXPLAYERS; i++) { if (!playeringame[i] || players[i].spectator) continue; - + if (!players[i].mo) continue; @@ -1205,7 +1254,36 @@ static inline void AM_drawThings(UINT8 colors) t = sectors[i].thinglist; while (t) { - AM_drawLineCharacter(thintriangle_guy, NUMTHINTRIANGLEGUYLINES, 16<angle, colors, t->x, t->y); + if (!t->player) + AM_drawLineCharacter(thintriangle_guy, NUMTHINTRIANGLEGUYLINES, 16<angle, colors, t->x, t->y); + t = t->snext; + } + } +} + +static inline void AM_drawSpecialThingsOnly(UINT8 colors) +{ + size_t i; + + for (i = 0; i < numsectors; i++) + { + mobj_t *t = NULL; + + // this is fucking horrible + const INT32 special = GETSECSPECIAL(sectors[i].special, 1); + + if (GetDamage(special) != 0 + //|| sectors[i].friction < ORIG_FRICTION + || GetOffroad(special) != 0) + continue; + + t = sectors[i].thinglist; + while (t) + { + if (t->type == MT_RANDOMITEM + || t->type == MT_STARPOST + || (t->flags & MF_SPRING)) + AM_drawLineCharacter(thintriangle_guy, NUMTHINTRIANGLEGUYLINES, 16<angle, colors, t->x, t->y); t = t->snext; } } @@ -1220,16 +1298,19 @@ static inline void AM_drawCrosshair(UINT8 color) const fixed_t scale = 4<> FRACBITS; fl.a.y = FixedMul(cross_mark[i].a.y, scale) >> FRACBITS; fl.b.x = FixedMul(cross_mark[i].b.x, scale) >> FRACBITS; fl.b.y = FixedMul(cross_mark[i].b.y, scale) >> FRACBITS; + fl.a.x += f_x + (f_w / 2); fl.a.y += f_y + (f_h / 2); fl.b.x += f_x + (f_w / 2); fl.b.y += f_y + (f_h / 2); + AM_drawFline(&fl, color); } } @@ -1250,8 +1331,8 @@ void AM_Drawer(void) AM_clearFB(BACKGROUND); if (draw_grid) AM_drawGrid(GRIDCOLORS); AM_drawWalls(PASS_FOF|PASS_INTANGIBLE|PASS_SOLID); - AM_drawPlayers(); AM_drawThings(THINGCOLORS); + AM_drawPlayers(); if (!followplayer) AM_drawCrosshair(XHAIRCOLORS); } @@ -1307,6 +1388,7 @@ minigen_t *AM_MinimapGenerate(INT32 mul) //AM_clearFB(BACKGROUND); memset(am_buf, 0xff, (f_w*f_h)); + AM_drawSpecialThingsOnly(BACKGROUND); AM_drawWalls(PASS_FOF); AM_drawWalls(PASS_INTANGIBLE); AM_drawWalls(PASS_SOLID); diff --git a/src/k_kart.c b/src/k_kart.c index da484841a..36d3e90c2 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10575,13 +10575,13 @@ static void K_drawKartMinimapIcon(fixed_t objx, fixed_t objy, INT32 hudx, INT32 if (encoremode) amnumxpos = -amnumxpos; - amxpos = amnumxpos + ((hudx + (AutomapPic->width-icon->width)/2)<height-icon->height)/2)<width)-SHORT(icon->width))/2)<height)-SHORT(icon->height))/2)<width / 4)<height / 4)<width) / 4)<height) / 4)<mo, sector)) P_DamageMobj(player->mo, NULL, NULL, 1); break; - case 2: // Damage (Water) // SRB2kart - These three damage types are now offroad sectors - case 3: // Damage (Fire) - case 4: // Damage (Electrical) + // SRB2kart - These three damage types are now offroad sectors + case 2: // Offroad (Weak) + case 3: // Offroad + case 4: // Offroad (Strong) break; case 5: // Spikes // Don't do anything. In Soviet Russia, spikes find you. diff --git a/src/screen.c b/src/screen.c index 1d83a409d..0a9468d25 100644 --- a/src/screen.c +++ b/src/screen.c @@ -455,7 +455,7 @@ void SCR_DisplayTicRate(void) // draw "FPS" if (cv_ticrate.value == 1) V_DrawFixedPatch(306< (benchmark - 5)) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MINT, GTC_CACHE); else if (fps < 20) @@ -474,10 +474,10 @@ void SCR_DisplayTicRate(void) // draw total frame: V_DrawPingNum(x, 190, fpsflags, cap, ticcntcolor); - + x -= digits * 4; - // draw "/" + // draw "/" V_DrawFixedPatch(x< servermaxping)) // only show 2 (warning) if our ping is at a bad level { INT32 dispy = (cv_ticrate.value == 1) ? 165 : ((cv_ticrate.value == 2 || cv_ticrate.value == 4) ? 172 : ((cv_ticrate.value == 3) ? 163 : 181)); // absolute buttpain