diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-25 11:20:27 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-25 11:20:27 +1000 |
commit | 97c650b1162b808278ee8207d3dd7a65e0b5ae80 (patch) | |
tree | 6a033d7ee32069c96deb64ee6df9f884876c124f /crawl-ref/source/rltiles | |
parent | 123e41762d8db75f5b28d51a032a4ba6bc3a928c (diff) | |
parent | 701f0d3bae53d22d476eeec3d85ee02a26623a66 (diff) | |
download | crawl-ref-97c650b1162b808278ee8207d3dd7a65e0b5ae80.tar.gz crawl-ref-97c650b1162b808278ee8207d3dd7a65e0b5ae80.zip |
Merge branch 'master' into wizlab
Diffstat (limited to 'crawl-ref/source/rltiles')
70 files changed, 1371 insertions, 140 deletions
diff --git a/crawl-ref/source/rltiles/UNUSED/other/dngn_altar_base.png b/crawl-ref/source/rltiles/UNUSED/other/dngn_altar_base.png Binary files differnew file mode 100644 index 0000000000..322d674f71 --- /dev/null +++ b/crawl-ref/source/rltiles/UNUSED/other/dngn_altar_base.png diff --git a/crawl-ref/source/rltiles/UNUSED/other/pedestal.png b/crawl-ref/source/rltiles/UNUSED/other/pedestal.png Binary files differnew file mode 100644 index 0000000000..07e57b7480 --- /dev/null +++ b/crawl-ref/source/rltiles/UNUSED/other/pedestal.png diff --git a/crawl-ref/source/rltiles/dc-dngn.txt b/crawl-ref/source/rltiles/dc-dngn.txt index 0f49bf72cc..053c487f86 100644 --- a/crawl-ref/source/rltiles/dc-dngn.txt +++ b/crawl-ref/source/rltiles/dc-dngn.txt @@ -8,7 +8,8 @@ dngn_unseen DNGN_UNSEEN # Multiple tile definitions are STATIC, that is they may change between # saves but are otherwise fixed. -wall/brick_brown0 WALL_NORMAL + +wall/brick_brown0 WALL_NORMAL WALL_BRICK WALL_BRICK_BROWN wall/brick_brown1 wall/brick_brown2 wall/brick_brown3 @@ -16,15 +17,246 @@ wall/brick_brown4 wall/brick_brown5 wall/brick_brown6 wall/brick_brown7 -floor/pebble_gray0 FLOOR_NORMAL -floor/pebble_gray1 -floor/pebble_gray2 -floor/pebble_gray3 -floor/pebble_gray4 -floor/pebble_gray5 -floor/pebble_gray6 -floor/pebble_gray7 -floor/pebble_gray8 + +%variation WALL_BRICK blue +%hue 30 240 +%hue 0 240 +%repeat WALL_BRICK WALL_BRICK_BLUE +%resetcol + +%variation WALL_BRICK green +%hue 30 90 +%hue 0 90 +%repeat WALL_BRICK WALL_BRICK_GREEN WALL_SNAKE +%resetcol + +%variation WALL_BRICK cyan +%hue 30 180 +%hue 0 180 +%repeat WALL_BRICK WALL_BRICK_CYAN +%resetcol + +%variation WALL_BRICK red +%hue 30 0 +%repeat WALL_BRICK WALL_BRICK_RED +%resetcol + +%variation WALL_BRICK magenta +%hue 30 300 +%hue 0 300 +%repeat WALL_BRICK WALL_BRICK_MAGENTA +%resetcol + +%variation WALL_BRICK lightgray +%desat 30 +%desat 0 +%lum 0 10 +%repeat WALL_BRICK WALL_BRICK_LIGHTGRAY +%resetcol + +%variation WALL_BRICK darkgray +%desat 30 +%lum 30 -20 +%desat 0 +%repeat WALL_BRICK WALL_BRICK_DARKGRAY +%resetcol + +%variation WALL_BRICK lightblue +%hue 30 240 +%lum 30 15 +%hue 0 240 +%repeat WALL_BRICK WALL_BRICK_LIGHTBLUE +%resetcol + +%variation WALL_BRICK lightgreen +%hue 30 90 +%lum 30 15 +%hue 0 90 +%lum 0 5 +%repeat WALL_BRICK WALL_BRICK_LIGHTGREEN +%resetcol + +%variation WALL_BRICK lightcyan +%hue 30 180 +%lum 30 15 +%hue 0 180 +%lum 0 5 +%repeat WALL_BRICK WALL_BRICK_LIGHTCYAN +%resetcol + +%variation WALL_BRICK lightred +%hue 30 0 +%lum 30 15 +%lum 0 5 +%repeat WALL_BRICK WALL_BRICK_LIGHTRED +%resetcol + +%variation WALL_BRICK lightmagenta +%hue 30 300 +%lum 30 15 +%hue 0 300 +%lum 0 5 +%repeat WALL_BRICK WALL_BRICK_LIGHTMAGENTA +%resetcol + +%variation WALL_BRICK yellow +%hue 30 60 +%hue 0 60 +%repeat WALL_BRICK WALL_BRICK_YELLOW +%resetcol + +%variation WALL_BRICK white +%desat 30 +%lum 30 30 +%desat 0 +%lum 0 15 +%repeat WALL_BRICK WALL_BRICK_WHITE +%resetcol + +# The colorized versions of FLOOR_PEBBLE were made from +# pebble_gray*.png, by colorizing the non-border color +# with hue 30, sat 50, lum +20 in GIMP. +%desat 28 +%desat 29 +%desat 30 +floor/pebble_brown0 FLOOR_PEBBLE FLOOR_PEBBLE_LIGHTGRAY FLOOR_NORMAL +floor/pebble_brown1 +floor/pebble_brown2 +floor/pebble_brown3 +floor/pebble_brown4 +floor/pebble_brown5 +floor/pebble_brown6 +floor/pebble_brown7 +floor/pebble_brown8 +%resetcol + +%variation FLOOR_PEBBLE brown +%hue 28 30 +%hue 29 30 +# Can't just use %repeat here, as we want the coloured versions. +floor/pebble_brown0 FLOOR_PEBBLE_BROWN +floor/pebble_brown1 +floor/pebble_brown2 +floor/pebble_brown3 +floor/pebble_brown4 +floor/pebble_brown5 +floor/pebble_brown6 +floor/pebble_brown7 +floor/pebble_brown8 +%resetcol + +%variation FLOOR_PEBBLE blue +%hue 28 240 +%hue 29 240 +%hue 30 240 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_BLUE +%resetcol + +%variation FLOOR_PEBBLE green +%hue 28 90 +%hue 29 90 +%hue 30 90 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_GREEN +%resetcol + +%variation FLOOR_PEBBLE cyan +%hue 28 180 +%hue 29 180 +%hue 30 180 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_CYAN +%resetcol + +%variation FLOOR_PEBBLE red +%hue 28 0 +%hue 29 0 +%hue 30 0 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_RED +%resetcol + +%variation FLOOR_PEBBLE magenta +%hue 28 300 +%hue 29 300 +%hue 30 300 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_MAGENTA +%resetcol + +%variation FLOOR_PEBBLE darkgray +%desat 28 +%desat 29 +%desat 30 +%lum 28 -7 +%lum 29 -7 +%lum 30 -7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_DARKGRAY +%resetcol + +%variation FLOOR_PEBBLE lightblue +%hue 28 240 +%hue 29 240 +%hue 30 240 +%lum 28 7 +%lum 29 7 +%lum 30 7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_LIGHTBLUE +%resetcol + +%variation FLOOR_PEBBLE lightgreen +%hue 28 90 +%hue 29 90 +%hue 30 90 +%lum 28 7 +%lum 29 7 +%lum 30 7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_LIGHTGREEN +%resetcol + +%variation FLOOR_PEBBLE lightcyan +%hue 28 180 +%hue 29 180 +%hue 30 180 +%lum 28 7 +%lum 29 7 +%lum 30 7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_LIGHTCYAN +%resetcol + +%variation FLOOR_PEBBLE lightred +%hue 28 0 +%hue 29 0 +%hue 30 0 +%lum 28 7 +%lum 29 7 +%lum 30 7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_LIGHTRED +%resetcol + +%variation FLOOR_PEBBLE lightmagenta +%hue 28 300 +%hue 29 300 +%hue 30 300 +%lum 28 7 +%lum 29 7 +%lum 30 7 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_LIGHTMAGENTA +%resetcol + +%variation FLOOR_PEBBLE yellow +%hue 28 60 +%hue 29 60 +%hue 30 60 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_YELLOW +%resetcol + +%variation FLOOR_PEBBLE white +%desat 28 +%desat 29 +%desat 30 +%lum 0 20 +%lum 28 40 +%lum 29 40 +%lum 30 40 +%repeat FLOOR_PEBBLE_BROWN FLOOR_PEBBLE_WHITE +%resetcol wall/relief0 WALL_HALL wall/relief1 @@ -39,21 +271,18 @@ wall/hive0 WALL_HIVE wall/hive1 wall/hive2 wall/hive3 -floor/hive0 FLOOR_HIVE + +floor/hive0 FLOOR_HIVE FLOOR_ORC floor/hive1 floor/hive2 floor/hive3 -wall/ice0 WALL_ICE -wall/ice1 -wall/ice2 -wall/ice3 floor/ice0 FLOOR_ICE floor/ice1 floor/ice2 floor/ice3 -wall/lair0 WALL_LAIR +wall/lair0 WALL_LAIR WALL_ORC WALL_SWAMP wall/lair1 wall/lair2 wall/lair3 @@ -62,16 +291,6 @@ floor/lair1 floor/lair2 floor/lair3 -## orcs don't have their own floor or walls yet... -wall/lair0 WALL_ORC -wall/lair1 -wall/lair2 -wall/lair3 -floor/hive0 FLOOR_ORC -floor/hive1 -floor/hive2 -floor/hive3 - wall/slime0 WALL_SLIME wall/slime1 wall/slime2 @@ -81,20 +300,12 @@ floor/bog_green1 floor/bog_green2 floor/bog_green3 -wall/snake0 WALL_SNAKE -wall/snake1 -wall/snake2 -wall/snake3 floor/snake0 FLOOR_SNAKE floor/snake1 floor/snake2 floor/snake3 ## swamp also doesn't have any unique walls... -wall/lair0 WALL_SWAMP -wall/lair1 -wall/lair2 -wall/lair3 floor/swamp0 FLOOR_SWAMP floor/swamp1 floor/swamp2 @@ -118,40 +329,87 @@ floor/rect_gray1 floor/rect_gray2 floor/rect_gray3 -wall/zot_blue0 WALL_ZOT_BLUE +wall/zot_blue0 WALL_ZOT WALL_ZOT_BLUE wall/zot_blue1 wall/zot_blue2 wall/zot_blue3 -wall/zot_cyan0 WALL_ZOT_CYAN -wall/zot_cyan1 -wall/zot_cyan2 -wall/zot_cyan3 +%variation WALL_ZOT green +%hue 240 120 +%repeat WALL_ZOT WALL_ZOT_GREEN +%resetcol + +%variation WALL_ZOT cyan +%hue 240 180 +%repeat WALL_ZOT WALL_ZOT_CYAN WALL_ICE +%resetcol + +%variation WALL_ZOT red +%hue 240 0 +%repeat WALL_ZOT WALL_ZOT_RED +%resetcol + +%variation WALL_ZOT magenta +%hue 240 300 +%repeat WALL_ZOT WALL_ZOT_MAGENTA +%resetcol + +%variation WALL_ZOT brown +%hue 240 30 +%repeat WALL_ZOT WALL_ZOT_BROWN +%resetcol + +%variation WALL_ZOT lightgray +%desat 240 +%lum 240 -15 +%repeat WALL_ZOT WALL_ZOT_LIGHTGRAY +%resetcol + +%variation WALL_ZOT darkgray +%desat 240 +%lum 240 -30 +%repeat WALL_ZOT WALL_ZOT_DARKGRAY +%resetcol -wall/zot_gray0 WALL_ZOT_GRAY -wall/zot_gray1 -wall/zot_gray2 -wall/zot_gray3 +%variation WALL_ZOT lightblue +%lum 240 40 +%repeat WALL_ZOT WALL_ZOT_LIGHTBLUE +%resetcol -wall/zot_green0 WALL_ZOT_GREEN -wall/zot_green1 -wall/zot_green2 -wall/zot_green3 +%variation WALL_ZOT lightgreen +%hue 240 120 +%lum 240 15 +%repeat WALL_ZOT WALL_ZOT_LIGHTGREEN +%resetcol -wall/zot_magenta0 WALL_ZOT_MAGENTA -wall/zot_magenta1 -wall/zot_magenta2 -wall/zot_magenta3 +%variation WALL_ZOT lightcyan +%hue 240 180 +%lum 240 15 +%repeat WALL_ZOT WALL_ZOT_LIGHTCYAN +%resetcol -wall/zot_red0 WALL_ZOT_RED -wall/zot_red1 -wall/zot_red2 -wall/zot_red3 +%variation WALL_ZOT lightred +%hue 240 0 +%lum 240 40 +%repeat WALL_ZOT WALL_ZOT_LIGHTRED +%resetcol -wall/zot_yellow0 WALL_ZOT_YELLOW -wall/zot_yellow1 -wall/zot_yellow2 -wall/zot_yellow3 +%variation WALL_ZOT lightmagenta +%hue 240 300 +%lum 240 40 +%repeat WALL_ZOT WALL_ZOT_LIGHTMAGENTA +%resetcol + +%variation WALL_ZOT yellow +%hue 240 60 +%repeat WALL_ZOT WALL_ZOT_YELLOW +%resetcol + +%variation WALL_ZOT white +%desat 240 +%lum 240 10 +%repeat WALL_ZOT WALL_ZOT_WHITE +%resetcol wall/wall_flesh0 WALL_FLESH wall/wall_flesh1 @@ -178,16 +436,169 @@ floor/floor_vines4 floor/floor_vines5 floor/floor_vines6 -wall/pebble_red0 WALL_PEBBLE_RED +wall/pebble_red0 WALL_PEBBLE WALL_PEBBLE_RED wall/pebble_red1 wall/pebble_red2 wall/pebble_red3 -floor/rough_red0 FLOOR_ROUGH_RED +%variation WALL_PEBBLE blue +%hue 0 240 +%repeat WALL_PEBBLE WALL_PEBBLE_BLUE +%resetcol + +%variation WALL_PEBBLE green +%hue 0 90 +%repeat WALL_PEBBLE WALL_PEBBLE_GREEN +%resetcol + +%variation WALL_PEBBLE cyan +%hue 0 180 +%repeat WALL_PEBBLE WALL_PEBBLE_CYAN +%resetcol + +%variation WALL_PEBBLE magenta +%hue 0 300 +%repeat WALL_PEBBLE WALL_PEBBLE_MAGENTA +%resetcol + +%variation WALL_PEBBLE brown +%hue 0 30 +%repeat WALL_PEBBLE WALL_PEBBLE_BROWN +%resetcol + +%variation WALL_PEBBLE lightgray +%desat 0 +%lum 0 -10 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTGRAY +%resetcol + +%variation WALL_PEBBLE darkgray +%desat 0 +%lum 0 -30 +%repeat WALL_PEBBLE WALL_PEBBLE_DARKGRAY +%resetcol + +%variation WALL_PEBBLE lightblue +%hue 0 240 +%lum 0 15 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTBLUE +%resetcol + +%variation WALL_PEBBLE lightgreen +%hue 0 90 +%lum 0 15 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTGREEN +%resetcol + +%variation WALL_PEBBLE lightcyan +%hue 0 180 +%lum 0 15 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTCYAN +%resetcol + +%variation WALL_PEBBLE lightred +%lum 0 15 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTRED +%resetcol + +%variation WALL_PEBBLE lightmagenta +%hue 0 300 +%lum 0 15 +%repeat WALL_PEBBLE WALL_PEBBLE_LIGHTMAGENTA +%resetcol + +%variation WALL_PEBBLE yellow +%hue 0 60 +%repeat WALL_PEBBLE WALL_PEBBLE_YELLOW +%resetcol + +%variation WALL_PEBBLE white +%desat 0 +%lum 0 20 +%repeat WALL_PEBBLE WALL_PEBBLE_WHITE +%resetcol + +floor/rough_red0 FLOOR_ROUGH FLOOR_ROUGH_RED floor/rough_red1 floor/rough_red2 floor/rough_red3 +%variation FLOOR_ROUGH blue +%hue 0 240 +%repeat FLOOR_ROUGH FLOOR_ROUGH_BLUE +%resetcol + +%variation FLOOR_ROUGH green +%hue 0 90 +%repeat FLOOR_ROUGH FLOOR_ROUGH_GREEN +%resetcol + +%variation FLOOR_ROUGH cyan +%hue 0 180 +%repeat FLOOR_ROUGH FLOOR_ROUGH_CYAN +%resetcol + +%variation FLOOR_ROUGH magenta +%hue 0 300 +%repeat FLOOR_ROUGH FLOOR_ROUGH_MAGENTA +%resetcol + +%variation FLOOR_ROUGH brown +%hue 0 30 +%repeat FLOOR_ROUGH FLOOR_ROUGH_BROWN +%resetcol + +%variation FLOOR_ROUGH lightgray +%desat 0 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTGRAY +%resetcol + +%variation FLOOR_ROUGH darkgray +%desat 0 +%lum 0 -10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_DARKGRAY +%resetcol + +%variation FLOOR_ROUGH lightblue +%hue 0 240 +%lum 0 10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTBLUE +%resetcol + +%variation FLOOR_ROUGH lightgreen +%hue 0 90 +%lum 0 10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTGREEN +%resetcol + +%variation FLOOR_ROUGH lightcyan +%hue 0 180 +%lum 0 10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTCYAN +%resetcol + +%variation FLOOR_ROUGH lightred +%lum 0 10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTRED +%resetcol + +%variation FLOOR_ROUGH lightmagenta +%hue 0 300 +%lum 0 10 +%repeat FLOOR_ROUGH FLOOR_ROUGH_LIGHTMAGENTA +%resetcol + +%variation FLOOR_ROUGH yellow +%hue 0 60 +%repeat FLOOR_ROUGH FLOOR_ROUGH_YELLOW +%resetcol + +%variation FLOOR_ROUGH white +%desat 0 +%lum 0 20 +%repeat FLOOR_ROUGH FLOOR_ROUGH_WHITE +%resetcol + floor/floor_sand_stone0 FLOOR_SAND_STONE floor/floor_sand_stone1 floor/floor_sand_stone2 @@ -321,15 +732,149 @@ floor/dirt_w floor/dirt_nw floor/dirt_full -wall/stone2_gray0 DNGN_STONE_WALL +wall/stone2_gray0 DNGN_STONE_WALL DNGN_STONE_WALL_LIGHTGRAY wall/stone2_gray1 wall/stone2_gray2 wall/stone2_gray3 -wall/dngn_metal_wall DNGN_METAL_WALL -wall/dngn_green_crystal_wall DNGN_GREEN_CRYSTAL_WALL +%variation DNGN_STONE_WALL blue +%hue 26 240 +%hue 27 240 +%hue 28 240 +%hue 29 240 +%hue 30 240 +%hue 31 240 +%hue 32 240 +%hue 33 240 +wall/stone2_brown0 DNGN_STONE_WALL_BLUE +wall/stone2_brown1 +wall/stone2_brown2 +wall/stone2_brown3 +%resetcol + +%variation DNGN_STONE_WALL green +%hue 240 120 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_GREEN +%resetcol + +%variation DNGN_STONE_WALL cyan +%hue 240 180 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_CYAN +%resetcol + +%variation DNGN_STONE_WALL red +%hue 240 0 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_RED +%resetcol + +%variation DNGN_STONE_WALL magenta +%hue 240 300 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_MAGENTA +%resetcol + +%variation DNGN_STONE_WALL brown +%hue 240 30 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_BROWN +%resetcol + +%variation DNGN_STONE_WALL darkgray +%lum 0 -20 +%repeat DNGN_STONE_WALL DNGN_STONE_WALL_DARKGRAY +%resetcol + +%variation DNGN_STONE_WALL yellow +%hue 240 60 +%repeat DNGN_STONE_WALL_BLUE DNGN_STONE_WALL_YELLOW +%resetcol + +%variation DNGN_STONE_WALL white +%lum 0 30 +%repeat DNGN_STONE_WALL DNGN_STONE_WALL_WHITE +%resetcol + wall/dngn_wax_wall DNGN_WAX_WALL wall/dngn_transparent_wall DNGN_TRANSPARENT_WALL +wall/dngn_metal_wall DNGN_METAL_WALL + +%hue 150 120 +wall/dngn_green_crystal_wall DNGN_GREEN_CRYSTAL_WALL DNGN_CRYSTAL DNGN_CRYSTAL_GREEN +%resetcol + +%variation DNGN_CRYSTAL blue +%hue 120 240 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_BLUE +%resetcol + +%variation DNGN_CRYSTAL cyan +%hue 120 180 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_CYAN +%resetcol + +%variation DNGN_CRYSTAL red +%hue 120 0 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_RED +%resetcol + +%variation DNGN_CRYSTAL magenta +%hue 120 300 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_MAGENTA +%resetcol + +%variation DNGN_CRYSTAL brown +%hue 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_BROWN +%resetcol + +%variation DNGN_CRYSTAL lightgray +%desat 120 +%lum 120 -20 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTGRAY +%resetcol + +%variation DNGN_CRYSTAL darkgray +%desat 120 +%lum 120 -40 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_DARKGRAY +%resetcol + +%variation DNGN_CRYSTAL lightblue +%hue 120 240 +%lum 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTBLUE +%resetcol + +%variation DNGN_CRYSTAL lightgreen +%lum 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTGREEN +%resetcol + +%variation DNGN_CRYSTAL lightcyan +%hue 120 180 +%lum 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTCYAN +%resetcol + +%variation DNGN_CRYSTAL lightred +%hue 120 0 +%lum 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTRED +%resetcol + +%variation DNGN_CRYSTAL lightmagenta +%hue 120 300 +%lum 120 30 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_LIGHTMAGENTA +%resetcol + +%variation DNGN_CRYSTAL yellow +%hue 120 60 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_YELLOW +%resetcol + +%variation DNGN_CRYSTAL white +%desat 120 +%repeat DNGN_CRYSTAL DNGN_CRYSTAL_WHITE +%resetcol ## doors dngn_detected_secret_door DNGN_DETECTED_SECRET_DOOR @@ -409,9 +954,11 @@ dngn_open_sea DNGN_OPEN_SEA dngn_open_sea dngn_open_sea dngn_open_sea2 + dngn_deep_water DNGN_DEEP_WATER dngn_deep_water dngn_deep_water2 + dngn_shallow_water DNGN_SHALLOW_WATER dngn_shallow_water dngn_shallow_water @@ -495,8 +1042,9 @@ dngn_altar_fedhas DNGN_ALTAR_FEDHAS dngn_altar_cheibriados DNGN_ALTAR_CHEIBRIADOS %sdir dc-dngn -dngn_blue_fountain DNGN_BLUE_FOUNTAIN +dngn_blue_fountain DNGN_FOUNTAIN DNGN_BLUE_FOUNTAIN dngn_blue_fountain2 + dngn_sparkling_fountain DNGN_SPARKLING_FOUNTAIN dngn_sparkling_fountain2 dngn_blood_fountain DNGN_BLOOD_FOUNTAIN diff --git a/crawl-ref/source/rltiles/dc-dngn/dngn_trap_shaft.png b/crawl-ref/source/rltiles/dc-dngn/dngn_trap_shaft.png Binary files differindex 32129807fb..a931331eed 100644 --- a/crawl-ref/source/rltiles/dc-dngn/dngn_trap_shaft.png +++ b/crawl-ref/source/rltiles/dc-dngn/dngn_trap_shaft.png diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown0.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown0.png Binary files differnew file mode 100644 index 0000000000..5dc062e52b --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown0.png diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown1.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown1.png Binary files differnew file mode 100644 index 0000000000..1ce8b1266c --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown1.png diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown2.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown2.png Binary files differnew file mode 100644 index 0000000000..ed419e9c05 --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown2.png diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown3.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown3.png Binary files differnew file mode 100644 index 0000000000..2ce7e3b88a --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown3.png diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown4.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown4.png Binary files differnew file mode 100644 index 0000000000..68445fb04c --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown4.png diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown5.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown5.png Binary files differnew file mode 100644 index 0000000000..6fb2823fd8 --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown5.png diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown6.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown6.png Binary files differnew file mode 100644 index 0000000000..4fc9439df5 --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown6.png diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown7.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown7.png Binary files differnew file mode 100644 index 0000000000..c16754ea86 --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown7.png diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown8.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown8.png Binary files differnew file mode 100644 index 0000000000..7309612217 --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_brown8.png diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray0.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray0.png Binary files differdeleted file mode 100644 index 8e1001ba8a..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray0.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray1.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray1.png Binary files differdeleted file mode 100644 index d30a2d3032..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray1.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray2.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray2.png Binary files differdeleted file mode 100644 index 4be0aa155d..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray2.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray3.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray3.png Binary files differdeleted file mode 100644 index feb030714b..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray3.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray4.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray4.png Binary files differdeleted file mode 100644 index 64f2dd7878..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray4.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray5.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray5.png Binary files differdeleted file mode 100644 index 024c193f48..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray5.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray6.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray6.png Binary files differdeleted file mode 100644 index 74a9ecfc4a..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray6.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray7.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray7.png Binary files differdeleted file mode 100644 index ba61403cf8..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray7.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray8.png b/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray8.png Binary files differdeleted file mode 100644 index 12967b7c9d..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/floor/pebble_gray8.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/ice0.png b/crawl-ref/source/rltiles/dc-dngn/wall/ice0.png Binary files differdeleted file mode 100644 index d5b8dbc269..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/ice0.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/ice1.png b/crawl-ref/source/rltiles/dc-dngn/wall/ice1.png Binary files differdeleted file mode 100644 index aa17851f29..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/ice1.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/ice2.png b/crawl-ref/source/rltiles/dc-dngn/wall/ice2.png Binary files differdeleted file mode 100644 index 5ed0cfd9af..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/ice2.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/ice3.png b/crawl-ref/source/rltiles/dc-dngn/wall/ice3.png Binary files differdeleted file mode 100644 index 60b4d072f5..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/ice3.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/snake0.png b/crawl-ref/source/rltiles/dc-dngn/wall/snake0.png Binary files differdeleted file mode 100644 index 867db7b4c1..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/snake0.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/snake1.png b/crawl-ref/source/rltiles/dc-dngn/wall/snake1.png Binary files differdeleted file mode 100644 index 485609f953..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/snake1.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/snake2.png b/crawl-ref/source/rltiles/dc-dngn/wall/snake2.png Binary files differdeleted file mode 100644 index 673912e445..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/snake2.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/snake3.png b/crawl-ref/source/rltiles/dc-dngn/wall/snake3.png Binary files differdeleted file mode 100644 index 46bd9d32d4..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/snake3.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown0.png b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown0.png Binary files differnew file mode 100644 index 0000000000..d4bdb5a45d --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown0.png diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown1.png b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown1.png Binary files differnew file mode 100644 index 0000000000..53e64d6cbd --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown1.png diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown2.png b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown2.png Binary files differnew file mode 100644 index 0000000000..67b967acdf --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown2.png diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown3.png b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown3.png Binary files differnew file mode 100644 index 0000000000..1ff9c971b3 --- /dev/null +++ b/crawl-ref/source/rltiles/dc-dngn/wall/stone2_brown3.png diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan0.png Binary files differdeleted file mode 100644 index d5b8dbc269..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan0.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan1.png Binary files differdeleted file mode 100644 index aa17851f29..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan1.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan2.png Binary files differdeleted file mode 100644 index 5ed0cfd9af..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan2.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan3.png Binary files differdeleted file mode 100644 index 60b4d072f5..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_cyan3.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray0.png Binary files differdeleted file mode 100644 index cc512906af..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray0.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray1.png Binary files differdeleted file mode 100644 index 2c1e681055..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray1.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray2.png Binary files differdeleted file mode 100644 index 1173861ea8..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray2.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray3.png Binary files differdeleted file mode 100644 index 541a48bb9b..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_gray3.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_green0.png Binary files differdeleted file mode 100644 index 2a7cb2fbe5..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green0.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_green1.png Binary files differdeleted file mode 100644 index 9e6da5180d..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green1.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_green2.png Binary files differdeleted file mode 100644 index f3005eece8..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green2.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_green3.png Binary files differdeleted file mode 100644 index f6c8823dcd..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_green3.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta0.png Binary files differdeleted file mode 100644 index 081bd32cd7..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta0.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta1.png Binary files differdeleted file mode 100644 index 32c59f0ec8..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta1.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta2.png Binary files differdeleted file mode 100644 index d3ad13c8b0..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta2.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta3.png Binary files differdeleted file mode 100644 index 9517f113a2..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_magenta3.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_red0.png Binary files differdeleted file mode 100644 index 6f31de45e3..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red0.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_red1.png Binary files differdeleted file mode 100644 index bc20553c60..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red1.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_red2.png Binary files differdeleted file mode 100644 index b0f709c961..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red2.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_red3.png Binary files differdeleted file mode 100644 index fed8b0cd3d..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_red3.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow0.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow0.png Binary files differdeleted file mode 100644 index 6994559ef6..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow0.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow1.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow1.png Binary files differdeleted file mode 100644 index aaa15e6709..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow1.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow2.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow2.png Binary files differdeleted file mode 100644 index e21cd799ff..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow2.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow3.png b/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow3.png Binary files differdeleted file mode 100644 index d1ab2feb2f..0000000000 --- a/crawl-ref/source/rltiles/dc-dngn/wall/zot_yellow3.png +++ /dev/null diff --git a/crawl-ref/source/rltiles/dc-mon.txt b/crawl-ref/source/rltiles/dc-mon.txt index 261076e9f2..df137c5f11 100644 --- a/crawl-ref/source/rltiles/dc-mon.txt +++ b/crawl-ref/source/rltiles/dc-mon.txt @@ -232,9 +232,14 @@ azrael MONS_AZRAEL efreet MONS_EFREET ## Rakshasa ('R') +%sdir dc-mon/unique +mara MONS_MARA +mara MONS_MARA_FAKE +%sdir dc-mon/demons rakshasa MONS_RAKSHASA rakshasa MONS_RAKSHASA_FAKE + ## Abominations ('X') abomination_large MONS_ABOMINATION_LARGE abomination_large1 diff --git a/crawl-ref/source/rltiles/dc-mon/unique/kirke.png b/crawl-ref/source/rltiles/dc-mon/unique/kirke.png Binary files differindex a10a319863..77769d5e06 100644 --- a/crawl-ref/source/rltiles/dc-mon/unique/kirke.png +++ b/crawl-ref/source/rltiles/dc-mon/unique/kirke.png diff --git a/crawl-ref/source/rltiles/dc-mon/unique/mara.png b/crawl-ref/source/rltiles/dc-mon/unique/mara.png Binary files differnew file mode 100644 index 0000000000..2cb82ea411 --- /dev/null +++ b/crawl-ref/source/rltiles/dc-mon/unique/mara.png diff --git a/crawl-ref/source/rltiles/tiledef_defines.h b/crawl-ref/source/rltiles/tiledef_defines.h index fb7e447988..238afd682b 100644 --- a/crawl-ref/source/rltiles/tiledef_defines.h +++ b/crawl-ref/source/rltiles/tiledef_defines.h @@ -2,6 +2,7 @@ #define TILEDEF_DEFINES_H #include <cassert> +#include <vector> class tile_info { @@ -47,4 +48,50 @@ typedef unsigned int (tile_count_func)(unsigned int); typedef const char *(tile_name_func)(unsigned int); typedef tile_info &(tile_info_func)(unsigned int); +typedef struct tile_variation +{ + tile_variation(int i, int c) : idx(i), col(c) { } + int idx; + int col; + + static int cmp(tile_variation left, tile_variation right) + { + if (left.idx < right.idx) + return (-1); + if (left.idx > right.idx) + return (1); + if (left.col < right.col) + return (-1); + if (left.col > right.col) + return (1); + return (0); + } +}; + +template<class F, class R> +bool binary_search(F find, std::pair<F, R> *arr, int num_pairs, + int (*cmpfnc)(F, F), R &result) +{ + int first = 0; + int last = num_pairs - 1; + + do + { + int half = (last - first) / 2 + first; + int cmp = cmpfnc(find, arr[half].first); + if (cmp < 0) + last = half - 1; + else if (cmp > 0) + first = half + 1; + else + { + result = arr[half].second; + return true; + } + + } while (first <= last); + + return false; +} + #endif diff --git a/crawl-ref/source/rltiles/tool/tile.cc b/crawl-ref/source/rltiles/tool/tile.cc index 2febfd73b2..65d82c9b18 100644 --- a/crawl-ref/source/rltiles/tool/tile.cc +++ b/crawl-ref/source/rltiles/tool/tile.cc @@ -17,9 +17,12 @@ tile::tile(const tile &img, const char *enumnam, const char *parts) : copy(img); if (enumnam) - m_enumname = enumnam; + m_enumname.push_back(enumnam); if (parts) m_parts_ctg = parts; + + for (int i = 0; i < MAX_COLOUR; ++i) + m_variations[i] = -1; } tile::~tile() @@ -39,27 +42,37 @@ bool tile::valid() const return m_pixels && m_width && m_height; } -const std::string &tile::filename() +const std::string &tile::filename() const { return m_filename; } -const std::string &tile::enumname() +int tile::enumcount() const +{ + return m_enumname.size(); +} + +const std::string &tile::enumname(int idx) const { - return m_enumname; + return m_enumname[idx]; } -const std::string &tile::parts_ctg() +void tile::add_enumname(const std::string &name) +{ + m_enumname.push_back(name); +} + +const std::string &tile::parts_ctg() const { return m_parts_ctg; } -int tile::width() +int tile::width() const { return m_width; } -int tile::height() +int tile::height() const { return m_height; } @@ -484,3 +497,19 @@ void tile::get_bounding_box(int &x0, int &y0, int &w, int &h) w = x1 - x0 + 1; h = y1 - y0 + 1; } + +void tile::add_variation(int colour, int idx) +{ + assert(colour >= 0); + assert(colour < MAX_COLOUR); + m_variations[colour] = idx; +} + +bool tile::get_variation(int colour, int &idx) +{ + if (m_variations[colour] == -1) + return (false); + + idx = m_variations[colour]; + return (true); +} diff --git a/crawl-ref/source/rltiles/tool/tile.h b/crawl-ref/source/rltiles/tool/tile.h index b14e14d100..7381763ead 100644 --- a/crawl-ref/source/rltiles/tool/tile.h +++ b/crawl-ref/source/rltiles/tool/tile.h @@ -3,6 +3,7 @@ #include "tile_colour.h" #include <string> +#include <vector> class tile { @@ -30,25 +31,32 @@ public: void replace_colour(tile_colour &find, tile_colour &replace); void fill(const tile_colour &col); - const std::string &filename(); - const std::string &enumname(); - const std::string &parts_ctg(); - int width(); - int height(); + const std::string &filename() const; + int enumcount() const; + const std::string &enumname(int idx) const; + void add_enumname(const std::string &name); + const std::string &parts_ctg() const; + int width() const; + int height() const; bool shrink(); void set_shrink(bool new_shrink); void get_bounding_box(int &x0, int &y0, int &w, int &h); tile_colour &get_pixel(unsigned int x, unsigned int y); + + void add_variation(int colour, int idx); + bool get_variation(int colour, int &idx); protected: int m_width; int m_height; std::string m_filename; - std::string m_enumname; + std::vector<std::string> m_enumname; std::string m_parts_ctg; tile_colour *m_pixels; bool m_shrink; + + int m_variations[MAX_COLOUR]; }; #endif diff --git a/crawl-ref/source/rltiles/tool/tile_colour.cc b/crawl-ref/source/rltiles/tool/tile_colour.cc index f1969f37be..2f098b387b 100644 --- a/crawl-ref/source/rltiles/tool/tile_colour.cc +++ b/crawl-ref/source/rltiles/tool/tile_colour.cc @@ -28,6 +28,226 @@ const tile_colour &tile_colour::operator=(const tile_colour &rhs) return (*this); } +unsigned char &tile_colour::operator[](int idx) +{ + assert(idx >= 0 && idx <= 4); + switch (idx) + { + default: + case 0: return r; + case 1: return g; + case 2: return b; + case 3: return a; + } +} + +unsigned char tile_colour::operator[](int idx) const +{ + assert(idx >= 0 && idx <= 4); + switch (idx) + { + default: + case 0: return r; + case 1: return g; + case 2: return b; + case 3: return a; + } +} + +int tile_colour::get_hue() const +{ + int max_rgb = get_max_rgb(); + int min_rgb = get_min_rgb(); + + if (max_rgb == min_rgb) + return (0); + + int diff = max_rgb - min_rgb; + + if (max_rgb == r) + { + return ((60 * (g - b)) / diff + 360) % 360; + } + else if (max_rgb == g) + { + return (60 * (b - r)) / diff + 120; + } + else // if (max_rgb == b) + { + return (60 * (r - g)) / diff + 240; + } +} + +int tile_colour::get_max_rgb() const +{ + int max_rgb = std::max(std::max(r, g), b); + return (max_rgb); +} + +int tile_colour::get_min_rgb() const +{ + int min_rgb = std::min(std::min(r, g), b); + return (min_rgb); +} + +void tile_colour::set_hue(int h) +{ + set_from_hue(h, get_min_rgb(), get_max_rgb()); +} + +void tile_colour::set_from_hue(int h, int min_rgb, int max_rgb) +{ + // http://en.wikipedia.org/wiki/HSL_and_HSV + // H is passed in + // S = diff / max or 0 if max == 0 + // V = max / 255 + + int v = max_rgb; + int s = max_rgb - min_rgb; + + float f = ((float)h / 60.0f) - (int)(h / 60); + + // When calculating P, Q, T, also convert to 0..255 range. + int p = v - s; + int q = v - f * s; + int t = v - (1.0f - f) * s; + + // Sanity bounds. + q = std::max(std::min(q, 255), 0); + t = std::max(std::min(t, 255), 0); + + int h_idx = (h / 60) % 6; + + switch (h_idx) + { + default: + case 0: + r = static_cast<unsigned char>(v); + g = static_cast<unsigned char>(t); + b = static_cast<unsigned char>(p); + break; + case 1: + r = static_cast<unsigned char>(q); + g = static_cast<unsigned char>(v); + b = static_cast<unsigned char>(p); + break; + case 2: + r = static_cast<unsigned char>(p); + g = static_cast<unsigned char>(v); + b = static_cast<unsigned char>(t); + break; + case 3: + r = static_cast<unsigned char>(p); + g = static_cast<unsigned char>(q); + b = static_cast<unsigned char>(v); + break; + case 4: + r = static_cast<unsigned char>(t); + g = static_cast<unsigned char>(p); + b = static_cast<unsigned char>(v); + break; + case 5: + r = static_cast<unsigned char>(v); + g = static_cast<unsigned char>(p); + b = static_cast<unsigned char>(q); + break; + } +} + +void tile_colour::desaturate() +{ + set_from_hue(get_hue(), get_max_rgb(), get_max_rgb()); +} + +float tile_colour::get_lum() const +{ + return ((get_min_rgb() + get_max_rgb()) / (255 * 2.0f)); +} + +float tile_colour::get_sat() const +{ + int min_rgb = get_min_rgb(); + int max_rgb = get_max_rgb(); + int sum = min_rgb + max_rgb; + + float sat; + if (sum == 0) + sat = 0; + else if (sum > 255) + sat = (max_rgb - min_rgb) / (float)(255*2 - min_rgb - max_rgb); + else + sat = (max_rgb - min_rgb) / (float)(min_rgb + max_rgb); + + return (sat); +} + +void tile_colour::set_from_hsl(int hue, float sat, float lum) +{ + float q; + if (lum < 0.5f) + q = lum * (1 + sat); + else + q = lum + sat - (lum * sat); + + float p = 2 * lum - q; + + for (int i = 0; i < 3; ++i) + { + int h = hue + (1 - i) * 120; + if (h < 0) + h += 360; + if (h >= 360) + h -= 360; + + float val; + + if (h < 60) + val = p + (q - p) * h / 60.0f; + else if (h < 180) + val = q; + else if (h < 240) + val = p + (q - p) * (4 - h / 60.0f); + else + val = p; + + int final = val * 255; + final = std::max(0, std::min(255, final)); + (*this)[i] = static_cast<unsigned char>(final); + } +} + +void tile_colour::change_lum(int lum_percent) +{ + int min_rgb = get_min_rgb(); + int max_rgb = get_max_rgb(); + int hue = get_hue(); + + if (min_rgb == max_rgb) + { + int rgb_change = (lum_percent * 255) / 100; + + min_rgb += rgb_change; + max_rgb += rgb_change; + + min_rgb = std::max(0, std::min(255, min_rgb)); + max_rgb = std::max(0, std::min(255, max_rgb)); + + set_from_hue(get_hue(), min_rgb, max_rgb); + return; + } + + float lum_change = lum_percent / 100.0f; + float lum = get_lum() + lum_change; + + if (lum > 1.0f) + lum = 1.0f; + if (lum < 0.0f) + lum = 0.0f; + + float sat = get_sat(); + set_from_hsl(hue, sat, lum); +} + bool write_png(const char *filename, tile_colour *pixels, unsigned int width, unsigned int height) { diff --git a/crawl-ref/source/rltiles/tool/tile_colour.h b/crawl-ref/source/rltiles/tool/tile_colour.h index 4c77162b9f..f660c84829 100644 --- a/crawl-ref/source/rltiles/tool/tile_colour.h +++ b/crawl-ref/source/rltiles/tool/tile_colour.h @@ -1,6 +1,30 @@ #ifndef TILE_COLOUR_H #define TILE_COLOUR_H +enum COLORS +{ + BLACK, + BLUE, + GREEN, + CYAN, + RED, + MAGENTA, + BROWN, + LIGHTGRAY, + LIGHTGREY = LIGHTGRAY, + DARKGRAY, + DARKGREY = DARKGRAY, + LIGHTBLUE, + LIGHTGREEN, + LIGHTCYAN, + LIGHTRED, + LIGHTMAGENTA, + YELLOW, + WHITE, + MAX_TERM_COLOUR, + MAX_COLOUR = MAX_TERM_COLOUR +}; + class tile_colour { public: @@ -12,6 +36,31 @@ public: bool operator!=(const tile_colour &rhs) const; const tile_colour &operator=(const tile_colour &rhs); + unsigned char &operator[](int idx); + unsigned char operator[](int idx) const; + + // Get the HSV/HSL hue, from 0..360. + int get_hue() const; + // Set the hue, from 0..360. + void set_hue(int h); + // Change the saturation to 0. + void desaturate(); + // Change the luminance by lum_percent %. + void change_lum(int lum_percent); + + int get_max_rgb() const; + int get_min_rgb() const; + + // Set the color from HSV. hue is 0..360. min_rgb and max_rgb are 0..255. + void set_from_hue(int hue, int min_rgb, int max_rgb); + + // Set the color from HSL. hue is 0..360. sat and lum are 0..1. + void set_from_hsl(int hue, float sat, float lum); + // Get the HSL saturation, from 0..1. + float get_sat() const; + // Get the HSL luminance, from 0..1. + float get_lum() const; + unsigned char r; unsigned char g; unsigned char b; diff --git a/crawl-ref/source/rltiles/tool/tile_list_processor.cc b/crawl-ref/source/rltiles/tool/tile_list_processor.cc index 091d195fca..dfd8385296 100644 --- a/crawl-ref/source/rltiles/tool/tile_list_processor.cc +++ b/crawl-ref/source/rltiles/tool/tile_list_processor.cc @@ -17,7 +17,9 @@ tile_list_processor::tile_list_processor() : m_composing(false), m_shrink(true), m_prefix("TILE"), - m_start_value("0") + m_start_value("0"), + m_variation_idx(-1), + m_variation_col(-1) { } @@ -150,6 +152,73 @@ static void eat_comments(char *&text) } } +static const std::string colour_list[16] = +{ + "black", "blue", "green", "cyan", "red", "magenta", "brown", + "lightgrey", "darkgrey", "lightblue", "lightgreen", "lightcyan", + "lightred", "lightmagenta", "yellow", "white" +}; + +static int str_to_colour(std::string colour) +{ + if (colour.empty()) + return (0); + + for (unsigned int c = 0; c < colour.size(); c++) + colour[c] = std::tolower(colour[c]); + + for (int i = 0; i < 16; ++i) + { + if (colour == colour_list[i]) + return (i); + } + + // Check for alternate spellings. + if (colour == "lightgray") + return (7); + else if (colour == "darkgray") + return (8); + + return (0); +} + +void tile_list_processor::recolour(tile &img) +{ + for (int y = 0; y < img.height(); ++y) + for (int x = 0; x < img.width(); ++x) + { + tile_colour &col = img.get_pixel(x, y); + tile_colour orig = col; + for (palette_list::iterator iter = m_palette.begin(); + iter != m_palette.end(); ++iter) + { + if (orig == iter->first) + col = iter->second; + } + + for (hue_list::iterator iter = m_hues.begin(); + iter != m_hues.end(); ++iter) + { + if (orig.get_hue() == iter->first) + col.set_hue(iter->second); + } + + for (desat_list::iterator iter = m_desat.begin(); + iter != m_desat.end(); ++iter) + { + if (orig.get_hue() == *iter) + col.desaturate(); + } + + for (lum_list::iterator iter = m_lum.begin(); + iter != m_lum.end(); ++iter) + { + if (orig.get_hue() == iter->first) + col.change_lum(iter->second); + } + } +} + bool tile_list_processor::process_line(char *read_line, const char *list_file, int line) { @@ -254,6 +323,8 @@ bool tile_list_processor::process_line(char *read_line, const char *list_file, if (m_rim) img.add_rim(tile_colour::black); + recolour(img); + if (!m_compose.compose(img)) { fprintf(stderr, "Error (%s:%d): failed composing '%s'" @@ -270,6 +341,8 @@ bool tile_list_processor::process_line(char *read_line, const char *list_file, "'%s'.\n", list_file, line, m_args[1]); return (false); } + + recolour(m_compose); } } else if (strcmp(arg, "corpse") == 0) @@ -409,6 +482,133 @@ bool tile_list_processor::process_line(char *read_line, const char *list_file, if (m_args.size() > 2) m_include = m_args[2]; } + else if (strcmp(arg, "pal") == 0) + { + // rgb (optional a) = rgb (optional a) + tile_colour cols[2] = { tile_colour::black, tile_colour::black }; + int col_idx = 0; + int comp_idx = 0; + + for (size_t i = 1; i < m_args.size(); ++i) + { + if (strcmp(m_args[i], "=")) + { + if (comp_idx > 3) + { + fprintf(stderr, "Error (%s:%d): " + "Must be R G B (A) = R G B (A).\n", + list_file, line); + return (false); + } + + int val = atoi(m_args[i]); + if (val < 0 || val > 255) + { + fprintf(stderr, + "Error (%s:%d): Arg %d must be 0-255.\n", + list_file, line, i); + } + + cols[col_idx][comp_idx++] = static_cast<unsigned char>(val); + } + else if (col_idx > 0) + { + fprintf(stderr, + "Error (%s:%d): Too many '=' characters.\n", + list_file, line); + return (false); + } + else + { + col_idx++; + comp_idx = 0; + } + } + + m_palette.push_back(palette_entry(cols[0], cols[1])); + } + else if (strcmp(arg, "hue") == 0) + { + CHECK_ARG(2); + m_hues.push_back(int_pair(atoi(m_args[1]), atoi(m_args[2]))); + } + else if (strcmp(arg, "resetcol") == 0) + { + CHECK_NO_ARG(1); + m_palette.clear(); + m_hues.clear(); + m_desat.clear(); + m_lum.clear(); + } + else if (strcmp(arg, "desat") == 0) + { + CHECK_ARG(1); + CHECK_NO_ARG(2); + + m_desat.push_back(atoi(m_args[1])); + } + else if (strcmp(arg, "lum") == 0) + { + CHECK_ARG(2); + CHECK_NO_ARG(3); + + m_lum.push_back(int_pair(atoi(m_args[1]), atoi(m_args[2]))); + } + else if (strcmp(arg, "variation") == 0) + { + CHECK_ARG(2); + CHECK_NO_ARG(3); + + int idx = m_page.find(m_args[1]); + if (idx == -1) + { + fprintf(stderr, "Error (%s:%d): invalid tile name '%s'\n", + list_file, line, m_args[1]); + return (false); + } + + int colour = str_to_colour(m_args[2]); + if (colour == 0) + { + fprintf(stderr, "Error (%s:%d): invalid colour '%s'\n", + list_file, line, m_args[2]); + return (false); + } + + m_variation_idx = idx; + m_variation_col = colour; + } + else if (strcmp(arg, "repeat") == 0) + { + CHECK_ARG(1); + + int idx = m_page.find(m_args[1]); + if (idx == -1) + { + fprintf(stderr, "Error (%s:%d): invalid tile name '%s'\n", + list_file, line, m_args[1]); + return (false); + } + + int cnt = m_page.m_counts[idx]; + + for (int i = 0; i < cnt; ++i) + { + tile img; + img.copy(*m_page.m_tiles[idx + i]); + recolour(img); + add_image(img, (i == 0 && m_args[2]) ? m_args[2] : NULL); + } + + if (m_args.size() > 2) + { + for (int i = 3; i < m_args.size(); ++i) + { + // Add enums for additional values. + m_page.add_synonym(m_args[2], m_args[i]); + } + } + } else { fprintf(stderr, "Error (%s:%d): unknown command '%%%s'\n", @@ -464,11 +664,19 @@ bool tile_list_processor::process_line(char *read_line, const char *list_file, img.corpsify(); } + recolour(img); + if (m_rim && !m_corpsify) img.add_rim(tile_colour::black); // Push tile onto tile page. add_image(img, m_args.size() > 1 ? m_args[1] : NULL); + + for (int i = 2; i < m_args.size(); ++i) + { + // Add enums for additional values. + m_page.add_synonym(m_args[1], m_args[i]); + } } return (true); @@ -489,6 +697,12 @@ void tile_list_processor::add_image(tile &img, const char *enumname) if (m_categories.size() > 0) m_ctg_counts[m_categories.size()-1]++; + + if (m_variation_idx != -1) + { + m_page.add_variation(m_last_enum, m_variation_idx, m_variation_col); + m_variation_idx = -1; + } } bool tile_list_processor::write_data() @@ -560,24 +774,47 @@ bool tile_list_processor::write_data() for (unsigned int i = 0; i < m_page.m_tiles.size(); i++) { - const std::string &enumname = m_page.m_tiles[i]->enumname(); const std::string &parts_ctg = m_page.m_tiles[i]->parts_ctg(); - if (enumname.empty()) + int enumcount = m_page.m_tiles[i]->enumcount(); + + std::string full_enum; + if (enumcount == 0) { fprintf(fp, " %s_%s_FILLER_%d%s,\n", m_prefix.c_str(), ucname.c_str(), i, start_val.c_str()); } else if (parts_ctg.empty()) { + const std::string &enumname = m_page.m_tiles[i]->enumname(0); fprintf(fp, " %s_%s%s,\n", m_prefix.c_str(), enumname.c_str(), start_val.c_str()); } else { + const std::string &enumname = m_page.m_tiles[i]->enumname(0); fprintf(fp, " %s_%s_%s%s,\n", m_prefix.c_str(), parts_ctg.c_str(), enumname.c_str(), start_val.c_str()); } + for (int c = 1; c < enumcount; ++c) + { + const std::string &basename = m_page.m_tiles[i]->enumname(0); + const std::string &enumname = m_page.m_tiles[i]->enumname(c); + + if (parts_ctg.empty()) + { + fprintf(fp, " %s_%s = %s_%s,\n", + m_prefix.c_str(), enumname.c_str(), + m_prefix.c_str(), basename.c_str()); + } + else + { + fprintf(fp, " %s_%s_%s = %s_%s_%s,\n", + m_prefix.c_str(), parts_ctg.c_str(), enumname.c_str(), + m_prefix.c_str(), parts_ctg.c_str(), basename.c_str()); + } + } + start_val = ""; if (!parts_ctg.empty()) @@ -597,13 +834,15 @@ bool tile_list_processor::write_data() fprintf(fp, "int tile_%s_count(unsigned int idx);\n", lcname.c_str()); fprintf(fp, "const char *tile_%s_name(unsigned int idx);\n", - lcname.c_str()); + lcname.c_str()); fprintf(fp, "tile_info &tile_%s_info(unsigned int idx);\n", - lcname.c_str()); + lcname.c_str()); fprintf(fp, "bool tile_%s_index(const char *str, unsigned int &idx);\n", - lcname.c_str()); + lcname.c_str()); fprintf(fp, "bool tile_%s_equal(unsigned int tile, unsigned int idx);\n", - lcname.c_str()); + lcname.c_str()); + fprintf(fp, "unsigned int tile_%s_coloured(unsigned int idx, int col);\n", + lcname.c_str()); if (m_categories.size() > 0) { @@ -663,11 +902,15 @@ bool tile_list_processor::write_data() lcname.c_str(), max.c_str(), m_start_value.c_str()); for (unsigned int i = 0; i < m_page.m_tiles.size(); i++) { - const std::string &enumname = m_page.m_tiles[i]->enumname(); - if (enumname.empty()) + if (m_page.m_tiles[i]->enumcount() == 0) + { fprintf(fp, " \"%s_FILLER_%d\",\n", ucname.c_str(), i); + } else + { + const std::string &enumname = m_page.m_tiles[i]->enumname(0); fprintf(fp, " \"%s\",\n", enumname.c_str()); + } } fprintf(fp, "};\n\n"); @@ -718,9 +961,9 @@ bool tile_list_processor::write_data() fprintf(fp, "};\n\n"); } - fprintf(fp, "\ntypedef std::pair<const char*, int> _tile_pair;\n\n"); + fprintf(fp, "\ntypedef std::pair<const char*, unsigned int> _name_pair;\n\n"); - fprintf(fp, "_tile_pair %s_map_pairs[] =\n" + fprintf(fp, "_name_pair %s_name_pairs[] =\n" "{\n", lcname.c_str()); typedef std::map<std::string, int> sort_map; @@ -728,22 +971,22 @@ bool tile_list_processor::write_data() for (unsigned int i = 0; i < m_page.m_tiles.size(); i++) { - const std::string &enumname = m_page.m_tiles[i]->enumname(); - // Filler can't be looked up. - if (enumname.empty()) - continue; + for (int c = 0; c < m_page.m_tiles[i]->enumcount(); ++c) + { + const std::string &enumname = m_page.m_tiles[i]->enumname(c); - std::string lcenum = enumname; - for (unsigned int c = 0; c < enumname.size(); c++) - lcenum[c] = std::tolower(enumname[c]); + std::string lcenum = enumname; + for (unsigned int c = 0; c < enumname.size(); c++) + lcenum[c] = std::tolower(enumname[c]); - table.insert(sort_map::value_type(lcenum, i)); + table.insert(sort_map::value_type(lcenum, i)); + } } sort_map::iterator itor; for (itor = table.begin(); itor != table.end(); itor++) { - fprintf(fp, " _tile_pair(\"%s\", %d + %s),\n", + fprintf(fp, " _name_pair(\"%s\", %d + %s),\n", itor->first.c_str(), itor->second, m_start_value.c_str()); } @@ -760,29 +1003,12 @@ bool tile_list_processor::write_data() " for (unsigned int i = 0; i < lc.size(); i++)\n" " lc[i] = tolower(lc[i]);\n" "\n" - " int num_pairs = sizeof(%s_map_pairs) / sizeof(%s_map_pairs[0]);\n" - "\n" - " int first = 0;\n" - " int last = num_pairs - 1;\n" - "\n" - " do\n" - " {\n" - " int half = (last - first) / 2 + first;\n" - " int cmp = strcmp(str, %s_map_pairs[half].first);\n" - " if (cmp < 0)\n" - " last = half - 1;\n" - " else if (cmp > 0)\n" - " first = half + 1;\n" - " else\n" - " {\n" - " idx = %s_map_pairs[half].second;\n" - " return true;\n" - " }\n" "\n" - " } while (first <= last);\n" - "\n" - " return false;\n" - "}\n", - lcname.c_str(), lcname.c_str(), lcname.c_str(), lcname.c_str(), lcname.c_str()); + " int num_pairs = sizeof(%s_name_pairs) / sizeof(%s_name_pairs[0]);\n" + " bool result = binary_search<const char *, unsigned int>(\n" + " lc.c_str(), &%s_name_pairs[0], num_pairs, &strcmp, idx);\n" + " return (result);\n" + "}\n\n", + lcname.c_str(), lcname.c_str(), lcname.c_str(), lcname.c_str()); fprintf(fp, "bool tile_%s_equal(unsigned int tile, unsigned int idx)\n" @@ -792,6 +1018,43 @@ bool tile_list_processor::write_data() "}\n\n", lcname.c_str(), m_start_value.c_str(), max.c_str(), lcname.c_str()); + fprintf(fp, "\ntypedef std::pair<tile_variation, unsigned int> _colour_pair;\n\n"); + + fprintf(fp, + "_colour_pair %s_colour_pairs[] =\n" + "{\n" + " _colour_pair(tile_variation(0, 0), 0),\n", + lcname.c_str()); + + for (unsigned int i = 0; i < m_page.m_tiles.size(); i++) + { + for (int c = 0; c < MAX_COLOUR; ++c) + { + int var; + if (!m_page.m_tiles[i]->get_variation(c, var)) + continue; + + fprintf(fp, + " _colour_pair(tile_variation(%d + %s, %d), %d + %s),\n", + i, m_start_value.c_str(), c, var, m_start_value.c_str()); + } + } + + fprintf(fp, "%s", "};\n\n"); + + fprintf(fp, + "unsigned int tile_%s_coloured(unsigned int idx, int col)\n" + "{\n" + " int num_pairs = sizeof(%s_colour_pairs) / sizeof(%s_colour_pairs[0]);\n" + " tile_variation key(idx, col);\n" + " unsigned int found;\n" + " bool result = binary_search<tile_variation, unsigned int>(\n" + " key, &%s_colour_pairs[0], num_pairs,\n" + " &tile_variation::cmp, found);\n" + " return (result ? found : idx);\n" + "}\n\n", + lcname.c_str(), lcname.c_str(), lcname.c_str(), lcname.c_str()); + fclose(fp); } @@ -818,29 +1081,32 @@ bool tile_list_processor::write_data() fprintf(fp, "<td><img src=\"%s\"/></td>", m_page.m_tiles[i]->filename().c_str()); - std::string lcenum = m_page.m_tiles[i]->enumname(); - for (unsigned int c = 0; c < lcenum.size(); c++) - lcenum[c] = std::tolower(lcenum[c]); - - fprintf(fp, "<td>%s</td>", lcenum.c_str()); - - const std::string &parts_ctg = m_page.m_tiles[i]->parts_ctg(); - if (m_page.m_tiles[i]->enumname().empty()) + if (m_page.m_tiles[i]->enumcount() == 0) { - fprintf(fp, "<td></td>"); - } - else if (parts_ctg.empty()) - { - fprintf(fp, "<td>%s_%s</td>", - m_prefix.c_str(), - m_page.m_tiles[i]->enumname().c_str()); + fprintf(fp, "<td></td><td></td>"); } else { - fprintf(fp, "<td>%s_%s_%s</td>", - m_prefix.c_str(), - parts_ctg.c_str(), - m_page.m_tiles[i]->enumname().c_str()); + std::string lcenum = m_page.m_tiles[i]->enumname(0); + for (unsigned int c = 0; c < lcenum.size(); c++) + lcenum[c] = std::tolower(lcenum[c]); + + fprintf(fp, "<td>%s</td>", lcenum.c_str()); + + const std::string &parts_ctg = m_page.m_tiles[i]->parts_ctg(); + if (parts_ctg.empty()) + { + fprintf(fp, "<td>%s_%s</td>", + m_prefix.c_str(), + m_page.m_tiles[i]->enumname(0).c_str()); + } + else + { + fprintf(fp, "<td>%s_%s_%s</td>", + m_prefix.c_str(), + parts_ctg.c_str(), + m_page.m_tiles[i]->enumname(0).c_str()); + } } fprintf(fp, "<td>%s</td>", m_page.m_tiles[i]->filename().c_str()); diff --git a/crawl-ref/source/rltiles/tool/tile_list_processor.h b/crawl-ref/source/rltiles/tool/tile_list_processor.h index 74b199b5ef..5e95d1815b 100644 --- a/crawl-ref/source/rltiles/tool/tile_list_processor.h +++ b/crawl-ref/source/rltiles/tool/tile_list_processor.h @@ -18,6 +18,7 @@ protected: bool load_image(tile &img, const char *filename); bool process_line(char *read_line, const char *list_file, int line); void add_image(tile &img, const char *enumname); + void recolour(tile &img); std::string m_name; @@ -38,6 +39,22 @@ protected: std::vector<std::string> m_categories; std::vector<int> m_ctg_counts; tile m_compose; + int m_variation_idx; + int m_variation_col; + + typedef std::pair<tile_colour, tile_colour> palette_entry; + typedef std::vector<palette_entry> palette_list; + palette_list m_palette; + + typedef std::pair<int, int> int_pair; + typedef std::vector<int_pair> hue_list; + hue_list m_hues; + + typedef std::vector<int> desat_list; + desat_list m_desat; + + typedef std::vector<int_pair> lum_list; + lum_list m_lum; }; #endif diff --git a/crawl-ref/source/rltiles/tool/tile_page.cc b/crawl-ref/source/rltiles/tool/tile_page.cc index 67c77db3ea..3c90dcfce8 100644 --- a/crawl-ref/source/rltiles/tool/tile_page.cc +++ b/crawl-ref/source/rltiles/tool/tile_page.cc @@ -2,6 +2,7 @@ #include "tile_colour.h" #include <stdio.h> #include <string.h> +#include <cassert> #include "tile.h" tile_page::tile_page() : m_width(1024), m_height(0) @@ -88,6 +89,31 @@ bool tile_page::place_images() return (true); } +int tile_page::find(const std::string &enumname) const +{ + for (size_t i = 0; i < m_tiles.size(); ++i) + { + for (int c = 0; c < m_tiles[i]->enumcount(); ++c) + { + if (m_tiles[i]->enumname(c) == enumname) + return (i); + } + } + + return (-1); +} + +bool tile_page::add_synonym(const std::string &enumname, const std::string &syn) +{ + int idx = find(enumname); + if (idx == -1) + return (false); + + m_tiles[idx]->add_enumname(syn); + + return (true); +} + bool tile_page::write_image(const char *filename) { if (m_width * m_height <= 0) @@ -123,3 +149,12 @@ bool tile_page::write_image(const char *filename) delete[] pixels; return success; } + +void tile_page::add_variation(int var_idx, int base_idx, int colour) +{ + assert(var_idx < (2 << 15)); + assert(base_idx < (2 << 15)); + + m_tiles[base_idx]->add_variation(colour, var_idx); +} + diff --git a/crawl-ref/source/rltiles/tool/tile_page.h b/crawl-ref/source/rltiles/tool/tile_page.h index 9f13651a1d..c63ae43a5a 100644 --- a/crawl-ref/source/rltiles/tool/tile_page.h +++ b/crawl-ref/source/rltiles/tool/tile_page.h @@ -2,6 +2,8 @@ #define TILE_PAGE_H #include <vector> +#include <string> + class tile; class tile_page @@ -13,10 +15,15 @@ public: bool place_images(); bool write_image(const char *filename); + int find(const std::string &enumname) const; + bool add_synonym(const std::string &enumname, const std::string &syn); + void add_variation(int var_idx, int base_idx, int colour); + std::vector<tile*> m_tiles; std::vector<unsigned int> m_counts; std::vector<int> m_texcoords; std::vector<int> m_offsets; + protected: int m_width; int m_height; |