qndel
373f1db22e
If cleanup + bugfixes ( #2273 )
5 years ago
ephphatha
357f6f1dc3
Move RNG functions to their own header/source files
5 years ago
Andrew James
20190ee687
Update random number functions to avoid IB ( #2226 )
...
* Update random number functions to avoid IB
Most calls to set seed were using uint32_t already, there were a few variables which were better served by having their type changed from signed to unsigned. The one exception is ItemStruct::_iSeed. This is an identifier that also happens to be used as a seed occasionally so a comment was added documenting this exception.
Includes suggested style changes for Source/towners.h; Source/towners.cpp; Source/msg.h; Source/multi.h
5 years ago
Anders Jenbo
af254601d6
♻️ Apply clang-tidy to engine
5 years ago
Gleb Mazovetskiy
14218080b6
🚚 engine.h: Extract `CelGetFrame` and friends
5 years ago
Gleb Mazovetskiy
4ea7ba0f5f
🚚 engine.h: Extract `LoadLE32` and `LoadBE32`
5 years ago
Gleb Mazovetskiy
1bc9c3973f
🚚 engine.h: Extract `Rectangle`
5 years ago
Gleb Mazovetskiy
e40b1963f9
🚚 engine.h: Extract `CelSprite` and file loading
5 years ago
Gleb Mazovetskiy
aa54675d83
🚚 engine.h: Extract `Size`
5 years ago
Gleb Mazovetskiy
dcf3397139
🚚 engine.h: Extract `ActorPosition`
5 years ago
Gleb Mazovetskiy
f9f301b054
🚚 engine.h: Extract `Point`, `Direction`, `clamp`
...
`engine.h` is getting quite bloated. Moves this code to their own files.
5 years ago
Juliano Leal Goncalves
25eaac78c1
♻️ Leverage 'Size' to represent a 'Rectangle's width/height
5 years ago
Juliano Leal Goncalves
e3ea6a9042
♻️ Leverage 'Point' to represent a 'Rectangle's position
5 years ago
Juliano Leal Goncalves
ff147f9280
🚚 Rename 'RECT32' to 'Rectangle' to match naming style of other core structs
5 years ago
Juliano Leal Goncalves
4490340a47
🚚 Move 'RECT32' type to 'engine.h' alongside other core types
5 years ago
ephphatha
8d5b5e833b
Add tests for LCG random engine
...
This documents the chosen LCG parameters and the default mapping function used in random number generation.
GetLCGEngineState() is a helper needed for testing because AdvanceRndSeed combines a distribution with a call to progress the engine. I'll split those eventually but this at least shows the current behaviour and should flag any bugs introduced by future changes.
5 years ago
Gleb Mazovetskiy
982260d94e
Clip control.cpp draw calls
...
No longer crashes there when running at a resolution smaller than
640x480
5 years ago
Juliano Leal Goncalves
1328c9ea93
🎨 Make 'Size' fields camelCase
5 years ago
qndel
4ba2c755c3
attempt to fix CI ( #2113 )
...
fix CI build
5 years ago
Vladimir Olteanu
02ffada9b8
constexpr version of abs
5 years ago
Vladimir Olteanu
fce8f7a503
Make Point stuff constexpr
5 years ago
Vladimir Olteanu
e37e7e408c
Introduce Point::WalkingDistance
5 years ago
Vladimir Olteanu
690211a699
replace Point::Absolute with abs
5 years ago
Vladimir Olteanu
ba3f0aef8b
Introduce Point::Absolute and Point::ManhattanDistance
5 years ago
Juliano Leal Goncalves
8622130966
♻️ Add '==' and '!=' operators to 'Size' struct
5 years ago
Juliano Leal Goncalves
58501cab26
🚚 Move 'Size' struct to engine.h
5 years ago
Kalebe Alves
0461529176
Move byte from engine.h
5 years ago
Juliano Leal Goncalves
94164812f4
🏷️ Add integer overload for Point multiplication operator
5 years ago
Anders Jenbo
43f26084d0
Fix warnigns
5 years ago
Juliano Leal Goncalves
21fdb0dcd9
♻️ Replace manual direction displacement logic with 'Point' add operator
5 years ago
Juliano Leal Goncalves
d55cd99dd5
🚚 Rename 'direction' enum to 'Direction'
5 years ago
Gleb Mazovetskiy
2f3fa76320
Fix gkd350h build
...
Works around a GCC bug on some platforms:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97044
5 years ago
obligaron
be13a0f727
Point: Add operator* float and operator-
5 years ago
Gleb Mazovetskiy
1181cc68ac
🎉 Remove buffer padding
...
The padding is no longer needed
5 years ago
Vladimir Olteanu
4ff0221a8d
Fix https://github.com/diasurgical/devilutionX/issues/1928
5 years ago
Gleb Mazovetskiy
710ddb9af6
♻️ Make SetPixel a method
5 years ago
Gleb Mazovetskiy
9a9941efdd
🚚 Move CL2 rendering to engine/render/cl2_render.cpp
5 years ago
Gleb Mazovetskiy
febaf0dc8b
🐞 Fix misaligned load in `GetCelFrame`
5 years ago
Gleb Mazovetskiy
0edfa3de66
🚚 Move CEL rendering to engine/render/cel_render.cpp
5 years ago
Gleb Mazovetskiy
473d1b0b14
🎉 Clip CEL drawing functions
...
Implements clipping for all CEL drawing functions except stippled and outline.
5 years ago
Gleb Mazovetskiy
59dd42692f
🚚 Move render.cpp to engine/render/dun_render.cpp
5 years ago
Anders Jenbo
f579b2f287
Handle cel/cl2 files as byte arrays
5 years ago
Gleb Mazovetskiy
e7a9293153
♻️ engine.h: Minor refactoring
...
1. Move `SetPixel` definition to the header to make it easier for the
compiler to inline (make it inlinable even without LTO).
2. Add an `operator[](Point)` overload to `CelOutputBuffer`.
5 years ago
Gleb Mazovetskiy
afef72f916
🎉 New map renderer
...
Uses integer math only: This speeds up the rendering and eliminates some
zoom artifacts.
Improves player indicator look -- it's now symmetric and more legible.
5 years ago
Anders Jenbo
3746723f52
♻️ Add type to MIN-files and TRN-files
5 years ago
Anders Jenbo
fa0b286693
♻️ Typed file loading
...
Tthis gives us the option to specify what type a file should be loaded
as, avoidng the need to case it and does some automatic checks on the
fitness of the data, while making the process simpler.
If no type is given then the type will be set to std::byte which limit
what operations can be performed on the data.
5 years ago
thebigMuh
24f32a1d53
Fix sound volume/panning attenuation ( #1789 )
...
* Fixing volume adjustment and scaling
5 years ago
Anders Jenbo
654a2b8834
♻️ Clean up automap code
...
Use Point for x,y pairs. Make helpers for drawing door and squares
5 years ago
Gleb Mazovetskiy
0bfc147b78
🧹 Remove `DiabloAllocPtr` and friends ( #1824 )
5 years ago
Gleb Mazovetskiy
63e0e60956
Add `MeasureSolidHorizontalBounds`
...
Adds a function to measure the X-coordinates of the solid
(non-transparent) bounding box of a CEL.
5 years ago