Commit graph

120 commits

Author SHA1 Message Date
Anders Jenbo
069249f318 🚚 Move local function to anonymous namespace i-p 2021-07-19 05:44:20 +02:00
ephphatha
7de18d27cf Extract door object type test to ObjectStruct method
This removes the direct reference to _object_id values in path.cpp, that enum is now only used in objects.h/cpp
2021-07-17 17:35:58 +02:00
Anders Jenbo
77b72da276 ♻️Use monster by reference when possible 2021-07-14 20:22:35 -07:00
Anders Jenbo
ef6275caac Clean up private function names 2021-07-12 17:59:22 -07:00
ephphatha
a842d07dab Combine duplicated initialisation logic for quest book objects 2021-07-11 05:09:13 -07:00
ephphatha
cc3572af81 Update BookLever related functions to use Rectangle.
This is mainly to help isolate functionality in the hopes of adding a specialised object class for this type of object as suggested by @julealgon in https://github.com/diasurgical/devilutionX/pull/2344#discussion_r667415019

For example, AddSCambBook performs almost the same logic but uses var6 instead of var8 for the trigger condition/identifier.
2021-07-11 05:09:13 -07:00
ephphatha
e25d287ba9 Move SetObjMapRange to a member function
Due to the way this function is used it was easiest to also change ObjIndex to return a reference to the object instead of the index. Also added an explicit conversion from Size to Displacement to make one of the uses slightly cleaner to express.
2021-07-10 19:11:30 -07:00
Andrew James
af60158274
Object by reference in SyncObjectAnimation functions (#2344) 2021-07-10 14:03:44 +02:00
ephphatha
b680e3fef1 Align end comment markers for doxygen comments
Including a bunch from previous PRs (since I was responsible for the broken formatting for most 😓)
2021-07-09 18:00:15 +02:00
ephphatha
19ae61811f Refactor AddObject to take Point instead of int x/y 2021-07-09 17:58:34 +02:00
ephphatha
6f40f0dd88 Refactor ObjSetMicro to take a Point parameter 2021-07-09 18:52:50 +10:00
Anders Jenbo
467b74dc06 Rename object globals 2021-07-08 02:01:14 -07:00
Anders Jenbo
7e737cfa96 Merge remote-tracking branch 'refs/remotes/devilution/master' 2021-07-03 01:44:45 +02: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
Anders Jenbo
790f42d078 Clang-tidy: readability-inconsistent-declaration-parameter-name 2021-06-27 01:06:00 +02: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
ephphatha
0c99ae0206 Add descriptive name and comments for the Na-Krul spell tome check function 2021-06-13 13:54:30 +02:00
Anders Jenbo
9e2206a673 Format code 2021-05-21 14:12:31 +02:00
Anders Jenbo
8eb9c930fe
🚨 Fix remaning GCC warnings (#1929) 2021-05-11 09:34:45 +02:00
Anders Jenbo
f579b2f287 Handle cel/cl2 files as byte arrays 2021-05-06 13:17:54 +02:00
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.
2021-05-04 19:08:37 +02:00
obligaron
239a43cc1c
Remove "AnimWidth2" expect for missiles (#1680) 2021-04-25 13:32:33 +02:00
Jmgr
c33182d6de Modernize deprecated headers 2021-04-25 02:50:31 +02:00
Anders Jenbo
2bd13451a1 ♻️Apply point positioning to all remaning entities 2021-04-25 01:25:48 +02:00
Anders Jenbo
7912e510f0 🎨 Clean up overuse of SDL types 2021-04-24 17:07:07 +02:00
Xadhoom
bf908da5bc Add option to disable clicking on character crippling shrines 2021-04-19 12:22:44 +02:00
Anders Jenbo
6e1a106a38 🚚 Move header we implement into the project 2021-04-16 01:04:54 +02:00
Anders Jenbo
f450d6a125 🚚 Move defines to there proper files 2021-04-16 01:04:54 +02:00
Anders Jenbo
61244c4d93 ♻️ Rearange and apply more enums 2021-04-10 05:24:01 +02:00
Anders Jenbo
93d42b62b8 ♻️ Change BOOL to bool 2021-04-09 15:13:02 +02:00
Anders Jenbo
b1ffdca0a3 ♻️ make better use of enums 2021-04-08 20:29:16 +02:00
Anders Jenbo
af96de4038 ♻️ Move a large part of enums to there respective headers 2021-04-08 19:20:55 +02:00
Anders Jenbo
433edc63ea ♻️ Consistently use pragma once to guard the headers 2021-04-06 15:21:25 +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
Anders Jenbo
6f1498d315 🚚 Move structures to there respective headers 2021-04-06 12:41:00 +02:00
Anders Jenbo
d6ec6395e0 ♻️ change QuestTalkData in to an array of _speech_id
This gets rid of casting QuestTalkData to DWORD/int in various parts of
the code.
2021-03-11 01:40:13 +01:00
Anders Jenbo
783e4a70b1 ♻️ Strongly type items structures 2021-03-06 10:04:07 +01:00
Anders Jenbo
93b82e3b7a Fix regression of static lights from fix of dynamic ones
This issue was introduced in 1f532040a8
2021-01-31 14:00:22 +01:00
Anders Jenbo
adf5f8f504 Clean up hellfire related code 2021-01-31 13:37:42 +01:00
Anders Jenbo
c802cbdc4d Merge more Hellfire code paths 2021-01-05 23:14:35 +01:00
Anders Jenbo
d20eddf48e Unifcy a chunk of Hellfire's code pathts 2020-12-28 01:11:25 +01:00
Anders Jenbo
4ae75753c8 Merge branch 'master' of github.com:diasurgical/devilution 2020-11-09 01:24:02 +01:00
Anders Jenbo
377e9a3383 Reorder objects.cpp 2020-11-04 20:14:58 +01:00
Anders Jenbo
72e2637061 Merge branch 'master' of github.com:diasurgical/devilution 2020-10-25 17:38:06 +01:00
Gleb Mazovetskiy
ec329e645c Fix all "no-write-strings" warnings 2020-10-25 15:37:51 +01:00
Anders Jenbo
cec9579186 Merge branch 'master' of github.com:diasurgical/devilution 2020-10-12 10:48:34 +02:00
Anders Jenbo
2d6c1efeab Merge branch 'master' of github.com:diasurgical/devilution 2020-10-12 10:46:28 +02:00
Anders Jenbo
e837130a98
Add missing book names (#2113) 2020-10-12 09:13:26 +02:00
qndel
baa2eacb0c
OperateFountain cleanup (#2096) 2020-10-12 00:24:36 +02:00