From 2df0ddc5bea220d87ba2215cd996aaf4174db978 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 5 Jun 2009 01:25:15 +0000 Subject: [PATCH] allow embedded textures --- direct/src/showbase/MakeAppMF.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/direct/src/showbase/MakeAppMF.py b/direct/src/showbase/MakeAppMF.py index 57b5c676e2..d1608152dd 100644 --- a/direct/src/showbase/MakeAppMF.py +++ b/direct/src/showbase/MakeAppMF.py @@ -209,13 +209,21 @@ class AppPacker: # them their new location within the multifile. for tex in NodePath(node).findAllTextures(): - if not tex.hasFullpath(): - continue - - if tex.hasFilename(): - tex.setFilename(self.addTexture(tex.getFullpath())) - if tex.hasAlphaFilename(): - tex.setAlphaFilename(self.addTexture(tex.getAlphaFullpath())) + if not tex.hasFullpath() and tex.hasRamImage(): + # We need to store this texture as a raw-data image. + # Clear the filename so this will happen + # automatically. + tex.clearFilename() + tex.clearAlphaFilename() + + else: + # We can store this texture as a file reference to its + # image. Copy the file into our multifile, and rename + # its reference in the texture. + if tex.hasFilename(): + tex.setFilename(self.addTexture(tex.getFullpath())) + if tex.hasAlphaFilename(): + tex.setAlphaFilename(self.addTexture(tex.getAlphaFullpath())) # Now generate an in-memory bam file. Tell the bam writer to # keep the textures referenced by their in-multifile path.