Commit graph

80 commits

Author SHA1 Message Date
ephphatha
32d397eb2a Add max_size checks when adding missiles to allow for limited size containers
This doesn't handle failed allocations (e.g. if the platform runs out of memory) but makes it easier to use a fixed size container on limited memory devices.
2022-01-23 05:02:57 +01:00
obligaron
234a053863 Change Missiles Array to std::list 2022-01-20 23:12:48 +01:00
staphen
5b21e0188f Fix order of operations during game initialization 2022-01-15 06:47:09 +01:00
Andrew James
796e2813cf
Use scoped enums for DungeonFlags/BFLAG (#3135) 2021-11-07 03:11:16 +01:00
Anders Jenbo
31ba8e2bc6 Validate additional network messages 2021-10-06 21:47:03 +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
ephphatha
851fb87e24 Remove mi argument from DeleteMissile
This value is always the current value of ActiveMissiles[i], while the caller has retrieved the index for its own use it's easier to track what the function does by just passing i.
2021-09-07 01:09:51 +02:00
Juliano Leal Goncalves
4ea9cd539e 🚚 Rename 'PortalStruct' struct to 'Portal' 2021-09-06 17:47:34 +02:00
Juliano Leal Goncalves
d82b3b542f
🚚 Rename 'MissileDataStruct' struct to 'MissileData' (#2803)
* 🚚 Rename 'MissileDataStruct' struct to 'MissileData'
* 🚚 Rename 'MissileData' global array to 'MissilesData'
2021-09-06 12:59:43 +02:00
Juliano Leal Goncalves
940a120bf9 ♻️ Replace 'ViewX' and 'ViewY' globals with single 'ViewPosition' 2021-09-04 18:06:28 -04:00
Anders Jenbo
d7c6d8b189 Use proper Direction type for AddMissile midir 2021-08-25 20:24:45 +02:00
Anders Jenbo
7f6e171b4b Use BFLAG_MISSILE instead of dMissile 2021-08-22 21:21:33 +02:00
BC Ko
14b7e3bdc1
2435 refactor missiles part 2 (#2635) 2021-08-19 08:15:41 +02:00
Anders Jenbo
069249f318 🚚 Move local function to anonymous namespace i-p 2021-07-19 05:44:20 +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
9ae908f947 Rename missile globals 2021-07-08 02:01:14 -07:00
Anders Jenbo
96bf75b502 Rename player globals 2021-07-08 02:01:14 -07:00
Vladimir Olteanu
95643029e3 Refactor missiles.cpp
Use Point wherever possible
Make some functions static (not exhaustive)
Reduce excessive indentation (not exhaustive)
Declare variables as needed (not exhaustive)
2021-06-21 12:10:37 -07:00
Anders Jenbo
8a7ec56d3a Player by reference part 2
This mostly change player to be by reference instead of by index.
But additionally it does stript checks for gold in the belt, move some
value types to the initialization and short circute a few functiongs.
2021-05-24 21:00:32 +02:00
Juliano Leal Goncalves
b3ec79af4f
Leverage 'Point' in Lighting and Player functions (#2048) 2021-05-24 17:28:52 +02:00
Anders Jenbo
2bd13451a1 ♻️Apply point positioning to all remaning entities 2021-04-25 01:25:48 +02:00
Anders Jenbo
98cd435fba ♻️ Apply point types to missiles 2021-04-24 21:41:04 +02:00
Anders Jenbo
1e3ed903be 🎨 strip redundant else 2021-04-22 00:39:48 +02:00
Anders Jenbo
997c1dba55 🚚 Split up all.h in to proper header relations 2021-04-16 01:04:54 +02:00
Anders Jenbo
e7ae8ddd04 🚚 Move all enums to there respective headers 2021-04-10 16:30:00 +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
af96de4038 ♻️ Move a large part of enums to there respective headers 2021-04-08 19:20:55 +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
a69a76941e ♻️ Clean up InitCutscene 2021-03-24 21:50:19 +01:00
qndel
03fcc8914f fix portals 2021-02-18 18:47:29 +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
2d6c1efeab Merge branch 'master' of github.com:diasurgical/devilution 2020-10-12 10:46:28 +02:00
qndel
b81d2eb831
some cleanups (#2099) 2020-10-12 00:42:02 +02:00
Anders Jenbo
893efd51ea Merge branch 'master' of github.com:diasurgical/devilution 2020-09-27 03:34:42 +02:00
Anders Jenbo
1ba96a6777 Add doxygen description to remaining engine files 2020-07-06 05:43:25 +02:00
Anders Jenbo
3227fea5c0 Merge branch 'master' of github.com:diasurgical/devilution 2020-04-26 21:44:34 +02:00
Anders Jenbo
7e45f8bcc8 More cleanups 2020-04-26 21:33:56 +02:00
Anders Jenbo
776ab10476 Merge branch 'master' of github.com:diasurgical/devilution 2020-03-29 23:40:05 +02:00
Anders Jenbo
3c276a3cd3 Add documentation
- Add file documentation to about 1/4 of the files in Source
- Copy over a lot of the documentation from the sanctuary/notes repo
- Standardise all the existing documentation
- Create a configuration for Doxygen
- Add more documentation (engine.cpp is now fully documented)
2020-03-01 22:18:00 +01:00
Anders Jenbo
25993b4043 Merge branch 'master' of github.com:diasurgical/devilution 2020-02-14 23:03:31 +01:00
Anders Jenbo
20621a0642
add all.h and use in place of diablo.h (#2005)
Now diablo.h is treated in the same way as all other header files of
Source, as it only contains the declarations of global variables and
functions of diablo.cpp.

Besides consistency, this also enables mods to include diablo.h just
like any other header file without having to include every header file
(and without having to include C++ specific aspects of the now all.h).
2020-02-14 13:12:54 +01:00
Anders Jenbo
14f8c9368a Merge branch 'master' of github.com:diasurgical/devilution 2019-09-13 17:51:58 +02:00
jimmy-cell
80fb61019f SetPortalStats bin exact vanilla 2019-09-05 20:12:27 +03:00
Anders Jenbo
60ee365dff Merge branch 'master' of github.com:diasurgical/devilution 2019-07-20 19:52:50 +02:00
Robin Eklind
105a583ce0 Use TRUE and FALSE enums for setlevel.
Also simplify if conditions to make
use of boolean values.

(If the cleanup4 PR ends up increasing
inserts/deletions, then this commit is
probably at fault.)
2019-07-17 20:42:26 +02:00
Anders Jenbo
4ff5197291 merge devilution 2019-06-28 21:53:52 +02:00
Joan Karadimov
fce804a09a Use the dungeon_type enum for leveltype 2019-06-28 11:58:44 +03:00