Commit graph

33042 commits

Author SHA1 Message Date
Charles Dang
1167e3e78b Some build fixups to reflect changes since the help commits were originally made 2018-03-19 10:48:48 +11:00
Celtic Minstrel
5d918cd5a5 Help Browser: Support arbitrary initial topic
Hidden topics still untested.
2018-03-19 10:48:02 +11:00
Celtic Minstrel
b5c0da9e37 Help Browser: Don't double-list a section's root topic 2018-03-19 10:45:11 +11:00
Celtic Minstrel
854ade5d5c Help Browser: Show topic title 2018-03-19 10:45:09 +11:00
Celtic Minstrel
f2434d6572 Help Browser: Fix back button being visible when dialog opens 2018-03-19 10:45:07 +11:00
Charles Dang
71a89de7b2 Help Browser: properly implement toggling by clicking the book icons 2018-03-19 10:45:06 +11:00
Celtic Minstrel
a96c270b32 Fix GUI1 help topics not showing 2018-03-19 10:45:04 +11:00
Celtic Minstrel
cdea534ee0 Help Browser: Implement history 2018-03-19 10:45:03 +11:00
Charles Dang
c514c95a1f Moved new help entry point to a common location 2018-03-19 10:45:01 +11:00
Charles Dang
231a8ccbf2 Help Browser: implemented viewing of sub-sections/topics 2018-03-19 10:44:01 +11:00
Celtic Minstrel
11dbcb1464 Help Viewer: Parse help markup to Pango markup... mostly.
The help parser now outputs a config rather than a vector of strings of
which some should be taken literally and others parsed as WML.
2018-03-19 10:43:59 +11:00
Celtic Minstrel
d61af99a9b Help: That parameter isn't really needed 2018-03-19 10:43:36 +11:00
Celtic Minstrel
178dba8284 Help Viewer: Show topics with generated text 2018-03-19 10:43:27 +11:00
Celtic Minstrel
fbd42a7378 Help Browser: Actually show the correct topics with the correct icons
This also fixes the lag when opening help and makes the topic text appear.
(The topic text is not parsed at the moment, though.)
2018-03-19 10:43:25 +11:00
Gregory A Lundberg
22f0a89a64
Fix Coverity 1386194 Initialize class member
Only a problem if stuff is not done in the expected order. Initialize to zero so at least things go wrong but they don't go wildly wrong.
2018-03-18 17:05:55 -05:00
Gunter Labes
b115be99e1 Enable lobby message logging again
Also re-enable flood protection and truncating too long messages.
2018-03-18 20:16:06 +01:00
Gregory A Lundberg
54b3f51a24
Fix more doccomments 2018-03-18 13:57:43 -05:00
Gregory A Lundberg
c7416ae7d9
Un-deprecate getMinimap
We can't use deprecated functions. If you want to replace it, replace it and delete the old function. But don't do half the job and expect a clean build!
2018-03-18 13:57:43 -05:00
Gregory A Lundberg
f97a617a26
Fix doccomments. 2018-03-18 13:18:12 -05:00
Gregory A Lundberg
ab36c8bcc2
More missing override specifiers. 2018-03-18 12:54:30 -05:00
Gregory A Lundberg
5b371161a7
Add missing override specifier. 2018-03-18 12:07:47 -05:00
Charles Dang
61f653f91a Merge branch 'master' of github.com:wesnoth/wesnoth 2018-03-19 02:16:17 +11:00
Charles Dang
7f81fba11a Fixup build again 2018-03-19 01:54:31 +11:00
Jyrki Vesterinen
750d558cd9 Fix #2681: minimap buttons don't do anything
Regression from commit ecc0dca665.
2018-03-18 16:48:05 +02:00
Charles Dang
af4db845d6 Cleaned up more framebuffer stuff that should have been in e205e42d44
Some additional uses from master that I forgot to add to the aforementioned commit,
and at least one thing I messed up in conflict resolution.
2018-03-19 01:45:43 +11:00
Charles Dang
cbf34d2db3 Video: we don't need to record the refresh rate anymore
Once we get OpenGL rendering all set up, double buffering will limit the frame rate for us.
2018-03-19 01:42:17 +11:00
Charles Dang
b7a717ff70 Fixup build (add missing include) 2018-03-19 01:32:33 +11:00
Charles Dang
90b2a51c46 display general compilation fixes 2018-03-19 01:31:34 +11:00
Charles Dang
079ec37909 Display: removed old software blitting routines from scroll 2018-03-19 01:31:33 +11:00
Charles Dang
11054e93f1 GUI2/Canvas: some refactoring to correctly reimplement the shape caching mechanism
The purpose of the shape caching is essentially to allow multiple draws to consecutively add to
previously drawn content. It essentially adds another condition for clearing the texture prior
to rendering.

