From c5a6c7271943dac9969bdccaeaed13a98e496841 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 18 Feb 2019 23:36:56 +0100 Subject: [PATCH] - fixed uninitialized variable and a few warnings. --- src/gamedata/fonts/font.cpp | 2 +- src/intermission/intermission.cpp | 1 + src/v_drawtext.cpp | 17 ++++++++--------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gamedata/fonts/font.cpp b/src/gamedata/fonts/font.cpp index a777cdef0..b8725eae6 100644 --- a/src/gamedata/fonts/font.cpp +++ b/src/gamedata/fonts/font.cpp @@ -361,7 +361,7 @@ void FFont::ReadSheetFont(TArray &folderdata, int width, int height tex->bNoDecals = false; tex->SourceLump = -1; // We do not really care. TexMan.AddTexture(tex); - charMap.Insert(position + x + y * numtex_x, tex); + charMap.Insert(int(position) + x + y * numtex_x, tex); } } } diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index a01f5325a..7f68ebae7 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -696,6 +696,7 @@ bool DIntermissionController::NextPage () // last page return false; } + bg.SetInvalid(); if (mScreen != NULL) { diff --git a/src/v_drawtext.cpp b/src/v_drawtext.cpp index c18d8bd13..e0bc0d639 100644 --- a/src/v_drawtext.cpp +++ b/src/v_drawtext.cpp @@ -63,9 +63,8 @@ FTexture * BuildTextTexture(FFont *font, const char *string, int textcolor) { int w; const uint8_t *ch; - int c; - double cx; - double cy; + int cx; + int cy; FRemapTable *range; int kerning; FTexture *pic; @@ -99,10 +98,10 @@ FTexture * BuildTextTexture(FFont *font, const char *string, int textcolor) { auto img = pic->GetImage(); auto offsets = img->GetOffsets(); - double x = cx - offsets.first; - double y = cy - offsets.second; - double ww = img->GetWidth(); - double h = img->GetHeight(); + int x = cx - offsets.first; + int y = cy - offsets.second; + int ww = img->GetWidth(); + int h = img->GetHeight(); box.AddToRect(x, y); box.AddToRect(x + ww, y + h); @@ -139,8 +138,8 @@ FTexture * BuildTextTexture(FFont *font, const char *string, int textcolor) { auto img = pic->GetImage(); auto offsets = img->GetOffsets(); - double x = cx - offsets.first; - double y = cy - offsets.second; + int x = cx - offsets.first; + int y = cy - offsets.second; auto &tp = part[part.Reserve(1)];