Gleb Mazovetskiy
cb0dae8590
🚚 Rename `CelOutputBuf` to `Surface` and extract
5 years ago
Gleb Mazovetskiy
14218080b6
🚚 engine.h: Extract `CelGetFrame` and friends
5 years ago
Gleb Mazovetskiy
bb95e0c337
cl2_render: Use memset when rendering outline
...
A minor cleanup that replaces the for-loop rendering for a fill run
with memsets.
5 years ago
Gleb Mazovetskiy
8ac9047b4f
🧹 Clean up CEL outline clipping
...
A simpler structure based on the CL2 implementation.
5 years ago
Gleb Mazovetskiy
29a488738e
🔥 Mark core CL2 and CEL functions as inline hot
5 years ago
Gleb Mazovetskiy
e53a79259d
🐞 CL2 outline: Fix left clip
5 years ago
Gleb Mazovetskiy
537e056111
🐞 CL2 outline: Skip color index 0
...
Fixes a regression introduced in #1934
5 years ago
Gleb Mazovetskiy
64ad9aeacf
🎉 cl2_render.cpp: Clip the outline
5 years ago
Gleb Mazovetskiy
1838eb43f2
🎉 cl2_render.cpp: Clip the drawing functions
...
Clips all the drawing functions except the outline one.
Example FPS gain in a dungeon: 1454 -> 1488
5 years ago
Anders Jenbo
bcbaeba2f0
📝 Correct file header
5 years ago
Gleb Mazovetskiy
9a9941efdd
🚚 Move CL2 rendering to engine/render/cl2_render.cpp
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
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
92db72719d
🔥 Remove some unused code
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
Gleb Mazovetskiy
987ab2533b
🐞 Synchronize SFileReadFile access
...
StormLib read function is not thread-safe: https://github.com/ladislav-zezula/StormLib/issues/175
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
f33f7ae7eb
💨 Do not zero-initalize arrays we write to
...
`std::make_unique<T[]>(size)` always zero-initalizes the array.
C++20 has `std::make_unique_for_overwrite` to avoid that, while
older C++ versions can use the approach applied here.
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
Gleb Mazovetskiy
1b8b62a8c2
♻️ Store CEL width with the sprite itself
...
Instead of passing the CEL sprite width when drawing, store the CEL
width at load time in the new `CelSprite` struct.
Implemented for most sprites except towners, missiles, or monsters.
5 years ago
Gleb Mazovetskiy
144dd6cd93
♻️ engine.cpp: Minor cleanup in draw functions
...
1. Introduce a couple of constants.
2. Extract a helper function for getting the light table pointer.
5 years ago
thebigMuh
ad8f342db0
Adding constness
5 years ago
obligaron
239a43cc1c
Remove "AnimWidth2" expect for missiles ( #1680 )
5 years ago
Anders Jenbo
f77c52941a
♻️ Make GetDirection take Points instead of ints
5 years ago
Anders Jenbo
bd389e9ef6
♻️ Clean up bool logic in engine.cpp
5 years ago
Anders Jenbo
1e3ed903be
🎨 strip redundant else
5 years ago
Anders Jenbo
593c6a6f17
🎨 Drop unused param and rename random_ to GenerateRnd
5 years ago
Anders Jenbo
d024f79b0e
🧹 performance-unnecessary-value-param
5 years ago
Jmgr
1d84156509
Simplify bitshift divisions/multiplications
5 years ago
Anders Jenbo
bb4e1960e7
🎨 modernize-use-nullptr
5 years ago
Anders Jenbo
c89bd9c001
🚨 Fix remaning warnings for clang and gcc
5 years ago
Anders Jenbo
997c1dba55
🚚 Split up all.h in to proper header relations
5 years ago
Anders Jenbo
6e1a106a38
🚚 Move header we implement into the project
5 years ago
Gleb Mazovetskiy
26a9930a70
Stop relying on buffer padding in CelBlitSafeTo
5 years ago
Anders Jenbo
20186e0370
🎨 Replace TRUE/FALSE with true/false
...
fix
Fix
fix
5 years ago
Anders Jenbo
93d42b62b8
♻️ Change BOOL to bool
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Anders Jenbo
630e507f63
🚚 Apply namespace
5 years ago
Gleb Mazovetskiy
21a4a671e4
Cleanup DiabloAllocPtr
...
1. Removes a lock around allocation. `malloc` is required to be thread-safe in C11.
2. Defines it as a macro so that:
1. We provide the correct location for the OOM error.
2. We get better attribution from memory profilers.
5 years ago
FluffyQuack
c0f57f3020
🐮 Draw outline for color in index 0 for inventory icons. ( #1318 )
5 years ago
Juliano Leal Goncalves
800dbce066
♻️ Move options-related structs to new 'options.h' file
5 years ago
Anders Jenbo
fbd86cd3c5
🎨 Mark noreturn functions as such
5 years ago
Anders Jenbo
17803d5923
♻️ Apply proper types to PlayerStruct
5 years ago
Gleb Mazovetskiy
cd59a1c323
Completely replace gpBuffer with CelOutputBuffer
...
`CelOutputBuffer` now contains an `SDL_Surface` and an `SDL_Rect`.
We now have access to SDL surface manipulation functions.
`gpBuffer` and `gpBufEnd` are completely gone 🧹
This results in some FPS loss (250 -> 195) recovered in a subsequent
commit.
5 years ago
Xadhoom
cb65d308cf
RNG: do not rely on implicit conversions in arithmetic expressions
5 years ago
Juliano Leal Goncalves
103cde53ff
♻️ Make options struct hierarchical
5 years ago