Commit Graph
95 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 4fa3732526 Add missing <cstdint> includes
Done with the following script:

```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
  v = File.read(path)
  next if !v.include?("uint32_t") || v.include?("cstdint")

  lines = v.lines
  line_num = if lines[2].start_with?(" *")
    lines.index { |l| l.start_with?(" */") } + 3
  else
    3
  end

  lines.insert(line_num, "#include <cstdint>\n")

  File.write(path, lines.join(""))
end
```

then fixed-up manually
2023-05-10 13:50:12 +01:00
Gleb Mazovetskiy 1fc8ecb6f6 Add fmt::runtime annotations for C++20 support
`fmt` requires non-contexpr format string arguments to be wrapped in
`fmt::runtime` in C++20.
2022-06-14 12:46:36 +01:00
Gleb Mazovetskiy 779ccaca17 Overhaul translation fetching
1. Do not modify the map after loading. Instead, return string views
   (guaranteed to be null-terminated) from look up functions and return
   the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
   Saves a bit of RAM (~50 KiB) and improves lookup performance.
2022-06-14 12:46:36 +01:00
obligaron bc15bdf3a9 Remove PANEL_ defines and replace them with GetMainPanel() 2022-05-29 20:20:44 +02:00
obligaron 70c5cf6cad Fix item label text with open stash (#4595)
* Item labels: check if stash is open in IsMouseOverGameArea

* Add IsLeft/RightPanelOpen
2022-05-20 09:12:54 +02:00
Anders Jenbo a48f89007d Implement stash 2022-03-18 06:01:53 +01:00
qndel 48f102eff1 Chat log 2022-03-06 01:02:55 +01:00
KPhoenix 1c25cb4bf0 Fixed Event Messages color 2021-12-26 12:18:13 +01:00
KPhoenixandAnders Jenbo a08026097a Chat Interface Revision (#3840)
Co-authored-by: Anders Jenbo <[email protected]>
2021-12-25 10:11:42 +00:00
Gleb Mazovetskiy e07c9eee03 Fix chat message overlap in CJK 2021-11-29 14:51:58 +01:00
Gleb Mazovetskiy 1b8939d70c Safer chat message handling 2021-11-29 14:51:58 +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 799f1763af Performce UTF8 aware limited string copies 2021-11-22 03:28:51 +01:00
obligaron 677303cba9 Reduce use of view globals in game menu 2021-11-20 21:57:32 +01:00
Anders Jenbo f09a065da5 Fix chat position in relation to dynamic panels 2021-10-26 01:10:08 +02:00
Anders Jenbo 573d24e1c0 Remove wrong translation comment 2021-10-25 22:11:21 +02: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 7771a08d03 Translatable mainpanel 2021-09-19 07:21:52 +02:00
Anders Jenbo 7169882b1f ✨ Implement new font rendering 2021-09-12 01:37:28 +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 9c4e34f988 Player by reference 2021-07-20 01:35:56 +02:00
Anders Jenbo f0a7a5c989 🎨 Apply code style 2021-07-19 05:44:20 +02:00
Anders Jenbo 069249f318 🚚 Move local function to anonymous namespace i-p 2021-07-19 05:44:20 +02:00
Anders Jenbo 0889780923 Remove more usage of miniwin types 2021-07-18 02:11:58 +02: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
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 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
Anders Jenbo a7c7fa0030 Fully apply clang-tidy/format to all files 2021-07-03 16:41:43 -07:00
Gleb Mazovetskiy cb0dae8590 🚚 Rename CelOutputBuf to Surface and extract 2021-07-03 05:33:32 -07:00
Anders Jenbo 129342d07a Clang-tidy: GlobalConstantCase 2021-07-02 22:56:56 +02:00
Anders Jenbo d8fa29c972 Clean up more implicit bool conversion 2021-06-26 10:07:02 -07: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 fd96bb9ab5 Render chat messages using common text rendering 2021-05-19 14:09:33 +02:00
Anders Jenbo 34744c068f ♻️Consitantly use %i and not %d 2021-05-15 14:17:52 +02:00
arcas 6502a3ca4d Adding resources for translation (#1973) 2021-05-15 14:12:28 +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
Anders Jenbo b69d18f12d 🌐 Enable translation of all remaning strings 2021-04-25 21:32:41 +02:00
Anders Jenbo d024f79b0e 🧹 performance-unnecessary-value-param 2021-04-22 00:08:19 +02:00
Anders Jenbo 373f28736f 🎨 Acceptable parts of modernize-* 2021-04-19 22:42:19 +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 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
Anders Jenbo 2362ff82f7 ✨ Add black text color 2021-03-27 23:04:19 +01:00
Anders Jenbo 38fdf34c14 💄 Apply code style 2021-03-20 20:39:28 +01:00