Commit graph

206 commits

Author SHA1 Message Date
qndel
dadf418fe0
fix typo (#2266) 2021-06-29 19:15:01 +02:00
Juliano Leal Goncalves
cbb84199c2 ♻️ Replace Point addition with 'Point + Displacement' 2021-06-28 20:37:44 -07:00
ephphatha
357f6f1dc3 Move RNG functions to their own header/source files 2021-06-27 03:09:41 -07:00
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
2021-06-27 10:37:09 +02:00
obligaron
3a9cc631c7 Rename DelayLen -> TicksPerFrame
Rename DelayCounter -> TickCounterOfCurrentFrame
2021-06-27 01:26:49 -07:00
obligaron
3ba4bac5e2 Harmonize DelayLen for Player and Monster (was 1-based on monseter (>= DelayLen) and 0-based on player (> DelayLen). Now both are 1-based (>= DelayLen) 2021-06-27 01:26:49 -07:00
Anders Jenbo
8a4d38dd74 Stabalize clang-tidy runs 2021-06-27 03:42:51 +02:00
Anders Jenbo
871f168ea0 Clang-tidy: bugprone-reserved-identifier 2021-06-27 02:59:07 +02:00
Anders Jenbo
8f3266244a Clang-tidy: readability-else-after-return 2021-06-27 01:10:20 +02:00
Anders Jenbo
2bdb6caa07
Cleanup majority of remaning implicit bool conversions (#2234) 2021-06-26 21:05:45 +02:00
Anders Jenbo
22b632f04a ♻️Clean up implicit bool conversions 2021-06-26 08:57:59 -07:00
obligaron
3c9314fa0a Remove MonsterStruct.actionFrame and enable ADL for Walking 2021-06-26 06:10:33 -07:00
obligaron
b0ed920a25 Introduce AnimationInfo to MonsterStruct 2021-06-25 11:52:12 -07:00
Anders Jenbo
ee7b32d8f6 Player by reference part 3 2021-06-24 00:53:09 +02:00
Gleb Mazovetskiy
4ea7ba0f5f 🚚 engine.h: Extract LoadLE32 and LoadBE32 2021-06-21 02:34:28 -07:00
Gleb Mazovetskiy
f9f301b054 🚚 engine.h: Extract Point, Direction, clamp
`engine.h` is getting quite bloated. Moves this code to their own files.
2021-06-21 01:36:20 -07:00
obligaron
660f8d2f43 Ensure AnimationInfo is reset when a game is loaded 2021-06-14 02:08:06 +02:00
Juliano Leal Goncalves
d47fc924f3 ♻️ Use '_item_indexes' instead of 'int' for 'ItemStruct.IDidx' field 2021-06-14 02:07:06 +02:00
obligaron
ccc1ccf9c3 Introduce ItemStruct.AnimInfo 2021-06-08 10:12:09 +02:00
Anders Jenbo
27591cc29f Fix spawn save game compatability 2021-06-06 04:51:43 +02:00
qndel
ae221bb860 fix invalid width2 2021-05-31 03:31:06 +02: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
obligaron
d97131349e Unify player_graphic memory handling 2021-05-24 20:12:43 +02:00
obligaron
61ba5009ac Convert to CelSprite 2021-05-24 20:12:43 +02:00
obligaron
3067aeacb8 Remove PlayerStruct._pXYZWidth and replace it with calls to GetAnimationWidth 2021-05-24 20:12:43 +02:00
Juliano Leal Goncalves
b3ec79af4f
Leverage 'Point' in Lighting and Player functions (#2048) 2021-05-24 17:28:52 +02:00
Juliano Leal Goncalves
d55cd99dd5 🚚 Rename 'direction' enum to 'Direction' 2021-05-24 04:46:08 +02:00
Anders Jenbo
a095bc0bf7 ♻️Migrate more code away from miniwin 2021-05-13 02:30:18 +02:00
obligaron
7ed009ecb7
Remove PlayerStruct.actionFrame and enable ADL for Walking/Run (#1939)
- Remove (unused) actionFrame for PM_DEATH
- Remove actionFrame for PM_SPELL
- Remove actionFrame for PM_WALK
- Remove actionFrame
2021-05-13 01:24:26 +02:00
Anders Jenbo
8eb9c930fe
🚨 Fix remaning GCC warnings (#1929) 2021-05-11 09:34:45 +02:00
Anders Jenbo
4b577329f4 ♻️Refactor towner initialization 2021-05-07 00:30:23 +02:00
Anders Jenbo
6321bf04d5 ♻️Pass player to towner by reference instead of index 2021-05-07 00:29:46 +02:00
Anders Jenbo
23cec61f15 🎨 Mark Points returned by GetTargetPosition as const 2021-05-02 15:41:25 +02:00
Anders Jenbo
654a2b8834 ♻️Clean up automap code
Use Point for x,y pairs. Make helpers for drawing door and squares
2021-05-02 15:27:38 +02:00
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.
2021-05-02 05:52:11 +02:00
Gleb Mazovetskiy
8e634ff02c ♻️ Remove _iAnimWidth
No longer needed as of #1796

We could probably go further and not expose `ItemAnimWidth`,
but it'd be dangerous because sometimes `_iAnimData` is null.
2021-05-02 02:05:36 +02:00
Gleb Mazovetskiy
47c93c2f9c 🧹 Fix more -Wformat warnings 2021-05-01 22:19:27 +02:00
Vladimir Olteanu
c319344c50
Load/save cleanup (#1766) 2021-04-30 08:44:11 +02:00
Anders Jenbo
3b04f67194 🔥 Remove a chunk of miniwin types 2021-04-29 23:04:56 +02:00
obligaron
16b3b38908 Move NewPlrAnim logic to AnimationInfo
Adjust SetNewAnimation-Parameter Names to Class Member

Adjust NewPlrAnim-Parameter Names to SetNewAnimation-Parameter Names
2021-04-29 04:33:51 +02:00
obligaron
1de46a8495 Rename member variables 2021-04-29 04:33:51 +02:00
obligaron
0b5183f63e Introduce AnimationInfo
Update AnimationInfo.DelayLen comment
2021-04-29 04:33:51 +02:00
Vladimir Olteanu
bea21a5e20 Replace LOAD_LE32 & LOAD_BE32 with signedness- and endian-agnostic equivalents 2021-04-28 20:11:51 +02:00
Anders Jenbo
b69d18f12d 🌐 Enable translation of all remaning strings 2021-04-25 21:32:41 +02:00
obligaron
239a43cc1c
Remove "AnimWidth2" expect for missiles (#1680) 2021-04-25 13:32:33 +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
efbe8a8338 ♻️ add possition points to monsters 2021-04-24 20:29:52 +02:00
Anders Jenbo
7912e510f0 🎨 Clean up overuse of SDL types 2021-04-24 17:07:07 +02:00
Anders Jenbo
275404029e ♻️Cleanup player temp variables 2021-04-24 17:07:07 +02:00