diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index 72d2810f4..99b55e5c5 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -448,8 +448,8 @@ DoShadows(uspritetype * tsp, int viewz) xrepeat = max(xrepeat - ground_dist - view_dist, 4); yrepeat = max(yrepeat - ground_dist - view_dist, 4); - xrepeat = min(xrepeat, 255); - yrepeat = min(yrepeat, 255); + xrepeat = min(xrepeat, short(255)); + yrepeat = min(yrepeat, short(255)); New->xrepeat = xrepeat; New->yrepeat = yrepeat; diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index ed69d3122..f19fee6f2 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -3812,8 +3812,8 @@ int32_t app_main(int32_t argc, char const * const * argv) if (strlen(arg) > 1) Skill = atoi(&arg[1])-1; - Skill = max(Skill,0); - Skill = min(Skill,3); + Skill = max(Skill,short(0)); + Skill = min(Skill,short(3)); } else if (Bstrncasecmp(arg, "commbat", 7) == 0) { diff --git a/source/sw/src/hornet.cpp b/source/sw/src/hornet.cpp index d9bb902bc..f3ef02335 100644 --- a/source/sw/src/hornet.cpp +++ b/source/sw/src/hornet.cpp @@ -404,8 +404,8 @@ int DoHornetMatchPlayerZ(short SpriteNum) u->sz = bound; } - u->sz = min(u->sz, loz - u->floor_dist); - u->sz = max(u->sz, hiz + u->ceiling_dist); + u->sz = min(long(u->sz), long(loz - u->floor_dist)); + u->sz = max(long(u->sz), long(hiz + u->ceiling_dist)); u->Counter = (u->Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047; sp->z = u->sz + ((HORNET_BOB_AMT * (long)sintable[u->Counter]) >> 14); diff --git a/source/sw/src/menus.cpp b/source/sw/src/menus.cpp index 107450ee5..3a38ed046 100644 --- a/source/sw/src/menus.cpp +++ b/source/sw/src/menus.cpp @@ -3636,8 +3636,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_MOUSESENSEMAX-1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_MOUSESENSEMAX-1)); slidersettings[sldr_mouse] = offset; @@ -3652,8 +3652,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_SNDFXVOLMAX-1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_SNDFXVOLMAX-1)); slidersettings[sldr_sndfxvolume] = offset; gs.SoundVolume = FX_MIN + (offset * VOL_MUL); @@ -3666,8 +3666,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_MUSICVOLMAX-1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_MUSICVOLMAX-1)); slidersettings[sldr_musicvolume] = offset; gs.MusicVolume = MUSIC_MIN + (offset * VOL_MUL); @@ -3689,8 +3689,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) ////DSPRINTF(ds,"BorderNum %d",gs.BorderNum); //MONO_PRINT(ds); - offset = max(offset, 0); - offset = min(offset, SLDR_SCRSIZEMAX - 1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_SCRSIZEMAX - 1)); bnum = offset; @@ -3712,8 +3712,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_BRIGHTNESSMAX - 1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_BRIGHTNESSMAX - 1)); slidersettings[sldr_brightness] = offset; if (gs.Brightness != offset) @@ -3730,8 +3730,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_BORDERTILEMAX - 1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_BORDERTILEMAX - 1)); slidersettings[sldr_bordertile] = offset; if (gs.BorderTile != offset) @@ -3749,8 +3749,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_GAMETYPEMAX - 1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_GAMETYPEMAX - 1)); slidersettings[sldr_gametype] = offset; extra_text = gametype[offset]; @@ -3767,8 +3767,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_NETLEVELMAX - 1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_NETLEVELMAX - 1)); slidersettings[sldr_netlevel] = offset; // Show the currently selected level on next line @@ -3786,8 +3786,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_MONSTERSMAX - 1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_MONSTERSMAX - 1)); slidersettings[sldr_monsters] = offset; extra_text = monsterskills[offset]; @@ -3802,8 +3802,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_KILLLIMITMAX - 1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_KILLLIMITMAX - 1)); slidersettings[sldr_killlimit] = offset; if (offset == 0) @@ -3826,8 +3826,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_TIMELIMITMAX - 1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_TIMELIMITMAX - 1)); slidersettings[sldr_timelimit] = offset; if (offset == 0) @@ -3850,8 +3850,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, SLDR_PLAYERCOLORMAX - 1); + offset = max(offset, short(0)); + offset = min(offset, short(SLDR_PLAYERCOLORMAX - 1)); slidersettings[sldr_playercolor] = offset; extra_text = playercolors[offset]; @@ -3913,8 +3913,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, barwidth-1); + offset = max(offset, short(0)); + offset = min(offset, short(barwidth-1)); if (slidersettings[item->slider] != offset) { @@ -3934,8 +3934,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, barwidth-1); + offset = max(offset, short(0)); + offset = min(offset, short(barwidth-1)); if (slidersettings[item->slider] != offset) { @@ -3958,8 +3958,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, barwidth-1); + offset = max(offset, short(0)); + offset = min(offset, short(barwidth-1)); if (slidersettings[item->slider] != offset) { @@ -3983,8 +3983,8 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) if (TEST(item->flags, mf_disabled)) break; - offset = max(offset, 0); - offset = min(offset, barwidth-1); + offset = max(offset, short(0)); + offset = min(offset, short(barwidth-1)); if (slidersettings[item->slider] != offset) { @@ -4024,7 +4024,7 @@ MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw) knobx = x; // Draw the in between sections - for (i = 0; i < min(barwidth,MAX_SLDR_WIDTH); i++) + for (i = 0; i < min(barwidth, short(MAX_SLDR_WIDTH)); i++) { rotatesprite(x << 16, y << 16, MZ, 0, pic_slidebar, shade, 0, MenuDrawFlags, 0, 0, xdim - 1, ydim - 1); x += tilesiz[pic_slidebar].x; diff --git a/source/sw/src/panel.cpp b/source/sw/src/panel.cpp index 98e21df0e..3ea4d9d02 100644 --- a/source/sw/src/panel.cpp +++ b/source/sw/src/panel.cpp @@ -7278,7 +7278,7 @@ pWeaponBob(PANEL_SPRITEp psp, short condition) bobvel = FindDistance2D(pp->xvect, pp->yvect) >> 15; bobvel = bobvel + DIV4(bobvel); - bobvel = min(bobvel, 128); + bobvel = min(bobvel, short(128)); if (condition) { diff --git a/source/sw/src/sector.cpp b/source/sw/src/sector.cpp index e47b9dcdf..6b1e723ac 100644 --- a/source/sw/src/sector.cpp +++ b/source/sw/src/sector.cpp @@ -162,10 +162,10 @@ WallSetup(void) wall[i].picnum = FAF_MIRROR_PIC+1; // get map min and max coordinates - x_min_bound = min(wp->x, x_min_bound); - y_min_bound = min(wp->y, y_min_bound); - x_max_bound = max(wp->x, x_max_bound); - y_max_bound = max(wp->y, y_max_bound); + x_min_bound = min(TrackerCast(wp->x), x_min_bound); + y_min_bound = min(TrackerCast(wp->y), y_min_bound); + x_max_bound = max(TrackerCast(wp->x), x_max_bound); + y_max_bound = max(TrackerCast(wp->y), y_max_bound); // this overwrites the lotag so it needs to be called LAST - its down there // SetupWallForBreak(wp);