revert minimap bounds calculation back to vanilla karts (fixes https://github.com/Indev450/SRB2Kart-Saturn/issues/201)

This commit is contained in:
Alug committed 2025-09-23 18:52:07 +02:00
1 parent a2d737bfd8
commit b3ef8774b2
2 files changed
+10 -26

No files matched your search

+1 -1
View File
@@ -3530,7 +3530,7 @@ static void K_drawKartMinimapIcon(fixed_t objx, fixed_t objy, INT32 hudx, INT32
return; // no pic, just get outta here
}
amnumxpos = (FixedMul(objx, minimapinfo.zoom) - minimapinfo.offs_x);
amnumxpos = (FixedMul(objx, minimapinfo.zoom) - minimapinfo.offs_x);
amnumypos = -(FixedMul(objy, minimapinfo.zoom) - minimapinfo.offs_y);
if (encoremode)
+9 -25
View File
@@ -2417,9 +2417,6 @@ struct minimapinfo minimapinfo;
static void P_InitMinimapInfo(void)
{
lumpnum_t lumpnum;
fixed_t a;
fixed_t b;
node_t *bsp = &nodes[numnodes-1];
if (minimapinfo.minimap_pic)
@@ -2449,30 +2446,17 @@ static void P_InitMinimapInfo(void)
// it's because mapwidth and height would otherwise overflow for maps larger than half the size possible...
// map boundaries and sizes will ALWAYS be whole numbers thankfully
// later calculations take into consideration that these are actually not in terms of FRACUNIT though
minimapinfo.map_w = (minimapinfo.max_x >>= FRACBITS) - (minimapinfo.min_x >>= FRACBITS);
minimapinfo.map_h = (minimapinfo.max_y >>= FRACBITS) - (minimapinfo.min_y >>= FRACBITS);
minimapinfo.min_x >>= FRACBITS;
minimapinfo.max_x >>= FRACBITS;
minimapinfo.min_y >>= FRACBITS;
minimapinfo.max_y >>= FRACBITS;
minimapinfo.map_w = minimapinfo.max_x - minimapinfo.min_x;
minimapinfo.map_h = minimapinfo.max_y - minimapinfo.min_y;
minimapinfo.minimap_w = minimapinfo.minimap_h = 100;
minimapinfo.minimap_w = FixedDiv(minimapinfo.minimap_pic->width, minimapinfo.map_w);
minimapinfo.minimap_h = FixedDiv(minimapinfo.minimap_pic->height, minimapinfo.map_h);
a = FixedDiv(minimapinfo.minimap_w<<FRACBITS, minimapinfo.map_w<<4);
b = FixedDiv(minimapinfo.minimap_h<<FRACBITS, minimapinfo.map_h<<4);
if (a < b)
{
minimapinfo.minimap_h = FixedMul(a, minimapinfo.map_h)>>(FRACBITS-4);
minimapinfo.zoom = a;
}
else
{
if (a != b)
{
minimapinfo.minimap_w = FixedMul(b, minimapinfo.map_w)>>(FRACBITS-4);
}
minimapinfo.zoom = b;
}
minimapinfo.zoom >>= (FRACBITS-4);
minimapinfo.zoom -= (minimapinfo.zoom/20);
minimapinfo.zoom = FixedMul(min(minimapinfo.minimap_w, minimapinfo.minimap_h), FRACUNIT-FRACUNIT/20);
// These should always be small enough to be bitshift back right now
minimapinfo.offs_x = FixedMul((minimapinfo.min_x + minimapinfo.map_w/2) << FRACBITS, minimapinfo.zoom);