Commit graph

40 commits

Author SHA1 Message Date
Jyrki Vesterinen
af418d86f4 WIP: texture atlas class
Currently only loading images and applying IPFs is implemented.

Most code here is copy-pasted from picture.cpp, I'm planning to eventually
remove that file.

Next task is implementing the actual sprite packing.
2018-10-10 15:03:19 +03:00
Jyrki Vesterinen
9f1e4564df WIP: thread pool class
For now it's missing ability to, you know, actually run tasks.
2018-09-27 21:30:51 +03:00
Jyrki Vesterinen
34b7903d25 Add a shader class 2018-09-27 20:04:53 +03:00
Jyrki Vesterinen
0992605c5d Add sprite, draw_op and vertex classes 2018-09-27 20:03:46 +03:00
Jyrki Vesterinen
73caa6da64 Add a texture class 2018-09-27 20:03:45 +03:00
Jyrki Vesterinen
695c8eebe8 Integrate GLEW to the Visual Studio project
I also removed USE_GL_RENDERING (OpenGL rendering is now used
unconditionally), moved initialization of gl::context out of the
constructor, and added some light logging about OpenGL (so that, in the
future with hardware-specific issues, we have a way to know which hardware
is affected).

This commit breaks build with anything except Visual Studio due to
requiring OpenGL and GLEW but not linking to them.
2018-09-27 19:56:22 +03:00
Martin Hrubý
50301f84e3 Fix building with Xcode 10 (#3460)
Resolves #3458.
2018-08-16 15:06:00 +03:00
Jyrki Vesterinen
d8e2498dde Create a named struct for terrain name and movement pair
This allows the sorting logic top be shared between the sidebar and the
unit preview pane. It also means that we no longer need to create a lambda
to sort them.

I also refactored the generation of movement cost data in help. In
particular, we're no longer extracting the struct to named local variables.
2018-07-23 17:25:24 +03:00
Charles Dang
263ad96ad3 VS: updated README
[ci skip]
2018-07-19 19:41:24 +11:00
Martin Hrubý (hrubymar10)
bc4d22dc72 Migrate links to https if available - Fwd c18537edc0 2018-07-16 19:07:08 +11:00
Charles Dang
162b9de330 Updated VS projectfile
[ci skip]
2018-07-02 22:25:51 +11:00
Charles Dang
dd69107c9b Removed scaling algorithm customization
We're going to be using NN scaling for the map, and that's already handled automatically
by SDL (and in the future, OGL). We don't need these settings for surface SCALED_TO_ZOOM
and SCALED_TO_HEX scaling. In any case, if we want to scale a surface to zoom or hex, it
will almost certainly be for map rendering (such scaling methods don't make sense in the
UI, for example), so just defaulting to NN is simplest.

As for why I've decided to stick with nearest-neighbor scaling for zoom, it happens to look
a lot better when done on the GPU than on the CPU for some reason (perhaps having to do with
the old rendering pipeline in which we were doing surface scaling), and it's better to have
a consistent scaling look as you zoom in, especially if we wanted to do animated zoom-ins.

This change drops the option to use Linear or xBRZ scaling for map zooming. This was already
the practical case due to me converting map rendering to use textures. NN was used for all
zoom levels, and it's fast and looks good.
2018-06-25 16:37:27 +11:00
Charles Dang
15917733e0 GUI2: removed legacy DescriptionWML parser
It's no longer needed.
2018-06-24 04:15:58 +11:00
Charles Dang
e0beff6615 Rename gettext_boost.cpp to gettext.cpp
Since there isn't another version anymore.
2018-05-16 12:06:48 +11:00
Charles Dang
946e9c31b4 Fixup 2a585118d8 (forgot to bump defines on all configurations)
[ci skip]
2018-05-15 19:08:18 +11:00
Charles Dang
e0192b1b1f Renamed filesystem_boost.cpp to filesystem.cpp 2018-05-13 00:10:56 +11:00
Charles Dang
2a585118d8 Bump min required Windows version to 7
Technically, all this code should work on Vista, (including the recent switch to using
SHGetKnownFolderPath), but since we're also considering requiring Visual Studio 2017
for building, we need Windows 7.
2018-05-11 10:56:11 +11:00
Wedge009
817f612f29 Update VC project files.
* Add missing project configurations.
* Remove remaining OpenMP support.
* Tidy filters.

[ci skip]
2018-04-26 18:37:50 +10:00
Charles Dang
3792612fb7 Removed OpenMP-related code
After some discussion, we concluded that this code was unmaintained, not even used in
some places (display.cpp, units/frame.cpp), leaving the only area that really used it
at all the image surface cache. Considering there was never really a conclusive benchmark
of its benefits and because said surface cache will be used a lot less going forward,
we're just removing it and simplifying everything for everyone.

Closes #1260 since it's now irrelevant.
2018-04-19 23:06:04 +11:00
Jyrki Vesterinen
a02100a0f1 Implement saving MP chat message history (#1194, #2802) 2018-04-17 22:29:26 +03:00
Charles Dang
07b69bdd32 Updated VS projectfile
[ci skip]
2018-04-14 15:17:00 +11:00
Charles Dang
f7d2924b27 Added initial implementation of a dynamic spritesheet generator
This isn't used anywhere yet. Right now it only takes a directory and generates one
sheet for all the images in that directory and its sub-directories. The sheets are
fully-functional textures, and a path -> rect mapping exists, but I haven't added anything
that uses it yet.

This will definitely need some improvements and changes to properly integrate with @jyrkive 's
OGL work.
2018-04-10 03:03:56 +11:00
Charles Dang
3922a48c5c Removed GUI1 formatting deliminator definitions 2018-04-05 12:45:21 +11:00
Charles Dang
23e78abb20 Help: massive refactor and cleanup of the help backend
This basically splits all the stuff in help/help_impl.*pp into multiple files by their
function, and refactors the entire workflow into a proper object-oriented interface in
modern C++.

There are still a features missing (such as hidden section parsing in the manager) that
I'll get back to.

Few incidental changes and fixes:
* Terrain topics now sorted alphabetically.
* Help text now small
* Fixed wrong toggle button id in browser. This is what was making it impossible to expand
  any sections.

The GUI2 help browser is now back in working order, inasmuch as you can view all sections'
and topics' text (save units').
2018-04-03 11:51:57 +11:00
Charles Dang
8d2244628a Updated Visual Studio projectfile readme
[ci skip]
2018-03-28 05:20:19 +11:00
lundberg
d322e1fb97 Suppress VC warning 4706 for campaignd 2018-03-26 10:07:20 -05:00
lundberg
8b7eb536eb Fix missing VC project options
campaignd project did not inherit warning supression for simple_wml from project/solution options.
2018-03-26 00:37:22 -05:00
Charles Dang
c198be1fa8 Removed the SDL_TTF and GUI1 font rendering API and associated functions
This removes all functions related to:
* GUI1 font formatting
* GUI1 font rendering
* Manual text surface size calculations
* The font description interface. While it wasn't exclusive to the TTF rendering system,
  it was unused by Pango/Cairo rendering.

A huge chunk of the help browser code was commented out since we don't have font::line_width anymore.
Likewise, a hack was added to the GUI2 text box since we don't have have get_max_height anymore.

font::is_cjk_char was retained (as well as some related helpers) since they might be useful
later.

I'll leave it to someone else to update the CMake/Scons files to remove TTF as a build
dependency.
2018-03-26 14:08:45 +11:00
Charles Dang
34797ed1a2 Removed or commented out (for reference) all uses of the GUI1 button widget
And removed said widget.
2018-03-26 13:13:17 +11:00
lundberg
a8539cfca0 Fix VC warnings about upstream issues
Disable some warnings pertaining to Boost issues such as name-hides-global.
2018-03-25 20:14:54 -05:00
Jyrki Vesterinen
d4c9db9e35 Visual Studio: increased warning level to /W4 even for release builds
In particular, this enables C4100, the warning for unreferenced function
parameters.

I also fixed some /W4 warnings.
2018-03-24 09:41:28 +02:00
Charles Dang
5ece7ac5b7 Split the rect_of_hexes struct into its own file
And cleaned up it a bit. Made use of std::array and gave it a default ctor using
the values from display::hexes_under_rect.
2018-03-24 13:22:54 +11:00
Charles Dang
239fde451a Removed the old surface drawing queue implementation, except for the layer enum
Kept that since it's still used in some places and is good for reference.
Also removed display::get_screen_surface which was used in said impl.
2018-03-20 22:07:34 +11:00
Charles Dang
28d2be4bec Removed a whole bunch of GUI1 stuff
This almost completely removes GUI1, save for the button widget (will remove once I get
all the Theme handling sorted out) and the editor's own GUI1 widgets.

This includes the GUI1 textbox, scrollbar, scrollarea, and menu widgets, as well as the
dialog_frame and dialog_manager classes. I've also removed floating_textbox. It was only
kept around for reference (it's unused as of the inclusion of the GUI2 command console).

gui::in_dialog has been replaced by GUI2's is_in_dialog directly now that we have no more
GUI1 dialogs.

\o/
2018-03-20 21:07:59 +11:00
Charles Dang
6ea405174e Updated VS projectfile for 5022a38
[ci skip]
2018-03-20 19:34:04 +11:00
Wedge009
899b4b73b2 Update VC project files.
* Switch libeay32 to libcrypto for OpenSSL 1.1.0 update in https://github.com/aquileia/external/
* Added recent source additions not yet present in MSVC projects.
* Miscellaneous minor tidying/sorting in filters and build configurations.

[ci skip]
2018-03-20 15:16:53 +11:00
Charles Dang
075a9bac34 Get the GUI2 in-game UI at least appearing
I decided to go with a modular approach, where both in-game and editor UI dialogs inherit
from a single base class, a pointer of which is owned by the display class. That can be
used for common functionality that needs be shared by all in-game dialogs.

Right now the new UI is just static. It works with most stuff, but not key presses. Working
on that...
2018-03-20 04:47:42 +11:00
lundberg
c187f069e8 Suppress upstream variable-hide-variable errors. 2018-03-19 11:21:37 -05:00
Charles Dang
bb3d5b9a9d Updated VS projectfile for recent changes
[ci skip]
2018-03-19 16:14:40 +11:00
Jyrki Vesterinen
3555b6278c Update Visual Studio project file to VS2015 toolset
I also enabled /DEBUG:FASTLINK and /LTCG:incremental to speed up compile
times. VS2015 introduces support for both switches.
2018-03-18 11:57:14 +02:00