Age | Commit message (Collapse) | Author | Files | Lines |
|
Due to the use of SubImage, there can be multiple images pointing to the same
SDL_Texture with different alpha values. However, since the alpha mod set on
the texture was only set from Image::setAlpha, images were not always rendered
with the correct alpha value.
Now the alpha mod is always set right before rendering each image. Most of the
time the alpha will remain the same, but I don't expect this to become a
performance issue so I've not added extra variables and checks to suppress such
calls when they aren't needed.
On the upside, this simplifies the "use color" option, which previously had to
restore the previously set alpha mod.
Closes #117
|
|
Rather than rendering the same texture 4 additional times, render a
specific outline version of the text. While reducing the number of times
the text is drawn, it does increase font texture use.
Result is a generally prettier outline due to rendering it properly at
sharp corners of the characters. The shadow for outlined text is now
also thicker, as appropriate.
As part of this change, the `TextRenderer` class was merged into the
`Graphics` and `TrueTypeFont` classes. There seemed to be little point
in having a separate function for this, apart from needing more static
casts to `Graphics*`.
Also fixed an issue where the font style was not being restored after
adjusting the font scale, when using an older SDL_ttf than 2.0.18.
Closes #87
|
|
No need to cache the image in different colors since color modulation is
cheap these days.
|
|
* TrueTypeFont class now takes into account the graphics scale, in order
to render an appropriate higher-resolution texture.
* Removed TrueTypeFont::fontCounter, since TTF_Init/TTF_Quit already
keep a counter.
* Avoid copying the rendered string needlessly, when it already exists
in the cache. Avoid another copy, when inserting a new chunk into the
cache.
|
|
Now a text chunk has a maximum length of 4k characters, but that should
be plenty of space since they're only single lines.
|
|
* Use default member initializers
* Use range-based for loops
* Avoid needless pointer references for ShopItem::mDuplicates
* Removed type aliases that are only used once or twice
* Removed more unused includes
* Removed some unused functions
* Removed superfluous .c_str()
* Rely on default copy and assignment operators for Vector class
* Use std::unique_ptr in some places
* Removed duplicated mPlayerMoney updating in SellDialog
* Removed duplicated Game::handleInput call
* Removed unused SDLInput::mMouseInWindow
* Removed remnant of manual widget positioning in HelpWindow
* Removed superfluous initialization of static pointers
|
|
This patch is not exhaustive.
|
|
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
|
|
|
|
It makes no sense to mark a return value as const when it is returned by
value. This only makes sense if the return value is passed by reference, in
order to prevent the receiver from modifying the value.
Also made some other small adjustments. A std::string does not need to be
initialized to "" explicitly and getSafeUtf8String could take its parameter by
reference.
Reviewed-by: Yohann Ferreira
|
|
SDL_ttf provides a separate function for getting the recommended line skip, or
the spacing between two lines of text. When rendering multiple lines of text
this should be used rather than the visual height of the font.
Since the information is only available for TrueTypeFont, a dynamic_cast was
used with a fallback on gcn::Font::getHeight.
Also made some small tweaks but nothing that really affects performance.
Reviewed-by: Yohann Ferreira
|
|
|
|
Reviewed-by: cody
|
|
Reviewed-by: Bertram
|
|
Reviewed-by: Bertram
Resolve: Manasource Mantis #143
|
|
|
|
|
|
|
|
Use the cache created by TTF::drawString, drops the cost of
TTF::getWidth from 5% of runtime to 0.5%.
It increases the cost of calculating line-wrapping in the BrowserBox,
but overall it's a saving, even with the BrowserBox recalculating on
every redraw.
|
|
Also added the update copyright tool from the Wormux Team.
( And not forgetting credit's due. :P )
|
|
Moved remaining widgets into widgets folder, standardized include order, moved TextRenderer out.
|
|
|
|
Plus some tweaks and cleanups.
|
|
|
|
enable/disable this effect (default is off) and another option to disable the pickup notification in the chat log (default is on).
|
|
Please do remember that member variables are prefixes with 'm', so that
they are easily distinguishable.
|
|
Conflicts:
CMakeLists.txt
configure.ac
data/help/header.txt
packaging/windows/setup.nsi
po/POTFILES.in
src/being.cpp
src/being.h
src/game.cpp
src/gui/color.cpp
src/gui/color.h
src/gui/equipmentwindow.h
src/gui/popupmenu.cpp
src/gui/recorder.cpp
src/gui/setup_colors.h
src/gui/setup_keyboard.cpp
src/gui/setup_keyboard.h
src/gui/skill.cpp
src/gui/speechbubble.cpp
src/gui/speechbubble.h
src/gui/table.cpp
src/keyboardconfig.cpp
src/keyboardconfig.h
src/localplayer.cpp
src/main.cpp
src/main.h
src/map.cpp
src/resources/colordb.cpp
src/resources/colordb.h
src/resources/emotedb.cpp
src/resources/emotedb.h
src/text.cpp
src/text.h
src/tmw.rc
src/winver.h
|
|
Sometimes it's nice for clarity, but most of the time this is just
clutter. C++ != Java. :)
|
|
useful since buddy lists are tracked through the player relation
interface instead)
Signed-off-by: Ira Rice <irarice@gmail.com>
|
|
Sometimes it's nice for clarity, but most of the time this is just
clutter. C++ != Java. :)
|
|
Signed-off-by: Ira Rice <irarice@gmail.com>
|
|
Conflicts:
Almost everywhere.
|
|
|
|
|
|
This dates back to the old days of TMW, but the usage instructions of
GPLv2 don't mention this being necessary. Since it doesn't add anything,
avoid the branding in these sections.
|
|
This dates back to the old days of TMW, but the usage instructions of
GPLv2 don't mention this being necessary. Since it doesn't add anything,
avoid the branding in these sections.
|
|
the function names should no longer be around.
Signed-off-by: Ira Rice <irarice@gmail.com>
|
|
|
|
|
|
The font was interpreting the strings as UTF8, as they are in the
mainline client. But in the eAthena client they are regular text.
|
|
on the screen.
(cherry picked from mainline commit 483c76d1b2433bc34f67406a10bf409fb2daafe1)
|
|
(cherry picked from mainline commit 0962fc8b567279a6e97e13e4b3f2f9f2ffe304c0)
|
|
(cherry picked from mainline commit 89a1dcb59be3e531cc0761c32d1aa70e141d4a12)
|
|
(cherry-picked from mainline)
|
|
the inbuilt GUIChan TrueType class. (Didn't use it originally because I
didn't see the difference, when there's a considerable speedup, and that
originally the import for TMW was broken code at the time, which has
been fixed since.)
|
|
The font was interpreting the strings as UTF8, as they are in the
mainline client. But in the eAthena client they are regular text.
|
|
Noticed by QOAL
|
|
on the screen.
(cherry picked from mainline commit 483c76d1b2433bc34f67406a10bf409fb2daafe1)
|
|
(cherry picked from mainline commit 0962fc8b567279a6e97e13e4b3f2f9f2ffe304c0)
|
|
(cherry picked from mainline commit 89a1dcb59be3e531cc0761c32d1aa70e141d4a12)
|