MapRenderer: Try harder to place enemy groups

* Increase the number of random tries from 3 to 5 allowed misses per enemy
* In case we still have failure, try a deterministic method, by iterating
  over all tiles in the given rectangle and place at the first free spot.
  This is not random, but should occur only on rare occasions.
* Warn if we still cannot place all enemies.

Fixes #742.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
EnemyManager: Warn if enemy has empty type

This was warning was removed in the previous commit. There is was only
be checked for enemy groups however. Now check for any enemies.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Fix crash when on empty or invalid map.

When being on an invalid map, you used to get back to the initial spawning
point. This seems to have broken on a rewrite of the MapRenderer rendering
the object layer.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
MapRenderer: Orthogonal renderer also working correct with floating point

The r_cursor->map_pos.y is a float while the j and i are integers
and the intention is to check whether we're on the exact tile there,
so we need to cast the floats to int, to actually check only tile based.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Merge pull request #795 from stefanbeller/fixrendering

Fix crash when on empty or invalid map.
Merge pull request #794 from stefanbeller/master

Fix #742
Prevent excessive is_valid_position() calls during positive x/y sliding

When we were using integer units for positions within tiles, it was easy
to determine the point right before the next tile. If we had 512 units
per tile, 511 would be the point before the next tile. Figuring out this
point isn't easy with floating point positions, since the number that
comes before 1.0 goes on for quite a bit.

This commit places a limit on how small steps can get when attempting to
slide along a surface in a positive direction (aka east or south). I did
some testing with perf while looking at is_valid_position(). Without the
patch, about 49.76% of cycles were dedicated to that function. With the
patch, only 0.17% of cycles were used.
Merge pull request #793 from dorkster/fp_perf

Prevent excessive is_valid_position() calls during positive x/y sliding