Commit Graph
114 Commits
Author SHA1 Message Date
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 7f6dec6dca Fix extra content rendered in dialogs
More then just the given line was being plased in the line buffer which
caused a lot of double rendering and sometimes also invalid UTF-8
resulting is stray question marks under the text
2021-09-25 09:05:51 +02:00
Anders Jenbo 7771a08d03 Translatable mainpanel 2021-09-19 07:21:52 +02:00
Siddharth singh chouhan bcb332b7b0 Move documentation from implementations to declarations 2021-09-14 09:55:55 +02:00
Anders Jenbo 7169882b1f ✨ Implement new font rendering 2021-09-12 01:37:28 +02:00
Juliano Leal Goncalves 9f4438fa22 🚚 Rename 'TextDataStruct' struct to 'Speech' (#2805) 2021-09-06 17:47:07 +02:00
Anders Jenbo 8df8b940c4 Handle some clang-tidy issues 2021-08-07 16:30:14 +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 9b8bf92575 Rename quest globals 2021-07-08 02:01:14 -07:00
Anders Jenbo bc59218d0d More clang-tidy/Android Studio cleanups 2021-07-04 19:34:37 +02: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
Gleb Mazovetskiy e40b1963f9 🚚 engine.h: Extract CelSprite and file loading 2021-06-21 01:36:20 -07:00
Anders Jenbo 0d5d8cb1d4 💚 Fix NOSOUND 2021-05-30 19:42:36 +02:00
Kalebe Alves 118efe8e6d Use Point/SDL_Rect for control functions coordinate system 2021-05-28 19:57:16 +02:00
Anders Jenbo 6ce8f13751 Apply clang-tidy to more code and do some related cleanups 2021-05-24 05:27:06 +02:00
Anders Jenbo 6acb49bea4 Render quest and menu text using common text rendering 2021-05-21 04:23:49 +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 4b577329f4 ♻️Refactor towner initialization 2021-05-07 00:30:23 +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
Gleb Mazovetskiy 57172e48ed 🔨 ⚙️ CMake: Add NOSOUND option
This option completely disables all audio handling, including audio
loading code and dependencies.

Dialog text length is estimated to be somewhere between
Cain and Griswold speed.
2021-04-29 19:43:45 +02:00
Anders Jenbo 48dbb47d70 🌐 Apply static translations 2021-04-29 01:21:28 +02:00
thebigMuh ad8f342db0 Adding constness 2021-04-26 23:30:02 +02:00
Anders Jenbo 7912e510f0 🎨 Clean up overuse of SDL types 2021-04-24 17:07:07 +02:00
Anders Jenbo d024f79b0e 🧹 performance-unnecessary-value-param 2021-04-22 00:08:19 +02:00
Anders Jenbo 6ba343e309 🎨 Acceptable parts of misc-* 2021-04-19 20:11:41 +02:00
Anders Jenbo 997c1dba55 🚚 Split up all.h in to proper header relations 2021-04-16 01:04:54 +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 70d1d633bd Get rid of SCREEN_X / SCREEN_Y
GlobalOutputBuffer() now returns a clipped subregion
2021-03-17 23:37:58 +01: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 3c4ccfc2e4 CelOutputBuffer: Replace subregion with subregionY
We can't do anything with X yet
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 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
Gleb Mazovetskiy 8283f85e24 Engine: Functions to render to any buffer
Refactor the rendering functions to allow rendering to any output
buffer.

New functions that accept a buffer have the `To` suffix.

The functions that render to the global buffer now always accept
coordinates.
2021-02-27 17:49:39 +01:00
Anders Jenbo bf02e0710b Fix calculating text speed for text containing line breaks 2021-01-25 04:26:36 +01:00
Anders Jenbo 2845ea9624 Use anon namespace for local symbols 2021-01-25 00:03:02 +01:00
Anders Jenbo e0d844eb47 Fix Windows builds 2021-01-24 23:53:02 +01:00
Anders Jenbo 757fd4d33d Full document and further clean up minitext.cpp 2021-01-24 23:45:53 +01:00
Anders Jenbo beca185e5b Deduplicate some code in minitext.cpp 2021-01-24 22:52:16 +01:00
Andi 03b989f6f4 Dynamic speed scrolling text (#985) 2021-01-24 21:59:36 +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 b62b3375bd Merge branch 'master' of github.com:diasurgical/devilution 2020-10-13 02:05:36 +02:00
Anders Jenbo 4e7e3e0b46 0 1 0 0 1 ... 2 2020-10-13 01:35:19 +02:00
Tyler ecde1f647e Adjust UI to any resoution 2020-09-28 07:01:27 +02:00
Anders Jenbo 893efd51ea Merge branch 'master' of github.com:diasurgical/devilution 2020-09-27 03:34:42 +02:00
Tyler c803c6aa66 Calculate position of screen elements 2020-09-27 00:21:54 +02:00