Merge lp:~widelands-dev/widelands/list-directories-in-cpp into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 9129
Proposed branch: lp:~widelands-dev/widelands/list-directories-in-cpp
Merge into: lp:widelands
Diff against target: 4547 lines (+822/-805)
197 files modified
data/scripting/mapobjects.lua (+8/-55)
data/sound/wl-sound-docu.csv (+39/-38)
data/tribes/atlanteans.lua (+12/-21)
data/tribes/barbarians.lua (+9/-16)
data/tribes/empire.lua (+10/-19)
data/tribes/frisians.lua (+9/-16)
data/tribes/immovables/berry_bushes/blueberry/init.lua (+4/-4)
data/tribes/immovables/berry_bushes/currant_black/init.lua (+4/-4)
data/tribes/immovables/berry_bushes/currant_red/init.lua (+4/-4)
data/tribes/immovables/berry_bushes/desert_hackberry/init.lua (+4/-4)
data/tribes/immovables/berry_bushes/juniper/init.lua (+4/-4)
data/tribes/immovables/berry_bushes/raspberry/init.lua (+4/-4)
data/tribes/immovables/berry_bushes/sea_buckthorn/init.lua (+4/-4)
data/tribes/immovables/berry_bushes/strawberry/init.lua (+4/-4)
data/tribes/ships/atlanteans/init.lua (+1/-1)
data/tribes/ships/barbarians/init.lua (+1/-1)
data/tribes/ships/empire/init.lua (+1/-1)
data/tribes/ships/frisians/init.lua (+1/-1)
data/tribes/workers/atlanteans/armorsmith/init.lua (+2/-2)
data/tribes/workers/atlanteans/baker/init.lua (+2/-2)
data/tribes/workers/atlanteans/blackroot_farmer/init.lua (+2/-2)
data/tribes/workers/atlanteans/builder/init.lua (+2/-2)
data/tribes/workers/atlanteans/carrier/init.lua (+4/-9)
data/tribes/workers/atlanteans/charcoal_burner/init.lua (+2/-2)
data/tribes/workers/atlanteans/farmer/init.lua (+2/-2)
data/tribes/workers/atlanteans/fishbreeder/init.lua (+1/-1)
data/tribes/workers/atlanteans/fisher/init.lua (+2/-2)
data/tribes/workers/atlanteans/forester/init.lua (+2/-2)
data/tribes/workers/atlanteans/geologist/init.lua (+2/-2)
data/tribes/workers/atlanteans/horse/init.lua (+2/-2)
data/tribes/workers/atlanteans/horsebreeder/init.lua (+1/-1)
data/tribes/workers/atlanteans/hunter/init.lua (+2/-2)
data/tribes/workers/atlanteans/miller/init.lua (+2/-2)
data/tribes/workers/atlanteans/miner/init.lua (+2/-2)
data/tribes/workers/atlanteans/recruit/init.lua (+1/-1)
data/tribes/workers/atlanteans/sawyer/init.lua (+2/-2)
data/tribes/workers/atlanteans/scout/init.lua (+1/-1)
data/tribes/workers/atlanteans/shipwright/init.lua (+2/-2)
data/tribes/workers/atlanteans/smelter/init.lua (+2/-2)
data/tribes/workers/atlanteans/smoker/init.lua (+2/-2)
data/tribes/workers/atlanteans/soldier/init.lua (+1/-1)
data/tribes/workers/atlanteans/spiderbreeder/init.lua (+2/-2)
data/tribes/workers/atlanteans/stonecutter/init.lua (+2/-2)
data/tribes/workers/atlanteans/toolsmith/init.lua (+2/-2)
data/tribes/workers/atlanteans/trainer/init.lua (+2/-2)
data/tribes/workers/atlanteans/weaponsmith/init.lua (+2/-2)
data/tribes/workers/atlanteans/weaver/init.lua (+2/-2)
data/tribes/workers/atlanteans/woodcutter/init.lua (+3/-3)
data/tribes/workers/barbarians/baker/init.lua (+2/-2)
data/tribes/workers/barbarians/blacksmith/init.lua (+2/-2)
data/tribes/workers/barbarians/blacksmith_master/init.lua (+2/-2)
data/tribes/workers/barbarians/brewer/init.lua (+2/-2)
data/tribes/workers/barbarians/brewer_master/init.lua (+2/-2)
data/tribes/workers/barbarians/builder/init.lua (+2/-2)
data/tribes/workers/barbarians/carrier/init.lua (+4/-9)
data/tribes/workers/barbarians/cattlebreeder/init.lua (+2/-2)
data/tribes/workers/barbarians/charcoal_burner/init.lua (+2/-2)
data/tribes/workers/barbarians/farmer/init.lua (+2/-2)
data/tribes/workers/barbarians/fisher/init.lua (+2/-2)
data/tribes/workers/barbarians/gamekeeper/init.lua (+2/-2)
data/tribes/workers/barbarians/gardener/init.lua (+2/-2)
data/tribes/workers/barbarians/geologist/init.lua (+2/-2)
data/tribes/workers/barbarians/helmsmith/init.lua (+2/-2)
data/tribes/workers/barbarians/hunter/init.lua (+2/-2)
data/tribes/workers/barbarians/innkeeper/init.lua (+2/-2)
data/tribes/workers/barbarians/lime_burner/init.lua (+2/-2)
data/tribes/workers/barbarians/lumberjack/init.lua (+3/-4)
data/tribes/workers/barbarians/miner/init.lua (+2/-2)
data/tribes/workers/barbarians/miner_chief/init.lua (+2/-2)
data/tribes/workers/barbarians/miner_master/init.lua (+2/-2)
data/tribes/workers/barbarians/ox/init.lua (+2/-2)
data/tribes/workers/barbarians/ranger/init.lua (+2/-2)
data/tribes/workers/barbarians/recruit/init.lua (+1/-1)
data/tribes/workers/barbarians/scout/init.lua (+2/-2)
data/tribes/workers/barbarians/shipwright/init.lua (+2/-2)
data/tribes/workers/barbarians/smelter/init.lua (+2/-2)
data/tribes/workers/barbarians/soldier/init.lua (+1/-1)
data/tribes/workers/barbarians/stonemason/init.lua (+2/-2)
data/tribes/workers/barbarians/trainer/init.lua (+2/-2)
data/tribes/workers/barbarians/weaver/init.lua (+2/-2)
data/tribes/workers/empire/armorsmith/init.lua (+2/-2)
data/tribes/workers/empire/baker/init.lua (+2/-2)
data/tribes/workers/empire/brewer/init.lua (+2/-2)
data/tribes/workers/empire/builder/init.lua (+2/-2)
data/tribes/workers/empire/carpenter/init.lua (+2/-2)
data/tribes/workers/empire/carrier/init.lua (+4/-9)
data/tribes/workers/empire/charcoal_burner/init.lua (+2/-2)
data/tribes/workers/empire/donkey/init.lua (+2/-2)
data/tribes/workers/empire/donkeybreeder/init.lua (+2/-2)
data/tribes/workers/empire/farmer/init.lua (+2/-2)
data/tribes/workers/empire/fisher/init.lua (+2/-2)
data/tribes/workers/empire/forester/init.lua (+2/-2)
data/tribes/workers/empire/geologist/init.lua (+2/-2)
data/tribes/workers/empire/hunter/init.lua (+2/-2)
data/tribes/workers/empire/innkeeper/init.lua (+2/-2)
data/tribes/workers/empire/lumberjack/init.lua (+3/-4)
data/tribes/workers/empire/miller/init.lua (+2/-2)
data/tribes/workers/empire/miner/init.lua (+2/-2)
data/tribes/workers/empire/miner_master/init.lua (+2/-2)
data/tribes/workers/empire/pigbreeder/init.lua (+2/-2)
data/tribes/workers/empire/recruit/init.lua (+1/-1)
data/tribes/workers/empire/scout/init.lua (+2/-2)
data/tribes/workers/empire/shepherd/init.lua (+2/-2)
data/tribes/workers/empire/shipwright/init.lua (+2/-2)
data/tribes/workers/empire/smelter/init.lua (+2/-2)
data/tribes/workers/empire/soldier/init.lua (+1/-1)
data/tribes/workers/empire/stonemason/init.lua (+2/-2)
data/tribes/workers/empire/toolsmith/init.lua (+2/-2)
data/tribes/workers/empire/trainer/init.lua (+2/-2)
data/tribes/workers/empire/vinefarmer/init.lua (+2/-2)
data/tribes/workers/empire/vintner/init.lua (+2/-2)
data/tribes/workers/empire/weaponsmith/init.lua (+2/-2)
data/tribes/workers/empire/weaver/init.lua (+2/-2)
data/tribes/workers/frisians/baker/init.lua (+2/-2)
data/tribes/workers/frisians/baker_master/init.lua (+2/-2)
data/tribes/workers/frisians/beekeeper/init.lua (+2/-2)
data/tribes/workers/frisians/berry_farmer/init.lua (+1/-1)
data/tribes/workers/frisians/blacksmith/init.lua (+2/-2)
data/tribes/workers/frisians/blacksmith_master/init.lua (+2/-2)
data/tribes/workers/frisians/brewer/init.lua (+2/-2)
data/tribes/workers/frisians/brewer_master/init.lua (+2/-2)
data/tribes/workers/frisians/brickmaker/init.lua (+2/-2)
data/tribes/workers/frisians/builder/init.lua (+2/-2)
data/tribes/workers/frisians/carrier/init.lua (+4/-9)
data/tribes/workers/frisians/charcoal_burner/init.lua (+2/-2)
data/tribes/workers/frisians/claydigger/init.lua (+2/-2)
data/tribes/workers/frisians/farmer/init.lua (+2/-2)
data/tribes/workers/frisians/fisher/init.lua (+2/-2)
data/tribes/workers/frisians/forester/init.lua (+1/-1)
data/tribes/workers/frisians/fruit_collector/init.lua (+2/-2)
data/tribes/workers/frisians/geologist/init.lua (+1/-1)
data/tribes/workers/frisians/hunter/init.lua (+2/-2)
data/tribes/workers/frisians/landlady/init.lua (+2/-2)
data/tribes/workers/frisians/miner/init.lua (+2/-2)
data/tribes/workers/frisians/miner_master/init.lua (+2/-2)
data/tribes/workers/frisians/reed_farmer/init.lua (+2/-2)
data/tribes/workers/frisians/reindeer/init.lua (+2/-2)
data/tribes/workers/frisians/reindeer_breeder/init.lua (+2/-2)
data/tribes/workers/frisians/scout/init.lua (+2/-2)
data/tribes/workers/frisians/seamstress/init.lua (+2/-2)
data/tribes/workers/frisians/seamstress_master/init.lua (+2/-2)
data/tribes/workers/frisians/shipwright/init.lua (+2/-2)
data/tribes/workers/frisians/smelter/init.lua (+2/-2)
data/tribes/workers/frisians/smoker/init.lua (+2/-2)
data/tribes/workers/frisians/soldier/init.lua (+4/-4)
data/tribes/workers/frisians/stonemason/init.lua (+2/-2)
data/tribes/workers/frisians/trainer/init.lua (+2/-2)
data/tribes/workers/frisians/woodcutter/init.lua (+4/-2)
data/world/critters/badger/init.lua (+1/-1)
data/world/critters/brownbear/init.lua (+1/-1)
data/world/critters/bunny/init.lua (+1/-1)
data/world/critters/chamois/init.lua (+1/-1)
data/world/critters/deer/init.lua (+1/-1)
data/world/critters/duck/init.lua (+1/-1)
data/world/critters/elk/init.lua (+1/-1)
data/world/critters/fox/init.lua (+1/-1)
data/world/critters/lynx/init.lua (+1/-1)
data/world/critters/marten/init.lua (+1/-1)
data/world/critters/reindeer/init.lua (+1/-1)
data/world/critters/sheep/init.lua (+1/-1)
data/world/critters/stag/init.lua (+1/-1)
data/world/critters/wildboar/init.lua (+1/-1)
data/world/critters/wisent/init.lua (+1/-1)
data/world/critters/wolf/init.lua (+1/-1)
data/world/immovables/grass1/init.lua (+1/-1)
data/world/immovables/grass2/init.lua (+1/-1)
data/world/immovables/grass3/init.lua (+1/-1)
doc/sphinx/source/animations.rst (+30/-59)
src/CMakeLists.txt (+0/-1)
src/game_io/game_loader.cc (+2/-1)
src/graphic/animation.cc (+165/-143)
src/graphic/animation.h (+8/-4)
src/helper.h (+0/-13)
src/io/filesystem/disk_filesystem.cc (+2/-2)
src/io/filesystem/disk_filesystem.h (+2/-2)
src/io/filesystem/filesystem.cc (+81/-0)
src/io/filesystem/filesystem.h (+20/-2)
src/io/filesystem/layered_filesystem.cc (+2/-2)
src/io/filesystem/layered_filesystem.h (+2/-2)
src/io/filesystem/zip_filesystem.cc (+2/-2)
src/io/filesystem/zip_filesystem.h (+2/-2)
src/logic/map_objects/map_object.cc (+47/-18)
src/logic/map_objects/map_object.h (+8/-4)
src/logic/map_objects/tribes/ship.cc (+1/-1)
src/logic/map_objects/tribes/tribe_descr.cc (+6/-4)
src/logic/map_objects/tribes/worker_descr.cc (+3/-3)
src/logic/map_objects/world/critter.cc (+1/-1)
src/map_io/CMakeLists.txt (+0/-1)
src/map_io/map_scripting_packet.cc (+1/-2)
src/scripting/lua_path.cc (+5/-1)
src/sound/fxset.cc (+9/-16)
src/sound/fxset.h (+4/-2)
src/sound/songset.cc (+1/-5)
src/sound/sound_handler.cc (+4/-0)
src/sound/sound_handler.h (+2/-0)
src/wlapplication.cc (+5/-6)
src/wui/load_or_save_game.cc (+2/-3)
To merge this branch: bzr merge lp:~widelands-dev/widelands/list-directories-in-cpp
Reviewer Review Type Date Requested Status
Toni Förster Approve
Review via email: mp+366614@code.launchpad.net

Commit message

Improve performance and memory usage when loading tribes and world
- Save memory and loading time by not listing files via Lua
- Common sequential file loading function for image and sound files
- Replace regular expressions with NumberGlob for speedup
- Only load mipmap scales that are being used
- Preload sound files and animations at default scale for existing
  map objects to prevent dropping FPS at game start

Description of the change

Performance :)

I have only converted the directional animations to the new system - the remaining animations will take care of themselves once we move to Spritemaps. Converting them now would cause a lot of unnecessary extra work.

Some stats:

TRUNK:

┏━ Running Lua for world:
┃ Resources: 58ms
┃ Terrains: 85ms
┃ Immovables: 1157ms
┃ Critters: 709ms
┗━ took: 2009ms
Loading the world took 2050ms
┏━ Running Lua for tribes:
┃ Ships: 280ms
┃ Wares: 871ms
┃ Immovables: 671ms
┃ Workers: 5775ms
┃ Warehouses: 357ms
┃ Productionsites: 3167ms
┃ Trainingsites: 162ms
┃ Militarysites: 318ms
┃ Partially finished buildings: 26ms
┃ Tribe infos: 380ms
┗━ took: 12007ms
Loading the tribes took 12033ms

THIS BRANCH:

┏━ Running Lua for world:
┃ Resources: 1ms
┃ Terrains: 13ms
┃ Immovables: 172ms
┃ Critters: 163ms
┗━ took: 349ms
Loading the world took 360ms
┏━ Running Lua for tribes:
┃ Ships: 70ms
┃ Wares: 65ms
┃ Immovables: 127ms
┃ Workers: 2134ms
┃ Warehouses: 33ms
┃ Productionsites: 384ms
┃ Trainingsites: 35ms
┃ Militarysites: 55ms
┃ Partially finished buildings: 2ms
┃ Tribe infos: 60ms
┗━ took: 2965ms
Loading the tribes took 2966ms

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4826. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/525572046.
Appveyor build 4607. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_list_directories_in_cpp-4607.

Revision history for this message
Toni Förster (stonerl) wrote :

I got ~100 compile warnings:

src/io/filesystem/filesystem.h:150:71: warning: unknown command tag name [-Wdocumentation-unknown-command]
        /// Returns all files in the given 'directory' that match 'basename[_\d{1,3}].extension'
                                                                             ^~

Revision history for this message
GunChleoc (gunchleoc) wrote :

Eek. Should be fixed now.

Revision history for this message
kaputtnik (franku) wrote :

This is a big feature and should be merged soon!

Will do some testing today :-)

Revision history for this message
kaputtnik (franku) wrote :

hm, loading a 8-players save game needs much more time with this branch here. trunk is r9111, both are release builds:

stoppped by hand:
trunk: ~ 11 sec.
this branch: ~ 24 sec.

The main difference when comparing the logs, is this output:

Trunk:
Second and third phase loading Map Objects ... took 34ms

This branch:
Second and third phase loading Map Objects ... ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred took 13645ms

So i am not sure if the alsa-thing is the cause of the difference. This alsa underrun happens each time i load that savegame with this branch, but not when loading it in trunk.

Revision history for this message
kaputtnik (franku) wrote :

When watching the console output, the output stops exactly at that line for a while. It shows the error from alsa-lib and and after some time the timestamp "took: ...ms"

Revision history for this message
Toni Förster (stonerl) wrote :

Same savegame with this branch.

 Second and third phase loading Map Objects ... took 37ms

Not sure what triggers the underrun on your system. The question is, is this caused by changes in this branch OR is this a problem with your system that you never noticed until this branch...

Revision history for this message
kaputtnik (franku) wrote :

I get this on a slow laptop, so maybe this machine dependent. Just curious that i didn't get this with trunk.

Toni, can you compare loading the save game with trunk, so we can see if this is really 10 sec. faster? Comparing the time for the editor would also be nice.

Anyway i noticed no other issues with this branch :-) So please can someone make a code review?

Revision history for this message
GunChleoc (gunchleoc) wrote :

I now pre-loading the sounds for the existing Map Objects. I don't do that in trunk, and I get a lot of stutter there at game start instead.

Do you also get the ALSA problem with Build 20?

Revision history for this message
GunChleoc (gunchleoc) wrote :

I don't get the ALSA error, looks like your sound driver doesn't like one of the files.

Revision history for this message
kaputtnik (franku) wrote :

with build20 i get the alsa error much earlier, when loading immovables:

┃ Immovables: 859ms
ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred

I had to create a new save game though, because the attached one is incompatible. Not sure if all buildings were erected at this time. And i have the feeling the game starts much faster than with this branch.

With current trunk i get never the alsa error, so my sound driver seems to work fine with all of the files.

Maybe related: https://stackoverflow.com/questions/14601666/alsa-ways-to-prevent-underrun-for-speaker

Revision history for this message
GunChleoc (gunchleoc) wrote :

I have added some debug log output to this branch so that we can find out which file is causing the problem for you. You should see something like this with your savegame:

Second and third phase loading Map Objects ... NOCOM loading sound effect: sound/animals//frog.ogg
NOCOM loading sound effect: world/critters/duck//duck_00.ogg
NOCOM loading sound effect: world/critters/duck//duck_01.ogg
NOCOM loading sound effect: world/critters/duck//duck_02.ogg
NOCOM loading sound effect: sound/animals//coyote_00.ogg
NOCOM loading sound effect: sound/animals//coyote_01.ogg
NOCOM loading sound effect: sound/farm//sheep_00.ogg
NOCOM loading sound effect: sound/farm//sheep_01.ogg
NOCOM loading sound effect: sound/farm//sheep_02.ogg
NOCOM loading sound effect: sound/hammering//hammering_00.ogg
NOCOM loading sound effect: sound/hammering//hammering_01.ogg
NOCOM loading sound effect: sound/hammering//hammering_02.ogg
NOCOM loading sound effect: sound/animals//bird5_00.ogg
NOCOM loading sound effect: sound/animals//bird5_01.ogg
NOCOM loading sound effect: sound/animals//bird5_02.ogg
NOCOM loading sound effect: sound/animals//bird4_00.ogg
NOCOM loading sound effect: sound/animals//bird4_01.ogg
NOCOM loading sound effect: sound/animals//bird4_02.ogg
NOCOM loading sound effect: sound/animals//bird6_00.ogg
NOCOM loading sound effect: sound/animals//bird6_01.ogg
NOCOM loading sound effect: sound/animals//bird3_00.ogg
NOCOM loading sound effect: sound/animals//bird3_01.ogg
NOCOM loading sound effect: sound/animals//bird3_02.ogg
NOCOM loading sound effect: sound/animals//bird3_03.ogg
NOCOM loading sound effect: sound/animals//boar.ogg
took 14653ms

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5022. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/534690803.
Appveyor build 4802. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_list_directories_in_cpp-4802.

Revision history for this message
kaputtnik (franku) wrote :

hm, there is now a text conflict shown...

Text conflict in data/tribes/workers/frisians/soldier/init.lua

Revision history for this message
kaputtnik (franku) wrote :

I am on my fast(er) machine now, but here there is no also error. But after the output of

NOCOM loading sound effect: sound/hammering//hammering_02.ogg

the output stops for a while. On each load of the save game the stop-time is different, one time the stop lasts longer, the other time it lasts shorter (but noticeable).

Revision history for this message
Toni Förster (stonerl) wrote :

The merge conflict needs fixing. Also this is not part of this branch but maybe can be foxed here.

Game: Reading Map Data ... Game: Reading Map Data took 7ms
Game: Reading Player Info ... ┏━ Running Lua for world:

Here are newlines missing.

Besides that it sped up the loading for me.

review: Needs Fixing
Revision history for this message
GunChleoc (gunchleoc) wrote :

> the output stops for a while. On each load of the save game the stop-time is different, one time the stop lasts longer, the other time it lasts shorter (but noticeable).

It stops because Widelands is loading more stuff for starting the game that isn't producing log outputs. This has nothing to do with this branch.

The ALSA error also has nothing to do with Widelands code, but we could try reencoding the affected sound file(s). I have removed the extra log output from this branch though, so this needs to be tested and fixed in a separate branch by somebody who can reproduce it. I have opened a new bug report for this:

https://bugs.launchpad.net/widelands/+bug/1830467

> The merge conflict needs fixing.

Of course it does - done :)

> Also this is not part of this branch but maybe can be foxed here.

Done.

Revision history for this message
Toni Förster (stonerl) wrote :

LGTM :)

review: Approve
Revision history for this message
GunChleoc (gunchleoc) wrote :

Thanks a lot for the review and testing :)

@bunnybot merge

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5043. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/537115107.
Appveyor build 4823. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_list_directories_in_cpp-4823.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Refusing to merge, since Travis is not green. Use @bunnybot merge force for merging anyways.

Travis build 5043. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/537115107.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5056. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/537329131.
Appveyor build 4836. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_list_directories_in_cpp-4836.

Revision history for this message
GunChleoc (gunchleoc) wrote :

@bunnybot merge

Revision history for this message
bunnybot (widelandsofficial) wrote :
Download full text (15.7 KiB)

Error merging this proposal:

Output:
stdout:

stderr:
R data/music/intro_00.ogg => data/music/intro.ogg
R data/music/menu_00.ogg => data/music/menu.ogg
 M data/scripting/mapobjects.lua
R data/sound/animals/boar_01.ogg => data/sound/animals/boar.ogg
R data/sound/animals/coyote_01.ogg => data/sound/animals/coyote_00.ogg
R data/sound/animals/coyote_02.ogg => data/sound/animals/coyote_01.ogg
R data/sound/animals/crickets1_01.ogg => data/sound/animals/crickets1_00.ogg
R data/sound/animals/crickets2_01.ogg => data/sound/animals/crickets2_00.ogg
R data/sound/animals/elk_01.ogg => data/sound/animals/elk_00.ogg
R data/sound/animals/elk_02.ogg => data/sound/animals/elk_01.ogg
R data/sound/animals/elk_10.ogg => data/sound/animals/elk_02.ogg
R data/sound/animals/elk_11.ogg => data/sound/animals/elk_03.ogg
R data/sound/animals/frog1_00.ogg => data/sound/animals/frog.ogg
R data/sound/animals/stag_01.ogg => data/sound/animals/stag_00.ogg
R data/sound/animals/stag_02.ogg => data/sound/animals/stag_01.ogg
R data/sound/animals/stag_10.ogg => data/sound/animals/stag_02.ogg
R data/sound/animals/stag_11.ogg => data/sound/animals/stag_03.ogg
R data/sound/animals/stag_12.ogg => data/sound/animals/stag_04.ogg
R data/sound/animals/stag_13.ogg => data/sound/animals/stag_05.ogg
R data/sound/animals/wolf_01.ogg => data/sound/animals/wolf_00.ogg
R data/sound/animals/wolf_02.ogg => data/sound/animals/wolf_01.ogg
R data/sound/animals/wolf_03.ogg => data/sound/animals/wolf_02.ogg
R data/sound/animals/wolf_10.ogg => data/sound/animals/wolf_03.ogg
R data/sound/animals/wolf_11.ogg => data/sound/animals/wolf_04.ogg
R data/sound/animals/wolf_12.ogg => data/sound/animals/wolf_05.ogg
R data/sound/animals/wolf_13.ogg => data/sound/animals/wolf_06.ogg
R data/sound/animals/wolf_14.ogg => data/sound/animals/wolf_07.ogg
R data/sound/atlanteans/cutting/stonecutter_01.ogg => data/sound/atlanteans/cutting/stonecutter_00.ogg
R data/sound/atlanteans/cutting/stonecutter_02.ogg => data/sound/atlanteans/cutting/stonecutter_01.ogg
R data/sound/atlanteans/cutting/stonecutter_03.ogg => data/sound/atlanteans/cutting/stonecutter_02.ogg
R data/sound/atlanteans/goldspin_01.ogg => data/sound/atlanteans/goldspin_00.ogg
R data/sound/atlanteans/goldspin_02.ogg => data/sound/atlanteans/goldspin_01.ogg
R data/sound/atlanteans/saw/benchsaw_01.ogg => data/sound/atlanteans/saw/benchsaw_00.ogg
R data/sound/atlanteans/saw/benchsaw_02.ogg => data/sound/atlanteans/saw/benchsaw_01.ogg
R data/sound/atlanteans/saw/benchsaw_03.ogg => data/sound/atlanteans/saw/benchsaw_02.ogg
R data/sound/atlanteans/saw/sawing_01.ogg => data/sound/atlanteans/saw/sawing_00.ogg
R data/sound/atlanteans/saw/sawing_02.ogg => data/sound/atlanteans/saw/sawing_01.ogg
R data/sound/atlanteans/saw/sawing_03.ogg => data/sound/atlanteans/saw/sawing_02.ogg
R data/sound/barbarians/blackwood_01.ogg => data/sound/barbarians/blackwood.ogg
R data/sound/barbarians/mortar_01.ogg => data/sound/barbarians/mortar.ogg
R data/sound/barbarians/stonegrind_01.ogg => data/sound/barbarians/stonegrind.ogg
R data/sound/barbarians/taverns/biginn_01.ogg => data/sound/barbarians/taverns/...

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5072. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/537848543.
Appveyor build 4852. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_list_directories_in_cpp-4852.

Revision history for this message
GunChleoc (gunchleoc) wrote :

