Merge /mnt/panda3d

This commit is contained in:
rdb 2015-02-11 21:43:21 +01:00
commit 886890b02f
8 changed files with 1326 additions and 44 deletions

View File

@ -7,6 +7,8 @@
//
///////////////////////////////////////////////////////////////////////
#include "dtoolbase.h"
#include <Python.h>
#if PY_MAJOR_VERSION >= 3
#include <wchar.h>

View File

@ -9,15 +9,15 @@
##############################################################################
import os,sys,gc
from pandac.PandaModules import *
from panda3d.core import *
class EggCacher:
def __init__(self, args):
maindir = Filename.fromOsSpecific(os.getcwd()).getFullpath()
ExecutionEnvironment.setEnvironmentVariable("MAIN_DIR", maindir)
self.bamcache = BamCache.getGlobalPtr()
self.pandaloader = PandaLoader()
self.loaderopts = LoaderOptions()
self.pandaloader = Loader()
self.loaderopts = LoaderOptions(LoaderOptions.LF_no_ram_cache)
if (self.bamcache.getActive() == 0):
print "The model cache is not currently active."
print "You must set a model-cache-dir in your config file."
@ -69,12 +69,12 @@ class EggCacher:
def processFiles(self, files):
total = 0
for (path,size) in files:
for (path, size) in files:
total += size
progress = 0
for (path,size) in files:
fn = Filename.fromOsSpecific(path)
cached = self.bamcache.lookup(fn,"bam")
cached = self.bamcache.lookup(fn, "bam")
percent = (progress * 100) / total
report = path
if (self.concise): report = os.path.basename(report)
@ -87,6 +87,4 @@ class EggCacher:
TexturePool.releaseAllTextures()
progress += size
cacher = EggCacher(sys.argv[1:])

1276
makepanda/installer.nsi Executable file

File diff suppressed because it is too large Load Diff

View File

@ -6171,7 +6171,7 @@ except:
#
##########################################################################################
def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
def MakeInstallerNSIS(file, title, installdir):
if (os.path.isfile(file)):
os.remove(file)
elif (os.path.isdir(file)):
@ -6199,7 +6199,7 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
shutil.move("direct\\src\\plugin_installer\\p3d-setup.exe", file)
return
print("Building "+fullname+" installer. This can take up to an hour.")
print("Building "+title+" installer. This can take up to an hour.")
if (COMPRESSOR != "lzma"):
print("Note: you are using zlib, which is faster, but lzma gives better compression.")
if (os.path.exists("nsis-output.exe")):
@ -6210,19 +6210,13 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
nsis_defs = {
'COMPRESSOR' : COMPRESSOR,
'NAME' : fullname,
'SMDIRECTORY' : smdirectory,
'TITLE' : title,
'INSTALLDIR' : installdir,
'OUTFILE' : os.path.join(psource, 'nsis-output.exe'),
'LICENSE' : os.path.join(panda, 'LICENSE'),
'LANGUAGE' : "English",
'RUNTEXT' : "Visit the Panda Manual",
'IBITMAP' : "panda-install.bmp",
'UBITMAP' : "panda-install.bmp",
'PANDA' : panda,
'BUILT' : panda,
'SOURCE' : psource,
'PYVER' : SDK["PYTHONVERSION"][6:9],
'PANDACONF' : os.path.join(panda, 'etc'),
'PSOURCE' : psource,
'PYEXTRAS' : os.path.join(os.path.abspath(GetThirdpartyBase()), 'win-extras'),
'REGVIEW' : regview,
}
@ -6236,7 +6230,7 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
for item in nsis_defs.items():
cmd += ' -D%s="%s"' % item
cmd += ' "%s"' % (os.path.join(psource, 'direct', 'src', 'directscripts', 'packpanda.nsi'))
cmd += ' "%s"' % (os.path.join(psource, 'makepanda', 'installer.nsi'))
oscmd(cmd)
os.rename("nsis-output.exe", file)
@ -6761,14 +6755,14 @@ try:
if (GetOptimize() <= 2): dbg = "-dbg"
if GetTargetArch() == 'x64':
if (RUNTIME):
MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+"-x64.exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION+"-x64")
MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+"-x64.exe", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION+"-x64")
else:
MakeInstallerNSIS("Panda3D-"+VERSION+dbg+"-x64.exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION+"-x64")
MakeInstallerNSIS("Panda3D-"+VERSION+dbg+"-x64.exe", "Panda3D SDK "+VERSION, "C:\\Panda3D-"+VERSION+"-x64")
else:
if (RUNTIME):
MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+".exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+".exe", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
else:
MakeInstallerNSIS("Panda3D-"+VERSION+dbg+".exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
MakeInstallerNSIS("Panda3D-"+VERSION+dbg+".exe", "Panda3D SDK "+VERSION, "C:\\Panda3D-"+VERSION)
elif (target == 'linux'):
MakeInstallerLinux()
elif (target == 'darwin'):

View File

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB

View File

@ -343,11 +343,11 @@ try_load_file(const Filename &pathname, const LoaderOptions &options,
return result;
}
}
}
if (loader_cat.is_debug()) {
loader_cat.debug()
<< "Model " << pathname << " not found in cache.\n";
if (loader_cat.is_debug()) {
loader_cat.debug()
<< "Model " << pathname << " not found in cache.\n";
}
}
bool cache_only = (options.get_flags() & LoaderOptions::LF_cache_only) != 0;

View File

@ -385,6 +385,16 @@ flush_index() {
check_cache_size();
}
////////////////////////////////////////////////////////////////////
// Function: BamCache::list_index
// Access: Published
// Description: Writes the contents of the index to standard output.
////////////////////////////////////////////////////////////////////
void BamCache::
list_index(ostream &out, int indent_level) const {
_index->write(out, indent_level);
}
////////////////////////////////////////////////////////////////////
// Function: BamCache::read_index
// Access: Private

View File

@ -80,6 +80,8 @@ PUBLISHED:
void consider_flush_index();
void flush_index();
void list_index(ostream &out, int indent_level = 0) const;
INLINE static BamCache *get_global_ptr();
private: