Commit graph

168 commits

Author SHA1 Message Date
ephphatha
8a0f81ec12 Pass regionId to TFit_Obj3 to extract reference to themes global 2022-01-19 03:05:27 +01:00
ephphatha
3e991fc9a8 Use Point/range iterator in CheckThemeObj3
This does introduce a slight behaviour difference for some callers. It was possible to read out of bounds due to the bounds check only guarding against negative indexes (e.g. Theme_Library uses 1, MAXDUN - 1 as the bounds, but Theme_ArmorStand includes boundary tiles so could read off the right/bottom edge). Given the way vanilla levels are generated with a border this has no impact in practice.
2022-01-19 03:05:27 +01:00
ephphatha
a0019d289d Use Point based object lookups in themes.cpp
Move bookstand lookup inside coinflip if statement, minimises the scope of that pointer.

Co-authored-by: Anders Jenbo <anders@jenbo.dk>
2021-12-28 16:01:37 +01:00
Andrew James
796e2813cf
Use scoped enums for DungeonFlags/BFLAG (#3135) 2021-11-07 03:11:16 +01:00
Anders Jenbo
294b583dbe Clean up Theme_Treasure 2021-10-18 05:12:33 +02:00
qndel
5656714ea9 fix 0 gold piles 2021-10-18 05:12:33 +02:00
Juliano Leal Goncalves
379a27b64a ♻️ Convert 'ItemType' enum to enum class
🎨 Rename 'ItemType' elements to enum class standards
2021-09-13 00:25:49 +02:00
ephphatha
b12de6fe12 Use scoped enum for Direction
Identified and removed an instance of Direction being used as an argument for a bool parameter

Removed a single-use temporary variable being cast from sprite frame to direction to size_t

Co-authored-by: Anders Jenbo <anders@jenbo.dk>

Fix alignment of WalkSettings array
2021-09-12 02:27:47 +02:00
Siddharth singh chouhan
6a8812c468
Move documentation from themes.cpp to themes.h 2021-09-01 18:28:56 +02:00
BC Ko
40c804c0ba Replace QuestStatus() with IsAvailable() in QuestStruct 2021-08-19 02:12:20 +02:00
Anders Jenbo
9264ad4b89 Use IsTileNotSolid() in place of !nSolidTable[dPiece[][]] 2021-07-17 03:57:26 +02:00
ephphatha
19ae61811f Refactor AddObject to take Point instead of int x/y 2021-07-09 17:58:34 +02:00
Anders Jenbo
903d4bd2e1 Scope all for loops
This caused 7 of the loops to be rewriteen using range by clang-tidy
2021-07-08 08:14:03 -07:00
Anders Jenbo
467b74dc06 Rename object globals 2021-07-08 02:01:14 -07:00
Anders Jenbo
c8870dbd1f Rename item globals 2021-07-08 02:01:14 -07:00
Anders Jenbo
07ad083fda Rename monster globals 2021-07-08 02:01:14 -07:00
Anders Jenbo
bc59218d0d More clang-tidy/Android Studio cleanups 2021-07-04 19:34:37 +02:00
Anders Jenbo
0f2ad469ea ♻️Clean up variable initialization 2021-06-27 14:58:51 -07:00
ephphatha
357f6f1dc3 Move RNG functions to their own header/source files 2021-06-27 03:09:41 -07:00
Anders Jenbo
d8fa29c972 Clean up more implicit bool conversion 2021-06-26 10:07:02 -07:00
Juliano Leal Goncalves
4668a526eb ♻️ Leverage 'Point' struct on monster functions (#2056) 2021-05-28 20:46:11 +02:00
Juliano Leal Goncalves
d55cd99dd5 🚚 Rename 'direction' enum to 'Direction' 2021-05-24 04:46:08 +02:00
Anders Jenbo
9e2206a673 Format code 2021-05-21 14:12:31 +02:00
Vladimir Olteanu
0c7c71d579
Cleanup of items.cpp (#1967)
- Apply Point where applicable
- Deduplicate vendor logic
- Add comment about unhanded edge case in GetSuperItemLoc
- Initialize some variables at deceleration
2021-05-17 00:12:53 +02:00
Anders Jenbo
34744c068f ♻️Consitantly use %i and not %d 2021-05-15 14:17:52 +02:00
Anders Jenbo
2bd13451a1 ♻️Apply point positioning to all remaning entities 2021-04-25 01:25:48 +02:00
Anders Jenbo
a32ac83090 🎨 cleanup trivial trype comparisons 2021-04-23 02:48:25 +02:00
Anders Jenbo
593c6a6f17 🎨 Drop unused param and rename random_ to GenerateRnd 2021-04-22 00:08:19 +02:00
Jmgr
1d84156509 Simplify bitshift divisions/multiplications 2021-04-21 05:31:17 +02:00
Anders Jenbo
373f28736f 🎨 Acceptable parts of modernize-* 2021-04-19 22:42:19 +02:00
Anders Jenbo
c89bd9c001 🚨 Fix remaning warnings for clang and gcc 2021-04-19 02:44:39 +02:00
Anders Jenbo
946ff5b0fa ♻️Performe static casts when load save game data 2021-04-18 23:27:21 +02:00
Anders Jenbo
61d15e23db 🎨 Apply direction enum to monsters and relations
Missiles _mimfnum is being used for a lot more then just directions and
can also be a 16 degree direction so can't apply enum verbs and
restricitons to it in most cases. This in turns also affects SetMissDir
and some other functions that have to stay int.
2021-04-18 23:13:03 +02:00
Anders Jenbo
997c1dba55 🚚 Split up all.h in to proper header relations 2021-04-16 01:04:54 +02:00
Anders Jenbo
61244c4d93 ♻️ Rearange and apply more enums 2021-04-10 05:24:01 +02:00
Anders Jenbo
20186e0370 🎨 Replace TRUE/FALSE with true/false
fix


Fix


fix
2021-04-09 15:13:02 +02:00
Anders Jenbo
93d42b62b8 ♻️ Change BOOL to bool 2021-04-09 15:13:02 +02:00
Anders Jenbo
bfb3c11c2b 🎨 Change namespace to devilution 2021-04-06 15:21:25 +02:00
Anders Jenbo
630e507f63 🚚 Apply namespace 2021-04-06 15:21:25 +02:00
Anders Jenbo
6f1498d315 🚚 Move structures to there respective headers 2021-04-06 12:41:00 +02:00
Juliano Leal Goncalves
9021f8daa5 ♻️ Pluralize global 'item' array variable 2021-04-06 11:45:28 +02:00
qndel
c0f5749728 Fix RNG diverging during level generation depending on the code path
The consequences has mostly mitigated after wards, but this will make things make more sens when analysing the state of the code.
2021-02-01 06:44:16 +01:00
Anders Jenbo
d20eddf48e Unifcy a chunk of Hellfire's code pathts 2020-12-28 01:11:25 +01:00
Anders Jenbo
61b2d0de95 Merge branch 'master' of github.com:diasurgical/devilution 2020-12-16 02:24:39 +01:00
qndel
7f7ae623df
Goe (#2163)
* proper random_ comparisons
* proper mienemy comparisons
* add mienemy/micaster enum
* GOE enum
2020-12-04 19:16:58 +01:00
Anders Jenbo
4ae75753c8 Merge branch 'master' of github.com:diasurgical/devilution 2020-11-09 01:24:02 +01:00
qndel
c94c04d049
some cleanup (#2146) 2020-11-04 03:33:40 +01:00
Anders Jenbo
cec9579186 Merge branch 'master' of github.com:diasurgical/devilution 2020-10-12 10:48:34 +02:00
Anders Jenbo
2d6c1efeab Merge branch 'master' of github.com:diasurgical/devilution 2020-10-12 10:46:28 +02:00
qndel
7c2ee3333f Theme_MonstPit cleanup 2020-10-12 03:22:03 +02:00