From 023d8d5875a6a65fea63b426e1072f9e557b93b1 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 24 Nov 2021 04:34:30 +0200 Subject: [PATCH 36/36] Add tileset specified stack size sprite offsets See osdn #43191 Signed-off-by: Marko Lindqvist --- client/tilespec.c | 11 +++++++++-- data/3d.tilespec | 4 ++++ data/alio.tilespec | 4 ++++ data/amplio.tilespec | 4 ++++ data/amplio2.tilespec | 4 ++++ data/cimpletoon.tilespec | 4 ++++ data/hex2t.tilespec | 4 ++++ data/hexemplio.tilespec | 4 ++++ data/isophex.tilespec | 4 ++++ data/isotrident.tilespec | 4 ++++ data/toonhex.tilespec | 4 ++++ data/trident.tilespec | 4 ++++ 12 files changed, 53 insertions(+), 2 deletions(-) diff --git a/client/tilespec.c b/client/tilespec.c index 2ec34bd509..b6c8edf623 100644 --- a/client/tilespec.c +++ b/client/tilespec.c @@ -500,6 +500,8 @@ struct tileset { int activity_offset_y; int select_offset_x; int select_offset_y; + int stack_size_offset_x; + int stack_size_offset_y; int occupied_offset_x; int occupied_offset_y; int unit_upkeep_offset_y; @@ -2064,6 +2066,10 @@ static struct tileset *tileset_read_toplevel(const char *tileset_name, "tilespec.select_offset_x") || !secfile_lookup_int(file, &t->select_offset_y, "tilespec.select_offset_y") + || !secfile_lookup_int(file, &t->stack_size_offset_x, + "tilespec.stack_size_offset_x") + || !secfile_lookup_int(file, &t->stack_size_offset_y, + "tilespec.stack_size_offset_y") || !secfile_lookup_int(file, &t->city_offset_x, "tilespec.city_offset_x") || !secfile_lookup_int(file, &t->city_offset_y, @@ -2092,6 +2098,8 @@ static struct tileset *tileset_read_toplevel(const char *tileset_name, t->city_size_offset_y = t->scale * t->city_size_offset_y; t->select_offset_x = t->scale * t->select_offset_x; t->select_offset_y = t->scale * t->select_offset_y; + t->stack_size_offset_x = t->scale * t->stack_size_offset_x; + t->stack_size_offset_y = t->scale * t->stack_size_offset_y; t->unit_flag_offset_x = t->scale * t->unit_flag_offset_x; t->unit_flag_offset_y = t->scale * t->unit_flag_offset_y; t->city_flag_offset_x = t->scale * t->city_flag_offset_x; @@ -4432,8 +4440,7 @@ static int fill_unit_sprite_array(const struct tileset *t, if (gui_options.draw_unit_stack_size && t->sprites.unit.num_stack_sprites >= stack) { ADD_SPRITE(t->sprites.unit.stack[stack - 1], FALSE, - FULL_TILE_X_OFFSET + t->unit_offset_x, - FULL_TILE_Y_OFFSET + t->unit_offset_y); + t->stack_size_offset_x, t->stack_size_offset_y); } else { ADD_SPRITE_FULL(t->sprites.unit.stack[0]); } diff --git a/data/3d.tilespec b/data/3d.tilespec index cfbb608e8f..0f18e68119 100644 --- a/data/3d.tilespec +++ b/data/3d.tilespec @@ -58,6 +58,10 @@ activity_offset_y = 0 select_offset_x = 0 select_offset_y = 0 +; offset of the unit stack size number sprites +stack_size_offset_x = 0 +stack_size_offset_y = 0 + ; offset the cities by this amount city_offset_x = 0 city_offset_y = 0 diff --git a/data/alio.tilespec b/data/alio.tilespec index 8c0a52c1c5..afb8f191a8 100644 --- a/data/alio.tilespec +++ b/data/alio.tilespec @@ -70,6 +70,10 @@ select_offset_y = 21 city_offset_x = 17 city_offset_y = 21 +; offset the cities by this amount +city_offset_x = 17 +city_offset_y = 21 + ; offset the city size number by this amount ; This is relative to full sprite origin. city_size_offset_x = 0 diff --git a/data/amplio.tilespec b/data/amplio.tilespec index 82e09e453d..01207d7a4a 100644 --- a/data/amplio.tilespec +++ b/data/amplio.tilespec @@ -57,6 +57,10 @@ activity_offset_y = 0 select_offset_x = 0 select_offset_y = 0 +; offset of the unit stack size number sprites +stack_size_offset_x = 20 +stack_size_offset_y = 20 + ; offset the cities by this amount city_offset_x = 0 city_offset_y = 0 diff --git a/data/amplio2.tilespec b/data/amplio2.tilespec index 7ff8739759..eedce2c0c1 100644 --- a/data/amplio2.tilespec +++ b/data/amplio2.tilespec @@ -57,6 +57,10 @@ activity_offset_y = 0 select_offset_x = 0 select_offset_y = 0 +; offset of the unit stack size number sprites +stack_size_offset_x = 20 +stack_size_offset_y = 20 + ; offset the cities by this amount city_offset_x = 0 city_offset_y = 0 diff --git a/data/cimpletoon.tilespec b/data/cimpletoon.tilespec index 6b532d200c..9a696c0c4d 100644 --- a/data/cimpletoon.tilespec +++ b/data/cimpletoon.tilespec @@ -60,6 +60,10 @@ activity_offset_y = 0 select_offset_x = 0 select_offset_y = 0 +; offset of the unit stack size number sprites +stack_size_offset_x = 22 +stack_size_offset_y = 10 + ; offset the cities by this amount city_offset_x = 0 city_offset_y = 0 diff --git a/data/hex2t.tilespec b/data/hex2t.tilespec index 399d8acd01..d7e0cee292 100644 --- a/data/hex2t.tilespec +++ b/data/hex2t.tilespec @@ -60,6 +60,10 @@ activity_offset_y = 0 select_offset_x = 0 select_offset_y = 22 +; offset of the unit stack size number sprites +stack_size_offset_x = -1 +stack_size_offset_y = 35 + ; offset the cities by this amount city_offset_x = 0 city_offset_y = 0 diff --git a/data/hexemplio.tilespec b/data/hexemplio.tilespec index 46d105e102..60ac8f6237 100644 --- a/data/hexemplio.tilespec +++ b/data/hexemplio.tilespec @@ -62,6 +62,10 @@ activity_offset_y = 28 select_offset_x = 0 select_offset_y = 21 +; offset of the unit stack size number sprites +stack_size_offset_x = 32 +stack_size_offset_y = 25 + ; offset the cities by this amount city_offset_x = 17 city_offset_y = 21 diff --git a/data/isophex.tilespec b/data/isophex.tilespec index e921ebb735..ec9eedc9d5 100644 --- a/data/isophex.tilespec +++ b/data/isophex.tilespec @@ -60,6 +60,10 @@ activity_offset_y = 0 select_offset_x = 0 select_offset_y = 0 +; offset of the unit stack size number sprites +stack_size_offset_x = 20 +stack_size_offset_y = 10 + ; offset the cities by this amount city_offset_x = 0 city_offset_y = 0 diff --git a/data/isotrident.tilespec b/data/isotrident.tilespec index ee9d5a9c8f..61646d6fd5 100644 --- a/data/isotrident.tilespec +++ b/data/isotrident.tilespec @@ -59,6 +59,10 @@ activity_offset_y = 0 select_offset_x = 0 select_offset_y = 0 +; offset of the unit stack size number sprites +stack_size_offset_x = 20 +stack_size_offset_y = 10 + ; offset the cities by this amount city_offset_x = 0 city_offset_y = 0 diff --git a/data/toonhex.tilespec b/data/toonhex.tilespec index 1ae508fdc2..2e749a452e 100644 --- a/data/toonhex.tilespec +++ b/data/toonhex.tilespec @@ -64,6 +64,10 @@ activity_offset_y = 28 select_offset_x = 0 select_offset_y = 21 +; offset of the unit stack size number sprites +stack_size_offset_x = 32 +stack_size_offset_y = 25 + ; offset the cities by this amount city_offset_x = 17 city_offset_y = 21 diff --git a/data/trident.tilespec b/data/trident.tilespec index 132f93af42..ba6f6b736a 100644 --- a/data/trident.tilespec +++ b/data/trident.tilespec @@ -58,6 +58,10 @@ activity_offset_y = 0 select_offset_x = 0 select_offset_y = 0 +; offset of the unit stack size number sprites +stack_size_offset_x = 20 +stack_size_offset_y = 10 + ; offset the cities by this amount city_offset_x = 0 city_offset_y = 0 -- 2.33.0