Browse Source

🎉 render.cpp: Do not render out-of-bounds

This is part of the work to allow us to eliminate buffer padding.

As this is a hotspot, we have 4 separate functions for each non-square
primitive, resulting in quite a bit of code:

1. Unclipped ("Full")
2. Vertical-only clip
3. Vertical + Left clip
4. Vertical + Right clip

FPS at 640x480: 1420 -> 1530
pull/952/head
Gleb Mazovetskiy 5 years ago committed by Anders Jenbo
parent
commit
18967ce5ff
  1. 3
      Source/.clang-tidy
  2. 1127
      Source/render.cpp
  3. 4
      Source/render.h

3
Source/.clang-tidy

@ -78,3 +78,6 @@ CheckOptions:
- { key: google-runtime-int.UnsignedTypePrefix, value: "std::uint" }
- { key: google-runtime-int.SignedTypePrefix, value: "std::int" }
- { key: google-runtime-int.TypeSuffix, value: "_t" }
# `int8_t` aren't used as chars, disable misleading warning.
- { key: bugprone-signed-char-misuse.CharTypdefsToIgnore, value: "std::int8_t" }

1127
Source/render.cpp

File diff suppressed because it is too large Load Diff

4
Source/render.h

@ -23,10 +23,10 @@ namespace devilution {
* @param x Target buffer coordinate
* @param y Target buffer coordinate
*/
void RenderTile(CelOutputBuffer out, int x, int y);
void RenderTile(const CelOutputBuffer &out, int x, int y);
/**
* @brief Render a black tile
* @brief Render a black 64x31 tile
* @param out Target buffer
* @param sx Target buffer coordinate (left corner of the tile)
* @param sy Target buffer coordinate (bottom corner of the tile)

Loading…
Cancel
Save