Skip to content

Draft: Issue warning when variant given is exceeds declared variants. Load error sprite in that case.

Fedja Beader requested to merge specing/manaplus:sprite_warnings into master

May be better to detect failed load by checking if mActions and mImageSets are empty, or by throwing an exception. Have to look how errors are handled elsewhere and decide on best approach.

hread 1 "manaplus" hit Breakpoint 2, SpriteDef::load (animationFile="graphics/sprites/emote.xml", variant=<optimized out>, 
    prot=<optimized out>) at resources/sprite/spritedef.cpp:114
114	        reportAlways("Error, failed to load sprite %s", animationFile.c_str())
print (def)
$27 = (SpriteDef * const) 0x5555569dd840
(gdb) print (def.mActions)
$28 = std::map with 0 elements
(gdb) print (def.mImageSets)
$29 = std::map with 0 elements

spriteload

See also: !50 (merged)

Edited by Fedja Beader

Merge request reports