From: <enn...@us...> - 2008-09-12 03:55:42
|
Revision: 6910 http://crawl-ref.svn.sourceforge.net/crawl-ref/?rev=6910&view=rev Author: ennewalker Date: 2008-09-12 03:55:34 +0000 (Fri, 12 Sep 2008) Log Message: ----------- Incorporating new tiles from Denzi/Mitsuhiro. Rings and amulets now have labels when identified. Centaurs/yaktaurs now display the weapon they're wielding (and look better too). Variations of weapons and armor (i.e. normal, shiny, randart) are now determined automatically from the tile definitions, rather than being hardcoded. Also, improved axe tiles. Modified Paths: -------------- trunk/crawl-ref/source/rltiles/dc-item.txt trunk/crawl-ref/source/rltiles/dc-mon/centaur_warrior.png trunk/crawl-ref/source/rltiles/dc-mon/yaktaur_captain.png trunk/crawl-ref/source/rltiles/dc-mon.txt trunk/crawl-ref/source/rltiles/item/rod/i-rod_destruction_lightning.png trunk/crawl-ref/source/rltiles/item/scroll/i-summoning.png trunk/crawl-ref/source/rltiles/item/staff/i-staff_channeling.png trunk/crawl-ref/source/rltiles/item/staff/i-staff_earth.png trunk/crawl-ref/source/rltiles/item/staff/i-staff_power.png trunk/crawl-ref/source/rltiles/item/wand/i-fire.png trunk/crawl-ref/source/rltiles/item/wand/i-flame.png trunk/crawl-ref/source/rltiles/item/weapon/battle_axe.png trunk/crawl-ref/source/rltiles/item/weapon/battle_axe2.png trunk/crawl-ref/source/rltiles/item/weapon/broad_axe2.png trunk/crawl-ref/source/rltiles/item/weapon/executioner_axe.png trunk/crawl-ref/source/rltiles/item/weapon/executioner_axe2.png trunk/crawl-ref/source/rltiles/item/weapon/falchion.png trunk/crawl-ref/source/rltiles/item/weapon/hand_axe.png trunk/crawl-ref/source/rltiles/item/weapon/war_axe.png trunk/crawl-ref/source/rltiles/tool/tile_colour.cc trunk/crawl-ref/source/rltiles/tool/tile_colour.h trunk/crawl-ref/source/rltiles/tool/tile_page.cc trunk/crawl-ref/source/tilemcache.cc trunk/crawl-ref/source/tilemcache.h trunk/crawl-ref/source/tilepick.cc trunk/crawl-ref/source/tilereg.cc Added Paths: ----------- trunk/crawl-ref/source/rltiles/dc-mon/centaur-melee.png trunk/crawl-ref/source/rltiles/dc-mon/centaur_warrior-melee.png trunk/crawl-ref/source/rltiles/dc-mon/yaktaur-melee.png trunk/crawl-ref/source/rltiles/dc-mon/yaktaur_captain-melee.png trunk/crawl-ref/source/rltiles/item/amulet/i-c-flight.png trunk/crawl-ref/source/rltiles/item/amulet/i-clarity.png trunk/crawl-ref/source/rltiles/item/amulet/i-conservation.png trunk/crawl-ref/source/rltiles/item/amulet/i-gourmand.png trunk/crawl-ref/source/rltiles/item/amulet/i-inaccuracy.png trunk/crawl-ref/source/rltiles/item/amulet/i-r-corrosion.png trunk/crawl-ref/source/rltiles/item/amulet/i-r-mutation.png trunk/crawl-ref/source/rltiles/item/amulet/i-r-slow.png trunk/crawl-ref/source/rltiles/item/amulet/i-rage.png trunk/crawl-ref/source/rltiles/item/amulet/i-warding.png trunk/crawl-ref/source/rltiles/item/ring/i-c-teleport.png trunk/crawl-ref/source/rltiles/item/ring/i-dex.png trunk/crawl-ref/source/rltiles/item/ring/i-evasion.png trunk/crawl-ref/source/rltiles/item/ring/i-fire.png trunk/crawl-ref/source/rltiles/item/ring/i-hunger.png trunk/crawl-ref/source/rltiles/item/ring/i-ice.png trunk/crawl-ref/source/rltiles/item/ring/i-int.png trunk/crawl-ref/source/rltiles/item/ring/i-invisibility.png trunk/crawl-ref/source/rltiles/item/ring/i-levitation.png trunk/crawl-ref/source/rltiles/item/ring/i-life-protection.png trunk/crawl-ref/source/rltiles/item/ring/i-magical-power.png trunk/crawl-ref/source/rltiles/item/ring/i-protection.png trunk/crawl-ref/source/rltiles/item/ring/i-r-cold.png trunk/crawl-ref/source/rltiles/item/ring/i-r-fire.png trunk/crawl-ref/source/rltiles/item/ring/i-r-lightning.png trunk/crawl-ref/source/rltiles/item/ring/i-r-magic.png trunk/crawl-ref/source/rltiles/item/ring/i-r-poison.png trunk/crawl-ref/source/rltiles/item/ring/i-regeneration.png trunk/crawl-ref/source/rltiles/item/ring/i-s-abil.png trunk/crawl-ref/source/rltiles/item/ring/i-see-invis.png trunk/crawl-ref/source/rltiles/item/ring/i-slaying.png trunk/crawl-ref/source/rltiles/item/ring/i-str.png trunk/crawl-ref/source/rltiles/item/ring/i-sustenance.png trunk/crawl-ref/source/rltiles/item/ring/i-teleport.png trunk/crawl-ref/source/rltiles/item/ring/i-wizardry.png trunk/crawl-ref/source/rltiles/item/weapon/bardiche.png trunk/crawl-ref/source/rltiles/item/weapon/bardiche2.png trunk/crawl-ref/source/rltiles/item/weapon/broad_axe.png trunk/crawl-ref/source/rltiles/item/weapon/broad_axe3.png trunk/crawl-ref/source/rltiles/item/weapon/falchion2.png trunk/crawl-ref/source/rltiles/item/weapon/hand_axe2.png trunk/crawl-ref/source/rltiles/item/weapon/war_axe2.png trunk/crawl-ref/source/rltiles/tool/tile_convert.cc Modified: trunk/crawl-ref/source/rltiles/dc-item.txt =================================================================== --- trunk/crawl-ref/source/rltiles/dc-item.txt 2008-09-12 02:04:02 UTC (rev 6909) +++ trunk/crawl-ref/source/rltiles/dc-item.txt 2008-09-12 03:55:34 UTC (rev 6910) @@ -1,3 +1,18 @@ +# A note on variations. To create additional variations for weapons or armour, +# simply create 1-5 images, e.g.: +# +# weapon_normal WEP_SOME_WEAPON +# weapon_shiny +# weapon_runed +# weapon_glowing +# weapon_randart +# +# If only the first line has a define on it, then the following images will be +# considered as variations. If you don't have five, images will be reused for +# multiple types. Orcish/elven/dwarven equipment are considered separate items +# with respect to variations and will not share variations with the base +# equipment. See tilepick.cc for more details. + #####OBJ_WEAPONS #####ARTIFACTS %sdir item/weapon @@ -28,21 +43,21 @@ ##Blunt club WPN_CLUB/* D5H4S12 A heavy piece of wood. mace WPN_MACE/* D8H3S14 A long handle with a heavy lump on one end. -mace2 WPN_MACE2 +mace2 mace_large WPN_GREAT_MACE/* D16H-3S18 A large and heavy mace. -mace_large2 WPN_GREAT_MACE2 +mace_large2 flail WPN_FLAIL -flail2 WPN_FLAIL2 +flail2 spiked_flail WPN_SPIKED_FLAIL -spiked_flail2 WPN_SPIKED_FLAIL2 +spiked_flail2 great_flail WPN_GREAT_FLAIL -great_flail2 WPN_GREAT_FLAIL2 +great_flail2 morningstar WPN_MORNINGSTAR -morningstar2 WPN_MORNINGSTAR2 +morningstar2 eveningstar WPN_EVENINGSTAR -eveningstar2 WPN_EVENINGSTAR2 +eveningstar2 hammer WPN_HAMMER -hammer2 WPN_HAMMER2 +hammer2 ankus WPN_ANKUS/* D9H1S14 A large and vicious toothed club. bullwhip WPN_WHIP/* D3H1S14 A whip. demon_whip WPN_DEMON_WHIP/* D10H1S14 A terrible weapon, woven in the depths of the inferno. @@ -57,32 +72,32 @@ elven_dagger WPN_DAGGER_ELF short_sword WPN_SHORT_SWORD/* D6H5S12 A sword with a short, slashing blade. -short_sword2 WPN_SHORT_SWORD_1 +short_sword2 orcish_short_sword WPN_SHORT_SWORD_ORC elven_short_sword WPN_SHORT_SWORD_ELF long_sword2 WPN_LONG_SWORD/* D10H3S14 A sword with a long, slashing blade. %rim 0 -long_sword3 WPN_LONG_SWORD_1 +long_sword3 %rim 1 orcish_long_sword WPN_LONG_SWORD_ORC greatsword WPN_GREAT_SWORD/* D16H-1S17 A sword with a very long, heavy blade and a long handle. -greatsword2 WPN_GREAT_SWORD_1 +greatsword2 orcish_great_sword WPN_GREAT_SWORD_ORC falchion WPN_FALCHION/* D8H2S13 A sword with a broad slashing blade. +falchion2 scimitar WPN_SCIMITAR/* D11H1S14 A long sword with a curved blade. -scimitar2 WPN_SCIMITAR2 +scimitar2 silver_saber WPN_SABRE/* D7H4S12 A sword with a medium length slashing blade. -sabre2 WPN_SABRE_1 +sabre2 quickblade WPN_QUICK_BLADE/* D5H6S7 A small and magically quick sword. -#tsurugi WPN_KATANA katana2 WPN_KATANA/* D13H4S13 A very rare and extremely effective imported weapon, featuring a long single-edged blade. -katana3 WPN_KATANA_1 +katana3 double_sword WPN_DOUBLE_SWORD/* D15H3S16 A magical weapon with two razor-sharp blades. triple_sword WPN_TRIPLE_SWORD/* D19H-1S19 A magical weapon with three great razor-sharp blades. @@ -90,39 +105,45 @@ ##Axe hand_axe WPN_HAND_AXE/* D7H2S13 An small axe designed for either hand combat or throwing. +hand_axe2 war_axe WPN_WAR_AXE/* D11H0S16 An axe intended for hand to hand combat. -battle_axe2 WPN_BROAD_AXE/* D14H1S17 An axe with a large blade. +war_axe2 +broad_axe WPN_BROAD_AXE/* D14H1S17 An axe with a large blade. broad_axe2 +broad_axe3 battle_axe WPN_BATTLEAXE/* D17H-2S18 A large axe with a double-headed blade. -battle_axe3 WPN_BATTLEAXE_1 +battle_axe2 +battle_axe3 executioner_axe WPN_EXECUTIONERS_AXE /* D20H-4S20 A huge axe. -executioner_axe2 WPN_EXECUTIONERS_AXE_1 +executioner_axe2 ##Ranged blowgun WPN_BLOWGUN /* D1H0S10 A long, light tube, open at both ends. Doing very little damage, its main use is to fire poisoned needles from afar. It makes very little noise. -blowgun2 WPN_BLOWGUN1 +blowgun2 sling WPN_SLING /* D1H-1S11 A piece of cloth and leather for launching stones, which do a small amount of damage on impact. bow WPN_BOW /* D2H-3S11 A curved piece of wood and string, for shooting arrows. It does good damage in combat, and a skilled user can use it to great effect. -bow2 WPN_BOW1 +bow2 crossbow WPN_CROSSBOW /* D2H-1S15 A piece of machinery used for firing bolts, which takes some time to load and fire. It does very good damage in combat. -crossbow2 WPN_CROSSBOW1 +crossbow2 hand_crossbow WPN_HAND_CROSSBOW /* D1H-1S15 A small crossbow, for firing darts. -hand_crossbow2 WPN_HAND_CROSSBOW1 +hand_crossbow2 ##Pole quarterstaff WPN_QUARTERSTAFF /* D7H6S12 A sturdy wooden pole. elven_spear WPN_SPEAR /* D5H3S13 A long stick with a pointy blade on one end, to be held or thrown. -spear2 WPN_SPEAR2 +spear2 trident WPN_TRIDENT /* D9H-2S17 A hafted weapon with three points at one end. -trident2 WPN_TRIDENT2 +trident2 halberd WPN_HALBERD /* D13H-3S19 A long pole with a spiked axe head on one end. -halberd2 WPN_HALBERD2 +halberd2 scythe WPN_SCYTHE /* D14H-4S22 A farm implement, usually unsuited to combat. -scythe2 WPN_SCYTHE2 +scythe2 glaive WPN_GLAIVE /* D15H-3S18 A pole with a large, heavy blade on one end. -glaive2 WPN_GLAIVE2 +glaive2 orcish_glaive WPN_GLAIVE_ORC +bardiche WPN_BARDICHE +bardiche2 demon_trident WPN_DEMON_TRIDENT /* D15H-2S17 A terrible weapon, molded by fire and brimstone. @@ -132,7 +153,7 @@ %rim 1 longbow WPN_LONGBOW lajatang WPN_LAJATANG -lajatang2 WPN_LAJATANG2 +lajatang2 lochaber_axe WPN_LOCHABER_AXE ######OBJ_MISSILES @@ -208,27 +229,27 @@ ######OBJ_ARMOUR %sdir item/armor robe ARM_ROBE /* A1E0 A cloth robe. -robe2 ARM_ROBE_1 -robe3 ARM_ROBE_2 +robe2 +robe3 leather_armor2 ARM_LEATHER_ARMOUR /* A2E-1 A suit made of hardened leather. -breast_plate2 ARM_LEATHER_ARMOUR_1 -leather_armor4 ARM_LEATHER_ARMOUR_2 +breast_plate2 +leather_armor4 orcish_leather_armor ARM_LEATHER_ARMOUR_ORC elven_leather_armor ARM_LEATHER_ARMOUR_ELF ring_mail ARM_RING_MAIL /* A4E-2 A leather suit covered in little rings. -ring_mail2 ARM_RING_MAIL_1 +ring_mail2 orcish_ringmail ARM_RING_MAIL_ORC elven_ringmail ARM_RING_MAIL_ELF dwarven_ringmail ARM_RING_MAIL_DWA scale_mail ARM_SCALE_MAIL /* A5E-2 A leather suit covered in little metal plates. -scale_mail2 ARM_SCALE_MAIL_2 +scale_mail2 elven_scalemail ARM_SCALE_MAIL_ELF chain_mail1 ARM_CHAIN_MAIL /* A6E-3 A suit made of interlocking metal rings. -chain_mail2 ARM_CHAIN_MAIL_1 +chain_mail2 chain_mail3 ARM_CHAIN_MAIL_ELF orcish_chain_mail ARM_CHAIN_MAIL_ORC @@ -241,7 +262,7 @@ crystal_plate_mail ARM_CRYSTAL_PLATE_MAIL /* A16E-8 animal_skin ARM_ANIMAL_SKIN /* A1E0 The skins of several animals. -animal_skin2 ARM_ANIMAL_SKIN_1 +animal_skin2 troll_hide ARM_TROLL_HIDE /* A1E-1 The stiff and knobbly hide of a troll. I suppose you could wear it if you really wanted to. troll_leather_armour ARM_TROLL_LEATHER_ARMOUR /* A3E-1 A magical armour, made from the stiff and knobbly skin of a common troll. It magically regenerates its wearer's flesh at a fairly slow rate (unless already a troll). @@ -270,45 +291,45 @@ centaur_barding_red elven_shield ARM_SHIELD /* A0E0 A piece of metal, to be strapped on one's arm. It is cumbersome to wear, and slightly slows the rate at which you may attack. -shield_kite2 ARM_SHIELD_1 -shield_round2 ARM_SHIELD_2 +shield_kite2 +shield_round2 #dwarvish_roundshield ARM_BUCKLER %rim 0 small_shield ARM_BUCKLER /* A small shield. -small_shield2 ARM_BUCKLER_1 +small_shield2 %rim 1 large_shield ARM_LARGE_SHIELD /* Like a normal shield, only larger. It is very cumbersome to wear, and slows the rate at which you may attack. -shield_large2 ARM_LARGE_SHIELD_1 -shield_kite3 ARM_LARGE_SHIELD_2 +shield_large2 +shield_kite3 leather_cloak ARM_CLOAK /* A1E0 A cloth cloak. -cloak2 ARM_CLOAK_1 -cloak3 ARM_CLOAK_2 -cloak4 ARM_CLOAK_3 +cloak2 +cloak3 +cloak4 #####ARM_HELMET elven_leather_helm THELM_CAP /* A cloth or leather cap. wizard_hat THELM_WIZARD_HAT /* A conical cloth hat. -wizard_hat2 THELM_WIZARD_HAT_1 +wizard_hat2 visored_helmet THELM_HELM /* A1E0 A piece of metal headgear. -etched_helmet THELM_HELM_1 -helm3 THELM_HELM_2 -helm_visor1 THELM_HELM_3 +etched_helmet +helm3 +helm_visor1 ###### GLOVES glove1 ARM_GLOVES /* A1E0 A pair of gloves. -glove3 ARM_GLOVES_1 -glove5 ARM_GLOVES_2 -gauntlet2 ARM_GLOVES_3 +glove3 +glove5 +gauntlet2 ###### BOOTS boots_brown1 ARM_BOOTS /* A1E0 A pair of sturdy boots. -jackboots ARM_BOOTS_1 -boots_stripe1 ARM_BOOTS_2 -boots_green2 ARM_BOOTS_3 +jackboots +boots_stripe1 +boots_green2 ###########OBJ_WANDS %sdir item/wand @@ -444,6 +465,36 @@ bronze moonstone +#########ID-ed +%rim 0 +%shrink 0 +i-regeneration RING_REGENERATION +i-protection RING_PROTECTION +i-r-fire RING_PROTECTION_FROM_FIRE +i-r-poison RING_POISON_RESISTANCE +i-r-cold RING_PROTECTION_FROM_COLD +i-str RING_STRENGTH +i-slaying RING_SLAYING +i-see-invis RING_SEE_INVISIBLE +i-invisibility RING_INVISIBILITY +i-hunger RING_HUNGER +i-teleport RING_TELEPORTATION +i-evasion RING_EVASION +i-s-abil RING_SUSTAIN_ABILITIES +i-sustenance RING_SUSTENANCE +i-dex RING_DEXTERITY +i-int RING_INTELLIGENCE +i-wizardry RING_WIZARDRY +i-magical-power RING_MAGICAL_POWER +i-levitation RING_LEVITATION +i-life-protection RING_LIFE_PROTECTION +i-r-magic RING_PROTECTION_FROM_MAGIC +i-fire RING_FIRE +i-ice RING_ICE +i-c-teleport RING_TELEPORT_CONTROL +%rim 1 +%shrink 1 + ###amulets %sdir item/amulet crystal_white AMU_NORMAL_OFFSET /*zirconium*/ @@ -477,6 +528,22 @@ crystal_red eye_green +%rim 0 +%shrink 0 +### ID-ed amulet +i-rage AMU_RAGE +i-r-slow AMU_RESIST_SLOW +i-clarity AMU_CLARITY +i-warding AMU_WARDING +i-r-corrosion AMU_RESIST_CORROSION +i-gourmand AMU_THE_GOURMAND +i-conservation AMU_CONSERVATION +i-c-flight AMU_CONTROLLED_FLIGHT +i-inaccuracy AMU_INACCURACY +i-r-mutation AMU_RESIST_MUTATION +%rim 1 +%shrink 1 + ####################OBJ_POTIONS %sdir item/potion clear POTION_OFFSET /*clear*/ @@ -595,7 +662,9 @@ i-staff_summoning STAFF_SUMMONING i-staff_air STAFF_AIR i-staff_earth STAFF_EARTH +%rim 0 i-staff_channeling STAFF_CHANNELING +%rim 1 %shrink 1 %sdir item/rod Property changes on: trunk/crawl-ref/source/rltiles/dc-mon/centaur-melee.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/dc-mon/centaur_warrior-melee.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/dc-mon/yaktaur-melee.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/dc-mon/yaktaur_captain-melee.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/crawl-ref/source/rltiles/dc-mon.txt =================================================================== --- trunk/crawl-ref/source/rltiles/dc-mon.txt 2008-09-12 02:04:02 UTC (rev 6909) +++ trunk/crawl-ref/source/rltiles/dc-mon.txt 2008-09-12 03:55:34 UTC (rev 6910) @@ -308,9 +308,13 @@ giant_bat MONS_GIANT_BAT /*'b'*/ centaur MONS_CENTAUR /*'c'*/ +centaur-melee MONS_CENTAUR_MELEE centaur_warrior MONS_CENTAUR_WARRIOR /*'c'*/ +centaur_warrior-melee MONS_CENTAUR_WARRIOR_MELEE yaktaur MONS_YAKTAUR /*'c'*/ +yaktaur-melee MONS_YAKTAUR_MELEE yaktaur_captain MONS_YAKTAUR_CAPTAIN /*'c'*/ +yaktaur_captain-melee MONS_YAKTAUR_CAPTAIN_MELEE firedrake MONS_FIREDRAKE /*'d'*/ lindwurm MONS_LINDWURM /*'d'*/ Property changes on: trunk/crawl-ref/source/rltiles/item/amulet/i-c-flight.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/amulet/i-clarity.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/amulet/i-conservation.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/amulet/i-gourmand.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/amulet/i-inaccuracy.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/amulet/i-r-corrosion.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/amulet/i-r-mutation.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/amulet/i-r-slow.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/amulet/i-rage.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/amulet/i-warding.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-c-teleport.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-dex.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-evasion.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-fire.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-hunger.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-ice.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-int.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-invisibility.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-levitation.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-life-protection.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-magical-power.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-protection.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-r-cold.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-r-fire.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-r-lightning.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-r-magic.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-r-poison.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-regeneration.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-s-abil.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-see-invis.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-slaying.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-str.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-sustenance.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-teleport.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/ring/i-wizardry.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/weapon/bardiche.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/weapon/bardiche2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/weapon/falchion2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/weapon/hand_axe2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/crawl-ref/source/rltiles/item/weapon/war_axe2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/crawl-ref/source/rltiles/tool/tile_colour.cc =================================================================== --- trunk/crawl-ref/source/rltiles/tool/tile_colour.cc 2008-09-12 02:04:02 UTC (rev 6909) +++ trunk/crawl-ref/source/rltiles/tool/tile_colour.cc 2008-09-12 03:55:34 UTC (rev 6910) @@ -1,4 +1,7 @@ #include "tile_colour.h" +#include <vector> +#include <stdio.h> +#include <png.h> tile_colour tile_colour::background(71, 108, 108, 255); tile_colour tile_colour::transparent(0, 0, 0, 0); @@ -23,3 +26,55 @@ return *this; } + +bool write_png(const char *filename, tile_colour *pixels, + int width, int height) +{ + FILE *fp = fopen(filename, "wb"); + if (!fp) + { + fprintf(stderr, "Error: Can't open file '%s' for write.\n", filename); + return false; + } + + png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + if (!png_ptr) + return false; + + png_infop info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) + { + png_destroy_write_struct(&png_ptr, (png_infopp)NULL); + return false; + } + + png_init_io(png_ptr, fp); + + int bit_depth = 8; + int colour_type = PNG_COLOR_TYPE_RGB_ALPHA; + int interlace_type = PNG_INTERLACE_NONE; + int compression_type = PNG_COMPRESSION_TYPE_DEFAULT; + int filter_method = PNG_FILTER_TYPE_DEFAULT; + png_set_IHDR(png_ptr, info_ptr, width, height, + bit_depth, colour_type, interlace_type, + compression_type, filter_method); + + png_bytep* row_pointers = (png_bytep*)malloc(sizeof(png_bytep) * height); + for (unsigned int y = 0; y < height; y++) + row_pointers[y] = (png_byte*)&pixels[y * width]; + + png_set_rows(png_ptr, info_ptr, row_pointers); + + int png_transforms = PNG_TRANSFORM_IDENTITY; + png_write_png(png_ptr, info_ptr, png_transforms, NULL); + png_write_end(png_ptr, info_ptr); + png_destroy_write_struct(&png_ptr, &info_ptr); + + free(row_pointers); + fclose(fp); + + return true; +} + + Modified: trunk/crawl-ref/source/rltiles/tool/tile_colour.h =================================================================== --- trunk/crawl-ref/source/rltiles/tool/tile_colour.h 2008-09-12 02:04:02 UTC (rev 6909) +++ trunk/crawl-ref/source/rltiles/tool/tile_colour.h 2008-09-12 03:55:34 UTC (rev 6910) @@ -22,4 +22,7 @@ static tile_colour black; }; +bool write_png(const char *filename, tile_colour *pixels, + int width, int height); + #endif Added: trunk/crawl-ref/source/rltiles/tool/tile_convert.cc =================================================================== --- trunk/crawl-ref/source/rltiles/tool/tile_convert.cc (rev 0) +++ trunk/crawl-ref/source/rltiles/tool/tile_convert.cc 2008-09-12 03:55:34 UTC (rev 6910) @@ -0,0 +1,49 @@ +#include <stdio.h> +#include <string.h> + +// This is a standalone utility to convert old-style palettized BMPs +// to transparent PNGs. + +#include "tile.h" + +int main(int argc, char **argv) +{ + if (argc < 2) + { + printf("Usage: %s (filename.bmp)\n", argv[0]); + return -1; + } + + char dest[1024]; + strcpy(dest, argv[1]); + + size_t len = strlen(dest); + if (strcmp(&dest[len-4], ".bmp")) + { + printf("File '%s' does not end in bmp.\n", argv[1]); + return -2; + } + + dest[len-3] = 'p'; + dest[len-2] = 'n'; + dest[len-1] = 'g'; + + tile conv; + if (!conv.load(argv[1])) + { + printf("Failed to load '%s'.\n", argv[1]); + return -3; + } + + conv.replace_colour(tile_colour::background, tile_colour::transparent); + + if (!write_png(dest, &conv.get_pixel(0,0), conv.width(), conv.height())) + { + printf("Failed to write dest '%s'.\n", dest); + return -4; + } + + printf("Converted '%s'.\n", argv[1]); + + return 0; +} Modified: trunk/crawl-ref/source/rltiles/tool/tile_page.cc =================================================================== --- trunk/crawl-ref/source/rltiles/tool/tile_page.cc 2008-09-12 02:04:02 UTC (rev 6909) +++ trunk/crawl-ref/source/rltiles/tool/tile_page.cc 2008-09-12 03:55:34 UTC (rev 6910) @@ -1,58 +1,7 @@ #include "tile_page.h" #include "tile_colour.h" #include "tile.h" -#include <png.h> -static bool write_png(const char *filename, tile_colour *pixels, - int width, int height) -{ - FILE *fp = fopen(filename, "wb"); - if (!fp) - { - fprintf(stderr, "Error: Can't open file '%s' for write.\n", filename); - return false; - } - - png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, - NULL, NULL, NULL); - if (!png_ptr) - return false; - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) - { - png_destroy_write_struct(&png_ptr, (png_infopp)NULL); - return false; - } - - png_init_io(png_ptr, fp); - - int bit_depth = 8; - int colour_type = PNG_COLOR_TYPE_RGB_ALPHA; - int interlace_type = PNG_INTERLACE_NONE; - int compression_type = PNG_COMPRESSION_TYPE_DEFAULT; - int filter_method = PNG_FILTER_TYPE_DEFAULT; - png_set_IHDR(png_ptr, info_ptr, width, height, - bit_depth, colour_type, interlace_type, - compression_type, filter_method); - - png_bytep* row_pointers = (png_bytep*)malloc(sizeof(png_bytep) * height); - for (unsigned int y = 0; y < height; y++) - row_pointers[y] = (png_byte*)&pixels[y * width]; - - png_set_rows(png_ptr, info_ptr, row_pointers); - - int png_transforms = PNG_TRANSFORM_IDENTITY; - png_write_png(png_ptr, info_ptr, png_transforms, NULL); - png_write_end(png_ptr, info_ptr); - png_destroy_write_struct(&png_ptr, &info_ptr); - - free(row_pointers); - fclose(fp); - - return true; -} - tile_page::tile_page() : m_width(1024), m_height(0) { } Modified: trunk/crawl-ref/source/tilemcache.cc =================================================================== --- trunk/crawl-ref/source/tilemcache.cc 2008-09-12 02:04:02 UTC (rev 6909) +++ trunk/crawl-ref/source/tilemcache.cc 2008-09-12 03:55:34 UTC (rev 6910) @@ -363,6 +363,22 @@ ofs_x = 0; ofs_y = 0; break; + case TILEP_MONS_CENTAUR_MELEE: + ofs_x = -1; + ofs_y = -3; + break; + case TILEP_MONS_CENTAUR_WARRIOR_MELEE: + ofs_x = 0; + ofs_y = -1; + break; + case TILEP_MONS_YAKTAUR_MELEE: + ofs_x = 2; + ofs_y = 0; + break; + case TILEP_MONS_YAKTAUR_CAPTAIN_MELEE: + ofs_x = 4; + ofs_y = 0; + break; case TILEP_MONS_ORC: case TILEP_MONS_URUG: case TILEP_MONS_BLORK_THE_ORC: Modified: trunk/crawl-ref/source/tilemcache.h =================================================================== --- trunk/crawl-ref/source/tilemcache.h 2008-09-12 02:04:02 UTC (rev 6909) +++ trunk/crawl-ref/source/tilemcache.h 2008-09-12 03:55:34 UTC (rev 6910) @@ -26,7 +26,7 @@ tile_draw_info() : idx(~0), ofs_x(0), ofs_y(0) {} void set(unsigned int _idx, int _ofs_x = 0, int _ofs_y = 0) - { idx = _idx; _ofs_x = ofs_x; _ofs_y = ofs_y; } + { idx = _idx; ofs_x = _ofs_x; ofs_y = _ofs_y; } unsigned int idx; int ofs_x; Modified: trunk/crawl-ref/source/tilepick.cc =================================================================== --- trunk/crawl-ref/source/tilepick.cc 2008-09-12 02:04:02 UTC (rev 6909) +++ trunk/crawl-ref/source/tilepick.cc 2008-09-12 03:55:34 UTC (rev 6910) @@ -102,8 +102,28 @@ } } -static int _tileidx_monster_base(const monsters* mon, bool detected) +// Special case for *taurs which have a different tile +// for when they have a bow. +static int _bow_offset(const monsters *mon) { + int mon_wep = mon->inv[MSLOT_WEAPON]; + if (mon_wep == NON_ITEM) + return 1; + + switch (mitm[mon_wep].sub_type) + { + case WPN_BOW: + case WPN_LONGBOW: + case WPN_CROSSBOW: + case WPN_HAND_CROSSBOW: + return 0; + default: + return 1; + } +} + +static int _tileidx_monster_base(const monsters *mon, bool detected) +{ int grid = grd(mon->pos()); bool in_water = (grid == DNGN_SHALLOW_WATER || grid == DNGN_DEEP_WATER); @@ -120,7 +140,7 @@ case MONS_GIANT_BAT: return TILEP_MONS_GIANT_BAT; case MONS_CENTAUR: - return TILEP_MONS_CENTAUR; + return TILEP_MONS_CENTAUR + _bow_offset(mon); case MONS_RED_DEVIL: return TILEP_MONS_RED_DEVIL; case MONS_ETTIN: @@ -365,7 +385,7 @@ case MONS_STORM_DRAGON: return TILEP_MONS_STORM_DRAGON; case MONS_YAKTAUR: - return TILEP_MONS_YAKTAUR; + return TILEP_MONS_YAKTAUR + _bow_offset(mon); case MONS_DEATH_YAK: return TILEP_MONS_DEATH_YAK; case MONS_ROCK_TROLL: @@ -722,9 +742,9 @@ case MONS_MUMMY_PRIEST: return TILEP_MONS_MUMMY_PRIEST; case MONS_CENTAUR_WARRIOR: - return TILEP_MONS_CENTAUR_WARRIOR; + return TILEP_MONS_CENTAUR_WARRIOR + _bow_offset(mon); case MONS_YAKTAUR_CAPTAIN: - return TILEP_MONS_YAKTAUR_CAPTAIN; + return TILEP_MONS_YAKTAUR_CAPTAIN + _bow_offset(mon); case MONS_KILLER_KLOWN: return TILEP_MONS_KILLER_KLOWN; case MONS_ELECTRIC_GOLEM: @@ -968,25 +988,32 @@ } } -static int _tileidx_weapon(const item_def &item) +static int _apply_variations(const item_def &item, int tile) { - static const int etable[4][4] = { - {0, 0, 0, 0}, // No ego tile - {0, 1, 1, 1}, // One ego tile - {0, 1, 1, 2}, // Two ego tile - {0, 1, 2, 3} + static const int etable[5][5] = + { + {0, 0, 0, 0, 0}, + {0, 1, 1, 1, 1}, + {0, 1, 1, 1, 2}, + {0, 1, 1, 2, 3}, + {0, 1, 2, 3, 4} }; - int race = item.flags & ISFLAG_RACIAL_MASK; int etype = _get_etype(item); + int idx = tile_main_count(tile) - 1; + ASSERT(idx < 5); + tile += etable[idx][etype]; - if (etype > 1) - etype--; + return tile; +} +static int _tileidx_weapon_base(const item_def &item) +{ + int race = item.flags & ISFLAG_RACIAL_MASK; + switch (item.sub_type) { - case WPN_KNIFE: - return TILE_WPN_KNIFE; + case WPN_KNIFE: return TILE_WPN_KNIFE; case WPN_DAGGER: if (race == ISFLAG_ORCISH) @@ -1000,32 +1027,25 @@ return TILE_WPN_SHORT_SWORD_ORC; if (race == ISFLAG_ELVEN) return TILE_WPN_SHORT_SWORD_ELF; - return TILE_WPN_SHORT_SWORD + etable[1][etype]; + return TILE_WPN_SHORT_SWORD; - case WPN_QUICK_BLADE: - return TILE_WPN_QUICK_BLADE; + case WPN_QUICK_BLADE: return TILE_WPN_QUICK_BLADE; + case WPN_SABRE: return TILE_WPN_SABRE; + case WPN_FALCHION: return TILE_WPN_FALCHION; + case WPN_KATANA: return TILE_WPN_KATANA; - case WPN_SABRE: - return TILE_WPN_SABRE + etable[1][etype]; - - case WPN_FALCHION: - return TILE_WPN_FALCHION; - - case WPN_KATANA: - return TILE_WPN_KATANA + etable[1][etype]; - case WPN_LONG_SWORD: if (race == ISFLAG_ORCISH) return TILE_WPN_LONG_SWORD_ORC; - return TILE_WPN_LONG_SWORD + etable[1][etype]; + return TILE_WPN_LONG_SWORD; case WPN_GREAT_SWORD: if (race == ISFLAG_ORCISH) return TILE_WPN_GREAT_SWORD_ORC; - return TILE_WPN_GREAT_SWORD + etable[1][etype]; + return TILE_WPN_GREAT_SWORD; case WPN_SCIMITAR: - return TILE_WPN_SCIMITAR + etable[1][etype]; + return TILE_WPN_SCIMITAR; case WPN_DOUBLE_SWORD: return TILE_WPN_DOUBLE_SWORD; @@ -1040,45 +1060,45 @@ return TILE_WPN_WAR_AXE; case WPN_BROAD_AXE: - return TILE_WPN_BROAD_AXE + etable[1][etype]; + return TILE_WPN_BROAD_AXE; case WPN_BATTLEAXE: - return TILE_WPN_BATTLEAXE + etable[1][etype]; + return TILE_WPN_BATTLEAXE; case WPN_EXECUTIONERS_AXE: - return TILE_WPN_EXECUTIONERS_AXE + etable[1][etype]; + return TILE_WPN_EXECUTIONERS_AXE; case WPN_BLOWGUN: - return TILE_WPN_BLOWGUN + etable[1][etype]; + return TILE_WPN_BLOWGUN; case WPN_SLING: return TILE_WPN_SLING; case WPN_BOW: - return TILE_WPN_BOW + etable[1][etype]; + return TILE_WPN_BOW; case WPN_CROSSBOW: - return TILE_WPN_CROSSBOW + etable[1][etype]; + return TILE_WPN_CROSSBOW; case WPN_HAND_CROSSBOW: - return TILE_WPN_HAND_CROSSBOW + etable[1][etype]; + return TILE_WPN_HAND_CROSSBOW; case WPN_SPEAR: - return TILE_WPN_SPEAR + etable[1][etype]; + return TILE_WPN_SPEAR; case WPN_TRIDENT: - return TILE_WPN_TRIDENT + etable[1][etype]; + return TILE_WPN_TRIDENT; case WPN_HALBERD: - return TILE_WPN_HALBERD + etable[1][etype]; + return TILE_WPN_HALBERD; case WPN_SCYTHE: - return TILE_WPN_SCYTHE + etable[1][etype]; + return TILE_WPN_SCYTHE; case WPN_GLAIVE: if (race == ISFLAG_ORCISH) return TILE_WPN_GLAIVE_ORC; - return TILE_WPN_GLAIVE + etable[1][etype]; + return TILE_WPN_GLAIVE; case WPN_QUARTERSTAFF: return TILE_WPN_QUARTERSTAFF; @@ -1087,28 +1107,28 @@ return TILE_WPN_CLUB; case WPN_HAMMER: - return TILE_WPN_HAMMER + etable[1][etype]; + return TILE_WPN_HAMMER; case WPN_MACE: - return TILE_WPN_MACE + etable[1][etype]; + return TILE_WPN_MACE; case WPN_FLAIL: - return TILE_WPN_FLAIL + etable[1][etype]; + return TILE_WPN_FLAIL; case WPN_SPIKED_FLAIL: - return TILE_WPN_SPIKED_FLAIL + etable[1][etype]; + return TILE_WPN_SPIKED_FLAIL; case WPN_GREAT_MACE: - return TILE_WPN_GREAT_MACE + etable[1][etype]; + return TILE_WPN_GREAT_MACE; case WPN_DIRE_FLAIL: - return TILE_WPN_GREAT_FLAIL + etable[1][etype]; + return TILE_WPN_GREAT_FLAIL; case WPN_MORNINGSTAR: - return TILE_WPN_MORNINGSTAR + etable[1][etype]; + return TILE_WPN_MORNINGSTAR; case WPN_EVENINGSTAR: - return TILE_WPN_EVENINGSTAR + etable[1][etype]; + return TILE_WPN_EVENINGSTAR; case WPN_GIANT_CLUB: return TILE_WPN_GIANT_CLUB; @@ -1138,7 +1158,7 @@ return TILE_WPN_LONGBOW; case WPN_LAJATANG: - return TILE_WPN_LAJATANG + etable[1][etype]; + return TILE_WPN_LAJATANG; case WPN_BARDICHE: return TILE_WPN_LOCHABER_AXE; @@ -1147,16 +1167,16 @@ return TILE_WPN_FALCHION; case WPN_BLESSED_LONG_SWORD: - return TILE_WPN_LONG_SWORD + etable[1][etype]; + return TILE_WPN_LONG_SWORD; case WPN_BLESSED_SCIMITAR: - return TILE_WPN_SCIMITAR + etable[1][etype]; + return TILE_WPN_SCIMITAR; case WPN_BLESSED_KATANA: - return TILE_WPN_KATANA + etable[1][etype]; + return TILE_WPN_KATANA; case WPN_BLESSED_GREAT_SWORD: - return TILE_WPN_GREAT_SWORD + etable[1][etype]; + return TILE_WPN_GREAT_SWORD; case WPN_BLESSED_DOUBLE_SWORD: return TILE_WPN_DOUBLE_SWORD; @@ -1168,6 +1188,12 @@ return TILE_ERROR; } +static int _tileidx_weapon(const item_def &item) +{ + int tile = _tileidx_weapon_base(item); + return _apply_variations(item, tile); +} + static int _tileidx_missile(const item_def &item) { int brand = item.special; @@ -1195,31 +1221,21 @@ return TILE_ERROR; } -static int _tileidx_armour(const item_def &item) +static int _tileidx_armour_base(const item_def &item) { int race = item.flags & ISFLAG_RACIAL_MASK; int type = item.sub_type; - int etype = _get_etype(item); - - static const int etable[5][5] = { - {0, 0, 0, 0, 0}, // No ego tile - {0, 1, 1, 1, 1}, // One ego tile - {0, 1, 1, 1, 2}, // Two ego tile - {0, 1, 1, 2, 3}, - {0, 1, 2, 3, 4} - }; - switch(type) { case ARM_ROBE: - return TILE_ARM_ROBE + etable[2][etype]; + return TILE_ARM_ROBE; case ARM_LEATHER_ARMOUR: if (race == ISFLAG_ORCISH) return TILE_ARM_LEATHER_ARMOUR_ORC; if (race == ISFLAG_ELVEN) return TILE_ARM_LEATHER_ARMOUR_ELF; - return TILE_ARM_LEATHER_ARMOUR + etable[2][etype]; + return TILE_ARM_LEATHER_ARMOUR; case ARM_RING_MAIL: if (race == ISFLAG_ORCISH) @@ -1228,19 +1244,19 @@ return TILE_ARM_RING_MAIL_ELF; if (race == ISFLAG_DWARVEN) return TILE_ARM_RING_MAIL_DWA; - return TILE_ARM_RING_MAIL + etable[1][etype]; + return TILE_ARM_RING_MAIL; case ARM_SCALE_MAIL: if (race == ISFLAG_ELVEN) return TILE_ARM_SCALE_MAIL_ELF; - return TILE_ARM_SCALE_MAIL + etable[1][etype]; + return TILE_ARM_SCALE_MAIL; case ARM_CHAIN_MAIL: if (race == ISFLAG_ELVEN) return TILE_ARM_CHAIN_MAIL_ELF; if (race == ISFLAG_ORCISH) return TILE_ARM_CHAIN_MAIL_ORC; - return TILE_ARM_CHAIN_MAIL + etable[1][etype]; + return TILE_ARM_CHAIN_MAIL; case ARM_SPLINT_MAIL: return TILE_ARM_SPLINT_MAIL; @@ -1257,40 +1273,40 @@ return TILE_ARM_CRYSTAL_PLATE_MAIL; case ARM_SHIELD: - return TILE_ARM_SHIELD + etable[2][etype]; + return TILE_ARM_SHIELD; case ARM_CLOAK: - return TILE_ARM_CLOAK + etable[3][etype]; + return TILE_ARM_CLOAK; case ARM_WIZARD_HAT: - return TILE_THELM_WIZARD_HAT + etable[1][etype]; + return TILE_THELM_WIZARD_HAT; case ARM_CAP: return TILE_THELM_CAP; case ARM_HELMET: - return TILE_THELM_HELM + etable[3][etype]; + return TILE_THELM_HELM; case ARM_GLOVES: - return TILE_ARM_GLOVES + etable[3][etype]; + return TILE_ARM_GLOVES; case ARM_BOOTS: - return TILE_ARM_BOOTS + etable[3][etype]; + return TILE_ARM_BOOTS; case ARM_BUCKLER: - return TILE_ARM_BUCKLER + etable[1][etype]; + return TILE_ARM_BUCKLER; case ARM_LARGE_SHIELD: - return TILE_ARM_LARGE_SHIELD + etable[2][etype]; + return TILE_ARM_LARGE_SHIELD; case ARM_CENTAUR_BARDING: - return TILE_ARM_CENTAUR_BARDING + etable[3][etype]; + return TILE_ARM_CENTAUR_BARDING; case ARM_NAGA_BARDING: - return TILE_ARM_NAGA_BARDING + etable[3][etype]; + return TILE_ARM_NAGA_BARDING; case ARM_ANIMAL_SKIN: - return TILE_ARM_ANIMAL_SKIN + etable[1][etype]; + return TILE_ARM_ANIMAL_SKIN; case ARM_TROLL_HIDE: return TILE_ARM_TROLL_HIDE; @@ -1344,6 +1360,12 @@ return TILE_ERROR; } +static int _tileidx_armour(const item_def &item) +{ + int tile = _tileidx_armour_base(item); + return _apply_variations(item, tile); +} + static int _tileidx_food(const item_def &item) { switch (item.sub_type) @@ -1820,13 +1842,19 @@ return TILE_GOLD; case OBJ_JEWELLERY: - - if (type < AMU_RAGE) + if (type < NUM_RINGS) { if (is_random_artefact( item )) return TILE_RING_RANDOM_OFFSET + color - 1; + else if (id[ IDTYPE_JEWELLERY][type] == ID_KNOWN_TYPE + || (item.flags & ISFLAG_KNOW_TYPE)) + { + return TILE_RING_REGENERATION + type - RING_FIRST_RING; + } else + { return TILE_RING_NORMAL_OFFSET + special % 13; + } } else { @@ -1834,8 +1862,15 @@ return _tileidx_unrand_artefact(find_unrandart_index(item)); else if (is_random_artefact( item )) return TILE_AMU_RANDOM_OFFSET + color - 1; + else if (id[ IDTYPE_JEWELLERY][type] == ID_KNOWN_TYPE + || (item.flags & ISFLAG_KNOW_TYPE)) + { + return TILE_AMU_RAGE + type - AMU_FIRST_AMULET; + } else + { return TILE_AMU_NORMAL_OFFSET + special % 13; + } } case OBJ_POTIONS: Modified: trunk/crawl-ref/source/tilereg.cc =================================================================== --- trunk/crawl-ref/source/tilereg.cc 2008-09-12 02:04:02 UTC (rev 6909) +++ trunk/crawl-ref/source/tilereg.cc 2008-09-12 03:55:34 UTC (rev 6910) @@ -490,7 +490,9 @@ ASSERT(draw_info_count <= sizeof(dinfo) / (sizeof(dinfo[0]))); for (unsigned int i = 0; i < draw_info_count; i++) + { add_quad(TEX_DOLL, dinfo[i].idx, x, y, dinfo[i].ofs_x, dinfo[i].ofs_y); + } } void DungeonRegion::draw_foreground(unsigned int bg, unsigned int fg, unsigned int x, unsigned int y) @@ -2283,7 +2285,8 @@ // Copy an image at inf from pixels into dest. static void _copy_into(unsigned char *dest, unsigned char *pixels, unsigned int width, - unsigned int height, const tile_info &inf) + unsigned int height, const tile_info &inf, + int ofs_x = 0, int ofs_y = 0) { unsigned char *src = &pixels[4 * (inf.sy * width + inf.sx)]; @@ -2292,10 +2295,26 @@ memset(dest, 0, 4 * inf.width * inf.height); - dest += inf.offset_x * 4 + inf.offset_y * dest_row_size; - + int total_ofs_x = inf.offset_x + ofs_x; + int total_ofs_y = inf.offset_y + ofs_y; int src_height = inf.ey - inf.sy; int src_width = inf.ex - inf.sx; + + if (total_ofs_x < 0) + { + src_width += total_ofs_x; + src -= 4 * total_ofs_x; + total_ofs_x = 0; + } + if (total_ofs_y < 0) + { + src_height += total_ofs_y; + src -= 4 * width * total_ofs_y; + total_ofs_y = 0; + } + + dest += total_ofs_x * 4 + total_ofs_y * dest_row_size; + for (int r = 0; r < src_height; r++) { memcpy(dest, src, src_width * 4); @@ -2307,7 +2326,8 @@ // Stores "over" on top of "under" in the location of "over". static bool _copy_under(unsigned char *pixels, unsigned int width, - unsigned int height, int idx_under, int idx_over) + unsigned int height, int idx_under, int idx_over, + int uofs_x = 0, int uofs_y = 0) { const tile_info &under = tile_main_info(idx_under); const tile_info &over = tile_main_info(idx_over); @@ -2325,7 +2345,7 @@ // Make a copy of the original images. unsigned char *under_pixels = new unsigned char[image_size]; - _copy_into(under_pixels, pixels, width, height, under); + _copy_into(under_pixels, pixels, width, height, under, uofs_x, uofs_y); unsigned char *over_pixels = new unsigned char[image_size]; _copy_into(over_pixels, pixels, width, height, over); @@ -2374,6 +2394,20 @@ int tile1 = TILE_ROD_SMITING + i - STAFF_SMITING; success &= _copy_under(pixels, width, height, tile0, tile1); } + for (int i = RING_FIRST_RING; i < NUM_RINGS; i++) + { + int special = you.item_description[IDESC_RINGS][i]; + int tile0 = TILE_RING_NORMAL_OFFSET + special % 13; + int tile1 = TILE_RING_REGENERATION + i - RING_FIRST_RING; + success &= _copy_under(pixels, width, height, tile0, tile1, -5, -6); + } + for (int i = AMU_FIRST_AMULET; i < NUM_JEWELLERY; i++) + { + int special = you.item_description[IDESC_RINGS][i]; + int tile0 = TILE_AMU_NORMAL_OFFSET + special % 13; + int tile1 = TILE_AMU_RAGE + i - AMU_FIRST_AMULET; + success &= _copy_under(pixels, width, height, tile0, tile1); + } return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |