diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 2983d0488a..375132d6ef 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1323,6 +1323,7 @@ PANDAVERSION_H=""" #define PANDA_MINOR_VERSION $VERSION2 #define PANDA_SEQUENCE_VERSION $VERSION2 #define PANDA_VERSION $NVERSION +#define PANDA_NUMERIC_VERSION $NVERSION #define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3" #define PANDA_DISTRIBUTOR "$DISTRIBUTOR" #define PANDA_PACKAGE_VERSION_STR "$RUNTIME_VERSION" @@ -1354,6 +1355,9 @@ def CreatePandaVersionFiles(): pversion2=int(PLUGIN_VERSION.split(".")[1]) pversion3=int(PLUGIN_VERSION.split(".")[2]) nversion=version1*1000000+version2*1000+version3 + if (DISTRIBUTOR != "cmu"): + # Subtract 1 if we are not an official version. + nversion -= 1 pandaversion_h = PANDAVERSION_H.replace("$VERSION1",str(version1)) pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2)) @@ -1367,8 +1371,8 @@ def CreatePandaVersionFiles(): pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n" if RUNTIME: pandaversion_h += "\n#define P3D_PLUGIN_MAJOR_VERSION %s\n" % pversion1 - pandaversion_h += "\n#define P3D_PLUGIN_MINOR_VERSION %s\n" % pversion1 - pandaversion_h += "\n#define P3D_PLUGIN_SEQUENCE_VERSION %s\n" % pversion1 + pandaversion_h += "\n#define P3D_PLUGIN_MINOR_VERSION %s\n" % pversion2 + pandaversion_h += "\n#define P3D_PLUGIN_SEQUENCE_VERSION %s\n" % pversion3 checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1)) checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2)) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index c9ef73cc17..3cdb51624e 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -717,7 +717,6 @@ def MakeBuildTree(): MakeDirectory(OUTPUTDIR+"/models/maps") MakeDirectory(OUTPUTDIR+"/models/misc") MakeDirectory(OUTPUTDIR+"/models/gui") - MakeDirectory(OUTPUTDIR+"/direct") MakeDirectory(OUTPUTDIR+"/pandac") MakeDirectory(OUTPUTDIR+"/pandac/input") @@ -1500,11 +1499,11 @@ def ParsePandaVersion(fn): for line in f: match = pattern.match(line,0) if (match): - version = match.group(1)+"."+match.group(2)+"."+match.group(3) - break + f.close() + return match.group(1)+"."+match.group(2)+"."+match.group(3) f.close() - except: version="0.0.0" - return version + except: pass + return "0.0.0" def ParsePluginVersion(fn): try: @@ -1513,11 +1512,11 @@ def ParsePluginVersion(fn): for line in f: match = pattern.match(line,0) if (match): - version = match.group(1)+"."+match.group(2)+"."+match.group(3) - break + f.close() + return match.group(1)+"."+match.group(2)+"."+match.group(3) f.close() - except: version="0.0.0" - return version + except: pass + return "0.0.0" ######################################################################## ##