Skip to content

Commit

Permalink
Fix build with NDEBUG defined
Browse files Browse the repository at this point in the history
code from
https://github.com/miki151/keeperrl/blob/f0d2a78a6ad7c2632be6d8554e4d947f980648ae/fx_base.h#L30

// ...

When NDEBUG defined game will just ignoring all PASSERT(...), and
PASSERT(size.x >= 0 && size.y >= 0) << size.x << " " << size.y;
will become just :
<< size.x << " " << size.y;
  • Loading branch information
q4a committed Dec 16, 2023
1 parent ad6b5cf commit aa81840
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fx_particle_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ void defaultEmitParticle(AnimationContext &ctx, EmissionState &em, Particle &new
}

array<FVec2, 4> DrawContext::quadCorners(FVec2 pos, FVec2 size, float rotation) const {
#ifndef NDEBUG
PASSERT(size.x >= 0 && size.y >= 0) << size.x << " " << size.y;
#endif
auto corners = FRect(pos - size * 0.5f, pos + size * 0.5f).corners();
if (rotation != 0.0f) {
auto sc = sincos(rotation);
Expand Down

0 comments on commit aa81840

Please sign in to comment.