Make sure bitmap loader searches for proper file (w/o EVE embedfs-specific path and extension)

This commit is contained in:
DarkPhoenix
2015-07-06 11:31:02 +03:00
parent 2b3f3773e5
commit 0521d242eb

View File

@@ -71,10 +71,23 @@ def getBitmap(name,location):
# print "#BMPs:%d - Current took: %.8f" % (cachedBitmapsCount,time.clock() - start)
return bmp
def stripPath(fname):
"""
Here we extract 'core' of icon name. Path and
extension are sometimes specified in database
but we don't need them.
"""
# Path before the icon file name
fname = fname.split('/')[-1]
# Extension
fname = fname.rsplit('.', 1)[0]
return fname
def getImage(name, location):
if location in locationMap:
if location == "pack":
location = locationMap[location]
name = stripPath(name)
filename = "icon{0}.png".format(name)
path = os.path.join(location, filename)
else: