Commit graph

217 commits

Author SHA1 Message Date
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.
2021-04-28 11:53:39 +01:00
thebigMuh
ad8f342db0 Adding constness 2021-04-26 23:30:02 +02:00
obligaron
239a43cc1c
Remove "AnimWidth2" expect for missiles (#1680) 2021-04-25 13:32:33 +02:00
Anders Jenbo
f77c52941a ♻️Make GetDirection take Points instead of ints 2021-04-25 02:25:52 +02:00
Anders Jenbo
bd389e9ef6 ♻️ Clean up bool logic in engine.cpp 2021-04-23 02:47:10 +02:00
Anders Jenbo
1e3ed903be 🎨 strip redundant else 2021-04-22 00:39:48 +02:00
Anders Jenbo
593c6a6f17 🎨 Drop unused param and rename random_ to GenerateRnd 2021-04-22 00:08:19 +02:00
Anders Jenbo
d024f79b0e 🧹 performance-unnecessary-value-param 2021-04-22 00:08:19 +02:00
Jmgr
1d84156509 Simplify bitshift divisions/multiplications 2021-04-21 05:31:17 +02:00
Anders Jenbo
bb4e1960e7 🎨 modernize-use-nullptr 2021-04-19 16:02:05 +02:00
Anders Jenbo
c89bd9c001 🚨 Fix remaning warnings for clang and gcc 2021-04-19 02:44:39 +02:00
Anders Jenbo
997c1dba55 🚚 Split up all.h in to proper header relations 2021-04-16 01:04:54 +02:00
Anders Jenbo
6e1a106a38 🚚 Move header we implement into the project 2021-04-16 01:04:54 +02:00
Gleb Mazovetskiy
26a9930a70 Stop relying on buffer padding in CelBlitSafeTo 2021-04-10 19:09:28 +01: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
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.
2021-04-06 11:38:47 +02:00
FluffyQuack
c0f57f3020
🐮 Draw outline for color in index 0 for inventory icons. (#1318) 2021-04-03 03:39:44 +02:00
Juliano Leal Goncalves
800dbce066 ♻️ Move options-related structs to new 'options.h' file 2021-03-27 03:26:44 +01:00
Anders Jenbo
fbd86cd3c5 🎨 Mark noreturn functions as such 2021-03-26 02:24:32 +01:00
Anders Jenbo
17803d5923 ♻️ Apply proper types to PlayerStruct 2021-03-14 15:38:23 +01:00
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.
2021-03-13 05:13:26 +01:00
Xadhoom
cb65d308cf RNG: do not rely on implicit conversions in arithmetic expressions 2021-03-13 01:35:09 +01:00
Juliano Leal Goncalves
103cde53ff ♻️ Make options struct hierarchical 2021-03-10 10:11:42 +01:00
Gleb Mazovetskiy
ba6a78ebc8 Migrate Cl2DrawOutline to accept a buffer 2021-03-06 09:55:14 +01:00
Gleb Mazovetskiy
819b5b05df Migrate Cl2DrawLightTbl to accept a buffer 2021-03-06 09:55:14 +01:00
Gleb Mazovetskiy
07f4dbbd2e Migrate Cl2Light to accept a buffer 2021-03-06 09:55:14 +01:00
Gleb Mazovetskiy
bb3ba369df Migrate Cl2Draw to accept a buffer 2021-03-06 09:55:14 +01:00
Gleb Mazovetskiy
d55a1c8a7d
Pass CelOutputBuffer to game text printing (#1095)
* Pass CelOutputBuffer to game text printing
* DrawHalfTransparentRectTo: minor cleanup
2021-03-03 18:20:24 +01:00
Gleb Mazovetskiy
83ce7c27af Enginify trans_rect
Moves `trans_rect` to `engine` as `DrawHalfTransparentRectTo` and makes
it operate on `CelOutputBuf`.
2021-03-03 12:07:07 +01:00
Gleb Mazovetskiy
188d3d5ec0 automap: Migrate away from gpBuffer/gpBufEnd 2021-03-01 13:30:57 +01:00
Anders Jenbo
39999791b3 Revamp ini options and sync in multiplayer
[NetMsg]
F12=Now you DIE!
F11=Here's something for you.
F10=Follow me.
F9=I need help! Come Here!

[Game]
Speed=50
Fast Walk=1
Grab Input=0
Theo Quest=0
Cow Quest=0

[Audio]
Sound Volume=0
Music Volume=0
Walking Sound=1

[Graphics]
Fullscreen=1
Fit to Screen=1
Scaling Quality=2
Integer Scaling=0
Vertical Sync=1
Blended Transparency=1
Gamma Correction=100
Color Cycling=1

[Diablo]
Intro=0

[Hellfire]
Intro=0
SItem=

[Phone Book]
Entry1=127.0.0.1

[Network]
Bind Address=0.0.0.0
2021-03-01 11:52:26 +01:00
Gleb Mazovetskiy
e5d7571ea7 Cleanup: Remove ENG_set_pixel function
Migrated to SetPixel
2021-03-01 02:20:21 +01:00
Gleb Mazovetskiy
0a6640397b Fix two-handed weapons in inventory
Fixes #1070
Follow-up to #964
2021-03-01 01:35:05 +01:00
Gleb Mazovetskiy
bd18080c32 Fix CelBlitLightBlendedSafeTo
Follow-up to #964
2021-02-28 22:44:51 +01:00
Gleb Mazovetskiy
8283f85e24 Engine: Functions to render to any buffer
Refactor the rendering functions to allow rendering to any output
buffer.

New functions that accept a buffer have the `To` suffix.

The functions that render to the global buffer now always accept
coordinates.
2021-02-27 17:49:39 +01:00
Anders Jenbo
36a196389b Fix remaning basic compiler errors and warnings 2021-02-22 13:51:42 +01:00
pionere
f5c1079d6f eliminate unused code 2021-02-19 22:04:11 +01:00
pionere
d5a0fa8e85 get rid of a few warnings 2021-02-19 22:04:11 +01:00
pionere
40eaf8a6f5 SeedCount is _DEBUG-only 2021-02-19 22:04:11 +01:00
FluffyQuack
790c8e17e5 Implemented blended tranparency 2021-02-19 05:57:48 +01: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
374e8177ef Remove wave.cpp 2021-01-23 21:24:25 +01:00
Anders Jenbo
61b2d0de95 Merge branch 'master' of github.com:diasurgical/devilution 2020-12-16 02:24:39 +01:00
Anders Jenbo
fd210b4b0b Clean up Cl2ApplyTrans 2020-12-05 21:31:34 +01:00
Anders Jenbo
43b5dea6e5 Merge branch 'master' of github.com:diasurgical/devilution 2020-11-03 00:56:51 +01:00
Anders Jenbo
2dc33b58ea Reorder engine.cpp 2020-11-02 16:22:11 +01:00
Anders Jenbo
72e2637061 Merge branch 'master' of github.com:diasurgical/devilution 2020-10-25 17:38:06 +01:00