856 Commits
Author SHA1 Message Date
ephphatha ed5d2d98e7 Simplify AddBookLever 2022-07-28 12:47:13 +02:00
ephphatha cdcccef47a Return pointer from AddObject
This allows removing the immediate lookup for call sites which need further initialisation.
2022-07-28 12:47:13 +02:00
Andrew James 24c57bf6c6 Simplify MonsterOperateDoor (#5100) 2022-07-23 13:14:47 +02:00
ephphatha 4a8f375011 Use position for operate object network commands
Only one remaining use of Object::getId for caching the target of a command requiring the player to path to an object.
2022-07-22 17:46:53 +02:00
ephphatha 50d292f8c6 Take references in operate door functions 2022-07-22 16:24:06 +02:00
Andrew James 9a09b07c4d Cleanup Object/Quest triggers which activate quests (#5081) 2022-07-22 14:16:38 +00:00
Andrew James 2786a65e7b Tidy up ActivateSkeleton and take monster by reference (#5080)
* Take reference in OperateSarcophagus
* Use monster reference instead of pointer in ActivateSkeleton
* Clean up ActivateSkeleton
2022-07-21 18:58:27 +02:00
Andrew James a075e5fe05 Take Object by reference in OperateContainer methods (#5079) 2022-07-20 14:24:07 +02:00
ephphatha de83d9440e Use position for break object network messages 2022-07-19 16:22:52 +02:00
Andrew James 986650afc8 Take Object by reference when operating quest objects (#5066) 2022-07-19 15:59:59 +02:00
ephphatha 9e76cd4ab7 Use object pointer for pcursobj 2022-07-19 13:20:24 +02:00
Gleb Mazovetskiy 8ca71272b8 Load all CEL as CL2
Convert CEL files to CL2 at load time. CL2 format is more efficient and is about as fast to render.

CEL vs CL2 sizes, on dLvl 5: https://gist.github.com/glebm/9bbdd76962abcd4fd2405ecd3379af97

Memory:

* Peak memory (while loading): -300 KiB
* Memory in-game (dLvl5): -700 KiB
* RG99 binary size: -15 KiB (1333096 -> 1317192)

Performance on rg99:

* On average, -1 FPS in town.
* Same FPS in dungeon (20 FPS on dLvl 1).
2022-07-19 10:59:35 +02:00
Anders Jenbo 56915974d6 Minimize passing of player indexes 2022-07-18 11:15:50 +02:00
Cesar Canassa aa6ea3907e ♻️ Adds Missile::SourcePlayer and Missile::SourceMonster (#4999) 2022-07-17 18:50:29 +02:00
Anders Jenbo d1189388f5 Use user by reference 2022-07-17 18:41:05 +02:00
Gleb Mazovetskiy 70364013b0 Fix fmt v9 deprecation warnings
Version 9 of libfmt deprecates printing `enum` without casting it to an
integral type explicitly (consistent with `enum class`).
2022-07-16 12:55:18 +01:00
Gleb Mazovetskiy f460405818 Fix warnings
Note that in test/utf8_test.cpp, the first comparison was redundant.
For a signed char, this iterates from -128 to -1, unsigned from 0 to 128.
2022-07-14 00:19:21 +01:00
Anders Jenbo ac2bf9aaac Limit what gets called in headless mode 2022-07-13 18:54:36 +02:00
ephphatha 073b62549c Cleanup AddTrap 2022-07-13 11:44:07 +02:00
ephphatha 16b8530375 Object reference in AddObjectLight 2022-07-13 11:44:07 +02:00
ephphatha 90c8f41e52 Object reference in AddChest 2022-07-13 11:44:07 +02:00
ephphatha 1337ff6ea2 Add check if a monster potentially has leashed minions 2022-07-13 07:13:34 +02:00
Gleb Mazovetskiy ae6a3dbe5e Add missing <ctime> includes for std::tm 2022-07-12 01:31:17 +01:00
Anders Jenbo 38113c0ad8 Convert monster_goal in to a scoped enum 2022-07-11 01:46:24 +02:00
Anders Jenbo 6a8fd04067 Use player by references (#4938) 2022-07-10 11:40:04 +02:00
Gleb Mazovetskiy 197e1180b2 Add StrCat and StrAppend
Adds simple string / integer concatenation functions.

Many of the uses of `fmt::format` are simply concatenation
of a few strings and integers.

`StrCat` is an easier-to-read alternative to such uses of `fmt`.
2022-07-10 06:14:58 +02:00
ephphatha 420a248e0c Use FlipCoin for most uses of GenerateRnd with variable frequency 2022-07-10 02:37:33 +02:00
ephphatha bc0a058350 Invert FlipCoin 2022-07-10 02:37:33 +02:00
Anders Jenbo ce4595b440 Split Crypt from Cathedral 2022-07-09 11:07:47 +02:00
Cesar Canassa bb3fb36ddc ✨ Introduces FlipCoin() (#4908) 2022-07-07 20:57:03 +02:00
Cesar Canassa e538acb248 📝 Fixes Doxygen warnings (#4904) 2022-07-07 12:51:24 +02:00
Gleb Mazovetskiy d07ac14440 Handle nullptr localtime
`localtime` can return `nullptr` on some platforms (e.g. NXDK)

Improve portability by handling the `nullptr` result.
2022-07-06 13:25:51 +01:00
Mikołaj Piróg 15989609a8 Members' name changes and comments in Monster struct (#4861) 2022-07-06 10:21:22 +02:00
Cesar Canassa de971c6a8b ♻️ Refactor AddMonster to return a monster pointer (#4894) 2022-07-06 02:36:02 +02:00
Mikołaj Piróg dda0b96ea5 Remove #defines in player.h and add constexpr where applicable (#4896)
* Change defines to constexpr int in player.h

* Add const or constexpr to player.h/cpp where applicable

* Update tests with changed names of player constatns

* remove unecessary variable
2022-07-05 17:25:23 +02:00
Gleb Mazovetskiy 495448c460 Fix extra bracket in (disabled) translation 2022-07-03 14:13:53 +02:00
Anders Jenbo b00ae287b8 Minimize propegation of global Players index 2022-07-03 06:10:42 +02:00
Gleb Mazovetskiy 3178dd5158 Replace most uses of sprintf with fmt (#4837) 2022-07-01 17:02:56 +02:00
Anders Jenbo b68fd1ff5e Use player by reference in OperateShrine 2022-06-28 13:18:37 +02:00
Anders Jenbo 488a052ce6 Clean up OperateShrine 2022-06-28 13:18:37 +02:00
Anders Jenbo ba4ee58c9f Pass along bools instead of player index 2022-06-28 09:55:10 +02:00
Anders Jenbo d82f2ebc9e Pass players by reference instead of an index 2022-06-28 00:30:00 +02:00
Anders Jenbo e47599c45f Clean up BreakBarrel 2022-06-27 20:21:10 +02:00
Anders Jenbo 0d27761ac2 Make _oAnimFlag a boolean 2022-06-27 20:21:10 +02:00
Anders Jenbo 4c62905381 Deduplicate OperateLever 2022-06-27 10:17:22 +02:00
Anders Jenbo 21fd0fb686 Split delta sync from realtime sync 2022-06-27 10:17:22 +02:00
Anders Jenbo 9d167e22c1 Clean up Operate Door 2022-06-26 22:19:29 +02:00
Anders Jenbo 6d56058708 Move level generation to subfolder 2022-06-23 09:21:58 +02:00
ephphatha 3354c57ca8 Rename SkipThemeRoom/invert logic to match use 2022-06-22 16:35:39 +02:00
Anders Jenbo 4cc3a5264c Make dPiece zero-indexed 2022-06-19 09:57:30 +02:00