A rich text label widget that can show text marked up with help markup.
Also includes the GUI Test Window, accessible in the title screen after launching wesnoth using --clock option. It can be used as dialog template/example or as a place to test GUI2 code.
assert() is not a good way to handle incorrect user input,
It is a debugging tool that should only be used for
conditions that the program guarantees to be true
(unless there a is a bug in the c++ code).
UI elements with blur effects (such as translucent windows) now defer
rendering for one frame, so they can snapshot the area underneath
for blurring.
In the future this should be done as multiple passes in one frame,
but for now this is fine.
The only real change is that in stead of passing around CVideo
pointers and calling things via CVideo::get_singleton().foo()
one simply does not pass around pointers, and calls video::foo().
Squashed from new_rendering:
* Ported over the basic text texture cache
* Font/Text: fixed bad hashing leading to duplicate textures
* Use text texture drawing method instead of surface one
* Cleaned up and optimized pango_text rendering pipeline
* Font/Text: removed get_width and get_height in favor of just get_size
* Font/Text: guard against caching a null texture
This breaks the credits screen. The game will crash when it tries to
display it.
- Removed overload of set_resolution taking two ints
- Removed get_width and get_height in favor of draw_area
- Removed some dead code
- Minor formatting cleanup
It is now transparent to the user.
The meaning of sdl::texture.w() and .h() have changed. These now
return the intended width and height of the texture in draw-space,
rather than the real width and height. To get the real width and
height, use texture::get_info().
Contains primitive drawing functions, such as fill, points, line, etc,
and also texture drawing functions blit, flipped, tiled.
This removes specialty drawing code from several places, most notably
CVideo and gui/core/canvas.
Functions to draw to the screen should now go in draw.cpp.
Places where usage is clear have been converted to the new calls.
Places that need extra work to convert are still using get_image(),
as are places that will be clobbered as part of general rendering
system upgrades anyway.
Draws now immediately apply to the render target, in stead of
accumulating on the drawing surface. This means textures can start
to be used for drawing in stead of surfaces, and both systems
should be able to be used interchangably for now.
Some things have been broken, including but probably not limited to:
* background blur
* the occasional direct SDL_FillRect call
* floating labels
* map screenshots
Some things will be broken if textures are used for drawing:
* widget restore images
* other screenshots
* clipping areas
However, this is the first step towards proper high-dpi hardware-
accelerated rendering.
Rendering is now done to a separate surface. All routines that previously
wrote directly to the framebuffer now write to this surface. When the screen
is flipped, this surface is copied directly to a streaming texture, which is
then scaled to the window's rendering surface for display.
This has enabled a drawing resolution that differs from display resolution.
It is active and for the most part works. Input events are converted to the
correct scale by SDL, so most input handling routines can be used unchanged,
but one or two are causing problems so there are some bugs. To test this,
change the "pixel_scale" preference. Don't expect a playable game with
any pixel scale other than 1 yet.