From 5401cb58bdfbbeedc148eea0922aab1801099350 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 16 Apr 2025 22:33:21 +0200 Subject: [PATCH 1/8] SHORT ma balls need this for now --- src/k_kart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 0949f0a15..a871f74bc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10565,13 +10565,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)< Date: Thu, 17 Apr 2025 13:30:41 +0200 Subject: [PATCH 2/8] fix automap colours forgor those revert those when i ported RR code over, now they should match up with what they say --- src/am_map.c | 13 +++++++------ src/m_misc.c | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 3c10f710d..08d5bd0db 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 diff --git a/src/m_misc.c b/src/m_misc.c index c6dd4175c..ca4b745ed 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1668,7 +1668,6 @@ failure: #endif //#ifdef USE_PNG } - // ========================================================================== // TRANSLATION FUNCTIONS // ========================================================================== From bcf82970a4b8fbeadb546e7625741065e59624b6 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 17 Apr 2025 13:32:37 +0200 Subject: [PATCH 3/8] fix oopsie in automap bounds calc --- src/am_map.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 08d5bd0db..69f7e4f65 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -265,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<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) @@ -984,8 +989,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 { @@ -1221,16 +1228,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); } } From f7acf7c2d343681955d60d91728f9bbd8d8f8cc2 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 17 Apr 2025 13:48:24 +0200 Subject: [PATCH 4/8] fix up the automap again got the rest of stuff working in a horrible way automap aswell as minigen stuff looks good now --- src/am_map.c | 180 +++++++++++++++++++++++++++++++++++---------------- src/p_spec.c | 7 +- src/screen.c | 10 +-- 3 files changed, 135 insertions(+), 62 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 69f7e4f65..c8172837a 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -898,6 +898,38 @@ static void AM_drawGrid(INT32 color) } } +static INT32 GetDamage(INT32 special) +{ + switch (special) + { + case 1: // Damage (Generic) + return 1; + case 6: // Death Pit (Camera Tilt) + return 6; + case 7: // Death Pit (No Camera Tilt) + return 7; + case 8: // Instant Kill + return 8; + default: + return 0; + } +} + +static INT32 GetOffroad(INT32 special) +{ + switch (special) + { + case 2: // Offroad (Weak) + return 2; + case 3: // Offroad + return 3; + case 4: // Offroad (Strong) + return 4; + default: + return 0; + } +} + #define SLOPEPARAMS(slope, end1, end2, normalheight) \ if (slope) { \ end1 = (P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y) + FRACUNIT/2) >> FRACBITS; \ @@ -945,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; } @@ -1011,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) @@ -1055,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 + } } } } @@ -1180,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; @@ -1213,7 +1254,37 @@ 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_RING + || t->type == MT_WAYPOINT + || (t->flags & MF_SPRING)) + AM_drawLineCharacter(thintriangle_guy, NUMTHINTRIANGLEGUYLINES, 16<angle, colors, t->x, t->y); t = t->snext; } } @@ -1261,8 +1332,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); } @@ -1318,6 +1389,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/p_spec.c b/src/p_spec.c index 7dc7ce6bb..42345e6dd 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3287,9 +3287,10 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers if (roversector || P_MobjReadyToTrigger(player->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 From 8702ddca6085a8bea0fe9a94f7c1f60b3bc10727 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 17 Apr 2025 13:48:38 +0200 Subject: [PATCH 5/8] those do not exist anymore lel --- src/Makefile | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/Makefile b/src/Makefile index 9244c30fd..4c3240dd1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -800,30 +800,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 ############################################################# From f2d1cb56061b94d89873afa951e096580f789b69 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 17 Apr 2025 13:50:26 +0200 Subject: [PATCH 6/8] aaaa != --- src/am_map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index c8172837a..62a3a3da6 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -1272,9 +1272,9 @@ static inline void AM_drawSpecialThingsOnly(UINT8 colors) // this is fucking horrible const INT32 special = GETSECSPECIAL(sectors[i].special, 1); - if (GetDamage(special) == 0 + if (GetDamage(special) != 0 //|| sectors[i].friction < ORIG_FRICTION - || GetOffroad(special) == 0) + || GetOffroad(special) != 0) continue; t = sectors[i].thinglist; From 541c70498d14e3e8f4f003f09ded825b5f93b0cd Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 17 Apr 2025 14:00:55 +0200 Subject: [PATCH 7/8] we dont use MT_WAYPOINT lel just use starposts also remove rings cause duh --- src/am_map.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 62a3a3da6..64fad1e0e 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -1281,8 +1281,7 @@ static inline void AM_drawSpecialThingsOnly(UINT8 colors) while (t) { if (t->type == MT_RANDOMITEM - || t->type == MT_RING - || t->type == MT_WAYPOINT + || t->type == MT_STARPOST || (t->flags & MF_SPRING)) AM_drawLineCharacter(thintriangle_guy, NUMTHINTRIANGLEGUYLINES, 16<angle, colors, t->x, t->y); t = t->snext; From db43b90b707eecd4d0a8fab342278bc89cb377ef Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 17 Apr 2025 20:49:35 +0200 Subject: [PATCH 8/8] Revert "convert fixed to float with multiplication instead of division" i did not intend to push this to testing lel --- src/m_fixed.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/m_fixed.h b/src/m_fixed.h index 8f537b328..3f1acd7ae 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -39,11 +39,9 @@ typedef UINT32 ufixed_t; \brief convert fixed_t into floating number */ -static const float FLOATUNIT = (1.0f / (float)FRACUNIT); - FUNCMATH FUNCINLINE static ATTRINLINE float FixedToFloat(fixed_t x) { - return x * FLOATUNIT; + return x / (float)FRACUNIT; } FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FloatToFixed(float f)