I also moved the shape list handling into the draw function itself so it's only executed once
if needed instead multiple times when calling functions like set_variable - not that it actually
would have done anything after the first call, but this allows me to keep the clearing-the-texture
code in one place.
2018-03-19 01:31:31 +11:00
Charles Dang
16842ea2a8 Game Display: formatting update 2018-03-19 01:31:30 +11:00
Charles Dang
56c733268e Game Display: reimplemented more functionality in draw_movement_info
Not completely done yet, still need to get some stuff working, but this gets rid of the old commented-out
code and puts stuff mostly in the right place.
2018-03-19 01:31:29 +11:00
Charles Dang
d5249333d4 Unit/Frame: fixed alpha mods being applied to all units of the same type 2018-03-19 01:31:28 +11:00
Charles Dang
3332ae9757 GUI2/Minimap: refactored drawing code
Instead of using the minimap surface method (which was getting converted from surface to texture every
draw cycle since the caching mechanism the canvas implemented wasn't available and the weird custom
cache the widget implemented itself didn't seem to do actually do anything) we use the new render-to-
canvas-texture method which is a lot cleaner and should be a lot faster. This also means we no longer
override styled_widget::impl_draw_background.

Do note I might use the design of the removed cache here to add some age functionality to the
font::pango_text cache.
2018-03-19 01:31:27 +11:00
Charles Dang
ae106b5091 GUI2/Canvas: allow the default draw routine (shape drawing) to be overridden
Previously widgets that wanted to implement custom drawing behavior overrode styled_widget::impl_draw_background
or impl_draw_foreground. Those functions in the base class simply called the canvas render methods. Some widgets
such as the minimap ignored that rendered the contents on their own.

This new method allows rendering directly to the canvas's texture, meaning all the caching and sizing is already
handled by the canvas and doesn't need to be done by the widget; everything's always the right size and redrawn
when necessary.
2018-03-19 01:31:26 +11:00
Charles Dang
6c09c2b269 Added new minimap drawing method that works wholly with textures
I've left the old getMinimap function alone and added a new function that will eventually replace it
that utilizes texture rendering to a given texture instead of relying on surface blits and scaling.
This has the benefit of, well, reducing surface ops, for one, as well as removing the need to create
a new texture from the minimap surface every time it's updated.
2018-03-19 01:30:38 +11:00
Charles Dang
8190d67152 Allow render_target_setter to restore the last target when destroyed 2018-03-19 01:30:37 +11:00
Jyrki Vesterinen
dde06909f0 Fix build with Visual Studio 2018-03-19 01:30:36 +11:00
Charles Dang
c7ed5559a0 GUI2/Canvas: optimized cached texture management
Instead of throwing out the cached texture every time the canvas was dirty, I've added a flag so that
only happens if its size has actually changed. There still seem to be some issues in GUI2 where canvas
objects keep getting reset, but I'm not sure why. Will have to look into that.

Anyway, the addition of the SDL_RenderClear call also seems to have fixed the weird graphics bleed-through
I was getting when running the game with the OGL driver.

I don't know if the canvas copy or move ctors are needed for anything. I added them for a test, but I'll
leave them for now in case I need them later.
2018-03-19 01:30:35 +11:00
Charles Dang
5e35f6dbfe Moved SDL_SetRenderDrawColor wrapper to utils file and added a second overload
Also renamed the function to a more colloquial version.
2018-03-19 01:30:34 +11:00
Charles Dang
028b4ee73c Halos: fixed incorrect drawing origin when at non-default zoom 2018-03-19 01:30:32 +11:00
Charles Dang
2ba020a746 Display: avoid temp vectors when rendering partial fog/shround images on hex 2018-03-19 01:30:31 +11:00
Charles Dang
eeece5e3c7 Display: exit render_scaled_to_zoom early if passed texture is null 2018-03-19 01:30:30 +11:00
Charles Dang
d9f284f926 Font/Pango Text: fixed a weird crash in Cairo
See added comment for details.
2018-03-19 01:30:29 +11:00
Charles Dang
8eba15bffc Refactored handling of window/renderer size getters
* Removed display::screen_area(), display::w(), and display::h().
* Moved the global screen_area() function into the CVideo class.
* Renamed CVideo::getx() and gety() to get_width() and get_height()
* Made those two functions return the result of screen_area() instead of the other way around.
* Added preliminary support for high-DPI rendering to screen_area()

Note on the last point: When I fixed bug #1772 (aa8f6c7e7 right now but will probably change with rebasing)
I noted that SDL_GetWindowSize and SDL_GetRendererOutputSize returned the same results for me (even with
Window's automatic scaling for non-high-DPI-enabled apps disabled) but that the SDL documentation stated the
former returned screen coordinates and the latter pixels. In that same commit I changed the dimension functions
to use SDL_GetWindowSize. I've now reversed that decision and gone back to using SDL_GetRendererOutputSize so
I can guarantee output in pixels. If use_pixels is false, the code will return coordinates in 96 DPI, so I need
to have pixel measurements for the calculations.

Again, though, I do not know if SDL_GetWindowSize returns a different value that pixel size (which it's said
to do) on macOS or iOS. I'll need to do some testing. It's possible on those platforms I won't need the 96 DPI
measurements, but it's also possible it will be needed on on platforms, since all of our code relies on pixel
measurements.
2018-03-19 01:29:41 +11:00
Charles Dang
63398733b0 Controller Base: removed unused process_focus_keydown_event event
This was used before the command console was converted to GUI2.
2018-03-19 01:29:39 +11:00
Charles Dang
0032395ccf Floating Label: keep local pango_text object static
This also means I need to set set_add_outline every time create_texture is called to make sure the
text renderer has the correct settings.
2018-03-19 01:29:38 +11:00
Charles Dang
c72ac0079d Display: fixed moving units drawing under foreground terrains 2018-03-19 01:29:37 +11:00
Charles Dang
54fd91cc55 SDL/Texture: avoid unnecessary shared_ptr creation
Made use of shared_ptr::reset instead of creating temp shared_ptrs, assigning them to the class ptr,
then deleting them.
2018-03-19 01:29:36 +11:00
Charles Dang
beae56a4ea Display: simplified a few things 2018-03-19 01:29:35 +11:00