@bunnybot merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file 'data/music/intro_00.ogg' => 'data/music/intro.ogg'
2=== renamed file 'data/music/menu_00.ogg' => 'data/music/menu.ogg'
3=== modified file 'data/scripting/mapobjects.lua'
4--- data/scripting/mapobjects.lua 2019-04-24 20:48:37 +0000
5+++ data/scripting/mapobjects.lua 2019-05-27 14:29:35 +0000
6@@ -21,25 +21,6 @@
7 print(("%s: %dms"):format(preamble, ticks() - start))
8 end
9
10-
11--- Helper function for finding animation files with varying numbering length
12-function get_animation_files(prefix)
13- local animation_files = path.list_files(prefix .. "_??.png")
14- if #animation_files < 1 then
15- animation_files = path.list_files(prefix .. "_???.png")
16- end
17- if #animation_files < 1 then
18- animation_files = path.list_files(prefix .. "_?.png")
19- end
20- return animation_files
21-end
22-
23-
24--- The mipmap scales supported by the engine.
25--- Ensure that this always matches kSupportedScales in animations.cc
26-local supported_scales = { 0.5, 1, 2, 4 }
27-
28-
29 -- RST
30 -- .. function:: add_animation(animationtable, animationname, dirname, basename, hotspot [, fps])
31 --
32@@ -55,8 +36,8 @@
33 -- :arg dirname: The name of the directory where the animation image files are located.
34 -- :type dirname: :class:`string`
35 -- :arg basename: The basename of the animation files. The filenames of the
36--- animation files need to have the format ``<basename>_\d{2,3}.png`` for simple
37--- file animations, and ``<basename>_<scale>_\d{2,3}.png`` for mipmaps.
38+-- animation files need to have the format ``<basename>_[_\d+].png`` for simple
39+-- file animations, and ``<basename>_<scale>[_\d+].png`` for mipmaps.
40 -- Supported scales are ``0.5``, ``1``, ``2`` and ``4``.
41 -- :type basename: :class:`string`
42 -- :arg hotspot: The hotspot coordinates for blitting, e.g. ``{2, 20}``.
43@@ -65,30 +46,9 @@
44 -- 1 frame, and if you need to deviate from the default frame rate.
45 -- :type fps: :class:`integer`
46 function add_animation(animationtable, animationname, dirname, basename, hotspot, fps)
47- mipmap = {}
48- for scale_idx, current_scale in ipairs(supported_scales) do
49- local listed_files = get_animation_files(dirname .. basename .. "_" .. current_scale)
50- if #listed_files > 0 then
51- table.insert(
52- mipmap,
53- {
54- scale = current_scale,
55- files = listed_files,
56- }
57- )
58- end
59- end
60- if #mipmap < 1 then
61- table.insert(
62- mipmap,
63- {
64- scale = 1,
65- files = get_animation_files(dirname .. basename),
66- }
67- )
68- end
69 animationtable[animationname] = {
70- mipmap = mipmap,
71+ directory = dirname,
72+ basename = basename,
73 hotspot = hotspot,
74 }
75 if (fps ~= nil) then
76@@ -96,10 +56,8 @@
77 end
78 end
79
80-
81-
82 -- RST
83--- .. function:: add_walking_animations(animationtable, animationname, dirname, basename, hotspot [, fps])
84+-- .. function:: add_directional_animation(animationtable, animationname, dirname, basename, hotspot [, fps])
85 --
86 -- Adds 6 walk or sail animations - one for each walking direction - to `animationtable`.
87 -- Supports both simple animations and mipmaps.
88@@ -123,12 +81,7 @@
89 -- :arg fps: Frames per second. Only use this if the animation has more than
90 -- 1 frame, and if you need to deviate from the default frame rate.
91 -- :type fps: :class:`integer`
92-function add_walking_animations(animationtable, animationname, dirname, basename, hotspot, fps)
93- for idx, dir in ipairs{ "ne", "e", "se", "sw", "w", "nw" } do
94- if fps ~= nil then
95- add_animation(animationtable, animationname .. "_" .. dir, dirname, basename .. "_" .. dir, hotspot, fps)
96- else
97- add_animation(animationtable, animationname .. "_" .. dir, dirname, basename .. "_" .. dir, hotspot)
98- end
99- end
100+function add_directional_animation(animationtable, animationname, dirname, basename, hotspot, fps)
101+ add_animation(animationtable, animationname, dirname, basename, hotspot, fps)
102+ animationtable[animationname]["directional"] = true
103 end
104
105=== renamed file 'data/sound/animals/boar_01.ogg' => 'data/sound/animals/boar.ogg'
106=== renamed file 'data/sound/animals/coyote_01.ogg' => 'data/sound/animals/coyote_00.ogg'
107=== renamed file 'data/sound/animals/coyote_02.ogg' => 'data/sound/animals/coyote_01.ogg'
108=== renamed file 'data/sound/animals/crickets1_01.ogg' => 'data/sound/animals/crickets1_00.ogg'
109=== renamed file 'data/sound/animals/crickets2_01.ogg' => 'data/sound/animals/crickets2_00.ogg'
110=== renamed file 'data/sound/animals/elk_01.ogg' => 'data/sound/animals/elk_00.ogg'
111=== renamed file 'data/sound/animals/elk_02.ogg' => 'data/sound/animals/elk_01.ogg'
112=== renamed file 'data/sound/animals/elk_10.ogg' => 'data/sound/animals/elk_02.ogg'
113=== renamed file 'data/sound/animals/elk_11.ogg' => 'data/sound/animals/elk_03.ogg'
114=== renamed file 'data/sound/animals/frog1_00.ogg' => 'data/sound/animals/frog.ogg'
115=== renamed file 'data/sound/animals/stag_01.ogg' => 'data/sound/animals/stag_00.ogg'
116=== renamed file 'data/sound/animals/stag_02.ogg' => 'data/sound/animals/stag_01.ogg'
117=== renamed file 'data/sound/animals/stag_10.ogg' => 'data/sound/animals/stag_02.ogg'
118=== renamed file 'data/sound/animals/stag_11.ogg' => 'data/sound/animals/stag_03.ogg'
119=== renamed file 'data/sound/animals/stag_12.ogg' => 'data/sound/animals/stag_04.ogg'
120=== renamed file 'data/sound/animals/stag_13.ogg' => 'data/sound/animals/stag_05.ogg'
121=== renamed file 'data/sound/animals/wolf_01.ogg' => 'data/sound/animals/wolf_00.ogg'
122=== renamed file 'data/sound/animals/wolf_02.ogg' => 'data/sound/animals/wolf_01.ogg'
123=== renamed file 'data/sound/animals/wolf_03.ogg' => 'data/sound/animals/wolf_02.ogg'
124=== renamed file 'data/sound/animals/wolf_10.ogg' => 'data/sound/animals/wolf_03.ogg'
125=== renamed file 'data/sound/animals/wolf_11.ogg' => 'data/sound/animals/wolf_04.ogg'
126=== renamed file 'data/sound/animals/wolf_12.ogg' => 'data/sound/animals/wolf_05.ogg'
127=== renamed file 'data/sound/animals/wolf_13.ogg' => 'data/sound/animals/wolf_06.ogg'
128=== renamed file 'data/sound/animals/wolf_14.ogg' => 'data/sound/animals/wolf_07.ogg'
129=== renamed file 'data/sound/atlanteans/cutting/stonecutter_01.ogg' => 'data/sound/atlanteans/cutting/stonecutter_00.ogg'
130=== renamed file 'data/sound/atlanteans/cutting/stonecutter_02.ogg' => 'data/sound/atlanteans/cutting/stonecutter_01.ogg'
131=== renamed file 'data/sound/atlanteans/cutting/stonecutter_03.ogg' => 'data/sound/atlanteans/cutting/stonecutter_02.ogg'
132=== renamed file 'data/sound/atlanteans/goldspin_01.ogg' => 'data/sound/atlanteans/goldspin_00.ogg'
133=== renamed file 'data/sound/atlanteans/goldspin_02.ogg' => 'data/sound/atlanteans/goldspin_01.ogg'
134=== renamed file 'data/sound/atlanteans/saw/benchsaw_01.ogg' => 'data/sound/atlanteans/saw/benchsaw_00.ogg'
135=== renamed file 'data/sound/atlanteans/saw/benchsaw_02.ogg' => 'data/sound/atlanteans/saw/benchsaw_01.ogg'
136=== renamed file 'data/sound/atlanteans/saw/benchsaw_03.ogg' => 'data/sound/atlanteans/saw/benchsaw_02.ogg'
137=== renamed file 'data/sound/atlanteans/saw/sawing_01.ogg' => 'data/sound/atlanteans/saw/sawing_00.ogg'
138=== renamed file 'data/sound/atlanteans/saw/sawing_02.ogg' => 'data/sound/atlanteans/saw/sawing_01.ogg'
139=== renamed file 'data/sound/atlanteans/saw/sawing_03.ogg' => 'data/sound/atlanteans/saw/sawing_02.ogg'
140=== renamed file 'data/sound/barbarians/blackwood_01.ogg' => 'data/sound/barbarians/blackwood.ogg'
141=== renamed file 'data/sound/barbarians/mortar_01.ogg' => 'data/sound/barbarians/mortar.ogg'
142=== renamed file 'data/sound/barbarians/stonegrind_01.ogg' => 'data/sound/barbarians/stonegrind.ogg'
143=== renamed file 'data/sound/barbarians/taverns/biginn_01.ogg' => 'data/sound/barbarians/taverns/biginn_00.ogg'
144=== renamed file 'data/sound/barbarians/taverns/biginn_02.ogg' => 'data/sound/barbarians/taverns/biginn_01.ogg'
145=== removed file 'data/sound/barbarians/taverns/biginn_10.ogg'
146Binary files data/sound/barbarians/taverns/biginn_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/barbarians/taverns/biginn_10.ogg 1970-01-01 00:00:00 +0000 differ
147=== renamed file 'data/sound/barbarians/taverns/inn_01.ogg' => 'data/sound/barbarians/taverns/inn_00.ogg'
148=== renamed file 'data/sound/barbarians/taverns/inn_02.ogg' => 'data/sound/barbarians/taverns/inn_01.ogg'
149=== removed file 'data/sound/barbarians/taverns/inn_10.ogg'
150Binary files data/sound/barbarians/taverns/inn_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/barbarians/taverns/inn_10.ogg 1970-01-01 00:00:00 +0000 differ
151=== renamed file 'data/sound/barbarians/taverns/tavern_01.ogg' => 'data/sound/barbarians/taverns/tavern_00.ogg'
152=== renamed file 'data/sound/barbarians/taverns/tavern_02.ogg' => 'data/sound/barbarians/taverns/tavern_01.ogg'
153=== removed file 'data/sound/barbarians/taverns/tavern_10.ogg'
154Binary files data/sound/barbarians/taverns/tavern_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/barbarians/taverns/tavern_10.ogg 1970-01-01 00:00:00 +0000 differ
155=== renamed file 'data/sound/barbarians/weaver_01.ogg' => 'data/sound/barbarians/weaver.ogg'
156=== renamed file 'data/sound/click_00.ogg' => 'data/sound/click.ogg'
157=== renamed file 'data/sound/create_construction_site_00.ogg' => 'data/sound/create_construction_site.ogg'
158=== renamed file 'data/sound/empire/beerbubble_01.ogg' => 'data/sound/empire/beerbubble_00.ogg'
159=== renamed file 'data/sound/empire/beerbubble_02.ogg' => 'data/sound/empire/beerbubble_01.ogg'
160=== renamed file 'data/sound/empire/taverns/meal_01.ogg' => 'data/sound/empire/taverns/meal_00.ogg'
161=== renamed file 'data/sound/empire/taverns/meal_02.ogg' => 'data/sound/empire/taverns/meal_01.ogg'
162=== removed file 'data/sound/empire/taverns/meal_10.ogg'
163Binary files data/sound/empire/taverns/meal_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/empire/taverns/meal_10.ogg 1970-01-01 00:00:00 +0000 differ
164=== renamed file 'data/sound/empire/taverns/ration_01.ogg' => 'data/sound/empire/taverns/ration_00.ogg'
165=== renamed file 'data/sound/empire/taverns/ration_02.ogg' => 'data/sound/empire/taverns/ration_01.ogg'
166=== removed file 'data/sound/empire/taverns/ration_10.ogg'
167Binary files data/sound/empire/taverns/ration_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/empire/taverns/ration_10.ogg 1970-01-01 00:00:00 +0000 differ
168=== renamed file 'data/sound/empire/winebubble_01.ogg' => 'data/sound/empire/winebubble_00.ogg'
169=== renamed file 'data/sound/empire/winebubble_02.ogg' => 'data/sound/empire/winebubble_01.ogg'
170=== renamed file 'data/sound/farm/donkey_00.ogg' => 'data/sound/farm/donkey.ogg'
171=== renamed file 'data/sound/farm/sheep_01.ogg' => 'data/sound/farm/sheep_00.ogg'
172=== renamed file 'data/sound/farm/sheep_02.ogg' => 'data/sound/farm/sheep_01.ogg'
173=== renamed file 'data/sound/farm/sheep_03.ogg' => 'data/sound/farm/sheep_02.ogg'
174=== renamed file 'data/sound/fisher/fisher_pull_net_00.ogg' => 'data/sound/fisher/fisher_pull_net.ogg'
175=== renamed file 'data/sound/fisher/fisher_throw_net_00.ogg' => 'data/sound/fisher/fisher_throw_net.ogg'
176=== renamed file 'data/sound/hammering/geologist_hammer_00.ogg' => 'data/sound/hammering/geologist_hammer.ogg'
177=== renamed file 'data/sound/lobby_chat_00.ogg' => 'data/sound/lobby_chat.ogg'
178=== renamed file 'data/sound/lobby_freshmen_00.ogg' => 'data/sound/lobby_freshmen.ogg'
179=== renamed file 'data/sound/metal/fizzle_01.ogg' => 'data/sound/metal/fizzle.ogg'
180=== renamed file 'data/sound/metal/furnace_01.ogg' => 'data/sound/metal/furnace.ogg'
181=== renamed file 'data/sound/metal/goldping_01.ogg' => 'data/sound/metal/goldping.ogg'
182=== renamed file 'data/sound/metal/ironping_01.ogg' => 'data/sound/metal/ironping.ogg'
183=== renamed file 'data/sound/military/site_occupied_00.ogg' => 'data/sound/military/site_occupied.ogg'
184=== renamed file 'data/sound/military/under_attack_00.ogg' => 'data/sound/military/under_attack.ogg'
185=== renamed file 'data/sound/mill/weaving_01.ogg' => 'data/sound/mill/weaving.ogg'
186=== renamed file 'data/sound/smiths/sharpening_00.ogg' => 'data/sound/smiths/sharpening.ogg'
187=== removed directory 'data/sound/spoken'
188=== removed file 'data/sound/spoken/timber_00.ogg'
189Binary files data/sound/spoken/timber_00.ogg 2008-10-19 07:47:24 +0000 and data/sound/spoken/timber_00.ogg 1970-01-01 00:00:00 +0000 differ
190=== removed file 'data/sound/spoken/timber_01.ogg'
191Binary files data/sound/spoken/timber_01.ogg 2008-10-19 07:47:24 +0000 and data/sound/spoken/timber_01.ogg 1970-01-01 00:00:00 +0000 differ
192=== renamed file 'data/sound/stonecutting/stonecutter_00.ogg' => 'data/sound/stonecutting/stonecutter.ogg'
193=== renamed file 'data/sound/stonecutting/stonemason_00.ogg' => 'data/sound/stonecutting/stonemason.ogg'
194=== modified file 'data/sound/wl-sound-docu.csv'
195--- data/sound/wl-sound-docu.csv 2017-02-09 13:11:36 +0000
196+++ data/sound/wl-sound-docu.csv 2019-05-27 14:29:35 +0000
197@@ -1,53 +1,54 @@
198 Widelands Sound Documentation (toptopple’s sounds added since BZR 8019),,,,,,,,,,
199+There are some empty sounds to reduce the probability value of playing them below 1. You can recognize them by the file size of 3.6kB.,,,,,,,,,,
200 ,,,,,,,,,,
201 File Name,Format,Location,Usage,Author,License,reworked,Original File Name,Source,Orig. Format,BZR
202 ,,,,,,,,,,
203+beerbubble_00.ogg,11025 – 16,sound/empire,empire.brewery,Julian Evans,CC-0,yes,338107__mentalsanityoff__beer-fermenter-gurgling-liquid-bubbles-glug.wav,http://www.freesound.org/people/MentalSanityOff/sounds/338107/,48000 – 24,8022
204 beerbubble_01.ogg,11025 – 16,sound/empire,empire.brewery,Julian Evans,CC-0,yes,338107__mentalsanityoff__beer-fermenter-gurgling-liquid-bubbles-glug.wav,http://www.freesound.org/people/MentalSanityOff/sounds/338107/,48000 – 24,8022
205-beerbubble_02.ogg,11025 – 16,sound/empire,empire.brewery,Julian Evans,CC-0,yes,338107__mentalsanityoff__beer-fermenter-gurgling-liquid-bubbles-glug.wav,http://www.freesound.org/people/MentalSanityOff/sounds/338107/,48000 – 24,8022
206+winebubble_00.ogg,22050 – 16,sound/empire,empire.winery,Michael Hinze,CC-0,yes,275578__hinzebeat__big-bubbles-on-water.wav,http://www.freesound.org/people/hinzebeat/sounds/275578/,44100 – 16,8022
207 winebubble_01.ogg,22050 – 16,sound/empire,empire.winery,Michael Hinze,CC-0,yes,275578__hinzebeat__big-bubbles-on-water.wav,http://www.freesound.org/people/hinzebeat/sounds/275578/,44100 – 16,8022
208-winebubble_02.ogg,22050 – 16,sound/empire,empire.winery,Michael Hinze,CC-0,yes,275578__hinzebeat__big-bubbles-on-water.wav,http://www.freesound.org/people/hinzebeat/sounds/275578/,44100 – 16,8022
209-fizzle_01.ogg,11025 – 16,sound/metal,empire.smelting_works,luffy,CC-3,yes,17299__luffy__luffy-fire3alternate.wav,http://www.freesound.org/people/luffy/sounds/17299/,44100 – 16,8022
210-ironping_01.ogg,22050 – 16,sound/metal,empire.smelting_works,timgormly,CC-3,yes,170964__timgormly__metal-ping1.aiff,http://www.freesound.org/people/timgormly/sounds/170964/,44100 – 16,8022
211-goldping_01.ogg,22050 – 16,sound/metal,empire.smelting_works,timgormly,CC-3,yes,170964__timgormly__metal-ping1.aiff,http://www.freesound.org/people/timgormly/sounds/170964/,44100 – 16,8022
212-furnace_01.ogg,11025 – 16,sound/metal,barbarian.smelting_works,UNKNOWN,,yes,Fire-8.wav,UNKNOWN,22050,8022
213-blackwood_01.ogg,11025 – 16,sound/barbarians,barbarian.wood_hardener,UNKNOWN,,,Creek-1.wav,UNKNOWN,11025-32,8029
214-mortar_01.ogg,11025 – 16,sound/barbarians,barbarian.limekiln,qubodup,CC-0,yes,184383__qubodup__gathering-stone-resources.flac,http://www.freesound.org/people/qubodup/sounds/184383/,48000 – 16,8029
215-stonegrind_01.ogg,22050 – 16,sound/barbarians,barbarian.limekiln,timgormly,CC-3,yes,232102__thalamus-lab__stone-grind.wav,http://www.freesound.org/people/Thalamus_Lab/sounds/232102/,44100 – 32,8029
216-tavern_01.ogg,11025 – 16,sound/barbarians/taverns,,UNKNOWN,,,Dishes-21.wav,UNKNOWN,11025,8029
217-tavern_02.ogg,16000,sound/barbarians/taverns,,UNKNOWN,,,Dishes-1.wav,UNKNOWN,22050,8029
218-inn_01.ogg,22050 – 16,sound/barbarians/taverns,barbarian.inn,Eelke Dekker,CC-3,yes,192099__eelke__preparing-dishes.wav,http://www.freesound.org/people/Eelke/sounds/192099/,44100 – 32,8145
219-inn_02.ogg,22050 – 16,sound/barbarians/taverns,barbarian.inn,Hannebu,CC-0,yes,194806__hannebu__frying.wav,http://www.freesound.org/people/Hannebu/sounds/194806/,48000 – 24,8145
220-biginn_01.ogg,22050 – 16,sound/barbarians/taverns,barbarian.biginn,Eelke Dekker,CC-3,yes,192099__eelke__preparing-dishes.wav,http://www.freesound.org/people/Eelke/sounds/192099/,44100 – 32,8145
221-biginn_02.ogg,11025 – 16,sound/barbarians/taverns,barbarian.biginn,Mike Koenig,CC-3,yes,Glass Cookie Jar-SoundBible.com-2105585386.wav,http://soundbible.com/314-Glass-Cookie-Jar.html,32000 – 32,8145
222-meal_01.ogg,,sound/empire/taverns,empire.biginn,DUPLICATE to inn_01.ogg,,,,,,8145
223-meal_02.ogg,22050 – 16,sound/empire/taverns,empire.biginn,UNKNOWN,,,Bottle-2.wav,UNKNOWN,22050 – 32,8145
224-ration_01.ogg,,sound/empire/taverns,empire.inn,DUPLICATE to tavern_02.ogg,,,,,,8145
225-ration_02.ogg,,sound/empire/taverns,empire.inn,DUPLICATE to tavern_01.ogg,,,,,,8145
226-weaving_01.ogg,22050 – 32,sound/mill,"empire.weavingmill, atlanteans.weavingmill",Xavier Serra,CC-3,yes,320510__xserra__kerala-1.wav,http://www.freesound.org/people/xserra/sounds/320510/,44100 – 16,8251
227-weaver_01.ogg,22050 – 32,sound/barbarians,barbarian.weavingmill,Yle Arkisto,CC-3,yes,368577__ylearkisto__kangaspuut-old-wooden-loom-from-1857-weaving-a-rag-rug.wav,http://www.freesound.org/people/YleArkisto/sounds/368577/,44100 – 24,8251
228+fizzle.ogg,11025 – 16,sound/metal,empire.smelting_works,luffy,CC-3,yes,17299__luffy__luffy-fire3alternate.wav,http://www.freesound.org/people/luffy/sounds/17299/,44100 – 16,8022
229+ironping.ogg,22050 – 16,sound/metal,empire.smelting_works,timgormly,CC-3,yes,170964__timgormly__metal-ping1.aiff,http://www.freesound.org/people/timgormly/sounds/170964/,44100 – 16,8022
230+goldping.ogg,22050 – 16,sound/metal,empire.smelting_works,timgormly,CC-3,yes,170964__timgormly__metal-ping1.aiff,http://www.freesound.org/people/timgormly/sounds/170964/,44100 – 16,8022
231+furnace.ogg,11025 – 16,sound/metal,barbarian.smelting_works,UNKNOWN,,yes,Fire-8.wav,UNKNOWN,22050,8022
232+blackwood.ogg,11025 – 16,sound/barbarians,barbarian.wood_hardener,UNKNOWN,,,Creek-1.wav,UNKNOWN,11025-32,8029
233+mortar.ogg,11025 – 16,sound/barbarians,barbarian.limekiln,qubodup,CC-0,yes,184383__qubodup__gathering-stone-resources.flac,http://www.freesound.org/people/qubodup/sounds/184383/,48000 – 16,8029
234+stonegrind.ogg,22050 – 16,sound/barbarians,barbarian.limekiln,timgormly,CC-3,yes,232102__thalamus-lab__stone-grind.wav,http://www.freesound.org/people/Thalamus_Lab/sounds/232102/,44100 – 32,8029
235+tavern_00.ogg,11025 – 16,sound/barbarians/taverns,,UNKNOWN,,,Dishes-21.wav,UNKNOWN,11025,8029
236+tavern_01.ogg,16000,sound/barbarians/taverns,,UNKNOWN,,,Dishes-1.wav,UNKNOWN,22050,8029
237+inn_00.ogg,22050 – 16,sound/barbarians/taverns,barbarian.inn,Eelke Dekker,CC-3,yes,192099__eelke__preparing-dishes.wav,http://www.freesound.org/people/Eelke/sounds/192099/,44100 – 32,8145
238+inn_01.ogg,22050 – 16,sound/barbarians/taverns,barbarian.inn,Hannebu,CC-0,yes,194806__hannebu__frying.wav,http://www.freesound.org/people/Hannebu/sounds/194806/,48000 – 24,8145
239+biginn_00.ogg,22050 – 16,sound/barbarians/taverns,barbarian.biginn,Eelke Dekker,CC-3,yes,192099__eelke__preparing-dishes.wav,http://www.freesound.org/people/Eelke/sounds/192099/,44100 – 32,8145
240+biginn_01.ogg,11025 – 16,sound/barbarians/taverns,barbarian.biginn,Mike Koenig,CC-3,yes,Glass Cookie Jar-SoundBible.com-2105585386.wav,http://soundbible.com/314-Glass-Cookie-Jar.html,32000 – 32,8145
241+meal_00.ogg,,sound/empire/taverns,empire.biginn,DUPLICATE to inn_01.ogg,,,,,,8145
242+meal_01.ogg,22050 – 16,sound/empire/taverns,empire.biginn,UNKNOWN,,,Bottle-2.wav,UNKNOWN,22050 – 32,8145
243+ration_00.ogg,,sound/empire/taverns,empire.inn,DUPLICATE to tavern_02.ogg,,,,,,8145
244+ration_01.ogg,,sound/empire/taverns,empire.inn,DUPLICATE to tavern_01.ogg,,,,,,8145
245+weaving.ogg,22050 – 32,sound/mill,"empire.weavingmill, atlanteans.weavingmill",Xavier Serra,CC-3,yes,320510__xserra__kerala-1.wav,http://www.freesound.org/people/xserra/sounds/320510/,44100 – 16,8251
246+weaver.ogg,22050 – 32,sound/barbarians,barbarian.weavingmill,Yle Arkisto,CC-3,yes,368577__ylearkisto__kangaspuut-old-wooden-loom-from-1857-weaving-a-rag-rug.wav,http://www.freesound.org/people/YleArkisto/sounds/368577/,44100 – 24,8251
247+stonecutter_00.ogg,22050 – 32,sound/atlanteans/cutting,atlanteans.stonecutter,Benboncan,CC-3,yes,71823__benboncan__pickaxe-striking-rock.wav,http://www.freesound.org/people/Benboncan/sounds/71823/,44100 – 16,8251
248 stonecutter_01.ogg,22050 – 32,sound/atlanteans/cutting,atlanteans.stonecutter,Benboncan,CC-3,yes,71823__benboncan__pickaxe-striking-rock.wav,http://www.freesound.org/people/Benboncan/sounds/71823/,44100 – 16,8251
249 stonecutter_02.ogg,22050 – 32,sound/atlanteans/cutting,atlanteans.stonecutter,Benboncan,CC-3,yes,71823__benboncan__pickaxe-striking-rock.wav,http://www.freesound.org/people/Benboncan/sounds/71823/,44100 – 16,8251
250-stonecutter_03.ogg,22050 – 32,sound/atlanteans/cutting,atlanteans.stonecutter,Benboncan,CC-3,yes,71823__benboncan__pickaxe-striking-rock.wav,http://www.freesound.org/people/Benboncan/sounds/71823/,44100 – 16,8251
251+benchsaw_00.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.sawmill,mauxuam,CC-0,yes,216828__mauxuam__saw-of-avalon-2.wav,http://www.freesound.org/people/mauxuam/sounds/216828/,44100 – 16,8251
252 benchsaw_01.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.sawmill,mauxuam,CC-0,yes,216828__mauxuam__saw-of-avalon-2.wav,http://www.freesound.org/people/mauxuam/sounds/216828/,44100 – 16,8251
253-benchsaw_02.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.sawmill,mauxuam,CC-0,yes,216828__mauxuam__saw-of-avalon-2.wav,http://www.freesound.org/people/mauxuam/sounds/216828/,44100 – 16,8251
254+sawing_00.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.woodcutter,dobroide,CC-3,yes,102844__dobroide__20100802-sawing.wav,http://www.freesound.org/people/dobroide/sounds/102844/,44100 – 16,8251
255 sawing_01.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.woodcutter,dobroide,CC-3,yes,102844__dobroide__20100802-sawing.wav,http://www.freesound.org/people/dobroide/sounds/102844/,44100 – 16,8251
256 sawing_02.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.woodcutter,dobroide,CC-3,yes,102844__dobroide__20100802-sawing.wav,http://www.freesound.org/people/dobroide/sounds/102844/,44100 – 16,8251
257-sawing_03.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.woodcutter,dobroide,CC-3,yes,102844__dobroide__20100802-sawing.wav,http://www.freesound.org/people/dobroide/sounds/102844/,44100 – 16,8251
258+goldspin_00.ogg,22050 – 32,sound/atlanteans,atlanteans.goldspinner,Mike Koenig,CC-3,yes,Metal Debris Falling-SoundBible.com-238218965.wav,http://soundbible.com/1099-Metal-Debris-Falling.html,44100 – 16,8251
259 goldspin_01.ogg,22050 – 32,sound/atlanteans,atlanteans.goldspinner,Mike Koenig,CC-3,yes,Metal Debris Falling-SoundBible.com-238218965.wav,http://soundbible.com/1099-Metal-Debris-Falling.html,44100 – 16,8251
260-goldspin_02.ogg,22050 – 32,sound/atlanteans,atlanteans.goldspinner,Mike Koenig,CC-3,yes,Metal Debris Falling-SoundBible.com-238218965.wav,http://soundbible.com/1099-Metal-Debris-Falling.html,44100 – 16,8251
261-tree-falling_00.ogg,11025 – 16,sound/woodcutting,woodcutters,ecfike,CC-0,yes,139952__ecfike__a-tree-falling-down.wav,http://www.freesound.org/people/ecfike/sounds/139952/,44100 – 16,new
262-tree-falling_01.ogg,11025 – 16,sound/woodcutting,woodcutters,Daniel Simion,CC-3,yes,Tree_Fall_Small-Daniel_Simion-1639156552.wav,http://soundbible.com/2039-Tree-Fall-Small.html,44100 – 16,new
263+tree_falling_00.ogg,11025 – 16,sound/woodcutting,woodcutters,ecfike,CC-0,yes,139952__ecfike__a-tree-falling-down.wav,http://www.freesound.org/people/ecfike/sounds/139952/,44100 – 16,new
264+tree_falling_01.ogg,11025 – 16,sound/woodcutting,woodcutters,Daniel Simion,CC-3,yes,Tree_Fall_Small-Daniel_Simion-1639156552.wav,http://soundbible.com/2039-Tree-Fall-Small.html,44100 – 16,new
265 ,,,,,,,,,,
266-boar_01.ogg,11025 – 16,data/sound/animals,,UNKNOWN,personal,yes,Pig-SoundBible.com-1026656068.wav,http://soundbible.com/736-Pig.html,11025,8019
267-elk_01.ogg,16000,data/sound/animals,,fws.gov,PD,yes,Elk Bellowing In Forest-SoundBible.com-681308174.wav,http://soundbible.com/245-Elk-Bellowing-In-Forest.html,48000,8019
268-elk_02.ogg,22050 – 16,data/sound/animals,,fws.gov,PD,yes,Elk Bellowing In Forest 2-SoundBible.com-860406835.wav,http://soundbible.com/246-Elk-Bellowing-In-Forest-2.html,48000,8029
269+boar.ogg,11025 – 16,data/sound/animals,,UNKNOWN,personal,yes,Pig-SoundBible.com-1026656068.wav,http://soundbible.com/736-Pig.html,11025,8019
270+elk_00.ogg,16000,data/sound/animals,,fws.gov,PD,yes,Elk Bellowing In Forest-SoundBible.com-681308174.wav,http://soundbible.com/245-Elk-Bellowing-In-Forest.html,48000,8019
271+elk_01.ogg,22050 – 16,data/sound/animals,,fws.gov,PD,yes,Elk Bellowing In Forest 2-SoundBible.com-860406835.wav,http://soundbible.com/246-Elk-Bellowing-In-Forest-2.html,48000,8029
272+stag_00.ogg,11025 – 16,data/sound/animals,,Juan Carlos,PD,yes,Red_stag_roar-Juan_Carlos_-2004708707.wav,http://soundbible.com/2073-Red-Stag-Roar.html,44100 – 16,8019
273 stag_01.ogg,11025 – 16,data/sound/animals,,Juan Carlos,PD,yes,Red_stag_roar-Juan_Carlos_-2004708707.wav,http://soundbible.com/2073-Red-Stag-Roar.html,44100 – 16,8019
274-stag_02.ogg,11025 – 16,data/sound/animals,,Juan Carlos,PD,yes,Red_stag_roar-Juan_Carlos_-2004708707.wav,http://soundbible.com/2073-Red-Stag-Roar.html,44100 – 16,8019
275+coyote_00.ogg,11025 – 16,data/sound/animals,,UNKNOWN,PD,yes,Coyote Call-SoundBible.com-2012388009.wav,http://soundbible.com/977-Coyote-Call.html,44100 – 16,8019
276 coyote_01.ogg,11025 – 16,data/sound/animals,,UNKNOWN,PD,yes,Coyote Call-SoundBible.com-2012388009.wav,http://soundbible.com/977-Coyote-Call.html,44100 – 16,8019
277-coyote_02.ogg,11025 – 16,data/sound/animals,,UNKNOWN,PD,yes,Coyote Call-SoundBible.com-2012388009.wav,http://soundbible.com/977-Coyote-Call.html,44100 – 16,8019
278-wolf_01.ogg,11025 – 16,data/sound/animals,,UNKNOWN,,,Howl-5.wav,UNKNOWN,11025,8019
279-wolf_02.ogg,22050 – 16,data/sound/animals,,UNKNOWN,,,Howl-4.wav,UNKNOWN,22050,8019
280-wolf_03.ogg,11025 – 16,data/sound/animals,,UNKNOWN,,,Howl-6.wav,UNKNOWN,11025,8019
281-sheep_01.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-3.wav,UNKNOWN,22050,8019
282-sheep_02.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-6.wav,UNKNOWN,22050,8019
283-sheep_03.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-2.wav,UNKNOWN,22050,8019
284+wolf_00.ogg,11025 – 16,data/sound/animals,,UNKNOWN,,,Howl-5.wav,UNKNOWN,11025,8019
285+wolf_01.ogg,22050 – 16,data/sound/animals,,UNKNOWN,,,Howl-4.wav,UNKNOWN,22050,8019
286+wolf_02.ogg,11025 – 16,data/sound/animals,,UNKNOWN,,,Howl-6.wav,UNKNOWN,11025,8019
287+sheep_00.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-3.wav,UNKNOWN,22050,8019
288+sheep_01.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-6.wav,UNKNOWN,22050,8019
289+sheep_02.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-2.wav,UNKNOWN,22050,8019
290
291=== removed file 'data/sound/woodcutting/tree-falling_10.ogg'
292Binary files data/sound/woodcutting/tree-falling_10.ogg 2017-02-07 18:05:21 +0000 and data/sound/woodcutting/tree-falling_10.ogg 1970-01-01 00:00:00 +0000 differ
293=== renamed file 'data/sound/woodcutting/tree-falling_00.ogg' => 'data/sound/woodcutting/tree_falling_00.ogg'
294=== renamed file 'data/sound/woodcutting/tree-falling_01.ogg' => 'data/sound/woodcutting/tree_falling_01.ogg'
295=== renamed file 'data/sound/woodcutting/woodcutting_00.ogg' => 'data/sound/woodcutting/woodcutting.ogg'
296=== modified file 'data/tribes/atlanteans.lua'
297--- data/tribes/atlanteans.lua 2019-05-18 13:33:00 +0000
298+++ data/tribes/atlanteans.lua 2019-05-27 14:29:35 +0000
299@@ -5,10 +5,7 @@
300 -- ---------------------
301 --
302 -- This file contains all the units for a tribe.
303-
304-dirname = path.dirname(__file__)
305-
306--- RST
307+--
308 -- .. function:: new_tribe{table}
309 --
310 -- This function adds all units to a tribe.
311@@ -47,31 +44,25 @@
312 -- **ship**: The internal name of the tribe's ship.
313 --
314 -- **port**: The internal name of the tribe's port building. This unit needs to be defined in the ``buildings`` table too.
315+
316+image_dirname = path.dirname(__file__) .. "images/atlanteans/"
317+
318+animations = {}
319+add_animation(animations, "frontier", image_dirname, "frontier", {3, 12})
320+add_animation(animations, "flag", image_dirname, "flag", {15, 35}, 10)
321+
322 tribes:new_tribe {
323 name = "atlanteans",
324-
325- animations = {
326- -- Some blue fires would be fine, but just an idea
327- frontier = {
328- pictures = path.list_files(dirname .. "images/atlanteans/frontier_??.png"),
329- hotspot = { 3, 12 },
330- },
331- flag = {
332- -- Not just a plain color, maybe a cross or some stripes
333- pictures = path.list_files(dirname .. "images/atlanteans/flag_??.png"),
334- hotspot = { 15, 35 },
335- fps = 10
336- }
337- },
338+ animations = animations,
339
340 -- Image file paths for this tribe's road textures
341 roads = {
342 busy = {
343- "tribes/images/atlanteans/roadt_busy.png",
344+ image_dirname .. "roadt_busy.png",
345 },
346 normal = {
347- "tribes/images/atlanteans/roadt_normal_00.png",
348- "tribes/images/atlanteans/roadt_normal_01.png",
349+ image_dirname .. "roadt_normal_00.png",
350+ image_dirname .. "roadt_normal_01.png",
351 },
352 },
353
354
355=== modified file 'data/tribes/barbarians.lua'
356--- data/tribes/barbarians.lua 2019-05-25 10:47:18 +0000
357+++ data/tribes/barbarians.lua 2019-05-27 14:29:35 +0000
358@@ -1,28 +1,21 @@
359-dirname = path.dirname(__file__)
360+image_dirname = path.dirname(__file__) .. "images/barbarians/"
361+
362+animations = {}
363+add_animation(animations, "frontier", image_dirname, "frontier", {1, 19})
364+add_animation(animations, "flag", image_dirname, "flag", {10, 38}, 5)
365
366 tribes:new_tribe {
367 name = "barbarians",
368-
369- animations = {
370- frontier = {
371- pictures = path.list_files(dirname .. "images/barbarians/frontier_??.png"),
372- hotspot = { 1, 19 },
373- },
374- flag = {
375- pictures = path.list_files(dirname .. "images/barbarians/flag_??.png"),
376- hotspot = { 10, 38 },
377- fps = 5
378- }
379- },
380+ animations = animations,
381
382 -- Image file paths for this tribe's road textures
383 roads = {
384 busy = {
385- "tribes/images/barbarians/roadt_busy.png",
386+ image_dirname .. "roadt_busy.png",
387 },
388 normal = {
389- "tribes/images/barbarians/roadt_normal_00.png",
390- "tribes/images/barbarians/roadt_normal_01.png",
391+ image_dirname .. "roadt_normal_00.png",
392+ image_dirname .. "roadt_normal_01.png",
393 },
394 },
395
396
397=== modified file 'data/tribes/empire.lua'
398--- data/tribes/empire.lua 2019-05-25 10:47:18 +0000
399+++ data/tribes/empire.lua 2019-05-27 14:29:35 +0000
400@@ -1,31 +1,22 @@
401-dirname = path.dirname(__file__)
402+image_dirname = path.dirname(__file__) .. "images/empire/"
403+
404+animations = {}
405+add_animation(animations, "frontier", image_dirname, "frontier", {1, 19})
406+add_animation(animations, "flag", image_dirname, "flag", {14, 38}, 10)
407
408 tribes:new_tribe {
409 name = "empire",
410-
411- animations = {
412- -- No idea for the frontier. Maybe some javelins?
413- frontier = {
414- pictures = path.list_files(dirname .. "images/empire/frontier_??.png"),
415- hotspot = { 1, 19 },
416- },
417- -- Not just a plain color, maybe a cross or some stripes
418- flag = {
419- pictures = path.list_files(dirname .. "images/empire/flag_??.png"),
420- hotspot = { 14, 38 },
421- fps = 10
422- }
423- },
424+ animations = animations,
425
426 -- Image file paths for this tribe's road textures
427 roads = {
428 busy = {
429- "tribes/images/empire/roadt_busy.png",
430+ image_dirname .. "roadt_busy.png",
431 },
432 normal = {
433- "tribes/images/empire/roadt_normal_00.png",
434- "tribes/images/empire/roadt_normal_01.png",
435- "tribes/images/empire/roadt_normal_02.png",
436+ image_dirname .. "roadt_normal_00.png",
437+ image_dirname .. "roadt_normal_01.png",
438+ image_dirname .. "roadt_normal_02.png",
439 },
440 },
441
442
443=== modified file 'data/tribes/frisians.lua'
444--- data/tribes/frisians.lua 2019-05-25 10:47:18 +0000
445+++ data/tribes/frisians.lua 2019-05-27 14:29:35 +0000
446@@ -1,28 +1,21 @@
447-dirname = path.dirname (__file__)
448+image_dirname = path.dirname(__file__) .. "images/frisians/"
449+
450+animations = {}
451+add_animation(animations, "frontier", image_dirname, "frontier", {9, 26})
452+add_animation(animations, "flag", image_dirname, "flag", {10, 39}, 10)
453
454 tribes:new_tribe {
455 name = "frisians",
456-
457- animations = {
458- frontier = {
459- pictures = path.list_files (dirname .. "images/frisians/frontier_??.png"),
460- hotspot = { 9, 26 },
461- },
462- flag = {
463- pictures = path.list_files (dirname .. "images/frisians/flag_??.png"),
464- hotspot = { 10, 39 },
465- fps = 10,
466- }
467- },
468+ animations = animations,
469
470 -- Image file paths for this tribe's road textures
471 roads = {
472 busy = {
473- "tribes/images/frisians/roadt_busy.png",
474+ image_dirname .. "roadt_busy.png",
475 },
476 normal = {
477- "tribes/images/frisians/roadt_normal_00.png",
478- "tribes/images/frisians/roadt_normal_01.png",
479+ image_dirname .. "roadt_normal_00.png",
480+ image_dirname .. "roadt_normal_01.png",
481 },
482 },
483
484
485=== modified file 'data/tribes/immovables/berry_bushes/blueberry/init.lua'
486--- data/tribes/immovables/berry_bushes/blueberry/init.lua 2019-03-02 13:56:42 +0000
487+++ data/tribes/immovables/berry_bushes/blueberry/init.lua 2019-05-27 14:29:35 +0000
488@@ -10,7 +10,7 @@
489 }
490
491 animations = {}
492-add_animation(animations, "idle", dirname, "tiny/idle", { 6, 7 })
493+add_animation(animations, "idle", dirname .. "tiny", "idle", { 6, 7 })
494
495 tribes:new_immovable_type {
496 msgctxt = "immovable",
497@@ -31,7 +31,7 @@
498 }
499
500 animations = {}
501-add_animation(animations, "idle", dirname, "small/idle", { 12, 13 })
502+add_animation(animations, "idle", dirname .. "small", "idle", { 12, 13 })
503
504 tribes:new_immovable_type {
505 msgctxt = "immovable",
506@@ -52,7 +52,7 @@
507 }
508
509 animations = {}
510-add_animation(animations, "idle", dirname, "medium/idle", { 15, 16 })
511+add_animation(animations, "idle", dirname .. "medium", "idle", { 15, 16 })
512
513 tribes:new_immovable_type {
514 msgctxt = "immovable",
515@@ -73,7 +73,7 @@
516 }
517
518 animations = {}
519-add_animation(animations, "idle", dirname, "ripe/idle", { 15, 16 })
520+add_animation(animations, "idle", dirname .. "ripe", "idle", { 15, 16 })
521
522 tribes:new_immovable_type {
523 msgctxt = "immovable",
524
525=== modified file 'data/tribes/immovables/berry_bushes/currant_black/init.lua'
526--- data/tribes/immovables/berry_bushes/currant_black/init.lua 2019-03-02 13:56:42 +0000
527+++ data/tribes/immovables/berry_bushes/currant_black/init.lua 2019-05-27 14:29:35 +0000
528@@ -8,7 +8,7 @@
529 }
530
531 animations = {}
532-add_animation(animations, "idle", dirname, "tiny/idle", { 4, 10 })
533+add_animation(animations, "idle", dirname .. "tiny", "idle", { 4, 10 })
534
535 tribes:new_immovable_type {
536 msgctxt = "immovable",
537@@ -29,7 +29,7 @@
538 }
539
540 animations = {}
541-add_animation(animations, "idle", dirname, "small/idle", { 8, 20 })
542+add_animation(animations, "idle", dirname .. "small", "idle", { 8, 20 })
543
544 tribes:new_immovable_type {
545 msgctxt = "immovable",
546@@ -50,7 +50,7 @@
547 }
548
549 animations = {}
550-add_animation(animations, "idle", dirname, "medium/idle", { 13, 33 })
551+add_animation(animations, "idle", dirname .. "medium", "idle", { 13, 33 })
552
553 tribes:new_immovable_type {
554 msgctxt = "immovable",
555@@ -71,7 +71,7 @@
556 }
557
558 animations = {}
559-add_animation(animations, "idle", dirname, "ripe/idle", { 13, 33 })
560+add_animation(animations, "idle", dirname .. "ripe", "idle", { 13, 33 })
561
562 tribes:new_immovable_type {
563 msgctxt = "immovable",
564
565=== modified file 'data/tribes/immovables/berry_bushes/currant_red/init.lua'
566--- data/tribes/immovables/berry_bushes/currant_red/init.lua 2019-03-02 13:56:42 +0000
567+++ data/tribes/immovables/berry_bushes/currant_red/init.lua 2019-05-27 14:29:35 +0000
568@@ -8,7 +8,7 @@
569 }
570
571 animations = {}
572-add_animation(animations, "idle", dirname, "tiny/idle", { 4, 10 })
573+add_animation(animations, "idle", dirname .. "tiny", "idle", { 4, 10 })
574
575 tribes:new_immovable_type {
576 msgctxt = "immovable",
577@@ -29,7 +29,7 @@
578 }
579
580 animations = {}
581-add_animation(animations, "idle", dirname, "small/idle", { 8, 20 })
582+add_animation(animations, "idle", dirname .. "small", "idle", { 8, 20 })
583
584 tribes:new_immovable_type {
585 msgctxt = "immovable",
586@@ -50,7 +50,7 @@
587 }
588
589 animations = {}
590-add_animation(animations, "idle", dirname, "medium/idle", { 13, 33 })
591+add_animation(animations, "idle", dirname .. "medium", "idle", { 13, 33 })
592
593 tribes:new_immovable_type {
594 msgctxt = "immovable",
595@@ -71,7 +71,7 @@
596 }
597
598 animations = {}
599-add_animation(animations, "idle", dirname, "ripe/idle", { 13, 33 })
600+add_animation(animations, "idle", dirname .. "ripe", "idle", { 13, 33 })
601
602 tribes:new_immovable_type {
603 msgctxt = "immovable",
604
605=== modified file 'data/tribes/immovables/berry_bushes/desert_hackberry/init.lua'
606--- data/tribes/immovables/berry_bushes/desert_hackberry/init.lua 2019-03-02 13:56:42 +0000
607+++ data/tribes/immovables/berry_bushes/desert_hackberry/init.lua 2019-05-27 14:29:35 +0000
608@@ -8,7 +8,7 @@
609 }
610
611 animations = {}
612-add_animation(animations, "idle", dirname, "tiny/idle", { 10, 9 })
613+add_animation(animations, "idle", dirname .. "tiny", "idle", { 10, 9 })
614
615 tribes:new_immovable_type {
616 msgctxt = "immovable",
617@@ -29,7 +29,7 @@
618 }
619
620 animations = {}
621-add_animation(animations, "idle", dirname, "small/idle", { 19, 21 })
622+add_animation(animations, "idle", dirname .. "small", "idle", { 19, 21 })
623
624 tribes:new_immovable_type {
625 msgctxt = "immovable",
626@@ -50,7 +50,7 @@
627 }
628
629 animations = {}
630-add_animation(animations, "idle", dirname, "medium/idle", { 21, 27 })
631+add_animation(animations, "idle", dirname .. "medium", "idle", { 21, 27 })
632
633 tribes:new_immovable_type {
634 msgctxt = "immovable",
635@@ -71,7 +71,7 @@
636 }
637
638 animations = {}
639-add_animation(animations, "idle", dirname, "ripe/idle", { 21, 27 })
640+add_animation(animations, "idle", dirname .. "ripe", "idle", { 21, 27 })
641
642 tribes:new_immovable_type {
643 msgctxt = "immovable",
644
645=== modified file 'data/tribes/immovables/berry_bushes/juniper/init.lua'
646--- data/tribes/immovables/berry_bushes/juniper/init.lua 2019-03-02 13:56:42 +0000
647+++ data/tribes/immovables/berry_bushes/juniper/init.lua 2019-05-27 14:29:35 +0000
648@@ -8,7 +8,7 @@
649 }
650
651 animations = {}
652-add_animation(animations, "idle", dirname, "tiny/idle", { 3, 15 })
653+add_animation(animations, "idle", dirname .. "tiny", "idle", { 3, 15 })
654
655 tribes:new_immovable_type {
656 msgctxt = "immovable",
657@@ -29,7 +29,7 @@
658 }
659
660 animations = {}
661-add_animation(animations, "idle", dirname, "small/idle", { 6, 30 })
662+add_animation(animations, "idle", dirname .. "small", "idle", { 6, 30 })
663
664 tribes:new_immovable_type {
665 msgctxt = "immovable",
666@@ -50,7 +50,7 @@
667 }
668
669 animations = {}
670-add_animation(animations, "idle", dirname, "medium/idle", { 10, 47 })
671+add_animation(animations, "idle", dirname .. "medium", "idle", { 10, 47 })
672
673 tribes:new_immovable_type {
674 msgctxt = "immovable",
675@@ -71,7 +71,7 @@
676 }
677
678 animations = {}
679-add_animation(animations, "idle", dirname, "ripe/idle", { 11, 49 })
680+add_animation(animations, "idle", dirname .. "ripe", "idle", { 11, 49 })
681
682 tribes:new_immovable_type {
683 msgctxt = "immovable",
684
685=== modified file 'data/tribes/immovables/berry_bushes/raspberry/init.lua'
686--- data/tribes/immovables/berry_bushes/raspberry/init.lua 2019-03-02 13:56:42 +0000
687+++ data/tribes/immovables/berry_bushes/raspberry/init.lua 2019-05-27 14:29:35 +0000
688@@ -8,7 +8,7 @@
689 }
690
691 animations = {}
692-add_animation(animations, "idle", dirname, "tiny/idle", { 4, 7 })
693+add_animation(animations, "idle", dirname .. "tiny", "idle", { 4, 7 })
694
695 tribes:new_immovable_type {
696 msgctxt = "immovable",
697@@ -29,7 +29,7 @@
698 }
699
700 animations = {}
701-add_animation(animations, "idle", dirname, "small/idle", { 16, 31 })
702+add_animation(animations, "idle", dirname .. "small", "idle", { 16, 31 })
703
704 tribes:new_immovable_type {
705 msgctxt = "immovable",
706@@ -50,7 +50,7 @@
707 }
708
709 animations = {}
710-add_animation(animations, "idle", dirname, "medium/idle", { 17, 34 })
711+add_animation(animations, "idle", dirname .. "medium", "idle", { 17, 34 })
712
713 tribes:new_immovable_type {
714 msgctxt = "immovable",
715@@ -71,7 +71,7 @@
716 }
717
718 animations = {}
719-add_animation(animations, "idle", dirname, "ripe/idle", { 17, 34 })
720+add_animation(animations, "idle", dirname .. "ripe", "idle", { 17, 34 })
721
722 tribes:new_immovable_type {
723 msgctxt = "immovable",
724
725=== modified file 'data/tribes/immovables/berry_bushes/sea_buckthorn/init.lua'
726--- data/tribes/immovables/berry_bushes/sea_buckthorn/init.lua 2019-03-02 13:56:42 +0000
727+++ data/tribes/immovables/berry_bushes/sea_buckthorn/init.lua 2019-05-27 14:29:35 +0000
728@@ -8,7 +8,7 @@
729 }
730
731 animations = {}
732-add_animation(animations, "idle", dirname, "tiny/idle", { 9, 19 })
733+add_animation(animations, "idle", dirname .. "tiny", "idle", { 9, 19 })
734
735 tribes:new_immovable_type {
736 msgctxt = "immovable",
737@@ -29,7 +29,7 @@
738 }
739
740 animations = {}
741-add_animation(animations, "idle", dirname, "small/idle", { 14, 32 })
742+add_animation(animations, "idle", dirname .. "small", "idle", { 14, 32 })
743
744 tribes:new_immovable_type {
745 msgctxt = "immovable",
746@@ -50,7 +50,7 @@
747 }
748
749 animations = {}
750-add_animation(animations, "idle", dirname, "medium/idle", { 17, 40 })
751+add_animation(animations, "idle", dirname .. "medium", "idle", { 17, 40 })
752
753 tribes:new_immovable_type {
754 msgctxt = "immovable",
755@@ -71,7 +71,7 @@
756 }
757
758 animations = {}
759-add_animation(animations, "idle", dirname, "ripe/idle", { 17, 40 })
760+add_animation(animations, "idle", dirname .. "ripe", "idle", { 17, 40 })
761
762 tribes:new_immovable_type {
763 msgctxt = "immovable",
764
765=== modified file 'data/tribes/immovables/berry_bushes/strawberry/init.lua'
766--- data/tribes/immovables/berry_bushes/strawberry/init.lua 2019-03-02 13:56:42 +0000
767+++ data/tribes/immovables/berry_bushes/strawberry/init.lua 2019-05-27 14:29:35 +0000
768@@ -8,7 +8,7 @@
769 }
770
771 animations = {}
772-add_animation(animations, "idle", dirname, "tiny/idle", { 4, 4 })
773+add_animation(animations, "idle", dirname .. "tiny", "idle", { 4, 4 })
774
775 tribes:new_immovable_type {
776 msgctxt = "immovable",
777@@ -29,7 +29,7 @@
778 }
779
780 animations = {}
781-add_animation(animations, "idle", dirname, "small/idle", { 12, 9 })
782+add_animation(animations, "idle", dirname .. "small", "idle", { 12, 9 })
783
784 tribes:new_immovable_type {
785 msgctxt = "immovable",
786@@ -50,7 +50,7 @@
787 }
788
789 animations = {}
790-add_animation(animations, "idle", dirname, "medium/idle", { 21, 15 })
791+add_animation(animations, "idle", dirname .. "medium", "idle", { 21, 15 })
792
793 tribes:new_immovable_type {
794 msgctxt = "immovable",
795@@ -71,7 +71,7 @@
796 }
797
798 animations = {}
799-add_animation(animations, "idle", dirname, "ripe/idle", { 21, 15 })
800+add_animation(animations, "idle", dirname .. "ripe", "idle", { 21, 15 })
801
802 tribes:new_immovable_type {
803 msgctxt = "immovable",
804
805=== modified file 'data/tribes/ships/atlanteans/init.lua'
806--- data/tribes/ships/atlanteans/init.lua 2017-02-12 09:10:57 +0000
807+++ data/tribes/ships/atlanteans/init.lua 2019-05-27 14:29:35 +0000
808@@ -24,7 +24,7 @@
809 fps = 7
810 }
811 }
812-add_walking_animations(animations, "sail", dirname, "sail", {89, 86}, 10)
813+add_directional_animation(animations, "sail", dirname, "sail", {89, 86}, 10)
814
815
816 -- RST
817
818=== modified file 'data/tribes/ships/barbarians/init.lua'
819--- data/tribes/ships/barbarians/init.lua 2017-02-12 09:10:57 +0000
820+++ data/tribes/ships/barbarians/init.lua 2019-05-27 14:29:35 +0000
821@@ -7,7 +7,7 @@
822 fps = 10
823 }
824 }
825-add_walking_animations(animations, "sail", dirname, "sail", {115, 76}, 10)
826+add_directional_animation(animations, "sail", dirname, "sail", {115, 76}, 10)
827
828
829 tribes:new_ship_type {
830
831=== modified file 'data/tribes/ships/empire/init.lua'
832--- data/tribes/ships/empire/init.lua 2017-02-12 09:10:57 +0000
833+++ data/tribes/ships/empire/init.lua 2019-05-27 14:29:35 +0000
834@@ -7,7 +7,7 @@
835 fps = 10
836 }
837 }
838-add_walking_animations(animations, "sail", dirname, "sail", {115, 100}, 10)
839+add_directional_animation(animations, "sail", dirname, "sail", {115, 100}, 10)
840
841
842 tribes:new_ship_type {
843
844=== modified file 'data/tribes/ships/frisians/init.lua'
845--- data/tribes/ships/frisians/init.lua 2018-02-08 17:18:30 +0000
846+++ data/tribes/ships/frisians/init.lua 2019-05-27 14:29:35 +0000
847@@ -12,7 +12,7 @@
848 fps = 7
849 }
850 }
851-add_walking_animations (animations, "sail", dirname, "sail", {146, 153}, 10)
852+add_directional_animation(animations, "sail", dirname, "sail", {146, 153}, 10)
853
854 tribes:new_ship_type {
855 name = "frisians_ship",
856
857=== modified file 'data/tribes/workers/atlanteans/armorsmith/init.lua'
858--- data/tribes/workers/atlanteans/armorsmith/init.lua 2017-08-30 16:46:00 +0000
859+++ data/tribes/workers/atlanteans/armorsmith/init.lua 2019-05-27 14:29:35 +0000
860@@ -21,8 +21,8 @@
861 hotspot = { 10, 21 },
862 }
863 }
864-add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10)
865-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 23}, 10)
866+add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10)
867+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 23}, 10)
868
869 -- RST
870 -- .. function:: new_worker_type{table}
871
872=== modified file 'data/tribes/workers/atlanteans/baker/init.lua'
873--- data/tribes/workers/atlanteans/baker/init.lua 2017-02-12 09:10:57 +0000
874+++ data/tribes/workers/atlanteans/baker/init.lua 2019-05-27 14:29:35 +0000
875@@ -6,8 +6,8 @@
876 hotspot = { 5, 23 },
877 }
878 }
879-add_walking_animations(animations, "walk", dirname, "walk", {7, 24}, 10)
880-add_walking_animations(animations, "walkload", dirname, "walkload", {9, 25}, 10)
881+add_directional_animation(animations, "walk", dirname, "walk", {7, 24}, 10)
882+add_directional_animation(animations, "walkload", dirname, "walkload", {9, 25}, 10)
883
884
885 tribes:new_worker_type {
886
887=== modified file 'data/tribes/workers/atlanteans/blackroot_farmer/init.lua'
888--- data/tribes/workers/atlanteans/blackroot_farmer/init.lua 2018-02-28 09:38:13 +0000
889+++ data/tribes/workers/atlanteans/blackroot_farmer/init.lua 2019-05-27 14:29:35 +0000
890@@ -21,8 +21,8 @@
891 fps = 10
892 }
893 }
894-add_walking_animations(animations, "walk", dirname, "walk", {13, 24}, 10)
895-add_walking_animations(animations, "walkload", dirname, "walk", {13, 24}, 10)
896+add_directional_animation(animations, "walk", dirname, "walk", {13, 24}, 10)
897+add_directional_animation(animations, "walkload", dirname, "walk", {13, 24}, 10)
898
899
900 tribes:new_worker_type {
901
902=== modified file 'data/tribes/workers/atlanteans/builder/init.lua'
903--- data/tribes/workers/atlanteans/builder/init.lua 2019-03-17 08:30:43 +0000
904+++ data/tribes/workers/atlanteans/builder/init.lua 2019-05-27 14:29:35 +0000
905@@ -16,8 +16,8 @@
906 fps=10,
907 }
908 }
909-add_walking_animations(animations, "walk", dirname, "walk", {8, 24}, 10)
910-add_walking_animations(animations, "walkload", dirname, "walk", {8, 24}, 10)
911+add_directional_animation(animations, "walk", dirname, "walk", {8, 24}, 10)
912+add_directional_animation(animations, "walkload", dirname, "walk", {8, 24}, 10)
913
914
915 tribes:new_worker_type {
916
917=== modified file 'data/tribes/workers/atlanteans/carrier/init.lua'
918--- data/tribes/workers/atlanteans/carrier/init.lua 2018-11-30 10:36:42 +0000
919+++ data/tribes/workers/atlanteans/carrier/init.lua 2019-05-27 14:29:35 +0000
920@@ -15,15 +15,10 @@
921
922 dirname = path.dirname(__file__)
923
924-animations = {
925- idle = {
926- pictures = path.list_files(dirname .. "idle_??.png"),
927- hotspot = { 13, 24 },
928- fps=10,
929- }
930-}
931-add_walking_animations(animations, "walk", dirname, "walk", {8, 25}, 10)
932-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 25}, 10)
933+animations = {}
934+add_animation(animations, "idle", dirname, "idle", {13, 24}, 10)
935+add_directional_animation(animations, "walk", dirname, "walk", {8, 25}, 10)
936+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 25}, 10)
937
938 -- RST
939 -- .. function:: new_carrier_type{table}
940
941=== modified file 'data/tribes/workers/atlanteans/charcoal_burner/init.lua'
942--- data/tribes/workers/atlanteans/charcoal_burner/init.lua 2017-02-12 09:10:57 +0000
943+++ data/tribes/workers/atlanteans/charcoal_burner/init.lua 2019-05-27 14:29:35 +0000
944@@ -6,8 +6,8 @@
945 hotspot = { 4, 22 }
946 }
947 }
948-add_walking_animations(animations, "walk", dirname, "walk", {8, 22}, 10)
949-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10)
950+add_directional_animation(animations, "walk", dirname, "walk", {8, 22}, 10)
951+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10)
952
953
954 tribes:new_worker_type {
955
956=== modified file 'data/tribes/workers/atlanteans/farmer/init.lua'
957--- data/tribes/workers/atlanteans/farmer/init.lua 2019-03-17 07:20:58 +0000
958+++ data/tribes/workers/atlanteans/farmer/init.lua 2019-05-27 14:29:35 +0000
959@@ -21,8 +21,8 @@
960 fps = 5
961 }
962 }
963-add_walking_animations(animations, "walk", dirname, "walk", {18, 23}, 10)
964-add_walking_animations(animations, "walkload", dirname, "walk", {18, 23}, 10)
965+add_directional_animation(animations, "walk", dirname, "walk", {18, 23}, 10)
966+add_directional_animation(animations, "walkload", dirname, "walk", {18, 23}, 10)
967
968
969 tribes:new_worker_type {
970
971=== modified file 'data/tribes/workers/atlanteans/fishbreeder/init.lua'
972--- data/tribes/workers/atlanteans/fishbreeder/init.lua 2017-11-18 17:49:18 +0000
973+++ data/tribes/workers/atlanteans/fishbreeder/init.lua 2019-05-27 14:29:35 +0000
974@@ -11,7 +11,7 @@
975 fps = 10
976 }
977 }
978-add_walking_animations(animations, "walk", dirname, "walk", {11, 23}, 20)
979+add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 20)
980
981 tribes:new_worker_type {
982 msgctxt = "atlanteans_worker",
983
984=== modified file 'data/tribes/workers/atlanteans/fisher/init.lua'
985--- data/tribes/workers/atlanteans/fisher/init.lua 2019-03-17 07:20:58 +0000
986+++ data/tribes/workers/atlanteans/fisher/init.lua 2019-05-27 14:29:35 +0000
987@@ -11,8 +11,8 @@
988 fps = 10
989 }
990 }
991-add_walking_animations(animations, "walk", dirname, "walk", {8, 21}, 20)
992-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 20}, 10)
993+add_directional_animation(animations, "walk", dirname, "walk", {8, 21}, 20)
994+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 20}, 10)
995
996
997 tribes:new_worker_type {
998
999=== modified file 'data/tribes/workers/atlanteans/forester/init.lua'
1000--- data/tribes/workers/atlanteans/forester/init.lua 2018-02-28 09:38:13 +0000
1001+++ data/tribes/workers/atlanteans/forester/init.lua 2019-05-27 14:29:35 +0000
1002@@ -21,8 +21,8 @@
1003 fps = 5
1004 }
1005 }
1006-add_walking_animations(animations, "walk", dirname, "walk", {10, 23}, 10)
1007-add_walking_animations(animations, "walkload", dirname, "walk", {10, 23}, 10)
1008+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 10)
1009+add_directional_animation(animations, "walkload", dirname, "walk", {10, 23}, 10)
1010
1011
1012 tribes:new_worker_type {
1013
1014=== modified file 'data/tribes/workers/atlanteans/geologist/init.lua'
1015--- data/tribes/workers/atlanteans/geologist/init.lua 2019-03-17 07:20:58 +0000
1016+++ data/tribes/workers/atlanteans/geologist/init.lua 2019-05-27 14:29:35 +0000
1017@@ -12,8 +12,8 @@
1018 fps = 10
1019 }
1020 }
1021-add_walking_animations(animations, "walk", dirname, "walk", {11, 23}, 10)
1022-add_walking_animations(animations, "walkload", dirname, "walk", {11, 23}, 10)
1023+add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 10)
1024+add_directional_animation(animations, "walkload", dirname, "walk", {11, 23}, 10)
1025
1026
1027 tribes:new_worker_type {
1028
1029=== modified file 'data/tribes/workers/atlanteans/horse/init.lua'
1030--- data/tribes/workers/atlanteans/horse/init.lua 2019-05-18 13:04:13 +0000
1031+++ data/tribes/workers/atlanteans/horse/init.lua 2019-05-27 14:29:35 +0000
1032@@ -7,8 +7,8 @@
1033 fps = 10
1034 }
1035 }
1036-add_walking_animations(animations, "walk", dirname, "walk", {19, 33}, 10)
1037-add_walking_animations(animations, "walkload", dirname, "walk", {19, 33}, 10) -- TODO(GunChleoc): Make animation
1038+add_directional_animation(animations, "walk", dirname, "walk", {19, 33}, 10)
1039+add_directional_animation(animations, "walkload", dirname, "walk", {19, 33}, 10) -- TODO(GunChleoc): Make animation
1040
1041
1042 tribes:new_carrier_type {
1043
1044=== modified file 'data/tribes/workers/atlanteans/horsebreeder/init.lua'
1045--- data/tribes/workers/atlanteans/horsebreeder/init.lua 2017-02-12 09:10:57 +0000
1046+++ data/tribes/workers/atlanteans/horsebreeder/init.lua 2019-05-27 14:29:35 +0000
1047@@ -6,7 +6,7 @@
1048 hotspot = { 8, 23 },
1049 }
1050 }
1051-add_walking_animations(animations, "walk", dirname, "walk", {35, 28}, 10)
1052+add_directional_animation(animations, "walk", dirname, "walk", {35, 28}, 10)
1053
1054 tribes:new_worker_type {
1055 msgctxt = "atlanteans_worker",
1056
1057=== modified file 'data/tribes/workers/atlanteans/hunter/init.lua'
1058--- data/tribes/workers/atlanteans/hunter/init.lua 2018-02-28 09:38:13 +0000
1059+++ data/tribes/workers/atlanteans/hunter/init.lua 2019-05-27 14:29:35 +0000
1060@@ -7,8 +7,8 @@
1061 fps = 10
1062 }
1063 }
1064-add_walking_animations(animations, "walk", dirname, "walk", {14, 22}, 10)
1065-add_walking_animations(animations, "walkload", dirname, "walkload", {13, 23}, 10)
1066+add_directional_animation(animations, "walk", dirname, "walk", {14, 22}, 10)
1067+add_directional_animation(animations, "walkload", dirname, "walkload", {13, 23}, 10)
1068
1069
1070 tribes:new_worker_type {
1071
1072=== modified file 'data/tribes/workers/atlanteans/miller/init.lua'
1073--- data/tribes/workers/atlanteans/miller/init.lua 2017-02-12 09:10:57 +0000
1074+++ data/tribes/workers/atlanteans/miller/init.lua 2019-05-27 14:29:35 +0000
1075@@ -6,8 +6,8 @@
1076 hotspot = { 4, 22 }
1077 }
1078 }
1079-add_walking_animations(animations, "walk", dirname, "walk", {8, 22}, 10)
1080-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10)
1081+add_directional_animation(animations, "walk", dirname, "walk", {8, 22}, 10)
1082+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10)
1083
1084
1085 tribes:new_worker_type {
1086
1087=== modified file 'data/tribes/workers/atlanteans/miner/init.lua'
1088--- data/tribes/workers/atlanteans/miner/init.lua 2017-02-12 09:10:57 +0000
1089+++ data/tribes/workers/atlanteans/miner/init.lua 2019-05-27 14:29:35 +0000
1090@@ -6,8 +6,8 @@
1091 hotspot = { 3, 23 }
1092 }
1093 }
1094-add_walking_animations(animations, "walk", dirname, "walk", {10, 24}, 10)
1095-add_walking_animations(animations, "walkload", dirname, "walkload", {10, 24}, 10)
1096+add_directional_animation(animations, "walk", dirname, "walk", {10, 24}, 10)
1097+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 24}, 10)
1098
1099
1100 tribes:new_worker_type {
1101
1102=== modified file 'data/tribes/workers/atlanteans/recruit/init.lua'
1103--- data/tribes/workers/atlanteans/recruit/init.lua 2017-05-25 20:30:41 +0000
1104+++ data/tribes/workers/atlanteans/recruit/init.lua 2019-05-27 14:29:35 +0000
1105@@ -7,7 +7,7 @@
1106 fps = 5
1107 },
1108 }
1109-add_walking_animations(animations, "walk", dirname, "walk", {20, 30}, 10)
1110+add_directional_animation(animations, "walk", dirname, "walk", {20, 30}, 10)
1111
1112 tribes:new_worker_type {
1113 msgctxt = "atlanteans_worker",
1114
1115=== modified file 'data/tribes/workers/atlanteans/sawyer/init.lua'
1116--- data/tribes/workers/atlanteans/sawyer/init.lua 2017-02-12 09:10:57 +0000
1117+++ data/tribes/workers/atlanteans/sawyer/init.lua 2019-05-27 14:29:35 +0000
1118@@ -6,8 +6,8 @@
1119 hotspot = { 5, 31 }
1120 }
1121 }
1122-add_walking_animations(animations, "walk", dirname, "walk", {16, 31}, 10)
1123-add_walking_animations(animations, "walkload", dirname, "walk", {16, 31}, 10)
1124+add_directional_animation(animations, "walk", dirname, "walk", {16, 31}, 10)
1125+add_directional_animation(animations, "walkload", dirname, "walk", {16, 31}, 10)
1126
1127
1128 tribes:new_worker_type {
1129
1130=== modified file 'data/tribes/workers/atlanteans/scout/init.lua'
1131--- data/tribes/workers/atlanteans/scout/init.lua 2018-02-28 09:38:13 +0000
1132+++ data/tribes/workers/atlanteans/scout/init.lua 2019-05-27 14:29:35 +0000
1133@@ -6,7 +6,7 @@
1134 hotspot = { 4, 22 },
1135 }
1136 }
1137-add_walking_animations(animations, "walk", dirname, "walk", {9, 25}, 10)
1138+add_directional_animation(animations, "walk", dirname, "walk", {9, 25}, 10)
1139
1140 tribes:new_worker_type {
1141 msgctxt = "atlanteans_worker",
1142
1143=== modified file 'data/tribes/workers/atlanteans/shipwright/init.lua'
1144--- data/tribes/workers/atlanteans/shipwright/init.lua 2019-03-17 08:30:43 +0000
1145+++ data/tribes/workers/atlanteans/shipwright/init.lua 2019-05-27 14:29:35 +0000
1146@@ -11,8 +11,8 @@
1147 fps = 10
1148 }
1149 }
1150-add_walking_animations(animations, "walk", dirname, "walk", {12, 28}, 10)
1151-add_walking_animations(animations, "walkload", dirname, "walkload", {12, 28}, 10)
1152+add_directional_animation(animations, "walk", dirname, "walk", {12, 28}, 10)
1153+add_directional_animation(animations, "walkload", dirname, "walkload", {12, 28}, 10)
1154
1155
1156 tribes:new_worker_type {
1157
1158=== modified file 'data/tribes/workers/atlanteans/smelter/init.lua'
1159--- data/tribes/workers/atlanteans/smelter/init.lua 2017-02-12 09:10:57 +0000
1160+++ data/tribes/workers/atlanteans/smelter/init.lua 2019-05-27 14:29:35 +0000
1161@@ -6,8 +6,8 @@
1162 hotspot = { 10, 22 }
1163 }
1164 }
1165-add_walking_animations(animations, "walk", dirname, "walk", {12, 22}, 10)
1166-add_walking_animations(animations, "walkload", dirname, "walkload", {12, 24}, 10)
1167+add_directional_animation(animations, "walk", dirname, "walk", {12, 22}, 10)
1168+add_directional_animation(animations, "walkload", dirname, "walkload", {12, 24}, 10)
1169
1170
1171 tribes:new_worker_type {
1172
1173=== modified file 'data/tribes/workers/atlanteans/smoker/init.lua'
1174--- data/tribes/workers/atlanteans/smoker/init.lua 2018-08-29 11:31:58 +0000
1175+++ data/tribes/workers/atlanteans/smoker/init.lua 2019-05-27 14:29:35 +0000
1176@@ -6,8 +6,8 @@
1177 hotspot = { 17, 22 }
1178 }
1179 }
1180-add_walking_animations(animations, "walk", dirname, "walk", {20, 22}, 10)
1181-add_walking_animations(animations, "walkload", dirname, "walkload", {20, 24}, 10)
1182+add_directional_animation(animations, "walk", dirname, "walk", {20, 22}, 10)
1183+add_directional_animation(animations, "walkload", dirname, "walkload", {20, 24}, 10)
1184
1185 tribes:new_worker_type {
1186 msgctxt = "atlanteans_worker",
1187
1188=== modified file 'data/tribes/workers/atlanteans/soldier/init.lua'
1189--- data/tribes/workers/atlanteans/soldier/init.lua 2019-05-19 09:36:33 +0000
1190+++ data/tribes/workers/atlanteans/soldier/init.lua 2019-05-27 14:29:35 +0000
1191@@ -71,7 +71,7 @@
1192 fps = 10
1193 }
1194 }
1195-add_walking_animations(animations, "walk", dirname, "walk", {20, 34}, 10)
1196+add_directional_animation(animations, "walk", dirname, "walk", {20, 34}, 10)
1197
1198 all_levels_atl = {
1199 min_health = 0,
1200
1201=== modified file 'data/tribes/workers/atlanteans/spiderbreeder/init.lua'
1202--- data/tribes/workers/atlanteans/spiderbreeder/init.lua 2017-02-12 09:10:57 +0000
1203+++ data/tribes/workers/atlanteans/spiderbreeder/init.lua 2019-05-27 14:29:35 +0000
1204@@ -6,8 +6,8 @@
1205 hotspot = { 8, 22 }
1206 }
1207 }
1208-add_walking_animations(animations, "walk", dirname, "walk", {10, 22}, 10)
1209-add_walking_animations(animations, "walkload", dirname, "walkload", {10, 22}, 10)
1210+add_directional_animation(animations, "walk", dirname, "walk", {10, 22}, 10)
1211+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 22}, 10)
1212
1213
1214 tribes:new_worker_type {
1215
1216=== modified file 'data/tribes/workers/atlanteans/stonecutter/init.lua'
1217--- data/tribes/workers/atlanteans/stonecutter/init.lua 2019-03-17 07:20:58 +0000
1218+++ data/tribes/workers/atlanteans/stonecutter/init.lua 2019-05-27 14:29:35 +0000
1219@@ -11,8 +11,8 @@
1220 fps = 10
1221 }
1222 }
1223-add_walking_animations(animations, "walk", dirname, "walk", {10, 21}, 10)
1224-add_walking_animations(animations, "walkload", dirname, "walkload", {10, 23}, 10)
1225+add_directional_animation(animations, "walk", dirname, "walk", {10, 21}, 10)
1226+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 23}, 10)
1227
1228
1229 tribes:new_worker_type {
1230
1231=== modified file 'data/tribes/workers/atlanteans/toolsmith/init.lua'
1232--- data/tribes/workers/atlanteans/toolsmith/init.lua 2017-02-12 09:10:57 +0000
1233+++ data/tribes/workers/atlanteans/toolsmith/init.lua 2019-05-27 14:29:35 +0000
1234@@ -6,8 +6,8 @@
1235 hotspot = { 10, 21 }
1236 }
1237 }
1238-add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10)
1239-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 23}, 10)
1240+add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10)
1241+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 23}, 10)
1242
1243
1244 tribes:new_worker_type {
1245
1246=== modified file 'data/tribes/workers/atlanteans/trainer/init.lua'
1247--- data/tribes/workers/atlanteans/trainer/init.lua 2017-02-12 09:10:57 +0000
1248+++ data/tribes/workers/atlanteans/trainer/init.lua 2019-05-27 14:29:35 +0000
1249@@ -6,8 +6,8 @@
1250 hotspot = { 11, 21 }
1251 }
1252 }
1253-add_walking_animations(animations, "walk", dirname, "walk", {14, 21}, 10)
1254-add_walking_animations(animations, "walkload", dirname, "walk", {14, 21}, 10)
1255+add_directional_animation(animations, "walk", dirname, "walk", {14, 21}, 10)
1256+add_directional_animation(animations, "walkload", dirname, "walk", {14, 21}, 10)
1257
1258
1259 tribes:new_worker_type {
1260
1261=== modified file 'data/tribes/workers/atlanteans/weaponsmith/init.lua'
1262--- data/tribes/workers/atlanteans/weaponsmith/init.lua 2017-02-12 09:10:57 +0000
1263+++ data/tribes/workers/atlanteans/weaponsmith/init.lua 2019-05-27 14:29:35 +0000
1264@@ -6,8 +6,8 @@
1265 hotspot = { 10, 21 }
1266 }
1267 }
1268-add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10)
1269-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 23}, 10)
1270+add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10)
1271+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 23}, 10)
1272
1273
1274 tribes:new_worker_type {
1275
1276=== modified file 'data/tribes/workers/atlanteans/weaver/init.lua'
1277--- data/tribes/workers/atlanteans/weaver/init.lua 2017-02-12 09:10:57 +0000
1278+++ data/tribes/workers/atlanteans/weaver/init.lua 2019-05-27 14:29:35 +0000
1279@@ -6,8 +6,8 @@
1280 hotspot = { 2, 22 }
1281 }
1282 }
1283-add_walking_animations(animations, "walk", dirname, "walk", {6, 23}, 10)
1284-add_walking_animations(animations, "walkload", dirname, "walkload", {9, 22}, 10)
1285+add_directional_animation(animations, "walk", dirname, "walk", {6, 23}, 10)
1286+add_directional_animation(animations, "walkload", dirname, "walkload", {9, 22}, 10)
1287
1288
1289 tribes:new_worker_type {
1290
1291=== modified file 'data/tribes/workers/atlanteans/woodcutter/init.lua'
1292--- data/tribes/workers/atlanteans/woodcutter/init.lua 2019-03-17 07:20:58 +0000
1293+++ data/tribes/workers/atlanteans/woodcutter/init.lua 2019-05-27 14:29:35 +0000
1294@@ -11,8 +11,8 @@
1295 fps = 10
1296 }
1297 }
1298-add_walking_animations(animations, "walk", dirname, "walk", {16, 31}, 10)
1299-add_walking_animations(animations, "walkload", dirname, "walkload", {13, 29}, 10)
1300+add_directional_animation(animations, "walk", dirname, "walk", {16, 31}, 10)
1301+add_directional_animation(animations, "walkload", dirname, "walkload", {13, 29}, 10)
1302
1303
1304 tribes:new_worker_type {
1305@@ -35,7 +35,7 @@
1306 "walk=object",
1307 "playsound=sound/atlanteans/saw/sawing 230",
1308 "animate=sawing 10000",
1309- "playsound=sound/woodcutting/tree-falling 130",
1310+ "playsound=sound/woodcutting/tree_falling 130",
1311 "callobject=fall",
1312 "animate=idle 2000",
1313 "createware=log",
1314
1315=== modified file 'data/tribes/workers/barbarians/baker/init.lua'
1316--- data/tribes/workers/barbarians/baker/init.lua 2017-02-12 09:10:57 +0000
1317+++ data/tribes/workers/barbarians/baker/init.lua 2019-05-27 14:29:35 +0000
1318@@ -6,8 +6,8 @@
1319 hotspot = { 5, 23 },
1320 }
1321 }
1322-add_walking_animations(animations, "walk", dirname, "walk", {7, 24}, 10)
1323-add_walking_animations(animations, "walkload", dirname, "walkload", {9, 25}, 10)
1324+add_directional_animation(animations, "walk", dirname, "walk", {7, 24}, 10)
1325+add_directional_animation(animations, "walkload", dirname, "walkload", {9, 25}, 10)
1326
1327
1328 tribes:new_worker_type {
1329
1330=== modified file 'data/tribes/workers/barbarians/blacksmith/init.lua'
1331--- data/tribes/workers/barbarians/blacksmith/init.lua 2017-12-07 08:33:46 +0000
1332+++ data/tribes/workers/barbarians/blacksmith/init.lua 2019-05-27 14:29:35 +0000
1333@@ -6,8 +6,8 @@
1334 hotspot = { 6, 28 },
1335 }
1336 }
1337-add_walking_animations(animations, "walk", dirname, "walk", {11, 24}, 15)
1338-add_walking_animations(animations, "walkload", dirname, "walk", {11, 24}, 15)
1339+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15)
1340+add_directional_animation(animations, "walkload", dirname, "walk", {11, 24}, 15)
1341
1342
1343 tribes:new_worker_type {
1344
1345=== modified file 'data/tribes/workers/barbarians/blacksmith_master/init.lua'
1346--- data/tribes/workers/barbarians/blacksmith_master/init.lua 2017-02-12 09:10:57 +0000
1347+++ data/tribes/workers/barbarians/blacksmith_master/init.lua 2019-05-27 14:29:35 +0000
1348@@ -6,8 +6,8 @@
1349 hotspot = { 3, 22 },
1350 }
1351 }
1352-add_walking_animations(animations, "walk", dirname, "walk", {6, 22}, 10)
1353-add_walking_animations(animations, "walkload", dirname, "walkload", {9, 23}, 10)
1354+add_directional_animation(animations, "walk", dirname, "walk", {6, 22}, 10)
1355+add_directional_animation(animations, "walkload", dirname, "walkload", {9, 23}, 10)
1356
1357
1358 tribes:new_worker_type {
1359
1360=== modified file 'data/tribes/workers/barbarians/brewer/init.lua'
1361--- data/tribes/workers/barbarians/brewer/init.lua 2017-12-07 08:33:46 +0000
1362+++ data/tribes/workers/barbarians/brewer/init.lua 2019-05-27 14:29:35 +0000
1363@@ -6,8 +6,8 @@
1364 hotspot = { 7, 22 },
1365 }
1366 }
1367-add_walking_animations(animations, "walk", dirname, "walk", {12, 23}, 10)
1368-add_walking_animations(animations, "walkload", dirname, "walkload", {11, 24}, 10)
1369+add_directional_animation(animations, "walk", dirname, "walk", {12, 23}, 10)
1370+add_directional_animation(animations, "walkload", dirname, "walkload", {11, 24}, 10)
1371
1372
1373 tribes:new_worker_type {
1374
1375=== modified file 'data/tribes/workers/barbarians/brewer_master/init.lua'
1376--- data/tribes/workers/barbarians/brewer_master/init.lua 2017-02-12 09:10:57 +0000
1377+++ data/tribes/workers/barbarians/brewer_master/init.lua 2019-05-27 14:29:35 +0000
1378@@ -6,8 +6,8 @@
1379 hotspot = { 8, 26 },
1380 }
1381 }
1382-add_walking_animations(animations, "walk", dirname, "walk", {15, 26}, 10)
1383-add_walking_animations(animations, "walkload", dirname, "walkload", {11, 24}, 10)
1384+add_directional_animation(animations, "walk", dirname, "walk", {15, 26}, 10)
1385+add_directional_animation(animations, "walkload", dirname, "walkload", {11, 24}, 10)
1386
1387
1388 tribes:new_worker_type {
1389
1390=== modified file 'data/tribes/workers/barbarians/builder/init.lua'
1391--- data/tribes/workers/barbarians/builder/init.lua 2019-04-24 06:32:02 +0000
1392+++ data/tribes/workers/barbarians/builder/init.lua 2019-05-27 14:29:35 +0000
1393@@ -7,8 +7,8 @@
1394 path = "sound/hammering/hammering",
1395 priority = 64
1396 }
1397-add_walking_animations(animations, "walk", dirname, "walk", {7, 22}, 10)
1398-add_walking_animations(animations, "walkload", dirname, "walk", {7, 22}, 10)
1399+add_directional_animation(animations, "walk", dirname, "walk", {7, 22}, 10)
1400+add_directional_animation(animations, "walkload", dirname, "walk", {7, 22}, 10)
1401
1402
1403 tribes:new_worker_type {
1404
1405=== modified file 'data/tribes/workers/barbarians/carrier/init.lua'
1406--- data/tribes/workers/barbarians/carrier/init.lua 2017-02-12 09:10:57 +0000
1407+++ data/tribes/workers/barbarians/carrier/init.lua 2019-05-27 14:29:35 +0000
1408@@ -1,14 +1,9 @@
1409 dirname = path.dirname(__file__)
1410
1411-animations = {
1412- idle = {
1413- pictures = path.list_files(dirname .. "idle_??.png"),
1414- hotspot = { 14, 21 },
1415- fps = 5
1416- }
1417-}
1418-add_walking_animations(animations, "walk", dirname, "walk", {9, 19}, 10)
1419-add_walking_animations(animations, "walkload", dirname, "walkload", {7, 22}, 10)
1420+animations = {}
1421+add_animation(animations, "idle", dirname, "idle", {14, 21}, 5)
1422+add_directional_animation(animations, "walk", dirname, "walk", {9, 19}, 10)
1423+add_directional_animation(animations, "walkload", dirname, "walkload", {7, 22}, 10)
1424
1425
1426 tribes:new_carrier_type {
1427
1428=== modified file 'data/tribes/workers/barbarians/cattlebreeder/init.lua'
1429--- data/tribes/workers/barbarians/cattlebreeder/init.lua 2017-02-12 09:10:57 +0000
1430+++ data/tribes/workers/barbarians/cattlebreeder/init.lua 2019-05-27 14:29:35 +0000
1431@@ -6,8 +6,8 @@
1432 hotspot = { 3, 21 },
1433 }
1434 }
1435-add_walking_animations(animations, "walk", dirname, "walk", {42, 30}, 20)
1436-add_walking_animations(animations, "walkload", dirname, "walk", {42, 30}, 20)
1437+add_directional_animation(animations, "walk", dirname, "walk", {42, 30}, 20)
1438+add_directional_animation(animations, "walkload", dirname, "walk", {42, 30}, 20)
1439
1440
1441 tribes:new_worker_type {
1442
1443=== modified file 'data/tribes/workers/barbarians/charcoal_burner/init.lua'
1444--- data/tribes/workers/barbarians/charcoal_burner/init.lua 2017-02-12 09:10:57 +0000
1445+++ data/tribes/workers/barbarians/charcoal_burner/init.lua 2019-05-27 14:29:35 +0000
1446@@ -6,8 +6,8 @@
1447 hotspot = { 6, 22 },
1448 }
1449 }
1450-add_walking_animations(animations, "walk", dirname, "walk", {8, 22}, 10)
1451-add_walking_animations(animations, "walkload", dirname, "walkload", {9, 23}, 10)
1452+add_directional_animation(animations, "walk", dirname, "walk", {8, 22}, 10)
1453+add_directional_animation(animations, "walkload", dirname, "walkload", {9, 23}, 10)
1454
1455
1456 tribes:new_worker_type {
1457
1458=== modified file 'data/tribes/workers/barbarians/farmer/init.lua'
1459--- data/tribes/workers/barbarians/farmer/init.lua 2019-03-17 07:20:58 +0000
1460+++ data/tribes/workers/barbarians/farmer/init.lua 2019-05-27 14:29:35 +0000
1461@@ -21,8 +21,8 @@
1462 fps = 5
1463 }
1464 }
1465-add_walking_animations(animations, "walk", dirname, "walk", {18, 23}, 10)
1466-add_walking_animations(animations, "walkload", dirname, "walkload", {16, 23}, 10)
1467+add_directional_animation(animations, "walk", dirname, "walk", {18, 23}, 10)
1468+add_directional_animation(animations, "walkload", dirname, "walkload", {16, 23}, 10)
1469
1470
1471 tribes:new_worker_type {
1472
1473=== modified file 'data/tribes/workers/barbarians/fisher/init.lua'
1474--- data/tribes/workers/barbarians/fisher/init.lua 2019-03-17 07:20:58 +0000
1475+++ data/tribes/workers/barbarians/fisher/init.lua 2019-05-27 14:29:35 +0000
1476@@ -11,8 +11,8 @@
1477 fps = 10
1478 }
1479 }
1480-add_walking_animations(animations, "walk", dirname, "walk", {10, 38}, 10)
1481-add_walking_animations(animations, "walkload", dirname, "walk", {10, 38}, 10)
1482+add_directional_animation(animations, "walk", dirname, "walk", {10, 38}, 10)
1483+add_directional_animation(animations, "walkload", dirname, "walk", {10, 38}, 10)
1484
1485
1486 tribes:new_worker_type {
1487
1488=== modified file 'data/tribes/workers/barbarians/gamekeeper/init.lua'
1489--- data/tribes/workers/barbarians/gamekeeper/init.lua 2017-11-18 21:01:55 +0000
1490+++ data/tribes/workers/barbarians/gamekeeper/init.lua 2019-05-27 14:29:35 +0000
1491@@ -16,8 +16,8 @@
1492 fps = 5
1493 }
1494 }
1495-add_walking_animations(animations, "walk", dirname, "walk", {15, 22}, 10)
1496-add_walking_animations(animations, "walkload", dirname, "walkload", {15, 22})
1497+add_directional_animation(animations, "walk", dirname, "walk", {15, 22}, 10)
1498+add_directional_animation(animations, "walkload", dirname, "walkload", {15, 22})
1499
1500
1501 tribes:new_worker_type {
1502
1503=== modified file 'data/tribes/workers/barbarians/gardener/init.lua'
1504--- data/tribes/workers/barbarians/gardener/init.lua 2019-05-19 11:25:28 +0000
1505+++ data/tribes/workers/barbarians/gardener/init.lua 2019-05-27 14:29:35 +0000
1506@@ -16,8 +16,8 @@
1507 fps = 5
1508 }
1509 }
1510-add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10)
1511-add_walking_animations(animations, "walkload", dirname, "walkload", {7, 23}, 10)
1512+add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10)
1513+add_directional_animation(animations, "walkload", dirname, "walkload", {7, 23}, 10)
1514
1515
1516 tribes:new_worker_type {
1517
1518=== modified file 'data/tribes/workers/barbarians/geologist/init.lua'
1519--- data/tribes/workers/barbarians/geologist/init.lua 2019-03-17 07:20:58 +0000
1520+++ data/tribes/workers/barbarians/geologist/init.lua 2019-05-27 14:29:35 +0000
1521@@ -12,8 +12,8 @@
1522 fps = 10
1523 }
1524 }
1525-add_walking_animations(animations, "walk", dirname, "walk", {9, 21}, 10)
1526-add_walking_animations(animations, "walkload", dirname, "walk", {9, 21}, 10)
1527+add_directional_animation(animations, "walk", dirname, "walk", {9, 21}, 10)
1528+add_directional_animation(animations, "walkload", dirname, "walk", {9, 21}, 10)
1529
1530
1531 tribes:new_worker_type {
1532
1533=== modified file 'data/tribes/workers/barbarians/helmsmith/init.lua'
1534--- data/tribes/workers/barbarians/helmsmith/init.lua 2017-02-12 09:10:57 +0000
1535+++ data/tribes/workers/barbarians/helmsmith/init.lua 2019-05-27 14:29:35 +0000
1536@@ -6,8 +6,8 @@
1537 hotspot = { 4, 21 }
1538 }
1539 }
1540-add_walking_animations(animations, "walk", dirname, "walk", {9, 21}, 10)
1541-add_walking_animations(animations, "walkload", dirname, "walkload", {7, 21}, 10)
1542+add_directional_animation(animations, "walk", dirname, "walk", {9, 21}, 10)
1543+add_directional_animation(animations, "walkload", dirname, "walkload", {7, 21}, 10)
1544
1545
1546 tribes:new_worker_type {
1547
1548=== modified file 'data/tribes/workers/barbarians/hunter/init.lua'
1549--- data/tribes/workers/barbarians/hunter/init.lua 2018-02-28 09:38:13 +0000
1550+++ data/tribes/workers/barbarians/hunter/init.lua 2019-05-27 14:29:35 +0000
1551@@ -7,8 +7,8 @@
1552 fps = 10
1553 }
1554 }
1555-add_walking_animations(animations, "walk", dirname, "walk", {6, 26}, 10)
1556-add_walking_animations(animations, "walkload", dirname, "walkload", {6, 26}, 10)
1557+add_directional_animation(animations, "walk", dirname, "walk", {6, 26}, 10)
1558+add_directional_animation(animations, "walkload", dirname, "walkload", {6, 26}, 10)
1559
1560
1561 tribes:new_worker_type {
1562
1563=== modified file 'data/tribes/workers/barbarians/innkeeper/init.lua'
1564--- data/tribes/workers/barbarians/innkeeper/init.lua 2017-02-12 09:10:57 +0000
1565+++ data/tribes/workers/barbarians/innkeeper/init.lua 2019-05-27 14:29:35 +0000
1566@@ -6,8 +6,8 @@
1567 hotspot = { 9, 24 }
1568 }
1569 }
1570-add_walking_animations(animations, "walk", dirname, "walk", {10, 23}, 10)
1571-add_walking_animations(animations, "walkload", dirname, "walkload", {10, 24}, 10)
1572+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 10)
1573+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 24}, 10)
1574
1575
1576 tribes:new_worker_type {
1577
1578=== modified file 'data/tribes/workers/barbarians/lime_burner/init.lua'
1579--- data/tribes/workers/barbarians/lime_burner/init.lua 2017-02-12 09:10:57 +0000
1580+++ data/tribes/workers/barbarians/lime_burner/init.lua 2019-05-27 14:29:35 +0000
1581@@ -6,8 +6,8 @@
1582 hotspot = { 4, 23 },
1583 }
1584 }
1585-add_walking_animations(animations, "walk", dirname, "walk", {7, 23}, 10)
1586-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 27}, 10)
1587+add_directional_animation(animations, "walk", dirname, "walk", {7, 23}, 10)
1588+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 27}, 10)
1589
1590
1591 tribes:new_worker_type {
1592
1593=== modified file 'data/tribes/workers/barbarians/lumberjack/init.lua'
1594--- data/tribes/workers/barbarians/lumberjack/init.lua 2019-03-17 07:20:58 +0000
1595+++ data/tribes/workers/barbarians/lumberjack/init.lua 2019-05-27 14:29:35 +0000
1596@@ -12,8 +12,8 @@
1597 fps = 10
1598 }
1599 }
1600-add_walking_animations(animations, "walk", dirname, "walk", {10, 22}, 10)
1601-add_walking_animations(animations, "walkload", dirname, "walkload", {10, 21}, 10)
1602+add_directional_animation(animations, "walk", dirname, "walk", {10, 22}, 10)
1603+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 21}, 10)
1604
1605
1606 tribes:new_worker_type {
1607@@ -36,8 +36,7 @@
1608 "walk=object",
1609 "playsound=sound/woodcutting/woodcutting 255",
1610 "animate=hacking 10000",
1611- -- "playsound=sound/spoken timber 192",
1612- "playsound=sound/woodcutting/tree-falling 130",
1613+ "playsound=sound/woodcutting/tree_falling 130",
1614 "callobject=fall",
1615 "animate=idle 2000",
1616 "createware=log",
1617
1618=== modified file 'data/tribes/workers/barbarians/miner/init.lua'
1619--- data/tribes/workers/barbarians/miner/init.lua 2017-02-12 09:10:57 +0000
1620+++ data/tribes/workers/barbarians/miner/init.lua 2019-05-27 14:29:35 +0000
1621@@ -6,8 +6,8 @@
1622 hotspot = { 3, 24 }
1623 }
1624 }
1625-add_walking_animations(animations, "walk", dirname, "walk", {9, 25}, 10)
1626-add_walking_animations(animations, "walkload", dirname, "walkload", {6, 23}, 10)
1627+add_directional_animation(animations, "walk", dirname, "walk", {9, 25}, 10)
1628+add_directional_animation(animations, "walkload", dirname, "walkload", {6, 23}, 10)
1629
1630
1631 tribes:new_worker_type {
1632
1633=== modified file 'data/tribes/workers/barbarians/miner_chief/init.lua'
1634--- data/tribes/workers/barbarians/miner_chief/init.lua 2017-02-12 09:10:57 +0000
1635+++ data/tribes/workers/barbarians/miner_chief/init.lua 2019-05-27 14:29:35 +0000
1636@@ -6,8 +6,8 @@
1637 hotspot = { 3, 24 }
1638 }
1639 }
1640-add_walking_animations(animations, "walk", dirname, "walk", {9, 25}, 10)
1641-add_walking_animations(animations, "walkload", dirname, "walkload", {6, 23}, 10)
1642+add_directional_animation(animations, "walk", dirname, "walk", {9, 25}, 10)
1643+add_directional_animation(animations, "walkload", dirname, "walkload", {6, 23}, 10)
1644
1645
1646 tribes:new_worker_type {
1647
1648=== modified file 'data/tribes/workers/barbarians/miner_master/init.lua'
1649--- data/tribes/workers/barbarians/miner_master/init.lua 2017-02-12 09:10:57 +0000
1650+++ data/tribes/workers/barbarians/miner_master/init.lua 2019-05-27 14:29:35 +0000
1651@@ -6,8 +6,8 @@
1652 hotspot = { 2, 24 }
1653 }
1654 }
1655-add_walking_animations(animations, "walk", dirname, "walk", {9, 25}, 10)
1656-add_walking_animations(animations, "walkload", dirname, "walkload", {6, 23}, 10)
1657+add_directional_animation(animations, "walk", dirname, "walk", {9, 25}, 10)
1658+add_directional_animation(animations, "walkload", dirname, "walkload", {6, 23}, 10)
1659
1660
1661 tribes:new_worker_type {
1662
1663=== modified file 'data/tribes/workers/barbarians/ox/init.lua'
1664--- data/tribes/workers/barbarians/ox/init.lua 2019-05-18 13:04:13 +0000
1665+++ data/tribes/workers/barbarians/ox/init.lua 2019-05-27 14:29:35 +0000
1666@@ -8,8 +8,8 @@
1667 }
1668 }
1669 -- TODO(GunChleoc): Make real oxen animations
1670-add_walking_animations(animations, "walk", dirname, "walk", {21, 31}, 20)
1671-add_walking_animations(animations, "walkload", dirname, "walk", {21, 31}, 10)
1672+add_directional_animation(animations, "walk", dirname, "walk", {21, 31}, 20)
1673+add_directional_animation(animations, "walkload", dirname, "walk", {21, 31}, 10)
1674
1675
1676 tribes:new_carrier_type {
1677
1678=== modified file 'data/tribes/workers/barbarians/ranger/init.lua'
1679--- data/tribes/workers/barbarians/ranger/init.lua 2018-02-28 09:38:13 +0000
1680+++ data/tribes/workers/barbarians/ranger/init.lua 2019-05-27 14:29:35 +0000
1681@@ -21,8 +21,8 @@
1682 fps = 5
1683 }
1684 }
1685-add_walking_animations(animations, "walk", dirname, "walk", {11, 23}, 10)
1686-add_walking_animations(animations, "walkload", dirname, "walkload", {11, 23})
1687+add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 10)
1688+add_directional_animation(animations, "walkload", dirname, "walkload", {11, 23})
1689
1690
1691 tribes:new_worker_type {
1692
1693=== modified file 'data/tribes/workers/barbarians/recruit/init.lua'
1694--- data/tribes/workers/barbarians/recruit/init.lua 2018-04-12 07:50:05 +0000
1695+++ data/tribes/workers/barbarians/recruit/init.lua 2019-05-27 14:29:35 +0000
1696@@ -2,7 +2,7 @@
1697
1698 animations = {}
1699 add_animation(animations, "idle", dirname, "idle", {16, 30}, 5)
1700-add_walking_animations(animations, "walk", dirname, "walk", {16, 30}, 10)
1701+add_directional_animation(animations, "walk", dirname, "walk", {16, 30}, 10)
1702
1703
1704 tribes:new_worker_type {
1705
1706=== modified file 'data/tribes/workers/barbarians/scout/init.lua'
1707--- data/tribes/workers/barbarians/scout/init.lua 2018-02-28 09:38:13 +0000
1708+++ data/tribes/workers/barbarians/scout/init.lua 2019-05-27 14:29:35 +0000
1709@@ -6,8 +6,8 @@
1710 hotspot = { 4, 23 },
1711 }
1712 }
1713-add_walking_animations(animations, "walk", dirname, "walk", {9, 25}, 10)
1714-add_walking_animations(animations, "walkload", dirname, "walk", {9, 25}, 10)
1715+add_directional_animation(animations, "walk", dirname, "walk", {9, 25}, 10)
1716+add_directional_animation(animations, "walkload", dirname, "walk", {9, 25}, 10)
1717
1718
1719 tribes:new_worker_type {
1720
1721=== modified file 'data/tribes/workers/barbarians/shipwright/init.lua'
1722--- data/tribes/workers/barbarians/shipwright/init.lua 2019-04-24 06:32:02 +0000
1723+++ data/tribes/workers/barbarians/shipwright/init.lua 2019-05-27 14:29:35 +0000
1724@@ -7,8 +7,8 @@
1725 path = "sound/hammering/hammering",
1726 priority = 64
1727 }
1728-add_walking_animations(animations, "walk", dirname, "walk", {9, 24}, 10)
1729-add_walking_animations(animations, "walkload", dirname, "walkload", {11, 22}, 10)
1730+add_directional_animation(animations, "walk", dirname, "walk", {9, 24}, 10)
1731+add_directional_animation(animations, "walkload", dirname, "walkload", {11, 22}, 10)
1732
1733
1734 tribes:new_worker_type {
1735
1736=== modified file 'data/tribes/workers/barbarians/smelter/init.lua'
1737--- data/tribes/workers/barbarians/smelter/init.lua 2017-02-12 09:10:57 +0000
1738+++ data/tribes/workers/barbarians/smelter/init.lua 2019-05-27 14:29:35 +0000
1739@@ -6,8 +6,8 @@
1740 hotspot = { 7, 21 }
1741 }
1742 }
1743-add_walking_animations(animations, "walk", dirname, "walk", {18, 25}, 10)
1744-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 27}, 10)
1745+add_directional_animation(animations, "walk", dirname, "walk", {18, 25}, 10)
1746+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 27}, 10)
1747
1748
1749 tribes:new_worker_type {
1750
1751=== modified file 'data/tribes/workers/barbarians/soldier/init.lua'
1752--- data/tribes/workers/barbarians/soldier/init.lua 2019-05-19 09:36:33 +0000
1753+++ data/tribes/workers/barbarians/soldier/init.lua 2019-05-27 14:29:35 +0000
1754@@ -57,7 +57,7 @@
1755 fps = 20
1756 },
1757 }
1758-add_walking_animations(animations, "walk", dirname, "walk", {16, 31}, 10)
1759+add_directional_animation(animations, "walk", dirname, "walk", {16, 31}, 10)
1760
1761 all_levels_bar = {
1762 min_health = 0,
1763
1764=== modified file 'data/tribes/workers/barbarians/stonemason/init.lua'
1765--- data/tribes/workers/barbarians/stonemason/init.lua 2019-03-17 07:20:58 +0000
1766+++ data/tribes/workers/barbarians/stonemason/init.lua 2019-05-27 14:29:35 +0000
1767@@ -12,8 +12,8 @@
1768 fps = 10
1769 }
1770 }
1771-add_walking_animations(animations, "walk", dirname, "walk", {9, 24}, 10)
1772-add_walking_animations(animations, "walkload", dirname, "walkload", {7, 22}, 10)
1773+add_directional_animation(animations, "walk", dirname, "walk", {9, 24}, 10)
1774+add_directional_animation(animations, "walkload", dirname, "walkload", {7, 22}, 10)
1775
1776
1777 tribes:new_worker_type {
1778
1779=== modified file 'data/tribes/workers/barbarians/trainer/init.lua'
1780--- data/tribes/workers/barbarians/trainer/init.lua 2017-02-12 09:10:57 +0000
1781+++ data/tribes/workers/barbarians/trainer/init.lua 2019-05-27 14:29:35 +0000
1782@@ -6,8 +6,8 @@
1783 hotspot = { 4, 23 }
1784 }
1785 }
1786-add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10)
1787-add_walking_animations(animations, "walkload", dirname, "walk", {8, 23}, 10)
1788+add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10)
1789+add_directional_animation(animations, "walkload", dirname, "walk", {8, 23}, 10)
1790
1791 tribes:new_worker_type {
1792 msgctxt = "barbarians_worker",
1793
1794=== modified file 'data/tribes/workers/barbarians/weaver/init.lua'
1795--- data/tribes/workers/barbarians/weaver/init.lua 2017-02-12 09:10:57 +0000
1796+++ data/tribes/workers/barbarians/weaver/init.lua 2019-05-27 14:29:35 +0000
1797@@ -6,8 +6,8 @@
1798 hotspot = { 5, 22 }
1799 }
1800 }
1801-add_walking_animations(animations, "walk", dirname, "walk", {7, 23}, 10)
1802-add_walking_animations(animations, "walkload", dirname, "walkload", {11, 28}, 10)
1803+add_directional_animation(animations, "walk", dirname, "walk", {7, 23}, 10)
1804+add_directional_animation(animations, "walkload", dirname, "walkload", {11, 28}, 10)
1805
1806
1807 tribes:new_worker_type {
1808
1809=== modified file 'data/tribes/workers/empire/armorsmith/init.lua'
1810--- data/tribes/workers/empire/armorsmith/init.lua 2017-02-12 09:10:57 +0000
1811+++ data/tribes/workers/empire/armorsmith/init.lua 2019-05-27 14:29:35 +0000
1812@@ -6,8 +6,8 @@
1813 hotspot = { 8, 24 }
1814 }
1815 }
1816-add_walking_animations(animations, "walk", dirname, "walk", {8, 24}, 10)
1817-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10)
1818+add_directional_animation(animations, "walk", dirname, "walk", {8, 24}, 10)
1819+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10)
1820
1821
1822 tribes:new_worker_type {
1823
1824=== modified file 'data/tribes/workers/empire/baker/init.lua'
1825--- data/tribes/workers/empire/baker/init.lua 2017-02-12 09:10:57 +0000
1826+++ data/tribes/workers/empire/baker/init.lua 2019-05-27 14:29:35 +0000
1827@@ -6,8 +6,8 @@
1828 hotspot = { 5, 26 }
1829 }
1830 }
1831-add_walking_animations(animations, "walk", dirname, "walk", {14, 27}, 10)
1832-add_walking_animations(animations, "walkload", dirname, "walkload", {14, 27}, 10)
1833+add_directional_animation(animations, "walk", dirname, "walk", {14, 27}, 10)
1834+add_directional_animation(animations, "walkload", dirname, "walkload", {14, 27}, 10)
1835
1836
1837 tribes:new_worker_type {
1838
1839=== modified file 'data/tribes/workers/empire/brewer/init.lua'
1840--- data/tribes/workers/empire/brewer/init.lua 2017-02-12 09:10:57 +0000
1841+++ data/tribes/workers/empire/brewer/init.lua 2019-05-27 14:29:35 +0000
1842@@ -6,8 +6,8 @@
1843 hotspot = { 8, 24 }
1844 }
1845 }
1846-add_walking_animations(animations, "walk", dirname, "walk", {14, 24}, 10)
1847-add_walking_animations(animations, "walkload", dirname, "walkload", {10, 22}, 10)
1848+add_directional_animation(animations, "walk", dirname, "walk", {14, 24}, 10)
1849+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 22}, 10)
1850
1851
1852 tribes:new_worker_type {
1853
1854=== modified file 'data/tribes/workers/empire/builder/init.lua'
1855--- data/tribes/workers/empire/builder/init.lua 2019-03-17 08:30:43 +0000
1856+++ data/tribes/workers/empire/builder/init.lua 2019-05-27 14:29:35 +0000
1857@@ -16,8 +16,8 @@
1858 fps = 10
1859 }
1860 }
1861-add_walking_animations(animations, "walk", dirname, "walk", {11, 23}, 10)
1862-add_walking_animations(animations, "walkload", dirname, "walk", {11, 23}, 10)
1863+add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 10)
1864+add_directional_animation(animations, "walkload", dirname, "walk", {11, 23}, 10)
1865
1866
1867 tribes:new_worker_type {
1868
1869=== modified file 'data/tribes/workers/empire/carpenter/init.lua'
1870--- data/tribes/workers/empire/carpenter/init.lua 2017-02-12 09:10:57 +0000
1871+++ data/tribes/workers/empire/carpenter/init.lua 2019-05-27 14:29:35 +0000
1872@@ -6,8 +6,8 @@
1873 hotspot = { 7, 29 }
1874 }
1875 }
1876-add_walking_animations(animations, "walk", dirname, "walk", {11, 30}, 10)
1877-add_walking_animations(animations, "walkload", dirname, "walkload", {11, 24}, 10)
1878+add_directional_animation(animations, "walk", dirname, "walk", {11, 30}, 10)
1879+add_directional_animation(animations, "walkload", dirname, "walkload", {11, 24}, 10)
1880
1881
1882 tribes:new_worker_type {
1883
1884=== modified file 'data/tribes/workers/empire/carrier/init.lua'
1885--- data/tribes/workers/empire/carrier/init.lua 2017-02-12 09:10:57 +0000
1886+++ data/tribes/workers/empire/carrier/init.lua 2019-05-27 14:29:35 +0000
1887@@ -1,14 +1,9 @@
1888 dirname = path.dirname(__file__)
1889
1890-animations = {
1891- idle = {
1892- pictures = path.list_files(dirname .. "idle_??.png"),
1893- hotspot = { 7, 22 },
1894- fps = 10
1895- }
1896-}
1897-add_walking_animations(animations, "walk", dirname, "walk", {7, 20}, 10)
1898-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 22}, 10)
1899+animations = {}
1900+add_animation(animations, "idle", dirname, "idle", {7, 22}, 10)
1901+add_directional_animation(animations, "walk", dirname, "walk", {7, 20}, 10)
1902+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 22}, 10)
1903
1904
1905 tribes:new_carrier_type {
1906
1907=== modified file 'data/tribes/workers/empire/charcoal_burner/init.lua'
1908--- data/tribes/workers/empire/charcoal_burner/init.lua 2017-02-12 09:10:57 +0000
1909+++ data/tribes/workers/empire/charcoal_burner/init.lua 2019-05-27 14:29:35 +0000
1910@@ -6,8 +6,8 @@
1911 hotspot = { 11, 23 }
1912 }
1913 }
1914-add_walking_animations(animations, "walk", dirname, "walk", {21, 28}, 10)
1915-add_walking_animations(animations, "walkload", dirname, "walkload", {17, 27}, 10)
1916+add_directional_animation(animations, "walk", dirname, "walk", {21, 28}, 10)
1917+add_directional_animation(animations, "walkload", dirname, "walkload", {17, 27}, 10)
1918
1919
1920 tribes:new_worker_type {
1921
1922=== modified file 'data/tribes/workers/empire/donkey/init.lua'
1923--- data/tribes/workers/empire/donkey/init.lua 2019-05-18 13:04:13 +0000
1924+++ data/tribes/workers/empire/donkey/init.lua 2019-05-27 14:29:35 +0000
1925@@ -7,8 +7,8 @@
1926 fps = 10
1927 }
1928 }
1929-add_walking_animations(animations, "walk", dirname, "walk", {14, 25}, 10)
1930-add_walking_animations(animations, "walkload", dirname, "walk", {14, 25}, 10) -- TODO(GunChleoc): Make animation
1931+add_directional_animation(animations, "walk", dirname, "walk", {14, 25}, 10)
1932+add_directional_animation(animations, "walkload", dirname, "walk", {14, 25}, 10) -- TODO(GunChleoc): Make animation
1933
1934
1935 tribes:new_carrier_type {
1936
1937=== modified file 'data/tribes/workers/empire/donkeybreeder/init.lua'
1938--- data/tribes/workers/empire/donkeybreeder/init.lua 2017-02-12 09:10:57 +0000
1939+++ data/tribes/workers/empire/donkeybreeder/init.lua 2019-05-27 14:29:35 +0000
1940@@ -6,8 +6,8 @@
1941 hotspot = { 19, 23 },
1942 }
1943 }
1944-add_walking_animations(animations, "walk", dirname, "walk", {28, 26}, 10)
1945-add_walking_animations(animations, "walkload", dirname, "walk", {28, 26}, 10)
1946+add_directional_animation(animations, "walk", dirname, "walk", {28, 26}, 10)
1947+add_directional_animation(animations, "walkload", dirname, "walk", {28, 26}, 10)
1948
1949
1950 tribes:new_worker_type {
1951
1952=== modified file 'data/tribes/workers/empire/farmer/init.lua'
1953--- data/tribes/workers/empire/farmer/init.lua 2019-03-17 07:20:58 +0000
1954+++ data/tribes/workers/empire/farmer/init.lua 2019-05-27 14:29:35 +0000
1955@@ -21,8 +21,8 @@
1956 fps = 5
1957 }
1958 }
1959-add_walking_animations(animations, "walk", dirname, "walk", {18, 24}, 10)
1960-add_walking_animations(animations, "walkload", dirname, "walk", {18, 24}, 10)
1961+add_directional_animation(animations, "walk", dirname, "walk", {18, 24}, 10)
1962+add_directional_animation(animations, "walkload", dirname, "walk", {18, 24}, 10)
1963
1964
1965 tribes:new_worker_type {
1966
1967=== modified file 'data/tribes/workers/empire/fisher/init.lua'
1968--- data/tribes/workers/empire/fisher/init.lua 2019-03-17 07:20:58 +0000
1969+++ data/tribes/workers/empire/fisher/init.lua 2019-05-27 14:29:35 +0000
1970@@ -11,8 +11,8 @@
1971 fps = 10,
1972 }
1973 }
1974-add_walking_animations(animations, "walk", dirname, "walk", {10, 38}, 20)
1975-add_walking_animations(animations, "walkload", dirname, "walk", {10, 38}, 20)
1976+add_directional_animation(animations, "walk", dirname, "walk", {10, 38}, 20)
1977+add_directional_animation(animations, "walkload", dirname, "walk", {10, 38}, 20)
1978
1979
1980 tribes:new_worker_type {
1981
1982=== modified file 'data/tribes/workers/empire/forester/init.lua'
1983--- data/tribes/workers/empire/forester/init.lua 2018-02-28 09:38:13 +0000
1984+++ data/tribes/workers/empire/forester/init.lua 2019-05-27 14:29:35 +0000
1985@@ -21,8 +21,8 @@
1986 fps = 5
1987 }
1988 }
1989-add_walking_animations(animations, "walk", dirname, "walk", {10, 23}, 10)
1990-add_walking_animations(animations, "walkload", dirname, "walk", {10, 23}, 10)
1991+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 10)
1992+add_directional_animation(animations, "walkload", dirname, "walk", {10, 23}, 10)
1993
1994
1995 tribes:new_worker_type {
1996
1997=== modified file 'data/tribes/workers/empire/geologist/init.lua'
1998--- data/tribes/workers/empire/geologist/init.lua 2019-03-17 07:20:58 +0000
1999+++ data/tribes/workers/empire/geologist/init.lua 2019-05-27 14:29:35 +0000
2000@@ -12,8 +12,8 @@
2001 fps = 10
2002 }
2003 }
2004-add_walking_animations(animations, "walk", dirname, "walk", {9, 21}, 10)
2005-add_walking_animations(animations, "walkload", dirname, "walk", {9, 21}, 10)
2006+add_directional_animation(animations, "walk", dirname, "walk", {9, 21}, 10)
2007+add_directional_animation(animations, "walkload", dirname, "walk", {9, 21}, 10)
2008
2009
2010 tribes:new_worker_type {
2011
2012=== modified file 'data/tribes/workers/empire/hunter/init.lua'
2013--- data/tribes/workers/empire/hunter/init.lua 2017-11-18 21:08:26 +0000
2014+++ data/tribes/workers/empire/hunter/init.lua 2019-05-27 14:29:35 +0000
2015@@ -7,8 +7,8 @@
2016 fps = 10
2017 }
2018 }
2019-add_walking_animations(animations, "walk", dirname, "walk", {9, 32}, 10)
2020-add_walking_animations(animations, "walkload", dirname, "walkload", {9, 32}, 10)
2021+add_directional_animation(animations, "walk", dirname, "walk", {9, 32}, 10)
2022+add_directional_animation(animations, "walkload", dirname, "walkload", {9, 32}, 10)
2023
2024
2025 tribes:new_worker_type {
2026
2027=== modified file 'data/tribes/workers/empire/innkeeper/init.lua'
2028--- data/tribes/workers/empire/innkeeper/init.lua 2017-02-12 09:10:57 +0000
2029+++ data/tribes/workers/empire/innkeeper/init.lua 2019-05-27 14:29:35 +0000
2030@@ -6,8 +6,8 @@
2031 hotspot = { 4, 26 },
2032 }
2033 }
2034-add_walking_animations(animations, "walk", dirname, "walk", {6, 26}, 10)
2035-add_walking_animations(animations, "walkload", dirname, "walkload", {6, 26}, 10)
2036+add_directional_animation(animations, "walk", dirname, "walk", {6, 26}, 10)
2037+add_directional_animation(animations, "walkload", dirname, "walkload", {6, 26}, 10)
2038
2039
2040 tribes:new_worker_type {
2041
2042=== modified file 'data/tribes/workers/empire/lumberjack/init.lua'
2043--- data/tribes/workers/empire/lumberjack/init.lua 2019-03-17 07:20:58 +0000
2044+++ data/tribes/workers/empire/lumberjack/init.lua 2019-05-27 14:29:35 +0000
2045@@ -12,8 +12,8 @@
2046 fps = 10
2047 }
2048 }
2049-add_walking_animations(animations, "walk", dirname, "walk", {9, 22}, 10)
2050-add_walking_animations(animations, "walkload", dirname, "walkload", {9, 22}, 10)
2051+add_directional_animation(animations, "walk", dirname, "walk", {9, 22}, 10)
2052+add_directional_animation(animations, "walkload", dirname, "walkload", {9, 22}, 10)
2053
2054
2055 tribes:new_worker_type {
2056@@ -36,8 +36,7 @@
2057 "walk=object",
2058 "playsound=sound/woodcutting/fast_woodcutting 250",
2059 "animate=hacking 10000",
2060- -- "playsound=sound/spoken/timber 156",
2061- "playsound=sound/woodcutting/tree-falling 130",
2062+ "playsound=sound/woodcutting/tree_falling 130",
2063 "callobject=fall",
2064 "animate=idle 2000",
2065 "createware=log",
2066
2067=== modified file 'data/tribes/workers/empire/miller/init.lua'
2068--- data/tribes/workers/empire/miller/init.lua 2017-02-12 09:10:57 +0000
2069+++ data/tribes/workers/empire/miller/init.lua 2019-05-27 14:29:35 +0000
2070@@ -6,8 +6,8 @@
2071 hotspot = { 5, 23 }
2072 }
2073 }
2074-add_walking_animations(animations, "walk", dirname, "walk", {8, 24}, 10)
2075-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10)
2076+add_directional_animation(animations, "walk", dirname, "walk", {8, 24}, 10)
2077+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10)
2078
2079
2080 tribes:new_worker_type {
2081
2082=== modified file 'data/tribes/workers/empire/miner/init.lua'
2083--- data/tribes/workers/empire/miner/init.lua 2017-02-12 09:10:57 +0000
2084+++ data/tribes/workers/empire/miner/init.lua 2019-05-27 14:29:35 +0000
2085@@ -6,8 +6,8 @@
2086 hotspot = { 3, 23 }
2087 }
2088 }
2089-add_walking_animations(animations, "walk", dirname, "walk", {9, 24}, 10)
2090-add_walking_animations(animations, "walkload", dirname, "walkload", {7, 24}, 10)
2091+add_directional_animation(animations, "walk", dirname, "walk", {9, 24}, 10)
2092+add_directional_animation(animations, "walkload", dirname, "walkload", {7, 24}, 10)
2093
2094
2095 tribes:new_worker_type {
2096
2097=== modified file 'data/tribes/workers/empire/miner_master/init.lua'
2098--- data/tribes/workers/empire/miner_master/init.lua 2017-02-12 09:10:57 +0000
2099+++ data/tribes/workers/empire/miner_master/init.lua 2019-05-27 14:29:35 +0000
2100@@ -6,8 +6,8 @@
2101 hotspot = { 7, 22 }
2102 }
2103 }
2104-add_walking_animations(animations, "walk", dirname, "walk", {11, 22}, 10)
2105-add_walking_animations(animations, "walkload", dirname, "walkload", {10, 22}, 10)
2106+add_directional_animation(animations, "walk", dirname, "walk", {11, 22}, 10)
2107+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 22}, 10)
2108
2109
2110 tribes:new_worker_type {
2111
2112=== modified file 'data/tribes/workers/empire/pigbreeder/init.lua'
2113--- data/tribes/workers/empire/pigbreeder/init.lua 2017-02-12 09:10:57 +0000
2114+++ data/tribes/workers/empire/pigbreeder/init.lua 2019-05-27 14:29:35 +0000
2115@@ -6,8 +6,8 @@
2116 hotspot = { 16, 29 },
2117 }
2118 }
2119-add_walking_animations(animations, "walk", dirname, "walk", {27, 29}, 20)
2120-add_walking_animations(animations, "walkload", dirname, "walk", {27, 29}, 20)
2121+add_directional_animation(animations, "walk", dirname, "walk", {27, 29}, 20)
2122+add_directional_animation(animations, "walkload", dirname, "walk", {27, 29}, 20)
2123
2124
2125 tribes:new_worker_type {
2126
2127=== modified file 'data/tribes/workers/empire/recruit/init.lua'
2128--- data/tribes/workers/empire/recruit/init.lua 2017-05-25 21:24:54 +0000
2129+++ data/tribes/workers/empire/recruit/init.lua 2019-05-27 14:29:35 +0000
2130@@ -7,7 +7,7 @@
2131 fps = 5
2132 },
2133 }
2134-add_walking_animations(animations, "walk", dirname, "walk", {10, 30}, 10)
2135+add_directional_animation(animations, "walk", dirname, "walk", {10, 30}, 10)
2136
2137
2138 tribes:new_worker_type {
2139
2140=== modified file 'data/tribes/workers/empire/scout/init.lua'
2141--- data/tribes/workers/empire/scout/init.lua 2018-02-28 09:38:13 +0000
2142+++ data/tribes/workers/empire/scout/init.lua 2019-05-27 14:29:35 +0000
2143@@ -6,8 +6,8 @@
2144 hotspot = { 4, 22 },
2145 }
2146 }
2147-add_walking_animations(animations, "walk", dirname, "walk", {9, 24}, 10)
2148-add_walking_animations(animations, "walkload", dirname, "walk", {9, 24}, 10)
2149+add_directional_animation(animations, "walk", dirname, "walk", {9, 24}, 10)
2150+add_directional_animation(animations, "walkload", dirname, "walk", {9, 24}, 10)
2151
2152
2153 tribes:new_worker_type {
2154
2155=== modified file 'data/tribes/workers/empire/shepherd/init.lua'
2156--- data/tribes/workers/empire/shepherd/init.lua 2017-02-12 09:10:57 +0000
2157+++ data/tribes/workers/empire/shepherd/init.lua 2019-05-27 14:29:35 +0000
2158@@ -6,8 +6,8 @@
2159 hotspot = { 16, 29 },
2160 }
2161 }
2162-add_walking_animations(animations, "walk", dirname, "walk", {26, 30}, 20)
2163-add_walking_animations(animations, "walkload", dirname, "walk", {26, 30}, 20)
2164+add_directional_animation(animations, "walk", dirname, "walk", {26, 30}, 20)
2165+add_directional_animation(animations, "walkload", dirname, "walk", {26, 30}, 20)
2166
2167
2168 tribes:new_worker_type {
2169
2170=== modified file 'data/tribes/workers/empire/shipwright/init.lua'
2171--- data/tribes/workers/empire/shipwright/init.lua 2019-03-17 08:30:43 +0000
2172+++ data/tribes/workers/empire/shipwright/init.lua 2019-05-27 14:29:35 +0000
2173@@ -15,8 +15,8 @@
2174 fps = 10
2175 }
2176 }
2177-add_walking_animations(animations, "walk", dirname, "walk", {11, 24}, 10)
2178-add_walking_animations(animations, "walkload", dirname, "walkload", {9, 22}, 10)
2179+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 10)
2180+add_directional_animation(animations, "walkload", dirname, "walkload", {9, 22}, 10)
2181
2182
2183 tribes:new_worker_type {
2184
2185=== modified file 'data/tribes/workers/empire/smelter/init.lua'
2186--- data/tribes/workers/empire/smelter/init.lua 2017-02-12 09:10:57 +0000
2187+++ data/tribes/workers/empire/smelter/init.lua 2019-05-27 14:29:35 +0000
2188@@ -6,8 +6,8 @@
2189 hotspot = { 4, 23 }
2190 }
2191 }
2192-add_walking_animations(animations, "walk", dirname, "walk", {18, 25}, 10)
2193-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 22}, 10)
2194+add_directional_animation(animations, "walk", dirname, "walk", {18, 25}, 10)
2195+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 22}, 10)
2196
2197
2198 tribes:new_worker_type {
2199
2200=== modified file 'data/tribes/workers/empire/soldier/init.lua'
2201--- data/tribes/workers/empire/soldier/init.lua 2019-05-19 09:36:33 +0000
2202+++ data/tribes/workers/empire/soldier/init.lua 2019-05-27 14:29:35 +0000
2203@@ -57,7 +57,7 @@
2204 fps = 10
2205 }
2206 }
2207-add_walking_animations(animations, "walk", dirname, "walk", {10, 36}, 10)
2208+add_directional_animation(animations, "walk", dirname, "walk", {10, 36}, 10)
2209
2210 all_levels_emp = {
2211 min_health = 0,
2212
2213=== modified file 'data/tribes/workers/empire/stonemason/init.lua'
2214--- data/tribes/workers/empire/stonemason/init.lua 2019-03-17 07:20:58 +0000
2215+++ data/tribes/workers/empire/stonemason/init.lua 2019-05-27 14:29:35 +0000
2216@@ -12,8 +12,8 @@
2217 fps = 10
2218 }
2219 }
2220-add_walking_animations(animations, "walk", dirname, "walk", {9, 22}, 10)
2221-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 25}, 10)
2222+add_directional_animation(animations, "walk", dirname, "walk", {9, 22}, 10)
2223+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 25}, 10)
2224
2225
2226 tribes:new_worker_type {
2227
2228=== modified file 'data/tribes/workers/empire/toolsmith/init.lua'
2229--- data/tribes/workers/empire/toolsmith/init.lua 2017-02-12 09:10:57 +0000
2230+++ data/tribes/workers/empire/toolsmith/init.lua 2019-05-27 14:29:35 +0000
2231@@ -6,8 +6,8 @@
2232 hotspot = { 8, 24 }
2233 }
2234 }
2235-add_walking_animations(animations, "walk", dirname, "walk", {8, 24}, 10)
2236-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10)
2237+add_directional_animation(animations, "walk", dirname, "walk", {8, 24}, 10)
2238+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10)
2239
2240
2241 tribes:new_worker_type {
2242
2243=== modified file 'data/tribes/workers/empire/trainer/init.lua'
2244--- data/tribes/workers/empire/trainer/init.lua 2017-02-12 09:10:57 +0000
2245+++ data/tribes/workers/empire/trainer/init.lua 2019-05-27 14:29:35 +0000
2246@@ -6,8 +6,8 @@
2247 hotspot = { 6, 23 }
2248 }
2249 }
2250-add_walking_animations(animations, "walk", dirname, "walk", {9, 23}, 10)
2251-add_walking_animations(animations, "walkload", dirname, "walk", {9, 23}, 10)
2252+add_directional_animation(animations, "walk", dirname, "walk", {9, 23}, 10)
2253+add_directional_animation(animations, "walkload", dirname, "walk", {9, 23}, 10)
2254
2255
2256 tribes:new_worker_type {
2257
2258=== modified file 'data/tribes/workers/empire/vinefarmer/init.lua'
2259--- data/tribes/workers/empire/vinefarmer/init.lua 2018-02-28 09:38:13 +0000
2260+++ data/tribes/workers/empire/vinefarmer/init.lua 2019-05-27 14:29:35 +0000
2261@@ -21,8 +21,8 @@
2262 fps = 10
2263 }
2264 }
2265-add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10)
2266-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10)
2267+add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10)
2268+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10)
2269
2270
2271 tribes:new_worker_type {
2272
2273=== modified file 'data/tribes/workers/empire/vintner/init.lua'
2274--- data/tribes/workers/empire/vintner/init.lua 2017-02-12 09:10:57 +0000
2275+++ data/tribes/workers/empire/vintner/init.lua 2019-05-27 14:29:35 +0000
2276@@ -7,8 +7,8 @@
2277 hotspot = { 12, 24 }
2278 }
2279 }
2280-add_walking_animations(animations, "walk", dirname, "walk", {12, 24}, 10)
2281-add_walking_animations(animations, "walkload", dirname, "walk", {12, 24}, 10)
2282+add_directional_animation(animations, "walk", dirname, "walk", {12, 24}, 10)
2283+add_directional_animation(animations, "walkload", dirname, "walk", {12, 24}, 10)
2284
2285
2286 tribes:new_worker_type {
2287
2288=== modified file 'data/tribes/workers/empire/weaponsmith/init.lua'
2289--- data/tribes/workers/empire/weaponsmith/init.lua 2017-02-12 09:10:57 +0000
2290+++ data/tribes/workers/empire/weaponsmith/init.lua 2019-05-27 14:29:35 +0000
2291@@ -6,8 +6,8 @@
2292 hotspot = { 8, 24 }
2293 }
2294 }
2295-add_walking_animations(animations, "walk", dirname, "walk", {8, 24}, 10)
2296-add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10)
2297+add_directional_animation(animations, "walk", dirname, "walk", {8, 24}, 10)
2298+add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10)
2299
2300
2301 tribes:new_worker_type {
2302
2303=== modified file 'data/tribes/workers/empire/weaver/init.lua'
2304--- data/tribes/workers/empire/weaver/init.lua 2017-02-12 09:10:57 +0000
2305+++ data/tribes/workers/empire/weaver/init.lua 2019-05-27 14:29:35 +0000
2306@@ -6,8 +6,8 @@
2307 hotspot = { 4, 24 },
2308 }
2309 }
2310-add_walking_animations(animations, "walk", dirname, "walk", {6, 26}, 10)
2311-add_walking_animations(animations, "walkload", dirname, "walkload", {6, 26}, 10)
2312+add_directional_animation(animations, "walk", dirname, "walk", {6, 26}, 10)
2313+add_directional_animation(animations, "walkload", dirname, "walkload", {6, 26}, 10)
2314
2315
2316 tribes:new_worker_type {
2317
2318=== modified file 'data/tribes/workers/frisians/baker/init.lua'
2319--- data/tribes/workers/frisians/baker/init.lua 2018-11-30 10:27:21 +0000
2320+++ data/tribes/workers/frisians/baker/init.lua 2019-05-27 14:29:35 +0000
2321@@ -6,8 +6,8 @@
2322 hotspot = {8, 23},
2323 }
2324 }
2325-add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15)
2326-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2327+add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15)
2328+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2329
2330 tribes:new_worker_type {
2331 msgctxt = "frisians_worker",
2332
2333=== modified file 'data/tribes/workers/frisians/baker_master/init.lua'
2334--- data/tribes/workers/frisians/baker_master/init.lua 2018-11-30 10:27:21 +0000
2335+++ data/tribes/workers/frisians/baker_master/init.lua 2019-05-27 14:29:35 +0000
2336@@ -6,8 +6,8 @@
2337 hotspot = {8, 23},
2338 }
2339 }
2340-add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15)
2341-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2342+add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15)
2343+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2344
2345 tribes:new_worker_type {
2346 msgctxt = "frisians_worker",
2347
2348=== modified file 'data/tribes/workers/frisians/beekeeper/init.lua'
2349--- data/tribes/workers/frisians/beekeeper/init.lua 2018-11-30 10:27:21 +0000
2350+++ data/tribes/workers/frisians/beekeeper/init.lua 2019-05-27 14:29:35 +0000
2351@@ -11,8 +11,8 @@
2352 fps = 50
2353 }
2354 }
2355-add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15)
2356-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2357+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15)
2358+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2359
2360 tribes:new_worker_type {
2361 msgctxt = "frisians_worker",
2362
2363=== modified file 'data/tribes/workers/frisians/berry_farmer/init.lua'
2364--- data/tribes/workers/frisians/berry_farmer/init.lua 2018-03-25 18:28:00 +0000
2365+++ data/tribes/workers/frisians/berry_farmer/init.lua 2019-05-27 14:29:35 +0000
2366@@ -21,7 +21,7 @@
2367 fps = 10
2368 }
2369 }
2370-add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15)
2371+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15)
2372
2373 tribes:new_worker_type {
2374 msgctxt = "frisians_worker",
2375
2376=== modified file 'data/tribes/workers/frisians/blacksmith/init.lua'
2377--- data/tribes/workers/frisians/blacksmith/init.lua 2018-11-30 10:27:21 +0000
2378+++ data/tribes/workers/frisians/blacksmith/init.lua 2019-05-27 14:29:35 +0000
2379@@ -6,8 +6,8 @@
2380 hotspot = {8, 23},
2381 }
2382 }
2383-add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15)
2384-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2385+add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15)
2386+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2387
2388 tribes:new_worker_type {
2389 msgctxt = "frisians_worker",
2390
2391=== modified file 'data/tribes/workers/frisians/blacksmith_master/init.lua'
2392--- data/tribes/workers/frisians/blacksmith_master/init.lua 2018-11-30 10:27:21 +0000
2393+++ data/tribes/workers/frisians/blacksmith_master/init.lua 2019-05-27 14:29:35 +0000
2394@@ -6,8 +6,8 @@
2395 hotspot = {8, 23},
2396 }
2397 }
2398-add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15)
2399-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2400+add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15)
2401+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2402
2403 tribes:new_worker_type {
2404 msgctxt = "frisians_worker",
2405
2406=== modified file 'data/tribes/workers/frisians/brewer/init.lua'
2407--- data/tribes/workers/frisians/brewer/init.lua 2018-11-30 10:27:21 +0000
2408+++ data/tribes/workers/frisians/brewer/init.lua 2019-05-27 14:29:35 +0000
2409@@ -6,8 +6,8 @@
2410 hotspot = {8, 23},
2411 }
2412 }
2413-add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15)
2414-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2415+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15)
2416+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2417
2418 tribes:new_worker_type {
2419 msgctxt = "frisians_worker",
2420
2421=== modified file 'data/tribes/workers/frisians/brewer_master/init.lua'
2422--- data/tribes/workers/frisians/brewer_master/init.lua 2018-11-30 10:27:21 +0000
2423+++ data/tribes/workers/frisians/brewer_master/init.lua 2019-05-27 14:29:35 +0000
2424@@ -6,8 +6,8 @@
2425 hotspot = {8, 23},
2426 }
2427 }
2428-add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15)
2429-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2430+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15)
2431+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2432
2433 tribes:new_worker_type {
2434 msgctxt = "frisians_worker",
2435
2436=== modified file 'data/tribes/workers/frisians/brickmaker/init.lua'
2437--- data/tribes/workers/frisians/brickmaker/init.lua 2018-11-30 10:27:21 +0000
2438+++ data/tribes/workers/frisians/brickmaker/init.lua 2019-05-27 14:29:35 +0000
2439@@ -6,8 +6,8 @@
2440 hotspot = {8, 23},
2441 },
2442 }
2443-add_walking_animations (animations, "walk", dirname, "walk", {13, 23}, 15)
2444-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 23}, 15)
2445+add_directional_animation(animations, "walk", dirname, "walk", {13, 23}, 15)
2446+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 23}, 15)
2447
2448 tribes:new_worker_type {
2449 msgctxt = "frisians_worker",
2450
2451=== modified file 'data/tribes/workers/frisians/builder/init.lua'
2452--- data/tribes/workers/frisians/builder/init.lua 2019-03-17 08:30:43 +0000
2453+++ data/tribes/workers/frisians/builder/init.lua 2019-05-27 14:29:35 +0000
2454@@ -16,8 +16,8 @@
2455 fps = 10
2456 }
2457 }
2458-add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15)
2459-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 24}, 15)
2460+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15)
2461+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 24}, 15)
2462
2463 tribes:new_worker_type {
2464 msgctxt = "frisians_worker",
2465
2466=== modified file 'data/tribes/workers/frisians/carrier/init.lua'
2467--- data/tribes/workers/frisians/carrier/init.lua 2018-02-06 11:17:48 +0000
2468+++ data/tribes/workers/frisians/carrier/init.lua 2019-05-27 14:29:35 +0000
2469@@ -1,14 +1,9 @@
2470 dirname = path.dirname (__file__)
2471
2472-animations = {
2473- idle = {
2474- pictures = path.list_files (dirname .. "idle_???.png"),
2475- hotspot = {17, 18},
2476- fps = 10
2477- },
2478-}
2479-add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15)
2480-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2481+animations = {}
2482+add_animation(animations, "idle", dirname, "idle", {17, 18}, 10)
2483+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15)
2484+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2485
2486 tribes:new_carrier_type {
2487 msgctxt = "frisians_worker",
2488
2489=== modified file 'data/tribes/workers/frisians/charcoal_burner/init.lua'
2490--- data/tribes/workers/frisians/charcoal_burner/init.lua 2018-11-30 10:27:21 +0000
2491+++ data/tribes/workers/frisians/charcoal_burner/init.lua 2019-05-27 14:29:35 +0000
2492@@ -6,8 +6,8 @@
2493 hotspot = {8, 23},
2494 }
2495 }
2496-add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15)
2497-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2498+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15)
2499+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2500
2501 tribes:new_worker_type {
2502 msgctxt = "frisians_worker",
2503
2504=== modified file 'data/tribes/workers/frisians/claydigger/init.lua'
2505--- data/tribes/workers/frisians/claydigger/init.lua 2018-11-30 10:27:21 +0000
2506+++ data/tribes/workers/frisians/claydigger/init.lua 2019-05-27 14:29:35 +0000
2507@@ -11,8 +11,8 @@
2508 fps = 20
2509 }
2510 }
2511-add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15)
2512-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2513+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15)
2514+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2515
2516 tribes:new_worker_type {
2517 msgctxt = "frisians_worker",
2518
2519=== modified file 'data/tribes/workers/frisians/farmer/init.lua'
2520--- data/tribes/workers/frisians/farmer/init.lua 2018-11-30 10:27:21 +0000
2521+++ data/tribes/workers/frisians/farmer/init.lua 2019-05-27 14:29:35 +0000
2522@@ -21,8 +21,8 @@
2523 fps = 10
2524 }
2525 }
2526-add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15)
2527-add_walking_animations (animations, "walkload", dirname, "walkload", {16, 26}, 15)
2528+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15)
2529+add_directional_animation(animations, "walkload", dirname, "walkload", {16, 26}, 15)
2530
2531 tribes:new_worker_type {
2532 msgctxt = "frisians_worker",
2533
2534=== modified file 'data/tribes/workers/frisians/fisher/init.lua'
2535--- data/tribes/workers/frisians/fisher/init.lua 2018-11-30 10:27:21 +0000
2536+++ data/tribes/workers/frisians/fisher/init.lua 2019-05-27 14:29:35 +0000
2537@@ -16,8 +16,8 @@
2538 fps = 10
2539 }
2540 }
2541-add_walking_animations (animations, "walk", dirname, "walk", {13, 25}, 15)
2542-add_walking_animations (animations, "walkload", dirname, "walkload", {13, 26}, 15)
2543+add_directional_animation(animations, "walk", dirname, "walk", {13, 25}, 15)
2544+add_directional_animation(animations, "walkload", dirname, "walkload", {13, 26}, 15)
2545
2546 tribes:new_worker_type {
2547 msgctxt = "frisians_worker",
2548
2549=== modified file 'data/tribes/workers/frisians/forester/init.lua'
2550--- data/tribes/workers/frisians/forester/init.lua 2018-03-25 18:28:00 +0000
2551+++ data/tribes/workers/frisians/forester/init.lua 2019-05-27 14:29:35 +0000
2552@@ -21,7 +21,7 @@
2553 fps = 10
2554 }
2555 }
2556-add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15)
2557+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15)
2558
2559 tribes:new_worker_type {
2560 msgctxt = "frisians_worker",
2561
2562=== modified file 'data/tribes/workers/frisians/fruit_collector/init.lua'
2563--- data/tribes/workers/frisians/fruit_collector/init.lua 2018-11-30 10:27:21 +0000
2564+++ data/tribes/workers/frisians/fruit_collector/init.lua 2019-05-27 14:29:35 +0000
2565@@ -12,8 +12,8 @@
2566 fps = 10
2567 }
2568 }
2569-add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15)
2570-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2571+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15)
2572+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2573
2574 tribes:new_worker_type {
2575 msgctxt = "frisians_worker",
2576
2577=== modified file 'data/tribes/workers/frisians/geologist/init.lua'
2578--- data/tribes/workers/frisians/geologist/init.lua 2018-03-25 18:28:00 +0000
2579+++ data/tribes/workers/frisians/geologist/init.lua 2019-05-27 14:29:35 +0000
2580@@ -12,7 +12,7 @@
2581 fps = 10
2582 }
2583 }
2584-add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15)
2585+add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15)
2586
2587 tribes:new_worker_type {
2588 msgctxt = "frisians_worker",
2589
2590=== modified file 'data/tribes/workers/frisians/hunter/init.lua'
2591--- data/tribes/workers/frisians/hunter/init.lua 2018-11-30 10:27:21 +0000
2592+++ data/tribes/workers/frisians/hunter/init.lua 2019-05-27 14:29:35 +0000
2593@@ -7,8 +7,8 @@
2594 fps = 10
2595 }
2596 }
2597-add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15)
2598-add_walking_animations (animations, "walkload", dirname, "walkload", {11, 26}, 15)
2599+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15)
2600+add_directional_animation(animations, "walkload", dirname, "walkload", {11, 26}, 15)
2601
2602 tribes:new_worker_type {
2603 msgctxt = "frisians_worker",
2604
2605=== modified file 'data/tribes/workers/frisians/landlady/init.lua'
2606--- data/tribes/workers/frisians/landlady/init.lua 2018-11-30 10:27:21 +0000
2607+++ data/tribes/workers/frisians/landlady/init.lua 2019-05-27 14:29:35 +0000
2608@@ -6,8 +6,8 @@
2609 hotspot = {9, 23},
2610 }
2611 }
2612-add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15)
2613-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2614+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15)
2615+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2616
2617 tribes:new_worker_type {
2618 msgctxt = "frisians_worker",
2619
2620=== modified file 'data/tribes/workers/frisians/miner/init.lua'
2621--- data/tribes/workers/frisians/miner/init.lua 2018-11-30 10:27:21 +0000
2622+++ data/tribes/workers/frisians/miner/init.lua 2019-05-27 14:29:35 +0000
2623@@ -6,8 +6,8 @@
2624 hotspot = {8, 24},
2625 }
2626 }
2627-add_walking_animations (animations, "walk", dirname, "walk", {10, 24}, 15)
2628-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2629+add_directional_animation(animations, "walk", dirname, "walk", {10, 24}, 15)
2630+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2631
2632 tribes:new_worker_type {
2633 msgctxt = "frisians_worker",
2634
2635=== modified file 'data/tribes/workers/frisians/miner_master/init.lua'
2636--- data/tribes/workers/frisians/miner_master/init.lua 2018-11-30 10:27:21 +0000
2637+++ data/tribes/workers/frisians/miner_master/init.lua 2019-05-27 14:29:35 +0000
2638@@ -6,8 +6,8 @@
2639 hotspot = {8, 24},
2640 }
2641 }
2642-add_walking_animations (animations, "walk", dirname, "walk", {10, 24}, 15)
2643-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2644+add_directional_animation(animations, "walk", dirname, "walk", {10, 24}, 15)
2645+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2646
2647 tribes:new_worker_type {
2648 msgctxt = "frisians_worker",
2649
2650=== modified file 'data/tribes/workers/frisians/reed_farmer/init.lua'
2651--- data/tribes/workers/frisians/reed_farmer/init.lua 2019-05-19 11:25:28 +0000
2652+++ data/tribes/workers/frisians/reed_farmer/init.lua 2019-05-27 14:29:35 +0000
2653@@ -21,8 +21,8 @@
2654 fps = 10
2655 }
2656 }
2657-add_walking_animations (animations, "walk", dirname, "walk", {10, 24}, 15)
2658-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2659+add_directional_animation(animations, "walk", dirname, "walk", {10, 24}, 15)
2660+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2661
2662 tribes:new_worker_type {
2663 msgctxt = "frisians_worker",
2664
2665=== modified file 'data/tribes/workers/frisians/reindeer/init.lua'
2666--- data/tribes/workers/frisians/reindeer/init.lua 2019-05-18 13:04:13 +0000
2667+++ data/tribes/workers/frisians/reindeer/init.lua 2019-05-27 14:29:35 +0000
2668@@ -8,8 +8,8 @@
2669 }
2670 }
2671
2672-add_walking_animations (animations, "walk", dirname, "walk", {21, 43}, 20)
2673-add_walking_animations (animations, "walkload", dirname, "walk", {21, 43}, 20)
2674+add_directional_animation(animations, "walk", dirname, "walk", {21, 43}, 20)
2675+add_directional_animation(animations, "walkload", dirname, "walk", {21, 43}, 20)
2676
2677 tribes:new_carrier_type {
2678 msgctxt = "frisians_worker",
2679
2680=== modified file 'data/tribes/workers/frisians/reindeer_breeder/init.lua'
2681--- data/tribes/workers/frisians/reindeer_breeder/init.lua 2018-11-30 10:27:21 +0000
2682+++ data/tribes/workers/frisians/reindeer_breeder/init.lua 2019-05-27 14:29:35 +0000
2683@@ -6,8 +6,8 @@
2684 hotspot = {8, 23},
2685 }
2686 }
2687-add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 10)
2688-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 10)
2689+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 10)
2690+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 10)
2691
2692 tribes:new_worker_type {
2693 msgctxt = "frisians_worker",
2694
2695=== modified file 'data/tribes/workers/frisians/scout/init.lua'
2696--- data/tribes/workers/frisians/scout/init.lua 2018-11-30 10:27:21 +0000
2697+++ data/tribes/workers/frisians/scout/init.lua 2019-05-27 14:29:35 +0000
2698@@ -6,8 +6,8 @@
2699 hotspot = {8, 23},
2700 }
2701 }
2702-add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15)
2703-add_walking_animations (animations, "walkload", dirname, "walkload", {12, 26}, 15)
2704+add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15)
2705+add_directional_animation(animations, "walkload", dirname, "walkload", {12, 26}, 15)
2706
2707 tribes:new_worker_type {
2708 msgctxt = "frisians_worker",
2709
2710=== modified file 'data/tribes/workers/frisians/seamstress/init.lua'
2711--- data/tribes/workers/frisians/seamstress/init.lua 2018-11-30 10:27:21 +0000
2712+++ data/tribes/workers/frisians/seamstress/init.lua 2019-05-27 14:29:35 +0000
2713@@ -6,8 +6,8 @@
2714 hotspot = {9, 23},
2715 }
2716 }
2717-add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15)
2718-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2719+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15)
2720+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2721
2722 tribes:new_worker_type {
2723 msgctxt = "frisians_worker",
2724
2725=== modified file 'data/tribes/workers/frisians/seamstress_master/init.lua'
2726--- data/tribes/workers/frisians/seamstress_master/init.lua 2018-11-30 10:27:21 +0000
2727+++ data/tribes/workers/frisians/seamstress_master/init.lua 2019-05-27 14:29:35 +0000
2728@@ -6,8 +6,8 @@
2729 hotspot = {21, 25},
2730 }
2731 }
2732-add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15)
2733-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2734+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15)
2735+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2736
2737 tribes:new_worker_type {
2738 msgctxt = "frisians_worker",
2739
2740=== modified file 'data/tribes/workers/frisians/shipwright/init.lua'
2741--- data/tribes/workers/frisians/shipwright/init.lua 2019-03-17 08:30:43 +0000
2742+++ data/tribes/workers/frisians/shipwright/init.lua 2019-05-27 14:29:35 +0000
2743@@ -15,8 +15,8 @@
2744 fps = 10
2745 }
2746 }
2747-add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15)
2748-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2749+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15)
2750+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2751
2752 tribes:new_worker_type {
2753 msgctxt = "frisians_worker",
2754
2755=== modified file 'data/tribes/workers/frisians/smelter/init.lua'
2756--- data/tribes/workers/frisians/smelter/init.lua 2018-11-30 10:27:21 +0000
2757+++ data/tribes/workers/frisians/smelter/init.lua 2019-05-27 14:29:35 +0000
2758@@ -6,8 +6,8 @@
2759 hotspot = {8, 23},
2760 }
2761 }
2762-add_walking_animations (animations, "walk", dirname, "walk", {13, 23}, 15)
2763-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2764+add_directional_animation(animations, "walk", dirname, "walk", {13, 23}, 15)
2765+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2766
2767 tribes:new_worker_type {
2768 msgctxt = "frisians_worker",
2769
2770=== modified file 'data/tribes/workers/frisians/smoker/init.lua'
2771--- data/tribes/workers/frisians/smoker/init.lua 2018-11-30 10:27:21 +0000
2772+++ data/tribes/workers/frisians/smoker/init.lua 2019-05-27 14:29:35 +0000
2773@@ -6,8 +6,8 @@
2774 hotspot = {8, 23},
2775 }
2776 }
2777-add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15)
2778-add_walking_animations (animations, "walkload", dirname, "walk", {10, 26}, 15)
2779+add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15)
2780+add_directional_animation(animations, "walkload", dirname, "walk", {10, 26}, 15)
2781
2782 tribes:new_worker_type {
2783 msgctxt = "frisians_worker",
2784
2785=== modified file 'data/tribes/workers/frisians/soldier/init.lua'
2786--- data/tribes/workers/frisians/soldier/init.lua 2019-05-19 09:25:06 +0000
2787+++ data/tribes/workers/frisians/soldier/init.lua 2019-05-27 14:29:35 +0000
2788@@ -347,10 +347,10 @@
2789 fps = 10
2790 },
2791 }
2792-add_walking_animations (animations, "walk", dirname, "rookie/walk", {7, 24}, 15)
2793-add_walking_animations (animations, "health_walk", dirname, "helm/walk", {7, 25}, 15)
2794-add_walking_animations (animations, "attack_walk", dirname, "sword/walk", {8, 24}, 15)
2795-add_walking_animations (animations, "hero_walk", dirname, "hero/walk", {8, 25}, 15)
2796+add_directional_animation(animations, "walk", dirname .. "rookie", "walk", {7, 24}, 15)
2797+add_directional_animation(animations, "health_walk", dirname .. "helm", "walk", {7, 25}, 15)
2798+add_directional_animation(animations, "attack_walk", dirname .. "sword", "walk", {8, 24}, 15)
2799+add_directional_animation(animations, "hero_walk", dirname .. "hero", "walk", {8, 25}, 15)
2800
2801 -- convenience definitions so we don´t have to repeat this table for every single entry below
2802 fri_health = {
2803
2804=== modified file 'data/tribes/workers/frisians/stonemason/init.lua'
2805--- data/tribes/workers/frisians/stonemason/init.lua 2018-11-30 10:27:21 +0000
2806+++ data/tribes/workers/frisians/stonemason/init.lua 2019-05-27 14:29:35 +0000
2807@@ -11,8 +11,8 @@
2808 fps = 10
2809 }
2810 }
2811-add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15)
2812-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15)
2813+add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15)
2814+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15)
2815
2816 tribes:new_worker_type {
2817 msgctxt = "frisians_worker",
2818
2819=== modified file 'data/tribes/workers/frisians/trainer/init.lua'
2820--- data/tribes/workers/frisians/trainer/init.lua 2018-11-30 10:27:21 +0000
2821+++ data/tribes/workers/frisians/trainer/init.lua 2019-05-27 14:29:35 +0000
2822@@ -6,8 +6,8 @@
2823 hotspot = {8, 23},
2824 }
2825 }
2826-add_walking_animations (animations, "walk", dirname, "walk", {10, 24}, 15)
2827-add_walking_animations (animations, "walkload", dirname, "walkload", {10, 25}, 15)
2828+add_directional_animation(animations, "walk", dirname, "walk", {10, 24}, 15)
2829+add_directional_animation(animations, "walkload", dirname, "walkload", {10, 25}, 15)
2830
2831 tribes:new_worker_type {
2832 msgctxt = "frisians_worker",
2833
2834=== modified file 'data/tribes/workers/frisians/woodcutter/init.lua'
2835--- data/tribes/workers/frisians/woodcutter/init.lua 2018-11-30 10:27:21 +0000
2836+++ data/tribes/workers/frisians/woodcutter/init.lua 2019-05-27 14:29:35 +0000
2837@@ -12,8 +12,8 @@
2838 fps = 10
2839 }
2840 }
2841-add_walking_animations (animations, "walk", dirname, "walk", {16, 23}, 15)
2842-add_walking_animations (animations, "walkload", dirname, "walkload", {12, 26}, 15)
2843+add_directional_animation(animations, "walk", dirname, "walk", {16, 23}, 15)
2844+add_directional_animation(animations, "walkload", dirname, "walkload", {12, 26}, 15)
2845
2846 tribes:new_worker_type {
2847 msgctxt = "frisians_worker",
2848@@ -33,7 +33,9 @@
2849 harvest = {
2850 "findobject=attrib:tree radius:10",
2851 "walk=object",
2852+ "playsound=sound/woodcutting/woodcutting 255",
2853 "animate=hacking 10000",
2854+ "playsound=sound/woodcutting/tree_falling 130",
2855 "callobject=fall",
2856 "animate=idle 2000",
2857 "createware=log",
2858
2859=== modified file 'data/world/critters/badger/init.lua'
2860--- data/world/critters/badger/init.lua 2017-09-03 09:39:39 +0000
2861+++ data/world/critters/badger/init.lua 2019-05-27 14:29:35 +0000
2862@@ -19,7 +19,7 @@
2863 },
2864 }
2865
2866-add_walking_animations(animations, "walk", dirname, "walk", {13, 15}, 20)
2867+add_directional_animation(animations, "walk", dirname, "walk", {13, 15}, 20)
2868
2869 -- RST
2870 -- .. function:: new_critter_type{table}
2871
2872=== modified file 'data/world/critters/brownbear/init.lua'
2873--- data/world/critters/brownbear/init.lua 2017-02-12 09:10:57 +0000
2874+++ data/world/critters/brownbear/init.lua 2019-05-27 14:29:35 +0000
2875@@ -8,7 +8,7 @@
2876 },
2877 }
2878
2879-add_walking_animations(animations, "walk", dirname, "walk", {24, 24}, 4)
2880+add_directional_animation(animations, "walk", dirname, "walk", {24, 24}, 4)
2881
2882 world:new_critter_type{
2883 name = "brownbear",
2884
2885=== modified file 'data/world/critters/bunny/init.lua'
2886--- data/world/critters/bunny/init.lua 2017-02-12 09:10:57 +0000
2887+++ data/world/critters/bunny/init.lua 2019-05-27 14:29:35 +0000
2888@@ -7,7 +7,7 @@
2889 },
2890 }
2891
2892-add_walking_animations(animations, "walk", dirname, "walk", {5, 9}, 4)
2893+add_directional_animation(animations, "walk", dirname, "walk", {5, 9}, 4)
2894
2895 world:new_critter_type{
2896 name = "bunny",
2897
2898=== modified file 'data/world/critters/chamois/init.lua'
2899--- data/world/critters/chamois/init.lua 2017-02-12 09:10:57 +0000
2900+++ data/world/critters/chamois/init.lua 2019-05-27 14:29:35 +0000
2901@@ -8,7 +8,7 @@
2902 },
2903 }
2904
2905-add_walking_animations(animations, "walk", dirname, "walk", {11, 20}, 20)
2906+add_directional_animation(animations, "walk", dirname, "walk", {11, 20}, 20)
2907
2908 world:new_critter_type{
2909 name = "chamois",
2910
2911=== modified file 'data/world/critters/deer/init.lua'
2912--- data/world/critters/deer/init.lua 2017-02-12 09:10:57 +0000
2913+++ data/world/critters/deer/init.lua 2019-05-27 14:29:35 +0000
2914@@ -8,7 +8,7 @@
2915 },
2916 }
2917
2918-add_walking_animations(animations, "walk", dirname, "walk", {15, 25}, 20)
2919+add_directional_animation(animations, "walk", dirname, "walk", {15, 25}, 20)
2920
2921 world:new_critter_type{
2922 name = "deer",
2923
2924=== modified file 'data/world/critters/duck/init.lua'
2925--- data/world/critters/duck/init.lua 2019-03-17 08:30:43 +0000
2926+++ data/world/critters/duck/init.lua 2019-05-27 14:29:35 +0000
2927@@ -11,7 +11,7 @@
2928 },
2929 }
2930
2931-add_walking_animations(animations, "walk", dirname, "walk", {5, 10})
2932+add_directional_animation(animations, "walk", dirname, "walk", {5, 10})
2933
2934 world:new_critter_type{
2935 name = "duck",
2936
2937=== modified file 'data/world/critters/elk/init.lua'
2938--- data/world/critters/elk/init.lua 2019-03-17 08:30:43 +0000
2939+++ data/world/critters/elk/init.lua 2019-05-27 14:29:35 +0000
2940@@ -12,7 +12,7 @@
2941 },
2942 }
2943
2944-add_walking_animations(animations, "walk", dirname, "walk", {21, 34}, 20)
2945+add_directional_animation(animations, "walk", dirname, "walk", {21, 34}, 20)
2946
2947 world:new_critter_type{
2948 name = "elk",
2949
2950=== modified file 'data/world/critters/fox/init.lua'
2951--- data/world/critters/fox/init.lua 2019-03-17 08:30:43 +0000
2952+++ data/world/critters/fox/init.lua 2019-05-27 14:29:35 +0000
2953@@ -12,7 +12,7 @@
2954 },
2955 }
2956
2957-add_walking_animations(animations, "walk", dirname, "walk", {11, 14}, 20)
2958+add_directional_animation(animations, "walk", dirname, "walk", {11, 14}, 20)
2959
2960 world:new_critter_type{
2961 name = "fox",
2962
2963=== modified file 'data/world/critters/lynx/init.lua'
2964--- data/world/critters/lynx/init.lua 2017-02-12 09:10:57 +0000
2965+++ data/world/critters/lynx/init.lua 2019-05-27 14:29:35 +0000
2966@@ -8,7 +8,7 @@
2967 },
2968 }
2969
2970-add_walking_animations(animations, "walk", dirname, "walk", {11, 21}, 20)
2971+add_directional_animation(animations, "walk", dirname, "walk", {11, 21}, 20)
2972
2973
2974 world:new_critter_type{
2975
2976=== modified file 'data/world/critters/marten/init.lua'
2977--- data/world/critters/marten/init.lua 2017-02-12 09:10:57 +0000
2978+++ data/world/critters/marten/init.lua 2019-05-27 14:29:35 +0000
2979@@ -8,7 +8,7 @@
2980 },
2981 }
2982
2983-add_walking_animations(animations, "walk", dirname, "walk", {15, 14}, 20)
2984+add_directional_animation(animations, "walk", dirname, "walk", {15, 14}, 20)
2985
2986 world:new_critter_type{
2987 name = "marten",
2988
2989=== modified file 'data/world/critters/reindeer/init.lua'
2990--- data/world/critters/reindeer/init.lua 2017-02-12 09:10:57 +0000
2991+++ data/world/critters/reindeer/init.lua 2019-05-27 14:29:35 +0000
2992@@ -8,7 +8,7 @@
2993 },
2994 }
2995
2996-add_walking_animations(animations, "walk", dirname, "walk", {25, 30}, 20)
2997+add_directional_animation(animations, "walk", dirname, "walk", {25, 30}, 20)
2998
2999
3000 world:new_critter_type{
3001
3002=== modified file 'data/world/critters/sheep/init.lua'
3003--- data/world/critters/sheep/init.lua 2019-03-17 08:30:43 +0000
3004+++ data/world/critters/sheep/init.lua 2019-05-27 14:29:35 +0000
3005@@ -11,7 +11,7 @@
3006 },
3007 }
3008
3009-add_walking_animations(animations, "walk", dirname, "walk", {15, 25}, 20)
3010+add_directional_animation(animations, "walk", dirname, "walk", {15, 25}, 20)
3011
3012 world:new_critter_type{
3013 name = "sheep",
3014
3015=== modified file 'data/world/critters/stag/init.lua'
3016--- data/world/critters/stag/init.lua 2019-03-17 08:30:43 +0000
3017+++ data/world/critters/stag/init.lua 2019-05-27 14:29:35 +0000
3018@@ -12,7 +12,7 @@
3019 },
3020 }
3021
3022-add_walking_animations(animations, "walk", dirname, "walk", {25, 30}, 20)
3023+add_directional_animation(animations, "walk", dirname, "walk", {25, 30}, 20)
3024
3025 world:new_critter_type{
3026 name = "stag",
3027
3028=== modified file 'data/world/critters/wildboar/init.lua'
3029--- data/world/critters/wildboar/init.lua 2019-03-17 08:30:43 +0000
3030+++ data/world/critters/wildboar/init.lua 2019-05-27 14:29:35 +0000
3031@@ -11,7 +11,7 @@
3032 },
3033 }
3034
3035-add_walking_animations(animations, "walk", dirname, "walk", {20, 22}, 20)
3036+add_directional_animation(animations, "walk", dirname, "walk", {20, 22}, 20)
3037
3038 world:new_critter_type{
3039 name = "wildboar",
3040
3041=== modified file 'data/world/critters/wisent/init.lua'
3042--- data/world/critters/wisent/init.lua 2017-02-12 09:10:57 +0000
3043+++ data/world/critters/wisent/init.lua 2019-05-27 14:29:35 +0000
3044@@ -8,7 +8,7 @@
3045 },
3046 }
3047
3048-add_walking_animations(animations, "walk", dirname, "walk", {24, 32}, 20)
3049+add_directional_animation(animations, "walk", dirname, "walk", {24, 32}, 20)
3050
3051 world:new_critter_type{
3052 name = "wisent",
3053
3054=== modified file 'data/world/critters/wolf/init.lua'
3055--- data/world/critters/wolf/init.lua 2019-03-17 08:30:43 +0000
3056+++ data/world/critters/wolf/init.lua 2019-05-27 14:29:35 +0000
3057@@ -12,7 +12,7 @@
3058 },
3059 }
3060
3061-add_walking_animations(animations, "walk", dirname, "walk", {19, 19}, 20)
3062+add_directional_animation(animations, "walk", dirname, "walk", {19, 19}, 20)
3063
3064 world:new_critter_type{
3065 name = "wolf",
3066
3067=== modified file 'data/world/immovables/grass1/init.lua'
3068--- data/world/immovables/grass1/init.lua 2019-03-17 08:30:43 +0000
3069+++ data/world/immovables/grass1/init.lua 2019-05-27 14:29:35 +0000
3070@@ -12,7 +12,7 @@
3071 pictures = path.list_files(dirname .. "idle.png"),
3072 hotspot = { 10, 20 },
3073 sound_effect = {
3074- path = "sound/animals/frog1",
3075+ path = "sound/animals/frog",
3076 },
3077 },
3078 }
3079
3080=== modified file 'data/world/immovables/grass2/init.lua'
3081--- data/world/immovables/grass2/init.lua 2019-03-17 08:30:43 +0000
3082+++ data/world/immovables/grass2/init.lua 2019-05-27 14:29:35 +0000
3083@@ -12,7 +12,7 @@
3084 pictures = path.list_files(dirname .. "idle.png"),
3085 hotspot = { 10, 16 },
3086 sound_effect = {
3087- path = "sound/animals/frog1",
3088+ path = "sound/animals/frog",
3089 },
3090 },
3091 }
3092
3093=== modified file 'data/world/immovables/grass3/init.lua'
3094--- data/world/immovables/grass3/init.lua 2019-03-17 08:30:43 +0000
3095+++ data/world/immovables/grass3/init.lua 2019-05-27 14:29:35 +0000
3096@@ -12,7 +12,7 @@
3097 pictures = path.list_files(dirname .. "idle.png"),
3098 hotspot = { 10, 11 },
3099 sound_effect = {
3100- path = "sound/animals/frog1",
3101+ path = "sound/animals/frog",
3102 },
3103 },
3104 }
3105
3106=== modified file 'doc/sphinx/source/animations.rst'
3107--- doc/sphinx/source/animations.rst 2019-05-11 13:48:12 +0000
3108+++ doc/sphinx/source/animations.rst 2019-05-27 14:29:35 +0000
3109@@ -19,7 +19,8 @@
3110
3111 animations = {
3112 idle = {
3113- files = path.list_files(path.dirname(__file__) .. "idle_??.png"),
3114+ directory = path.dirname(__file__),
3115+ basename = "idle",
3116 hotspot = { 5, 7 },
3117 fps = 4,
3118 sound_effect = {
3119@@ -28,7 +29,14 @@
3120 },
3121 representative_frame = 3,
3122 },
3123- working = ...
3124+ walk = {
3125+ directory = path.dirname(__file__),
3126+ basename = "walk",
3127+ hotspot = { 5, 7 },
3128+ fps = 4,
3129+ directional = true
3130+ },
3131+ ...
3132 }
3133
3134 Let's have a detailed look at the ``idle`` animation:
3135@@ -36,11 +44,23 @@
3136 **idle**
3137 *Mandatory*. This is the name of the animation. The animation can then be referenced by this name e.g. if you want to trigger it in a production program.
3138
3139-**files**
3140- *Mandatory*. A template for the image names. Our example will pick up any image from ``idle_00.png`` through ``idle_99.png`` in the specified directory path -- the current path in our example. These images can optionally have corresponding player color mask images called ``idle_00_pc.png`` through ``idle_99_pc.png``. Make sure to include leading 0's in the file names and to have consistent length -- we support 1, 2 and 3 digit numbers in an animation.
3141+**directory**
3142+ *Mandatory*. The directory where the animation image files are located.
3143+
3144+**basename**
3145+ *Mandatory*. The filename prefix for the image files. Our example will pick up any image from ``idle_00.png`` through ``idle_99.png`` in the specified directory path -- the current path in our example. These images can optionally have corresponding player color mask images called ``idle_00_pc.png`` through ``idle_99_pc.png``. Make sure to include leading 0's in the file names and to have consistent length -- we support 1, 2 and 3 digit numbers in an animation.
3146+ If your animation contains only one file, you can also call it ``idle.png`` (and ``idle_pc.png`` for the player color mask) without ``_`` or any numbers in the file name.
3147+
3148+ We support *mipmaps* for animations. They allow us to provide the same image in different resolutions for optimum rendering quality.
3149+ For using mipmaps, simply name your files accordingly, and the engine will pick them up. e.g. ``idle_0.5_00.png`` will be rendered at scale ``0.5``, and ``idle_1_00.png`` will be rendered at the neutral scale ``1``.
3150+ The scale of ``1`` is mandatory, and other supported scales are ``0.5``, ``2`` and ``4``.
3151
3152 **pictures**
3153- *DEPRECATED*. The same as ``files``.
3154+ *DEPRECATED*. This is older code that is slowly being phased out - do not use this parameter.
3155+ A table with full directory and file names.
3156+
3157+**directional**
3158+ *Optional*. If this is ``true``, indicates to the engine that this is a directional animation. In our example, the engine will create a set of 6 animations called ``"walk_ne"``, ``"walk_e"``, ``"walk_se"``, ``"walk_sw"``, ``"walk_w"``, and ``"walk_nw"``. See :ref:`animations_directional` below.
3159
3160 **hotspot**
3161 *Mandatory*. Hotspots define a place on a graphic image through its *x* and *y* coordinates that can be used as a handle or reference point to provide control over positioning the image on the map. For example, hotspots help carriers stay on the road, and control the positioning of the wares they carry. Increase ``x`` to shift the animation to the left and ``y`` to shift it upwards.
3162@@ -56,56 +76,7 @@
3163 * **255:** Always play
3164
3165
3166-Mipmaps
3167--------
3168-
3169-We support mipmaps for animations. They allow us to provide the same image in different
3170-resolutions for optimum rendering quality. Let's look at an example with a mipmap ``idle`` animation and a normal ``build`` animation:
3171-
3172-.. code-block:: lua
3173-
3174- animations = {
3175- idle = {
3176- mipmap = {
3177- {
3178- scale = 0.5,
3179- files = path.list_files(dirname .. "idle_0.5_??.png"),
3180- },
3181- {
3182- scale = 1,
3183- files = path.list_files(dirname .. "idle_1_??.png"),
3184- },
3185- {
3186- scale = 2,
3187- files = path.list_files(dirname .. "idle_2_??.png"),
3188- },
3189- {
3190- scale = 4,
3191- files = path.list_files(dirname .. "idle_4_??.png"),
3192- }
3193- },
3194- hotspot = { 5, 7 },
3195- fps = 4,
3196- sound_effect = {
3197- directory = "sound/foo",
3198- name = "bar",
3199- },
3200- },
3201- build = {
3202- files = path.list_files(dirname .. "build_??.png"),
3203- hotspot = { 5, 7 },
3204- }
3205- },
3206-
3207-The scale of ``1`` is mandatory, and other supported scales are ``0.5``, ``2``
3208-and ``4``.
3209-The base table should no longer contain the ``files`` entry
3210-when you're using a mipmap.
3211-Each mimap entry must define the ``files`` and the ``scale``.
3212-See also :ref:`animations_converting_formats`.
3213-
3214-**representative_frame**
3215- *Optional*. Choose the animation frame that will be displayed in messages and in the encyclopedia as a representative image. Default is 0.
3216+.. _animations_directional:
3217
3218 Directional Animations
3219 ----------------------
3220@@ -126,7 +97,7 @@
3221 ---------------------
3222
3223 In order to cut down on the manual coding needed, we provide the convenience functions
3224-:any:`add_animation` for static animations and :any:`add_walking_animations` for walking
3225+:any:`add_animation` for static animations and :any:`add_directional_animation` for walking
3226 animations, both of which will also detect mipmaps automatically.
3227 The corresponding ``.lua`` script file is included centrally when the tribe or world
3228 loading is started, so you won't need to include it again. Example:
3229@@ -142,10 +113,10 @@
3230 add_animation(animations, "idle", dirname, "idle", {16, 30}, 5)
3231
3232 -- Add animations for the 6 directions with hotspot = {16, 30} and fps = 10
3233- add_walking_animations(animations, "walk", dirname, "walk", {16, 30}, 10)
3234+ add_directional_animation(animations, "walk", dirname, "walk", {16, 30}, 10)
3235
3236 -- Add a "walkload" animation. The animation hasn't been created yet in this example, so we reuse the files for the "walk" animation.
3237- add_walking_animations(animations, "walkload", dirname, "walk", {16, 30}, 10)
3238+ add_directional_animation(animations, "walkload", dirname, "walk", {16, 30}, 10)
3239
3240
3241 tribes:new_worker_type {
3242@@ -191,7 +162,7 @@
3243 MipmapMaker accepts high-resolution images as input files (they should be at least 4 times the in-game size)
3244 and creates correctly named mipmap images for all supported scales for each animation, e.g.:
3245
3246- java MipmapMaker ~/widelands/data/tribes/workers/fancytribe/diligentworker walk_se 2 true true true 4.0
3247+ ``java MipmapMaker ~/widelands/data/tribes/workers/fancytribe/diligentworker walk_se 2 true true true 4.0``
3248
3249 MipmapMaker is documented in ``widelands-media/graphics/tools/Graphics Tools (Java)/Readme``.
3250
3251
3252=== modified file 'src/CMakeLists.txt'
3253--- src/CMakeLists.txt 2019-05-12 07:45:59 +0000
3254+++ src/CMakeLists.txt 2019-05-27 14:29:35 +0000
3255@@ -107,7 +107,6 @@
3256 graphic
3257 graphic_fonthandler
3258 graphic_text
3259- helper
3260 io_filesystem
3261 logic
3262 logic_exceptions
3263
3264=== modified file 'src/game_io/game_loader.cc'
3265--- src/game_io/game_loader.cc 2019-02-23 11:00:49 +0000
3266+++ src/game_io/game_loader.cc 2019-05-27 14:29:35 +0000
3267@@ -93,7 +93,8 @@
3268 log("Game: Reading Scenario Tribes took %ums\n", timer.ms_since_last_query());
3269 }
3270
3271- log("Game: Reading Player Info ... ");
3272+ // This also triggers loading the world and tribes, so we need a newline at the end of the log output
3273+ log("Game: Reading Player Info ...\n");
3274 {
3275 GamePlayerInfoPacket p;
3276 p.read(fs_, game_);
3277
3278=== modified file 'src/graphic/animation.cc'
3279--- src/graphic/animation.cc 2019-05-04 09:59:51 +0000
3280+++ src/graphic/animation.cc 2019-05-27 14:29:35 +0000
3281@@ -31,13 +31,13 @@
3282 #include "base/i18n.h"
3283 #include "base/log.h"
3284 #include "base/macros.h"
3285-#include "base/wexception.h"
3286 #include "graphic/diranimations.h"
3287 #include "graphic/graphic.h"
3288 #include "graphic/image.h"
3289 #include "graphic/image_cache.h"
3290 #include "graphic/playercolor.h"
3291 #include "graphic/texture.h"
3292+#include "io/filesystem/filesystem.h"
3293 #include "io/filesystem/layered_filesystem.h"
3294 #include "logic/game_data_error.h"
3295 #include "scripting/lua_table.h"
3296@@ -56,25 +56,36 @@
3297 class NonPackedAnimation : public Animation {
3298 public:
3299 struct MipMapEntry {
3300- explicit MipMapEntry(float scale, const LuaTable& table);
3301+ explicit MipMapEntry(std::vector<std::string> files);
3302+
3303+ // Loads the graphics if they are not yet loaded.
3304+ void ensure_graphics_are_loaded() const;
3305+
3306+ // Load the needed graphics from disk.
3307+ void load_graphics();
3308+
3309+ void blit(uint32_t idx, const Rectf& source_rect, const Rectf& destination_rect, const RGBColor* clr, Surface* target) const;
3310
3311 // Whether this image set has player color masks provided
3312 bool has_playercolor_masks;
3313
3314 // Image files on disk
3315 std::vector<std::string> image_files;
3316+
3317+ // Loaded images for each frame
3318+ std::vector<const Image*> frames;
3319+
3320+ private:
3321 // Player color mask files on disk
3322 std::vector<std::string> playercolor_mask_image_files;
3323
3324- // Loaded images for each frame
3325- std::vector<const Image*> frames;
3326 // Loaded player color mask images for each frame
3327 std::vector<const Image*> playercolor_mask_frames;
3328 };
3329
3330 ~NonPackedAnimation() override {
3331 }
3332- explicit NonPackedAnimation(const LuaTable& table);
3333+ explicit NonPackedAnimation(const LuaTable& table, const std::string& basename);
3334
3335 // Implements Animation.
3336 float height() const override;
3337@@ -90,8 +101,8 @@
3338 const Rectf& source_rect,
3339 const Rectf& destination_rect,
3340 const RGBColor* clr,
3341- Surface* target,
3342- float scale) const override;
3343+ Surface* target, float scale) const override;
3344+ void load_default_scale_and_sounds() const override;
3345
3346 private:
3347 float find_best_scale(float scale) const;
3348@@ -100,12 +111,6 @@
3349 // What if the game runs very slowly or very quickly?
3350 void trigger_sound(uint32_t framenumber, const Widelands::Coords& coords) const override;
3351
3352- // Loads the graphics if they are not yet loaded.
3353- void ensure_graphics_are_loaded() const;
3354-
3355- // Load the needed graphics from disk.
3356- void load_graphics();
3357-
3358 uint32_t current_frame(uint32_t time) const;
3359
3360 uint32_t frametime_;
3361@@ -126,22 +131,17 @@
3362 bool play_once_;
3363 };
3364
3365-NonPackedAnimation::MipMapEntry::MipMapEntry(float scale, const LuaTable& table)
3366- : has_playercolor_masks(false) {
3367- if (scale <= 0.0f) {
3368- throw wexception(
3369- "Animation scales must be positive numbers. Found %.2f", static_cast<double>(scale));
3370- }
3371-
3372- // TODO(GunChleoc): We want to rename these from "pictures" to "files", because we'll have
3373- // spritesheets etc. in the future, and this naming will be clearer. We don't want to convert
3374- // them in bulk right now though - it will take care of itself as we convert to mipmaps.
3375- image_files = (table.has_key("files") ? table.get_table("files") : table.get_table("pictures"))
3376- ->array_entries<std::string>();
3377-
3378+/*
3379+==============================================================================
3380+
3381+NonPackedAnimation::MipMapEntry IMPLEMENTATION
3382+
3383+==============================================================================
3384+*/
3385+
3386+NonPackedAnimation::MipMapEntry::MipMapEntry(std::vector<std::string> files) : has_playercolor_masks(false), image_files(files) {
3387 if (image_files.empty()) {
3388- throw wexception("Animation without image files. For a scale of 1.0, the template should "
3389- "look similar to this:"
3390+ throw Widelands::GameDataError("Animation without image files. For a scale of 1.0, the template should look similar to this:"
3391 " 'directory/idle_1_??.png' for 'directory/idle_1_00.png' etc.");
3392 }
3393
3394@@ -151,18 +151,84 @@
3395 has_playercolor_masks = true;
3396 playercolor_mask_image_files.push_back(image_file);
3397 } else if (has_playercolor_masks) {
3398- throw wexception("Animation is missing player color file: %s", image_file.c_str());
3399+ throw Widelands::GameDataError("Animation is missing player color file: %s", image_file.c_str());
3400 }
3401 }
3402
3403 assert(!image_files.empty());
3404- assert(playercolor_mask_image_files.size() == image_files.size() ||
3405- playercolor_mask_image_files.empty());
3406-}
3407-
3408-NonPackedAnimation::NonPackedAnimation(const LuaTable& table)
3409+ assert(playercolor_mask_image_files.size() == image_files.size() || playercolor_mask_image_files.empty());
3410+}
3411+
3412+// Loads the graphics if they are not yet loaded.
3413+void NonPackedAnimation::MipMapEntry::ensure_graphics_are_loaded() const {
3414+ if (frames.empty()) {
3415+ const_cast<MipMapEntry*>(this)->load_graphics();
3416+ }
3417+}
3418+
3419+// Load the needed graphics from disk.
3420+void NonPackedAnimation::MipMapEntry::load_graphics() {
3421+ if (image_files.empty()) {
3422+ throw Widelands::GameDataError("animation without image files.");
3423+ }
3424+ if (playercolor_mask_image_files.size() && playercolor_mask_image_files.size() != image_files.size()) {
3425+ throw Widelands::GameDataError("animation has %" PRIuS " frames but playercolor mask has %" PRIuS " frames. First image is %s",
3426+ image_files.size(), playercolor_mask_image_files.size(), image_files.front().c_str());
3427+ }
3428+
3429+ for (const std::string& filename : image_files) {
3430+ const Image* image = g_gr->images().get(filename);
3431+ if (frames.size() &&
3432+ (frames.front()->width() != image->width() || frames.front()->height() != image->height())) {
3433+ throw Widelands::GameDataError("wrong size: (%u, %u) for file %s, should be (%u, %u) like the first frame",
3434+ image->width(), image->height(), filename.c_str(), frames.front()->width(),
3435+ frames.front()->height());
3436+ }
3437+ frames.push_back(image);
3438+ }
3439+
3440+ for (const std::string& filename : playercolor_mask_image_files) {
3441+ // TODO(unknown): Do not load playercolor mask as opengl texture or use it as
3442+ // opengl texture.
3443+ const Image* pc_image = g_gr->images().get(filename);
3444+ if (frames.front()->width() != pc_image->width() || frames.front()->height() != pc_image->height()) {
3445+ throw Widelands::GameDataError("playercolor mask %s has wrong size: (%u, %u), should "
3446+ "be (%u, %u) like the animation frame",
3447+ filename.c_str(), pc_image->width(), pc_image->height(), frames.front()->width(),
3448+ frames.front()->height());
3449+ }
3450+ playercolor_mask_frames.push_back(pc_image);
3451+ }
3452+}
3453+
3454+void NonPackedAnimation::MipMapEntry::blit(uint32_t idx,
3455+ const Rectf& source_rect,
3456+ const Rectf& destination_rect,
3457+ const RGBColor* clr,
3458+ Surface* target) const {
3459+ assert(!frames.empty());
3460+ assert(target);
3461+ assert(idx < frames.size());
3462+
3463+ if (!has_playercolor_masks || clr == nullptr) {
3464+ target->blit(destination_rect, *frames.at(idx), source_rect, 1., BlendMode::UseAlpha);
3465+ } else {
3466+ target->blit_blended(
3467+ destination_rect, *frames.at(idx), *playercolor_mask_frames.at(idx), source_rect, *clr);
3468+ }
3469+}
3470+
3471+/*
3472+==============================================================================
3473+
3474+NonPackedAnimation IMPLEMENTATION
3475+
3476+==============================================================================
3477+*/
3478+
3479+NonPackedAnimation::NonPackedAnimation(const LuaTable& table, const std::string& basename)
3480 : Animation(table.has_key("representative_frame") ? table.get_int("representative_frame") : 0),
3481- frametime_(FRAME_LENGTH),
3482+ frametime_(FRAME_LENGTH),
3483 hotspot_(table.get_vector<std::string, int>("hotspot")),
3484 sound_effect_(kNoSoundEffect),
3485 sound_priority_(kFxPriorityLowest),
3486@@ -190,36 +256,47 @@
3487 play_once_ = table.get_bool("play_once");
3488 }
3489
3490- if (table.has_key("mipmap")) {
3491- std::unique_ptr<LuaTable> mipmaps_table = table.get_table("mipmap");
3492- for (const int key : mipmaps_table->keys<int>()) {
3493- std::unique_ptr<LuaTable> current_scale_table = mipmaps_table->get_table(key);
3494- const float current_scale = current_scale_table->get_double("scale");
3495- if (kSupportedScales.count(current_scale) != 1) {
3496- std::string supported_scales = "";
3497- for (const float supported_scale : kSupportedScales) {
3498- supported_scales =
3499- (boost::format("%s %.1f") % supported_scales % supported_scale).str();
3500- }
3501- throw wexception(
3502- "Animation has unsupported scale '%.2f' in mipmap - supported scales are:%s",
3503- static_cast<double>(current_scale), supported_scales.c_str());
3504- }
3505- mipmaps_.insert(std::make_pair(
3506- current_scale,
3507- std::unique_ptr<MipMapEntry>(new MipMapEntry(current_scale, *current_scale_table))));
3508- }
3509+ // Get image files
3510+ if (table.has_key("pictures")) {
3511+ // TODO(GunChleoc): Old code - remove this option once conversion has been completed
3512+ mipmaps_.insert(std::make_pair(
3513+ 1.0f,
3514+ std::unique_ptr<MipMapEntry>(new MipMapEntry(table.get_table("pictures")->array_entries<std::string>()))));
3515 } else {
3516- mipmaps_.insert(
3517- std::make_pair(1.0f, std::unique_ptr<MipMapEntry>(new MipMapEntry(1.0f, table))));
3518+ if (basename.empty() || !table.has_key("directory")) {
3519+ throw Widelands::GameDataError("Animation did not define both a basename and a directory for its image files");
3520+ }
3521+ const std::string directory = table.get_string("directory");
3522+
3523+ // List files for the given scale, and if we have any, add a mipmap entry for them.
3524+ auto add_scale = [this, basename, directory](float scale_as_float, const std::string& scale_as_string) {
3525+ std::vector<std::string> filenames = g_fs->get_sequential_files(directory, basename + scale_as_string, "png");
3526+ if (!filenames.empty()) {
3527+ mipmaps_.insert(std::make_pair(scale_as_float, std::unique_ptr<MipMapEntry>(new MipMapEntry(filenames))));
3528+ }
3529+ };
3530+ add_scale(0.5f, "_0.5");
3531+ add_scale(1.0f, "_1");
3532+ add_scale(2.0f, "_2");
3533+ add_scale(4.0f, "_4");
3534+
3535+ if (mipmaps_.count(1.0f) == 0) {
3536+ // There might be only 1 scale
3537+ add_scale(1.0f, "");
3538+ if (mipmaps_.count(1.0f) == 0) {
3539+ // No files found at all
3540+ throw Widelands::GameDataError(
3541+ "Animation in directory '%s' with basename '%s' has no images for mandatory scale '1' in mipmap - supported scales are: 0.5, 1, 2, 4", directory.c_str(), basename.c_str());
3542+ }
3543+ }
3544 }
3545
3546- // Frames
3547+ // Frames and FPS
3548 nr_frames_ = mipmaps_.begin()->second->image_files.size();
3549 if (table.has_key("fps")) {
3550 if (nr_frames_ == 1) {
3551- throw wexception("Animation with one picture %s must not have 'fps'",
3552- mipmaps_.begin()->second->image_files[0].c_str());
3553+ throw Widelands::GameDataError(
3554+ "Animation with one picture %s must not have 'fps'", mipmaps_.begin()->second->image_files.front().c_str());
3555 }
3556 frametime_ = 1000 / get_positive_int(table, "fps");
3557 }
3558@@ -234,22 +311,22 @@
3559 const bool should_have_playercolor = mipmaps_.begin()->second->has_playercolor_masks;
3560 for (const auto& mipmap : mipmaps_) {
3561 if (mipmap.second->image_files.size() != nr_frames_) {
3562- throw wexception(
3563- "Mismatched number of images for different scales in animation table: %" PRIuS
3564- " vs. %u at scale %.2f",
3565- mipmap.second->image_files.size(), nr_frames_, static_cast<double>(mipmap.first));
3566+ throw Widelands::GameDataError("Mismatched number of images for different scales in animation table: %" PRIuS " vs. %u at scale %.2f",
3567+ mipmap.second->image_files.size(),
3568+ nr_frames_,
3569+ static_cast<double>(mipmap.first));
3570 }
3571 if (mipmap.second->has_playercolor_masks != should_have_playercolor) {
3572- throw wexception(
3573- "Mismatched existence of player colors in animation table for scales %.2f and %.2f",
3574- static_cast<double>(mipmaps_.begin()->first), static_cast<double>(mipmap.first));
3575+ throw Widelands::GameDataError("Mismatched existence of player colors in animation table for scales %.2f and %.2f",
3576+ static_cast<double>(mipmaps_.begin()->first),
3577+ static_cast<double>(mipmap.first));
3578 }
3579 }
3580 if (mipmaps_.count(1.0f) != 1) {
3581- throw wexception("All animations must provide images for the neutral scale (1.0)");
3582+ throw Widelands::GameDataError("All animations must provide images for the neutral scale (1.0)");
3583 }
3584 } catch (const LuaError& e) {
3585- throw wexception("Error in animation table: %s", e.what());
3586+ throw Widelands::GameDataError("Error in animation table: %s", e.what());
3587 }
3588 }
3589
3590@@ -266,59 +343,10 @@
3591 return result;
3592 }
3593
3594-void NonPackedAnimation::ensure_graphics_are_loaded() const {
3595- if (mipmaps_.begin()->second->frames.empty()) {
3596- const_cast<NonPackedAnimation*>(this)->load_graphics();
3597- }
3598-}
3599-
3600-void NonPackedAnimation::load_graphics() {
3601- for (const auto& entry : mipmaps_) {
3602- MipMapEntry* mipmap = entry.second.get();
3603-
3604- if (mipmap->image_files.empty()) {
3605- throw wexception("animation without image files at promised scale %.2f.",
3606- static_cast<double>(entry.first));
3607- }
3608- if (mipmap->playercolor_mask_image_files.size() &&
3609- mipmap->playercolor_mask_image_files.size() != mipmap->image_files.size()) {
3610- throw wexception("animation has %" PRIuS " frames but playercolor mask has %" PRIuS
3611- " frames for scale %.2f",
3612- mipmap->image_files.size(), mipmap->playercolor_mask_image_files.size(),
3613- static_cast<double>(entry.first));
3614- }
3615-
3616- for (const std::string& filename : mipmap->image_files) {
3617- const Image* image = g_gr->images().get(filename);
3618- if (mipmap->frames.size() && (mipmap->frames[0]->width() != image->width() ||
3619- mipmap->frames[0]->height() != image->height())) {
3620- throw wexception("wrong size: (%u, %u), should be (%u, %u) like the first frame",
3621- image->width(), image->height(), mipmap->frames[0]->width(),
3622- mipmap->frames[0]->height());
3623- }
3624- mipmap->frames.push_back(image);
3625- }
3626-
3627- for (const std::string& filename : mipmap->playercolor_mask_image_files) {
3628- // TODO(unknown): Do not load playercolor mask as opengl texture or use it as
3629- // opengl texture.
3630- const Image* pc_image = g_gr->images().get(filename);
3631- if (mipmap->frames[0]->width() != pc_image->width() ||
3632- mipmap->frames[0]->height() != pc_image->height()) {
3633- // TODO(unknown): see bug #1324642
3634- throw wexception("playercolor mask has wrong size: (%u, %u), should "
3635- "be (%u, %u) like the animation frame",
3636- pc_image->width(), pc_image->height(), mipmap->frames[0]->width(),
3637- mipmap->frames[0]->height());
3638- }
3639- mipmap->playercolor_mask_frames.push_back(pc_image);
3640- }
3641- }
3642-}
3643-
3644 float NonPackedAnimation::height() const {
3645- ensure_graphics_are_loaded();
3646- return mipmaps_.at(1.0f)->frames.at(0)->height();
3647+ const MipMapEntry& mipmap = *mipmaps_.at(1.0f);
3648+ mipmap.ensure_graphics_are_loaded();
3649+ return mipmap.frames.front()->height();
3650 }
3651
3652 uint16_t NonPackedAnimation::nr_frames() const {
3653@@ -368,8 +396,9 @@
3654 }
3655
3656 Rectf NonPackedAnimation::source_rectangle(const int percent_from_bottom, float scale) const {
3657- ensure_graphics_are_loaded();
3658- const Image* first_frame = mipmaps_.at(find_best_scale(scale))->frames.at(0);
3659+ const MipMapEntry& mipmap = *mipmaps_.at(find_best_scale(scale));
3660+ mipmap.ensure_graphics_are_loaded();
3661+ const Image* first_frame = mipmap.frames.front();
3662 const float h = percent_from_bottom * first_frame->height() / 100;
3663 // Using floor for pixel perfect positioning
3664 return Rectf(0.f, std::floor(first_frame->height() - h), first_frame->width(), h);
3665@@ -378,7 +407,6 @@
3666 Rectf NonPackedAnimation::destination_rectangle(const Vector2f& position,
3667 const Rectf& source_rect,
3668 const float scale) const {
3669- ensure_graphics_are_loaded();
3670 const float best_scale = find_best_scale(scale);
3671 return Rectf(position.x - (hotspot_.x - source_rect.x / best_scale) * scale,
3672 position.y - (hotspot_.y - source_rect.y / best_scale) * scale,
3673@@ -390,23 +418,18 @@
3674 const Rectf& source_rect,
3675 const Rectf& destination_rect,
3676 const RGBColor* clr,
3677- Surface* target,
3678- float scale) const {
3679- ensure_graphics_are_loaded();
3680- assert(target);
3681- const uint32_t idx = current_frame(time);
3682- assert(idx < nr_frames());
3683-
3684- const MipMapEntry& mipmap = *mipmaps_.at(find_best_scale(scale));
3685- if (!mipmap.has_playercolor_masks || clr == nullptr) {
3686- target->blit(destination_rect, *mipmap.frames.at(idx), source_rect, 1., BlendMode::UseAlpha);
3687- } else {
3688- target->blit_blended(destination_rect, *mipmap.frames.at(idx),
3689- *mipmap.playercolor_mask_frames.at(idx), source_rect, *clr);
3690- }
3691+ Surface* target, float scale) const {
3692+ mipmaps_.at(find_best_scale(scale))->blit(current_frame(time), source_rect, destination_rect, clr, target);
3693 trigger_sound(time, coords);
3694 }
3695
3696+void NonPackedAnimation::load_default_scale_and_sounds() const {
3697+ mipmaps_.at(1.0f)->ensure_graphics_are_loaded();
3698+ if (sound_effect_ != kNoSoundEffect && !SoundHandler::is_backend_disabled()) {
3699+ g_sh->load_fx(SoundType::kAmbient, sound_effect_);
3700+ }
3701+}
3702+
3703 } // namespace
3704
3705 /*
3706@@ -434,13 +457,12 @@
3707
3708 ==============================================================================
3709 */
3710-
3711-uint32_t AnimationManager::load(const LuaTable& table) {
3712- animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table)));
3713+uint32_t AnimationManager::load(const LuaTable& table, const std::string& basename) {
3714+ animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table, basename)));
3715 return animations_.size();
3716 }
3717-uint32_t AnimationManager::load(const std::string& map_object_name, const LuaTable& table) {
3718- animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table)));
3719+uint32_t AnimationManager::load(const std::string& map_object_name, const LuaTable& table, const std::string& basename) {
3720+ animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table, basename)));
3721 const size_t result = animations_.size();
3722 representative_animations_by_map_object_name_.insert(std::make_pair(map_object_name, result));
3723 return result;
3724@@ -448,7 +470,7 @@
3725
3726 const Animation& AnimationManager::get_animation(uint32_t id) const {
3727 if (!id || id > animations_.size())
3728- throw wexception("Requested unknown animation with id: %i", id);
3729+ throw Widelands::GameDataError("Requested unknown animation with id: %i", id);
3730
3731 return *animations_[id - 1];
3732 }
3733
3734=== modified file 'src/graphic/animation.h'
3735--- src/graphic/animation.h 2019-05-04 09:59:51 +0000
3736+++ src/graphic/animation.h 2019-05-27 14:29:35 +0000
3737@@ -94,8 +94,10 @@
3738 const Rectf& source_rect,
3739 const Rectf& destination_rect,
3740 const RGBColor* clr,
3741- Surface* target,
3742- float scale) const = 0;
3743+ Surface* target, float scale) const = 0;
3744+
3745+ /// Load animation images into memory for default scale.
3746+ virtual void load_default_scale_and_sounds() const = 0;
3747
3748 protected:
3749 /// Play the sound effect associated with this animation at the given time.
3750@@ -118,14 +120,16 @@
3751 /**
3752 * Loads an animation, graphics sound and everything from a Lua table.
3753 *
3754+ * The 'basename' is the filename prefix for loading the images, e.g. "idle" or "walk_ne".
3755+ *
3756 * The Lua table must contain a table 'pictures' with image paths and a 'hotspot' table.
3757 *
3758 * Optional parameters in the Lua table are 'fps' and 'sound_effect'.
3759 */
3760- uint32_t load(const LuaTable& table);
3761+ uint32_t load(const LuaTable& table, const std::string& basename);
3762 /// Same as above, but this animation will be used for getting a representative image by map
3763 /// object name
3764- uint32_t load(const std::string& map_object_name, const LuaTable& table);
3765+ uint32_t load(const std::string& map_object_name, const LuaTable& table, const std::string& basename);
3766
3767 /// Returns the animation with the given ID or throws an exception if it is
3768 /// unknown.
3769
3770=== modified file 'src/helper.h'
3771--- src/helper.h 2019-02-23 11:00:49 +0000
3772+++ src/helper.h 2019-05-27 14:29:35 +0000
3773@@ -41,17 +41,4 @@
3774 /// lines.
3775 std::vector<std::string> split_string(const std::string&, char const* separators);
3776
3777-// A functional container filtering (by copying the values). Returns a new
3778-// ContainerType that contains all values where 'test' returned true.
3779-template <typename ContainerType, class UnaryPredicate>
3780-ContainerType filter(const ContainerType& container, UnaryPredicate test) {
3781- ContainerType filtered;
3782- for (const auto& entry : container) {
3783- if (!test(entry)) {
3784- continue;
3785- }
3786- filtered.insert(entry);
3787- }
3788- return filtered;
3789-}
3790 #endif // end of include guard: WL_HELPER_H
3791
3792=== modified file 'src/io/filesystem/disk_filesystem.cc'
3793--- src/io/filesystem/disk_filesystem.cc 2019-02-23 11:00:49 +0000
3794+++ src/io/filesystem/disk_filesystem.cc 2019-05-27 14:29:35 +0000
3795@@ -76,7 +76,7 @@
3796 return true;
3797 }
3798
3799-std::set<std::string> RealFSImpl::list_directory(const std::string& path) {
3800+FilenameSet RealFSImpl::list_directory(const std::string& path) const {
3801 #ifdef _WIN32
3802 std::string buf;
3803 struct _finddata_t c_file;
3804@@ -152,7 +152,7 @@
3805 * \e can't exist then)
3806 */
3807 // TODO(unknown): Can this be rewritten to just using exceptions? Should it?
3808-bool RealFSImpl::file_exists(const std::string& path) {
3809+bool RealFSImpl::file_exists(const std::string& path) const {
3810 return FileSystemPath(canonicalize_name(path)).exists_;
3811 }
3812
3813
3814=== modified file 'src/io/filesystem/disk_filesystem.h'
3815--- src/io/filesystem/disk_filesystem.h 2019-02-23 11:00:49 +0000
3816+++ src/io/filesystem/disk_filesystem.h 2019-05-27 14:29:35 +0000
3817@@ -30,10 +30,10 @@
3818 public:
3819 explicit RealFSImpl(const std::string& Directory);
3820
3821- std::set<std::string> list_directory(const std::string& path) override;
3822+ FilenameSet list_directory(const std::string& path) const override;
3823
3824 bool is_writable() const override;
3825- bool file_exists(const std::string& path) override;
3826+ bool file_exists(const std::string& path) const override;
3827 bool is_directory(const std::string& path) override;
3828 void ensure_directory_exists(const std::string& fs_dirname) override;
3829 void make_directory(const std::string& fs_dirname) override;
3830
3831=== modified file 'src/io/filesystem/filesystem.cc'
3832--- src/io/filesystem/filesystem.cc 2019-03-12 20:55:44 +0000
3833+++ src/io/filesystem/filesystem.cc 2019-05-27 14:29:35 +0000
3834@@ -34,7 +34,9 @@
3835
3836 // We have to add Boost to this block to make codecheck happy
3837 #include <boost/algorithm/string/predicate.hpp>
3838+#include <boost/algorithm/string/replace.hpp>
3839 #include <boost/format.hpp>
3840+#include <boost/lexical_cast.hpp>
3841 #ifdef _WIN32
3842 #include <direct.h>
3843 #include <io.h>
3844@@ -81,6 +83,54 @@
3845 const std::vector<std::string> illegal_filename_characters{
3846 "<", ">", ":", "\"", "|", "?", "*", "/", "\\",
3847 };
3848+
3849+/// A class that makes iteration over filename_?.* templates easy. It is much faster than using regex.
3850+class NumberGlob {
3851+public:
3852+ explicit NumberGlob(const std::string& file_template);
3853+
3854+ /// If there is a next filename, puts it in 's' and returns true.
3855+ bool next(std::string* s);
3856+
3857+private:
3858+ std::string template_;
3859+ std::string format_;
3860+ std::string to_replace_;
3861+ uint32_t current_;
3862+ uint32_t max_;
3863+
3864+ DISALLOW_COPY_AND_ASSIGN(NumberGlob);
3865+};
3866+
3867+/**
3868+ * Implementation for NumberGlob.
3869+ */
3870+NumberGlob::NumberGlob(const std::string& file_template) : template_(file_template), current_(0) {
3871+ int nchars = count(file_template.begin(), file_template.end(), '?');
3872+ format_ = "%0" + boost::lexical_cast<std::string>(nchars) + "i";
3873+
3874+ max_ = 1;
3875+ for (int i = 0; i < nchars; ++i) {
3876+ max_ *= 10;
3877+ to_replace_ += "?";
3878+ }
3879+ max_ -= 1;
3880+}
3881+
3882+bool NumberGlob::next(std::string* s) {
3883+ if (current_ > max_) {
3884+ return false;
3885+ }
3886+
3887+ if (max_) {
3888+ *s = boost::replace_last_copy(
3889+ template_, to_replace_, (boost::format(format_) % current_).str());
3890+ } else {
3891+ *s = template_;
3892+ }
3893+ ++current_;
3894+ return true;
3895+}
3896 } // namespace
3897
3898 /**
3899@@ -261,6 +311,37 @@
3900 return homedir;
3901 }
3902
3903+// Returning a vector rather than a set because animations need the indices
3904+std::vector<std::string> FileSystem::get_sequential_files(const std::string& directory, const std::string& basename, const std::string& extension) const {
3905+ std::vector<std::string> result;
3906+
3907+ auto get_files = [this, directory, basename, extension](const std::string& number_template) {
3908+ std::vector<std::string> files;
3909+ const std::string filename_template = directory + file_separator() + basename + number_template + "." + extension;
3910+
3911+ NumberGlob glob(filename_template);
3912+ std::string filename;
3913+ while (glob.next(&filename)) {
3914+ if (!file_exists(filename)) {
3915+ break;
3916+ }
3917+ files.push_back(filename);
3918+ }
3919+ return files;
3920+ };
3921+ result = get_files("");
3922+ if (result.empty()) {
3923+ result = get_files("_?");
3924+ }
3925+ if (result.empty()) {
3926+ result = get_files("_??");
3927+ }
3928+ if (result.empty()) {
3929+ result = get_files("_???");
3930+ }
3931+ return result;
3932+}
3933+
3934 /**
3935 * Split a string into components separated by a certain character.
3936 *
3937
3938=== modified file 'src/io/filesystem/filesystem.h'
3939--- src/io/filesystem/filesystem.h 2019-02-23 11:00:49 +0000
3940+++ src/io/filesystem/filesystem.h 2019-05-27 14:29:35 +0000
3941@@ -50,11 +50,11 @@
3942 }
3943
3944 // Returns all files and directories (full path) in the given directory 'directory'.
3945- virtual std::set<std::string> list_directory(const std::string& directory) = 0;
3946+ virtual FilenameSet list_directory(const std::string& directory) const = 0;
3947
3948 virtual bool is_writable() const = 0;
3949 virtual bool is_directory(const std::string& path) = 0;
3950- virtual bool file_exists(const std::string& path) = 0;
3951+ virtual bool file_exists(const std::string& path) const = 0;
3952
3953 virtual void* load(const std::string& fname, size_t& length) = 0;
3954
3955@@ -132,6 +132,24 @@
3956 static std::string filename_without_ext(const char* n);
3957 static std::string get_homedir();
3958
3959+
3960+ /// Return the files in the given 'directory' that match the condition in 'test', i.e. 'test' returned 'true' for their filenames.
3961+ template <class UnaryPredicate>
3962+ FilenameSet filter_directory(const std::string& directory, UnaryPredicate test) const {
3963+ FilenameSet result = list_directory(directory);
3964+ for (auto it = result.begin(); it != result.end();) {
3965+ if (!test(*it)) {
3966+ it = result.erase(it);
3967+ } else {
3968+ ++it;
3969+ }
3970+ }
3971+ return result;
3972+ }
3973+
3974+ /// Returns all files in the given 'directory' that match 'basename' followed by 1-3 numbers, followed by '.', followed by 'extension'
3975+ std::vector<std::string> get_sequential_files(const std::string& directory, const std::string& basename, const std::string& extension) const;
3976+
3977 virtual unsigned long long disk_space() = 0;
3978
3979 protected:
3980
3981=== modified file 'src/io/filesystem/layered_filesystem.cc'
3982--- src/io/filesystem/layered_filesystem.cc 2019-02-23 11:00:49 +0000
3983+++ src/io/filesystem/layered_filesystem.cc 2019-05-27 14:29:35 +0000
3984@@ -59,7 +59,7 @@
3985 *
3986 * Returns the number of files found.
3987 */
3988-std::set<std::string> LayeredFileSystem::list_directory(const std::string& path) {
3989+FilenameSet LayeredFileSystem::list_directory(const std::string& path) const {
3990 std::set<std::string> results;
3991 FilenameSet files;
3992 // Check home system first
3993@@ -81,7 +81,7 @@
3994 /**
3995 * Returns true if the file can be found in at least one of the sub-filesystems
3996 */
3997-bool LayeredFileSystem::file_exists(const std::string& path) {
3998+bool LayeredFileSystem::file_exists(const std::string& path) const {
3999 if (home_ && home_->file_exists(path))
4000 return true;
4001 for (auto it = filesystems_.rbegin(); it != filesystems_.rend(); ++it)
4002
4003=== modified file 'src/io/filesystem/layered_filesystem.h'
4004--- src/io/filesystem/layered_filesystem.h 2019-02-23 11:00:49 +0000
4005+++ src/io/filesystem/layered_filesystem.h 2019-05-27 14:29:35 +0000
4006@@ -56,10 +56,10 @@
4007 // files). Take ownership of the given filesystem.
4008 void set_home_file_system(FileSystem*);
4009
4010- std::set<std::string> list_directory(const std::string& path) override;
4011+ FilenameSet list_directory(const std::string& path) const override;
4012
4013 bool is_writable() const override;
4014- bool file_exists(const std::string& path) override;
4015+ bool file_exists(const std::string& path) const override;
4016 bool is_directory(const std::string& path) override;
4017 void ensure_directory_exists(const std::string& fs_dirname) override;
4018 void make_directory(const std::string& fs_dirname) override;
4019
4020=== modified file 'src/io/filesystem/zip_filesystem.cc'
4021--- src/io/filesystem/zip_filesystem.cc 2019-02-23 11:00:49 +0000
4022+++ src/io/filesystem/zip_filesystem.cc 2019-05-27 14:29:35 +0000
4023@@ -154,7 +154,7 @@
4024 * pathname) in the results. There doesn't seem to be an even remotely
4025 * cross-platform way of doing this
4026 */
4027-std::set<std::string> ZipFilesystem::list_directory(const std::string& path_in) {
4028+FilenameSet ZipFilesystem::list_directory(const std::string& path_in) const {
4029 assert(path_in.size()); // prevent invalid read below
4030
4031 std::string path = basedir_in_zip_file_;
4032@@ -197,7 +197,7 @@
4033 * Returns true if the given file exists, and false if it doesn't.
4034 * Also returns false if the pathname is invalid
4035 */
4036-bool ZipFilesystem::file_exists(const std::string& path) {
4037+bool ZipFilesystem::file_exists(const std::string& path) const {
4038 try {
4039 unzGoToFirstFile(zip_file_->read_handle());
4040 } catch (...) {
4041
4042=== modified file 'src/io/filesystem/zip_filesystem.h'
4043--- src/io/filesystem/zip_filesystem.h 2019-02-23 11:00:49 +0000
4044+++ src/io/filesystem/zip_filesystem.h 2019-05-27 14:29:35 +0000
4045@@ -38,10 +38,10 @@
4046
4047 bool is_writable() const override;
4048
4049- std::set<std::string> list_directory(const std::string& path) override;
4050+ FilenameSet list_directory(const std::string& path) const override;
4051
4052 bool is_directory(const std::string& path) override;
4053- bool file_exists(const std::string& path) override;
4054+ bool file_exists(const std::string& path) const override;
4055
4056 void* load(const std::string& fname, size_t& length) override;
4057
4058
4059=== modified file 'src/logic/map_objects/map_object.cc'
4060--- src/logic/map_objects/map_object.cc 2019-05-26 17:21:15 +0000
4061+++ src/logic/map_objects/map_object.cc 2019-05-27 14:29:35 +0000
4062@@ -44,6 +44,10 @@
4063 #include "map_io/map_object_loader.h"
4064 #include "map_io/map_object_saver.h"
4065
4066+namespace {
4067+char const* const animation_direction_names[6] = {"_ne", "_e", "_se", "_sw", "_w", "_nw"};
4068+} // namespace
4069+
4070 namespace Widelands {
4071
4072 CmdDestroyMapObject::CmdDestroyMapObject(uint32_t const t, MapObject& o)
4073@@ -239,15 +243,7 @@
4074 init_descname,
4075 table.has_key("helptext_script") ? table.get_string("helptext_script") : "") {
4076 if (table.has_key("animations")) {
4077- std::unique_ptr<LuaTable> anims(table.get_table("animations"));
4078- for (const std::string& animation : anims->keys<std::string>()) {
4079- if (animation == "idle") {
4080- add_animation(
4081- animation, g_gr->animations().load(init_name, *anims->get_table(animation)));
4082- } else {
4083- add_animation(animation, g_gr->animations().load(*anims->get_table(animation)));
4084- }
4085- }
4086+ add_animations(*table.get_table("animations"));
4087 if (!is_animation_known("idle")) {
4088 throw GameDataError(
4089 "Map object %s has animations but no idle animation", init_name.c_str());
4090@@ -275,20 +271,43 @@
4091 }
4092
4093 /**
4094- * Add this animation for this map object under this name
4095+ * Add all animations for this map object
4096 */
4097-void MapObjectDescr::add_animation(const std::string& animname, uint32_t const anim) {
4098- if (is_animation_known(animname)) {
4099- throw GameDataError("Tried to add already existing animation \"%s\"", animname.c_str());
4100- } else {
4101- anims_.insert(std::pair<std::string, uint32_t>(animname, anim));
4102+void MapObjectDescr::add_animations(const LuaTable& table) {
4103+ for (const std::string& animname : table.keys<std::string>()) {
4104+ try {
4105+ std::unique_ptr<LuaTable> anim = table.get_table(animname);
4106+ // TODO(GunChleoc): Require basename after conversion has been completed
4107+ const std::string basename = anim->has_key<std::string>("basename") ? anim->get_string("basename") : "";
4108+ const bool is_directional = anim->has_key<std::string>("directional") ? anim->get_bool("directional") : false;
4109+ if (is_directional) {
4110+ for (int dir = 1; dir <= 6; ++dir) {
4111+ const std::string directional_animname = animname + animation_direction_names[dir - 1];
4112+ if (is_animation_known(directional_animname)) {
4113+ throw GameDataError("Tried to add already existing directional animation '%s\'", directional_animname.c_str());
4114+ }
4115+ const std::string directional_basename = basename + animation_direction_names[dir - 1];
4116+ anims_.insert(std::pair<std::string, uint32_t>(directional_animname, g_gr->animations().load(*anim, directional_basename)));
4117+ }
4118+ } else {
4119+ if (is_animation_known(animname)) {
4120+ throw GameDataError("Tried to add already existing animation '%s'", animname.c_str());
4121+ }
4122+ if (animname == "idle") {
4123+ anims_.insert(std::pair<std::string, uint32_t>(animname, g_gr->animations().load(name_, *anim, basename)));
4124+ } else {
4125+ anims_.insert(std::pair<std::string, uint32_t>(animname, g_gr->animations().load(*anim, basename)));
4126+ }
4127+ }
4128+ } catch (const std::exception& e) {
4129+ throw GameDataError("Error loading animation for map object '%s': %s", name().c_str(), e.what());
4130+ }
4131 }
4132 }
4133
4134-void MapObjectDescr::add_directional_animation(DirAnimations* anims, const std::string& prefix) {
4135- static char const* const dirstrings[6] = {"ne", "e", "se", "sw", "w", "nw"};
4136+void MapObjectDescr::assign_directional_animation(DirAnimations* anims, const std::string& basename) {
4137 for (int32_t dir = 1; dir <= 6; ++dir) {
4138- const std::string anim_name = prefix + std::string("_") + dirstrings[dir - 1];
4139+ const std::string anim_name = basename + animation_direction_names[dir - 1];
4140 try {
4141 anims->set_animation(dir, get_animation(anim_name, nullptr));
4142 } catch (const GameDataError& e) {
4143@@ -318,6 +337,12 @@
4144 NEVER_HERE();
4145 }
4146
4147+void MapObjectDescr::load_graphics() const {
4148+ for (const auto& temp_anim : anims_) {
4149+ g_gr->animations().get_animation(temp_anim.second).load_default_scale_and_sounds();
4150+ }
4151+}
4152+
4153 const Image* MapObjectDescr::representative_image(const RGBColor* player_color) const {
4154 if (is_animation_known("idle")) {
4155 return g_gr->animations().get_representative_image(
4156@@ -639,8 +664,12 @@
4157 * configured.
4158 *
4159 * Derived functions must call ancestor's function in the appropriate place.
4160+ *
4161+ * We also preload some animation graphics here to prevent jitter at game start.
4162 */
4163 void MapObject::Loader::load_finish() {
4164+ MapObject& mo = get<MapObject>();
4165+ mo.descr().load_graphics();
4166 }
4167
4168 /**
4169
4170=== modified file 'src/logic/map_objects/map_object.h'
4171--- src/logic/map_objects/map_object.h 2019-05-11 13:48:12 +0000
4172+++ src/logic/map_objects/map_object.h 2019-05-27 14:29:35 +0000
4173@@ -129,11 +129,9 @@
4174 std::string get_animation_name(uint32_t) const; ///< needed for save, debug
4175
4176 bool is_animation_known(const std::string& name) const;
4177- void add_animation(const std::string& name, uint32_t anim);
4178
4179- /// Sets the directional animations in 'anims' with the animations
4180- /// '&lt;prefix&gt;_(ne|e|se|sw|w|nw)'.
4181- void add_directional_animation(DirAnimations* anims, const std::string& prefix);
4182+ /// Preload animation graphics at default scale
4183+ void load_graphics() const;
4184
4185 /// Returns the image for the first frame of the idle animation if the MapObject has animations,
4186 /// nullptr otherwise
4187@@ -154,7 +152,13 @@
4188 const std::set<uint32_t>& allowed_special);
4189 void add_attribute(uint32_t attr);
4190
4191+ /// Sets the directional animations in 'anims' with the animations
4192+ /// '&lt;basename&gt;_(ne|e|se|sw|w|nw)'.
4193+ void assign_directional_animation(DirAnimations* anims, const std::string& basename);
4194+
4195 private:
4196+ void add_animations(const LuaTable& table);
4197+
4198 /// Throws an exception if the MapObjectDescr has no representative image
4199 void check_representative_image();
4200
4201
4202=== modified file 'src/logic/map_objects/tribes/ship.cc'
4203--- src/logic/map_objects/tribes/ship.cc 2019-05-27 05:37:03 +0000
4204+++ src/logic/map_objects/tribes/ship.cc 2019-05-27 14:29:35 +0000
4205@@ -114,7 +114,7 @@
4206 i18n::Textdomain td("tribes");
4207
4208 // Read the sailing animations
4209- add_directional_animation(&sail_anims_, "sail");
4210+ assign_directional_animation(&sail_anims_, "sail");
4211
4212 capacity_ = table.has_key("capacity") ? table.get_int("capacity") : 20;
4213 }
4214
4215=== modified file 'src/logic/map_objects/tribes/tribe_descr.cc'
4216--- src/logic/map_objects/tribes/tribe_descr.cc 2019-05-18 13:33:00 +0000
4217+++ src/logic/map_objects/tribes/tribe_descr.cc 2019-05-27 14:29:35 +0000
4218@@ -63,10 +63,12 @@
4219 initializations_ = info.initializations;
4220
4221 std::unique_ptr<LuaTable> items_table = table.get_table("animations");
4222- frontier_animation_id_ = g_gr->animations().load(
4223- name_ + std::string("_frontier"), *items_table->get_table("frontier"));
4224- flag_animation_id_ =
4225- g_gr->animations().load(name_ + std::string("_flag"), *items_table->get_table("flag"));
4226+ {
4227+ std::unique_ptr<LuaTable> animations_table = items_table->get_table("frontier");
4228+ frontier_animation_id_ = g_gr->animations().load(name_ + std::string("_frontier"), *animations_table, animations_table->get_string("basename"));
4229+ animations_table = items_table->get_table("flag");
4230+ flag_animation_id_ = g_gr->animations().load(name_ + std::string("_frontier"), *animations_table, animations_table->get_string("basename"));
4231+ }
4232
4233 items_table = table.get_table("roads");
4234 const auto load_roads = [&items_table](
4235
4236=== modified file 'src/logic/map_objects/tribes/worker_descr.cc'
4237--- src/logic/map_objects/tribes/worker_descr.cc 2019-05-22 11:23:14 +0000
4238+++ src/logic/map_objects/tribes/worker_descr.cc 2019-05-27 14:29:35 +0000
4239@@ -92,13 +92,13 @@
4240 }
4241
4242 // Read the walking animations
4243- add_directional_animation(&walk_anims_, "walk");
4244+ assign_directional_animation(&walk_anims_, "walk");
4245
4246 // Many workers don't carry wares, so they have no walkload animation.
4247 std::unique_ptr<LuaTable> anims(table.get_table("animations"));
4248 anims->do_not_warn_about_unaccessed_keys();
4249- if (anims->has_key("walkload_e")) {
4250- add_directional_animation(&walkload_anims_, "walkload");
4251+ if (is_animation_known("walkload_e")) {
4252+ assign_directional_animation(&walkload_anims_, "walkload");
4253 }
4254
4255 // Read programs
4256
4257=== modified file 'src/logic/map_objects/world/critter.cc'
4258--- src/logic/map_objects/world/critter.cc 2019-04-26 12:46:40 +0000
4259+++ src/logic/map_objects/world/critter.cc 2019-05-27 14:29:35 +0000
4260@@ -101,7 +101,7 @@
4261 const World& world)
4262 : BobDescr(init_descname, MapObjectType::CRITTER, MapObjectDescr::OwnerType::kWorld, table),
4263 editor_category_(nullptr) {
4264- add_directional_animation(&walk_anims_, "walk");
4265+ assign_directional_animation(&walk_anims_, "walk");
4266
4267 add_attributes(
4268 table.get_table("attributes")->array_entries<std::string>(), std::set<uint32_t>());
4269
4270=== modified file 'src/map_io/CMakeLists.txt'
4271--- src/map_io/CMakeLists.txt 2019-05-05 18:53:14 +0000
4272+++ src/map_io/CMakeLists.txt 2019-05-27 14:29:35 +0000
4273@@ -103,7 +103,6 @@
4274 graphic_minimap_renderer
4275 graphic_playercolor
4276 graphic_surface
4277- helper
4278 io_fileread
4279 io_filesystem
4280 logic
4281
4282=== modified file 'src/map_io/map_scripting_packet.cc'
4283--- src/map_io/map_scripting_packet.cc 2019-02-23 11:00:49 +0000
4284+++ src/map_io/map_scripting_packet.cc 2019-05-27 14:29:35 +0000
4285@@ -24,7 +24,6 @@
4286 #include <boost/algorithm/string/predicate.hpp>
4287
4288 #include "base/macros.h"
4289-#include "helper.h"
4290 #include "io/fileread.h"
4291 #include "io/filewrite.h"
4292 #include "logic/editor_game_base.h"
4293@@ -43,7 +42,7 @@
4294 void write_lua_dir(FileSystem& target_fs, FileSystem* map_fs, const std::string& path) {
4295 assert(map_fs);
4296 target_fs.ensure_directory_exists(path);
4297- for (const std::string& script : filter(map_fs->list_directory(path), [](const std::string& fn) {
4298+ for (const std::string& script : map_fs->filter_directory(path, [](const std::string& fn) {
4299 return boost::ends_with(fn, ".lua");
4300 })) {
4301 size_t length;
4302
4303=== modified file 'src/scripting/lua_path.cc'
4304--- src/scripting/lua_path.cc 2019-02-23 11:00:49 +0000
4305+++ src/scripting/lua_path.cc 2019-05-27 14:29:35 +0000
4306@@ -30,6 +30,8 @@
4307 namespace {
4308
4309 /// A class that makes iteration over filename_?.png templates easy.
4310+// TODO(GunChleoc): Code duplication with g_fs->get_sequential_files.
4311+// Get rid of this and list_files when conversion to spritemaps has been done.
4312 class NumberGlob {
4313 public:
4314 explicit NumberGlob(const std::string& file_template);
4315@@ -132,10 +134,11 @@
4316 /* RST
4317 .. function:: list_files(filename_template)
4318
4319- Lists the full path for all files that fit the template pattern.
4320+ **DEPRECATED**. Lists the full path for all files that fit the template pattern.
4321 Use ? as placeholders for numbers, e.g. 'directory/idle\_??.png' will list
4322 'directory/idle_00.png', 'directory/idle_01.png' etc, and
4323 'directory/idle.png' will just list 'directory/idle.png'.
4324+ Lua Tables need lots of memory, so only use this when you have to.
4325
4326 :type filename_template: class:`string`
4327 :arg filename_template: The filename template to use for the listing.
4328@@ -165,6 +168,7 @@
4329 .. function:: list_directory(filename)
4330
4331 Returns all file names contained in the given directory.
4332+ Lua Tables need lots of memory, so only use this when you have to.
4333
4334 :type filename: class:`string`
4335 :arg filename: The directory to read.
4336
4337=== modified file 'src/sound/fxset.cc'
4338--- src/sound/fxset.cc 2019-04-24 06:01:37 +0000
4339+++ src/sound/fxset.cc 2019-05-27 14:29:35 +0000
4340@@ -36,25 +36,15 @@
4341 * \param random: Randomize the time last played a bit to prevent sound onslaught at game start
4342 */
4343 FXset::FXset(const std::string& path, uint32_t random) : last_used_(random % 2000) {
4344- // Check directory
4345- std::string directory = FileSystem::fs_dirname(path);
4346- if (!g_fs->is_directory(directory)) {
4347- throw Widelands::GameDataError(
4348- "SoundHandler: Can't load files from %s, not a directory!", directory.c_str());
4349- }
4350-
4351- // Find files
4352- std::string base_filename = FileSystem::fs_filename(path.c_str());
4353- boost::regex re(base_filename + "_\\d+\\.ogg");
4354- paths_ = filter(g_fs->list_directory(directory), [&re](const std::string& fn) {
4355- return boost::regex_match(FileSystem::fs_filename(fn.c_str()), re);
4356- });
4357+ const std::string dirname = FileSystem::fs_dirname(path.c_str());
4358+ const std::string basename = FileSystem::fs_filename(path.c_str());
4359+ paths_ = g_fs->get_sequential_files(dirname, basename, "ogg");
4360
4361 // Ensure that we have at least 1 file
4362 if (paths_.empty()) {
4363 throw Widelands::GameDataError(
4364 "FXset: No files matching the pattern '%s_<numbers>.ogg' found in directory %s\n",
4365- base_filename.c_str(), directory.c_str());
4366+ basename.c_str(), dirname.c_str());
4367 }
4368
4369 #ifndef NDEBUG
4370@@ -81,7 +71,7 @@
4371 return SDL_GetTicks() - last_used_;
4372 }
4373
4374-Mix_Chunk* FXset::get_fx(uint32_t random) {
4375+void FXset::load_sound_files() {
4376 if (!paths_.empty()) {
4377 // Load sounds from paths if this FX hasn't been played yet
4378 for (const std::string& path : paths_) {
4379@@ -91,8 +81,11 @@
4380 // We don't need the paths any more
4381 paths_.clear();
4382 }
4383-
4384 assert(paths_.empty());
4385+}
4386+
4387+Mix_Chunk* FXset::get_fx(uint32_t random) {
4388+ load_sound_files();
4389
4390 if (fxs_.empty()) {
4391 return nullptr;
4392
4393=== modified file 'src/sound/fxset.h'
4394--- src/sound/fxset.h 2019-04-24 06:01:37 +0000
4395+++ src/sound/fxset.h 2019-05-27 14:29:35 +0000
4396@@ -20,7 +20,6 @@
4397 #ifndef WL_SOUND_FXSET_H
4398 #define WL_SOUND_FXSET_H
4399
4400-#include <set>
4401 #include <string>
4402 #include <vector>
4403
4404@@ -49,6 +48,9 @@
4405 */
4406 Mix_Chunk* get_fx(uint32_t random);
4407
4408+ /// Load the sound files into memory
4409+ void load_sound_files();
4410+
4411 private:
4412 /** Load an audio file into memory.
4413 * \param path the effect to be loaded
4414@@ -69,7 +71,7 @@
4415 * This will be cleared when the effects have been loaded into memory by \ref get_fx on first
4416 * play.
4417 */
4418- std::set<std::string> paths_;
4419+ std::vector<std::string> paths_;
4420
4421 /// The collection of sound effects, to be loaded on demand
4422 std::vector<Mix_Chunk*> fxs_;
4423
4424=== modified file 'src/sound/songset.cc'
4425--- src/sound/songset.cc 2019-04-24 06:01:37 +0000
4426+++ src/sound/songset.cc 2019-05-27 14:29:35 +0000
4427@@ -33,11 +33,7 @@
4428 Songset::Songset(const std::string& dir, const std::string& basename)
4429 : m_(nullptr), rwops_(nullptr) {
4430 assert(g_fs);
4431- FilenameSet files = filter(g_fs->list_directory(dir), [&basename](const std::string& fn) {
4432- const std::string only_filename = FileSystem::fs_filename(fn.c_str());
4433- return boost::starts_with(only_filename, basename) && boost::ends_with(only_filename, ".ogg");
4434- });
4435-
4436+ std::vector<std::string> files = g_fs->get_sequential_files(dir, basename, "ogg");
4437 for (const std::string& filename : files) {
4438 assert(!g_fs->is_directory(filename));
4439 add_song(filename);
4440
4441=== modified file 'src/sound/sound_handler.cc'
4442--- src/sound/sound_handler.cc 2019-04-24 06:01:37 +0000
4443+++ src/sound/sound_handler.cc 2019-05-27 14:29:35 +0000
4444@@ -412,6 +412,10 @@
4445 }
4446 }
4447
4448+void SoundHandler::load_fx(SoundType type, FxId id) {
4449+ fxs_[type][id]->load_sound_files();
4450+}
4451+
4452 /// Removes the given FXset from memory
4453 void SoundHandler::remove_fx_set(SoundType type) {
4454 fxs_.erase(type);
4455
4456=== modified file 'src/sound/sound_handler.h'
4457--- src/sound/sound_handler.h 2019-04-24 06:01:37 +0000
4458+++ src/sound/sound_handler.h 2019-05-27 14:29:35 +0000
4459@@ -180,6 +180,8 @@
4460 uint8_t priority = kFxPriorityAlwaysPlay,
4461 int32_t stereo_position = kStereoCenter,
4462 int distance = 0);
4463+ // Trigger loading of the sound files for the given effect.
4464+ void load_fx(SoundType type, FxId id);
4465 void remove_fx_set(SoundType type);
4466
4467 void register_songs(const std::string& dir, const std::string& basename);
4468
4469=== modified file 'src/wlapplication.cc'
4470--- src/wlapplication.cc 2019-05-13 06:04:34 +0000
4471+++ src/wlapplication.cc 2019-05-27 14:29:35 +0000
4472@@ -55,7 +55,6 @@
4473 #include "graphic/default_resolution.h"
4474 #include "graphic/font_handler.h"
4475 #include "graphic/text/font_set.h"
4476-#include "helper.h"
4477 #include "io/filesystem/disk_filesystem.h"
4478 #include "io/filesystem/filesystem_exceptions.h"
4479 #include "io/filesystem/layered_filesystem.h"
4480@@ -1500,7 +1499,7 @@
4481 */
4482 void WLApplication::cleanup_replays() {
4483 for (const std::string& filename :
4484- filter(g_fs->list_directory(kReplayDir), [](const std::string& fn) {
4485+ g_fs->filter_directory(kReplayDir, [](const std::string& fn) {
4486 return boost::ends_with(
4487 fn, (boost::format("%s%s") % kReplayExtension % kSyncstreamExtension).str());
4488 })) {
4489@@ -1521,7 +1520,7 @@
4490 */
4491 void WLApplication::cleanup_ai_files() {
4492 for (const std::string& filename :
4493- filter(g_fs->list_directory(kAiDir), [](const std::string& fn) {
4494+ g_fs->filter_directory(kAiDir, [](const std::string& fn) {
4495 return boost::ends_with(fn, kAiExtension) || boost::contains(fn, "ai_player");
4496 })) {
4497 if (is_autogenerated_and_expired(filename, kAIFilesKeepAroundTime)) {
4498@@ -1541,7 +1540,7 @@
4499 */
4500 void WLApplication::cleanup_temp_files() {
4501 for (const std::string& filename :
4502- filter(g_fs->list_directory(kTempFileDir),
4503+ g_fs->filter_directory(kTempFileDir,
4504 [](const std::string& fn) { return boost::ends_with(fn, kTempFileExtension); })) {
4505 if (is_autogenerated_and_expired(filename, kTempFilesKeepAroundTime)) {
4506 log("Deleting old temp file: %s\n", filename.c_str());
4507@@ -1559,7 +1558,7 @@
4508 * Recursively delete temporary backup files in a given directory
4509 */
4510 void WLApplication::cleanup_temp_backups(std::string dir) {
4511- for (const std::string& filename : filter(g_fs->list_directory(dir), [](const std::string& fn) {
4512+ for (const std::string& filename : g_fs->filter_directory(dir, [](const std::string& fn) {
4513 return boost::ends_with(fn, kTempBackupExtension);
4514 })) {
4515 if (is_autogenerated_and_expired(filename, kTempBackupsKeepAroundTime)) {
4516@@ -1573,7 +1572,7 @@
4517 }
4518 }
4519 // recursively delete in subdirs
4520- for (const std::string& dirname : filter(g_fs->list_directory(dir), [](const std::string& fn) {
4521+ for (const std::string& dirname : g_fs->filter_directory(dir, [](const std::string& fn) {
4522 return g_fs->is_directory(fn) &&
4523 // avoid searching within savegames/maps/backups that were created
4524 // as directories instead of zipfiles
4525
4526=== modified file 'src/wui/load_or_save_game.cc'
4527--- src/wui/load_or_save_game.cc 2019-05-26 17:21:15 +0000
4528+++ src/wui/load_or_save_game.cc 2019-05-27 14:29:35 +0000
4529@@ -367,16 +367,15 @@
4530 table_.clear();
4531
4532 FilenameSet gamefiles;
4533-
4534 if (filetype_ == FileType::kReplay) {
4535- gamefiles = filter(g_fs->list_directory(kReplayDir), [](const std::string& fn) {
4536+ gamefiles = g_fs->filter_directory(kReplayDir, [](const std::string& fn) {
4537 return boost::algorithm::ends_with(fn, kReplayExtension);
4538 });
4539 // Update description column title for replays
4540 table_.set_column_tooltip(2, show_filenames_ ? _("Filename: Map name (start of replay)") :
4541 _("Map name (start of replay)"));
4542 } else {
4543- gamefiles = filter(g_fs->list_directory(kSaveDir), [](const std::string& fn) {
4544+ gamefiles = g_fs->filter_directory(kSaveDir, [](const std::string& fn) {
4545 return boost::algorithm::ends_with(fn, kSavegameExtension);
4546 });
4547 }

Subscribers

People subscribed via source and target branches

to status/vote changes: