Project

General

Profile

Feature #1096 » 0050-Support-animated-Single-sprite-extras.patch

Marko Lindqvist, 11/17/2024 06:59 AM

View differences:

client/tilespec.c
*rmact;
enum extrastyle_id extrastyle;
union {
struct sprite *single;
struct anim *single;
struct sprite *cardinals[MAX_INDEX_CARDINAL];
struct {
struct sprite
......
TRUE); \
} while (FALSE)
#define SET_ANIM(field, tag) \
do { \
t->sprites.field = anim_load(t, tag, 3); \
if (t->sprites.field == NULL) { \
tileset_error(LOG_FATAL, tileset_name_get(t), \
_("Animation for tag '%s' missing."), tag); \
} \
} while (FALSE)
/************************************************************************//**
Load an animation
......
case ESTYLE_SINGLE1:
case ESTYLE_SINGLE2:
SET_SPRITE(extras[id].u.single, tag);
SET_ANIM(extras[id].u.single, tag);
break;
case ESTYLE_CARDINALS:
......
#define ADD_ANIM_SPRITE(s, draw_fog, x_offset, y_offset) \
ADD_SPRITE(anim_get_current_frame(s), draw_fog, x_offset, y_offset)
#define ADD_ANIM_SPRITE_SIMPLE(s) \
ADD_SPRITE(anim_get_current_frame(s), TRUE, 0, 0)
/************************************************************************//**
Assemble some data that is used in building the tile sprite arrays.
......
}
}
#define ADD_FRAME0_SIMPLE(s) ADD_SPRITE_SIMPLE(s->sprites[0])
/************************************************************************//**
Fill in the sprite array for the unit type.
****************************************************************************/
......
} extra_type_list_iterate_end;
if (!hidden) {
ADD_SPRITE_SIMPLE(t->sprites.extras[extra_index(pextra)].u.single);
ADD_ANIM_SPRITE_SIMPLE(t->sprites.extras[extra_index(pextra)].u.single);
}
}
} extra_type_list_iterate_end;
......
} extra_type_list_iterate_end;
if (!hidden) {
ADD_SPRITE_SIMPLE(t->sprites.extras[extra_index(pextra)].u.single);
ADD_ANIM_SPRITE_SIMPLE(t->sprites.extras[extra_index(pextra)].u.single);
}
}
} extra_type_list_iterate_end;
......
switch (t->sprites.extras[idx].extrastyle) {
case ESTYLE_SINGLE1:
case ESTYLE_SINGLE2:
ADD_SPRITE_SIMPLE(t->sprites.extras[idx].u.single);
ADD_FRAME0_SIMPLE(t->sprites.extras[idx].u.single);
break;
case ESTYLE_CARDINALS:
ADD_SPRITE_SIMPLE(t->sprites.extras[idx].u.cardinals[0]);
data/alio/terrain.spec
pixel_border = 1
tiles = { "row", "column","tag"
0, 0, "ts.thermal_vent"
1, 0, "ts.glowing_rocks"
2, 0, "ts.huge_plant"
3, 0, "ts.alien_mine"
0, 0, "ts.thermal_vent0"
1, 0, "ts.glowing_rocks0"
2, 0, "ts.huge_plant0"
3, 0, "ts.alien_mine0"
0, 1, "t.l0.radiating_rocks1"
5, 1, "t.l1.radiating_rocks1"
data/amplio/terrain1.spec
; Terrain special resources:
0, 2, "ts.oasis"
0, 4, "ts.oil"
0, 2, "ts.oasis0"
0, 4, "ts.oil0"
1, 2, "ts.buffalo"
1, 4, "ts.wheat"
1, 2, "ts.buffalo0"
1, 4, "ts.wheat0"
2, 2, "ts.pheasant"
2, 4, "ts.silk"
2, 2, "ts.pheasant0"
2, 4, "ts.silk0"
3, 2, "ts.coal"
3, 4, "ts.wine"
3, 2, "ts.coal0"
3, 4, "ts.wine0"
4, 2, "ts.gold"
4, 4, "ts.iron"
4, 2, "ts.gold0"
4, 4, "ts.iron0"
5, 2, "ts.tundra_game"
5, 4, "ts.furs"
5, 2, "ts.tundra_game0"
5, 4, "ts.furs0"
6, 2, "ts.arctic_ivory"
6, 4, "ts.arctic_oil"
6, 2, "ts.arctic_ivory0"
6, 4, "ts.arctic_oil0"
7, 2, "ts.peat"
7, 4, "ts.spice"
7, 2, "ts.peat0"
7, 4, "ts.spice0"
8, 2, "ts.gems"
8, 4, "ts.fruit"
8, 2, "ts.gems0"
8, 4, "ts.fruit0"
9, 2, "ts.fish"
9, 4, "ts.whales"
9, 2, "ts.fish0"
9, 4, "ts.whales0"
10, 2, "ts.seals"
10, 4, "ts.forest_game"
10, 2, "ts.seals0"
10, 4, "ts.forest_game0"
11, 2, "ts.horses"
11, 4, "ts.grassland_resources", "ts.river_resources"
11, 2, "ts.horses0"
11, 4, "ts.grassland_resources0", "ts.river_resources0"
; Roads
12, 0, "road.road_isolated"
......
13, 8, "road.rail_nw"
; Other extras
0, 6, "tx.oil_mine"
0, 6, "tx.oil_mine0"
1, 6, "tx.irrigation"
2, 6, "tx.farmland"
3, 6, "tx.mine"
4, 6, "tx.pollution"
5, 6, "tx.village"
6, 6, "tx.fallout"
7, 6, "tx.oil_rig"
8, 6, "tx.nets"
3, 6, "tx.mine0"
4, 6, "tx.pollution0"
5, 6, "tx.village0"
6, 6, "tx.fallout0"
7, 6, "tx.oil_rig0"
8, 6, "tx.nets0"
15, 0, "t.dither_tile"
15, 0, "tx.darkness"
data/amplio2/terrain1.spec
; Terrain special resources:
0, 2, "ts.oasis"
0, 4, "ts.oil"
0, 2, "ts.oasis0"
0, 4, "ts.oil0"
1, 2, "ts.buffalo"
1, 4, "ts.wheat"
1, 2, "ts.buffalo0"
1, 4, "ts.wheat0"
2, 2, "ts.pheasant"
2, 4, "ts.silk"
2, 2, "ts.pheasant0"
2, 4, "ts.silk0"
3, 2, "ts.coal"
3, 4, "ts.wine"
3, 2, "ts.coal0"
3, 4, "ts.wine0"
4, 2, "ts.gold"
4, 4, "ts.iron"
4, 2, "ts.gold0"
4, 4, "ts.iron0"
5, 2, "ts.tundra_game"
5, 4, "ts.furs"
5, 2, "ts.tundra_game0"
5, 4, "ts.furs0"
6, 2, "ts.arctic_ivory"
6, 4, "ts.arctic_oil"
6, 2, "ts.arctic_ivory0"
6, 4, "ts.arctic_oil0"
7, 2, "ts.peat"
7, 4, "ts.spice"
7, 2, "ts.peat0"
7, 4, "ts.spice0"
8, 2, "ts.gems"
8, 4, "ts.fruit"
8, 2, "ts.gems0"
8, 4, "ts.fruit0"
9, 2, "ts.fish"
9, 4, "ts.whales"
9, 2, "ts.fish0"
9, 4, "ts.whales0"
10, 2, "ts.seals"
10, 4, "ts.forest_game"
10, 2, "ts.seals0"
10, 4, "ts.forest_game0"
11, 2, "ts.horses"
11, 4, "ts.grassland_resources", "ts.river_resources"
11, 2, "ts.horses0"
11, 4, "ts.grassland_resources0", "ts.river_resources0"
;roads
; Roads
12, 0, "road.road_isolated"
12, 1, "road.road_n"
12, 2, "road.road_ne"
......
12, 7, "road.road_w"
12, 8, "road.road_nw"
;rails
; Rails
13, 0, "road.rail_isolated"
13, 1, "road.rail_n"
13, 2, "road.rail_ne"
......
13, 7, "road.rail_w"
13, 8, "road.rail_nw"
;add-ons
0, 6, "tx.oil_mine"
; Add-ons
0, 6, "tx.oil_mine0"
1, 6, "tx.irrigation"
2, 6, "tx.farmland"
3, 6, "tx.mine"
4, 6, "tx.pollution"
5, 6, "tx.village"
6, 6, "tx.fallout"
7, 6, "tx.oil_rig"
8, 6, "tx.nets"
3, 6, "tx.mine0"
4, 6, "tx.pollution0"
5, 6, "tx.village0"
6, 6, "tx.fallout0"
7, 6, "tx.oil_rig0"
8, 6, "tx.nets0"
15, 0, "t.dither_tile"
15, 0, "tx.darkness"
15, 2, "mask.tile"
15, 2, "t.unknown1"
7, 0, "t.blend.arctic" ;ice over neighbors
7, 0, "t.blend.arctic" ; Ice over neighbors
15, 3, "t.blend.coast"
15, 3, "t.blend.lake"
15, 4, "user.attention"
15, 5, "tx.fog"
15, 6, "user.infratile"
;goto path sprites
14, 7, "path.step" ; turn boundary within path
14, 8, "path.exhausted_mp" ; tip of path, no MP left
15, 7, "path.normal" ; tip of path with MP remaining
; Goto path sprites
14, 7, "path.step" ; Turn boundary within path
14, 8, "path.exhausted_mp" ; Tip of path, no MP left
15, 7, "path.normal" ; Tip of path with MP remaining
15, 8, "path.waypoint"
}
data/hex2t/tiles.spec
; Terrain special resources:
4, 0, "ts.oasis"
5, 0, "ts.oil"
4, 1, "ts.buffalo"
5, 1, "ts.wheat"
5, 2, "ts.grassland_resources", "ts.river_resources"
4, 3, "ts.pheasant"
5, 3, "ts.silk"
4, 4, "ts.coal"
5, 4, "ts.wine"
4, 5, "ts.gold"
5, 5, "ts.iron"
4, 6, "ts.tundra_game"
5, 6, "ts.furs"
4, 7, "ts.arctic_ivory"
5, 7, "ts.arctic_oil"
4, 8, "ts.peat"
5, 8, "ts.spice"
4, 9, "ts.gems"
5, 9, "ts.fruit"
4, 10, "ts.fish"
5, 10, "ts.whales"
6, 7, "ts.seals"
6, 8, "ts.forest_game"
6, 9, "ts.horses"
4, 0, "ts.oasis0"
5, 0, "ts.oil0"
4, 1, "ts.buffalo0"
5, 1, "ts.wheat0"
5, 2, "ts.grassland_resources0", "ts.river_resources0"
4, 3, "ts.pheasant0"
5, 3, "ts.silk0"
4, 4, "ts.coal0"
5, 4, "ts.wine0"
4, 5, "ts.gold0"
5, 5, "ts.iron0"
4, 6, "ts.tundra_game0"
5, 6, "ts.furs0"
4, 7, "ts.arctic_ivory0"
5, 7, "ts.arctic_oil0"
4, 8, "ts.peat0"
5, 8, "ts.spice0"
4, 9, "ts.gems0"
5, 9, "ts.fruit0"
4, 10, "ts.fish0"
5, 10, "ts.whales0"
6, 7, "ts.seals0"
6, 8, "ts.forest_game0"
6, 9, "ts.horses0"
; Extras
6, 0, "tx.oil_mine"
6, 10, "tx.oil_rig"
6, 1, "tx.mine"
6, 0, "tx.oil_mine0"
6, 10, "tx.oil_rig0"
6, 1, "tx.mine0"
6, 2, "tx.irrigation"
6, 3, "tx.farmland"
6, 4, "tx.pollution"
6, 5, "tx.fallout"
6, 6, "tx.village"
6, 4, "tx.pollution0"
6, 5, "tx.fallout0"
6, 6, "tx.village0"
7, 10, "tx.nets"
7, 10, "tx.nets0"
; Random stuff
data/hexemplio/terrain.spec
5, 0, "t.l1.inaccessible1"
; Terrain special resources:
1, 0, "ts.oil" ;[?]
1, 0, "ts.arctic_oil" ;[?]
1, 1, "ts.buffalo" ;[?]
1, 2, "ts.grassland_resources" ;[?]
1, 2, "ts.river_resources" ;[?]
1, 3, "ts.tundra_game" ;[?]
1, 4, "ts.arctic_ivory" ;[?]
1, 5, "ts.peat" ;[?]
1, 6, "ts.coal" ;[?]
1, 7, "ts.forest_game" ;[?]
1, 8, "ts.gold" ;[?]
1, 0, "ts.oil0" ;[?]
1, 0, "ts.arctic_oil0" ;[?]
1, 1, "ts.buffalo0" ;[?]
1, 2, "ts.grassland_resources0" ;[?]
1, 2, "ts.river_resources0" ;[?]
1, 3, "ts.tundra_game0" ;[?]
1, 4, "ts.arctic_ivory0" ;[?]
1, 5, "ts.peat0" ;[?]
1, 6, "ts.coal0" ;[?]
1, 7, "ts.forest_game0" ;[?]
1, 8, "ts.gold0" ;[?]
2, 0, "ts.oasis" ;[BFW]
2, 1, "ts.wheat" ;[?]
2, 2, "ts.pheasant" ;[?]
2, 3, "ts.furs" ;[?]
2, 4, "ts.seals" ;[?]
2, 5, "ts.spice" ;[?]
2, 6, "ts.wine" ;[?]
2, 7, "ts.silk" ;[?]
2, 8, "ts.iron" ;[?]
2, 0, "ts.oasis0" ;[BFW]
2, 1, "ts.wheat0" ;[?]
2, 2, "ts.pheasant0" ;[?]
2, 3, "ts.furs0" ;[?]
2, 4, "ts.seals0" ;[?]
2, 5, "ts.spice0" ;[?]
2, 6, "ts.wine0" ;[?]
2, 7, "ts.silk0" ;[?]
2, 8, "ts.iron0" ;[?]
3, 6, "ts.fruit" ;[?]
3, 7, "ts.gems" ;[?]
3, 8, "ts.fish" ;[?]
3, 6, "ts.fruit0" ;[?]
3, 7, "ts.gems0" ;[?]
3, 8, "ts.fish0" ;[?]
4, 8, "ts.whales" ;[?]
4, 8, "ts.whales0" ;[?]
; Strategic Resources
3, 0, "ts.saltpeter" ;[?]
3, 1, "ts.aluminum" ;[?]
3, 2, "ts.uranium" ;[?]
3, 3, "ts.horses" ;[?]
3, 4, "ts.elephant" ;[AF]
3, 5, "ts.rubber" ;[GS]
3, 0, "ts.saltpeter0" ;[?]
3, 1, "ts.aluminum0" ;[?]
3, 2, "ts.uranium0" ;[?]
3, 3, "ts.horses0" ;[?]
3, 4, "ts.elephant0" ;[AF]
3, 5, "ts.rubber0" ;[GS]
;add-ons
4, 0, "tx.oil_mine" ;[?]
4, 1, "tx.mine" ;[?]
4, 2, "tx.oil_rig" ;[?][GS]
4, 3, "tx.irrigation" ;[GS]
4, 4, "tx.farmland" ;[GS]
4, 5, "tx.fallout" ;[?][GS]
4, 6, "tx.pollution" ;[?]
4, 7, "tx.village" ;[BFW][GS]
4, 0, "tx.oil_mine0" ;[?]
4, 1, "tx.mine0" ;[?]
4, 2, "tx.oil_rig0" ;[?][GS]
4, 3, "tx.irrigation" ;[GS]
4, 4, "tx.farmland" ;[GS]
4, 5, "tx.fallout0" ;[?][GS]
4, 6, "tx.pollution0" ;[?]
4, 7, "tx.village0" ;[BFW][GS]
;misc
5, 5, "mask.tile"
data/isophex/terrain1.spec
; Terrain special resources:
1, 0, "ts.oil"
2, 0, "ts.oasis"
1, 1, "ts.buffalo"
2, 1, "ts.wheat"
1, 2, "ts.grassland_resources"
1, 2, "ts.river_resources"
2, 2, "ts.pheasant"
1, 3, "ts.tundra_game"
2, 3, "ts.furs"
1, 4, "ts.arctic_ivory"
2, 4, "ts.arctic_oil"
1, 5, "ts.peat"
2, 5, "ts.spice"
1, 6, "ts.gems"
2, 6, "ts.fruit"
1, 7, "ts.forest_game"
2, 7, "ts.silk"
1, 8, "ts.coal"
2, 8, "ts.wine"
1, 9, "ts.gold"
2, 9, "ts.iron"
1, 10, "ts.fish"
2, 10, "ts.whales"
3, 6, "ts.seals"
1, 0, "ts.oil0"
2, 0, "ts.oasis0"
1, 1, "ts.buffalo0"
2, 1, "ts.wheat0"
1, 2, "ts.grassland_resources0"
1, 2, "ts.river_resources0"
2, 2, "ts.pheasant0"
1, 3, "ts.tundra_game0"
2, 3, "ts.furs0"
1, 4, "ts.arctic_ivory0"
2, 4, "ts.arctic_oil0"
1, 5, "ts.peat0"
2, 5, "ts.spice0"
1, 6, "ts.gems0"
2, 6, "ts.fruit0"
1, 7, "ts.forest_game0"
2, 7, "ts.silk0"
1, 8, "ts.coal0"
2, 8, "ts.wine0"
1, 9, "ts.gold0"
2, 9, "ts.iron0"
1, 10, "ts.fish0"
2, 10, "ts.whales0"
3, 6, "ts.seals0"
; Strategic Resources
3, 0, "ts.saltpeter"
3, 1, "ts.aluminum"
3, 2, "ts.uranium"
3, 3, "ts.horses"
3, 4, "ts.elephant"
3, 5, "ts.rubber"
3, 0, "ts.saltpeter0"
3, 1, "ts.aluminum0"
3, 2, "ts.uranium0"
3, 3, "ts.horses0"
3, 4, "ts.elephant0"
3, 5, "ts.rubber0"
; Roads
......
;add-ons
4, 0, "tx.oil_mine"
4, 1, "tx.oil_rig"
4, 2, "tx.mine"
4, 0, "tx.oil_mine0"
4, 1, "tx.oil_rig0"
4, 2, "tx.mine0"
4, 3, "tx.irrigation"
4, 4, "tx.farmland"
4, 5, "tx.fallout"
4, 6, "tx.pollution"
4, 7, "tx.village"
4, 8, "tx.nets"
4, 5, "tx.fallout0"
4, 6, "tx.pollution0"
4, 7, "tx.village0"
4, 8, "tx.nets0"
; misc
data/isotrident/terrain1.spec
; Terrain special resources:
0, 2, "ts.oasis"
0, 3, "ts.oil"
0, 2, "ts.oasis0"
0, 3, "ts.oil0"
1, 2, "ts.buffalo"
1, 3, "ts.wheat"
1, 2, "ts.buffalo0"
1, 3, "ts.wheat0"
2, 2, "ts.fish"
2, 3, "ts.whales"
2, 2, "ts.fish0"
2, 3, "ts.whales0"
7, 7, "ts.grassland_resources", "ts.river_resources"
7, 7, "ts.grassland_resources0", "ts.river_resources0"
3, 2, "ts.pheasant"
3, 3, "ts.silk"
3, 2, "ts.pheasant0"
3, 3, "ts.silk0"
4, 2, "ts.coal"
4, 3, "ts.wine"
4, 2, "ts.coal0"
4, 3, "ts.wine0"
5, 2, "ts.gold"
5, 3, "ts.iron"
5, 2, "ts.gold0"
5, 3, "ts.iron0"
6, 2, "ts.tundra_game"
6, 3, "ts.furs"
6, 2, "ts.tundra_game0"
6, 3, "ts.furs0"
7, 2, "ts.arctic_ivory"
7, 3, "ts.arctic_oil"
7, 2, "ts.arctic_ivory0"
7, 3, "ts.arctic_oil0"
8, 2, "ts.peat"
8, 3, "ts.spice"
8, 2, "ts.peat0"
8, 3, "ts.spice0"
9, 2, "ts.gems"
9, 3, "ts.fruit"
9, 4, "ts.horses"
9, 5, "ts.seals"
9, 6, "ts.forest_game"
9, 2, "ts.gems0"
9, 3, "ts.fruit0"
9, 4, "ts.horses0"
9, 5, "ts.seals0"
9, 6, "ts.forest_game0"
; Maglevs
......
12, 8, "road.rail_nw"
; Add-ons
2, 7, "tx.oil_mine"
2, 8, "tx.oil_rig"
2, 7, "tx.oil_mine0"
2, 8, "tx.oil_rig0"
3, 7, "tx.irrigation"
4, 7, "tx.farmland"
5, 7, "tx.mine"
6, 7, "tx.pollution"
8, 7, "tx.village"
8, 8, "tx.nets"
9, 7, "tx.fallout"
5, 7, "tx.mine0"
6, 7, "tx.pollution0"
8, 7, "tx.village0"
8, 8, "tx.nets0"
9, 7, "tx.fallout0"
}
data/trident/tiles.spec
; Terrain special resources:
14, 0, "ts.spice"
14, 1, "ts.furs"
14, 2, "ts.peat"
14, 3, "ts.arctic_ivory"
14, 4, "ts.fruit"
14, 5, "ts.iron"
14, 6, "ts.whales"
14, 7, "ts.wheat"
14, 8, "ts.pheasant"
14, 9, "ts.buffalo"
14, 10, "ts.silk"
14, 11, "ts.wine"
15, 0, "ts.seals"
15, 1, "ts.oasis"
15, 2, "ts.forest_game"
15, 3, "ts.grassland_resources"
15, 4, "ts.coal"
15, 5, "ts.gems"
15, 6, "ts.gold"
15, 7, "ts.fish"
15, 8, "ts.horses"
15, 9, "ts.river_resources"
15, 10, "ts.oil", "ts.arctic_oil"
15, 11, "ts.tundra_game"
14, 0, "ts.spice0"
14, 1, "ts.furs0"
14, 2, "ts.peat0"
14, 3, "ts.arctic_ivory0"
14, 4, "ts.fruit0"
14, 5, "ts.iron0"
14, 6, "ts.whales0"
14, 7, "ts.wheat0"
14, 8, "ts.pheasant0"
14, 9, "ts.buffalo0"
14, 10, "ts.silk0"
14, 11, "ts.wine0"
15, 0, "ts.seals0"
15, 1, "ts.oasis0"
15, 2, "ts.forest_game0"
15, 3, "ts.grassland_resources0"
15, 4, "ts.coal0"
15, 5, "ts.gems0"
15, 6, "ts.gold0"
15, 7, "ts.fish0"
15, 8, "ts.horses0"
15, 9, "ts.river_resources0"
15, 10, "ts.oil0", "ts.arctic_oil0"
15, 11, "ts.tundra_game0"
; Terrain Strategic Resources
15, 12, "ts.aluminum"
15, 13, "ts.uranium"
15, 14, "ts.saltpeter"
15, 15, "ts.elephant"
15, 12, "ts.aluminum0"
15, 13, "ts.uranium0"
15, 14, "ts.saltpeter0"
15, 15, "ts.elephant0"
; Terrain improvements and similar:
16, 0, "tx.farmland"
16, 1, "tx.irrigation"
16, 2, "tx.mine"
16, 3, "tx.oil_mine"
16, 4, "tx.pollution"
16, 5, "tx.fallout"
16, 13, "tx.oil_rig"
16, 14, "tx.nets"
16, 2, "tx.mine0"
16, 3, "tx.oil_mine0"
16, 4, "tx.pollution0"
16, 5, "tx.fallout0"
16, 13, "tx.oil_rig0"
16, 14, "tx.nets0"
; Bases
16, 6, "base.buoy_mg"
16, 7, "extra.ruins_mg"
16, 8, "tx.village"
16, 8, "tx.village0"
16, 9, "base.airstrip_mg"
16, 10, "base.airbase_mg"
16, 11, "base.outpost_mg"
(2-2/3)