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> #include <Python.h>
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
#include <wchar.h> #include <wchar.h>

View File

@ -9,15 +9,15 @@
############################################################################## ##############################################################################
import os,sys,gc import os,sys,gc
from pandac.PandaModules import * from panda3d.core import *
class EggCacher: class EggCacher:
def __init__(self, args): def __init__(self, args):
maindir = Filename.fromOsSpecific(os.getcwd()).getFullpath() maindir = Filename.fromOsSpecific(os.getcwd()).getFullpath()
ExecutionEnvironment.setEnvironmentVariable("MAIN_DIR", maindir) ExecutionEnvironment.setEnvironmentVariable("MAIN_DIR", maindir)
self.bamcache = BamCache.getGlobalPtr() self.bamcache = BamCache.getGlobalPtr()
self.pandaloader = PandaLoader() self.pandaloader = Loader()
self.loaderopts = LoaderOptions() self.loaderopts = LoaderOptions(LoaderOptions.LF_no_ram_cache)
if (self.bamcache.getActive() == 0): if (self.bamcache.getActive() == 0):
print "The model cache is not currently active." print "The model cache is not currently active."
print "You must set a model-cache-dir in your config file." print "You must set a model-cache-dir in your config file."
@ -69,12 +69,12 @@ class EggCacher:
def processFiles(self, files): def processFiles(self, files):
total = 0 total = 0
for (path,size) in files: for (path, size) in files:
total += size total += size
progress = 0 progress = 0
for (path,size) in files: for (path,size) in files:
fn = Filename.fromOsSpecific(path) fn = Filename.fromOsSpecific(path)
cached = self.bamcache.lookup(fn,"bam") cached = self.bamcache.lookup(fn, "bam")
percent = (progress * 100) / total percent = (progress * 100) / total
report = path report = path
if (self.concise): report = os.path.basename(report) if (self.concise): report = os.path.basename(report)
@ -87,6 +87,4 @@ class EggCacher:
TexturePool.releaseAllTextures() TexturePool.releaseAllTextures()
progress += size progress += size
cacher = EggCacher(sys.argv[1:]) 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)): if (os.path.isfile(file)):
os.remove(file) os.remove(file)
elif (os.path.isdir(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) shutil.move("direct\\src\\plugin_installer\\p3d-setup.exe", file)
return 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"): if (COMPRESSOR != "lzma"):
print("Note: you are using zlib, which is faster, but lzma gives better compression.") print("Note: you are using zlib, which is faster, but lzma gives better compression.")
if (os.path.exists("nsis-output.exe")): if (os.path.exists("nsis-output.exe")):
@ -6210,19 +6210,13 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
nsis_defs = { nsis_defs = {
'COMPRESSOR' : COMPRESSOR, 'COMPRESSOR' : COMPRESSOR,
'NAME' : fullname, 'TITLE' : title,
'SMDIRECTORY' : smdirectory,
'INSTALLDIR' : installdir, 'INSTALLDIR' : installdir,
'OUTFILE' : os.path.join(psource, 'nsis-output.exe'), 'OUTFILE' : os.path.join(psource, 'nsis-output.exe'),
'LICENSE' : os.path.join(panda, 'LICENSE'), 'LICENSE' : os.path.join(panda, 'LICENSE'),
'LANGUAGE' : "English", 'BUILT' : panda,
'RUNTEXT' : "Visit the Panda Manual", 'SOURCE' : psource,
'IBITMAP' : "panda-install.bmp",
'UBITMAP' : "panda-install.bmp",
'PANDA' : panda,
'PYVER' : SDK["PYTHONVERSION"][6:9], 'PYVER' : SDK["PYTHONVERSION"][6:9],
'PANDACONF' : os.path.join(panda, 'etc'),
'PSOURCE' : psource,
'PYEXTRAS' : os.path.join(os.path.abspath(GetThirdpartyBase()), 'win-extras'), 'PYEXTRAS' : os.path.join(os.path.abspath(GetThirdpartyBase()), 'win-extras'),
'REGVIEW' : regview, 'REGVIEW' : regview,
} }
@ -6236,7 +6230,7 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
for item in nsis_defs.items(): for item in nsis_defs.items():
cmd += ' -D%s="%s"' % item 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) oscmd(cmd)
os.rename("nsis-output.exe", file) os.rename("nsis-output.exe", file)
@ -6761,14 +6755,14 @@ try:
if (GetOptimize() <= 2): dbg = "-dbg" if (GetOptimize() <= 2): dbg = "-dbg"
if GetTargetArch() == 'x64': if GetTargetArch() == 'x64':
if (RUNTIME): 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: 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: else:
if (RUNTIME): 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: 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'): elif (target == 'linux'):
MakeInstallerLinux() MakeInstallerLinux()
elif (target == 'darwin'): 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; return result;
} }
} }
}
if (loader_cat.is_debug()) { if (loader_cat.is_debug()) {
loader_cat.debug() loader_cat.debug()
<< "Model " << pathname << " not found in cache.\n"; << "Model " << pathname << " not found in cache.\n";
}
} }
bool cache_only = (options.get_flags() & LoaderOptions::LF_cache_only) != 0; bool cache_only = (options.get_flags() & LoaderOptions::LF_cache_only) != 0;

View File

@ -385,6 +385,16 @@ flush_index() {
check_cache_size(); 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 // Function: BamCache::read_index
// Access: Private // Access: Private

View File

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