Commit graph

187 commits

Author SHA1 Message Date
KPhoenix
d544a467e6
Show game Difficulty in Automap (#3867) 2021-12-31 05:28:51 +01:00
Andrew James
796e2813cf
Use scoped enums for DungeonFlags/BFLAG (#3135) 2021-11-07 03:11:16 +01:00
qndel
7250aeae66 tweak automap colors 2021-10-25 16:57:16 +02:00
Anders Jenbo
b9b4b9eea0 Fix OOB in DrawAutomapTile 2021-10-25 04:43:35 +02:00
qndel
e567953bc9 Sharing automap exploration in multiplayer 2021-10-25 02:58:41 +02:00
staphen
ffbbcc6d62 Support unencrypted multiplayer games with no password 2021-10-25 01:14:37 +02:00
qndel
9f7c69f4f5 improve southeast arrow 2021-10-01 12:44:11 +02:00
qndel
560066585a center automap arrow 2021-10-01 12:44:11 +02:00
qndel
6bd48907e0 fix jumping arrow 2021-10-01 09:28:10 +02:00
ephphatha
b12de6fe12 Use scoped enum for Direction
Identified and removed an instance of Direction being used as an argument for a bool parameter

Removed a single-use temporary variable being cast from sprite frame to direction to size_t

Co-authored-by: Anders Jenbo <anders@jenbo.dk>

Fix alignment of WalkSettings array
2021-09-12 02:27:47 +02:00
Anders Jenbo
7169882b1f Implement new font rendering 2021-09-12 01:37:28 +02:00
Juliano Leal Goncalves
940a120bf9 ♻️ Replace 'ViewX' and 'ViewY' globals with single 'ViewPosition' 2021-09-04 18:06:28 -04:00
Anders Jenbo
df636c0afc Remove DIR_OMNI 2021-08-23 10:51:06 +02:00
Anders Jenbo
23fdb5aa27 [vanilla] Fix missing dirt corners in automap 2021-08-11 02:33:22 +02:00
Anders Jenbo
0b68a8b2d3 Fix missing dirt tiles in automap 2021-08-11 02:33:22 +02:00
Andrew James
8d9c46290d Automap: Scoped enums and wrappers to minimise bitwise operations (#2534) 2021-08-08 19:25:05 +02:00
Anders Jenbo
26756b82dc ♻️Split up DrawAutomapTile 2021-08-08 19:25:05 +02:00
Anders Jenbo
f2d858af4b Cleanup magic numbers in automap.cpp 2021-08-08 19:25:05 +02:00
obligaron
cb62e7bf2d Fix automap jiggling for player arrow 2021-07-19 17:19:49 +02:00
obligaron
dae9d7eff5 Enable ADL (GetOffsetForWalking) for automap 2021-07-18 21:41:07 +02:00
Anders Jenbo
9ebdb6db69 General clean up 2021-07-08 03:30:25 -07:00
Anders Jenbo
9b8bf92575 Rename quest globals 2021-07-08 02:01:14 -07:00
Anders Jenbo
96bf75b502 Rename player globals 2021-07-08 02:01:14 -07:00
Gleb Mazovetskiy
cb0dae8590 🚚 Rename CelOutputBuf to Surface and extract 2021-07-03 05:33:32 -07:00
Juliano Leal Goncalves
cbb84199c2 ♻️ Replace Point addition with 'Point + Displacement' 2021-06-28 20:37:44 -07:00
Andrew James
60a47caf1b
Refactor Draw* functions to use Rectangle and Point types
Added overload for DrawString taking a Point to avoid creating a rect for callers which only use position. This also documents the way DrawString operates when passed a clipping rectangle with a dimension of 0.
As part of this overload removed the logic for 0 width regions from DrawString. This does change the behaviour of the Rectangle version if called with a rect with width 0, all callers using that behaviour have been updated in this commit.

Using Rectangle/Size allowed simplifying the logic for certain calls where they could use DrawText alignment flags, previously this was manually aligning by calculating dimensions and offsetting the position. This also fixes #2169

Also includes a few instances where a temporary buffer was used to set the text to be drawn with unbounded sprintf calls, replaced those with snprintf as is recommended in modern C applications. Moving to C++ strings would be good in a future refactor.
2021-06-24 01:36:06 +02:00
Gleb Mazovetskiy
e40b1963f9 🚚 engine.h: Extract CelSprite and file loading 2021-06-21 01:36:20 -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
Anders Jenbo
1c13f283cf Fix Clang warning 2021-06-15 00:23:35 +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
Jmgr
bbd39aa513 Replace sprintfs with strcpy for translatable strings 2021-05-21 01:02:45 +02:00
Jmgr
6e85cde978 Update format strings 2021-05-21 01:02:45 +02:00
Jmgr
0c27e756f7 Add fmt::format 2021-05-21 01:02:45 +02:00
Anders Jenbo
a095bc0bf7 ♻️Migrate more code away from miniwin 2021-05-13 02:30:18 +02:00
Anders Jenbo
72598865cc ♻️Replace PrintGameStr with DrawString 2021-05-08 18:48:19 +02:00
Anders Jenbo
4a7ba94702 🎨 Run clang-format 2021-05-07 23:26:39 +02:00
Gleb Mazovetskiy
710ddb9af6 ♻️ Make SetPixel a method 2021-05-07 01:02:03 +02:00
Gleb Mazovetskiy
6474dea0a9 ♻️ Move automap_render to engine/, rename 2->Steep
Also adds header file documentation.
2021-05-06 12:58:06 +02:00
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.
2021-05-06 12:58:06 +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
Anders Jenbo
bfc510fb23 Clean up automap.cpp 2021-05-03 05:44:40 +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
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.
2021-05-01 20:51:55 +02:00
Anders Jenbo
48dbb47d70 🌐 Apply static translations 2021-04-29 01:21:28 +02:00
Anders Jenbo
b69d18f12d 🌐 Enable translation of all remaning strings 2021-04-25 21:32:41 +02:00
John Törnblom
e0dddf508a
Add automatically translated string literals (#1694) 2021-04-25 18:14:58 +02:00
Anders Jenbo
2bd13451a1 ♻️Apply point positioning to all remaning entities 2021-04-25 01:25:48 +02:00
Anders Jenbo
275404029e ♻️Cleanup player temp variables 2021-04-24 17:07:07 +02:00
Anders Jenbo
433fc9fa8d 💚 Packport std::clamp for pre GCC 7.1 2021-04-24 09:16:15 +02:00
Anders Jenbo
72ad648e9a ♻️Cleanup some min/max/clamp logic
Apply suggestions from code review

Co-authored-by: Gleb Mazovetskiy <glex.spb@gmail.com>
Co-authored-by: thebigMuh <81810641+thebigMuh@users.noreply.github.com>
2021-04-24 05:17:59 +02:00