You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1825 lines
59 KiB

/**
* @file scrollrt.cpp
*
* Implementation of functionality for rendering the dungeons, monsters and calling other render routines.
*/
#include "engine/render/scrollrt.h"
#include <cmath>
#include <cstddef>
#include <cstdint>
#ifdef USE_SDL3
#include <SDL3/SDL_keyboard.h>
#include <SDL3/SDL_rect.h>
#include <SDL3/SDL_timer.h>
#else
#include <SDL.h>
#endif
#include <ankerl/unordered_dense.h>
#include "DiabloUI/ui_flags.hpp"
#include "automap.h"
#include "controls/control_mode.hpp"
#include "controls/plrctrls.h"
#include "cursor.h"
#include "dead.h"
#include "diablo_msg.hpp"
#include "doom.h"
#include "engine/backbuffer_state.hpp"
#include "engine/displacement.hpp"
#include "engine/dx.h"
#include "engine/point.hpp"
#include "engine/render/clx_render.hpp"
#include "engine/render/dun_render.hpp"
#include "engine/render/light_render.hpp"
#include "engine/render/text_render.hpp"
#include "engine/trn.hpp"
#include "engine/world_tile.hpp"
#include "game_mode.hpp"
#include "gmenu.h"
#include "headless_mode.hpp"
#include "help.h"
#include "hwcursor.hpp"
10 months ago
#include "init.hpp"
#include "inv.h"
#include "levels/dun_tile.hpp"
#include "levels/gendung.h"
#include "levels/tile_properties.hpp"
#include "lighting.h"
#include "lua/lua_global.hpp"
#include "minitext.h"
#include "missiles.h"
#include "nthread.h"
#include "options.h"
#include "panels/charpanel.hpp"
#include "panels/console.hpp"
#include "panels/partypanel.hpp"
#include "panels/spell_list.hpp"
#include "plrmsg.h"
4 years ago
#include "qol/chatlog.h"
#include "qol/floatingnumbers.h"
#include "qol/itemlabels.h"
#include "qol/monhealthbar.h"
4 years ago
#include "qol/stash.h"
#include "qol/xpbar.h"
#include "stores.h"
#include "towners.h"
#include "utils/attributes.h"
#include "utils/display.h"
#include "utils/is_of.hpp"
#include "utils/log.hpp"
#include "utils/sdl_compat.h"
#include "utils/str_cat.hpp"
#ifndef USE_SDL1
#include "controls/touch/renderers.h"
#endif
#ifdef _DEBUG
#include "debug.h"
#endif
#ifdef DUN_RENDER_STATS
#include "utils/format_int.hpp"
#endif
namespace devilution {
bool AutoMapShowItems;
// DevilutionX extension.
extern void DrawControllerModifierHints(const Surface &out);
bool frameflag;
namespace {
constexpr auto RightFrameDisplacement = Displacement { DunFrameWidth, 0 };
[[nodiscard]] DVL_ALWAYS_INLINE bool IsFloor(Point tilePosition)
{
return !TileHasAny(tilePosition, TileProperties::Solid | TileProperties::BlockMissile);
}
[[nodiscard]] DVL_ALWAYS_INLINE bool IsWall(Point tilePosition)
{
return !IsFloor(tilePosition) || dSpecial[tilePosition.x][tilePosition.y] != 0;
}
/**
* @brief Contains all Missile at rendering position
*/
ankerl::unordered_dense::map<WorldTilePosition, std::vector<Missile *>> MissilesAtRenderingTile;
/**
* @brief Could the missile (at the next game tick) collide? This method is a simplified version of CheckMissileCol (for example without random).
*/
bool CouldMissileCollide(Point tile, bool checkPlayerAndMonster)
{
if (!InDungeonBounds(tile))
return true;
if (checkPlayerAndMonster) {
if (dMonster[tile.x][tile.y] > 0)
return true;
if (dPlayer[tile.x][tile.y] > 0)
return true;
}
return IsMissileBlockedByTile(tile);
}
void UpdateMissilePositionForRendering(Missile &m, int progress)
{
DisplacementOf<int64_t> velocity = m.position.velocity;
velocity *= progress;
velocity /= AnimationInfo::baseValueFraction;
const Displacement pixelsTravelled = (m.position.traveled + Displacement { static_cast<int>(velocity.deltaX), static_cast<int>(velocity.deltaY) }) >> 16;
const Displacement tileOffset = pixelsTravelled.screenToMissile();
// calculate the future missile position
m.position.tileForRendering = m.position.start + tileOffset;
m.position.offsetForRendering = pixelsTravelled + tileOffset.worldToScreen();
}
void UpdateMissileRendererData(Missile &m)
{
m.position.tileForRendering = m.position.tile;
m.position.offsetForRendering = m.position.offset;
const MissileMovementDistribution missileMovement = GetMissileData(m._mitype).movementDistribution;
// don't calculate missile position if they don't move
if (missileMovement == MissileMovementDistribution::Disabled || m.position.velocity == Displacement {})
return;
int progress = ProgressToNextGameTick;
UpdateMissilePositionForRendering(m, progress);
// In some cases this calculated position is invalid.
// For example a missile shouldn't move inside a wall.
// In this case the game logic don't advance the missile position and removes the missile or shows an explosion animation at the old position.
// For the animation distribution logic this means we are not allowed to move to a tile where the missile could collide, because this could be a invalid position.
// If we are still at the current tile, this tile was already checked and is a valid tile
if (m.position.tileForRendering == m.position.tile)
return;
// If no collision can happen at the new tile we can advance
if (!CouldMissileCollide(m.position.tileForRendering, missileMovement == MissileMovementDistribution::Blockable))
return;
// The new tile could be invalid, so don't advance to it.
// We search the last offset that is in the old (valid) tile.
// Implementation note: If someone knows the correct math to calculate this without the loop, I would really appreciate it.
while (m.position.tile != m.position.tileForRendering) {
progress -= 1;
if (progress <= 0) {
m.position.tileForRendering = m.position.tile;
m.position.offsetForRendering = m.position.offset;
return;
}
UpdateMissilePositionForRendering(m, progress);
}
}
void UpdateMissilesRendererData()
{
MissilesAtRenderingTile.clear();
for (auto &m : Missiles) {
UpdateMissileRendererData(m);
MissilesAtRenderingTile[m.position.tileForRendering].push_back(&m);
}
}
uint32_t lastFpsUpdateInMs;
Rectangle PrevCursorRect;
void BlitCursor(uint8_t *dst, uint32_t dstPitch, uint8_t *src, uint32_t srcPitch, uint32_t srcWidth, uint32_t srcHeight)
{
for (std::uint32_t i = 0; i < srcHeight; ++i, src += srcPitch, dst += dstPitch) {
memcpy(dst, src, srcWidth);
}
}
/**
* @brief Remove the cursor from the buffer
*/
5 years ago
void UndrawCursor(const Surface &out)
{
DrawnCursor &cursor = GetDrawnCursor();
BlitCursor(&out[cursor.rect.position], out.pitch(), cursor.behindBuffer, cursor.rect.size.width, cursor.rect.size.width, cursor.rect.size.height);
PrevCursorRect = cursor.rect;
}
5 years ago
bool ShouldShowCursor()
{
if (ControlMode == ControlTypes::KeyboardAndMouse)
return true;
if (pcurs == CURSOR_TELEPORT)
return true;
if (invflag)
return true;
if (CharFlag && MyPlayer->_pStatPts > 0)
return true;
return false;
}
/**
* @brief Blit CL2 sprite, and apply lighting, to the given buffer at the given coordinates
* @param out Output buffer
* @param position Target buffer coordinate
* @param clx CLX frame
*/
inline void ClxDrawLight(const Surface &out, Point position, ClxSprite clx, int lightTableIndex)
{
if (lightTableIndex != 0) {
ClxDrawTRN(out, position, clx, LightTables[lightTableIndex].data());
} else {
ClxDraw(out, position, clx);
}
}
/**
* @brief Blit CL2 sprite, and apply lighting and transparency blending, to the given buffer at the given coordinates
* @param out Output buffer
* @param position Target buffer coordinate
* @param clx CLX frame
*/
inline void ClxDrawLightBlended(const Surface &out, Point position, ClxSprite clx, int lightTableIndex)
{
if (lightTableIndex != 0) {
ClxDrawBlendedTRN(out, position, clx, LightTables[lightTableIndex].data());
} else {
ClxDrawBlended(out, position, clx);
}
}
/**
* @brief Save the content behind the cursor to a temporary buffer, then draw the cursor.
*/
5 years ago
void DrawCursor(const Surface &out)
{
DrawnCursor &cursor = GetDrawnCursor();
if (IsHardwareCursor()) {
SetHardwareCursorVisible(ShouldShowCursor());
cursor.rect.size = { 0, 0 };
return;
}
if (pcurs <= CURSOR_NONE || !ShouldShowCursor()) {
cursor.rect.size = { 0, 0 };
return;
}
const Size cursSize = GetInvItemSize(pcurs);
if (cursSize.width == 0 || cursSize.height == 0) {
cursor.rect.size = { 0, 0 };
return;
}
constexpr auto Clip = [](int &pos, int &length, int posEnd) {
if (pos + length <= 0 || pos >= posEnd) {
pos = 0;
length = 0;
} else if (pos < 0) {
length += pos;
pos = 0;
} else if (pos + length > posEnd) {
length = posEnd - pos;
}
};
// Copy the buffer before the item cursor and its 1px outline are drawn to a temporary buffer.
const int outlineWidth = !MyPlayer->HoldItem.isEmpty() ? 1 : 0;
const Displacement offset = !MyPlayer->HoldItem.isEmpty() ? Displacement { cursSize / 2 } : Displacement { 0 };
const Point cursPosition = MousePosition - offset;
Rectangle &rect = cursor.rect;
rect.position.x = cursPosition.x - outlineWidth;
rect.size.width = cursSize.width + 2 * outlineWidth;
Clip(rect.position.x, rect.size.width, out.w());
rect.position.y = cursPosition.y - outlineWidth;
rect.size.height = cursSize.height + 2 * outlineWidth;
Clip(rect.position.y, rect.size.height, out.h());
if (rect.size.width == 0 || rect.size.height == 0)
return;
BlitCursor(cursor.behindBuffer, rect.size.width, &out[rect.position], out.pitch(), rect.size.width, rect.size.height);
DrawSoftwareCursor(out, cursPosition + Displacement { 0, cursSize.height - 1 }, pcurs);
}
/**
* @brief Render a missile sprite
* @param out Output buffer
* @param missile Pointer to Missile struct
* @param targetBufferPosition Output buffer coordinate
* @param pre Is the sprite in the background
*/
void DrawMissilePrivate(const Surface &out, const Missile &missile, Point targetBufferPosition, bool pre, int lightTableIndex)
{
if (missile._miPreFlag != pre || !missile._miDrawFlag)
return;
const Point missileRenderPosition { targetBufferPosition + missile.position.offsetForRendering - Displacement { missile._miAnimWidth2, 0 } };
const ClxSprite sprite = (*missile._miAnimData)[missile._miAnimFrame - 1];
if (missile._miUniqTrans != 0) {
ClxDrawTRN(out, missileRenderPosition, sprite, Monsters[missile._misource].uniqueMonsterTRN.get());
} else if (missile._miLightFlag) {
ClxDrawLight(out, missileRenderPosition, sprite, lightTableIndex);
} else {
ClxDraw(out, missileRenderPosition, sprite);
}
}
/**
* @brief Render a missile sprites for a given tile
* @param out Output buffer
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Output buffer coordinates
* @param pre Is the sprite in the background
*/
void DrawMissile(const Surface &out, WorldTilePosition tilePosition, Point targetBufferPosition, bool pre, int lightTableIndex)
{
const auto it = MissilesAtRenderingTile.find(tilePosition);
if (it == MissilesAtRenderingTile.end()) return;
for (Missile *missile : it->second) {
DrawMissilePrivate(out, *missile, targetBufferPosition, pre, lightTableIndex);
}
}
/**
* @brief Render a monster sprite
* @param out Output buffer
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Output buffer coordinates
* @param monster Monster reference
*/
void DrawMonster(const Surface &out, Point tilePosition, Point targetBufferPosition, const Monster &monster, int lightTableIndex)
{
if (!monster.animInfo.sprites) {
Log("Draw Monster \"{}\": NULL Cel Buffer", monster.name());
return;
}
const ClxSprite sprite = monster.animInfo.currentSprite();
if (!IsTileLit(tilePosition)) {
ClxDrawTRN(out, targetBufferPosition, sprite, GetInfravisionTRN());
return;
}
uint8_t *trn = nullptr;
if (monster.isUnique())
trn = monster.uniqueMonsterTRN.get();
if (monster.mode == MonsterMode::Petrified)
trn = GetStoneTRN();
if (MyPlayer->_pInfraFlag && lightTableIndex > 8)
trn = GetInfravisionTRN();
if (trn != nullptr)
ClxDrawTRN(out, targetBufferPosition, sprite, trn);
else
ClxDrawLight(out, targetBufferPosition, sprite, lightTableIndex);
}
/**
* @brief Helper for rendering a specific player icon (Mana Shield or Reflect)
*/
void DrawPlayerIconHelper(const Surface &out, MissileGraphicID missileGraphicId, Point position, const Player &player, bool infraVision, int lightTableIndex)
{
const bool lighting = &player != MyPlayer;
if (player.isWalking())
position += GetOffsetForWalking(player.AnimInfo, player._pdir);
position.x -= GetMissileSpriteData(missileGraphicId).animWidth2;
const ClxSprite sprite = (*GetMissileSpriteData(missileGraphicId).sprites).list()[0];
if (!lighting) {
ClxDraw(out, position, sprite);
return;
}
if (infraVision) {
ClxDrawTRN(out, position, sprite, GetInfravisionTRN());
return;
}
ClxDrawLight(out, position, sprite, lightTableIndex);
}
/**
* @brief Helper for rendering player icons (Mana Shield and Reflect)
* @param out Output buffer
* @param player Player reference
* @param position Output buffer coordinates
* @param infraVision Should infravision be applied
*/
void DrawPlayerIcons(const Surface &out, const Player &player, Point position, bool infraVision, int lightTableIndex)
{
if (player.pManaShield)
DrawPlayerIconHelper(out, MissileGraphicID::ManaShield, position, player, infraVision, lightTableIndex);
if (player.wReflections > 0)
DrawPlayerIconHelper(out, MissileGraphicID::Reflect, position + Displacement { 0, 16 }, player, infraVision, lightTableIndex);
}
/**
* @brief Render a player sprite
* @param out Output buffer
* @param player Player reference
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Output buffer coordinates
*/
void DrawPlayer(const Surface &out, const Player &player, Point tilePosition, Point targetBufferPosition, int lightTableIndex)
{
if (!IsTileLit(tilePosition) && !MyPlayer->_pInfraFlag && !MyPlayer->isOnArenaLevel() && leveltype != DTYPE_TOWN) {
return;
}
const ClxSprite sprite = player.currentSprite();
const Point spriteBufferPosition = targetBufferPosition + player.getRenderingOffset(sprite);
if (&player == PlayerUnderCursor)
ClxDrawOutlineSkipColorZero(out, 165, spriteBufferPosition, sprite);
if (&player == MyPlayer && IsNoneOf(leveltype, DTYPE_NEST, DTYPE_CRYPT)) {
ClxDraw(out, spriteBufferPosition, sprite);
DrawPlayerIcons(out, player, targetBufferPosition, /*infraVision=*/false, lightTableIndex);
return;
}
if (!IsTileLit(tilePosition) || ((MyPlayer->_pInfraFlag || MyPlayer->isOnArenaLevel()) && lightTableIndex > 8)) {
ClxDrawTRN(out, spriteBufferPosition, sprite, GetInfravisionTRN());
DrawPlayerIcons(out, player, targetBufferPosition, /*infraVision=*/true, lightTableIndex);
return;
}
lightTableIndex = std::max(lightTableIndex - 5, 0);
ClxDrawLight(out, spriteBufferPosition, sprite, lightTableIndex);
DrawPlayerIcons(out, player, targetBufferPosition, /*infraVision=*/false, lightTableIndex);
}
/**
* @brief Render a player sprite
* @param out Output buffer
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Output buffer coordinates
*/
void DrawDeadPlayer(const Surface &out, Point tilePosition, Point targetBufferPosition, int lightTableIndex)
{
dFlags[tilePosition.x][tilePosition.y] &= ~DungeonFlag::DeadPlayer;
for (const Player &player : Players) {
if (player.plractive && player.hasNoLife() && player.isOnActiveLevel() && player.position.tile == tilePosition) {
dFlags[tilePosition.x][tilePosition.y] |= DungeonFlag::DeadPlayer;
const Point playerRenderPosition { targetBufferPosition };
DrawPlayer(out, player, tilePosition, playerRenderPosition, lightTableIndex);
}
}
}
/**
* @brief Render an object sprite
* @param out Output buffer
* @param objectToDraw Dungeone object to draw
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Output buffer coordinates
* @param pre Is the sprite in the background
*/
void DrawObject(const Surface &out, const Object &objectToDraw, Point tilePosition, Point targetBufferPosition, int lightTableIndex)
{
const ClxSprite sprite = objectToDraw.currentSprite();
const Point screenPosition = targetBufferPosition + objectToDraw.getRenderingOffset(sprite, tilePosition);
if (&objectToDraw == ObjectUnderCursor) {
ClxDrawOutlineSkipColorZero(out, 194, screenPosition, sprite);
}
if (objectToDraw.applyLighting) {
ClxDrawLight(out, screenPosition, sprite, lightTableIndex);
} else {
ClxDraw(out, screenPosition, sprite);
}
}
static void DrawDungeon(const Surface & /*out*/, const Lightmap & /*lightmap*/, Point /*tilePosition*/, Point /*targetBufferPosition*/);
/**
* @brief Render a cell
* @param out Target buffer
* @param lightmap Per-pixel light buffer
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Target buffer coordinates
*/
void DrawCell(const Surface &out, const Lightmap lightmap, Point tilePosition, Point targetBufferPosition, int lightTableIndex)
{
const uint16_t levelPieceId = dPiece[tilePosition.x][tilePosition.y];
const MICROS *pMap = &DPieceMicros[levelPieceId];
const uint8_t *tbl = LightTables[lightTableIndex].data();
const uint8_t *foliageTbl = tbl;
#ifdef _DEBUG
int walkpathIdx = -1;
Point originalTargetBufferPosition;
if (DebugPath) {
walkpathIdx = MyPlayer->GetPositionPathIndex(tilePosition);
if (walkpathIdx != -1) {
originalTargetBufferPosition = targetBufferPosition;
tbl = GetPauseTRN();
}
}
#endif
bool transparency = TileHasAny(tilePosition, TileProperties::Transparent) && TransList[dTransVal[tilePosition.x][tilePosition.y]];
#ifdef _DEBUG
if ((SDL_GetModState() & SDL_KMOD_ALT) != 0) {
transparency = false;
}
#endif
const auto getFirstTileMaskLeft = [=](TileType tile) -> MaskType {
if (transparency) {
switch (tile) {
case TileType::LeftTrapezoid:
case TileType::TransparentSquare:
return TileHasAny(tilePosition, TileProperties::TransparentLeft)
? MaskType::Left
: MaskType::Solid;
case TileType::LeftTriangle:
return MaskType::Solid;
default:
return MaskType::Transparent;
}
}
return MaskType::Solid;
};
const auto getFirstTileMaskRight = [=](TileType tile) -> MaskType {
if (transparency) {
switch (tile) {
case TileType::RightTrapezoid:
case TileType::TransparentSquare:
return TileHasAny(tilePosition, TileProperties::TransparentRight)
? MaskType::Right
: MaskType::Solid;
case TileType::RightTriangle:
return MaskType::Solid;
default:
return MaskType::Transparent;
}
}
return MaskType::Solid;
};
// Create a special lightmap buffer to bleed light up walls
uint8_t lightmapBuffer[TILE_WIDTH * TILE_HEIGHT];
const Lightmap bleedLightmap = Lightmap::bleedUp(*GetOptions().Graphics.perPixelLighting, lightmap, targetBufferPosition, lightmapBuffer);
// If the first micro tile is a floor tile, it may be followed
// by foliage which should be rendered now.
const bool isFloor = IsFloor(tilePosition);
if (const LevelCelBlock levelCelBlock { pMap->mt[0] }; levelCelBlock.hasValue()) {
const TileType tileType = levelCelBlock.type();
if (!isFloor || tileType == TileType::TransparentSquare) {
if (isFloor && tileType == TileType::TransparentSquare) {
Make `dun_render` a standalone library Does not make `dun_render_benchmark` standalone yet as that will require more untangling. Benchmark is neutral: ``` Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------------- Render<LeftTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyLit>_mean +0.0119 +0.0120 8377 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_median +0.0119 +0.0119 8376 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_stddev -0.0884 -0.2462 2 1 1 1 Render<LeftTriangle, Solid, FullyLit>_cv -0.0992 -0.2551 0 0 0 0 Render<LeftTriangle, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyDark>_mean +0.0910 +0.0910 21174 23100 21170 23097 Render<LeftTriangle, Solid, FullyDark>_median +0.0869 +0.0869 21183 23023 21179 23019 Render<LeftTriangle, Solid, FullyDark>_stddev -0.1528 -0.1593 267 226 268 225 Render<LeftTriangle, Solid, FullyDark>_cv -0.2234 -0.2294 0 0 0 0 Render<LeftTriangle, Solid, PartiallyLit>_pvalue 0.0013 0.0013 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, PartiallyLit>_mean +0.0065 +0.0065 81168 81698 81151 81680 Render<LeftTriangle, Solid, PartiallyLit>_median +0.0075 +0.0073 81143 81748 81136 81730 Render<LeftTriangle, Solid, PartiallyLit>_stddev +0.8663 +0.8787 167 311 164 307 Render<LeftTriangle, Solid, PartiallyLit>_cv +0.8542 +0.8665 0 0 0 0 Render<LeftTriangle, Transparent, FullyLit>_pvalue 0.0028 0.0017 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyLit>_mean -0.0239 -0.0239 94989 92719 94973 92703 Render<LeftTriangle, Transparent, FullyLit>_median -0.0122 -0.0123 93867 92717 93856 92704 Render<LeftTriangle, Transparent, FullyLit>_stddev -0.9920 -0.9955 2370 19 2368 11 Render<LeftTriangle, Transparent, FullyLit>_cv -0.9918 -0.9954 0 0 0 0 Render<LeftTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyDark>_mean -0.0841 -0.0841 76234 69821 76220 69809 Render<LeftTriangle, Transparent, FullyDark>_median -0.0831 -0.0832 76209 69877 76202 69864 Render<LeftTriangle, Transparent, FullyDark>_stddev -0.4486 -0.4538 441 243 440 241 Render<LeftTriangle, Transparent, FullyDark>_cv -0.3979 -0.4037 0 0 0 0 Render<LeftTriangle, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, PartiallyLit>_mean +0.0022 +0.0021 128812 129091 128792 129067 Render<LeftTriangle, Transparent, PartiallyLit>_median +0.0023 +0.0023 128820 129115 128805 129096 Render<LeftTriangle, Transparent, PartiallyLit>_stddev +0.8757 +0.6866 50 93 53 90 Render<LeftTriangle, Transparent, PartiallyLit>_cv +0.8716 +0.6830 0 0 0 0 Render<RightTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyLit>_mean +0.0057 +0.0057 8521 8570 8520 8569 Render<RightTriangle, Solid, FullyLit>_median +0.0057 +0.0057 8522 8570 8520 8568 Render<RightTriangle, Solid, FullyLit>_stddev -0.1826 -0.0420 1 1 1 1 Render<RightTriangle, Solid, FullyLit>_cv -0.1872 -0.0475 0 0 0 0 Render<RightTriangle, Solid, FullyDark>_pvalue 0.0006 0.0006 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyDark>_mean -0.0303 -0.0303 22678 21991 22675 21987 Render<RightTriangle, Solid, FullyDark>_median -0.0360 -0.0359 22704 21888 22699 21883 Render<RightTriangle, Solid, FullyDark>_stddev +0.4759 +0.4648 195 288 196 287 Render<RightTriangle, Solid, FullyDark>_cv +0.5220 +0.5106 0 0 0 0 Render<RightTriangle, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, PartiallyLit>_mean +0.0338 +0.0338 83355 86170 83341 86157 Render<RightTriangle, Solid, PartiallyLit>_median +0.0347 +0.0348 83248 86140 83230 86126 Render<RightTriangle, Solid, PartiallyLit>_stddev +0.3670 +0.3423 238 326 240 322 Render<RightTriangle, Solid, PartiallyLit>_cv +0.3224 +0.2985 0 0 0 0 Render<RightTriangle, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyLit>_mean -0.0617 -0.0616 102726 96392 102706 96375 Render<RightTriangle, Transparent, FullyLit>_median -0.0598 -0.0597 102521 96394 102498 96375 Render<RightTriangle, Transparent, FullyLit>_stddev -0.9516 -0.9548 456 22 461 21 Render<RightTriangle, Transparent, FullyLit>_cv -0.9485 -0.9518 0 0 0 0 Render<RightTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyDark>_mean -0.1377 -0.1377 84505 72865 84492 72853 Render<RightTriangle, Transparent, FullyDark>_median -0.1374 -0.1374 84339 72748 84323 72740 Render<RightTriangle, Transparent, FullyDark>_stddev -0.2760 -0.2867 526 381 528 377 Render<RightTriangle, Transparent, FullyDark>_cv -0.1604 -0.1727 0 0 0 0 Render<RightTriangle, Transparent, PartiallyLit>_pvalue 0.0036 0.0017 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, PartiallyLit>_mean +0.0010 +0.0010 131672 131808 131649 131784 Render<RightTriangle, Transparent, PartiallyLit>_median +0.0010 +0.0008 131665 131797 131654 131757 Render<RightTriangle, Transparent, PartiallyLit>_stddev -0.0688 -0.0128 81 75 72 71 Render<RightTriangle, Transparent, PartiallyLit>_cv -0.0697 -0.0138 0 0 0 0 Render<TransparentSquare, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyLit>_mean -0.0300 -0.0300 143323 139021 143300 139000 Render<TransparentSquare, Solid, FullyLit>_median -0.0300 -0.0301 143321 139014 143310 138990 Render<TransparentSquare, Solid, FullyLit>_stddev +0.0008 -0.0820 43 43 43 39 Render<TransparentSquare, Solid, FullyLit>_cv +0.0318 -0.0536 0 0 0 0 Render<TransparentSquare, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyDark>_mean -0.0100 -0.0100 134939 133588 134914 133565 Render<TransparentSquare, Solid, FullyDark>_median -0.0106 -0.0108 134964 133526 134948 133497 Render<TransparentSquare, Solid, FullyDark>_stddev +1.7508 +1.8682 99 273 96 276 Render<TransparentSquare, Solid, FullyDark>_cv +1.7786 +1.8972 0 0 0 0 Render<TransparentSquare, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, PartiallyLit>_mean -0.0460 -0.0460 152043 145043 152016 145020 Render<TransparentSquare, Solid, PartiallyLit>_median -0.0463 -0.0461 152012 144978 151964 144962 Render<TransparentSquare, Solid, PartiallyLit>_stddev -0.4453 -0.4334 267 148 266 151 Render<TransparentSquare, Solid, PartiallyLit>_cv -0.4185 -0.4060 0 0 0 0 Render<TransparentSquare, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyLit>_mean -0.0846 -0.0846 181333 165997 181304 165969 Render<TransparentSquare, Transparent, FullyLit>_median -0.0840 -0.0839 181184 165972 181147 165945 Render<TransparentSquare, Transparent, FullyLit>_stddev -0.5808 -0.5755 319 134 320 136 Render<TransparentSquare, Transparent, FullyLit>_cv -0.5421 -0.5362 0 0 0 0 Render<TransparentSquare, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyDark>_mean -0.0250 -0.0250 142232 138672 142208 138648 Render<TransparentSquare, Transparent, FullyDark>_median -0.0245 -0.0245 142144 138663 142128 138639 Render<TransparentSquare, Transparent, FullyDark>_stddev +0.1011 +0.0806 288 317 290 313 Render<TransparentSquare, Transparent, FullyDark>_cv +0.1294 +0.1084 0 0 0 0 Render<TransparentSquare, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, PartiallyLit>_mean +0.0105 +0.0105 205439 207589 205397 207556 Render<TransparentSquare, Transparent, PartiallyLit>_median +0.0106 +0.0107 205402 207575 205355 207558 Render<TransparentSquare, Transparent, PartiallyLit>_stddev -0.4410 -0.3876 182 102 167 102 Render<TransparentSquare, Transparent, PartiallyLit>_cv -0.4468 -0.3940 0 0 0 0 Render<Square, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyLit>_mean -0.0010 -0.0010 11109 11098 11107 11096 Render<Square, Solid, FullyLit>_median -0.0010 -0.0010 11109 11097 11107 11095 Render<Square, Solid, FullyLit>_stddev -0.2265 +0.2791 3 2 2 2 Render<Square, Solid, FullyLit>_cv -0.2257 +0.2804 0 0 0 0 Render<Square, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyDark>_mean +0.0904 +0.0904 8513 9283 8512 9282 Render<Square, Solid, FullyDark>_median +0.0902 +0.0902 8521 9290 8519 9288 Render<Square, Solid, FullyDark>_stddev -0.1884 -0.1616 21 17 21 18 Render<Square, Solid, FullyDark>_cv -0.2557 -0.2311 0 0 0 0 Render<Square, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, PartiallyLit>_mean +0.0038 +0.0038 163661 164289 163632 164259 Render<Square, Solid, PartiallyLit>_median +0.0038 +0.0040 163665 164290 163621 164269 Render<Square, Solid, PartiallyLit>_stddev +0.1746 +0.4412 34 40 28 40 Render<Square, Solid, PartiallyLit>_cv +0.1701 +0.4356 0 0 0 0 Render<Square, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyLit>_mean -0.0029 -0.0029 197906 197340 197876 197304 Render<Square, Transparent, FullyLit>_median -0.0030 -0.0029 197929 197339 197872 197307 Render<Square, Transparent, FullyLit>_stddev -0.5965 -0.7554 61 25 62 15 Render<Square, Transparent, FullyLit>_cv -0.5953 -0.7547 0 0 0 0 Render<Square, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyDark>_mean -0.0163 -0.0163 125659 123607 125641 123588 Render<Square, Transparent, FullyDark>_median -0.0163 -0.0163 125651 123609 125629 123579 Render<Square, Transparent, FullyDark>_stddev -0.7943 -0.8033 180 37 181 36 Render<Square, Transparent, FullyDark>_cv -0.7909 -0.8000 0 0 0 0 Render<Square, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, PartiallyLit>_mean +0.0182 +0.0182 278103 283157 278043 283107 Render<Square, Transparent, PartiallyLit>_median +0.0184 +0.0184 278086 283190 278017 283120 Render<Square, Transparent, PartiallyLit>_stddev +1.6051 +1.5303 81 210 82 209 Render<Square, Transparent, PartiallyLit>_cv +1.5586 +1.4850 0 0 0 0 Render<LeftTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyLit>_mean -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_median -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_stddev -0.4844 -0.6856 1 0 1 0 Render<LeftTrapezoid, Solid, FullyLit>_cv -0.4809 -0.6834 0 0 0 0 Render<LeftTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyDark>_mean +0.3996 +0.3997 5163 7227 5162 7226 Render<LeftTrapezoid, Solid, FullyDark>_median +0.3973 +0.3974 5174 7230 5173 7229 Render<LeftTrapezoid, Solid, FullyDark>_stddev -0.7835 -0.7789 89 19 89 20 Render<LeftTrapezoid, Solid, FullyDark>_cv -0.8453 -0.8420 0 0 0 0 Render<LeftTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, PartiallyLit>_mean -0.1228 -0.1228 50053 43907 50044 43900 Render<LeftTrapezoid, Solid, PartiallyLit>_median -0.1228 -0.1228 50062 43916 50054 43906 Render<LeftTrapezoid, Solid, PartiallyLit>_stddev +1.3916 +1.3800 63 150 64 151 Render<LeftTrapezoid, Solid, PartiallyLit>_cv +1.7263 +1.7131 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyLit>_mean -0.1584 -0.1583 62677 52751 62665 52743 Render<LeftTrapezoid, Transparent, FullyLit>_median -0.1585 -0.1585 62670 52736 62656 52728 Render<LeftTrapezoid, Transparent, FullyLit>_stddev +1.1429 +1.4086 26 55 23 55 Render<LeftTrapezoid, Transparent, FullyLit>_cv +1.5461 +1.8617 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyDark>_mean -0.1929 -0.1929 57688 46558 57679 46551 Render<LeftTrapezoid, Transparent, FullyDark>_median -0.1943 -0.1944 57681 46473 57672 46459 Render<LeftTrapezoid, Transparent, FullyDark>_stddev +2.8190 +2.7914 62 237 63 238 Render<LeftTrapezoid, Transparent, FullyDark>_cv +3.7319 +3.6978 0 0 0 0 Render<LeftTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, PartiallyLit>_mean -0.0054 -0.0054 70694 70313 70682 70301 Render<LeftTrapezoid, Transparent, PartiallyLit>_median -0.0050 -0.0048 70671 70319 70650 70311 Render<LeftTrapezoid, Transparent, PartiallyLit>_stddev -0.7448 -0.7617 163 42 168 40 Render<LeftTrapezoid, Transparent, PartiallyLit>_cv -0.7434 -0.7604 0 0 0 0 Render<RightTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyLit>_mean +0.0123 +0.0123 2985 3022 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_median +0.0123 +0.0123 2985 3021 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_stddev -0.4207 -0.4667 1 0 1 0 Render<RightTrapezoid, Solid, FullyLit>_cv -0.4277 -0.4731 0 0 0 0 Render<RightTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyDark>_mean +0.1105 +0.1105 4894 5435 4893 5434 Render<RightTrapezoid, Solid, FullyDark>_median +0.1083 +0.1082 4902 5433 4901 5432 Render<RightTrapezoid, Solid, FullyDark>_stddev -0.1973 -0.1947 45 37 45 37 Render<RightTrapezoid, Solid, FullyDark>_cv -0.2772 -0.2748 0 0 0 0 Render<RightTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, PartiallyLit>_mean -0.0169 -0.0169 48201 47386 48192 47379 Render<RightTrapezoid, Solid, PartiallyLit>_median -0.0172 -0.0170 48184 47355 48170 47351 Render<RightTrapezoid, Solid, PartiallyLit>_stddev +0.6070 +0.5204 48 78 50 76 Render<RightTrapezoid, Solid, PartiallyLit>_cv +0.6346 +0.5465 0 0 0 0 Render<RightTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyLit>_mean -0.0023 -0.0023 48751 48639 48742 48632 Render<RightTrapezoid, Transparent, FullyLit>_median -0.0020 -0.0018 48751 48654 48738 48651 Render<RightTrapezoid, Transparent, FullyLit>_stddev +2.4354 +2.4427 10 35 11 36 Render<RightTrapezoid, Transparent, FullyLit>_cv +2.4433 +2.4505 0 0 0 0 Render<RightTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyDark>_mean -0.2247 -0.2247 40942 31742 40936 31736 Render<RightTrapezoid, Transparent, FullyDark>_median -0.2241 -0.2240 40904 31739 40895 31734 Render<RightTrapezoid, Transparent, FullyDark>_stddev -0.3455 -0.3546 165 108 167 108 Render<RightTrapezoid, Transparent, FullyDark>_cv -0.1558 -0.1676 0 0 0 0 Render<RightTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, PartiallyLit>_mean -0.0908 -0.0908 74269 67523 74256 67512 Render<RightTrapezoid, Transparent, PartiallyLit>_median -0.0898 -0.0897 74196 67536 74176 67523 Render<RightTrapezoid, Transparent, PartiallyLit>_stddev -0.6590 -0.6568 147 50 146 50 Render<RightTrapezoid, Transparent, PartiallyLit>_cv -0.6250 -0.6225 0 0 0 0 BM_RenderBlackTile_pvalue 0.0539 0.0539 U Test, Repetitions: 10 vs 10 BM_RenderBlackTile_mean -0.0188 -0.0188 125 123 125 123 BM_RenderBlackTile_median -0.0263 -0.0264 126 122 125 122 BM_RenderBlackTile_stddev +1.0907 +1.0966 1 3 1 3 BM_RenderBlackTile_cv +1.1307 +1.1368 0 0 0 0 OVERALL_GEOMEAN -0.0207 -0.0207 0 0 0 0 ```
8 months ago
RenderTileFoliage(out, bleedLightmap, targetBufferPosition,
pDungeonCels.get(), levelCelBlock, foliageTbl);
} else {
Make `dun_render` a standalone library Does not make `dun_render_benchmark` standalone yet as that will require more untangling. Benchmark is neutral: ``` Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------------- Render<LeftTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyLit>_mean +0.0119 +0.0120 8377 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_median +0.0119 +0.0119 8376 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_stddev -0.0884 -0.2462 2 1 1 1 Render<LeftTriangle, Solid, FullyLit>_cv -0.0992 -0.2551 0 0 0 0 Render<LeftTriangle, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyDark>_mean +0.0910 +0.0910 21174 23100 21170 23097 Render<LeftTriangle, Solid, FullyDark>_median +0.0869 +0.0869 21183 23023 21179 23019 Render<LeftTriangle, Solid, FullyDark>_stddev -0.1528 -0.1593 267 226 268 225 Render<LeftTriangle, Solid, FullyDark>_cv -0.2234 -0.2294 0 0 0 0 Render<LeftTriangle, Solid, PartiallyLit>_pvalue 0.0013 0.0013 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, PartiallyLit>_mean +0.0065 +0.0065 81168 81698 81151 81680 Render<LeftTriangle, Solid, PartiallyLit>_median +0.0075 +0.0073 81143 81748 81136 81730 Render<LeftTriangle, Solid, PartiallyLit>_stddev +0.8663 +0.8787 167 311 164 307 Render<LeftTriangle, Solid, PartiallyLit>_cv +0.8542 +0.8665 0 0 0 0 Render<LeftTriangle, Transparent, FullyLit>_pvalue 0.0028 0.0017 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyLit>_mean -0.0239 -0.0239 94989 92719 94973 92703 Render<LeftTriangle, Transparent, FullyLit>_median -0.0122 -0.0123 93867 92717 93856 92704 Render<LeftTriangle, Transparent, FullyLit>_stddev -0.9920 -0.9955 2370 19 2368 11 Render<LeftTriangle, Transparent, FullyLit>_cv -0.9918 -0.9954 0 0 0 0 Render<LeftTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyDark>_mean -0.0841 -0.0841 76234 69821 76220 69809 Render<LeftTriangle, Transparent, FullyDark>_median -0.0831 -0.0832 76209 69877 76202 69864 Render<LeftTriangle, Transparent, FullyDark>_stddev -0.4486 -0.4538 441 243 440 241 Render<LeftTriangle, Transparent, FullyDark>_cv -0.3979 -0.4037 0 0 0 0 Render<LeftTriangle, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, PartiallyLit>_mean +0.0022 +0.0021 128812 129091 128792 129067 Render<LeftTriangle, Transparent, PartiallyLit>_median +0.0023 +0.0023 128820 129115 128805 129096 Render<LeftTriangle, Transparent, PartiallyLit>_stddev +0.8757 +0.6866 50 93 53 90 Render<LeftTriangle, Transparent, PartiallyLit>_cv +0.8716 +0.6830 0 0 0 0 Render<RightTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyLit>_mean +0.0057 +0.0057 8521 8570 8520 8569 Render<RightTriangle, Solid, FullyLit>_median +0.0057 +0.0057 8522 8570 8520 8568 Render<RightTriangle, Solid, FullyLit>_stddev -0.1826 -0.0420 1 1 1 1 Render<RightTriangle, Solid, FullyLit>_cv -0.1872 -0.0475 0 0 0 0 Render<RightTriangle, Solid, FullyDark>_pvalue 0.0006 0.0006 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyDark>_mean -0.0303 -0.0303 22678 21991 22675 21987 Render<RightTriangle, Solid, FullyDark>_median -0.0360 -0.0359 22704 21888 22699 21883 Render<RightTriangle, Solid, FullyDark>_stddev +0.4759 +0.4648 195 288 196 287 Render<RightTriangle, Solid, FullyDark>_cv +0.5220 +0.5106 0 0 0 0 Render<RightTriangle, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, PartiallyLit>_mean +0.0338 +0.0338 83355 86170 83341 86157 Render<RightTriangle, Solid, PartiallyLit>_median +0.0347 +0.0348 83248 86140 83230 86126 Render<RightTriangle, Solid, PartiallyLit>_stddev +0.3670 +0.3423 238 326 240 322 Render<RightTriangle, Solid, PartiallyLit>_cv +0.3224 +0.2985 0 0 0 0 Render<RightTriangle, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyLit>_mean -0.0617 -0.0616 102726 96392 102706 96375 Render<RightTriangle, Transparent, FullyLit>_median -0.0598 -0.0597 102521 96394 102498 96375 Render<RightTriangle, Transparent, FullyLit>_stddev -0.9516 -0.9548 456 22 461 21 Render<RightTriangle, Transparent, FullyLit>_cv -0.9485 -0.9518 0 0 0 0 Render<RightTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyDark>_mean -0.1377 -0.1377 84505 72865 84492 72853 Render<RightTriangle, Transparent, FullyDark>_median -0.1374 -0.1374 84339 72748 84323 72740 Render<RightTriangle, Transparent, FullyDark>_stddev -0.2760 -0.2867 526 381 528 377 Render<RightTriangle, Transparent, FullyDark>_cv -0.1604 -0.1727 0 0 0 0 Render<RightTriangle, Transparent, PartiallyLit>_pvalue 0.0036 0.0017 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, PartiallyLit>_mean +0.0010 +0.0010 131672 131808 131649 131784 Render<RightTriangle, Transparent, PartiallyLit>_median +0.0010 +0.0008 131665 131797 131654 131757 Render<RightTriangle, Transparent, PartiallyLit>_stddev -0.0688 -0.0128 81 75 72 71 Render<RightTriangle, Transparent, PartiallyLit>_cv -0.0697 -0.0138 0 0 0 0 Render<TransparentSquare, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyLit>_mean -0.0300 -0.0300 143323 139021 143300 139000 Render<TransparentSquare, Solid, FullyLit>_median -0.0300 -0.0301 143321 139014 143310 138990 Render<TransparentSquare, Solid, FullyLit>_stddev +0.0008 -0.0820 43 43 43 39 Render<TransparentSquare, Solid, FullyLit>_cv +0.0318 -0.0536 0 0 0 0 Render<TransparentSquare, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyDark>_mean -0.0100 -0.0100 134939 133588 134914 133565 Render<TransparentSquare, Solid, FullyDark>_median -0.0106 -0.0108 134964 133526 134948 133497 Render<TransparentSquare, Solid, FullyDark>_stddev +1.7508 +1.8682 99 273 96 276 Render<TransparentSquare, Solid, FullyDark>_cv +1.7786 +1.8972 0 0 0 0 Render<TransparentSquare, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, PartiallyLit>_mean -0.0460 -0.0460 152043 145043 152016 145020 Render<TransparentSquare, Solid, PartiallyLit>_median -0.0463 -0.0461 152012 144978 151964 144962 Render<TransparentSquare, Solid, PartiallyLit>_stddev -0.4453 -0.4334 267 148 266 151 Render<TransparentSquare, Solid, PartiallyLit>_cv -0.4185 -0.4060 0 0 0 0 Render<TransparentSquare, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyLit>_mean -0.0846 -0.0846 181333 165997 181304 165969 Render<TransparentSquare, Transparent, FullyLit>_median -0.0840 -0.0839 181184 165972 181147 165945 Render<TransparentSquare, Transparent, FullyLit>_stddev -0.5808 -0.5755 319 134 320 136 Render<TransparentSquare, Transparent, FullyLit>_cv -0.5421 -0.5362 0 0 0 0 Render<TransparentSquare, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyDark>_mean -0.0250 -0.0250 142232 138672 142208 138648 Render<TransparentSquare, Transparent, FullyDark>_median -0.0245 -0.0245 142144 138663 142128 138639 Render<TransparentSquare, Transparent, FullyDark>_stddev +0.1011 +0.0806 288 317 290 313 Render<TransparentSquare, Transparent, FullyDark>_cv +0.1294 +0.1084 0 0 0 0 Render<TransparentSquare, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, PartiallyLit>_mean +0.0105 +0.0105 205439 207589 205397 207556 Render<TransparentSquare, Transparent, PartiallyLit>_median +0.0106 +0.0107 205402 207575 205355 207558 Render<TransparentSquare, Transparent, PartiallyLit>_stddev -0.4410 -0.3876 182 102 167 102 Render<TransparentSquare, Transparent, PartiallyLit>_cv -0.4468 -0.3940 0 0 0 0 Render<Square, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyLit>_mean -0.0010 -0.0010 11109 11098 11107 11096 Render<Square, Solid, FullyLit>_median -0.0010 -0.0010 11109 11097 11107 11095 Render<Square, Solid, FullyLit>_stddev -0.2265 +0.2791 3 2 2 2 Render<Square, Solid, FullyLit>_cv -0.2257 +0.2804 0 0 0 0 Render<Square, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyDark>_mean +0.0904 +0.0904 8513 9283 8512 9282 Render<Square, Solid, FullyDark>_median +0.0902 +0.0902 8521 9290 8519 9288 Render<Square, Solid, FullyDark>_stddev -0.1884 -0.1616 21 17 21 18 Render<Square, Solid, FullyDark>_cv -0.2557 -0.2311 0 0 0 0 Render<Square, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, PartiallyLit>_mean +0.0038 +0.0038 163661 164289 163632 164259 Render<Square, Solid, PartiallyLit>_median +0.0038 +0.0040 163665 164290 163621 164269 Render<Square, Solid, PartiallyLit>_stddev +0.1746 +0.4412 34 40 28 40 Render<Square, Solid, PartiallyLit>_cv +0.1701 +0.4356 0 0 0 0 Render<Square, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyLit>_mean -0.0029 -0.0029 197906 197340 197876 197304 Render<Square, Transparent, FullyLit>_median -0.0030 -0.0029 197929 197339 197872 197307 Render<Square, Transparent, FullyLit>_stddev -0.5965 -0.7554 61 25 62 15 Render<Square, Transparent, FullyLit>_cv -0.5953 -0.7547 0 0 0 0 Render<Square, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyDark>_mean -0.0163 -0.0163 125659 123607 125641 123588 Render<Square, Transparent, FullyDark>_median -0.0163 -0.0163 125651 123609 125629 123579 Render<Square, Transparent, FullyDark>_stddev -0.7943 -0.8033 180 37 181 36 Render<Square, Transparent, FullyDark>_cv -0.7909 -0.8000 0 0 0 0 Render<Square, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, PartiallyLit>_mean +0.0182 +0.0182 278103 283157 278043 283107 Render<Square, Transparent, PartiallyLit>_median +0.0184 +0.0184 278086 283190 278017 283120 Render<Square, Transparent, PartiallyLit>_stddev +1.6051 +1.5303 81 210 82 209 Render<Square, Transparent, PartiallyLit>_cv +1.5586 +1.4850 0 0 0 0 Render<LeftTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyLit>_mean -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_median -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_stddev -0.4844 -0.6856 1 0 1 0 Render<LeftTrapezoid, Solid, FullyLit>_cv -0.4809 -0.6834 0 0 0 0 Render<LeftTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyDark>_mean +0.3996 +0.3997 5163 7227 5162 7226 Render<LeftTrapezoid, Solid, FullyDark>_median +0.3973 +0.3974 5174 7230 5173 7229 Render<LeftTrapezoid, Solid, FullyDark>_stddev -0.7835 -0.7789 89 19 89 20 Render<LeftTrapezoid, Solid, FullyDark>_cv -0.8453 -0.8420 0 0 0 0 Render<LeftTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, PartiallyLit>_mean -0.1228 -0.1228 50053 43907 50044 43900 Render<LeftTrapezoid, Solid, PartiallyLit>_median -0.1228 -0.1228 50062 43916 50054 43906 Render<LeftTrapezoid, Solid, PartiallyLit>_stddev +1.3916 +1.3800 63 150 64 151 Render<LeftTrapezoid, Solid, PartiallyLit>_cv +1.7263 +1.7131 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyLit>_mean -0.1584 -0.1583 62677 52751 62665 52743 Render<LeftTrapezoid, Transparent, FullyLit>_median -0.1585 -0.1585 62670 52736 62656 52728 Render<LeftTrapezoid, Transparent, FullyLit>_stddev +1.1429 +1.4086 26 55 23 55 Render<LeftTrapezoid, Transparent, FullyLit>_cv +1.5461 +1.8617 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyDark>_mean -0.1929 -0.1929 57688 46558 57679 46551 Render<LeftTrapezoid, Transparent, FullyDark>_median -0.1943 -0.1944 57681 46473 57672 46459 Render<LeftTrapezoid, Transparent, FullyDark>_stddev +2.8190 +2.7914 62 237 63 238 Render<LeftTrapezoid, Transparent, FullyDark>_cv +3.7319 +3.6978 0 0 0 0 Render<LeftTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, PartiallyLit>_mean -0.0054 -0.0054 70694 70313 70682 70301 Render<LeftTrapezoid, Transparent, PartiallyLit>_median -0.0050 -0.0048 70671 70319 70650 70311 Render<LeftTrapezoid, Transparent, PartiallyLit>_stddev -0.7448 -0.7617 163 42 168 40 Render<LeftTrapezoid, Transparent, PartiallyLit>_cv -0.7434 -0.7604 0 0 0 0 Render<RightTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyLit>_mean +0.0123 +0.0123 2985 3022 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_median +0.0123 +0.0123 2985 3021 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_stddev -0.4207 -0.4667 1 0 1 0 Render<RightTrapezoid, Solid, FullyLit>_cv -0.4277 -0.4731 0 0 0 0 Render<RightTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyDark>_mean +0.1105 +0.1105 4894 5435 4893 5434 Render<RightTrapezoid, Solid, FullyDark>_median +0.1083 +0.1082 4902 5433 4901 5432 Render<RightTrapezoid, Solid, FullyDark>_stddev -0.1973 -0.1947 45 37 45 37 Render<RightTrapezoid, Solid, FullyDark>_cv -0.2772 -0.2748 0 0 0 0 Render<RightTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, PartiallyLit>_mean -0.0169 -0.0169 48201 47386 48192 47379 Render<RightTrapezoid, Solid, PartiallyLit>_median -0.0172 -0.0170 48184 47355 48170 47351 Render<RightTrapezoid, Solid, PartiallyLit>_stddev +0.6070 +0.5204 48 78 50 76 Render<RightTrapezoid, Solid, PartiallyLit>_cv +0.6346 +0.5465 0 0 0 0 Render<RightTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyLit>_mean -0.0023 -0.0023 48751 48639 48742 48632 Render<RightTrapezoid, Transparent, FullyLit>_median -0.0020 -0.0018 48751 48654 48738 48651 Render<RightTrapezoid, Transparent, FullyLit>_stddev +2.4354 +2.4427 10 35 11 36 Render<RightTrapezoid, Transparent, FullyLit>_cv +2.4433 +2.4505 0 0 0 0 Render<RightTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyDark>_mean -0.2247 -0.2247 40942 31742 40936 31736 Render<RightTrapezoid, Transparent, FullyDark>_median -0.2241 -0.2240 40904 31739 40895 31734 Render<RightTrapezoid, Transparent, FullyDark>_stddev -0.3455 -0.3546 165 108 167 108 Render<RightTrapezoid, Transparent, FullyDark>_cv -0.1558 -0.1676 0 0 0 0 Render<RightTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, PartiallyLit>_mean -0.0908 -0.0908 74269 67523 74256 67512 Render<RightTrapezoid, Transparent, PartiallyLit>_median -0.0898 -0.0897 74196 67536 74176 67523 Render<RightTrapezoid, Transparent, PartiallyLit>_stddev -0.6590 -0.6568 147 50 146 50 Render<RightTrapezoid, Transparent, PartiallyLit>_cv -0.6250 -0.6225 0 0 0 0 BM_RenderBlackTile_pvalue 0.0539 0.0539 U Test, Repetitions: 10 vs 10 BM_RenderBlackTile_mean -0.0188 -0.0188 125 123 125 123 BM_RenderBlackTile_median -0.0263 -0.0264 126 122 125 122 BM_RenderBlackTile_stddev +1.0907 +1.0966 1 3 1 3 BM_RenderBlackTile_cv +1.1307 +1.1368 0 0 0 0 OVERALL_GEOMEAN -0.0207 -0.0207 0 0 0 0 ```
8 months ago
RenderTile(out, bleedLightmap, targetBufferPosition,
pDungeonCels.get(), levelCelBlock, getFirstTileMaskLeft(tileType), tbl);
}
}
}
if (const LevelCelBlock levelCelBlock { pMap->mt[1] }; levelCelBlock.hasValue()) {
const TileType tileType = levelCelBlock.type();
if (!isFloor || tileType == TileType::TransparentSquare) {
if (isFloor && tileType == TileType::TransparentSquare) {
Make `dun_render` a standalone library Does not make `dun_render_benchmark` standalone yet as that will require more untangling. Benchmark is neutral: ``` Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------------- Render<LeftTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyLit>_mean +0.0119 +0.0120 8377 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_median +0.0119 +0.0119 8376 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_stddev -0.0884 -0.2462 2 1 1 1 Render<LeftTriangle, Solid, FullyLit>_cv -0.0992 -0.2551 0 0 0 0 Render<LeftTriangle, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyDark>_mean +0.0910 +0.0910 21174 23100 21170 23097 Render<LeftTriangle, Solid, FullyDark>_median +0.0869 +0.0869 21183 23023 21179 23019 Render<LeftTriangle, Solid, FullyDark>_stddev -0.1528 -0.1593 267 226 268 225 Render<LeftTriangle, Solid, FullyDark>_cv -0.2234 -0.2294 0 0 0 0 Render<LeftTriangle, Solid, PartiallyLit>_pvalue 0.0013 0.0013 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, PartiallyLit>_mean +0.0065 +0.0065 81168 81698 81151 81680 Render<LeftTriangle, Solid, PartiallyLit>_median +0.0075 +0.0073 81143 81748 81136 81730 Render<LeftTriangle, Solid, PartiallyLit>_stddev +0.8663 +0.8787 167 311 164 307 Render<LeftTriangle, Solid, PartiallyLit>_cv +0.8542 +0.8665 0 0 0 0 Render<LeftTriangle, Transparent, FullyLit>_pvalue 0.0028 0.0017 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyLit>_mean -0.0239 -0.0239 94989 92719 94973 92703 Render<LeftTriangle, Transparent, FullyLit>_median -0.0122 -0.0123 93867 92717 93856 92704 Render<LeftTriangle, Transparent, FullyLit>_stddev -0.9920 -0.9955 2370 19 2368 11 Render<LeftTriangle, Transparent, FullyLit>_cv -0.9918 -0.9954 0 0 0 0 Render<LeftTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyDark>_mean -0.0841 -0.0841 76234 69821 76220 69809 Render<LeftTriangle, Transparent, FullyDark>_median -0.0831 -0.0832 76209 69877 76202 69864 Render<LeftTriangle, Transparent, FullyDark>_stddev -0.4486 -0.4538 441 243 440 241 Render<LeftTriangle, Transparent, FullyDark>_cv -0.3979 -0.4037 0 0 0 0 Render<LeftTriangle, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, PartiallyLit>_mean +0.0022 +0.0021 128812 129091 128792 129067 Render<LeftTriangle, Transparent, PartiallyLit>_median +0.0023 +0.0023 128820 129115 128805 129096 Render<LeftTriangle, Transparent, PartiallyLit>_stddev +0.8757 +0.6866 50 93 53 90 Render<LeftTriangle, Transparent, PartiallyLit>_cv +0.8716 +0.6830 0 0 0 0 Render<RightTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyLit>_mean +0.0057 +0.0057 8521 8570 8520 8569 Render<RightTriangle, Solid, FullyLit>_median +0.0057 +0.0057 8522 8570 8520 8568 Render<RightTriangle, Solid, FullyLit>_stddev -0.1826 -0.0420 1 1 1 1 Render<RightTriangle, Solid, FullyLit>_cv -0.1872 -0.0475 0 0 0 0 Render<RightTriangle, Solid, FullyDark>_pvalue 0.0006 0.0006 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyDark>_mean -0.0303 -0.0303 22678 21991 22675 21987 Render<RightTriangle, Solid, FullyDark>_median -0.0360 -0.0359 22704 21888 22699 21883 Render<RightTriangle, Solid, FullyDark>_stddev +0.4759 +0.4648 195 288 196 287 Render<RightTriangle, Solid, FullyDark>_cv +0.5220 +0.5106 0 0 0 0 Render<RightTriangle, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, PartiallyLit>_mean +0.0338 +0.0338 83355 86170 83341 86157 Render<RightTriangle, Solid, PartiallyLit>_median +0.0347 +0.0348 83248 86140 83230 86126 Render<RightTriangle, Solid, PartiallyLit>_stddev +0.3670 +0.3423 238 326 240 322 Render<RightTriangle, Solid, PartiallyLit>_cv +0.3224 +0.2985 0 0 0 0 Render<RightTriangle, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyLit>_mean -0.0617 -0.0616 102726 96392 102706 96375 Render<RightTriangle, Transparent, FullyLit>_median -0.0598 -0.0597 102521 96394 102498 96375 Render<RightTriangle, Transparent, FullyLit>_stddev -0.9516 -0.9548 456 22 461 21 Render<RightTriangle, Transparent, FullyLit>_cv -0.9485 -0.9518 0 0 0 0 Render<RightTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyDark>_mean -0.1377 -0.1377 84505 72865 84492 72853 Render<RightTriangle, Transparent, FullyDark>_median -0.1374 -0.1374 84339 72748 84323 72740 Render<RightTriangle, Transparent, FullyDark>_stddev -0.2760 -0.2867 526 381 528 377 Render<RightTriangle, Transparent, FullyDark>_cv -0.1604 -0.1727 0 0 0 0 Render<RightTriangle, Transparent, PartiallyLit>_pvalue 0.0036 0.0017 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, PartiallyLit>_mean +0.0010 +0.0010 131672 131808 131649 131784 Render<RightTriangle, Transparent, PartiallyLit>_median +0.0010 +0.0008 131665 131797 131654 131757 Render<RightTriangle, Transparent, PartiallyLit>_stddev -0.0688 -0.0128 81 75 72 71 Render<RightTriangle, Transparent, PartiallyLit>_cv -0.0697 -0.0138 0 0 0 0 Render<TransparentSquare, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyLit>_mean -0.0300 -0.0300 143323 139021 143300 139000 Render<TransparentSquare, Solid, FullyLit>_median -0.0300 -0.0301 143321 139014 143310 138990 Render<TransparentSquare, Solid, FullyLit>_stddev +0.0008 -0.0820 43 43 43 39 Render<TransparentSquare, Solid, FullyLit>_cv +0.0318 -0.0536 0 0 0 0 Render<TransparentSquare, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyDark>_mean -0.0100 -0.0100 134939 133588 134914 133565 Render<TransparentSquare, Solid, FullyDark>_median -0.0106 -0.0108 134964 133526 134948 133497 Render<TransparentSquare, Solid, FullyDark>_stddev +1.7508 +1.8682 99 273 96 276 Render<TransparentSquare, Solid, FullyDark>_cv +1.7786 +1.8972 0 0 0 0 Render<TransparentSquare, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, PartiallyLit>_mean -0.0460 -0.0460 152043 145043 152016 145020 Render<TransparentSquare, Solid, PartiallyLit>_median -0.0463 -0.0461 152012 144978 151964 144962 Render<TransparentSquare, Solid, PartiallyLit>_stddev -0.4453 -0.4334 267 148 266 151 Render<TransparentSquare, Solid, PartiallyLit>_cv -0.4185 -0.4060 0 0 0 0 Render<TransparentSquare, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyLit>_mean -0.0846 -0.0846 181333 165997 181304 165969 Render<TransparentSquare, Transparent, FullyLit>_median -0.0840 -0.0839 181184 165972 181147 165945 Render<TransparentSquare, Transparent, FullyLit>_stddev -0.5808 -0.5755 319 134 320 136 Render<TransparentSquare, Transparent, FullyLit>_cv -0.5421 -0.5362 0 0 0 0 Render<TransparentSquare, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyDark>_mean -0.0250 -0.0250 142232 138672 142208 138648 Render<TransparentSquare, Transparent, FullyDark>_median -0.0245 -0.0245 142144 138663 142128 138639 Render<TransparentSquare, Transparent, FullyDark>_stddev +0.1011 +0.0806 288 317 290 313 Render<TransparentSquare, Transparent, FullyDark>_cv +0.1294 +0.1084 0 0 0 0 Render<TransparentSquare, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, PartiallyLit>_mean +0.0105 +0.0105 205439 207589 205397 207556 Render<TransparentSquare, Transparent, PartiallyLit>_median +0.0106 +0.0107 205402 207575 205355 207558 Render<TransparentSquare, Transparent, PartiallyLit>_stddev -0.4410 -0.3876 182 102 167 102 Render<TransparentSquare, Transparent, PartiallyLit>_cv -0.4468 -0.3940 0 0 0 0 Render<Square, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyLit>_mean -0.0010 -0.0010 11109 11098 11107 11096 Render<Square, Solid, FullyLit>_median -0.0010 -0.0010 11109 11097 11107 11095 Render<Square, Solid, FullyLit>_stddev -0.2265 +0.2791 3 2 2 2 Render<Square, Solid, FullyLit>_cv -0.2257 +0.2804 0 0 0 0 Render<Square, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyDark>_mean +0.0904 +0.0904 8513 9283 8512 9282 Render<Square, Solid, FullyDark>_median +0.0902 +0.0902 8521 9290 8519 9288 Render<Square, Solid, FullyDark>_stddev -0.1884 -0.1616 21 17 21 18 Render<Square, Solid, FullyDark>_cv -0.2557 -0.2311 0 0 0 0 Render<Square, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, PartiallyLit>_mean +0.0038 +0.0038 163661 164289 163632 164259 Render<Square, Solid, PartiallyLit>_median +0.0038 +0.0040 163665 164290 163621 164269 Render<Square, Solid, PartiallyLit>_stddev +0.1746 +0.4412 34 40 28 40 Render<Square, Solid, PartiallyLit>_cv +0.1701 +0.4356 0 0 0 0 Render<Square, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyLit>_mean -0.0029 -0.0029 197906 197340 197876 197304 Render<Square, Transparent, FullyLit>_median -0.0030 -0.0029 197929 197339 197872 197307 Render<Square, Transparent, FullyLit>_stddev -0.5965 -0.7554 61 25 62 15 Render<Square, Transparent, FullyLit>_cv -0.5953 -0.7547 0 0 0 0 Render<Square, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyDark>_mean -0.0163 -0.0163 125659 123607 125641 123588 Render<Square, Transparent, FullyDark>_median -0.0163 -0.0163 125651 123609 125629 123579 Render<Square, Transparent, FullyDark>_stddev -0.7943 -0.8033 180 37 181 36 Render<Square, Transparent, FullyDark>_cv -0.7909 -0.8000 0 0 0 0 Render<Square, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, PartiallyLit>_mean +0.0182 +0.0182 278103 283157 278043 283107 Render<Square, Transparent, PartiallyLit>_median +0.0184 +0.0184 278086 283190 278017 283120 Render<Square, Transparent, PartiallyLit>_stddev +1.6051 +1.5303 81 210 82 209 Render<Square, Transparent, PartiallyLit>_cv +1.5586 +1.4850 0 0 0 0 Render<LeftTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyLit>_mean -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_median -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_stddev -0.4844 -0.6856 1 0 1 0 Render<LeftTrapezoid, Solid, FullyLit>_cv -0.4809 -0.6834 0 0 0 0 Render<LeftTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyDark>_mean +0.3996 +0.3997 5163 7227 5162 7226 Render<LeftTrapezoid, Solid, FullyDark>_median +0.3973 +0.3974 5174 7230 5173 7229 Render<LeftTrapezoid, Solid, FullyDark>_stddev -0.7835 -0.7789 89 19 89 20 Render<LeftTrapezoid, Solid, FullyDark>_cv -0.8453 -0.8420 0 0 0 0 Render<LeftTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, PartiallyLit>_mean -0.1228 -0.1228 50053 43907 50044 43900 Render<LeftTrapezoid, Solid, PartiallyLit>_median -0.1228 -0.1228 50062 43916 50054 43906 Render<LeftTrapezoid, Solid, PartiallyLit>_stddev +1.3916 +1.3800 63 150 64 151 Render<LeftTrapezoid, Solid, PartiallyLit>_cv +1.7263 +1.7131 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyLit>_mean -0.1584 -0.1583 62677 52751 62665 52743 Render<LeftTrapezoid, Transparent, FullyLit>_median -0.1585 -0.1585 62670 52736 62656 52728 Render<LeftTrapezoid, Transparent, FullyLit>_stddev +1.1429 +1.4086 26 55 23 55 Render<LeftTrapezoid, Transparent, FullyLit>_cv +1.5461 +1.8617 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyDark>_mean -0.1929 -0.1929 57688 46558 57679 46551 Render<LeftTrapezoid, Transparent, FullyDark>_median -0.1943 -0.1944 57681 46473 57672 46459 Render<LeftTrapezoid, Transparent, FullyDark>_stddev +2.8190 +2.7914 62 237 63 238 Render<LeftTrapezoid, Transparent, FullyDark>_cv +3.7319 +3.6978 0 0 0 0 Render<LeftTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, PartiallyLit>_mean -0.0054 -0.0054 70694 70313 70682 70301 Render<LeftTrapezoid, Transparent, PartiallyLit>_median -0.0050 -0.0048 70671 70319 70650 70311 Render<LeftTrapezoid, Transparent, PartiallyLit>_stddev -0.7448 -0.7617 163 42 168 40 Render<LeftTrapezoid, Transparent, PartiallyLit>_cv -0.7434 -0.7604 0 0 0 0 Render<RightTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyLit>_mean +0.0123 +0.0123 2985 3022 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_median +0.0123 +0.0123 2985 3021 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_stddev -0.4207 -0.4667 1 0 1 0 Render<RightTrapezoid, Solid, FullyLit>_cv -0.4277 -0.4731 0 0 0 0 Render<RightTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyDark>_mean +0.1105 +0.1105 4894 5435 4893 5434 Render<RightTrapezoid, Solid, FullyDark>_median +0.1083 +0.1082 4902 5433 4901 5432 Render<RightTrapezoid, Solid, FullyDark>_stddev -0.1973 -0.1947 45 37 45 37 Render<RightTrapezoid, Solid, FullyDark>_cv -0.2772 -0.2748 0 0 0 0 Render<RightTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, PartiallyLit>_mean -0.0169 -0.0169 48201 47386 48192 47379 Render<RightTrapezoid, Solid, PartiallyLit>_median -0.0172 -0.0170 48184 47355 48170 47351 Render<RightTrapezoid, Solid, PartiallyLit>_stddev +0.6070 +0.5204 48 78 50 76 Render<RightTrapezoid, Solid, PartiallyLit>_cv +0.6346 +0.5465 0 0 0 0 Render<RightTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyLit>_mean -0.0023 -0.0023 48751 48639 48742 48632 Render<RightTrapezoid, Transparent, FullyLit>_median -0.0020 -0.0018 48751 48654 48738 48651 Render<RightTrapezoid, Transparent, FullyLit>_stddev +2.4354 +2.4427 10 35 11 36 Render<RightTrapezoid, Transparent, FullyLit>_cv +2.4433 +2.4505 0 0 0 0 Render<RightTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyDark>_mean -0.2247 -0.2247 40942 31742 40936 31736 Render<RightTrapezoid, Transparent, FullyDark>_median -0.2241 -0.2240 40904 31739 40895 31734 Render<RightTrapezoid, Transparent, FullyDark>_stddev -0.3455 -0.3546 165 108 167 108 Render<RightTrapezoid, Transparent, FullyDark>_cv -0.1558 -0.1676 0 0 0 0 Render<RightTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, PartiallyLit>_mean -0.0908 -0.0908 74269 67523 74256 67512 Render<RightTrapezoid, Transparent, PartiallyLit>_median -0.0898 -0.0897 74196 67536 74176 67523 Render<RightTrapezoid, Transparent, PartiallyLit>_stddev -0.6590 -0.6568 147 50 146 50 Render<RightTrapezoid, Transparent, PartiallyLit>_cv -0.6250 -0.6225 0 0 0 0 BM_RenderBlackTile_pvalue 0.0539 0.0539 U Test, Repetitions: 10 vs 10 BM_RenderBlackTile_mean -0.0188 -0.0188 125 123 125 123 BM_RenderBlackTile_median -0.0263 -0.0264 126 122 125 122 BM_RenderBlackTile_stddev +1.0907 +1.0966 1 3 1 3 BM_RenderBlackTile_cv +1.1307 +1.1368 0 0 0 0 OVERALL_GEOMEAN -0.0207 -0.0207 0 0 0 0 ```
8 months ago
RenderTileFoliage(out, bleedLightmap, targetBufferPosition + RightFrameDisplacement,
pDungeonCels.get(), levelCelBlock, foliageTbl);
} else {
RenderTile(out, bleedLightmap, targetBufferPosition + RightFrameDisplacement,
Make `dun_render` a standalone library Does not make `dun_render_benchmark` standalone yet as that will require more untangling. Benchmark is neutral: ``` Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------------- Render<LeftTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyLit>_mean +0.0119 +0.0120 8377 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_median +0.0119 +0.0119 8376 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_stddev -0.0884 -0.2462 2 1 1 1 Render<LeftTriangle, Solid, FullyLit>_cv -0.0992 -0.2551 0 0 0 0 Render<LeftTriangle, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyDark>_mean +0.0910 +0.0910 21174 23100 21170 23097 Render<LeftTriangle, Solid, FullyDark>_median +0.0869 +0.0869 21183 23023 21179 23019 Render<LeftTriangle, Solid, FullyDark>_stddev -0.1528 -0.1593 267 226 268 225 Render<LeftTriangle, Solid, FullyDark>_cv -0.2234 -0.2294 0 0 0 0 Render<LeftTriangle, Solid, PartiallyLit>_pvalue 0.0013 0.0013 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, PartiallyLit>_mean +0.0065 +0.0065 81168 81698 81151 81680 Render<LeftTriangle, Solid, PartiallyLit>_median +0.0075 +0.0073 81143 81748 81136 81730 Render<LeftTriangle, Solid, PartiallyLit>_stddev +0.8663 +0.8787 167 311 164 307 Render<LeftTriangle, Solid, PartiallyLit>_cv +0.8542 +0.8665 0 0 0 0 Render<LeftTriangle, Transparent, FullyLit>_pvalue 0.0028 0.0017 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyLit>_mean -0.0239 -0.0239 94989 92719 94973 92703 Render<LeftTriangle, Transparent, FullyLit>_median -0.0122 -0.0123 93867 92717 93856 92704 Render<LeftTriangle, Transparent, FullyLit>_stddev -0.9920 -0.9955 2370 19 2368 11 Render<LeftTriangle, Transparent, FullyLit>_cv -0.9918 -0.9954 0 0 0 0 Render<LeftTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyDark>_mean -0.0841 -0.0841 76234 69821 76220 69809 Render<LeftTriangle, Transparent, FullyDark>_median -0.0831 -0.0832 76209 69877 76202 69864 Render<LeftTriangle, Transparent, FullyDark>_stddev -0.4486 -0.4538 441 243 440 241 Render<LeftTriangle, Transparent, FullyDark>_cv -0.3979 -0.4037 0 0 0 0 Render<LeftTriangle, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, PartiallyLit>_mean +0.0022 +0.0021 128812 129091 128792 129067 Render<LeftTriangle, Transparent, PartiallyLit>_median +0.0023 +0.0023 128820 129115 128805 129096 Render<LeftTriangle, Transparent, PartiallyLit>_stddev +0.8757 +0.6866 50 93 53 90 Render<LeftTriangle, Transparent, PartiallyLit>_cv +0.8716 +0.6830 0 0 0 0 Render<RightTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyLit>_mean +0.0057 +0.0057 8521 8570 8520 8569 Render<RightTriangle, Solid, FullyLit>_median +0.0057 +0.0057 8522 8570 8520 8568 Render<RightTriangle, Solid, FullyLit>_stddev -0.1826 -0.0420 1 1 1 1 Render<RightTriangle, Solid, FullyLit>_cv -0.1872 -0.0475 0 0 0 0 Render<RightTriangle, Solid, FullyDark>_pvalue 0.0006 0.0006 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyDark>_mean -0.0303 -0.0303 22678 21991 22675 21987 Render<RightTriangle, Solid, FullyDark>_median -0.0360 -0.0359 22704 21888 22699 21883 Render<RightTriangle, Solid, FullyDark>_stddev +0.4759 +0.4648 195 288 196 287 Render<RightTriangle, Solid, FullyDark>_cv +0.5220 +0.5106 0 0 0 0 Render<RightTriangle, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, PartiallyLit>_mean +0.0338 +0.0338 83355 86170 83341 86157 Render<RightTriangle, Solid, PartiallyLit>_median +0.0347 +0.0348 83248 86140 83230 86126 Render<RightTriangle, Solid, PartiallyLit>_stddev +0.3670 +0.3423 238 326 240 322 Render<RightTriangle, Solid, PartiallyLit>_cv +0.3224 +0.2985 0 0 0 0 Render<RightTriangle, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyLit>_mean -0.0617 -0.0616 102726 96392 102706 96375 Render<RightTriangle, Transparent, FullyLit>_median -0.0598 -0.0597 102521 96394 102498 96375 Render<RightTriangle, Transparent, FullyLit>_stddev -0.9516 -0.9548 456 22 461 21 Render<RightTriangle, Transparent, FullyLit>_cv -0.9485 -0.9518 0 0 0 0 Render<RightTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyDark>_mean -0.1377 -0.1377 84505 72865 84492 72853 Render<RightTriangle, Transparent, FullyDark>_median -0.1374 -0.1374 84339 72748 84323 72740 Render<RightTriangle, Transparent, FullyDark>_stddev -0.2760 -0.2867 526 381 528 377 Render<RightTriangle, Transparent, FullyDark>_cv -0.1604 -0.1727 0 0 0 0 Render<RightTriangle, Transparent, PartiallyLit>_pvalue 0.0036 0.0017 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, PartiallyLit>_mean +0.0010 +0.0010 131672 131808 131649 131784 Render<RightTriangle, Transparent, PartiallyLit>_median +0.0010 +0.0008 131665 131797 131654 131757 Render<RightTriangle, Transparent, PartiallyLit>_stddev -0.0688 -0.0128 81 75 72 71 Render<RightTriangle, Transparent, PartiallyLit>_cv -0.0697 -0.0138 0 0 0 0 Render<TransparentSquare, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyLit>_mean -0.0300 -0.0300 143323 139021 143300 139000 Render<TransparentSquare, Solid, FullyLit>_median -0.0300 -0.0301 143321 139014 143310 138990 Render<TransparentSquare, Solid, FullyLit>_stddev +0.0008 -0.0820 43 43 43 39 Render<TransparentSquare, Solid, FullyLit>_cv +0.0318 -0.0536 0 0 0 0 Render<TransparentSquare, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyDark>_mean -0.0100 -0.0100 134939 133588 134914 133565 Render<TransparentSquare, Solid, FullyDark>_median -0.0106 -0.0108 134964 133526 134948 133497 Render<TransparentSquare, Solid, FullyDark>_stddev +1.7508 +1.8682 99 273 96 276 Render<TransparentSquare, Solid, FullyDark>_cv +1.7786 +1.8972 0 0 0 0 Render<TransparentSquare, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, PartiallyLit>_mean -0.0460 -0.0460 152043 145043 152016 145020 Render<TransparentSquare, Solid, PartiallyLit>_median -0.0463 -0.0461 152012 144978 151964 144962 Render<TransparentSquare, Solid, PartiallyLit>_stddev -0.4453 -0.4334 267 148 266 151 Render<TransparentSquare, Solid, PartiallyLit>_cv -0.4185 -0.4060 0 0 0 0 Render<TransparentSquare, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyLit>_mean -0.0846 -0.0846 181333 165997 181304 165969 Render<TransparentSquare, Transparent, FullyLit>_median -0.0840 -0.0839 181184 165972 181147 165945 Render<TransparentSquare, Transparent, FullyLit>_stddev -0.5808 -0.5755 319 134 320 136 Render<TransparentSquare, Transparent, FullyLit>_cv -0.5421 -0.5362 0 0 0 0 Render<TransparentSquare, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyDark>_mean -0.0250 -0.0250 142232 138672 142208 138648 Render<TransparentSquare, Transparent, FullyDark>_median -0.0245 -0.0245 142144 138663 142128 138639 Render<TransparentSquare, Transparent, FullyDark>_stddev +0.1011 +0.0806 288 317 290 313 Render<TransparentSquare, Transparent, FullyDark>_cv +0.1294 +0.1084 0 0 0 0 Render<TransparentSquare, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, PartiallyLit>_mean +0.0105 +0.0105 205439 207589 205397 207556 Render<TransparentSquare, Transparent, PartiallyLit>_median +0.0106 +0.0107 205402 207575 205355 207558 Render<TransparentSquare, Transparent, PartiallyLit>_stddev -0.4410 -0.3876 182 102 167 102 Render<TransparentSquare, Transparent, PartiallyLit>_cv -0.4468 -0.3940 0 0 0 0 Render<Square, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyLit>_mean -0.0010 -0.0010 11109 11098 11107 11096 Render<Square, Solid, FullyLit>_median -0.0010 -0.0010 11109 11097 11107 11095 Render<Square, Solid, FullyLit>_stddev -0.2265 +0.2791 3 2 2 2 Render<Square, Solid, FullyLit>_cv -0.2257 +0.2804 0 0 0 0 Render<Square, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyDark>_mean +0.0904 +0.0904 8513 9283 8512 9282 Render<Square, Solid, FullyDark>_median +0.0902 +0.0902 8521 9290 8519 9288 Render<Square, Solid, FullyDark>_stddev -0.1884 -0.1616 21 17 21 18 Render<Square, Solid, FullyDark>_cv -0.2557 -0.2311 0 0 0 0 Render<Square, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, PartiallyLit>_mean +0.0038 +0.0038 163661 164289 163632 164259 Render<Square, Solid, PartiallyLit>_median +0.0038 +0.0040 163665 164290 163621 164269 Render<Square, Solid, PartiallyLit>_stddev +0.1746 +0.4412 34 40 28 40 Render<Square, Solid, PartiallyLit>_cv +0.1701 +0.4356 0 0 0 0 Render<Square, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyLit>_mean -0.0029 -0.0029 197906 197340 197876 197304 Render<Square, Transparent, FullyLit>_median -0.0030 -0.0029 197929 197339 197872 197307 Render<Square, Transparent, FullyLit>_stddev -0.5965 -0.7554 61 25 62 15 Render<Square, Transparent, FullyLit>_cv -0.5953 -0.7547 0 0 0 0 Render<Square, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyDark>_mean -0.0163 -0.0163 125659 123607 125641 123588 Render<Square, Transparent, FullyDark>_median -0.0163 -0.0163 125651 123609 125629 123579 Render<Square, Transparent, FullyDark>_stddev -0.7943 -0.8033 180 37 181 36 Render<Square, Transparent, FullyDark>_cv -0.7909 -0.8000 0 0 0 0 Render<Square, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, PartiallyLit>_mean +0.0182 +0.0182 278103 283157 278043 283107 Render<Square, Transparent, PartiallyLit>_median +0.0184 +0.0184 278086 283190 278017 283120 Render<Square, Transparent, PartiallyLit>_stddev +1.6051 +1.5303 81 210 82 209 Render<Square, Transparent, PartiallyLit>_cv +1.5586 +1.4850 0 0 0 0 Render<LeftTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyLit>_mean -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_median -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_stddev -0.4844 -0.6856 1 0 1 0 Render<LeftTrapezoid, Solid, FullyLit>_cv -0.4809 -0.6834 0 0 0 0 Render<LeftTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyDark>_mean +0.3996 +0.3997 5163 7227 5162 7226 Render<LeftTrapezoid, Solid, FullyDark>_median +0.3973 +0.3974 5174 7230 5173 7229 Render<LeftTrapezoid, Solid, FullyDark>_stddev -0.7835 -0.7789 89 19 89 20 Render<LeftTrapezoid, Solid, FullyDark>_cv -0.8453 -0.8420 0 0 0 0 Render<LeftTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, PartiallyLit>_mean -0.1228 -0.1228 50053 43907 50044 43900 Render<LeftTrapezoid, Solid, PartiallyLit>_median -0.1228 -0.1228 50062 43916 50054 43906 Render<LeftTrapezoid, Solid, PartiallyLit>_stddev +1.3916 +1.3800 63 150 64 151 Render<LeftTrapezoid, Solid, PartiallyLit>_cv +1.7263 +1.7131 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyLit>_mean -0.1584 -0.1583 62677 52751 62665 52743 Render<LeftTrapezoid, Transparent, FullyLit>_median -0.1585 -0.1585 62670 52736 62656 52728 Render<LeftTrapezoid, Transparent, FullyLit>_stddev +1.1429 +1.4086 26 55 23 55 Render<LeftTrapezoid, Transparent, FullyLit>_cv +1.5461 +1.8617 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyDark>_mean -0.1929 -0.1929 57688 46558 57679 46551 Render<LeftTrapezoid, Transparent, FullyDark>_median -0.1943 -0.1944 57681 46473 57672 46459 Render<LeftTrapezoid, Transparent, FullyDark>_stddev +2.8190 +2.7914 62 237 63 238 Render<LeftTrapezoid, Transparent, FullyDark>_cv +3.7319 +3.6978 0 0 0 0 Render<LeftTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, PartiallyLit>_mean -0.0054 -0.0054 70694 70313 70682 70301 Render<LeftTrapezoid, Transparent, PartiallyLit>_median -0.0050 -0.0048 70671 70319 70650 70311 Render<LeftTrapezoid, Transparent, PartiallyLit>_stddev -0.7448 -0.7617 163 42 168 40 Render<LeftTrapezoid, Transparent, PartiallyLit>_cv -0.7434 -0.7604 0 0 0 0 Render<RightTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyLit>_mean +0.0123 +0.0123 2985 3022 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_median +0.0123 +0.0123 2985 3021 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_stddev -0.4207 -0.4667 1 0 1 0 Render<RightTrapezoid, Solid, FullyLit>_cv -0.4277 -0.4731 0 0 0 0 Render<RightTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyDark>_mean +0.1105 +0.1105 4894 5435 4893 5434 Render<RightTrapezoid, Solid, FullyDark>_median +0.1083 +0.1082 4902 5433 4901 5432 Render<RightTrapezoid, Solid, FullyDark>_stddev -0.1973 -0.1947 45 37 45 37 Render<RightTrapezoid, Solid, FullyDark>_cv -0.2772 -0.2748 0 0 0 0 Render<RightTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, PartiallyLit>_mean -0.0169 -0.0169 48201 47386 48192 47379 Render<RightTrapezoid, Solid, PartiallyLit>_median -0.0172 -0.0170 48184 47355 48170 47351 Render<RightTrapezoid, Solid, PartiallyLit>_stddev +0.6070 +0.5204 48 78 50 76 Render<RightTrapezoid, Solid, PartiallyLit>_cv +0.6346 +0.5465 0 0 0 0 Render<RightTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyLit>_mean -0.0023 -0.0023 48751 48639 48742 48632 Render<RightTrapezoid, Transparent, FullyLit>_median -0.0020 -0.0018 48751 48654 48738 48651 Render<RightTrapezoid, Transparent, FullyLit>_stddev +2.4354 +2.4427 10 35 11 36 Render<RightTrapezoid, Transparent, FullyLit>_cv +2.4433 +2.4505 0 0 0 0 Render<RightTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyDark>_mean -0.2247 -0.2247 40942 31742 40936 31736 Render<RightTrapezoid, Transparent, FullyDark>_median -0.2241 -0.2240 40904 31739 40895 31734 Render<RightTrapezoid, Transparent, FullyDark>_stddev -0.3455 -0.3546 165 108 167 108 Render<RightTrapezoid, Transparent, FullyDark>_cv -0.1558 -0.1676 0 0 0 0 Render<RightTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, PartiallyLit>_mean -0.0908 -0.0908 74269 67523 74256 67512 Render<RightTrapezoid, Transparent, PartiallyLit>_median -0.0898 -0.0897 74196 67536 74176 67523 Render<RightTrapezoid, Transparent, PartiallyLit>_stddev -0.6590 -0.6568 147 50 146 50 Render<RightTrapezoid, Transparent, PartiallyLit>_cv -0.6250 -0.6225 0 0 0 0 BM_RenderBlackTile_pvalue 0.0539 0.0539 U Test, Repetitions: 10 vs 10 BM_RenderBlackTile_mean -0.0188 -0.0188 125 123 125 123 BM_RenderBlackTile_median -0.0263 -0.0264 126 122 125 122 BM_RenderBlackTile_stddev +1.0907 +1.0966 1 3 1 3 BM_RenderBlackTile_cv +1.1307 +1.1368 0 0 0 0 OVERALL_GEOMEAN -0.0207 -0.0207 0 0 0 0 ```
8 months ago
pDungeonCels.get(), levelCelBlock, getFirstTileMaskRight(tileType), tbl);
}
}
}
targetBufferPosition.y -= TILE_HEIGHT;
for (uint_fast8_t i = 2, n = MicroTileLen; i < n; i += 2) {
{
const LevelCelBlock levelCelBlock { pMap->mt[i] };
if (levelCelBlock.hasValue()) {
RenderTile(out, bleedLightmap, targetBufferPosition,
Make `dun_render` a standalone library Does not make `dun_render_benchmark` standalone yet as that will require more untangling. Benchmark is neutral: ``` Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------------- Render<LeftTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyLit>_mean +0.0119 +0.0120 8377 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_median +0.0119 +0.0119 8376 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_stddev -0.0884 -0.2462 2 1 1 1 Render<LeftTriangle, Solid, FullyLit>_cv -0.0992 -0.2551 0 0 0 0 Render<LeftTriangle, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyDark>_mean +0.0910 +0.0910 21174 23100 21170 23097 Render<LeftTriangle, Solid, FullyDark>_median +0.0869 +0.0869 21183 23023 21179 23019 Render<LeftTriangle, Solid, FullyDark>_stddev -0.1528 -0.1593 267 226 268 225 Render<LeftTriangle, Solid, FullyDark>_cv -0.2234 -0.2294 0 0 0 0 Render<LeftTriangle, Solid, PartiallyLit>_pvalue 0.0013 0.0013 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, PartiallyLit>_mean +0.0065 +0.0065 81168 81698 81151 81680 Render<LeftTriangle, Solid, PartiallyLit>_median +0.0075 +0.0073 81143 81748 81136 81730 Render<LeftTriangle, Solid, PartiallyLit>_stddev +0.8663 +0.8787 167 311 164 307 Render<LeftTriangle, Solid, PartiallyLit>_cv +0.8542 +0.8665 0 0 0 0 Render<LeftTriangle, Transparent, FullyLit>_pvalue 0.0028 0.0017 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyLit>_mean -0.0239 -0.0239 94989 92719 94973 92703 Render<LeftTriangle, Transparent, FullyLit>_median -0.0122 -0.0123 93867 92717 93856 92704 Render<LeftTriangle, Transparent, FullyLit>_stddev -0.9920 -0.9955 2370 19 2368 11 Render<LeftTriangle, Transparent, FullyLit>_cv -0.9918 -0.9954 0 0 0 0 Render<LeftTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyDark>_mean -0.0841 -0.0841 76234 69821 76220 69809 Render<LeftTriangle, Transparent, FullyDark>_median -0.0831 -0.0832 76209 69877 76202 69864 Render<LeftTriangle, Transparent, FullyDark>_stddev -0.4486 -0.4538 441 243 440 241 Render<LeftTriangle, Transparent, FullyDark>_cv -0.3979 -0.4037 0 0 0 0 Render<LeftTriangle, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, PartiallyLit>_mean +0.0022 +0.0021 128812 129091 128792 129067 Render<LeftTriangle, Transparent, PartiallyLit>_median +0.0023 +0.0023 128820 129115 128805 129096 Render<LeftTriangle, Transparent, PartiallyLit>_stddev +0.8757 +0.6866 50 93 53 90 Render<LeftTriangle, Transparent, PartiallyLit>_cv +0.8716 +0.6830 0 0 0 0 Render<RightTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyLit>_mean +0.0057 +0.0057 8521 8570 8520 8569 Render<RightTriangle, Solid, FullyLit>_median +0.0057 +0.0057 8522 8570 8520 8568 Render<RightTriangle, Solid, FullyLit>_stddev -0.1826 -0.0420 1 1 1 1 Render<RightTriangle, Solid, FullyLit>_cv -0.1872 -0.0475 0 0 0 0 Render<RightTriangle, Solid, FullyDark>_pvalue 0.0006 0.0006 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyDark>_mean -0.0303 -0.0303 22678 21991 22675 21987 Render<RightTriangle, Solid, FullyDark>_median -0.0360 -0.0359 22704 21888 22699 21883 Render<RightTriangle, Solid, FullyDark>_stddev +0.4759 +0.4648 195 288 196 287 Render<RightTriangle, Solid, FullyDark>_cv +0.5220 +0.5106 0 0 0 0 Render<RightTriangle, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, PartiallyLit>_mean +0.0338 +0.0338 83355 86170 83341 86157 Render<RightTriangle, Solid, PartiallyLit>_median +0.0347 +0.0348 83248 86140 83230 86126 Render<RightTriangle, Solid, PartiallyLit>_stddev +0.3670 +0.3423 238 326 240 322 Render<RightTriangle, Solid, PartiallyLit>_cv +0.3224 +0.2985 0 0 0 0 Render<RightTriangle, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyLit>_mean -0.0617 -0.0616 102726 96392 102706 96375 Render<RightTriangle, Transparent, FullyLit>_median -0.0598 -0.0597 102521 96394 102498 96375 Render<RightTriangle, Transparent, FullyLit>_stddev -0.9516 -0.9548 456 22 461 21 Render<RightTriangle, Transparent, FullyLit>_cv -0.9485 -0.9518 0 0 0 0 Render<RightTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyDark>_mean -0.1377 -0.1377 84505 72865 84492 72853 Render<RightTriangle, Transparent, FullyDark>_median -0.1374 -0.1374 84339 72748 84323 72740 Render<RightTriangle, Transparent, FullyDark>_stddev -0.2760 -0.2867 526 381 528 377 Render<RightTriangle, Transparent, FullyDark>_cv -0.1604 -0.1727 0 0 0 0 Render<RightTriangle, Transparent, PartiallyLit>_pvalue 0.0036 0.0017 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, PartiallyLit>_mean +0.0010 +0.0010 131672 131808 131649 131784 Render<RightTriangle, Transparent, PartiallyLit>_median +0.0010 +0.0008 131665 131797 131654 131757 Render<RightTriangle, Transparent, PartiallyLit>_stddev -0.0688 -0.0128 81 75 72 71 Render<RightTriangle, Transparent, PartiallyLit>_cv -0.0697 -0.0138 0 0 0 0 Render<TransparentSquare, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyLit>_mean -0.0300 -0.0300 143323 139021 143300 139000 Render<TransparentSquare, Solid, FullyLit>_median -0.0300 -0.0301 143321 139014 143310 138990 Render<TransparentSquare, Solid, FullyLit>_stddev +0.0008 -0.0820 43 43 43 39 Render<TransparentSquare, Solid, FullyLit>_cv +0.0318 -0.0536 0 0 0 0 Render<TransparentSquare, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyDark>_mean -0.0100 -0.0100 134939 133588 134914 133565 Render<TransparentSquare, Solid, FullyDark>_median -0.0106 -0.0108 134964 133526 134948 133497 Render<TransparentSquare, Solid, FullyDark>_stddev +1.7508 +1.8682 99 273 96 276 Render<TransparentSquare, Solid, FullyDark>_cv +1.7786 +1.8972 0 0 0 0 Render<TransparentSquare, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, PartiallyLit>_mean -0.0460 -0.0460 152043 145043 152016 145020 Render<TransparentSquare, Solid, PartiallyLit>_median -0.0463 -0.0461 152012 144978 151964 144962 Render<TransparentSquare, Solid, PartiallyLit>_stddev -0.4453 -0.4334 267 148 266 151 Render<TransparentSquare, Solid, PartiallyLit>_cv -0.4185 -0.4060 0 0 0 0 Render<TransparentSquare, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyLit>_mean -0.0846 -0.0846 181333 165997 181304 165969 Render<TransparentSquare, Transparent, FullyLit>_median -0.0840 -0.0839 181184 165972 181147 165945 Render<TransparentSquare, Transparent, FullyLit>_stddev -0.5808 -0.5755 319 134 320 136 Render<TransparentSquare, Transparent, FullyLit>_cv -0.5421 -0.5362 0 0 0 0 Render<TransparentSquare, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyDark>_mean -0.0250 -0.0250 142232 138672 142208 138648 Render<TransparentSquare, Transparent, FullyDark>_median -0.0245 -0.0245 142144 138663 142128 138639 Render<TransparentSquare, Transparent, FullyDark>_stddev +0.1011 +0.0806 288 317 290 313 Render<TransparentSquare, Transparent, FullyDark>_cv +0.1294 +0.1084 0 0 0 0 Render<TransparentSquare, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, PartiallyLit>_mean +0.0105 +0.0105 205439 207589 205397 207556 Render<TransparentSquare, Transparent, PartiallyLit>_median +0.0106 +0.0107 205402 207575 205355 207558 Render<TransparentSquare, Transparent, PartiallyLit>_stddev -0.4410 -0.3876 182 102 167 102 Render<TransparentSquare, Transparent, PartiallyLit>_cv -0.4468 -0.3940 0 0 0 0 Render<Square, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyLit>_mean -0.0010 -0.0010 11109 11098 11107 11096 Render<Square, Solid, FullyLit>_median -0.0010 -0.0010 11109 11097 11107 11095 Render<Square, Solid, FullyLit>_stddev -0.2265 +0.2791 3 2 2 2 Render<Square, Solid, FullyLit>_cv -0.2257 +0.2804 0 0 0 0 Render<Square, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyDark>_mean +0.0904 +0.0904 8513 9283 8512 9282 Render<Square, Solid, FullyDark>_median +0.0902 +0.0902 8521 9290 8519 9288 Render<Square, Solid, FullyDark>_stddev -0.1884 -0.1616 21 17 21 18 Render<Square, Solid, FullyDark>_cv -0.2557 -0.2311 0 0 0 0 Render<Square, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, PartiallyLit>_mean +0.0038 +0.0038 163661 164289 163632 164259 Render<Square, Solid, PartiallyLit>_median +0.0038 +0.0040 163665 164290 163621 164269 Render<Square, Solid, PartiallyLit>_stddev +0.1746 +0.4412 34 40 28 40 Render<Square, Solid, PartiallyLit>_cv +0.1701 +0.4356 0 0 0 0 Render<Square, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyLit>_mean -0.0029 -0.0029 197906 197340 197876 197304 Render<Square, Transparent, FullyLit>_median -0.0030 -0.0029 197929 197339 197872 197307 Render<Square, Transparent, FullyLit>_stddev -0.5965 -0.7554 61 25 62 15 Render<Square, Transparent, FullyLit>_cv -0.5953 -0.7547 0 0 0 0 Render<Square, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyDark>_mean -0.0163 -0.0163 125659 123607 125641 123588 Render<Square, Transparent, FullyDark>_median -0.0163 -0.0163 125651 123609 125629 123579 Render<Square, Transparent, FullyDark>_stddev -0.7943 -0.8033 180 37 181 36 Render<Square, Transparent, FullyDark>_cv -0.7909 -0.8000 0 0 0 0 Render<Square, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, PartiallyLit>_mean +0.0182 +0.0182 278103 283157 278043 283107 Render<Square, Transparent, PartiallyLit>_median +0.0184 +0.0184 278086 283190 278017 283120 Render<Square, Transparent, PartiallyLit>_stddev +1.6051 +1.5303 81 210 82 209 Render<Square, Transparent, PartiallyLit>_cv +1.5586 +1.4850 0 0 0 0 Render<LeftTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyLit>_mean -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_median -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_stddev -0.4844 -0.6856 1 0 1 0 Render<LeftTrapezoid, Solid, FullyLit>_cv -0.4809 -0.6834 0 0 0 0 Render<LeftTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyDark>_mean +0.3996 +0.3997 5163 7227 5162 7226 Render<LeftTrapezoid, Solid, FullyDark>_median +0.3973 +0.3974 5174 7230 5173 7229 Render<LeftTrapezoid, Solid, FullyDark>_stddev -0.7835 -0.7789 89 19 89 20 Render<LeftTrapezoid, Solid, FullyDark>_cv -0.8453 -0.8420 0 0 0 0 Render<LeftTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, PartiallyLit>_mean -0.1228 -0.1228 50053 43907 50044 43900 Render<LeftTrapezoid, Solid, PartiallyLit>_median -0.1228 -0.1228 50062 43916 50054 43906 Render<LeftTrapezoid, Solid, PartiallyLit>_stddev +1.3916 +1.3800 63 150 64 151 Render<LeftTrapezoid, Solid, PartiallyLit>_cv +1.7263 +1.7131 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyLit>_mean -0.1584 -0.1583 62677 52751 62665 52743 Render<LeftTrapezoid, Transparent, FullyLit>_median -0.1585 -0.1585 62670 52736 62656 52728 Render<LeftTrapezoid, Transparent, FullyLit>_stddev +1.1429 +1.4086 26 55 23 55 Render<LeftTrapezoid, Transparent, FullyLit>_cv +1.5461 +1.8617 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyDark>_mean -0.1929 -0.1929 57688 46558 57679 46551 Render<LeftTrapezoid, Transparent, FullyDark>_median -0.1943 -0.1944 57681 46473 57672 46459 Render<LeftTrapezoid, Transparent, FullyDark>_stddev +2.8190 +2.7914 62 237 63 238 Render<LeftTrapezoid, Transparent, FullyDark>_cv +3.7319 +3.6978 0 0 0 0 Render<LeftTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, PartiallyLit>_mean -0.0054 -0.0054 70694 70313 70682 70301 Render<LeftTrapezoid, Transparent, PartiallyLit>_median -0.0050 -0.0048 70671 70319 70650 70311 Render<LeftTrapezoid, Transparent, PartiallyLit>_stddev -0.7448 -0.7617 163 42 168 40 Render<LeftTrapezoid, Transparent, PartiallyLit>_cv -0.7434 -0.7604 0 0 0 0 Render<RightTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyLit>_mean +0.0123 +0.0123 2985 3022 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_median +0.0123 +0.0123 2985 3021 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_stddev -0.4207 -0.4667 1 0 1 0 Render<RightTrapezoid, Solid, FullyLit>_cv -0.4277 -0.4731 0 0 0 0 Render<RightTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyDark>_mean +0.1105 +0.1105 4894 5435 4893 5434 Render<RightTrapezoid, Solid, FullyDark>_median +0.1083 +0.1082 4902 5433 4901 5432 Render<RightTrapezoid, Solid, FullyDark>_stddev -0.1973 -0.1947 45 37 45 37 Render<RightTrapezoid, Solid, FullyDark>_cv -0.2772 -0.2748 0 0 0 0 Render<RightTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, PartiallyLit>_mean -0.0169 -0.0169 48201 47386 48192 47379 Render<RightTrapezoid, Solid, PartiallyLit>_median -0.0172 -0.0170 48184 47355 48170 47351 Render<RightTrapezoid, Solid, PartiallyLit>_stddev +0.6070 +0.5204 48 78 50 76 Render<RightTrapezoid, Solid, PartiallyLit>_cv +0.6346 +0.5465 0 0 0 0 Render<RightTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyLit>_mean -0.0023 -0.0023 48751 48639 48742 48632 Render<RightTrapezoid, Transparent, FullyLit>_median -0.0020 -0.0018 48751 48654 48738 48651 Render<RightTrapezoid, Transparent, FullyLit>_stddev +2.4354 +2.4427 10 35 11 36 Render<RightTrapezoid, Transparent, FullyLit>_cv +2.4433 +2.4505 0 0 0 0 Render<RightTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyDark>_mean -0.2247 -0.2247 40942 31742 40936 31736 Render<RightTrapezoid, Transparent, FullyDark>_median -0.2241 -0.2240 40904 31739 40895 31734 Render<RightTrapezoid, Transparent, FullyDark>_stddev -0.3455 -0.3546 165 108 167 108 Render<RightTrapezoid, Transparent, FullyDark>_cv -0.1558 -0.1676 0 0 0 0 Render<RightTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, PartiallyLit>_mean -0.0908 -0.0908 74269 67523 74256 67512 Render<RightTrapezoid, Transparent, PartiallyLit>_median -0.0898 -0.0897 74196 67536 74176 67523 Render<RightTrapezoid, Transparent, PartiallyLit>_stddev -0.6590 -0.6568 147 50 146 50 Render<RightTrapezoid, Transparent, PartiallyLit>_cv -0.6250 -0.6225 0 0 0 0 BM_RenderBlackTile_pvalue 0.0539 0.0539 U Test, Repetitions: 10 vs 10 BM_RenderBlackTile_mean -0.0188 -0.0188 125 123 125 123 BM_RenderBlackTile_median -0.0263 -0.0264 126 122 125 122 BM_RenderBlackTile_stddev +1.0907 +1.0966 1 3 1 3 BM_RenderBlackTile_cv +1.1307 +1.1368 0 0 0 0 OVERALL_GEOMEAN -0.0207 -0.0207 0 0 0 0 ```
8 months ago
pDungeonCels.get(), levelCelBlock,
transparency ? MaskType::Transparent : MaskType::Solid, foliageTbl);
}
}
{
const LevelCelBlock levelCelBlock { pMap->mt[i + 1] };
if (levelCelBlock.hasValue()) {
RenderTile(out, bleedLightmap, targetBufferPosition + RightFrameDisplacement,
Make `dun_render` a standalone library Does not make `dun_render_benchmark` standalone yet as that will require more untangling. Benchmark is neutral: ``` Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------------- Render<LeftTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyLit>_mean +0.0119 +0.0120 8377 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_median +0.0119 +0.0119 8376 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_stddev -0.0884 -0.2462 2 1 1 1 Render<LeftTriangle, Solid, FullyLit>_cv -0.0992 -0.2551 0 0 0 0 Render<LeftTriangle, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyDark>_mean +0.0910 +0.0910 21174 23100 21170 23097 Render<LeftTriangle, Solid, FullyDark>_median +0.0869 +0.0869 21183 23023 21179 23019 Render<LeftTriangle, Solid, FullyDark>_stddev -0.1528 -0.1593 267 226 268 225 Render<LeftTriangle, Solid, FullyDark>_cv -0.2234 -0.2294 0 0 0 0 Render<LeftTriangle, Solid, PartiallyLit>_pvalue 0.0013 0.0013 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, PartiallyLit>_mean +0.0065 +0.0065 81168 81698 81151 81680 Render<LeftTriangle, Solid, PartiallyLit>_median +0.0075 +0.0073 81143 81748 81136 81730 Render<LeftTriangle, Solid, PartiallyLit>_stddev +0.8663 +0.8787 167 311 164 307 Render<LeftTriangle, Solid, PartiallyLit>_cv +0.8542 +0.8665 0 0 0 0 Render<LeftTriangle, Transparent, FullyLit>_pvalue 0.0028 0.0017 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyLit>_mean -0.0239 -0.0239 94989 92719 94973 92703 Render<LeftTriangle, Transparent, FullyLit>_median -0.0122 -0.0123 93867 92717 93856 92704 Render<LeftTriangle, Transparent, FullyLit>_stddev -0.9920 -0.9955 2370 19 2368 11 Render<LeftTriangle, Transparent, FullyLit>_cv -0.9918 -0.9954 0 0 0 0 Render<LeftTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyDark>_mean -0.0841 -0.0841 76234 69821 76220 69809 Render<LeftTriangle, Transparent, FullyDark>_median -0.0831 -0.0832 76209 69877 76202 69864 Render<LeftTriangle, Transparent, FullyDark>_stddev -0.4486 -0.4538 441 243 440 241 Render<LeftTriangle, Transparent, FullyDark>_cv -0.3979 -0.4037 0 0 0 0 Render<LeftTriangle, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, PartiallyLit>_mean +0.0022 +0.0021 128812 129091 128792 129067 Render<LeftTriangle, Transparent, PartiallyLit>_median +0.0023 +0.0023 128820 129115 128805 129096 Render<LeftTriangle, Transparent, PartiallyLit>_stddev +0.8757 +0.6866 50 93 53 90 Render<LeftTriangle, Transparent, PartiallyLit>_cv +0.8716 +0.6830 0 0 0 0 Render<RightTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyLit>_mean +0.0057 +0.0057 8521 8570 8520 8569 Render<RightTriangle, Solid, FullyLit>_median +0.0057 +0.0057 8522 8570 8520 8568 Render<RightTriangle, Solid, FullyLit>_stddev -0.1826 -0.0420 1 1 1 1 Render<RightTriangle, Solid, FullyLit>_cv -0.1872 -0.0475 0 0 0 0 Render<RightTriangle, Solid, FullyDark>_pvalue 0.0006 0.0006 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyDark>_mean -0.0303 -0.0303 22678 21991 22675 21987 Render<RightTriangle, Solid, FullyDark>_median -0.0360 -0.0359 22704 21888 22699 21883 Render<RightTriangle, Solid, FullyDark>_stddev +0.4759 +0.4648 195 288 196 287 Render<RightTriangle, Solid, FullyDark>_cv +0.5220 +0.5106 0 0 0 0 Render<RightTriangle, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, PartiallyLit>_mean +0.0338 +0.0338 83355 86170 83341 86157 Render<RightTriangle, Solid, PartiallyLit>_median +0.0347 +0.0348 83248 86140 83230 86126 Render<RightTriangle, Solid, PartiallyLit>_stddev +0.3670 +0.3423 238 326 240 322 Render<RightTriangle, Solid, PartiallyLit>_cv +0.3224 +0.2985 0 0 0 0 Render<RightTriangle, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyLit>_mean -0.0617 -0.0616 102726 96392 102706 96375 Render<RightTriangle, Transparent, FullyLit>_median -0.0598 -0.0597 102521 96394 102498 96375 Render<RightTriangle, Transparent, FullyLit>_stddev -0.9516 -0.9548 456 22 461 21 Render<RightTriangle, Transparent, FullyLit>_cv -0.9485 -0.9518 0 0 0 0 Render<RightTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyDark>_mean -0.1377 -0.1377 84505 72865 84492 72853 Render<RightTriangle, Transparent, FullyDark>_median -0.1374 -0.1374 84339 72748 84323 72740 Render<RightTriangle, Transparent, FullyDark>_stddev -0.2760 -0.2867 526 381 528 377 Render<RightTriangle, Transparent, FullyDark>_cv -0.1604 -0.1727 0 0 0 0 Render<RightTriangle, Transparent, PartiallyLit>_pvalue 0.0036 0.0017 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, PartiallyLit>_mean +0.0010 +0.0010 131672 131808 131649 131784 Render<RightTriangle, Transparent, PartiallyLit>_median +0.0010 +0.0008 131665 131797 131654 131757 Render<RightTriangle, Transparent, PartiallyLit>_stddev -0.0688 -0.0128 81 75 72 71 Render<RightTriangle, Transparent, PartiallyLit>_cv -0.0697 -0.0138 0 0 0 0 Render<TransparentSquare, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyLit>_mean -0.0300 -0.0300 143323 139021 143300 139000 Render<TransparentSquare, Solid, FullyLit>_median -0.0300 -0.0301 143321 139014 143310 138990 Render<TransparentSquare, Solid, FullyLit>_stddev +0.0008 -0.0820 43 43 43 39 Render<TransparentSquare, Solid, FullyLit>_cv +0.0318 -0.0536 0 0 0 0 Render<TransparentSquare, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyDark>_mean -0.0100 -0.0100 134939 133588 134914 133565 Render<TransparentSquare, Solid, FullyDark>_median -0.0106 -0.0108 134964 133526 134948 133497 Render<TransparentSquare, Solid, FullyDark>_stddev +1.7508 +1.8682 99 273 96 276 Render<TransparentSquare, Solid, FullyDark>_cv +1.7786 +1.8972 0 0 0 0 Render<TransparentSquare, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, PartiallyLit>_mean -0.0460 -0.0460 152043 145043 152016 145020 Render<TransparentSquare, Solid, PartiallyLit>_median -0.0463 -0.0461 152012 144978 151964 144962 Render<TransparentSquare, Solid, PartiallyLit>_stddev -0.4453 -0.4334 267 148 266 151 Render<TransparentSquare, Solid, PartiallyLit>_cv -0.4185 -0.4060 0 0 0 0 Render<TransparentSquare, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyLit>_mean -0.0846 -0.0846 181333 165997 181304 165969 Render<TransparentSquare, Transparent, FullyLit>_median -0.0840 -0.0839 181184 165972 181147 165945 Render<TransparentSquare, Transparent, FullyLit>_stddev -0.5808 -0.5755 319 134 320 136 Render<TransparentSquare, Transparent, FullyLit>_cv -0.5421 -0.5362 0 0 0 0 Render<TransparentSquare, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyDark>_mean -0.0250 -0.0250 142232 138672 142208 138648 Render<TransparentSquare, Transparent, FullyDark>_median -0.0245 -0.0245 142144 138663 142128 138639 Render<TransparentSquare, Transparent, FullyDark>_stddev +0.1011 +0.0806 288 317 290 313 Render<TransparentSquare, Transparent, FullyDark>_cv +0.1294 +0.1084 0 0 0 0 Render<TransparentSquare, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, PartiallyLit>_mean +0.0105 +0.0105 205439 207589 205397 207556 Render<TransparentSquare, Transparent, PartiallyLit>_median +0.0106 +0.0107 205402 207575 205355 207558 Render<TransparentSquare, Transparent, PartiallyLit>_stddev -0.4410 -0.3876 182 102 167 102 Render<TransparentSquare, Transparent, PartiallyLit>_cv -0.4468 -0.3940 0 0 0 0 Render<Square, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyLit>_mean -0.0010 -0.0010 11109 11098 11107 11096 Render<Square, Solid, FullyLit>_median -0.0010 -0.0010 11109 11097 11107 11095 Render<Square, Solid, FullyLit>_stddev -0.2265 +0.2791 3 2 2 2 Render<Square, Solid, FullyLit>_cv -0.2257 +0.2804 0 0 0 0 Render<Square, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyDark>_mean +0.0904 +0.0904 8513 9283 8512 9282 Render<Square, Solid, FullyDark>_median +0.0902 +0.0902 8521 9290 8519 9288 Render<Square, Solid, FullyDark>_stddev -0.1884 -0.1616 21 17 21 18 Render<Square, Solid, FullyDark>_cv -0.2557 -0.2311 0 0 0 0 Render<Square, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, PartiallyLit>_mean +0.0038 +0.0038 163661 164289 163632 164259 Render<Square, Solid, PartiallyLit>_median +0.0038 +0.0040 163665 164290 163621 164269 Render<Square, Solid, PartiallyLit>_stddev +0.1746 +0.4412 34 40 28 40 Render<Square, Solid, PartiallyLit>_cv +0.1701 +0.4356 0 0 0 0 Render<Square, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyLit>_mean -0.0029 -0.0029 197906 197340 197876 197304 Render<Square, Transparent, FullyLit>_median -0.0030 -0.0029 197929 197339 197872 197307 Render<Square, Transparent, FullyLit>_stddev -0.5965 -0.7554 61 25 62 15 Render<Square, Transparent, FullyLit>_cv -0.5953 -0.7547 0 0 0 0 Render<Square, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyDark>_mean -0.0163 -0.0163 125659 123607 125641 123588 Render<Square, Transparent, FullyDark>_median -0.0163 -0.0163 125651 123609 125629 123579 Render<Square, Transparent, FullyDark>_stddev -0.7943 -0.8033 180 37 181 36 Render<Square, Transparent, FullyDark>_cv -0.7909 -0.8000 0 0 0 0 Render<Square, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, PartiallyLit>_mean +0.0182 +0.0182 278103 283157 278043 283107 Render<Square, Transparent, PartiallyLit>_median +0.0184 +0.0184 278086 283190 278017 283120 Render<Square, Transparent, PartiallyLit>_stddev +1.6051 +1.5303 81 210 82 209 Render<Square, Transparent, PartiallyLit>_cv +1.5586 +1.4850 0 0 0 0 Render<LeftTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyLit>_mean -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_median -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_stddev -0.4844 -0.6856 1 0 1 0 Render<LeftTrapezoid, Solid, FullyLit>_cv -0.4809 -0.6834 0 0 0 0 Render<LeftTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyDark>_mean +0.3996 +0.3997 5163 7227 5162 7226 Render<LeftTrapezoid, Solid, FullyDark>_median +0.3973 +0.3974 5174 7230 5173 7229 Render<LeftTrapezoid, Solid, FullyDark>_stddev -0.7835 -0.7789 89 19 89 20 Render<LeftTrapezoid, Solid, FullyDark>_cv -0.8453 -0.8420 0 0 0 0 Render<LeftTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, PartiallyLit>_mean -0.1228 -0.1228 50053 43907 50044 43900 Render<LeftTrapezoid, Solid, PartiallyLit>_median -0.1228 -0.1228 50062 43916 50054 43906 Render<LeftTrapezoid, Solid, PartiallyLit>_stddev +1.3916 +1.3800 63 150 64 151 Render<LeftTrapezoid, Solid, PartiallyLit>_cv +1.7263 +1.7131 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyLit>_mean -0.1584 -0.1583 62677 52751 62665 52743 Render<LeftTrapezoid, Transparent, FullyLit>_median -0.1585 -0.1585 62670 52736 62656 52728 Render<LeftTrapezoid, Transparent, FullyLit>_stddev +1.1429 +1.4086 26 55 23 55 Render<LeftTrapezoid, Transparent, FullyLit>_cv +1.5461 +1.8617 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyDark>_mean -0.1929 -0.1929 57688 46558 57679 46551 Render<LeftTrapezoid, Transparent, FullyDark>_median -0.1943 -0.1944 57681 46473 57672 46459 Render<LeftTrapezoid, Transparent, FullyDark>_stddev +2.8190 +2.7914 62 237 63 238 Render<LeftTrapezoid, Transparent, FullyDark>_cv +3.7319 +3.6978 0 0 0 0 Render<LeftTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, PartiallyLit>_mean -0.0054 -0.0054 70694 70313 70682 70301 Render<LeftTrapezoid, Transparent, PartiallyLit>_median -0.0050 -0.0048 70671 70319 70650 70311 Render<LeftTrapezoid, Transparent, PartiallyLit>_stddev -0.7448 -0.7617 163 42 168 40 Render<LeftTrapezoid, Transparent, PartiallyLit>_cv -0.7434 -0.7604 0 0 0 0 Render<RightTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyLit>_mean +0.0123 +0.0123 2985 3022 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_median +0.0123 +0.0123 2985 3021 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_stddev -0.4207 -0.4667 1 0 1 0 Render<RightTrapezoid, Solid, FullyLit>_cv -0.4277 -0.4731 0 0 0 0 Render<RightTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyDark>_mean +0.1105 +0.1105 4894 5435 4893 5434 Render<RightTrapezoid, Solid, FullyDark>_median +0.1083 +0.1082 4902 5433 4901 5432 Render<RightTrapezoid, Solid, FullyDark>_stddev -0.1973 -0.1947 45 37 45 37 Render<RightTrapezoid, Solid, FullyDark>_cv -0.2772 -0.2748 0 0 0 0 Render<RightTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, PartiallyLit>_mean -0.0169 -0.0169 48201 47386 48192 47379 Render<RightTrapezoid, Solid, PartiallyLit>_median -0.0172 -0.0170 48184 47355 48170 47351 Render<RightTrapezoid, Solid, PartiallyLit>_stddev +0.6070 +0.5204 48 78 50 76 Render<RightTrapezoid, Solid, PartiallyLit>_cv +0.6346 +0.5465 0 0 0 0 Render<RightTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyLit>_mean -0.0023 -0.0023 48751 48639 48742 48632 Render<RightTrapezoid, Transparent, FullyLit>_median -0.0020 -0.0018 48751 48654 48738 48651 Render<RightTrapezoid, Transparent, FullyLit>_stddev +2.4354 +2.4427 10 35 11 36 Render<RightTrapezoid, Transparent, FullyLit>_cv +2.4433 +2.4505 0 0 0 0 Render<RightTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyDark>_mean -0.2247 -0.2247 40942 31742 40936 31736 Render<RightTrapezoid, Transparent, FullyDark>_median -0.2241 -0.2240 40904 31739 40895 31734 Render<RightTrapezoid, Transparent, FullyDark>_stddev -0.3455 -0.3546 165 108 167 108 Render<RightTrapezoid, Transparent, FullyDark>_cv -0.1558 -0.1676 0 0 0 0 Render<RightTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, PartiallyLit>_mean -0.0908 -0.0908 74269 67523 74256 67512 Render<RightTrapezoid, Transparent, PartiallyLit>_median -0.0898 -0.0897 74196 67536 74176 67523 Render<RightTrapezoid, Transparent, PartiallyLit>_stddev -0.6590 -0.6568 147 50 146 50 Render<RightTrapezoid, Transparent, PartiallyLit>_cv -0.6250 -0.6225 0 0 0 0 BM_RenderBlackTile_pvalue 0.0539 0.0539 U Test, Repetitions: 10 vs 10 BM_RenderBlackTile_mean -0.0188 -0.0188 125 123 125 123 BM_RenderBlackTile_median -0.0263 -0.0264 126 122 125 122 BM_RenderBlackTile_stddev +1.0907 +1.0966 1 3 1 3 BM_RenderBlackTile_cv +1.1307 +1.1368 0 0 0 0 OVERALL_GEOMEAN -0.0207 -0.0207 0 0 0 0 ```
8 months ago
pDungeonCels.get(), levelCelBlock,
transparency ? MaskType::Transparent : MaskType::Solid, foliageTbl);
}
}
targetBufferPosition.y -= TILE_HEIGHT;
}
#ifdef _DEBUG
if (DebugPath && walkpathIdx != -1) {
DrawString(out, StrCat(walkpathIdx),
Rectangle(originalTargetBufferPosition + Displacement { 0, -TILE_HEIGHT }, Size { TILE_WIDTH, TILE_HEIGHT }),
TextRenderOptions {
.flags = UiFlags::AlignCenter | UiFlags::VerticalCenter
| (IsTileSolid(tilePosition) ? UiFlags::ColorYellow : UiFlags::ColorWhite) });
}
#endif
}
/**
* @brief Render a floor tile.
* @param out Target buffer
* @param lightmap Per-pixel light buffer
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Target buffer coordinate
*/
void DrawFloorTile(const Surface &out, const Lightmap &lightmap, Point tilePosition, Point targetBufferPosition)
{
const int lightTableIndex = dLight[tilePosition.x][tilePosition.y];
const uint8_t *tbl = LightTables[lightTableIndex].data();
#ifdef _DEBUG
if (DebugPath && MyPlayer->GetPositionPathIndex(tilePosition) != -1)
tbl = GetPauseTRN();
#endif
const uint16_t levelPieceId = dPiece[tilePosition.x][tilePosition.y];
{
const LevelCelBlock levelCelBlock { DPieceMicros[levelPieceId].mt[0] };
if (levelCelBlock.hasValue()) {
RenderTileFrame(out, lightmap, targetBufferPosition, TileType::LeftTriangle,
Make `dun_render` a standalone library Does not make `dun_render_benchmark` standalone yet as that will require more untangling. Benchmark is neutral: ``` Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------------- Render<LeftTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyLit>_mean +0.0119 +0.0120 8377 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_median +0.0119 +0.0119 8376 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_stddev -0.0884 -0.2462 2 1 1 1 Render<LeftTriangle, Solid, FullyLit>_cv -0.0992 -0.2551 0 0 0 0 Render<LeftTriangle, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyDark>_mean +0.0910 +0.0910 21174 23100 21170 23097 Render<LeftTriangle, Solid, FullyDark>_median +0.0869 +0.0869 21183 23023 21179 23019 Render<LeftTriangle, Solid, FullyDark>_stddev -0.1528 -0.1593 267 226 268 225 Render<LeftTriangle, Solid, FullyDark>_cv -0.2234 -0.2294 0 0 0 0 Render<LeftTriangle, Solid, PartiallyLit>_pvalue 0.0013 0.0013 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, PartiallyLit>_mean +0.0065 +0.0065 81168 81698 81151 81680 Render<LeftTriangle, Solid, PartiallyLit>_median +0.0075 +0.0073 81143 81748 81136 81730 Render<LeftTriangle, Solid, PartiallyLit>_stddev +0.8663 +0.8787 167 311 164 307 Render<LeftTriangle, Solid, PartiallyLit>_cv +0.8542 +0.8665 0 0 0 0 Render<LeftTriangle, Transparent, FullyLit>_pvalue 0.0028 0.0017 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyLit>_mean -0.0239 -0.0239 94989 92719 94973 92703 Render<LeftTriangle, Transparent, FullyLit>_median -0.0122 -0.0123 93867 92717 93856 92704 Render<LeftTriangle, Transparent, FullyLit>_stddev -0.9920 -0.9955 2370 19 2368 11 Render<LeftTriangle, Transparent, FullyLit>_cv -0.9918 -0.9954 0 0 0 0 Render<LeftTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyDark>_mean -0.0841 -0.0841 76234 69821 76220 69809 Render<LeftTriangle, Transparent, FullyDark>_median -0.0831 -0.0832 76209 69877 76202 69864 Render<LeftTriangle, Transparent, FullyDark>_stddev -0.4486 -0.4538 441 243 440 241 Render<LeftTriangle, Transparent, FullyDark>_cv -0.3979 -0.4037 0 0 0 0 Render<LeftTriangle, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, PartiallyLit>_mean +0.0022 +0.0021 128812 129091 128792 129067 Render<LeftTriangle, Transparent, PartiallyLit>_median +0.0023 +0.0023 128820 129115 128805 129096 Render<LeftTriangle, Transparent, PartiallyLit>_stddev +0.8757 +0.6866 50 93 53 90 Render<LeftTriangle, Transparent, PartiallyLit>_cv +0.8716 +0.6830 0 0 0 0 Render<RightTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyLit>_mean +0.0057 +0.0057 8521 8570 8520 8569 Render<RightTriangle, Solid, FullyLit>_median +0.0057 +0.0057 8522 8570 8520 8568 Render<RightTriangle, Solid, FullyLit>_stddev -0.1826 -0.0420 1 1 1 1 Render<RightTriangle, Solid, FullyLit>_cv -0.1872 -0.0475 0 0 0 0 Render<RightTriangle, Solid, FullyDark>_pvalue 0.0006 0.0006 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyDark>_mean -0.0303 -0.0303 22678 21991 22675 21987 Render<RightTriangle, Solid, FullyDark>_median -0.0360 -0.0359 22704 21888 22699 21883 Render<RightTriangle, Solid, FullyDark>_stddev +0.4759 +0.4648 195 288 196 287 Render<RightTriangle, Solid, FullyDark>_cv +0.5220 +0.5106 0 0 0 0 Render<RightTriangle, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, PartiallyLit>_mean +0.0338 +0.0338 83355 86170 83341 86157 Render<RightTriangle, Solid, PartiallyLit>_median +0.0347 +0.0348 83248 86140 83230 86126 Render<RightTriangle, Solid, PartiallyLit>_stddev +0.3670 +0.3423 238 326 240 322 Render<RightTriangle, Solid, PartiallyLit>_cv +0.3224 +0.2985 0 0 0 0 Render<RightTriangle, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyLit>_mean -0.0617 -0.0616 102726 96392 102706 96375 Render<RightTriangle, Transparent, FullyLit>_median -0.0598 -0.0597 102521 96394 102498 96375 Render<RightTriangle, Transparent, FullyLit>_stddev -0.9516 -0.9548 456 22 461 21 Render<RightTriangle, Transparent, FullyLit>_cv -0.9485 -0.9518 0 0 0 0 Render<RightTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyDark>_mean -0.1377 -0.1377 84505 72865 84492 72853 Render<RightTriangle, Transparent, FullyDark>_median -0.1374 -0.1374 84339 72748 84323 72740 Render<RightTriangle, Transparent, FullyDark>_stddev -0.2760 -0.2867 526 381 528 377 Render<RightTriangle, Transparent, FullyDark>_cv -0.1604 -0.1727 0 0 0 0 Render<RightTriangle, Transparent, PartiallyLit>_pvalue 0.0036 0.0017 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, PartiallyLit>_mean +0.0010 +0.0010 131672 131808 131649 131784 Render<RightTriangle, Transparent, PartiallyLit>_median +0.0010 +0.0008 131665 131797 131654 131757 Render<RightTriangle, Transparent, PartiallyLit>_stddev -0.0688 -0.0128 81 75 72 71 Render<RightTriangle, Transparent, PartiallyLit>_cv -0.0697 -0.0138 0 0 0 0 Render<TransparentSquare, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyLit>_mean -0.0300 -0.0300 143323 139021 143300 139000 Render<TransparentSquare, Solid, FullyLit>_median -0.0300 -0.0301 143321 139014 143310 138990 Render<TransparentSquare, Solid, FullyLit>_stddev +0.0008 -0.0820 43 43 43 39 Render<TransparentSquare, Solid, FullyLit>_cv +0.0318 -0.0536 0 0 0 0 Render<TransparentSquare, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyDark>_mean -0.0100 -0.0100 134939 133588 134914 133565 Render<TransparentSquare, Solid, FullyDark>_median -0.0106 -0.0108 134964 133526 134948 133497 Render<TransparentSquare, Solid, FullyDark>_stddev +1.7508 +1.8682 99 273 96 276 Render<TransparentSquare, Solid, FullyDark>_cv +1.7786 +1.8972 0 0 0 0 Render<TransparentSquare, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, PartiallyLit>_mean -0.0460 -0.0460 152043 145043 152016 145020 Render<TransparentSquare, Solid, PartiallyLit>_median -0.0463 -0.0461 152012 144978 151964 144962 Render<TransparentSquare, Solid, PartiallyLit>_stddev -0.4453 -0.4334 267 148 266 151 Render<TransparentSquare, Solid, PartiallyLit>_cv -0.4185 -0.4060 0 0 0 0 Render<TransparentSquare, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyLit>_mean -0.0846 -0.0846 181333 165997 181304 165969 Render<TransparentSquare, Transparent, FullyLit>_median -0.0840 -0.0839 181184 165972 181147 165945 Render<TransparentSquare, Transparent, FullyLit>_stddev -0.5808 -0.5755 319 134 320 136 Render<TransparentSquare, Transparent, FullyLit>_cv -0.5421 -0.5362 0 0 0 0 Render<TransparentSquare, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyDark>_mean -0.0250 -0.0250 142232 138672 142208 138648 Render<TransparentSquare, Transparent, FullyDark>_median -0.0245 -0.0245 142144 138663 142128 138639 Render<TransparentSquare, Transparent, FullyDark>_stddev +0.1011 +0.0806 288 317 290 313 Render<TransparentSquare, Transparent, FullyDark>_cv +0.1294 +0.1084 0 0 0 0 Render<TransparentSquare, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, PartiallyLit>_mean +0.0105 +0.0105 205439 207589 205397 207556 Render<TransparentSquare, Transparent, PartiallyLit>_median +0.0106 +0.0107 205402 207575 205355 207558 Render<TransparentSquare, Transparent, PartiallyLit>_stddev -0.4410 -0.3876 182 102 167 102 Render<TransparentSquare, Transparent, PartiallyLit>_cv -0.4468 -0.3940 0 0 0 0 Render<Square, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyLit>_mean -0.0010 -0.0010 11109 11098 11107 11096 Render<Square, Solid, FullyLit>_median -0.0010 -0.0010 11109 11097 11107 11095 Render<Square, Solid, FullyLit>_stddev -0.2265 +0.2791 3 2 2 2 Render<Square, Solid, FullyLit>_cv -0.2257 +0.2804 0 0 0 0 Render<Square, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyDark>_mean +0.0904 +0.0904 8513 9283 8512 9282 Render<Square, Solid, FullyDark>_median +0.0902 +0.0902 8521 9290 8519 9288 Render<Square, Solid, FullyDark>_stddev -0.1884 -0.1616 21 17 21 18 Render<Square, Solid, FullyDark>_cv -0.2557 -0.2311 0 0 0 0 Render<Square, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, PartiallyLit>_mean +0.0038 +0.0038 163661 164289 163632 164259 Render<Square, Solid, PartiallyLit>_median +0.0038 +0.0040 163665 164290 163621 164269 Render<Square, Solid, PartiallyLit>_stddev +0.1746 +0.4412 34 40 28 40 Render<Square, Solid, PartiallyLit>_cv +0.1701 +0.4356 0 0 0 0 Render<Square, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyLit>_mean -0.0029 -0.0029 197906 197340 197876 197304 Render<Square, Transparent, FullyLit>_median -0.0030 -0.0029 197929 197339 197872 197307 Render<Square, Transparent, FullyLit>_stddev -0.5965 -0.7554 61 25 62 15 Render<Square, Transparent, FullyLit>_cv -0.5953 -0.7547 0 0 0 0 Render<Square, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyDark>_mean -0.0163 -0.0163 125659 123607 125641 123588 Render<Square, Transparent, FullyDark>_median -0.0163 -0.0163 125651 123609 125629 123579 Render<Square, Transparent, FullyDark>_stddev -0.7943 -0.8033 180 37 181 36 Render<Square, Transparent, FullyDark>_cv -0.7909 -0.8000 0 0 0 0 Render<Square, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, PartiallyLit>_mean +0.0182 +0.0182 278103 283157 278043 283107 Render<Square, Transparent, PartiallyLit>_median +0.0184 +0.0184 278086 283190 278017 283120 Render<Square, Transparent, PartiallyLit>_stddev +1.6051 +1.5303 81 210 82 209 Render<Square, Transparent, PartiallyLit>_cv +1.5586 +1.4850 0 0 0 0 Render<LeftTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyLit>_mean -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_median -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_stddev -0.4844 -0.6856 1 0 1 0 Render<LeftTrapezoid, Solid, FullyLit>_cv -0.4809 -0.6834 0 0 0 0 Render<LeftTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyDark>_mean +0.3996 +0.3997 5163 7227 5162 7226 Render<LeftTrapezoid, Solid, FullyDark>_median +0.3973 +0.3974 5174 7230 5173 7229 Render<LeftTrapezoid, Solid, FullyDark>_stddev -0.7835 -0.7789 89 19 89 20 Render<LeftTrapezoid, Solid, FullyDark>_cv -0.8453 -0.8420 0 0 0 0 Render<LeftTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, PartiallyLit>_mean -0.1228 -0.1228 50053 43907 50044 43900 Render<LeftTrapezoid, Solid, PartiallyLit>_median -0.1228 -0.1228 50062 43916 50054 43906 Render<LeftTrapezoid, Solid, PartiallyLit>_stddev +1.3916 +1.3800 63 150 64 151 Render<LeftTrapezoid, Solid, PartiallyLit>_cv +1.7263 +1.7131 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyLit>_mean -0.1584 -0.1583 62677 52751 62665 52743 Render<LeftTrapezoid, Transparent, FullyLit>_median -0.1585 -0.1585 62670 52736 62656 52728 Render<LeftTrapezoid, Transparent, FullyLit>_stddev +1.1429 +1.4086 26 55 23 55 Render<LeftTrapezoid, Transparent, FullyLit>_cv +1.5461 +1.8617 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyDark>_mean -0.1929 -0.1929 57688 46558 57679 46551 Render<LeftTrapezoid, Transparent, FullyDark>_median -0.1943 -0.1944 57681 46473 57672 46459 Render<LeftTrapezoid, Transparent, FullyDark>_stddev +2.8190 +2.7914 62 237 63 238 Render<LeftTrapezoid, Transparent, FullyDark>_cv +3.7319 +3.6978 0 0 0 0 Render<LeftTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, PartiallyLit>_mean -0.0054 -0.0054 70694 70313 70682 70301 Render<LeftTrapezoid, Transparent, PartiallyLit>_median -0.0050 -0.0048 70671 70319 70650 70311 Render<LeftTrapezoid, Transparent, PartiallyLit>_stddev -0.7448 -0.7617 163 42 168 40 Render<LeftTrapezoid, Transparent, PartiallyLit>_cv -0.7434 -0.7604 0 0 0 0 Render<RightTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyLit>_mean +0.0123 +0.0123 2985 3022 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_median +0.0123 +0.0123 2985 3021 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_stddev -0.4207 -0.4667 1 0 1 0 Render<RightTrapezoid, Solid, FullyLit>_cv -0.4277 -0.4731 0 0 0 0 Render<RightTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyDark>_mean +0.1105 +0.1105 4894 5435 4893 5434 Render<RightTrapezoid, Solid, FullyDark>_median +0.1083 +0.1082 4902 5433 4901 5432 Render<RightTrapezoid, Solid, FullyDark>_stddev -0.1973 -0.1947 45 37 45 37 Render<RightTrapezoid, Solid, FullyDark>_cv -0.2772 -0.2748 0 0 0 0 Render<RightTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, PartiallyLit>_mean -0.0169 -0.0169 48201 47386 48192 47379 Render<RightTrapezoid, Solid, PartiallyLit>_median -0.0172 -0.0170 48184 47355 48170 47351 Render<RightTrapezoid, Solid, PartiallyLit>_stddev +0.6070 +0.5204 48 78 50 76 Render<RightTrapezoid, Solid, PartiallyLit>_cv +0.6346 +0.5465 0 0 0 0 Render<RightTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyLit>_mean -0.0023 -0.0023 48751 48639 48742 48632 Render<RightTrapezoid, Transparent, FullyLit>_median -0.0020 -0.0018 48751 48654 48738 48651 Render<RightTrapezoid, Transparent, FullyLit>_stddev +2.4354 +2.4427 10 35 11 36 Render<RightTrapezoid, Transparent, FullyLit>_cv +2.4433 +2.4505 0 0 0 0 Render<RightTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyDark>_mean -0.2247 -0.2247 40942 31742 40936 31736 Render<RightTrapezoid, Transparent, FullyDark>_median -0.2241 -0.2240 40904 31739 40895 31734 Render<RightTrapezoid, Transparent, FullyDark>_stddev -0.3455 -0.3546 165 108 167 108 Render<RightTrapezoid, Transparent, FullyDark>_cv -0.1558 -0.1676 0 0 0 0 Render<RightTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, PartiallyLit>_mean -0.0908 -0.0908 74269 67523 74256 67512 Render<RightTrapezoid, Transparent, PartiallyLit>_median -0.0898 -0.0897 74196 67536 74176 67523 Render<RightTrapezoid, Transparent, PartiallyLit>_stddev -0.6590 -0.6568 147 50 146 50 Render<RightTrapezoid, Transparent, PartiallyLit>_cv -0.6250 -0.6225 0 0 0 0 BM_RenderBlackTile_pvalue 0.0539 0.0539 U Test, Repetitions: 10 vs 10 BM_RenderBlackTile_mean -0.0188 -0.0188 125 123 125 123 BM_RenderBlackTile_median -0.0263 -0.0264 126 122 125 122 BM_RenderBlackTile_stddev +1.0907 +1.0966 1 3 1 3 BM_RenderBlackTile_cv +1.1307 +1.1368 0 0 0 0 OVERALL_GEOMEAN -0.0207 -0.0207 0 0 0 0 ```
8 months ago
GetDunFrame(pDungeonCels.get(), levelCelBlock.frame()), DunFrameTriangleHeight, MaskType::Solid, tbl);
}
}
{
const LevelCelBlock levelCelBlock { DPieceMicros[levelPieceId].mt[1] };
if (levelCelBlock.hasValue()) {
RenderTileFrame(out, lightmap, targetBufferPosition + RightFrameDisplacement, TileType::RightTriangle,
Make `dun_render` a standalone library Does not make `dun_render_benchmark` standalone yet as that will require more untangling. Benchmark is neutral: ``` Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------------- Render<LeftTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyLit>_mean +0.0119 +0.0120 8377 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_median +0.0119 +0.0119 8376 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_stddev -0.0884 -0.2462 2 1 1 1 Render<LeftTriangle, Solid, FullyLit>_cv -0.0992 -0.2551 0 0 0 0 Render<LeftTriangle, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyDark>_mean +0.0910 +0.0910 21174 23100 21170 23097 Render<LeftTriangle, Solid, FullyDark>_median +0.0869 +0.0869 21183 23023 21179 23019 Render<LeftTriangle, Solid, FullyDark>_stddev -0.1528 -0.1593 267 226 268 225 Render<LeftTriangle, Solid, FullyDark>_cv -0.2234 -0.2294 0 0 0 0 Render<LeftTriangle, Solid, PartiallyLit>_pvalue 0.0013 0.0013 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, PartiallyLit>_mean +0.0065 +0.0065 81168 81698 81151 81680 Render<LeftTriangle, Solid, PartiallyLit>_median +0.0075 +0.0073 81143 81748 81136 81730 Render<LeftTriangle, Solid, PartiallyLit>_stddev +0.8663 +0.8787 167 311 164 307 Render<LeftTriangle, Solid, PartiallyLit>_cv +0.8542 +0.8665 0 0 0 0 Render<LeftTriangle, Transparent, FullyLit>_pvalue 0.0028 0.0017 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyLit>_mean -0.0239 -0.0239 94989 92719 94973 92703 Render<LeftTriangle, Transparent, FullyLit>_median -0.0122 -0.0123 93867 92717 93856 92704 Render<LeftTriangle, Transparent, FullyLit>_stddev -0.9920 -0.9955 2370 19 2368 11 Render<LeftTriangle, Transparent, FullyLit>_cv -0.9918 -0.9954 0 0 0 0 Render<LeftTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyDark>_mean -0.0841 -0.0841 76234 69821 76220 69809 Render<LeftTriangle, Transparent, FullyDark>_median -0.0831 -0.0832 76209 69877 76202 69864 Render<LeftTriangle, Transparent, FullyDark>_stddev -0.4486 -0.4538 441 243 440 241 Render<LeftTriangle, Transparent, FullyDark>_cv -0.3979 -0.4037 0 0 0 0 Render<LeftTriangle, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, PartiallyLit>_mean +0.0022 +0.0021 128812 129091 128792 129067 Render<LeftTriangle, Transparent, PartiallyLit>_median +0.0023 +0.0023 128820 129115 128805 129096 Render<LeftTriangle, Transparent, PartiallyLit>_stddev +0.8757 +0.6866 50 93 53 90 Render<LeftTriangle, Transparent, PartiallyLit>_cv +0.8716 +0.6830 0 0 0 0 Render<RightTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyLit>_mean +0.0057 +0.0057 8521 8570 8520 8569 Render<RightTriangle, Solid, FullyLit>_median +0.0057 +0.0057 8522 8570 8520 8568 Render<RightTriangle, Solid, FullyLit>_stddev -0.1826 -0.0420 1 1 1 1 Render<RightTriangle, Solid, FullyLit>_cv -0.1872 -0.0475 0 0 0 0 Render<RightTriangle, Solid, FullyDark>_pvalue 0.0006 0.0006 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyDark>_mean -0.0303 -0.0303 22678 21991 22675 21987 Render<RightTriangle, Solid, FullyDark>_median -0.0360 -0.0359 22704 21888 22699 21883 Render<RightTriangle, Solid, FullyDark>_stddev +0.4759 +0.4648 195 288 196 287 Render<RightTriangle, Solid, FullyDark>_cv +0.5220 +0.5106 0 0 0 0 Render<RightTriangle, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, PartiallyLit>_mean +0.0338 +0.0338 83355 86170 83341 86157 Render<RightTriangle, Solid, PartiallyLit>_median +0.0347 +0.0348 83248 86140 83230 86126 Render<RightTriangle, Solid, PartiallyLit>_stddev +0.3670 +0.3423 238 326 240 322 Render<RightTriangle, Solid, PartiallyLit>_cv +0.3224 +0.2985 0 0 0 0 Render<RightTriangle, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyLit>_mean -0.0617 -0.0616 102726 96392 102706 96375 Render<RightTriangle, Transparent, FullyLit>_median -0.0598 -0.0597 102521 96394 102498 96375 Render<RightTriangle, Transparent, FullyLit>_stddev -0.9516 -0.9548 456 22 461 21 Render<RightTriangle, Transparent, FullyLit>_cv -0.9485 -0.9518 0 0 0 0 Render<RightTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyDark>_mean -0.1377 -0.1377 84505 72865 84492 72853 Render<RightTriangle, Transparent, FullyDark>_median -0.1374 -0.1374 84339 72748 84323 72740 Render<RightTriangle, Transparent, FullyDark>_stddev -0.2760 -0.2867 526 381 528 377 Render<RightTriangle, Transparent, FullyDark>_cv -0.1604 -0.1727 0 0 0 0 Render<RightTriangle, Transparent, PartiallyLit>_pvalue 0.0036 0.0017 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, PartiallyLit>_mean +0.0010 +0.0010 131672 131808 131649 131784 Render<RightTriangle, Transparent, PartiallyLit>_median +0.0010 +0.0008 131665 131797 131654 131757 Render<RightTriangle, Transparent, PartiallyLit>_stddev -0.0688 -0.0128 81 75 72 71 Render<RightTriangle, Transparent, PartiallyLit>_cv -0.0697 -0.0138 0 0 0 0 Render<TransparentSquare, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyLit>_mean -0.0300 -0.0300 143323 139021 143300 139000 Render<TransparentSquare, Solid, FullyLit>_median -0.0300 -0.0301 143321 139014 143310 138990 Render<TransparentSquare, Solid, FullyLit>_stddev +0.0008 -0.0820 43 43 43 39 Render<TransparentSquare, Solid, FullyLit>_cv +0.0318 -0.0536 0 0 0 0 Render<TransparentSquare, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyDark>_mean -0.0100 -0.0100 134939 133588 134914 133565 Render<TransparentSquare, Solid, FullyDark>_median -0.0106 -0.0108 134964 133526 134948 133497 Render<TransparentSquare, Solid, FullyDark>_stddev +1.7508 +1.8682 99 273 96 276 Render<TransparentSquare, Solid, FullyDark>_cv +1.7786 +1.8972 0 0 0 0 Render<TransparentSquare, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, PartiallyLit>_mean -0.0460 -0.0460 152043 145043 152016 145020 Render<TransparentSquare, Solid, PartiallyLit>_median -0.0463 -0.0461 152012 144978 151964 144962 Render<TransparentSquare, Solid, PartiallyLit>_stddev -0.4453 -0.4334 267 148 266 151 Render<TransparentSquare, Solid, PartiallyLit>_cv -0.4185 -0.4060 0 0 0 0 Render<TransparentSquare, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyLit>_mean -0.0846 -0.0846 181333 165997 181304 165969 Render<TransparentSquare, Transparent, FullyLit>_median -0.0840 -0.0839 181184 165972 181147 165945 Render<TransparentSquare, Transparent, FullyLit>_stddev -0.5808 -0.5755 319 134 320 136 Render<TransparentSquare, Transparent, FullyLit>_cv -0.5421 -0.5362 0 0 0 0 Render<TransparentSquare, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyDark>_mean -0.0250 -0.0250 142232 138672 142208 138648 Render<TransparentSquare, Transparent, FullyDark>_median -0.0245 -0.0245 142144 138663 142128 138639 Render<TransparentSquare, Transparent, FullyDark>_stddev +0.1011 +0.0806 288 317 290 313 Render<TransparentSquare, Transparent, FullyDark>_cv +0.1294 +0.1084 0 0 0 0 Render<TransparentSquare, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, PartiallyLit>_mean +0.0105 +0.0105 205439 207589 205397 207556 Render<TransparentSquare, Transparent, PartiallyLit>_median +0.0106 +0.0107 205402 207575 205355 207558 Render<TransparentSquare, Transparent, PartiallyLit>_stddev -0.4410 -0.3876 182 102 167 102 Render<TransparentSquare, Transparent, PartiallyLit>_cv -0.4468 -0.3940 0 0 0 0 Render<Square, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyLit>_mean -0.0010 -0.0010 11109 11098 11107 11096 Render<Square, Solid, FullyLit>_median -0.0010 -0.0010 11109 11097 11107 11095 Render<Square, Solid, FullyLit>_stddev -0.2265 +0.2791 3 2 2 2 Render<Square, Solid, FullyLit>_cv -0.2257 +0.2804 0 0 0 0 Render<Square, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyDark>_mean +0.0904 +0.0904 8513 9283 8512 9282 Render<Square, Solid, FullyDark>_median +0.0902 +0.0902 8521 9290 8519 9288 Render<Square, Solid, FullyDark>_stddev -0.1884 -0.1616 21 17 21 18 Render<Square, Solid, FullyDark>_cv -0.2557 -0.2311 0 0 0 0 Render<Square, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, PartiallyLit>_mean +0.0038 +0.0038 163661 164289 163632 164259 Render<Square, Solid, PartiallyLit>_median +0.0038 +0.0040 163665 164290 163621 164269 Render<Square, Solid, PartiallyLit>_stddev +0.1746 +0.4412 34 40 28 40 Render<Square, Solid, PartiallyLit>_cv +0.1701 +0.4356 0 0 0 0 Render<Square, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyLit>_mean -0.0029 -0.0029 197906 197340 197876 197304 Render<Square, Transparent, FullyLit>_median -0.0030 -0.0029 197929 197339 197872 197307 Render<Square, Transparent, FullyLit>_stddev -0.5965 -0.7554 61 25 62 15 Render<Square, Transparent, FullyLit>_cv -0.5953 -0.7547 0 0 0 0 Render<Square, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyDark>_mean -0.0163 -0.0163 125659 123607 125641 123588 Render<Square, Transparent, FullyDark>_median -0.0163 -0.0163 125651 123609 125629 123579 Render<Square, Transparent, FullyDark>_stddev -0.7943 -0.8033 180 37 181 36 Render<Square, Transparent, FullyDark>_cv -0.7909 -0.8000 0 0 0 0 Render<Square, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, PartiallyLit>_mean +0.0182 +0.0182 278103 283157 278043 283107 Render<Square, Transparent, PartiallyLit>_median +0.0184 +0.0184 278086 283190 278017 283120 Render<Square, Transparent, PartiallyLit>_stddev +1.6051 +1.5303 81 210 82 209 Render<Square, Transparent, PartiallyLit>_cv +1.5586 +1.4850 0 0 0 0 Render<LeftTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyLit>_mean -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_median -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_stddev -0.4844 -0.6856 1 0 1 0 Render<LeftTrapezoid, Solid, FullyLit>_cv -0.4809 -0.6834 0 0 0 0 Render<LeftTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyDark>_mean +0.3996 +0.3997 5163 7227 5162 7226 Render<LeftTrapezoid, Solid, FullyDark>_median +0.3973 +0.3974 5174 7230 5173 7229 Render<LeftTrapezoid, Solid, FullyDark>_stddev -0.7835 -0.7789 89 19 89 20 Render<LeftTrapezoid, Solid, FullyDark>_cv -0.8453 -0.8420 0 0 0 0 Render<LeftTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, PartiallyLit>_mean -0.1228 -0.1228 50053 43907 50044 43900 Render<LeftTrapezoid, Solid, PartiallyLit>_median -0.1228 -0.1228 50062 43916 50054 43906 Render<LeftTrapezoid, Solid, PartiallyLit>_stddev +1.3916 +1.3800 63 150 64 151 Render<LeftTrapezoid, Solid, PartiallyLit>_cv +1.7263 +1.7131 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyLit>_mean -0.1584 -0.1583 62677 52751 62665 52743 Render<LeftTrapezoid, Transparent, FullyLit>_median -0.1585 -0.1585 62670 52736 62656 52728 Render<LeftTrapezoid, Transparent, FullyLit>_stddev +1.1429 +1.4086 26 55 23 55 Render<LeftTrapezoid, Transparent, FullyLit>_cv +1.5461 +1.8617 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyDark>_mean -0.1929 -0.1929 57688 46558 57679 46551 Render<LeftTrapezoid, Transparent, FullyDark>_median -0.1943 -0.1944 57681 46473 57672 46459 Render<LeftTrapezoid, Transparent, FullyDark>_stddev +2.8190 +2.7914 62 237 63 238 Render<LeftTrapezoid, Transparent, FullyDark>_cv +3.7319 +3.6978 0 0 0 0 Render<LeftTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, PartiallyLit>_mean -0.0054 -0.0054 70694 70313 70682 70301 Render<LeftTrapezoid, Transparent, PartiallyLit>_median -0.0050 -0.0048 70671 70319 70650 70311 Render<LeftTrapezoid, Transparent, PartiallyLit>_stddev -0.7448 -0.7617 163 42 168 40 Render<LeftTrapezoid, Transparent, PartiallyLit>_cv -0.7434 -0.7604 0 0 0 0 Render<RightTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyLit>_mean +0.0123 +0.0123 2985 3022 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_median +0.0123 +0.0123 2985 3021 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_stddev -0.4207 -0.4667 1 0 1 0 Render<RightTrapezoid, Solid, FullyLit>_cv -0.4277 -0.4731 0 0 0 0 Render<RightTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyDark>_mean +0.1105 +0.1105 4894 5435 4893 5434 Render<RightTrapezoid, Solid, FullyDark>_median +0.1083 +0.1082 4902 5433 4901 5432 Render<RightTrapezoid, Solid, FullyDark>_stddev -0.1973 -0.1947 45 37 45 37 Render<RightTrapezoid, Solid, FullyDark>_cv -0.2772 -0.2748 0 0 0 0 Render<RightTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, PartiallyLit>_mean -0.0169 -0.0169 48201 47386 48192 47379 Render<RightTrapezoid, Solid, PartiallyLit>_median -0.0172 -0.0170 48184 47355 48170 47351 Render<RightTrapezoid, Solid, PartiallyLit>_stddev +0.6070 +0.5204 48 78 50 76 Render<RightTrapezoid, Solid, PartiallyLit>_cv +0.6346 +0.5465 0 0 0 0 Render<RightTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyLit>_mean -0.0023 -0.0023 48751 48639 48742 48632 Render<RightTrapezoid, Transparent, FullyLit>_median -0.0020 -0.0018 48751 48654 48738 48651 Render<RightTrapezoid, Transparent, FullyLit>_stddev +2.4354 +2.4427 10 35 11 36 Render<RightTrapezoid, Transparent, FullyLit>_cv +2.4433 +2.4505 0 0 0 0 Render<RightTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyDark>_mean -0.2247 -0.2247 40942 31742 40936 31736 Render<RightTrapezoid, Transparent, FullyDark>_median -0.2241 -0.2240 40904 31739 40895 31734 Render<RightTrapezoid, Transparent, FullyDark>_stddev -0.3455 -0.3546 165 108 167 108 Render<RightTrapezoid, Transparent, FullyDark>_cv -0.1558 -0.1676 0 0 0 0 Render<RightTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, PartiallyLit>_mean -0.0908 -0.0908 74269 67523 74256 67512 Render<RightTrapezoid, Transparent, PartiallyLit>_median -0.0898 -0.0897 74196 67536 74176 67523 Render<RightTrapezoid, Transparent, PartiallyLit>_stddev -0.6590 -0.6568 147 50 146 50 Render<RightTrapezoid, Transparent, PartiallyLit>_cv -0.6250 -0.6225 0 0 0 0 BM_RenderBlackTile_pvalue 0.0539 0.0539 U Test, Repetitions: 10 vs 10 BM_RenderBlackTile_mean -0.0188 -0.0188 125 123 125 123 BM_RenderBlackTile_median -0.0263 -0.0264 126 122 125 122 BM_RenderBlackTile_stddev +1.0907 +1.0966 1 3 1 3 BM_RenderBlackTile_cv +1.1307 +1.1368 0 0 0 0 OVERALL_GEOMEAN -0.0207 -0.0207 0 0 0 0 ```
8 months ago
GetDunFrame(pDungeonCels.get(), levelCelBlock.frame()), DunFrameTriangleHeight, MaskType::Solid, tbl);
}
}
}
/**
* @brief Draw item for a given tile
* @param out Output buffer
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Output buffer coordinates
* @param pre Is the sprite in the background
*/
void DrawItem(const Surface &out, int8_t itemIndex, Point targetBufferPosition, int lightTableIndex)
{
const Item &item = Items[itemIndex];
const ClxSprite sprite = item.AnimInfo.currentSprite();
const Point position = targetBufferPosition + item.getRenderingOffset(sprite);
if (!IsPlayerInStore() && (itemIndex == pcursitem || AutoMapShowItems)) {
ClxDrawOutlineSkipColorZero(out, GetOutlineColor(item, false), position, sprite);
}
ClxDrawLight(out, position, sprite, lightTableIndex);
if (item.AnimInfo.isLastFrame() || item._iCurs == ICURS_MAGIC_ROCK)
AddItemToLabelQueue(itemIndex, position);
}
/**
5 years ago
* @brief Check if and how a monster should be rendered
* @param out Output buffer
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Output buffer coordinates
*/
void DrawMonsterHelper(const Surface &out, Point tilePosition, Point targetBufferPosition, int lightTableIndex)
{
int mi = dMonster[tilePosition.x][tilePosition.y];
mi = std::abs(mi) - 1;
if (leveltype == DTYPE_TOWN) {
auto &towner = Towners[mi];
const Point position = targetBufferPosition + towner.getRenderingOffset();
const ClxSprite sprite = towner.currentSprite();
if (mi == pcursmonst) {
ClxDrawOutlineSkipColorZero(out, 166, position, sprite);
}
ClxDraw(out, position, sprite);
return;
}
if (!IsTileLit(tilePosition) && !(MyPlayer->_pInfraFlag && IsFloor(tilePosition))) {
return;
}
if (static_cast<size_t>(mi) >= MaxMonsters) {
Log("Draw Monster: tried to draw illegal monster {}", mi);
return;
}
const auto &monster = Monsters[mi];
if ((monster.flags & MFLAG_HIDDEN) != 0) {
return;
}
const ClxSprite sprite = monster.animInfo.currentSprite();
const Displacement offset = monster.getRenderingOffset(sprite);
const Point monsterRenderPosition = targetBufferPosition + offset;
if (mi == pcursmonst) {
ClxDrawOutlineSkipColorZero(out, 233, monsterRenderPosition, sprite);
}
DrawMonster(out, tilePosition, monsterRenderPosition, monster, lightTableIndex);
}
/**
* @brief Render object sprites
* @param out Target buffer
* @param lightmap Per-pixel light buffer
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Target buffer coordinates
*/
void DrawDungeon(const Surface &out, const Lightmap &lightmap, Point tilePosition, Point targetBufferPosition)
{
assert(InDungeonBounds(tilePosition));
const int lightTableIndex = dLight[tilePosition.x][tilePosition.y];
DrawCell(out, lightmap, tilePosition, targetBufferPosition, lightTableIndex);
const int8_t bDead = dCorpse[tilePosition.x][tilePosition.y];
const int8_t bMap = dTransVal[tilePosition.x][tilePosition.y];
#ifdef _DEBUG
if (DebugVision && IsTileLit(tilePosition)) {
ClxDraw(out, targetBufferPosition, (*pSquareCel)[0]);
}
#endif
if (MissilePreFlag) {
DrawMissile(out, tilePosition, targetBufferPosition, true, lightTableIndex);
}
if (lightTableIndex < LightsMax && bDead != 0) {
const Corpse &corpse = Corpses[(bDead & 0x1F) - 1];
const Point position { targetBufferPosition.x - CalculateSpriteTileCenterX(corpse.width), targetBufferPosition.y };
3 years ago
const ClxSprite sprite = corpse.spritesForDirection(static_cast<Direction>((bDead >> 5) & 7))[corpse.frame];
if (corpse.translationPaletteIndex != 0) {
const uint8_t *trn = Monsters[corpse.translationPaletteIndex - 1].uniqueMonsterTRN.get();
ClxDrawTRN(out, position, sprite, trn);
} else {
ClxDrawLight(out, position, sprite, lightTableIndex);
3 years ago
}
}
const int8_t bItem = dItem[tilePosition.x][tilePosition.y];
const Object *object = lightTableIndex < LightsMax
? FindObjectAtPosition(tilePosition)
: nullptr;
if (object != nullptr && object->_oPreFlag) {
DrawObject(out, *object, tilePosition, targetBufferPosition, lightTableIndex);
}
if (bItem > 0 && !Items[bItem - 1]._iPostDraw) {
DrawItem(out, static_cast<int8_t>(bItem - 1), targetBufferPosition, lightTableIndex);
}
if (TileContainsDeadPlayer(tilePosition)) {
DrawDeadPlayer(out, tilePosition, targetBufferPosition, lightTableIndex);
}
Player *player = PlayerAtPosition(tilePosition);
if (player != nullptr) {
const uint8_t pid = player->getId();
assert(pid < MAX_PLRS);
int playerId = static_cast<int>(pid) + 1;
// If sprite is moving southwards or east, we want to draw it offset from the tile it's moving to, so we need negative ID
// This respests the order that tiles are drawn. By using the negative id, we ensure that the sprite is drawn with priority
if (player->_pmode == PM_WALK_SOUTHWARDS || (player->_pmode == PM_WALK_SIDEWAYS && player->_pdir == Direction::East))
playerId = -playerId;
if (dPlayer[tilePosition.x][tilePosition.y] == playerId) {
auto tempTilePosition = tilePosition;
auto tempTargetBufferPosition = targetBufferPosition;
// Offset the sprite to the tile it's moving from
if (player->_pmode == PM_WALK_SOUTHWARDS) {
switch (player->_pdir) {
case Direction::SouthWest:
tempTargetBufferPosition += { TILE_WIDTH / 2, -TILE_HEIGHT / 2 };
break;
case Direction::South:
tempTargetBufferPosition += { 0, -TILE_HEIGHT };
break;
case Direction::SouthEast:
tempTargetBufferPosition += { -TILE_WIDTH / 2, -TILE_HEIGHT / 2 };
break;
default:
DVL_UNREACHABLE();
}
tempTilePosition += Opposite(player->_pdir);
} else if (player->_pmode == PM_WALK_SIDEWAYS && player->_pdir == Direction::East) {
tempTargetBufferPosition += { -TILE_WIDTH, 0 };
tempTilePosition += Opposite(player->_pdir);
}
DrawPlayer(out, *player, tempTilePosition, tempTargetBufferPosition, lightTableIndex);
}
}
Monster *monster = FindMonsterAtPosition(tilePosition);
if (monster != nullptr) {
auto mid = monster->getId();
assert(mid < MaxMonsters);
int monsterId = static_cast<int>(mid) + 1;
// If sprite is moving southwards or east, we want to draw it offset from the tile it's moving to, so we need negative ID
// This respests the order that tiles are drawn. By using the negative id, we ensure that the sprite is drawn with priority
if (monster->mode == MonsterMode::MoveSouthwards || (monster->mode == MonsterMode::MoveSideways && monster->direction == Direction::East))
monsterId = -monsterId;
if (dMonster[tilePosition.x][tilePosition.y] == monsterId) {
auto tempTilePosition = tilePosition;
auto tempTargetBufferPosition = targetBufferPosition;
// Offset the sprite to the tile it's moving from
if (monster->mode == MonsterMode::MoveSouthwards) {
switch (monster->direction) {
case Direction::SouthWest:
tempTargetBufferPosition += { TILE_WIDTH / 2, -TILE_HEIGHT / 2 };
break;
case Direction::South:
tempTargetBufferPosition += { 0, -TILE_HEIGHT };
break;
case Direction::SouthEast:
tempTargetBufferPosition += { -TILE_WIDTH / 2, -TILE_HEIGHT / 2 };
break;
default:
DVL_UNREACHABLE();
}
tempTilePosition += Opposite(monster->direction);
} else if (monster->mode == MonsterMode::MoveSideways && monster->direction == Direction::East) {
tempTargetBufferPosition += { -TILE_WIDTH, 0 };
tempTilePosition += Opposite(monster->direction);
}
DrawMonsterHelper(out, tempTilePosition, tempTargetBufferPosition, lightTableIndex);
}
}
DrawMissile(out, tilePosition, targetBufferPosition, false, lightTableIndex);
if (object != nullptr && !object->_oPreFlag) {
DrawObject(out, *object, tilePosition, targetBufferPosition, lightTableIndex);
}
if (bItem > 0 && Items[bItem - 1]._iPostDraw) {
DrawItem(out, static_cast<int8_t>(bItem - 1), targetBufferPosition, lightTableIndex);
}
if (leveltype != DTYPE_TOWN) {
const bool perPixelLighting = *GetOptions().Graphics.perPixelLighting;
const int8_t bArch = dSpecial[tilePosition.x][tilePosition.y] - 1;
if (bArch >= 0) {
bool transparency = TransList[bMap];
#ifdef _DEBUG
// Turn transparency off here for debugging
transparency = transparency && (SDL_GetModState() & SDL_KMOD_ALT) == 0;
#endif
if (perPixelLighting) {
// Create a special lightmap buffer to bleed light up walls
uint8_t lightmapBuffer[TILE_WIDTH * TILE_HEIGHT];
const Lightmap bleedLightmap = Lightmap::bleedUp(*GetOptions().Graphics.perPixelLighting, lightmap, targetBufferPosition, lightmapBuffer);
if (transparency)
ClxDrawBlendedWithLightmap(out, targetBufferPosition, (*pSpecialCels)[bArch], bleedLightmap);
else
ClxDrawWithLightmap(out, targetBufferPosition, (*pSpecialCels)[bArch], bleedLightmap);
} else if (transparency) {
ClxDrawLightBlended(out, targetBufferPosition, (*pSpecialCels)[bArch], lightTableIndex);
} else {
ClxDrawLight(out, targetBufferPosition, (*pSpecialCels)[bArch], lightTableIndex);
}
}
} else {
5 years ago
// Tree leaves should always cover player when entering or leaving the tile,
// So delay the rendering until after the next row is being drawn.
// This could probably have been better solved by sprites in screen space.
if (tilePosition.x > 0 && tilePosition.y > 0 && targetBufferPosition.y > TILE_HEIGHT) {
const int8_t bArch = dSpecial[tilePosition.x - 1][tilePosition.y - 1] - 1;
if (bArch >= 0)
ClxDraw(out, targetBufferPosition + Displacement { 0, -TILE_HEIGHT }, (*pSpecialCels)[bArch]);
}
}
}
/**
* @brief Render a row of tiles
* @param out Buffer to render to
* @param lightmap Per-pixel light buffer
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Target buffer coordinates
* @param rows Number of rows
* @param columns Tile in a row
*/
void DrawFloor(const Surface &out, const Lightmap &lightmap, Point tilePosition, Point targetBufferPosition, int rows, int columns)
{
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++, tilePosition += Direction::East, targetBufferPosition.x += TILE_WIDTH) {
if (!InDungeonBounds(tilePosition)) {
world_draw_black_tile(out, targetBufferPosition.x, targetBufferPosition.y);
continue;
}
if (IsFloor(tilePosition)) {
DrawFloorTile(out, lightmap, tilePosition, targetBufferPosition);
}
}
// Return to start of row
tilePosition += Displacement(Direction::West) * columns;
targetBufferPosition.x -= columns * TILE_WIDTH;
// Jump to next row
targetBufferPosition.y += TILE_HEIGHT / 2;
if ((i & 1) != 0) {
tilePosition.x++;
columns--;
targetBufferPosition.x += TILE_WIDTH / 2;
} else {
tilePosition.y++;
columns++;
targetBufferPosition.x -= TILE_WIDTH / 2;
}
}
}
/**
* @brief Renders the floor tiles
* @param out Output buffer
* @param lightmap Per-pixel light buffer
* @param tilePosition dPiece coordinates
* @param targetBufferPosition Buffer coordinates
* @param rows Number of rows
* @param columns Tile in a row
*/
void DrawTileContent(const Surface &out, const Lightmap &lightmap, Point tilePosition, Point targetBufferPosition, int rows, int columns)
{
// Keep evaluating until MicroTiles can't affect screen
rows += MicroTileLen;
#ifdef _DEBUG
DebugCoordsMap.reserve(rows * columns);
#endif
for (int i = 0; i < rows; i++) {
bool skip = false;
for (int j = 0; j < columns; j++) {
if (InDungeonBounds(tilePosition)) {
bool skipNext = false;
#ifdef _DEBUG
DebugCoordsMap[tilePosition.x + tilePosition.y * MAXDUNX] = targetBufferPosition;
#endif
if (tilePosition.x + 1 < MAXDUNX && tilePosition.y - 1 >= 0 && targetBufferPosition.x + TILE_WIDTH <= gnScreenWidth) {
// Render objects behind walls first to prevent sprites, that are moving
6 years ago
// between tiles, from poking through the walls as they exceed the tile bounds.
// A proper fix for this would probably be to layout the scene and render by
6 years ago
// sprite screen position rather than tile position.
if (IsWall(tilePosition) && (IsWall(tilePosition + Displacement { 1, 0 }) || (tilePosition.x > 0 && IsWall(tilePosition + Displacement { -1, 0 })))) { // Part of a wall aligned on the x-axis
if (IsTileNotSolid(tilePosition + Displacement { 1, -1 }) && IsTileNotSolid(tilePosition + Displacement { 0, -1 })) { // Has walkable area behind it
DrawDungeon(out, lightmap, tilePosition + Direction::East, { targetBufferPosition.x + TILE_WIDTH, targetBufferPosition.y });
skipNext = true;
}
}
}
if (!skip) {
DrawDungeon(out, lightmap, tilePosition, targetBufferPosition);
}
skip = skipNext;
}
tilePosition += Direction::East;
targetBufferPosition.x += TILE_WIDTH;
}
// Return to start of row
tilePosition += Displacement(Direction::West) * columns;
targetBufferPosition.x -= columns * TILE_WIDTH;
// Jump to next row
targetBufferPosition.y += TILE_HEIGHT / 2;
if ((i & 1) != 0) {
tilePosition.x++;
columns--;
targetBufferPosition.x += TILE_WIDTH / 2;
} else {
tilePosition.y++;
columns++;
targetBufferPosition.x -= TILE_WIDTH / 2;
}
}
}
/**
* @brief Scale up the top left part of the buffer 2x.
*/
5 years ago
void Zoom(const Surface &out)
{
int viewportWidth = out.w();
int viewportOffsetX = 0;
if (CanPanelsCoverView()) {
if (IsLeftPanelOpen()) {
viewportWidth -= SidePanelSize.width;
viewportOffsetX = SidePanelSize.width;
} else if (IsRightPanelOpen()) {
viewportWidth -= SidePanelSize.width;
}
}
// We round to even for the source width and height.
// If the width / height was odd, we copy just one extra pixel / row later on.
const int srcWidth = (viewportWidth + 1) / 2;
const int doubleableWidth = viewportWidth / 2;
const int srcHeight = (out.h() + 1) / 2;
const int doubleableHeight = out.h() / 2;
uint8_t *src = out.at(srcWidth - 1, srcHeight - 1);
uint8_t *dst = out.at(viewportOffsetX + viewportWidth - 1, out.h() - 1);
const bool oddViewportWidth = (viewportWidth % 2) == 1;
for (int hgt = 0; hgt < doubleableHeight; hgt++) {
// Double the pixels in the line.
for (int i = 0; i < doubleableWidth; i++) {
*dst-- = *src;
*dst-- = *src;
--src;
}
// Copy a single extra pixel if the output width is odd.
if (oddViewportWidth) {
*dst-- = *src;
--src;
}
// Skip the rest of the source line.
src -= (out.pitch() - srcWidth);
// Double the line.
memcpy(dst - out.pitch() + 1, dst + 1, viewportWidth);
// Skip the rest of the destination line.
dst -= 2 * out.pitch() - viewportWidth;
}
if ((out.h() % 2) == 1) {
memcpy(dst - out.pitch() + 1, dst + 1, viewportWidth);
}
}
Displacement tileOffset;
Displacement tileShift;
int tileColumns;
int tileRows;
void CalcFirstTilePosition(Point &position, Displacement &offset)
{
// Adjust by player offset and tile grid alignment
const Player &myPlayer = *MyPlayer;
offset = tileOffset;
if (myPlayer.isWalking())
offset += GetOffsetForWalking(myPlayer.AnimInfo, myPlayer._pdir, true);
position += tileShift;
// Skip rendering parts covered by the panels
if (CanPanelsCoverView() && (IsLeftPanelOpen() || IsRightPanelOpen())) {
const int multiplier = (*GetOptions().Graphics.zoom) ? 1 : 2;
position += Displacement(Direction::East) * multiplier;
offset.deltaX += -TILE_WIDTH * multiplier / 2 / 2;
if (IsLeftPanelOpen() && !*GetOptions().Graphics.zoom) {
offset.deltaX += SidePanelSize.width;
// SidePanelSize.width accounted for in Zoom()
}
}
// Draw areas moving in and out of the screen
if (myPlayer.isWalking()) {
switch (myPlayer._pdir) {
case Direction::North:
case Direction::NorthEast:
offset.deltaY -= TILE_HEIGHT;
position += Direction::North;
break;
case Direction::SouthWest:
case Direction::West:
offset.deltaX -= TILE_WIDTH;
position += Direction::West;
break;
case Direction::NorthWest:
offset.deltaX -= TILE_WIDTH / 2;
offset.deltaY -= TILE_HEIGHT / 2;
position += Direction::NorthWest;
default:
break;
}
}
}
/**
* @brief Configure render and process screen rows
* @param fullOut Buffer to render to
* @param position First tile of view in dPiece coordinate
* @param offset Amount to offset the rendering in screen space
*/
void DrawGame(const Surface &fullOut, Point position, Displacement offset)
{
// Limit rendering to the view area
const Surface &out = !*GetOptions().Graphics.zoom
? fullOut.subregionY(0, gnViewportHeight)
: fullOut.subregionY(0, (gnViewportHeight + 1) / 2);
int columns = tileColumns;
int rows = tileRows;
// Skip rendering parts covered by the panels
if (CanPanelsCoverView() && (IsLeftPanelOpen() || IsRightPanelOpen())) {
columns -= (*GetOptions().Graphics.zoom) ? 2 : 4;
}
UpdateMissilesRendererData();
// Draw areas moving in and out of the screen
if (MyPlayer->isWalking()) {
switch (MyPlayer->_pdir) {
case Direction::NoDirection:
break;
case Direction::North:
case Direction::South:
rows += 2;
break;
case Direction::NorthEast:
columns++;
rows += 2;
break;
case Direction::East:
case Direction::West:
columns++;
break;
case Direction::SouthEast:
case Direction::SouthWest:
case Direction::NorthWest:
columns++;
rows++;
break;
}
}
#ifdef DUN_RENDER_STATS
DunRenderStats.clear();
#endif
Lightmap lightmap = Lightmap::build(*GetOptions().Graphics.perPixelLighting, position, Point {} + offset,
gnScreenWidth, gnViewportHeight, rows, columns,
Make `dun_render` a standalone library Does not make `dun_render_benchmark` standalone yet as that will require more untangling. Benchmark is neutral: ``` Benchmark Time CPU Time Old Time New CPU Old CPU New ---------------------------------------------------------------------------------------------------------------------------------------------------------- Render<LeftTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyLit>_mean +0.0119 +0.0120 8377 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_median +0.0119 +0.0119 8376 8477 8375 8475 Render<LeftTriangle, Solid, FullyLit>_stddev -0.0884 -0.2462 2 1 1 1 Render<LeftTriangle, Solid, FullyLit>_cv -0.0992 -0.2551 0 0 0 0 Render<LeftTriangle, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, FullyDark>_mean +0.0910 +0.0910 21174 23100 21170 23097 Render<LeftTriangle, Solid, FullyDark>_median +0.0869 +0.0869 21183 23023 21179 23019 Render<LeftTriangle, Solid, FullyDark>_stddev -0.1528 -0.1593 267 226 268 225 Render<LeftTriangle, Solid, FullyDark>_cv -0.2234 -0.2294 0 0 0 0 Render<LeftTriangle, Solid, PartiallyLit>_pvalue 0.0013 0.0013 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Solid, PartiallyLit>_mean +0.0065 +0.0065 81168 81698 81151 81680 Render<LeftTriangle, Solid, PartiallyLit>_median +0.0075 +0.0073 81143 81748 81136 81730 Render<LeftTriangle, Solid, PartiallyLit>_stddev +0.8663 +0.8787 167 311 164 307 Render<LeftTriangle, Solid, PartiallyLit>_cv +0.8542 +0.8665 0 0 0 0 Render<LeftTriangle, Transparent, FullyLit>_pvalue 0.0028 0.0017 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyLit>_mean -0.0239 -0.0239 94989 92719 94973 92703 Render<LeftTriangle, Transparent, FullyLit>_median -0.0122 -0.0123 93867 92717 93856 92704 Render<LeftTriangle, Transparent, FullyLit>_stddev -0.9920 -0.9955 2370 19 2368 11 Render<LeftTriangle, Transparent, FullyLit>_cv -0.9918 -0.9954 0 0 0 0 Render<LeftTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, FullyDark>_mean -0.0841 -0.0841 76234 69821 76220 69809 Render<LeftTriangle, Transparent, FullyDark>_median -0.0831 -0.0832 76209 69877 76202 69864 Render<LeftTriangle, Transparent, FullyDark>_stddev -0.4486 -0.4538 441 243 440 241 Render<LeftTriangle, Transparent, FullyDark>_cv -0.3979 -0.4037 0 0 0 0 Render<LeftTriangle, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTriangle, Transparent, PartiallyLit>_mean +0.0022 +0.0021 128812 129091 128792 129067 Render<LeftTriangle, Transparent, PartiallyLit>_median +0.0023 +0.0023 128820 129115 128805 129096 Render<LeftTriangle, Transparent, PartiallyLit>_stddev +0.8757 +0.6866 50 93 53 90 Render<LeftTriangle, Transparent, PartiallyLit>_cv +0.8716 +0.6830 0 0 0 0 Render<RightTriangle, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyLit>_mean +0.0057 +0.0057 8521 8570 8520 8569 Render<RightTriangle, Solid, FullyLit>_median +0.0057 +0.0057 8522 8570 8520 8568 Render<RightTriangle, Solid, FullyLit>_stddev -0.1826 -0.0420 1 1 1 1 Render<RightTriangle, Solid, FullyLit>_cv -0.1872 -0.0475 0 0 0 0 Render<RightTriangle, Solid, FullyDark>_pvalue 0.0006 0.0006 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, FullyDark>_mean -0.0303 -0.0303 22678 21991 22675 21987 Render<RightTriangle, Solid, FullyDark>_median -0.0360 -0.0359 22704 21888 22699 21883 Render<RightTriangle, Solid, FullyDark>_stddev +0.4759 +0.4648 195 288 196 287 Render<RightTriangle, Solid, FullyDark>_cv +0.5220 +0.5106 0 0 0 0 Render<RightTriangle, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Solid, PartiallyLit>_mean +0.0338 +0.0338 83355 86170 83341 86157 Render<RightTriangle, Solid, PartiallyLit>_median +0.0347 +0.0348 83248 86140 83230 86126 Render<RightTriangle, Solid, PartiallyLit>_stddev +0.3670 +0.3423 238 326 240 322 Render<RightTriangle, Solid, PartiallyLit>_cv +0.3224 +0.2985 0 0 0 0 Render<RightTriangle, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyLit>_mean -0.0617 -0.0616 102726 96392 102706 96375 Render<RightTriangle, Transparent, FullyLit>_median -0.0598 -0.0597 102521 96394 102498 96375 Render<RightTriangle, Transparent, FullyLit>_stddev -0.9516 -0.9548 456 22 461 21 Render<RightTriangle, Transparent, FullyLit>_cv -0.9485 -0.9518 0 0 0 0 Render<RightTriangle, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, FullyDark>_mean -0.1377 -0.1377 84505 72865 84492 72853 Render<RightTriangle, Transparent, FullyDark>_median -0.1374 -0.1374 84339 72748 84323 72740 Render<RightTriangle, Transparent, FullyDark>_stddev -0.2760 -0.2867 526 381 528 377 Render<RightTriangle, Transparent, FullyDark>_cv -0.1604 -0.1727 0 0 0 0 Render<RightTriangle, Transparent, PartiallyLit>_pvalue 0.0036 0.0017 U Test, Repetitions: 10 vs 10 Render<RightTriangle, Transparent, PartiallyLit>_mean +0.0010 +0.0010 131672 131808 131649 131784 Render<RightTriangle, Transparent, PartiallyLit>_median +0.0010 +0.0008 131665 131797 131654 131757 Render<RightTriangle, Transparent, PartiallyLit>_stddev -0.0688 -0.0128 81 75 72 71 Render<RightTriangle, Transparent, PartiallyLit>_cv -0.0697 -0.0138 0 0 0 0 Render<TransparentSquare, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyLit>_mean -0.0300 -0.0300 143323 139021 143300 139000 Render<TransparentSquare, Solid, FullyLit>_median -0.0300 -0.0301 143321 139014 143310 138990 Render<TransparentSquare, Solid, FullyLit>_stddev +0.0008 -0.0820 43 43 43 39 Render<TransparentSquare, Solid, FullyLit>_cv +0.0318 -0.0536 0 0 0 0 Render<TransparentSquare, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, FullyDark>_mean -0.0100 -0.0100 134939 133588 134914 133565 Render<TransparentSquare, Solid, FullyDark>_median -0.0106 -0.0108 134964 133526 134948 133497 Render<TransparentSquare, Solid, FullyDark>_stddev +1.7508 +1.8682 99 273 96 276 Render<TransparentSquare, Solid, FullyDark>_cv +1.7786 +1.8972 0 0 0 0 Render<TransparentSquare, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Solid, PartiallyLit>_mean -0.0460 -0.0460 152043 145043 152016 145020 Render<TransparentSquare, Solid, PartiallyLit>_median -0.0463 -0.0461 152012 144978 151964 144962 Render<TransparentSquare, Solid, PartiallyLit>_stddev -0.4453 -0.4334 267 148 266 151 Render<TransparentSquare, Solid, PartiallyLit>_cv -0.4185 -0.4060 0 0 0 0 Render<TransparentSquare, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyLit>_mean -0.0846 -0.0846 181333 165997 181304 165969 Render<TransparentSquare, Transparent, FullyLit>_median -0.0840 -0.0839 181184 165972 181147 165945 Render<TransparentSquare, Transparent, FullyLit>_stddev -0.5808 -0.5755 319 134 320 136 Render<TransparentSquare, Transparent, FullyLit>_cv -0.5421 -0.5362 0 0 0 0 Render<TransparentSquare, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, FullyDark>_mean -0.0250 -0.0250 142232 138672 142208 138648 Render<TransparentSquare, Transparent, FullyDark>_median -0.0245 -0.0245 142144 138663 142128 138639 Render<TransparentSquare, Transparent, FullyDark>_stddev +0.1011 +0.0806 288 317 290 313 Render<TransparentSquare, Transparent, FullyDark>_cv +0.1294 +0.1084 0 0 0 0 Render<TransparentSquare, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<TransparentSquare, Transparent, PartiallyLit>_mean +0.0105 +0.0105 205439 207589 205397 207556 Render<TransparentSquare, Transparent, PartiallyLit>_median +0.0106 +0.0107 205402 207575 205355 207558 Render<TransparentSquare, Transparent, PartiallyLit>_stddev -0.4410 -0.3876 182 102 167 102 Render<TransparentSquare, Transparent, PartiallyLit>_cv -0.4468 -0.3940 0 0 0 0 Render<Square, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyLit>_mean -0.0010 -0.0010 11109 11098 11107 11096 Render<Square, Solid, FullyLit>_median -0.0010 -0.0010 11109 11097 11107 11095 Render<Square, Solid, FullyLit>_stddev -0.2265 +0.2791 3 2 2 2 Render<Square, Solid, FullyLit>_cv -0.2257 +0.2804 0 0 0 0 Render<Square, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, FullyDark>_mean +0.0904 +0.0904 8513 9283 8512 9282 Render<Square, Solid, FullyDark>_median +0.0902 +0.0902 8521 9290 8519 9288 Render<Square, Solid, FullyDark>_stddev -0.1884 -0.1616 21 17 21 18 Render<Square, Solid, FullyDark>_cv -0.2557 -0.2311 0 0 0 0 Render<Square, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Solid, PartiallyLit>_mean +0.0038 +0.0038 163661 164289 163632 164259 Render<Square, Solid, PartiallyLit>_median +0.0038 +0.0040 163665 164290 163621 164269 Render<Square, Solid, PartiallyLit>_stddev +0.1746 +0.4412 34 40 28 40 Render<Square, Solid, PartiallyLit>_cv +0.1701 +0.4356 0 0 0 0 Render<Square, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyLit>_mean -0.0029 -0.0029 197906 197340 197876 197304 Render<Square, Transparent, FullyLit>_median -0.0030 -0.0029 197929 197339 197872 197307 Render<Square, Transparent, FullyLit>_stddev -0.5965 -0.7554 61 25 62 15 Render<Square, Transparent, FullyLit>_cv -0.5953 -0.7547 0 0 0 0 Render<Square, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, FullyDark>_mean -0.0163 -0.0163 125659 123607 125641 123588 Render<Square, Transparent, FullyDark>_median -0.0163 -0.0163 125651 123609 125629 123579 Render<Square, Transparent, FullyDark>_stddev -0.7943 -0.8033 180 37 181 36 Render<Square, Transparent, FullyDark>_cv -0.7909 -0.8000 0 0 0 0 Render<Square, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<Square, Transparent, PartiallyLit>_mean +0.0182 +0.0182 278103 283157 278043 283107 Render<Square, Transparent, PartiallyLit>_median +0.0184 +0.0184 278086 283190 278017 283120 Render<Square, Transparent, PartiallyLit>_stddev +1.6051 +1.5303 81 210 82 209 Render<Square, Transparent, PartiallyLit>_cv +1.5586 +1.4850 0 0 0 0 Render<LeftTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyLit>_mean -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_median -0.0068 -0.0068 3299 3276 3298 3276 Render<LeftTrapezoid, Solid, FullyLit>_stddev -0.4844 -0.6856 1 0 1 0 Render<LeftTrapezoid, Solid, FullyLit>_cv -0.4809 -0.6834 0 0 0 0 Render<LeftTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, FullyDark>_mean +0.3996 +0.3997 5163 7227 5162 7226 Render<LeftTrapezoid, Solid, FullyDark>_median +0.3973 +0.3974 5174 7230 5173 7229 Render<LeftTrapezoid, Solid, FullyDark>_stddev -0.7835 -0.7789 89 19 89 20 Render<LeftTrapezoid, Solid, FullyDark>_cv -0.8453 -0.8420 0 0 0 0 Render<LeftTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Solid, PartiallyLit>_mean -0.1228 -0.1228 50053 43907 50044 43900 Render<LeftTrapezoid, Solid, PartiallyLit>_median -0.1228 -0.1228 50062 43916 50054 43906 Render<LeftTrapezoid, Solid, PartiallyLit>_stddev +1.3916 +1.3800 63 150 64 151 Render<LeftTrapezoid, Solid, PartiallyLit>_cv +1.7263 +1.7131 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyLit>_mean -0.1584 -0.1583 62677 52751 62665 52743 Render<LeftTrapezoid, Transparent, FullyLit>_median -0.1585 -0.1585 62670 52736 62656 52728 Render<LeftTrapezoid, Transparent, FullyLit>_stddev +1.1429 +1.4086 26 55 23 55 Render<LeftTrapezoid, Transparent, FullyLit>_cv +1.5461 +1.8617 0 0 0 0 Render<LeftTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, FullyDark>_mean -0.1929 -0.1929 57688 46558 57679 46551 Render<LeftTrapezoid, Transparent, FullyDark>_median -0.1943 -0.1944 57681 46473 57672 46459 Render<LeftTrapezoid, Transparent, FullyDark>_stddev +2.8190 +2.7914 62 237 63 238 Render<LeftTrapezoid, Transparent, FullyDark>_cv +3.7319 +3.6978 0 0 0 0 Render<LeftTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<LeftTrapezoid, Transparent, PartiallyLit>_mean -0.0054 -0.0054 70694 70313 70682 70301 Render<LeftTrapezoid, Transparent, PartiallyLit>_median -0.0050 -0.0048 70671 70319 70650 70311 Render<LeftTrapezoid, Transparent, PartiallyLit>_stddev -0.7448 -0.7617 163 42 168 40 Render<LeftTrapezoid, Transparent, PartiallyLit>_cv -0.7434 -0.7604 0 0 0 0 Render<RightTrapezoid, Solid, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyLit>_mean +0.0123 +0.0123 2985 3022 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_median +0.0123 +0.0123 2985 3021 2984 3021 Render<RightTrapezoid, Solid, FullyLit>_stddev -0.4207 -0.4667 1 0 1 0 Render<RightTrapezoid, Solid, FullyLit>_cv -0.4277 -0.4731 0 0 0 0 Render<RightTrapezoid, Solid, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, FullyDark>_mean +0.1105 +0.1105 4894 5435 4893 5434 Render<RightTrapezoid, Solid, FullyDark>_median +0.1083 +0.1082 4902 5433 4901 5432 Render<RightTrapezoid, Solid, FullyDark>_stddev -0.1973 -0.1947 45 37 45 37 Render<RightTrapezoid, Solid, FullyDark>_cv -0.2772 -0.2748 0 0 0 0 Render<RightTrapezoid, Solid, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Solid, PartiallyLit>_mean -0.0169 -0.0169 48201 47386 48192 47379 Render<RightTrapezoid, Solid, PartiallyLit>_median -0.0172 -0.0170 48184 47355 48170 47351 Render<RightTrapezoid, Solid, PartiallyLit>_stddev +0.6070 +0.5204 48 78 50 76 Render<RightTrapezoid, Solid, PartiallyLit>_cv +0.6346 +0.5465 0 0 0 0 Render<RightTrapezoid, Transparent, FullyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyLit>_mean -0.0023 -0.0023 48751 48639 48742 48632 Render<RightTrapezoid, Transparent, FullyLit>_median -0.0020 -0.0018 48751 48654 48738 48651 Render<RightTrapezoid, Transparent, FullyLit>_stddev +2.4354 +2.4427 10 35 11 36 Render<RightTrapezoid, Transparent, FullyLit>_cv +2.4433 +2.4505 0 0 0 0 Render<RightTrapezoid, Transparent, FullyDark>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, FullyDark>_mean -0.2247 -0.2247 40942 31742 40936 31736 Render<RightTrapezoid, Transparent, FullyDark>_median -0.2241 -0.2240 40904 31739 40895 31734 Render<RightTrapezoid, Transparent, FullyDark>_stddev -0.3455 -0.3546 165 108 167 108 Render<RightTrapezoid, Transparent, FullyDark>_cv -0.1558 -0.1676 0 0 0 0 Render<RightTrapezoid, Transparent, PartiallyLit>_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10 Render<RightTrapezoid, Transparent, PartiallyLit>_mean -0.0908 -0.0908 74269 67523 74256 67512 Render<RightTrapezoid, Transparent, PartiallyLit>_median -0.0898 -0.0897 74196 67536 74176 67523 Render<RightTrapezoid, Transparent, PartiallyLit>_stddev -0.6590 -0.6568 147 50 146 50 Render<RightTrapezoid, Transparent, PartiallyLit>_cv -0.6250 -0.6225 0 0 0 0 BM_RenderBlackTile_pvalue 0.0539 0.0539 U Test, Repetitions: 10 vs 10 BM_RenderBlackTile_mean -0.0188 -0.0188 125 123 125 123 BM_RenderBlackTile_median -0.0263 -0.0264 126 122 125 122 BM_RenderBlackTile_stddev +1.0907 +1.0966 1 3 1 3 BM_RenderBlackTile_cv +1.1307 +1.1368 0 0 0 0 OVERALL_GEOMEAN -0.0207 -0.0207 0 0 0 0 ```
8 months ago
out.at(0, 0), out.pitch(), LightTables, FullyLitLightTable, FullyDarkLightTable,
dLight, MicroTileLen);
DrawFloor(out, lightmap, position, Point {} + offset, rows, columns);
DrawTileContent(out, lightmap, position, Point {} + offset, rows, columns);
if (*GetOptions().Graphics.zoom) {
Zoom(fullOut.subregionY(0, gnViewportHeight));
}
#ifdef DUN_RENDER_STATS
std::vector<std::pair<DunRenderType, size_t>> sortedStats(DunRenderStats.begin(), DunRenderStats.end());
c_sort(sortedStats, [](const std::pair<DunRenderType, size_t> &a, const std::pair<DunRenderType, size_t> &b) {
return a.first.maskType == b.first.maskType
? static_cast<uint8_t>(a.first.tileType) < static_cast<uint8_t>(b.first.tileType)
: static_cast<uint8_t>(a.first.maskType) < static_cast<uint8_t>(b.first.maskType);
});
Point pos { 100, 20 };
for (size_t i = 0; i < sortedStats.size(); ++i) {
const auto &stat = sortedStats[i];
DrawString(out, StrCat(i, "."), Rectangle(pos, Size { 20, 16 }), { .flags = UiFlags::AlignRight });
DrawString(out, MaskTypeToString(stat.first.maskType), { pos.x + 24, pos.y });
DrawString(out, TileTypeToString(stat.first.tileType), { pos.x + 184, pos.y });
DrawString(out, FormatInteger(stat.second), Rectangle({ pos.x + 354, pos.y }, Size(40, 16)), { .flags = UiFlags::AlignRight });
pos.y += 16;
}
#endif
}
/**
* @brief Start rendering of screen, town variation
* @param out Buffer to render to
* @param startPosition Center of view in dPiece coordinates
*/
void DrawView(const Surface &out, Point startPosition)
{
#ifdef _DEBUG
DebugCoordsMap.clear();
#endif
Displacement offset = {};
CalcFirstTilePosition(startPosition, offset);
DrawGame(out, startPosition, offset);
if (AutomapActive) {
DrawAutomap(out.subregionY(0, gnViewportHeight));
}
#ifdef _DEBUG
bool debugGridTextNeeded = IsDebugGridTextNeeded();
if (debugGridTextNeeded || DebugGrid) {
// force redrawing or debug stuff stays on panel on 640x480 resolution
RedrawEverything();
std::string debugGridText;
bool megaTiles = IsDebugGridInMegatiles();
for (auto [dunCoordVal, pixelCoords] : DebugCoordsMap) {
Point dunCoords = { dunCoordVal % MAXDUNX, dunCoordVal / MAXDUNX };
if (megaTiles && (dunCoords.x % 2 == 1 || dunCoords.y % 2 == 1))
continue;
if (megaTiles)
pixelCoords += Displacement { 0, TILE_HEIGHT / 2 };
if (*GetOptions().Graphics.zoom)
pixelCoords *= 2;
if (debugGridTextNeeded && GetDebugGridText(dunCoords, debugGridText)) {
Size tileSize = { TILE_WIDTH, TILE_HEIGHT };
if (*GetOptions().Graphics.zoom)
tileSize *= 2;
DrawString(out, debugGridText, { pixelCoords - Displacement { 0, tileSize.height }, tileSize },
{ .flags = UiFlags::ColorRed | UiFlags::AlignCenter | UiFlags::VerticalCenter });
}
if (DebugGrid) {
int halfTileWidth = TILE_WIDTH / 2;
int halfTileHeight = TILE_HEIGHT / 2;
if (*GetOptions().Graphics.zoom) {
halfTileWidth *= 2;
halfTileHeight *= 2;
}
const Point center { pixelCoords.x + halfTileWidth, pixelCoords.y - halfTileHeight };
if (megaTiles) {
halfTileWidth *= 2;
halfTileHeight *= 2;
}
const uint8_t col = PAL16_BEIGE;
for (const auto &[originX, dx] : { std::pair(center.x - halfTileWidth, 1), std::pair(center.x + halfTileWidth, -1) }) {
// We only need to draw half of the grid cell boundaries (one triangle).
// The other triangle will be drawn when drawing the adjacent grid cells.
const int dy = 1;
Point from { originX, center.y };
int height = halfTileHeight;
if (out.InBounds(from) && out.InBounds(from + Displacement { 2 * dx * height, dy * height })) {
uint8_t *dst = out.at(from.x, from.y);
const int pitch = out.pitch();
while (height-- > 0) {
*dst = col;
dst += dx;
*dst = col;
dst += dx;
dst += static_cast<ptrdiff_t>(dy * pitch);
}
} else {
while (height-- > 0) {
out.SetPixel(from, col);
from.x += dx;
out.SetPixel(from, col);
from.x += dx;
from.y += dy;
}
}
}
}
}
}
#endif
DrawItemNameLabels(out);
DrawMonsterHealthBar(out);
DrawFloatingNumbers(out, startPosition, offset);
if (IsPlayerInStore() && !qtextflag)
DrawSText(out);
if (invflag) {
DrawInv(out);
} else if (SpellbookFlag) {
DrawSpellBook(out);
}
DrawDurIcon(out);
if (CharFlag) {
DrawChr(out);
} else if (QuestLogIsOpen) {
DrawQuestLog(out);
4 years ago
} else if (IsStashOpen) {
DrawStash(out);
}
DrawLevelButton(out);
if (ShowUniqueItemInfoBox) {
DrawUniqueInfo(out);
}
if (qtextflag) {
DrawQText(out);
}
if (SpellSelectFlag) {
DrawSpellList(out);
}
if (DropGoldFlag) {
DrawGoldSplit(out);
}
DrawGoldWithdraw(out);
if (HelpFlag) {
DrawHelp(out);
}
4 years ago
if (ChatLogFlag) {
DrawChatLog(out);
}
if (MyPlayerIsDead) {
RedBack(out);
DrawDeathText(out);
} else if (PauseMode != 0) {
gmenu_draw_pause(out);
}
if (IsDiabloMsgAvailable()) {
DrawDiabloMsg(out.subregionY(0, out.h() - GetMainPanel().size.height));
}
DrawControllerModifierHints(out);
DrawPlrMsg(out);
gmenu_draw(out);
doom_draw(out);
DrawInfoBox(out);
UpdateLifeManaPercent(); // Update life/mana totals before rendering any portion of the flask.
DrawLifeFlaskUpper(out);
DrawManaFlaskUpper(out);
}
/**
* @brief Display the current average FPS over 1 sec
*/
5 years ago
void DrawFPS(const Surface &out)
{
static int framesSinceLastUpdate = 0;
static std::string_view formatted {};
if (!frameflag || !gbActive) {
return;
}
framesSinceLastUpdate++;
const uint32_t runtimeInMs = SDL_GetTicks();
const uint32_t msSinceLastUpdate = runtimeInMs - lastFpsUpdateInMs;
if (msSinceLastUpdate >= 1000) {
lastFpsUpdateInMs = runtimeInMs;
constexpr int FpsPow10 = 10;
const uint32_t fps = 1000 * FpsPow10 * framesSinceLastUpdate / msSinceLastUpdate;
framesSinceLastUpdate = 0;
static char buf[15] {};
const char *end = fps >= 100 * FpsPow10
? BufCopy(buf, fps / FpsPow10, " FPS")
: BufCopy(buf, fps / FpsPow10, ".", fps % FpsPow10, " FPS");
formatted = { buf, static_cast<std::string_view::size_type>(end - buf) };
};
DrawString(out, formatted, Point { 8, 8 }, { .flags = UiFlags::ColorRed });
}
/**
* @brief Update part of the screen from the back buffer
*/
void DoBlitScreen(Rectangle area)
{
#ifdef DEBUG_DO_BLIT_SCREEN
const Surface &out = GlobalBackBuffer();
const uint8_t debugColor = PAL8_RED;
DrawHorizontalLine(out, area.position, area.size.width, debugColor);
DrawHorizontalLine(out, area.position + Displacement { 0, area.size.height - 1 }, area.size.width, debugColor);
DrawVerticalLine(out, area.position, area.size.height, debugColor);
DrawVerticalLine(out, area.position + Displacement { area.size.width - 1, 0 }, area.size.height, debugColor);
#endif
SDL_Rect srcRect = MakeSdlRect(area);
SDL_Rect dstRect = MakeSdlRect(area);
BltFast(&srcRect, &dstRect);
}
/**
* @brief Check render pipeline and update individual screen parts
* @param out Output surface.
* @param dwHgt Section of screen to update from top to bottom
* @param drawDesc Render info box
* @param drawHp Render health bar
* @param drawMana Render mana bar
* @param drawSbar Render belt
* @param drawBtn Render panel buttons
*/
void DrawMain(int dwHgt, bool drawDesc, bool drawHp, bool drawMana, bool drawSbar, bool drawBtn)
{
if (!gbActive || RenderDirectlyToOutputSurface) {
return;
}
assert(dwHgt >= 0 && dwHgt <= gnScreenHeight);
if (dwHgt > 0) {
DoBlitScreen({ { 0, 0 }, { gnScreenWidth, dwHgt } });
}
if (dwHgt < gnScreenHeight) {
const Point mainPanelPosition = GetMainPanel().position;
if (drawSbar) {
DoBlitScreen({ mainPanelPosition + Displacement { 204, 5 }, { 232, 28 } });
}
if (drawDesc) {
if (ChatFlag) {
// When chat input is displayed, the belt is hidden and the chat moves up.
DoBlitScreen({ mainPanelPosition + Displacement { 171, 6 }, { 298, 116 } });
} else {
DoBlitScreen({ mainPanelPosition + Displacement { InfoBoxRect.position.x, InfoBoxRect.position.y }, { InfoBoxRect.size } });
}
}
if (drawMana) {
DoBlitScreen({ mainPanelPosition + Displacement { 460, 0 }, { 88, 72 } });
DoBlitScreen({ mainPanelPosition + Displacement { 564, 64 }, { 56, 56 } });
}
if (drawHp) {
DoBlitScreen({ mainPanelPosition + Displacement { 96, 0 }, { 88, 72 } });
}
if (drawBtn) {
DoBlitScreen({ mainPanelPosition + Displacement { 8, 7 }, { 74, 114 } });
DoBlitScreen({ mainPanelPosition + Displacement { 559, 7 }, { 74, 48 } });
if (gbIsMultiplayer) {
DoBlitScreen({ mainPanelPosition + Displacement { 86, 91 }, { 34, 32 } });
DoBlitScreen({ mainPanelPosition + Displacement { 526, 91 }, { 34, 32 } });
}
}
if (PrevCursorRect.size.width != 0 && PrevCursorRect.size.height != 0) {
DoBlitScreen(PrevCursorRect);
}
const Rectangle &cursorRect = GetDrawnCursor().rect;
if (cursorRect.size.width != 0 && cursorRect.size.height != 0) {
DoBlitScreen(cursorRect);
}
}
}
void OptionShowFPSChanged()
{
if (*GetOptions().Graphics.showFPS)
EnableFrameCount();
else
frameflag = false;
}
const auto OptionChangeHandlerShowFPS = (GetOptions().Graphics.showFPS.SetValueChangedCallback(OptionShowFPSChanged), true);
} // namespace
Displacement GetOffsetForWalking(const AnimationInfo &animationInfo, const Direction dir, bool cameraMode /*= false*/)
{
// clang-format off
// South, SouthWest, West, NorthWest, North, NorthEast, East, SouthEast,
constexpr Displacement MovingOffset[8] = { { 0, 32 }, { -32, 16 }, { -64, 0 }, { -32, -16 }, { 0, -32 }, { 32, -16 }, { 64, 0 }, { 32, 16 } };
// clang-format on
const uint8_t animationProgress = animationInfo.getAnimationProgress();
Displacement offset = MovingOffset[static_cast<size_t>(dir)];
offset *= animationProgress;
offset /= AnimationInfo::baseValueFraction;
if (cameraMode) {
offset = -offset;
}
return offset;
}
void ClearCursor() // CODE_FIX: this was supposed to be in cursor.cpp
{
PrevCursorRect = {};
}
void ShiftGrid(Point *offset, int horizontal, int vertical)
{
offset->x += vertical + horizontal;
offset->y += vertical - horizontal;
}
int RowsCoveredByPanel()
{
const auto &mainPanelSize = GetMainPanel().size;
if (GetScreenWidth() <= mainPanelSize.width) {
return 0;
}
int rows = mainPanelSize.height / TILE_HEIGHT;
if (*GetOptions().Graphics.zoom) {
rows /= 2;
}
return rows;
}
void CalcTileOffset(int *offsetX, int *offsetY)
{
const uint16_t screenWidth = GetScreenWidth();
const uint16_t viewportHeight = GetViewportHeight();
int x;
int y;
if (!*GetOptions().Graphics.zoom) {
x = screenWidth % TILE_WIDTH;
y = viewportHeight % TILE_HEIGHT;
} else {
x = (screenWidth / 2) % TILE_WIDTH;
y = (viewportHeight / 2) % TILE_HEIGHT;
}
if (x != 0)
x = (TILE_WIDTH - x) / 2;
if (y != 0)
y = (TILE_HEIGHT - y) / 2;
*offsetX = x;
*offsetY = y;
}
void TilesInView(int *rcolumns, int *rrows)
{
const uint16_t screenWidth = GetScreenWidth();
const uint16_t viewportHeight = GetViewportHeight();
int columns = screenWidth / TILE_WIDTH;
if ((screenWidth % TILE_WIDTH) != 0) {
columns++;
}
int rows = viewportHeight / TILE_HEIGHT;
if ((viewportHeight % TILE_HEIGHT) != 0) {
rows++;
}
if (*GetOptions().Graphics.zoom) {
// Half the number of tiles, rounded up
if ((columns & 1) != 0) {
columns++;
}
columns /= 2;
if ((rows & 1) != 0) {
rows++;
}
rows /= 2;
}
*rcolumns = columns;
*rrows = rows;
}
void CalcViewportGeometry()
{
const int zoomFactor = *GetOptions().Graphics.zoom ? 2 : 1;
const int screenWidth = GetScreenWidth() / zoomFactor;
const int screenHeight = GetScreenHeight() / zoomFactor;
const int panelHeight = GetMainPanel().size.height / zoomFactor;
const int pixelsToPanel = screenHeight - panelHeight;
Point playerPosition { screenWidth / 2, pixelsToPanel / 2 };
if (*GetOptions().Graphics.zoom)
playerPosition.y += TILE_HEIGHT / 4;
const int tilesToTop = (playerPosition.y + TILE_HEIGHT - 1) / TILE_HEIGHT;
const int tilesToLeft = (playerPosition.x + TILE_WIDTH - 1) / TILE_WIDTH;
// Location of the center of the tile from which to start rendering, relative to the viewport origin
Point startPosition = playerPosition - Displacement { tilesToLeft * TILE_WIDTH, tilesToTop * TILE_HEIGHT };
// Position of the tile from which to start rendering in tile space,
// relative to the tile the player character occupies
tileShift = { 0, 0 };
tileShift += Displacement(Direction::North) * tilesToTop;
tileShift += Displacement(Direction::West) * tilesToLeft;
// The rendering loop expects to start on a row with fewer columns
if (tilesToLeft * TILE_WIDTH >= playerPosition.x) {
startPosition += Displacement { TILE_WIDTH / 2, -TILE_HEIGHT / 2 };
tileShift += Displacement(Direction::NorthEast);
} else if (tilesToTop * TILE_HEIGHT < playerPosition.y) {
// There is one row above the current row that needs to be rendered,
// but we skip to the row above it because it has too many columns
startPosition += Displacement { 0, -TILE_HEIGHT };
tileShift += Displacement(Direction::North);
}
// Location of the bottom-left corner of the bounding box around the
// tile from which to start rendering, relative to the viewport origin
tileOffset = { startPosition.x - TILE_WIDTH / 2, startPosition.y + TILE_HEIGHT / 2 - 1 };
// Compute the number of rows to be rendered as well as
// the number of columns to be rendered in the first row
const int viewportHeight = GetViewportHeight() / zoomFactor;
const Point renderStart = startPosition - Displacement { TILE_WIDTH / 2, TILE_HEIGHT / 2 };
tileRows = (viewportHeight - renderStart.y + TILE_HEIGHT / 2 - 1) / (TILE_HEIGHT / 2);
tileColumns = (screenWidth - renderStart.x + TILE_WIDTH - 1) / TILE_WIDTH;
}
Point GetScreenPosition(Point tile)
{
Point firstTile = ViewPosition;
Displacement offset = {};
CalcFirstTilePosition(firstTile, offset);
const Displacement delta = firstTile - tile;
Point position {};
position += delta.worldToScreen();
position += offset;
return position;
}
extern SDL_Surface *PalSurface;
void ClearScreenBuffer()
{
if (HeadlessMode)
return;
assert(PalSurface != nullptr);
SDL_FillSurfaceRect(PalSurface, nullptr, 0);
}
#ifdef _DEBUG
void ScrollView()
{
if (!MyPlayer->HoldItem.isEmpty())
return;
if (MousePosition.x < 20) {
if (dmaxPosition.y - 1 <= ViewPosition.y || dminPosition.x >= ViewPosition.x) {
if (dmaxPosition.y - 1 > ViewPosition.y) {
ViewPosition.y++;
}
if (dminPosition.x < ViewPosition.x) {
ViewPosition.x--;
}
} else {
ViewPosition.y++;
ViewPosition.x--;
}
}
if (MousePosition.x > gnScreenWidth - 20) {
if (dmaxPosition.x - 1 <= ViewPosition.x || dminPosition.y >= ViewPosition.y) {
if (dmaxPosition.x - 1 > ViewPosition.x) {
ViewPosition.x++;
}
if (dminPosition.y < ViewPosition.y) {
ViewPosition.y--;
}
} else {
ViewPosition.y--;
ViewPosition.x++;
}
}
if (MousePosition.y < 20) {
if (dminPosition.y >= ViewPosition.y || dminPosition.x >= ViewPosition.x) {
if (dminPosition.y < ViewPosition.y) {
ViewPosition.y--;
}
if (dminPosition.x < ViewPosition.x) {
ViewPosition.x--;
}
} else {
ViewPosition.x--;
ViewPosition.y--;
}
}
if (MousePosition.y > gnScreenHeight - 20) {
if (dmaxPosition.y - 1 <= ViewPosition.y || dmaxPosition.x - 1 <= ViewPosition.x) {
if (dmaxPosition.y - 1 > ViewPosition.y) {
ViewPosition.y++;
}
if (dmaxPosition.x - 1 > ViewPosition.x) {
ViewPosition.x++;
}
} else {
ViewPosition.x++;
ViewPosition.y++;
}
}
}
#endif
void EnableFrameCount()
{
frameflag = true;
lastFpsUpdateInMs = SDL_GetTicks();
}
void scrollrt_draw_game_screen()
{
if (HeadlessMode)
return;
int hgt = 0;
if (IsRedrawEverything()) {
RedrawComplete();
hgt = gnScreenHeight;
}
const Surface &out = GlobalBackBuffer();
UndrawCursor(out);
DrawCursor(out);
DrawMain(hgt, false, false, false, false, false);
RenderPresent();
}
void DrawAndBlit()
{
if (!gbRunGame || HeadlessMode) {
return;
}
int hgt = 0;
bool drawHealth = IsRedrawComponent(PanelDrawComponent::Health);
bool drawMana = IsRedrawComponent(PanelDrawComponent::Mana);
bool drawControlButtons = IsRedrawComponent(PanelDrawComponent::ControlButtons);
bool drawBelt = IsRedrawComponent(PanelDrawComponent::Belt);
const bool drawChatInput = ChatFlag;
bool drawInfoBox = false;
bool drawCtrlPan = false;
const Rectangle &mainPanel = GetMainPanel();
if (gnScreenWidth > mainPanel.size.width || IsRedrawEverything() || *GetOptions().Gameplay.enableFloatingNumbers != FloatingNumbers::Off) {
drawHealth = true;
drawMana = true;
drawControlButtons = true;
drawBelt = true;
drawInfoBox = false;
drawCtrlPan = true;
hgt = gnScreenHeight;
} else if (IsRedrawViewport()) {
drawInfoBox = true;
drawCtrlPan = false;
hgt = gnViewportHeight;
}
const Surface &out = GlobalBackBuffer();
UndrawCursor(out);
nthread_UpdateProgressToNextGameTick();
DrawView(out, ViewPosition);
if (drawCtrlPan) {
DrawMainPanel(out);
}
if (drawHealth) {
DrawLifeFlaskLower(out, !drawCtrlPan);
}
if (drawMana) {
DrawManaFlaskLower(out, !drawCtrlPan);
DrawSpell(out);
}
if (drawControlButtons) {
DrawMainPanelButtons(out);
}
if (drawBelt) {
DrawInvBelt(out);
}
if (drawChatInput) {
DrawChatBox(out);
}
DrawXPBar(out);
if (*GetOptions().Gameplay.showHealthValues)
DrawFlaskValues(out, { mainPanel.position.x + 134, mainPanel.position.y + 28 }, MyPlayer->_pHitPoints >> 6, MyPlayer->_pMaxHP >> 6);
if (*GetOptions().Gameplay.showManaValues)
DrawFlaskValues(out, { mainPanel.position.x + mainPanel.size.width - 138, mainPanel.position.y + 28 },
(HasAnyOf(InspectPlayer->_pIFlags, ItemSpecialEffect::NoMana) || (MyPlayer->_pMana >> 6) <= 0) ? 0 : MyPlayer->_pMana >> 6,
HasAnyOf(InspectPlayer->_pIFlags, ItemSpecialEffect::NoMana) ? 0 : MyPlayer->_pMaxMana >> 6);
if (*GetOptions().Gameplay.floatingInfoBox)
DrawFloatingInfoBox(out);
if (*GetOptions().Gameplay.showMultiplayerPartyInfo && PartySidePanelOpen)
DrawPartyMemberInfoPanel(out);
DrawCursor(out);
DrawFPS(out);
LuaEvent("GameDrawComplete");
DrawMain(hgt, drawInfoBox, drawHealth, drawMana, drawBelt, drawControlButtons);
#ifdef _DEBUG
DrawConsole(out);
#endif
RedrawComplete();
for (const PanelDrawComponent component : enum_values<PanelDrawComponent>()) {
if (IsRedrawComponent(component)) {
RedrawComponentComplete(component);
}
}
RenderPresent();
}
} // namespace devilution