Anders Jenbo
ac2bf9aaac
Limit what gets called in headless mode
4 years ago
Gleb Mazovetskiy
d152d2c0fb
Add OptionalOwnedCelSprite
4 years ago
Anders Jenbo
0cc5ee4344
Clean up variable definitions
4 years ago
Anders Jenbo
99181fd709
Move more files to the engine folder
4 years ago
Gleb Mazovetskiy
8e9c9e0238
Reduced the size of `OwnedCelSprite*` by 8 bytes
...
`OwnedCelSpriteWithFrameHeight`: 40 -> 32
4 years ago
obligaron
d86c4e5d84
Introduce GetUIRectangle() to distinguish between UI and main panel
4 years ago
Gleb Mazovetskiy
a66ca44695
Zero-based frame indexing
...
Index frames starting at 0 instead of 1.
4 years ago
Anders Jenbo
1409e604f5
Reduce string conversions
4 years ago
Anders Jenbo
718c46e7fe
Remove use of tempstr
4 years ago
Gleb Mazovetskiy
7fede6c4cb
Clean up owned/unowned CelSprite ambiguity
...
Makes `CelSprite` unowned and adds a new `OwnedCelSprite` class for
owned sprites.
This clarifies ownership and makes the code cleaner in a number of
places.
Additionally, because the `CelSprite` class is now tiny (1 less
pointer), we can pass it by-value instead of by-reference, removing a
pointer indirection in the rendering functions.
4 years ago
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.
4 years ago
Gleb Mazovetskiy
bc9031ad54
WordWrapString: Fix state after starting a new line
...
After starting a new line, we restart the processing from the line break
position, so we need to set `nextCodepoint` correctly.
Fixes #3449
4 years ago
Anders Jenbo
bff9140995
Expand buffers to handle Bulgarian translation
4 years ago
Anders Jenbo
203766f51b
Fix OOB write with long dialog translations
4 years ago
Gleb Mazovetskiy
0c694edaba
WordWrapString: Wrap on punctuation
...
Useful for Chinese and Japanese, which do not have spaces between words,
nor whitespace after punctuation.
5 years ago
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
5 years ago
Anders Jenbo
7771a08d03
Translatable mainpanel
5 years ago
Siddharth singh chouhan
bcb332b7b0
Move documentation from implementations to declarations
5 years ago
Anders Jenbo
7169882b1f
✨ Implement new font rendering
5 years ago
Juliano Leal Goncalves
9f4438fa22
🚚 Rename 'TextDataStruct' struct to 'Speech' ( #2805 )
5 years ago
Anders Jenbo
8df8b940c4
Handle some clang-tidy issues
5 years ago
ephphatha
0575716eac
Rename UiFlags members to group related options
5 years ago
ephphatha
4ad53232a0
Convert the UiFlags enum to a scoped enum type
...
Replace operator&& with named function
5 years ago
Anders Jenbo
9b8bf92575
Rename quest globals
5 years ago
Anders Jenbo
bc59218d0d
More clang-tidy/Android Studio cleanups
5 years ago
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);
^~~~~~~~~~~~~~~~~~~~~~
```
5 years ago
Gleb Mazovetskiy
cb0dae8590
🚚 Rename `CelOutputBuf` to `Surface` and extract
5 years ago
Gleb Mazovetskiy
e40b1963f9
🚚 engine.h: Extract `CelSprite` and file loading
5 years ago
Anders Jenbo
0d5d8cb1d4
💚 Fix NOSOUND
5 years ago
Kalebe Alves
118efe8e6d
Use Point/SDL_Rect for control functions coordinate system
5 years ago
Anders Jenbo
6ce8f13751
Apply clang-tidy to more code and do some related cleanups
5 years ago
Anders Jenbo
6acb49bea4
Render quest and menu text using common text rendering
5 years ago
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
5 years ago
Anders Jenbo
4b577329f4
♻️ Refactor towner initialization
5 years ago
Gleb Mazovetskiy
0edfa3de66
🚚 Move CEL rendering to engine/render/cel_render.cpp
5 years ago
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.
5 years ago
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.
5 years ago
Anders Jenbo
48dbb47d70
🌐 Apply static translations
5 years ago
thebigMuh
ad8f342db0
Adding constness
5 years ago
Anders Jenbo
7912e510f0
🎨 Clean up overuse of SDL types
5 years ago
Anders Jenbo
d024f79b0e
🧹 performance-unnecessary-value-param
5 years ago
Anders Jenbo
6ba343e309
🎨 Acceptable parts of misc-*
5 years ago
Anders Jenbo
997c1dba55
🚚 Split up all.h in to proper header relations
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Anders Jenbo
630e507f63
🚚 Apply namespace
5 years ago
Gleb Mazovetskiy
70d1d633bd
Get rid of SCREEN_X / SCREEN_Y
...
GlobalOutputBuffer() now returns a clipped subregion
5 years ago
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.
5 years ago
Gleb Mazovetskiy
3c4ccfc2e4
CelOutputBuffer: Replace subregion with subregionY
...
We can't do anything with X yet
5 years ago
Anders Jenbo
037ef082b4
🐛 Correct position of dialog backgrounds
...
Fixes #1098
5 years ago
Gleb Mazovetskiy
83ce7c27af
Enginify `trans_rect`
...
Moves `trans_rect` to `engine` as `DrawHalfTransparentRectTo` and makes
it operate on `CelOutputBuf`.
5 years ago