|
|
|
|
/**
|
|
|
|
|
* @file gendung.h
|
|
|
|
|
*
|
|
|
|
|
* Interface of general dungeon generation code.
|
|
|
|
|
*/
|
|
|
|
|
#pragma once
|
|
|
|
|
|
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
```
7 months ago
|
|
|
#include <cstddef>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <optional>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
|
|
#include <expected.hpp>
|
|
|
|
|
|
|
|
|
|
#include "engine/clx_sprite.hpp"
|
|
|
|
|
#include "engine/point.hpp"
|
|
|
|
|
#include "engine/rectangle.hpp"
|
|
|
|
|
#include "engine/render/scrollrt.h"
|
|
|
|
|
#include "engine/world_tile.hpp"
|
|
|
|
|
#include "levels/dun_tile.hpp"
|
|
|
|
|
#include "levels/gendung_defs.hpp"
|
|
|
|
|
#include "utils/attributes.h"
|
|
|
|
|
#include "utils/bitset2d.hpp"
|
|
|
|
|
#include "utils/enum_traits.h"
|
|
|
|
|
|
|
|
|
|
namespace devilution {
|
|
|
|
|
|
|
|
|
|
#define MAXTHEMES 50
|
|
|
|
|
#define MAXTILES 1379
|
|
|
|
|
|
|
|
|
|
enum _setlevels : int8_t {
|
|
|
|
|
SL_NONE,
|
|
|
|
|
SL_SKELKING,
|
|
|
|
|
SL_BONECHAMB,
|
|
|
|
|
SL_MAZE,
|
|
|
|
|
SL_POISONWATER,
|
|
|
|
|
SL_VILEBETRAYER,
|
|
|
|
|
|
|
|
|
|
SL_ARENA_CHURCH,
|
|
|
|
|
SL_ARENA_HELL,
|
|
|
|
|
SL_ARENA_CIRCLE_OF_LIFE,
|
|
|
|
|
|
|
|
|
|
SL_FIRST_ARENA = SL_ARENA_CHURCH,
|
|
|
|
|
SL_LAST = SL_ARENA_CIRCLE_OF_LIFE,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
inline bool IsArenaLevel(_setlevels setLevel)
|
|
|
|
|
{
|
|
|
|
|
switch (setLevel) {
|
|
|
|
|
case SL_ARENA_CHURCH:
|
|
|
|
|
case SL_ARENA_HELL:
|
|
|
|
|
case SL_ARENA_CIRCLE_OF_LIFE:
|
|
|
|
|
return true;
|
|
|
|
|
default:
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tl::expected<dungeon_type, std::string> ParseDungeonType(std::string_view value);
|
|
|
|
|
tl::expected<_setlevels, std::string> ParseSetLevel(std::string_view value);
|
|
|
|
|
|
|
|
|
|
enum class DungeonFlag : uint8_t {
|
|
|
|
|
// clang-format off
|
|
|
|
|
None = 0, // Only used by lighting/automap
|
|
|
|
|
Missile = 1 << 0,
|
|
|
|
|
Visible = 1 << 1,
|
|
|
|
|
DeadPlayer = 1 << 2,
|
|
|
|
|
Populated = 1 << 3,
|
|
|
|
|
MissileFireWall = 1 << 4,
|
|
|
|
|
MissileLightningWall = 1 << 5,
|
|
|
|
|
Lit = 1 << 6,
|
|
|
|
|
Explored = 1 << 7,
|
|
|
|
|
SavedFlags = (Populated | Lit | Explored), // ~(Missile | Visible | DeadPlayer)
|
|
|
|
|
LoadedFlags = (Missile | Visible | DeadPlayer | Populated | Lit | Explored)
|
|
|
|
|
// clang-format on
|
|
|
|
|
};
|
|
|
|
|
use_enum_as_flags(DungeonFlag);
|
|
|
|
|
|
|
|
|
|
enum _difficulty : uint8_t {
|
|
|
|
|
DIFF_NORMAL,
|
|
|
|
|
DIFF_NIGHTMARE,
|
|
|
|
|
DIFF_HELL,
|
|
|
|
|
|
|
|
|
|
DIFF_LAST = DIFF_HELL,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct THEME_LOC {
|
|
|
|
|
RectangleOf<uint8_t> room;
|
|
|
|
|
int8_t ttval;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct MegaTile {
|
|
|
|
|
uint16_t micro1;
|
|
|
|
|
uint16_t micro2;
|
|
|
|
|
uint16_t micro3;
|
|
|
|
|
uint16_t micro4;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct ShadowStruct {
|
|
|
|
|
uint8_t strig;
|
|
|
|
|
uint8_t s1;
|
|
|
|
|
uint8_t s2;
|
|
|
|
|
uint8_t s3;
|
|
|
|
|
uint8_t nv1;
|
|
|
|
|
uint8_t nv2;
|
|
|
|
|
uint8_t nv3;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** Reprecents what tiles are being utilized in the generated map. */
|
|
|
|
|
extern Bitset2d<DMAXX, DMAXY> DungeonMask;
|
|
|
|
|
/** Contains the tile IDs of the map. */
|
|
|
|
|
extern DVL_API_FOR_TEST uint8_t dungeon[DMAXX][DMAXY];
|
|
|
|
|
/** Contains a backup of the tile IDs of the map. */
|
|
|
|
|
extern uint8_t pdungeon[DMAXX][DMAXY];
|
|
|
|
|
/** Tile that may not be overwritten by the level generator */
|
|
|
|
|
extern Bitset2d<DMAXX, DMAXY> Protected;
|
|
|
|
|
extern WorldTileRectangle SetPieceRoom;
|
|
|
|
|
/** Specifies the active set quest piece in coordinate. */
|
|
|
|
|
extern WorldTileRectangle SetPiece;
|
|
|
|
|
extern OptionalOwnedClxSpriteList pSpecialCels;
|
|
|
|
|
/** Specifies the tile definitions of the active dungeon type; (e.g. levels/l1data/l1.til). */
|
|
|
|
|
extern DVL_API_FOR_TEST std::unique_ptr<MegaTile[]> pMegaTiles;
|
|
|
|
|
extern DVL_API_FOR_TEST std::unique_ptr<std::byte[]> pDungeonCels;
|
|
|
|
|
/**
|
|
|
|
|
* List tile properties
|
|
|
|
|
*/
|
|
|
|
|
extern DVL_API_FOR_TEST TileProperties SOLData[MAXTILES];
|
|
|
|
|
/** Specifies the minimum X,Y-coordinates of the map. */
|
|
|
|
|
extern WorldTilePosition dminPosition;
|
|
|
|
|
/** Specifies the maximum X,Y-coordinates of the map. */
|
|
|
|
|
extern WorldTilePosition dmaxPosition;
|
|
|
|
|
/** Specifies the active dungeon type of the current game. */
|
|
|
|
|
extern DVL_API_FOR_TEST dungeon_type leveltype;
|
|
|
|
|
/** Specifies the active dungeon level of the current game. */
|
|
|
|
|
extern DVL_API_FOR_TEST uint8_t currlevel;
|
|
|
|
|
extern bool setlevel;
|
|
|
|
|
/** Specifies the active quest level of the current game. */
|
|
|
|
|
extern _setlevels setlvlnum;
|
|
|
|
|
/** Specifies the dungeon type of the active quest level of the current game. */
|
|
|
|
|
extern dungeon_type setlvltype;
|
|
|
|
|
/** Specifies the player viewpoint X,Y-coordinates of the map. */
|
|
|
|
|
extern DVL_API_FOR_TEST Point ViewPosition;
|
|
|
|
|
extern uint_fast8_t MicroTileLen;
|
|
|
|
|
extern int8_t TransVal;
|
|
|
|
|
/** Specifies the active transparency indices. */
|
|
|
|
|
extern std::array<bool, 256> TransList;
|
|
|
|
|
/** Contains the piece IDs of each tile on the map. */
|
|
|
|
|
extern DVL_API_FOR_TEST uint16_t dPiece[MAXDUNX][MAXDUNY];
|
|
|
|
|
/** Map of micros that comprises a full tile for any given dungeon piece. */
|
|
|
|
|
extern DVL_API_FOR_TEST MICROS DPieceMicros[MAXTILES];
|
|
|
|
|
/** Specifies the transparency at each coordinate of the map. */
|
|
|
|
|
extern DVL_API_FOR_TEST int8_t dTransVal[MAXDUNX][MAXDUNY];
|
|
|
|
|
/** Current realtime lighting. Per tile. */
|
|
|
|
|
extern DVL_API_FOR_TEST uint8_t dLight[MAXDUNX][MAXDUNY];
|
|
|
|
|
/** Precalculated static lights. dLight uses this as a base before applying lights. Per tile. */
|
|
|
|
|
extern uint8_t dPreLight[MAXDUNX][MAXDUNY];
|
|
|
|
|
/** Holds various information about dungeon tiles, @see DungeonFlag */
|
|
|
|
|
extern DungeonFlag dFlags[MAXDUNX][MAXDUNY];
|
|
|
|
|
/** Contains the player numbers (players array indices) of the map. negative id indicates player moving. */
|
|
|
|
|
extern int8_t dPlayer[MAXDUNX][MAXDUNY];
|
|
|
|
|
/**
|
|
|
|
|
* Contains the NPC numbers of the map. The NPC number represents a
|
|
|
|
|
* towner number (towners array index) in Tristram and a monster number
|
|
|
|
|
* (monsters array index) in the dungeon.
|
|
|
|
|
* Negative id indicates monsters moving.
|
|
|
|
|
*/
|
|
|
|
|
extern int16_t dMonster[MAXDUNX][MAXDUNY];
|
|
|
|
|
/**
|
|
|
|
|
* Contains the dead numbers (deads array indices) and dead direction of
|
|
|
|
|
* the map, encoded as specified by the pseudo-code below.
|
|
|
|
|
* dDead[x][y] & 0x1F - index of dead
|
|
|
|
|
* dDead[x][y] >> 0x5 - direction
|
|
|
|
|
*/
|
|
|
|
|
extern DVL_API_FOR_TEST int8_t dCorpse[MAXDUNX][MAXDUNY];
|
|
|
|
|
/**
|
|
|
|
|
* Contains the object numbers (objects array indices) of the map.
|
|
|
|
|
* Large objects have negative id for their extended area.
|
|
|
|
|
*/
|
|
|
|
|
extern DVL_API_FOR_TEST int8_t dObject[MAXDUNX][MAXDUNY];
|
|
|
|
|
/**
|
|
|
|
|
* Contains the arch frame numbers of the map from the special tileset
|
|
|
|
|
* (e.g. "levels/l1data/l1s"). Note, the special tileset of Tristram (i.e.
|
|
|
|
|
* "levels/towndata/towns") contains trees rather than arches.
|
|
|
|
|
*/
|
|
|
|
|
extern int8_t dSpecial[MAXDUNX][MAXDUNY];
|
|
|
|
|
extern int themeCount;
|
|
|
|
|
extern THEME_LOC themeLoc[MAXTHEMES];
|
|
|
|
|
|
|
|
|
|
#ifdef BUILD_TESTING
|
|
|
|
|
std::optional<WorldTileSize> GetSizeForThemeRoom();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
dungeon_type GetLevelType(int level);
|
|
|
|
|
void CreateDungeon(uint32_t rseed, lvl_entry entry);
|
|
|
|
|
|
|
|
|
|
DVL_ALWAYS_INLINE constexpr bool InDungeonBounds(Point position)
|
|
|
|
|
{
|
|
|
|
|
return position.x >= 0 && position.x < MAXDUNX && position.y >= 0 && position.y < MAXDUNY;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Checks if a given tile contains at least one missile
|
|
|
|
|
* @param position Coordinates of the dungeon tile to check
|
|
|
|
|
* @return true if a missile exists at this position
|
|
|
|
|
*/
|
|
|
|
|
constexpr bool TileContainsMissile(Point position)
|
|
|
|
|
{
|
|
|
|
|
return InDungeonBounds(position) && HasAnyOf(dFlags[position.x][position.y], DungeonFlag::Missile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Checks if a given tile contains a player corpse
|
|
|
|
|
* @param position Coordinates of the dungeon tile to check
|
|
|
|
|
* @return true if a dead player exists at this position
|
|
|
|
|
*/
|
|
|
|
|
constexpr bool TileContainsDeadPlayer(Point position)
|
|
|
|
|
{
|
|
|
|
|
return InDungeonBounds(position) && HasAnyOf(dFlags[position.x][position.y], DungeonFlag::DeadPlayer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Check if a given tile contains a decorative object (or similar non-pathable set piece)
|
|
|
|
|
*
|
|
|
|
|
* This appears to include stairs so that monsters do not spawn or path onto them, but players can path to them to navigate between layers
|
|
|
|
|
*
|
|
|
|
|
* @param position Coordinates of the dungeon tile to check
|
|
|
|
|
* @return true if a set piece was spawned at this position
|
|
|
|
|
*/
|
|
|
|
|
constexpr bool TileContainsSetPiece(Point position)
|
|
|
|
|
{
|
|
|
|
|
return InDungeonBounds(position) && HasAnyOf(dFlags[position.x][position.y], DungeonFlag::Populated);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Checks if any player can currently see this tile
|
|
|
|
|
*
|
|
|
|
|
* Currently only used by monster AI routines so basic monsters out of sight can be ignored until they're likely to interact with the player
|
|
|
|
|
*
|
|
|
|
|
* @param position Coordinates of the dungeon tile to check
|
|
|
|
|
* @return true if the tile is within at least one players vision
|
|
|
|
|
*/
|
|
|
|
|
constexpr bool IsTileVisible(Point position)
|
|
|
|
|
{
|
|
|
|
|
return InDungeonBounds(position) && HasAnyOf(dFlags[position.x][position.y], DungeonFlag::Visible);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Checks if a light source is illuminating this tile
|
|
|
|
|
* @param position Coordinates of the dungeon tile to check
|
|
|
|
|
* @return true if the tile is within the radius of at least one light source
|
|
|
|
|
*/
|
|
|
|
|
constexpr bool IsTileLit(Point position)
|
|
|
|
|
{
|
|
|
|
|
return InDungeonBounds(position) && HasAnyOf(dFlags[position.x][position.y], DungeonFlag::Lit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct Miniset {
|
|
|
|
|
WorldTileSize size;
|
|
|
|
|
/* these are indexed as [y][x] */
|
|
|
|
|
uint8_t search[6][6];
|
|
|
|
|
uint8_t replace[6][6];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param position Coordinates of the dungeon tile to check
|
|
|
|
|
* @param respectProtected Match bug from Crypt levels if false
|
|
|
|
|
*/
|
|
|
|
|
bool matches(WorldTilePosition position, bool respectProtected = true) const
|
|
|
|
|
{
|
|
|
|
|
for (WorldTileCoord yy = 0; yy < size.height; yy++) {
|
|
|
|
|
for (WorldTileCoord xx = 0; xx < size.width; xx++) {
|
|
|
|
|
if (search[yy][xx] != 0 && dungeon[xx + position.x][yy + position.y] != search[yy][xx])
|
|
|
|
|
return false;
|
|
|
|
|
if (respectProtected && Protected.test(xx + position.x, yy + position.y))
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void place(WorldTilePosition position, bool protect = false) const
|
|
|
|
|
{
|
|
|
|
|
for (WorldTileCoord y = 0; y < size.height; y++) {
|
|
|
|
|
for (WorldTileCoord x = 0; x < size.width; x++) {
|
|
|
|
|
if (replace[y][x] == 0)
|
|
|
|
|
continue;
|
|
|
|
|
dungeon[x + position.x][y + position.y] = replace[y][x];
|
|
|
|
|
if (protect)
|
|
|
|
|
Protected.set(x + position.x, y + position.y);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[[nodiscard]] DVL_ALWAYS_INLINE bool TileHasAny(Point coords, TileProperties property)
|
|
|
|
|
{
|
|
|
|
|
return HasAnyOf(SOLData[dPiece[coords.x][coords.y]], property);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tl::expected<void, std::string> LoadLevelSOLData();
|
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
```
7 months ago
|
|
|
void SetDungeonMicros(std::unique_ptr<std::byte[]> &dungeonCels, uint_fast8_t µTileLen);
|
|
|
|
|
void DRLG_InitTrans();
|
|
|
|
|
void DRLG_MRectTrans(WorldTilePosition origin, WorldTilePosition extent);
|
|
|
|
|
void DRLG_MRectTrans(WorldTileRectangle area);
|
|
|
|
|
void DRLG_RectTrans(WorldTileRectangle area);
|
|
|
|
|
void DRLG_CopyTrans(int sx, int sy, int dx, int dy);
|
|
|
|
|
void LoadTransparency(const uint16_t *dunData);
|
|
|
|
|
void LoadDungeonBase(const char *path, Point spawn, int floorId, int dirtId);
|
|
|
|
|
void Make_SetPC(WorldTileRectangle area);
|
|
|
|
|
/**
|
|
|
|
|
* @param miniset The miniset to place
|
|
|
|
|
* @param tries Tiles to try, 1600 will scan the full map
|
|
|
|
|
* @param drlg1Quirk Match buggy behaviour of Diablo's Cathedral
|
|
|
|
|
*/
|
|
|
|
|
std::optional<Point> PlaceMiniSet(const Miniset &miniset, int tries = 199, bool drlg1Quirk = false);
|
|
|
|
|
void PlaceDunTiles(const uint16_t *dunData, Point position, int floorId = 0);
|
|
|
|
|
void DRLG_PlaceThemeRooms(int minSize, int maxSize, int floor, int freq, bool rndSize);
|
|
|
|
|
void DRLG_HoldThemeRooms();
|
|
|
|
|
/**
|
|
|
|
|
* @brief Returns the size in tiles of the specified ".dun" Data
|
|
|
|
|
*/
|
|
|
|
|
WorldTileSize GetDunSize(const uint16_t *dunData);
|
|
|
|
|
void DRLG_LPass3(int lv);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Checks if a theme room is located near the target point
|
|
|
|
|
* @param position Target location in dungeon coordinates
|
|
|
|
|
* @return True if a theme room is near (within 2 tiles of) this point, false if it is free.
|
|
|
|
|
*/
|
|
|
|
|
bool IsNearThemeRoom(WorldTilePosition position);
|
|
|
|
|
void InitLevels();
|
|
|
|
|
void FloodTransparencyValues(uint8_t floorID);
|
|
|
|
|
|
|
|
|
|
} // namespace devilution
|