Gleb Mazovetskiy
8c1a847f41
Remove utils/stdcompat/string_view.hpp
3 years ago
Gleb Mazovetskiy
74755c8be7
Remove utils/stdcompat/cstddef.hpp
3 years ago
Gleb Mazovetskiy
e67ea9b006
Make `MissilesData` const
...
Instead of temporarily modifying `MissileData` around certain calls,
pass the arguments from the outside.
3 years ago
Gleb Mazovetskiy
98294e0ad5
Optimize `MissileData`: 32 bytes -> 24
...
23 bytes used, 1 spare byte in the padding.
3 years ago
Gleb Mazovetskiy
64730bd0bd
Optimize `MissileFileData` size: 80 bytes -> 32
3 years ago
Gleb Mazovetskiy
25e9b7320d
Remove unused self-ID from `Missile(File)Data`
3 years ago
Gleb Mazovetskiy
0a6a8e8aa0
Clean up missile data access
...
Replace enum static casts with `GetMissile(Sprite)Data`.
3 years ago
KPhoenix
7947b99511
Implement new enum class
3 years ago
KPhoenix
8db521727d
`enum missile_id` -> `enum class MissileID`
...
Changes `enum missile_id` to `enum class MissileID`
3 years ago
Anders Jenbo
0c5fd01067
Change missile_resistance into class DamageType
3 years ago
staphen
702fedbc54
Remove ConsumeSpell() from AddMissile() functions
3 years ago
obligaron
68891a8df1
Rename MissileMovementDistrubution => MissileMovementDistribution
4 years ago
Gleb Mazovetskiy
4cf0053ece
Set underlying type for all the enums
...
Reduces rg99 binary size by 3 KiB.
4 years ago
Gleb Mazovetskiy
961866e1c4
CLX: A new graphics format
...
The format is almost identical to CL2, except it uses the frame header
to store frame width and height instead of 5 32-line offsets.
This means we always have access to frame dimensions, so we can use it
as an on-disk format for our graphics as well.
Additionally, we may be able to optimize the rendering even more
in the future now that we have guaranteed knowledge of frame dimensions.
4 years ago
Gleb Mazovetskiy
f4bce38875
Use `uint16_t` for sprite widths
4 years ago
Gleb Mazovetskiy
11aaf2a441
Fix `MissileFileData#GetFrame` for a null missile
...
Fixes the following warning:
/usr/include/c++/11/bits/unique_ptr.h:660:14: runtime error: reference binding to null pointer of type 'byte'
4 years ago
Gleb Mazovetskiy
a5e1fa5bbe
Load missile frames into a single buffer
...
Previously, the memory for each frame was allocated separately.
Changes it to allocate a single buffer for all the frames.
This has the following advantages:
1. Less bookkeeping overhead in the allocator.
2. Less alignment overhead (allocator results are max-aligned by default).
We can follow this up with a similar treatment for other multi-file
animations.
4 years ago
obligaron
1aabcf295b
Add AddMissileParameter
4 years ago
Gleb Mazovetskiy
7e1fea6f76
clang-format all files in {Source,test}/
...
Also includes a few manual tweaks to comments and newlines for better results.
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago
ephphatha
6fa3018f05
Move Init/FreeMissileGFX functions alongside MissileSpriteData array definition
...
Also combined the two free missile graphics functions as they were always called together (just slightly out of order previously).
5 years ago
Juliano Leal Goncalves
d82b3b542f
🚚 Rename 'MissileDataStruct' struct to 'MissileData' ( #2803 )
...
* 🚚 Rename 'MissileDataStruct' struct to 'MissileData'
* 🚚 Rename 'MissileData' global array to 'MissilesData'
5 years ago
Juliano Leal Goncalves
6e1d05187e
🚚 Rename 'MissileStruct' to 'Missile'
5 years ago
BC Ko
ee96690410
change function parameter
...
pass missile to mProc()
5 years ago
Anders Jenbo
d7c6d8b189
Use proper Direction type for AddMissile midir
5 years ago
Anders Jenbo
bea8cc9d87
Reduce paremters used in add missile functions
5 years ago
BC Ko
ac0a690768
remove Missiles[]
5 years ago
Anders Jenbo
fa7f3442e4
Fix loading monster missiles
5 years ago
Anders Jenbo
f289fbcec5
Remove dead missile code
5 years ago
Vladimir Olteanu
a437cb1af9
Fix MissileFileData arrays not getting properly filled
5 years ago
Anders Jenbo
ffc9b0e6a8
Apply clang-format
5 years ago
Vladimir Olteanu
b76e8c060b
Introduce MissileDataFlags
5 years ago
Vladimir Olteanu
4253ea7a39
Rename MisFileData to MissileFileData
5 years ago
Vladimir Olteanu
040ca7b1e9
Remove logic related to unused MFLAG_ALLOW_SPECIAL
5 years ago
Vladimir Olteanu
b5d6758295
Introduce AutofillArray
5 years ago
Vladimir Olteanu
3364a4e00c
Refactor MisFileData
...
MisFileData: make pinnedMem private
5 years ago
Anders Jenbo
9ae908f947
Rename missile globals
5 years ago
obligaron
be53349c2d
Decouple missile movement from game logic ( #2322 )
5 years ago
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)
5 years ago
Kalebe Alves
0461529176
Move byte from engine.h
5 years ago
Anders Jenbo
f579b2f287
Handle cel/cl2 files as byte arrays
5 years ago
Jmgr
c33182d6de
Modernize deprecated headers
5 years ago
Anders Jenbo
7912e510f0
🎨 Clean up overuse of SDL types
5 years ago
Anders Jenbo
5fdb9ce459
🎨 Format code
5 years ago
Anders Jenbo
997c1dba55
🚚 Split up all.h in to proper header relations
5 years ago
Anders Jenbo
779e6cf950
♻️ Apply more enums
5 years ago
Anders Jenbo
af96de4038
♻️ Move a large part of enums to there respective headers
5 years ago
Anders Jenbo
433edc63ea
♻️ Consistently use pragma once to guard the headers
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Anders Jenbo
630e507f63
🚚 Apply namespace
5 years ago
Anders Jenbo
61729c1eb6
Clean up missile types
5 years ago