From 0b6cdeb5f5f55cd363a86979c8873ef6c87470b7 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Wed, 9 Nov 2016 23:35:41 +0100 Subject: [PATCH] Warning and assert fixes. --- src/character.cpp | 3 --- src/texture.cpp | 11 ----------- src/tiledwallpaper.cpp | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/character.cpp b/src/character.cpp index 8536ee3..4f39152 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -67,9 +67,6 @@ namespace cloonel { ///------------------------------------------------------------------------- ///------------------------------------------------------------------------- void Character::Prepare() { - const SDLMain* const sdlmain = m_texture->SDLObject(); - const int2 screensize(vector_cast(sdlmain->WidthHeight())); - m_texture->Reload(); } diff --git a/src/texture.cpp b/src/texture.cpp index cc8820f..137edb4 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -116,15 +116,6 @@ namespace cloonel { bool IsRectCompletelyInsideRect ( const RectFloat& parInner, const RectFloat& parOuter ) a_pure; #endif -#if !defined(NDEBUG) - bool areEqualRel (float parA, float parB, float parEpsilon) a_pure; - - //see: http://stackoverflow.com/questions/4548004/how-to-correctly-and-standardly-compare-floats - bool areEqualRel (float parA, float parB, float parEpsilon) { - return (std::fabs(parA - parB) <= parEpsilon * std::max(std::fabs(parA), std::fabs(parB))); - } -#endif - ///---------------------------------------------------------------------- ///---------------------------------------------------------------------- SDL_Surface* SurfaceFromPng (PixelFormat parPixelFormat, ushort2 parSize, const png_structp& parPngPtr, const png_infop& parInfoPtr, std::vector& parBuff) { @@ -272,7 +263,6 @@ namespace cloonel { ///got set to a valid value, otherwise false. ///---------------------------------------------------------------------- bool ClipRect (RectFloat& parSrc, RectFloat& parDest, const RectFloat& parClip) { - assert(areEqualRel(parSrc.Width(), parDest.Width(), 0.00001f)); assert(parSrc.IsValid()); assert(parDest.IsValid()); @@ -305,7 +295,6 @@ namespace cloonel { assert(dst.IsValid()); assert(dst.from >= parClip.from); assert(dst.to <= parClip.to); - assert(areEqualRel(src.Width(), dst.Width(), 0.00001f)); } parDest = dst; parSrc = src; diff --git a/src/tiledwallpaper.cpp b/src/tiledwallpaper.cpp index ef85764..c3fa131 100644 --- a/src/tiledwallpaper.cpp +++ b/src/tiledwallpaper.cpp @@ -33,7 +33,7 @@ namespace cloonel { ///---------------------------------------------------------------------- float2 CountTilesInScreen (const ushort2& parScreenSize, const ushort2& parTileSize) { assert(ushort2(0) != parTileSize); - return vector_cast((parTileSize - 1 + parScreenSize) / parTileSize); + return vector_cast((parTileSize - 1U + parScreenSize) / parTileSize); } } //unnamed namespace