- fixed the remaining warnings.

This commit is contained in:
Christoph Oelckers 2021-05-12 17:57:36 +02:00
parent cf22a70d82
commit cb2bc7967a
13 changed files with 47 additions and 47 deletions

View file

@ -192,8 +192,8 @@ void FNotifyBuffer::Draw()
double nfscale = (generic_ui? 0.7 : NotifyFontScale); double nfscale = (generic_ui? 0.7 : NotifyFontScale);
double scale = 1 / ( * con_notifyscale); double scale = 1 / ( * con_notifyscale);
int line = Top + font->GetDisplacement() / nfscale; double line = Top + font->GetDisplacement() / nfscale;
int lineadv = font->GetHeight () / nfscale; double lineadv = font->GetHeight () / nfscale;
for (unsigned i = 0; i < Text.Size(); ++ i) for (unsigned i = 0; i < Text.Size(); ++ i)
{ {

View file

@ -481,7 +481,7 @@ int HWLinePortal::ClipSeg(walltype *seg, const DVector3 &viewpos)
int HWLinePortal::ClipSector(sectortype *sub) int HWLinePortal::ClipSector(sectortype *sub)
{ {
// this seg is completely behind the mirror // this seg is completely behind the mirror
for (unsigned int i = 0; i<sub->wallnum; i++) for (int i = 0; i<sub->wallnum; i++)
{ {
if (PointOnLineSide(WallStart(&wall[sub->wallptr]), line) == 0) return PClip_Inside; if (PointOnLineSide(WallStart(&wall[sub->wallptr]), line) == 0) return PClip_Inside;
} }

View file

@ -274,7 +274,7 @@ void BuildTiles::MakeCanvas(int tilenum, int width, int height)
{ {
auto canvas = ValidateCustomTile(tilenum, ReplacementType::Canvas); auto canvas = ValidateCustomTile(tilenum, ReplacementType::Canvas);
canvas->SetSize(width*4, height*4); canvas->SetSize(width*4, height*4);
canvas->SetDisplaySize(width, height); canvas->SetDisplaySize((float)width, (float)height);
canvas->GetTexture()->SetSize(width * 4, height * 4); canvas->GetTexture()->SetSize(width * 4, height * 4);
static_cast<FCanvasTexture*>(canvas->GetTexture())->aspectRatio = (float)width / height; static_cast<FCanvasTexture*>(canvas->GetTexture())->aspectRatio = (float)width / height;
} }
@ -291,7 +291,7 @@ void BuildTiles::MakeCanvas(int tilenum, int width, int height)
int BuildTiles::LoadArtFile(const char *fn, const char *mapname, int firsttile) int BuildTiles::LoadArtFile(const char *fn, const char *mapname, int firsttile)
{ {
auto old = FindFile(fn); unsigned old = FindFile(fn);
if (old >= ArtFiles.Size()) // Do not process if already loaded. if (old >= ArtFiles.Size()) // Do not process if already loaded.
{ {
FileReader fr = fileSystem.OpenFileReader(fn); FileReader fr = fileSystem.OpenFileReader(fn);

View file

@ -440,7 +440,7 @@ bool PreBindTexture(FRenderState* state, FGameTexture*& tex, EUpscaleFlags& flag
flags |= (((pick.tintFlags & TINTF_BLENDMASK) >> 6) + 1) & TextureManipulation::BlendMask; flags |= (((pick.tintFlags & TINTF_BLENDMASK) >> 6) + 1) & TextureManipulation::BlendMask;
} }
} }
addcol.W = flags; addcol.W = (float)flags;
if ((pick.translation & 0x80000000) && hw_shadeinterpolate) addcol.W += 16384; // hijack a free bit in here. if ((pick.translation & 0x80000000) && hw_shadeinterpolate) addcol.W += 16384; // hijack a free bit in here.
state->SetTextureColors(&modcol.X, &addcol.X, &blendcol.X); state->SetTextureColors(&modcol.X, &addcol.X, &blendcol.X);
} }

View file

@ -4461,7 +4461,7 @@ void handle_se27(DDukeActor* actor)
{ {
if (cansee(s->x, s->y, s->z, s->sectnum, ps[p].posx, ps[p].posy, ps[p].posz, ps[p].cursectnum)) if (cansee(s->x, s->y, s->z, s->sectnum, ps[p].posx, ps[p].posy, ps[p].posz, ps[p].cursectnum))
{ {
if (x < (unsigned)sh) if (x < sh)
{ {
ud.cameraactor = actor; ud.cameraactor = actor;
t[0] = 999; t[0] = 999;

View file

@ -232,7 +232,7 @@ void drawoverlays(double smoothratio)
// loogies courtesy of being snotted on // loogies courtesy of being snotted on
if (pp->loogcnt > 0 && !isRR()) if (pp->loogcnt > 0 && !isRR())
{ {
V_AddBlend(0, 63, 0, (pp->loogcnt >> 1), blend); V_AddBlend(0, 63, 0, float(pp->loogcnt >> 1), blend);
} }
if (blend[3]) if (blend[3])
{ {

View file

@ -300,7 +300,7 @@ int ConCompiler::getkeyword(const char* text)
while (min <= max) while (min <= max)
{ {
int mid = (min + max) >> 1; auto mid = (min + max) >> 1;
const int comp = strcmp(text, cmdList[mid].cmd); const int comp = strcmp(text, cmdList[mid].cmd);
if (comp == 0) if (comp == 0)

View file

@ -633,7 +633,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
case PLAYER_ONE_EIGHTY_COUNT: case PLAYER_ONE_EIGHTY_COUNT:
if (bSet) ps[iPlayer].angle.spin = lValue; if (bSet) ps[iPlayer].angle.spin = lValue;
else SetGameVarID(lVar2, ps[iPlayer].angle.spin, sActor, sPlayer); else SetGameVarID(lVar2, int(ps[iPlayer].angle.spin), sActor, sPlayer);
break; break;
case PLAYER_CHEAT_PHASE: case PLAYER_CHEAT_PHASE:
@ -987,11 +987,11 @@ void DoWall(char bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, s
else SetGameVarID(lVar2, wall[iWall].yrepeat, sActor, sPlayer); else SetGameVarID(lVar2, wall[iWall].yrepeat, sActor, sPlayer);
break; break;
case WALL_XPANNING: case WALL_XPANNING:
if (bSet) wall[iWall].xpan_ = lValue; if (bSet) wall[iWall].xpan_ = (float)(lValue & 255);
else SetGameVarID(lVar2, wall[iWall].xpan(), sActor, sPlayer); else SetGameVarID(lVar2, wall[iWall].xpan(), sActor, sPlayer);
break; break;
case WALL_YPANNING: case WALL_YPANNING:
if (bSet) wall[iWall].ypan_ = lValue; if (bSet) wall[iWall].ypan_ = (float)(lValue & 255);
else SetGameVarID(lVar2, wall[iWall].ypan(), sActor, sPlayer); else SetGameVarID(lVar2, wall[iWall].ypan(), sActor, sPlayer);
break; break;
case WALL_LOTAG: case WALL_LOTAG:
@ -1077,11 +1077,11 @@ void DoSector(char bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
else SetGameVarID(lVar2, sector[iSector].ceilingpal, sActor, sPlayer); else SetGameVarID(lVar2, sector[iSector].ceilingpal, sActor, sPlayer);
break; break;
case SECTOR_CEILINGXPANNING: case SECTOR_CEILINGXPANNING:
if (bSet) sector[iSector].ceilingxpan_ = lValue; if (bSet) sector[iSector].ceilingxpan_ = (float)(lValue & 255);
else SetGameVarID(lVar2, sector[iSector].ceilingxpan(), sActor, sPlayer); else SetGameVarID(lVar2, sector[iSector].ceilingxpan(), sActor, sPlayer);
break; break;
case SECTOR_CEILINGYPANNING: case SECTOR_CEILINGYPANNING:
if (bSet) sector[iSector].ceilingypan_ = lValue; if (bSet) sector[iSector].ceilingypan_ = (float)(lValue & 255);
else SetGameVarID(lVar2, sector[iSector].ceilingypan(), sActor, sPlayer); else SetGameVarID(lVar2, sector[iSector].ceilingypan(), sActor, sPlayer);
break; break;
case SECTOR_FLOORPICNUM: case SECTOR_FLOORPICNUM:
@ -1101,11 +1101,11 @@ void DoSector(char bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
else SetGameVarID(lVar2, sector[iSector].floorpal, sActor, sPlayer); else SetGameVarID(lVar2, sector[iSector].floorpal, sActor, sPlayer);
break; break;
case SECTOR_FLOORXPANNING: case SECTOR_FLOORXPANNING:
if (bSet) sector[iSector].floorxpan_ = lValue; if (bSet) sector[iSector].floorxpan_ = (float)(lValue & 255);
else SetGameVarID(lVar2, sector[iSector].floorxpan(), sActor, sPlayer); else SetGameVarID(lVar2, sector[iSector].floorxpan(), sActor, sPlayer);
break; break;
case SECTOR_FLOORYPANNING: case SECTOR_FLOORYPANNING:
if (bSet) sector[iSector].floorypan_ = lValue; if (bSet) sector[iSector].floorypan_ = (float)(lValue & 255);
else SetGameVarID(lVar2, sector[iSector].floorypan(), sActor, sPlayer); else SetGameVarID(lVar2, sector[iSector].floorypan(), sActor, sPlayer);
break; break;
case SECTOR_VISIBILITY: case SECTOR_VISIBILITY:
@ -1698,7 +1698,7 @@ int ParseState::parse(void)
ps[connecthead].max_actors_killed++; //revive the egg ps[connecthead].max_actors_killed++; //revive the egg
g_ac->temp_data[5] = 0; g_ac->temp_data[5] = 0;
} }
g_sp->pal = g_ac->tempang; g_sp->pal = (uint8_t)g_ac->tempang;
} }
g_ac->tempang = 0; g_ac->tempang = 0;
break; break;
@ -2194,7 +2194,7 @@ int ParseState::parse(void)
break; break;
case concmd_clipdist: case concmd_clipdist:
insptr++; insptr++;
g_sp->clipdist = (short) *insptr; g_sp->clipdist = (uint8_t) *insptr;
insptr++; insptr++;
break; break;
case concmd_cstat: case concmd_cstat:

View file

@ -369,7 +369,7 @@ void hud_input(int plnum)
{ {
int j = gs.max_player_health - p->GetActor()->s->extra; int j = gs.max_player_health - p->GetActor()->s->extra;
if ((unsigned int)p->firstaid_amount > j) if (p->firstaid_amount > j)
{ {
p->firstaid_amount -= j; p->firstaid_amount -= j;
p->GetActor()->s->extra = gs.max_player_health; p->GetActor()->s->extra = gs.max_player_health;
@ -568,13 +568,13 @@ static double motoApplyTurn(player_struct* p, ControlInfo* const hidInput, bool
if (kbdLeft || hidInput->mouseturnx < 0 || hidInput->dyaw < 0) if (kbdLeft || hidInput->mouseturnx < 0 || hidInput->dyaw < 0)
{ {
p->TiltStatus -= factor; p->TiltStatus -= (float)factor;
if (p->TiltStatus < -10) if (p->TiltStatus < -10)
p->TiltStatus = -10; p->TiltStatus = -10;
} }
else if (kbdRight || hidInput->mouseturnx > 0 || hidInput->dyaw > 0) else if (kbdRight || hidInput->mouseturnx > 0 || hidInput->dyaw > 0)
{ {
p->TiltStatus += factor; p->TiltStatus += (float)factor;
if (p->TiltStatus > 10) if (p->TiltStatus > 10)
p->TiltStatus = 10; p->TiltStatus = 10;
} }
@ -589,7 +589,7 @@ static double motoApplyTurn(player_struct* p, ControlInfo* const hidInput, bool
if (kbdLeft || p->moto_drink < 0 || hidInput->mouseturnx < 0 || hidInput->dyaw < 0) if (kbdLeft || p->moto_drink < 0 || hidInput->mouseturnx < 0 || hidInput->dyaw < 0)
{ {
updateTurnHeldAmt(factor); updateTurnHeldAmt(factor);
p->TiltStatus -= factor; p->TiltStatus -= (float)factor;
if (p->TiltStatus < -10) if (p->TiltStatus < -10)
p->TiltStatus = -10; p->TiltStatus = -10;
@ -607,7 +607,7 @@ static double motoApplyTurn(player_struct* p, ControlInfo* const hidInput, bool
if (kbdRight || p->moto_drink > 0 || hidInput->mouseturnx > 0 || hidInput->dyaw > 0) if (kbdRight || p->moto_drink > 0 || hidInput->mouseturnx > 0 || hidInput->dyaw > 0)
{ {
updateTurnHeldAmt(factor); updateTurnHeldAmt(factor);
p->TiltStatus += factor; p->TiltStatus += (float)factor;
if (p->TiltStatus > 10) if (p->TiltStatus > 10)
p->TiltStatus = 10; p->TiltStatus = 10;
@ -627,9 +627,9 @@ static double motoApplyTurn(player_struct* p, ControlInfo* const hidInput, bool
resetTurnHeldAmt(); resetTurnHeldAmt();
if (p->TiltStatus > 0) if (p->TiltStatus > 0)
p->TiltStatus -= factor; p->TiltStatus -= (float)factor;
else if (p->TiltStatus < 0) else if (p->TiltStatus < 0)
p->TiltStatus += factor; p->TiltStatus += (float)factor;
} }
} }
@ -663,7 +663,7 @@ static double boatApplyTurn(player_struct *p, ControlInfo* const hidInput, bool
if (!p->NotOnWater) if (!p->NotOnWater)
{ {
p->TiltStatus -= factor; p->TiltStatus -= (float)factor;
if (p->TiltStatus < -10) if (p->TiltStatus < -10)
p->TiltStatus = -10; p->TiltStatus = -10;
} }
@ -684,7 +684,7 @@ static double boatApplyTurn(player_struct *p, ControlInfo* const hidInput, bool
if (!p->NotOnWater) if (!p->NotOnWater)
{ {
p->TiltStatus += factor; p->TiltStatus += (float)factor;
if (p->TiltStatus > 10) if (p->TiltStatus > 10)
p->TiltStatus = 10; p->TiltStatus = 10;
} }
@ -704,9 +704,9 @@ static double boatApplyTurn(player_struct *p, ControlInfo* const hidInput, bool
resetTurnHeldAmt(); resetTurnHeldAmt();
if (p->TiltStatus > 0) if (p->TiltStatus > 0)
p->TiltStatus -= factor; p->TiltStatus -= (float)factor;
else if (p->TiltStatus < 0) else if (p->TiltStatus < 0)
p->TiltStatus += factor; p->TiltStatus += (float)factor;
} }
} }
else if (!p->NotOnWater) else if (!p->NotOnWater)
@ -714,9 +714,9 @@ static double boatApplyTurn(player_struct *p, ControlInfo* const hidInput, bool
resetTurnHeldAmt(); resetTurnHeldAmt();
if (p->TiltStatus > 0) if (p->TiltStatus > 0)
p->TiltStatus -= factor; p->TiltStatus -= (float)factor;
else if (p->TiltStatus < 0) else if (p->TiltStatus < 0)
p->TiltStatus += factor; p->TiltStatus += (float)factor;
} }
if (fabs(p->TiltStatus) < factor) if (fabs(p->TiltStatus) < factor)
@ -747,12 +747,12 @@ static void processVehicleInput(player_struct *p, ControlInfo* const hidInput, I
if (p->OnMotorcycle) if (p->OnMotorcycle)
{ {
input.avel = motoApplyTurn(p, hidInput, kbdLeft, kbdRight, scaleAdjust); input.avel = (float)motoApplyTurn(p, hidInput, kbdLeft, kbdRight, scaleAdjust);
if (p->moto_underwater) p->MotoSpeed = 0; if (p->moto_underwater) p->MotoSpeed = 0;
} }
else else
{ {
input.avel = boatApplyTurn(p, hidInput, kbdLeft, kbdRight, scaleAdjust); input.avel = (float)boatApplyTurn(p, hidInput, kbdLeft, kbdRight, scaleAdjust);
} }
loc.fvel = clamp(xs_CRoundToInt(p->MotoSpeed), -(MAXVELMOTO >> 3), MAXVELMOTO); loc.fvel = clamp(xs_CRoundToInt(p->MotoSpeed), -(MAXVELMOTO >> 3), MAXVELMOTO);

View file

@ -521,7 +521,7 @@ void footprints(int snum)
default: fprint = spawn(actor, TILE_FOOTPRINTS4); break; default: fprint = spawn(actor, TILE_FOOTPRINTS4); break;
} }
fprint->s->pal = p->footprintpal; fprint->s->pal = p->footprintpal;
fprint->s->shade = p->footprintshade; fprint->s->shade = (int8_t)p->footprintshade;
} }
} }
} }

View file

@ -73,7 +73,7 @@ void renderView(spritetype* playersprite, int sectnum, int x, int y, int z, bina
if (!testnewrenderer) if (!testnewrenderer)
{ {
// do screen rotation. // do screen rotation.
renderSetRollAngle(rotscrnang.asbuildf()); renderSetRollAngle((float)rotscrnang.asbuildf());
se40code(x, y, z, a, h, smoothratio); se40code(x, y, z, a, h, smoothratio);
renderMirror(x, y, z, a, h, smoothratio); renderMirror(x, y, z, a, h, smoothratio);
@ -108,7 +108,7 @@ void GameInterface::UpdateCameras(double smoothratio)
if (camsprite->GetOwner() && dist(p->GetActor(), camsprite) < VIEWSCREEN_ACTIVE_DISTANCE) if (camsprite->GetOwner() && dist(p->GetActor(), camsprite) < VIEWSCREEN_ACTIVE_DISTANCE)
{ {
auto tex = tileGetTexture(sp->picnum); auto tex = tileGetTexture(sp->picnum);
TileFiles.MakeCanvas(TILE_VIEWSCR, tex->GetDisplayWidth(), tex->GetDisplayHeight()); TileFiles.MakeCanvas(TILE_VIEWSCR, (int)tex->GetDisplayWidth(), (int)tex->GetDisplayHeight());
auto canvas = renderSetTarget(TILE_VIEWSCR); auto canvas = renderSetTarget(TILE_VIEWSCR);
if (!canvas) return; if (!canvas) return;
@ -122,7 +122,7 @@ void GameInterface::UpdateCameras(double smoothratio)
{ {
// Note: no ROR or camera here - Polymost has no means to detect these things before rendering the scene itself. // Note: no ROR or camera here - Polymost has no means to detect these things before rendering the scene itself.
renderDrawRoomsQ16(camera->x, camera->y, camera->z, ang.asq16(), IntToFixed(camera->shade), camera->sectnum); // why 'shade'...? renderDrawRoomsQ16(camera->x, camera->y, camera->z, ang.asq16(), IntToFixed(camera->shade), camera->sectnum); // why 'shade'...?
fi.animatesprites(pm_tsprite, pm_spritesortcnt, camera->x, camera->y, ang.asbuild(), smoothratio); fi.animatesprites(pm_tsprite, pm_spritesortcnt, camera->x, camera->y, ang.asbuild(), (int)smoothratio);
renderDrawMasks(); renderDrawMasks();
} }
else else
@ -299,7 +299,7 @@ void displayrooms(int snum, double smoothratio)
cang = buildang(interpolatedangle(ud.cameraactor->tempang, s->ang, smoothratio)); cang = buildang(interpolatedangle(ud.cameraactor->tempang, s->ang, smoothratio));
auto bh = buildhoriz(s->yvel); auto bh = buildhoriz(s->yvel);
renderView(s, s->sectnum, s->x, s->y, s->z - (4 << 8), cang, bh, buildang(0), smoothratio); renderView(s, s->sectnum, s->x, s->y, s->z - (4 << 8), cang, bh, buildang(0), (int)smoothratio);
} }
else else
{ {
@ -410,12 +410,12 @@ void displayrooms(int snum, double smoothratio)
if (isRR() && sector[sect].lotag == 848 && !testnewrenderer) if (isRR() && sector[sect].lotag == 848 && !testnewrenderer)
{ {
renderSetRollAngle(rotscrnang.asbuildf()); renderSetRollAngle((float)rotscrnang.asbuildf());
geometryEffect(cposx, cposy, cposz, cang, choriz, sect, smoothratio); geometryEffect(cposx, cposy, cposz, cang, choriz, sect, (int)smoothratio);
} }
else else
{ {
renderView(viewer, sect, cposx, cposy, cposz, cang, choriz, rotscrnang, smoothratio); renderView(viewer, sect, cposx, cposy, cposz, cang, choriz, rotscrnang, (int)smoothratio);
} }
} }
//GLInterface.SetMapFog(false); //GLInterface.SetMapFog(false);

View file

@ -1090,10 +1090,10 @@ void operateactivators(int low, int plnum)
{ {
p[5] = !p[5]; p[5] = !p[5];
sector[p[0]].floorshade = sector[p[0]].ceilingshade = p[3]; sector[p[0]].floorshade = sector[p[0]].ceilingshade = (int8_t)p[3];
wal = &wall[sector[p[0]].wallptr]; wal = &wall[sector[p[0]].wallptr];
for (j = sector[p[0]].wallnum; j > 0; j--, wal++) for (j = sector[p[0]].wallnum; j > 0; j--, wal++)
wal->shade = p[3]; wal->shade = (int8_t)p[3];
} }
} }
@ -1267,8 +1267,8 @@ void moveclouds(double smoothratio)
cloudclock = myclock + 6; cloudclock = myclock + 6;
// cloudx/y were an array, but all entries were always having the same value so a single pair is enough. // cloudx/y were an array, but all entries were always having the same value so a single pair is enough.
cloudx += ps[screenpeek].angle.ang.fcos() * 0.5f; cloudx += (float)ps[screenpeek].angle.ang.fcos() * 0.5f;
cloudy += ps[screenpeek].angle.ang.fsin() * 0.5f; cloudy += (float)ps[screenpeek].angle.ang.fsin() * 0.5f;
for (int i = 0; i < numclouds; i++) for (int i = 0; i < numclouds; i++)
{ {
if (!testnewrenderer) if (!testnewrenderer)

View file

@ -84,8 +84,8 @@ void GLInstance::Draw(EDrawType type, size_t start, size_t count)
{ {
assert (BufferLock > 0); assert (BufferLock > 0);
applyMapFog(); applyMapFog();
renderState.vindex = start; renderState.vindex = (int)start;
renderState.vcount = count; renderState.vcount = (int)count;
renderState.primtype = type; renderState.primtype = type;
rendercommands.Push(renderState); rendercommands.Push(renderState);
clearMapFog(); clearMapFog();