Warning and assert fixes.

This commit is contained in:
King_DuckZ 2016-11-09 23:35:41 +01:00
parent 72bfb64795
commit 0b6cdeb5f5
3 changed files with 1 additions and 15 deletions

View file

@ -67,9 +67,6 @@ namespace cloonel {
///-------------------------------------------------------------------------
///-------------------------------------------------------------------------
void Character::Prepare() {
const SDLMain* const sdlmain = m_texture->SDLObject();
const int2 screensize(vector_cast<int2>(sdlmain->WidthHeight()));
m_texture->Reload();
}

View file

@ -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<uint8_t>& 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;

View file

@ -33,7 +33,7 @@ namespace cloonel {
///----------------------------------------------------------------------
float2 CountTilesInScreen (const ushort2& parScreenSize, const ushort2& parTileSize) {
assert(ushort2(0) != parTileSize);
return vector_cast<float2>((parTileSize - 1 + parScreenSize) / parTileSize);
return vector_cast<float2>((parTileSize - 1U + parScreenSize) / parTileSize);
}
} //unnamed namespace