Skip to content

Commit b9c1765

Browse files
committed
Fix eggcacher, dramatically improve Windows installer
1 parent cbd70ad commit b9c1765

File tree

8 files changed

+1326
-44
lines changed

8 files changed

+1326
-44
lines changed

direct/src/directbase/ppython.cxx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
//
88
///////////////////////////////////////////////////////////////////////
99

10+
#include "dtoolbase.h"
11+
1012
#include <Python.h>
1113
#if PY_MAJOR_VERSION >= 3
1214
#include <wchar.h>
@@ -71,21 +73,21 @@ int main(int argc, char *argv[]) {
7173
char *path = getenv("PATH");
7274
char *result = strtok(path, ";");
7375
while (result != NULL) {
74-
struct stat st;
76+
struct stat st;
7577
char *ppython = (char*) malloc(strlen(result) + 13);
7678
strcpy(ppython, result);
7779
strcat(ppython, "\\ppython.exe");
7880
if (stat(ppython, &st) == 0) {
7981
Py_SetPythonHome(result);
8082
free(ppython);
8183
break;
82-
}
84+
}
8385
result = strtok(NULL, ";");
8486
free(ppython);
8587
}
8688
#endif
8789
#endif
88-
90+
8991
Py_Initialize();
9092

9193
if (Py_VerboseFlag) {

direct/src/directscripts/eggcacher.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
##############################################################################
1010

1111
import os,sys,gc
12-
from pandac.PandaModules import *
12+
from panda3d.core import *
1313

1414
class EggCacher:
1515
def __init__(self, args):
1616
maindir = Filename.fromOsSpecific(os.getcwd()).getFullpath()
1717
ExecutionEnvironment.setEnvironmentVariable("MAIN_DIR", maindir)
1818
self.bamcache = BamCache.getGlobalPtr()
19-
self.pandaloader = PandaLoader()
20-
self.loaderopts = LoaderOptions()
19+
self.pandaloader = Loader()
20+
self.loaderopts = LoaderOptions(LoaderOptions.LF_no_ram_cache)
2121
if (self.bamcache.getActive() == 0):
2222
print "The model cache is not currently active."
2323
print "You must set a model-cache-dir in your config file."
@@ -69,12 +69,12 @@ def scanPaths(self, paths):
6969

7070
def processFiles(self, files):
7171
total = 0
72-
for (path,size) in files:
72+
for (path, size) in files:
7373
total += size
7474
progress = 0
7575
for (path,size) in files:
7676
fn = Filename.fromOsSpecific(path)
77-
cached = self.bamcache.lookup(fn,"bam")
77+
cached = self.bamcache.lookup(fn, "bam")
7878
percent = (progress * 100) / total
7979
report = path
8080
if (self.concise): report = os.path.basename(report)
@@ -87,6 +87,4 @@ def processFiles(self, files):
8787
TexturePool.releaseAllTextures()
8888
progress += size
8989

90-
9190
cacher = EggCacher(sys.argv[1:])
92-

0 commit comments

Comments
 (0)