- silenced some warnings.

This commit is contained in:
Christoph Oelckers 2020-10-07 16:02:49 +02:00
parent 38ddbfe65f
commit 53c3a6fc9b
4 changed files with 25 additions and 27 deletions

View file

@ -461,10 +461,10 @@ void F2DDrawer::AddTexture(FGameTexture* img, DrawParms& parms)
if (x < (double)parms.lclip || y < (double)parms.uclip || x + w >(double)parms.rclip || y + h >(double)parms.dclip) if (x < (double)parms.lclip || y < (double)parms.uclip || x + w >(double)parms.rclip || y + h >(double)parms.dclip)
{ {
dg.mScissor[0] = parms.lclip + offset.X; dg.mScissor[0] = parms.lclip + int(offset.X);
dg.mScissor[1] = parms.uclip + offset.Y; dg.mScissor[1] = parms.uclip + int(offset.Y);
dg.mScissor[2] = parms.rclip + offset.X; dg.mScissor[2] = parms.rclip + int(offset.X);
dg.mScissor[3] = parms.dclip + offset.Y; dg.mScissor[3] = parms.dclip + int(offset.Y);
dg.mFlags |= DTF_Scissor; dg.mFlags |= DTF_Scissor;
} }
else else
@ -502,10 +502,10 @@ void F2DDrawer::AddTexture(FGameTexture* img, DrawParms& parms)
double x4 = parms.x + xscale * (xd2 * cosang + yd2 * sinang); double x4 = parms.x + xscale * (xd2 * cosang + yd2 * sinang);
double y4 = parms.y - yscale * (xd2 * sinang - yd2 * cosang); double y4 = parms.y - yscale * (xd2 * sinang - yd2 * cosang);
dg.mScissor[0] = parms.lclip + offset.X; dg.mScissor[0] = parms.lclip + int(offset.X);
dg.mScissor[1] = parms.uclip + offset.Y; dg.mScissor[1] = parms.uclip + int(offset.Y);
dg.mScissor[2] = parms.rclip + offset.X; dg.mScissor[2] = parms.rclip + int(offset.X);
dg.mScissor[3] = parms.dclip + offset.Y; dg.mScissor[3] = parms.dclip + int(offset.Y);
dg.mFlags |= DTF_Scissor; dg.mFlags |= DTF_Scissor;
dg.mVertCount = 4; dg.mVertCount = 4;
@ -571,10 +571,10 @@ void F2DDrawer::AddShape(FGameTexture* img, DShape2D* shape, DrawParms& parms)
} }
if (minx < (double)parms.lclip || miny < (double)parms.uclip || maxx >(double)parms.rclip || maxy >(double)parms.dclip) if (minx < (double)parms.lclip || miny < (double)parms.uclip || maxx >(double)parms.rclip || maxy >(double)parms.dclip)
{ {
dg.mScissor[0] = parms.lclip + offset.X; dg.mScissor[0] = parms.lclip + int(offset.X);
dg.mScissor[1] = parms.uclip + offset.Y; dg.mScissor[1] = parms.uclip + int(offset.Y);
dg.mScissor[2] = parms.rclip + offset.X; dg.mScissor[2] = parms.rclip + int(offset.X);
dg.mScissor[3] = parms.dclip + offset.Y; dg.mScissor[3] = parms.dclip + int(offset.Y);
dg.mFlags |= DTF_Scissor; dg.mFlags |= DTF_Scissor;
} }
else else
@ -694,10 +694,10 @@ void F2DDrawer::AddPoly(FGameTexture* img, FVector4* vt, size_t vtcount, unsigne
dg.mType = DrawTypeTriangles; dg.mType = DrawTypeTriangles;
if (clipx1 > 0 || clipy1 > 0 || clipx2 < GetWidth() - 1 || clipy2 < GetHeight() - 1) if (clipx1 > 0 || clipy1 > 0 || clipx2 < GetWidth() - 1 || clipy2 < GetHeight() - 1)
{ {
dg.mScissor[0] = clipx1 + offset.X; dg.mScissor[0] = clipx1 + int(offset.X);
dg.mScissor[1] = clipy1 + offset.Y; dg.mScissor[1] = clipy1 + int(offset.Y);
dg.mScissor[2] = clipx2 + 1 + offset.X; dg.mScissor[2] = clipx2 + 1 + int(offset.X);
dg.mScissor[3] = clipy2 + 1 + offset.Y; dg.mScissor[3] = clipy2 + 1 + int(offset.Y);
dg.mFlags |= DTF_Scissor; dg.mFlags |= DTF_Scissor;
} }
@ -911,10 +911,10 @@ void F2DDrawer::AddLine(double x1, double y1, double x2, double y2, int clipx1,
if (clipx1 > 0 || clipy1 > 0 || clipx2 < GetWidth()- 1 || clipy2 < GetHeight() - 1) if (clipx1 > 0 || clipy1 > 0 || clipx2 < GetWidth()- 1 || clipy2 < GetHeight() - 1)
{ {
dg.mScissor[0] = clipx1 + offset.X; dg.mScissor[0] = clipx1 + int(offset.X);
dg.mScissor[1] = clipy1 + offset.Y; dg.mScissor[1] = clipy1 + int(offset.Y);
dg.mScissor[2] = clipx2 + 1 + offset.X; dg.mScissor[2] = clipx2 + 1 + int(offset.X);
dg.mScissor[3] = clipy2 + 1 + offset.Y; dg.mScissor[3] = clipy2 + 1 + int(offset.Y);
dg.mFlags |= DTF_Scissor; dg.mFlags |= DTF_Scissor;
} }

View file

@ -417,8 +417,6 @@ DEFINE_ACTION_FUNCTION(_Screen, GetFullscreenRect)
PARAM_FLOAT(virth); PARAM_FLOAT(virth);
PARAM_INT(fsmode); PARAM_INT(fsmode);
if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
DrawParms parms; DrawParms parms;
DoubleRect rect; DoubleRect rect;
parms.viewport.width = twod->GetWidth(); parms.viewport.width = twod->GetWidth();

View file

@ -99,7 +99,7 @@ SoundStream *S_CreateCustomStream(size_t size, int samplerate, int numchannels,
{ {
int flags = 0; int flags = 0;
if (numchannels < 2) flags |= SoundStream::Mono; if (numchannels < 2) flags |= SoundStream::Mono;
auto stream = GSnd->CreateStream(cb, size, flags, samplerate, userdata); auto stream = GSnd->CreateStream(cb, int(size), flags, samplerate, userdata);
if (stream) stream->Play(true, 1); if (stream) stream->Play(true, 1);
return stream; return stream;
} }

View file

@ -1044,8 +1044,8 @@ bool FScanner::ScanValue(bool allowfloat, bool evaluate)
auto d = constants.CheckKey(String); auto d = constants.CheckKey(String);
if (!d) return false; if (!d) return false;
if (!allowfloat && int64_t(*d) != *d) return false; if (!allowfloat && int64_t(*d) != *d) return false;
BigNumber = *d; BigNumber = int64_t(*d);
Number = *d; Number = int(*d);
Float = *d; Float = *d;
} }
if (neg) if (neg)
@ -1231,8 +1231,8 @@ void FScanner::AddSymbol(const char *name, int64_t value)
{ {
Symbol sym; Symbol sym;
sym.tokenType = TK_IntConst; sym.tokenType = TK_IntConst;
sym.Number = value; sym.Number = int(value);
sym.Float = value; sym.Float = double(value);
symbols.Insert(name, sym); symbols.Insert(name, sym);
} }