Fixed: Missing graphics when running from a different working directory.
Open terrain.png and several other files from their location in dataDir instead of from the current directory.
This commit is contained in:
parent
85a7c61c99
commit
eb26590fb5
@ -49,7 +49,7 @@ def alertException(func):
|
|||||||
alert("Canceled.")
|
alert("Canceled.")
|
||||||
except pymclevel.infiniteworld.SessionLockLost as e:
|
except pymclevel.infiniteworld.SessionLockLost as e:
|
||||||
alert(e.message + "\n\nYour changes cannot be saved.")
|
alert(e.message + "\n\nYour changes cannot be saved.")
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logging.exception("Exception:")
|
logging.exception("Exception:")
|
||||||
if ask("Error during {0}: {1!r}".format(func, e)[:1000], ["Report Error", "Okay"], default=1, cancel=0) == "Report Error":
|
if ask("Error during {0}: {1!r}".format(func, e)[:1000], ["Report Error", "Okay"], default=1, cancel=0) == "Report Error":
|
||||||
@ -308,7 +308,7 @@ def loadAlphaTerrainTexture():
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
print repr(e), "while loading texture pack info."
|
print repr(e), "while loading texture pack info."
|
||||||
|
|
||||||
texW, texH, terraindata = loadPNGFile("terrain.png")
|
texW, texH, terraindata = loadPNGFile(os.path.join(directories.dataDir, "terrain.png"))
|
||||||
|
|
||||||
def slurpZipExt(zipextfile):
|
def slurpZipExt(zipextfile):
|
||||||
# zipextfile.read() doesn't read all available data
|
# zipextfile.read() doesn't read all available data
|
||||||
@ -414,6 +414,7 @@ def loadTextureFunc(w, h, ndata):
|
|||||||
|
|
||||||
|
|
||||||
def loadPNGTexture(filename):
|
def loadPNGTexture(filename):
|
||||||
|
filename = os.path.join(directories.dataDir, filename)
|
||||||
try:
|
try:
|
||||||
w, h, ndata = loadPNGFile(filename)
|
w, h, ndata = loadPNGFile(filename)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ def get_version():
|
|||||||
except:
|
except:
|
||||||
return 'unknown'
|
return 'unknown'
|
||||||
|
|
||||||
fin = open('RELEASE-VERSION', 'rb')
|
fin = open(os.path.join(directories.dataDir, 'RELEASE-VERSION'), 'rb')
|
||||||
v = fin.read().strip()
|
v = fin.read().strip()
|
||||||
fin.close()
|
fin.close()
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ def get_commit():
|
|||||||
except:
|
except:
|
||||||
return 'unknown'
|
return 'unknown'
|
||||||
|
|
||||||
fin = open('GIT-COMMIT', 'rb')
|
fin = open(os.path.join(directories.dataDir, 'GIT-COMMIT'), 'rb')
|
||||||
v = fin.read().strip()
|
v = fin.read().strip()
|
||||||
fin.close()
|
fin.close()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user