Commit graph

33042 commits

Author SHA1 Message Date
Jyrki Vesterinen
8ab4525034 Texture atlas generation itself 2019-03-31 16:52:23 +03:00
Jyrki Vesterinen
16f20d5286 High-level sprite packing code for the 'pack everything' case 2018-10-13 12:30:57 +03:00
Jyrki Vesterinen
62bbdab065 Low-level sprite packing code 2018-10-11 14:10:32 +03:00
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
c81095ac8b Really fix build 2018-09-29 13:50:41 +03:00
Jyrki Vesterinen
df37b11561 Fix build 2018-09-29 12:09:16 +03:00
Jyrki Vesterinen
6716227279 Thread pool can now receive tasks to do 2018-09-29 11:51:28 +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
6e9576a282 Stop logging GL_VENDOR
I think the log output looks nicer without it in the end.
2018-09-27 20:00:01 +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
jostephd
c55b0c6adb Commandline: Fix documentation of --render-image 2018-09-26 18:16:16 +11:00
josteph
c88a799b90 Help: Hide abilities with empty names.
Fixes empty name abilities in help in Liberty S1.
2018-09-26 18:14:37 +11:00
josteph
4db974431d Unit Display: When the recruiting or recruited units is invisible, don't scroll to it.
When the enemy leader and the unit it recruits are both invisible,
scrolling to them would leak their location to the player.
2018-09-24 20:18:16 +03:00
Jyrki Vesterinen
79206d92d5 Fix: Chance to hit wasn't protected from becoming negative
Manual merge of pull request #3550. Credit to @newfrenchy83.
2018-09-23 16:52:24 +03:00
Jyrki Vesterinen
9536f3825e Fix #3567: error when trying to send an error message to the client
Simple_wml requires double quotes to be duplicated like this.
2018-09-22 12:29:52 +03:00
jostephd
3a3b752881 WML: Support [filter_side] in [item]. (#3533)
* WML: Support [filter_side] in [item].

If [filter_side] is present then "team_name" is ignored.

Fixes #1477.

* WML: Compare [item]team_name to [side]team_name using intersection.

Fixes problems with substrings and when one or the other is a
comma-separated list. See #3533

* WML: Rename [item][filter_side] to [item][filter_team]

* Add changelog entry
2018-09-21 21:11:08 -04:00
josteph
b64f4b42d6 Commandline: --campaign-skip-story skips [message]s during prestart and start events 2018-09-21 12:59:15 +03:00
josteph
1d1d260350 Commandline: Encapsulate skip_story in play_controller 2018-09-21 12:17:59 +03:00
josteph
f7be872da2 Commandline: Add --campaign-skip-story option
Fixes #3472
2018-09-21 12:17:40 +03:00
josteph
9f58a80635 Add const annotation to new function 2018-09-14 22:52:54 +00:00
josteph
d99f5b8a76 Reevaluate [show_if] conditions and delayed variable expansions before displaying objectives at start.
Fixes #3544.
2018-09-14 22:12:49 +00:00
Łukasz Hryniuk
7cf478e8d9 gui2: indicate that unit cannot advance 2018-09-13 18:43:53 +03:00
gfgtdf
d0c0f406f2 fix #3532 : oos error in mp campaigns.
previously it would cause oos when a player that has not yet advanced to
the currrent scenario sends random seed requests.
2018-09-11 20:25:36 +02:00
loonycyborg
0b9565375f Prevent C++ exception from escaping from is_user_banned() 2018-09-11 16:41:38 +03:00
gfgtdf
69cdbe8da7 fix 3541 : crash in lua tstring comparision 2018-09-10 22:10:33 +02:00
gfgtdf
3591e82586 add game_config.combat experience
and make [harm_unit] use these values instead of hardcoded 8*level for
killing and level for combat.
2018-09-10 22:09:50 +02:00
gfgtdf
08b7d1b1ac fix #3396 lua_function= doesn't work in [effect][filter]
unfortunately this adds an annoying const_cast. The old code 'worked around'
this by getting a nonconst reference to the same unit via the unit map,
which i think is not better just hides the issue.
2018-09-10 22:08:27 +02:00
newfrenchy83
7d6e2b2a10 Lua API: implicitly clear animator after playing it (#3536)
This prevents the animator from holding a strong reference to the target unit, which was keeping the unit object alive and thus preventing the unit halo, if any, from disappearing.
2018-09-09 18:47:56 +03:00
Celtic Minstrel
354f24e926 Allow lists in SLF location_id key (closes #3493) 2018-09-08 23:31:02 -04:00
Rikard Falkeborn
cc98bcd9d0 Bugfix generate random map unique names
The used names was never set so the check for duplicated names did not
work. Detected by cppcheck.
2018-09-08 18:25:32 +03:00
Jyrki Vesterinen
9f43c4a10e Fix build
Regression from commit ca6e7aef7d.
2018-09-06 20:15:50 +03:00
gfgtdf
8ed601461e fix #3515 : random start time 2018-09-06 20:15:39 +03:00
Iris Morelle
444d6d63f6 gui2/unit_create: Use unit type ids as filtering criteria as well 2018-09-04 16:45:58 -03:00
gfgtdf
18526e499a fix crash in ai code when a side has multiple leaders
see https://github.com/wesnoth/wesnoth/issues/3240

Just fixing the crash, not sure how the code should behave in this case, it would be nice if someone who knows more about the ai code would either implement that todo or remove the second warning. An alternative fix would be to move the 'calculate_moves' inside the ai_leaders loop.
2018-09-03 22:58:54 +02:00
Iris Morelle
b7c7fca8b1 gui2/unit_create: Allow searching by race name as well 2018-09-01 18:48:29 -03:00
Iris Morelle
26629d4a62 gui2/unit_create: Fix segfault on empty list when updating unit preview
This happens when the list comes up empty because of a non-matching
filter, e.g. "Elvish Archer222" and the user clicks on one of the gender
options in this state.

Ideally we should clear the preview pane and disable the options and OK
button here, but the former appears impossible and for some reason
changing the pane's visibility in filter_text_changed() doesn't work
reliably.
2018-09-01 18:48:27 -03:00
gfgtdf
1ac635ec63 put [resource] before other content; fixes #3345
Now content that is loaded via [load_resource] is placed to the position
where the [load_resource] was. This fixes a problem where previously one could
not use lua variables/functions created by the [resource][lua] because the
engine would put the [lua] tags from the [resource] after the [resource] from the
scenario.
2018-08-30 22:48:19 +02:00
gfgtdf
144e8a1f8d fixup "fix oos when undoing after ally chat"
this also caused errors later when saving replays because the server would concatinate all [turn] leading to dublicate undo=no attributes.
2018-08-30 22:48:18 +02:00
josteph
012142a3c6 Lua Console: Print an error message when not opening the console because :debug hasn't been run. 2018-08-30 14:37:00 -05:00
Gregory A Lundberg
616ae9b472 Fix error: no previous declaration
No used outside the source file, so marked as a static function.
2018-08-28 13:57:47 +03:00
Gregory A Lundberg
3826c263b1 Fix error: missing noexcept
GCC 8.2.0 -Wnoexcept flags two functions which should be marked as not throwing.
2018-08-28 13:57:24 +03:00
jostephd
6f670556a1 Game Load: Show list of enabled modifications (#3495) 2018-08-27 19:46:35 +03:00
Jyrki Vesterinen
328a9c9a83 Another build fix 2018-08-27 11:43:54 +03:00
Jyrki Vesterinen
8f40b51a77 Attempted build fix 2018-08-27 11:21:08 +03:00
jostephd
24cb784d4b Don't scroll to an enemy leader that has an effective [hides] ability (#3492) 2018-08-27 10:35:11 +03:00
josteph
937e971e50 Game Load: Show the user-name difficulty name instead of the internal name.
The internal name (Easy/Medium/Hard/Nightmare) will only be shown if the campaign
is not installed, or doesn't declare the saved difficulty.
2018-08-25 16:58:46 +03:00
gfgtdf
6b58ce7c04 Revert "preserve traslatable strings in simple_wml."
This reverts commit 4f3ce6865c.
This reverts commit 20128ac991.

see issue #3454, there were problems caused by simple_wml when
joining/observing games and this commit is the obvious suspect
so i'm reverting it until we can fix that one.
2018-08-22 15:06:55 +02:00