Commit graph

95 commits

Author SHA1 Message Date
Gleb Mazovetskiy
1519e995cf Move store graphics out of stores.cpp
These graphics are used in various places outside of `stores.cpp`.
2022-01-30 14:56:04 +01:00
Gleb Mazovetskiy
c57644970f Move UiFlags and UiPanels into their own files
The first breaks circular dependency between `DiabloUI` and `text_render`.
The latter one moves `UiPanels` to a more appropriate place.
2021-11-25 12:22:27 +01:00
Anders Jenbo
95fef934c1 Correctly cut up lines
Fixes #3558
2021-11-20 21:17:19 +01:00
Gleb Mazovetskiy
0c694edaba WordWrapString: Wrap on punctuation
Useful for Chinese and Japanese, which do not have spaces between words,
nor whitespace after punctuation.
2021-09-30 18:16:31 +02:00
Anders Jenbo
7169882b1f Implement new font rendering 2021-09-12 01:37:28 +02:00
obligaron
a27ab517dc Enable multiline DiabloMsg and use it in debug.cpp 2021-08-26 08:28:46 +02:00
obligaron
19652a84c9 Replace msgtable, msgcnt and msgflag with std::deque 2021-08-26 08:28:46 +02:00
obligaron
6325d87e04 Introduce CancelCurrentDiabloMsg and hide msgdelay 2021-08-26 08:28:46 +02:00
obligaron
3c45149cef Introduce IsDiabloMsgAvailable and hide msgflag 2021-08-26 08:28:46 +02:00
Anders Jenbo
dc059dadb8 Restrict access to Hive and Crypt in multiplayer 2021-08-16 05:27:33 +02:00
ephphatha
0575716eac Rename UiFlags members to group related options 2021-07-31 20:22:40 +02:00
ephphatha
4ad53232a0 Convert the UiFlags enum to a scoped enum type
Replace operator&& with named function
2021-07-31 20:22:40 +02:00
Anders Jenbo
a19e7b2a3b Remove some more use of miniwin 2021-07-17 23:54:13 +02:00
Anders Jenbo
74b57558c9 🚚 Move local code to anonymous namespace 2021-07-10 17:30:15 -07:00
Anders Jenbo
903d4bd2e1 Scope all for loops
This caused 7 of the loops to be rewriteen using range by clang-tidy
2021-07-08 08:14:03 -07:00
Gleb Mazovetskiy
55464eec78 Fix -Wmissing-braces
Fixes warnings such as this one:

```
../../../../../../Source/engine/render/text_render.hpp:83:33: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        return DrawString(out, text, { position.x, position.y, out.w() - position.x, 0 }, flags, spacing, lineHeight, drawTextCursor);
                                       ^~~~~~~~~~~~~~~~~~~~~~
```
2021-07-03 19:08:45 -07:00
Gleb Mazovetskiy
cb0dae8590 🚚 Rename CelOutputBuf to Surface and extract 2021-07-03 05:33:32 -07:00
Kalebe Alves
118efe8e6d
Use Point/SDL_Rect for control functions coordinate system 2021-05-28 19:57:16 +02:00
Anders Jenbo
9e2206a673 Format code 2021-05-21 14:12:31 +02:00
arcas
6502a3ca4d
Adding resources for translation (#1973) 2021-05-15 14:12:28 +02:00
Anders Jenbo
8361e70087 ♻️Use DrawString in error.cpp 2021-05-08 18:48:19 +02:00
Anders Jenbo
68923c6c33 Generic game text render function
This should gradually replace all the direct rendering of game texts
throughout the code. The interface is made to closly mirror that of the
art fonts as that is what will eventually be used for rendering Unicode
fonts both in the menus and ingame.

fixup!  Generic game text render function
2021-05-08 18:48:19 +02:00
Gleb Mazovetskiy
0edfa3de66 🚚 Move CEL rendering to engine/render/cel_render.cpp 2021-05-07 00:16:40 +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
Mathieu Maret
8d8711a966
Apply static menu translations (#1728) 2021-04-27 14:20:31 +02:00
John Törnblom
e0dddf508a
Add automatically translated string literals (#1694) 2021-04-25 18:14:58 +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
373f28736f 🎨 Acceptable parts of modernize-* 2021-04-19 22:42:19 +02:00
Anders Jenbo
c89bd9c001 🚨 Fix remaning warnings for clang and gcc 2021-04-19 02:44:39 +02:00
qndel
449cea2b47
fix typo in spiritual shrine (#1569) 2021-04-17 18:51:11 +02:00
Anders Jenbo
997c1dba55 🚚 Split up all.h in to proper header relations 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
b1ffdca0a3 ♻️ make better use of enums 2021-04-08 20:29:16 +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
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
Gleb Mazovetskiy
a0af2a8ebe Migrate gmenu_clear_buffer away from gpBuffer 2021-03-13 02:26:11 +01:00
Anders Jenbo
037ef082b4 🐛 Correct position of dialog backgrounds
Fixes #1098
2021-03-03 20:08: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
Anders Jenbo
5bdbf18902 Merge branch 'master' of github.com:diasurgical/devilution 2021-01-05 22:44:11 +01:00
Anders Jenbo
bdebd5f1f5
OOB in error.cpp (#1847) 2021-01-03 02:35:29 +01:00
Anders Jenbo
d20eddf48e Unifcy a chunk of Hellfire's code pathts 2020-12-28 01:11:25 +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
2d6c1efeab Merge branch 'master' of github.com:diasurgical/devilution 2020-10-12 10:46:28 +02:00
Anders Jenbo
7108145a04 Merge branch 'master' of github.com:diasurgical/devilution 2020-04-14 15:30:49 +02:00
Anders Jenbo
630655d9e4 Merge branch 'master' of github.com:diasurgical/devilution into hellfire 2020-04-08 21:58:34 +02:00
Anders Jenbo
cc280eeba3 Enable asserts in files that where cleaned 2020-04-08 20:41:11 +02:00