mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
Move makepanda to root
This commit is contained in:
parent
7255aad2a6
commit
125c82d23b
BIN
makepanda/Panda3D-tpl.dmg
Normal file
BIN
makepanda/Panda3D-tpl.dmg
Normal file
Binary file not shown.
107
makepanda/confauto.in
Executable file
107
makepanda/confauto.in
Executable file
@ -0,0 +1,107 @@
|
||||
###########################################################
|
||||
### ###
|
||||
### Panda3D Configuration File - Auto-Generated Portion ###
|
||||
### ###
|
||||
### Editing this file is not recommended. Most of these ###
|
||||
### directives can be overriden in Config.prc ###
|
||||
### ###
|
||||
###########################################################
|
||||
|
||||
# The egg loader is handy to have available by default. This allows
|
||||
# clients to load egg files. (The bam loader is built-in so bam files
|
||||
# are always loadable).
|
||||
|
||||
# By qualifying with the extension "egg", we indicate the egg loader
|
||||
# should be made available only if you explicitly name a file with an
|
||||
# .egg extension.
|
||||
|
||||
# Also see ptloader, which is built as part of pandatool; it allows
|
||||
# files of more exotic types (like .flt, .mb, .lwo, and .dxf) to be
|
||||
# loaded directly into Panda.
|
||||
|
||||
load-file-type egg pandaegg
|
||||
|
||||
# The following lines define some handy object types to use within the
|
||||
# egg syntax. This remaps <ObjectType> { name } into whatever egg
|
||||
# syntax is given by egg-object-type-name, which makes a handy
|
||||
# abbreviation for modeling packages (like Maya) to insert
|
||||
# sophisticated egg syntax into the generated egg file, using a single
|
||||
# object type string.
|
||||
|
||||
egg-object-type-portal <Scalar> portal { 1 }
|
||||
egg-object-type-polylight <Scalar> polylight { 1 }
|
||||
egg-object-type-seq24 <Switch> { 1 } <Scalar> fps { 24 }
|
||||
egg-object-type-seq12 <Switch> { 1 } <Scalar> fps { 12 }
|
||||
egg-object-type-indexed <Scalar> indexed { 1 }
|
||||
|
||||
egg-object-type-binary <Scalar> alpha { binary }
|
||||
egg-object-type-dual <Scalar> alpha { dual }
|
||||
egg-object-type-glass <Scalar> alpha { blend_no_occlude }
|
||||
|
||||
# These are just shortcuts to define the Model and DCS flags, which
|
||||
# indicate nodes that should not be flattened out of the hierarchy
|
||||
# during the conversion process. DCS goes one step further and
|
||||
# indicates that the node's transform is important and should be
|
||||
# preserved (DCS stands for Dynamic Coordinate System). Notouch is
|
||||
# even stronger, and means not to do any flattening below the node at
|
||||
# all.
|
||||
egg-object-type-model <Model> { 1 }
|
||||
egg-object-type-dcs <DCS> { 1 }
|
||||
egg-object-type-notouch <DCS> { no_touch }
|
||||
|
||||
# The following define various kinds of collision geometry. These
|
||||
# mark the geometry at this level and below as invisible collision
|
||||
# polygons, which can be used by Panda's collision system to detect
|
||||
# collisions more optimally than regular visible polygons.
|
||||
egg-object-type-barrier <Collide> { Polyset descend }
|
||||
egg-object-type-sphere <Collide> { Sphere descend }
|
||||
egg-object-type-invsphere <Collide> { InvSphere descend }
|
||||
egg-object-type-tube <Collide> { Tube descend }
|
||||
|
||||
# As above, but these are flagged to be "intangible", so that they
|
||||
# will trigger an event but not stop an object from passing through.
|
||||
egg-object-type-trigger <Collide> { Polyset descend intangible }
|
||||
egg-object-type-trigger-sphere <Collide> { Sphere descend intangible }
|
||||
|
||||
# "floor" and "dupefloor" define the nodes in question as floor
|
||||
# polygons. dupefloor means to duplicate the geometry first so that
|
||||
# the same polygons serve both as visible geometry and as collision
|
||||
# polygons.
|
||||
egg-object-type-floor <Collide> { Polyset descend level }
|
||||
egg-object-type-dupefloor <Collide> { Polyset keep descend level }
|
||||
|
||||
# "bubble" puts an invisible bubble around an object, but does not
|
||||
# otherwise remove the geometry.
|
||||
egg-object-type-bubble <Collide> { Sphere keep descend }
|
||||
|
||||
# "ghost" turns off the normal collide bit that is set on visible
|
||||
# geometry by default, so that if you are using visible geometry for
|
||||
# collisions, this particular geometry will not be part of those
|
||||
# collisions--it is ghostlike.
|
||||
egg-object-type-ghost <Scalar> collide-mask { 0 }
|
||||
|
||||
# "glow" is useful for halo effects and things of that ilk. It
|
||||
# renders the object in add mode instead of the normal opaque mode.
|
||||
egg-object-type-glow <Scalar> blend { add }
|
||||
|
||||
# This module allows direct loading of formats like .flt, .mb, or .dxf
|
||||
|
||||
load-file-type p3ptloader
|
||||
|
||||
# Define a new egg object type. See the comments in _panda.prc about this.
|
||||
|
||||
egg-object-type-direct-widget <Scalar> collide-mask { 0x80000000 } <Collide> { Polyset descend }
|
||||
|
||||
# Define a new cull bin that will render on top of everything else.
|
||||
|
||||
cull-bin gui-popup 60 unsorted
|
||||
|
||||
# The following two lines are a fix for flaky hardware clocks.
|
||||
|
||||
lock-to-one-cpu #t
|
||||
paranoid-clock 1
|
||||
|
||||
# This default only comes into play if you try to load a model
|
||||
# and don't specify an extension.
|
||||
|
||||
default-model-extension .egg
|
86
makepanda/config.in
Executable file
86
makepanda/config.in
Executable file
@ -0,0 +1,86 @@
|
||||
###########################################################
|
||||
### ###
|
||||
### Panda3D Configuration File - User-Editable Portion ###
|
||||
### ###
|
||||
###########################################################
|
||||
|
||||
# Uncomment one of the following lines to choose whether you should
|
||||
# run using OpenGL or DirectX rendering.
|
||||
|
||||
load-display pandagl
|
||||
|
||||
# These control the placement and size of the default rendering window.
|
||||
|
||||
win-origin 50 50
|
||||
win-size 800 600
|
||||
|
||||
# Uncomment this line if you want to run Panda fullscreen instead of
|
||||
# in a window.
|
||||
|
||||
fullscreen #f
|
||||
|
||||
# The framebuffer-hardware flag forces it to use an accelerated driver.
|
||||
# The framebuffer-software flag forces it to use a software renderer.
|
||||
# If you don't set either, it will use whatever's available.
|
||||
|
||||
framebuffer-hardware #t
|
||||
framebuffer-software #f
|
||||
|
||||
# These set the minimum requirements for the framebuffer.
|
||||
|
||||
depth-bits 16
|
||||
color-bits 16
|
||||
alpha-bits 0
|
||||
stencil-bits 0
|
||||
multisamples 0
|
||||
|
||||
# These control the amount of output Panda gives for some various
|
||||
# categories. The severity levels, in order, are "spam", "debug",
|
||||
# "info", "warning", and "error"; the default is "info". Uncomment
|
||||
# one (or define a new one for the particular category you wish to
|
||||
# change) to control this output.
|
||||
|
||||
notify-level warning
|
||||
default-directnotify-level warning
|
||||
|
||||
# These specify where model files may be loaded from. You probably
|
||||
# want to set this to a sensible path for yourself. $THIS_PRC_DIR is
|
||||
# a special variable that indicates the same directory as this
|
||||
# particular Config.prc file.
|
||||
|
||||
model-path $MAIN_DIR
|
||||
model-path $THIS_PRC_DIR/..
|
||||
model-path $THIS_PRC_DIR/../models
|
||||
|
||||
# This enable the automatic creation of a TK window when running
|
||||
# Direct.
|
||||
|
||||
want-directtools #f
|
||||
want-tk #f
|
||||
|
||||
# Enable/disable performance profiling tool and frame-rate meter
|
||||
|
||||
want-pstats #f
|
||||
show-frame-rate-meter #f
|
||||
|
||||
# Enable audio using the FMOD audio library by default:
|
||||
|
||||
audio-library-name p3fmod_audio
|
||||
|
||||
# Enable the use of the new movietexture class.
|
||||
|
||||
use-movietexture #t
|
||||
|
||||
# The new version of panda supports hardware vertex animation, but it's not quite ready
|
||||
|
||||
hardware-animated-vertices 0
|
||||
|
||||
# Enable the model-cache, but only for models, not textures.
|
||||
|
||||
model-cache-dir $THIS_PRC_DIR/../modelcache
|
||||
model-cache-textures #f
|
||||
|
||||
# Limit the use of advanced shader profiles.
|
||||
# Currently, advanced profiles are not reliable under Cg.
|
||||
|
||||
basic-shaders-only #t
|
26
makepanda/expandimports.bat
Normal file
26
makepanda/expandimports.bat
Normal file
@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Verify that we can find the 'expandimports' python script
|
||||
REM and the python interpreter. If we can find both, then
|
||||
REM run 'expandimports'.
|
||||
REM
|
||||
|
||||
if not exist makepanda\expandimports.py goto :missing1
|
||||
if not exist thirdparty\win-python\python.exe goto :missing2
|
||||
thirdparty\win-python\python.exe makepanda\expandimports.py %*
|
||||
goto done
|
||||
|
||||
:missing1
|
||||
echo You need to change directory to the root of the panda source tree
|
||||
echo before invoking expandimports.
|
||||
goto done
|
||||
|
||||
:missing2
|
||||
echo You seem to be missing the 'thirdparty' directory. You probably checked
|
||||
echo the source code out from sourceforge. The sourceforge repository is
|
||||
echo missing the 'thirdparty' directory. You will need to supplement the
|
||||
echo code by downloading the 'thirdparty' directory from panda3d.etc.cmu.edu
|
||||
goto done
|
||||
|
||||
:done
|
21
makepanda/expandimports.py
Normal file
21
makepanda/expandimports.py
Normal file
@ -0,0 +1,21 @@
|
||||
########################################################################
|
||||
##
|
||||
## Win32 Usage: makepanda\expandimports.bat
|
||||
## Linux Usage: makepanda/expandimports.py
|
||||
##
|
||||
########################################################################
|
||||
|
||||
import sys,os,re
|
||||
sys.path = ["direct/src/directscripts"] + sys.path
|
||||
import gendocs
|
||||
|
||||
########################################################################
|
||||
##
|
||||
## Make sure panda has been built.
|
||||
##
|
||||
########################################################################
|
||||
|
||||
if (os.path.isfile("built/pandac/input/libpgraph.in")==0) or (os.path.isfile("built/pandac/input/libputil.in")==0):
|
||||
sys.exit("Cannot read the interrogate-output files in built/pandac/input")
|
||||
|
||||
gendocs.expandImports("built/pandac/input", "direct", "samples")
|
26
makepanda/makechm.bat
Executable file
26
makepanda/makechm.bat
Executable file
@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Verify that we can find the 'makechm' python script
|
||||
REM and the python interpreter. If we can find both, then
|
||||
REM run 'makechm'.
|
||||
REM
|
||||
|
||||
if not exist makepanda\makechm.py goto :missing1
|
||||
if not exist thirdparty\win-python\python.exe goto :missing2
|
||||
thirdparty\win-python\python.exe makepanda\makechm.py %*
|
||||
goto done
|
||||
|
||||
:missing1
|
||||
echo You need to change directory to the root of the panda source tree
|
||||
echo before invoking makechm.
|
||||
goto done
|
||||
|
||||
:missing2
|
||||
echo You seem to be missing the 'thirdparty' directory. You probably checked
|
||||
echo the source code out from sourceforge. The sourceforge repository is
|
||||
echo missing the 'thirdparty' directory. You will need to supplement the
|
||||
echo code by downloading the 'thirdparty' directory from panda3d.etc.cmu.edu
|
||||
goto done
|
||||
|
||||
:done
|
278
makepanda/makechm.py
Executable file
278
makepanda/makechm.py
Executable file
@ -0,0 +1,278 @@
|
||||
########################################################################
|
||||
##
|
||||
## Win32 Usage: makepanda\makechm.bat
|
||||
## Linux Usage: makepanda/makechm.py
|
||||
##
|
||||
## To use this script, you will need to have hhc.exe on your system.
|
||||
## For verbose output, run with -v or --verbose option.
|
||||
## To keep the temporary .hhc, .hhk, .hhp, .chw files use -k or --keep.
|
||||
##
|
||||
## You can also import this file as a python module. You will then have
|
||||
## access to three functions: makeCHM, makeManualCHM, makeReferenceCHM.
|
||||
## This is how you call them:
|
||||
## makeCHM(outputfile, dirname, title)
|
||||
## where outputfile is the filename where the .chm file will be written,
|
||||
## and dirname is the directory containing the html files to include.
|
||||
## Title will be the title of the CHM file.
|
||||
## The functions makeManualCHM and makeReferenceCHM work exactly the
|
||||
## same, except that they work with a structure resembling that of the
|
||||
## Panda3D manual and reference, respectively.
|
||||
## Note: outputfile should not contain spaces.
|
||||
##
|
||||
########################################################################
|
||||
|
||||
__all__ = ["makeCHM", "makeManualCHM", "makeReferenceCHM"]
|
||||
import os, re
|
||||
from sys import exit
|
||||
import xml.dom.minidom
|
||||
from xml.dom.minidom import Node
|
||||
|
||||
VERBOSE = False
|
||||
KEEPTEMP = False
|
||||
|
||||
if __name__ == "__main__":
|
||||
from sys import argv
|
||||
VERBOSE = ("-v" in argv) or ("-vk" in argv) or ("-kv" in argv) or ("--verbose" in argv)
|
||||
KEEPTEMP = ("-k" in argv) or ("-kv" in argv) or ("-vk" in argv) or ("--keep" in argv)
|
||||
|
||||
OPTIONBLOCK = """
|
||||
Binary TOC=Yes
|
||||
Compatibility=1.1 or later
|
||||
Compiled file=%s
|
||||
Contents file=%s.hhc
|
||||
Default Font=Arial,10,0
|
||||
Default topic=%s
|
||||
Display compile progress=VERBOSE
|
||||
Full-text search=Yes
|
||||
Index file=%s.hhk
|
||||
Language=0x409 English (United States)
|
||||
Title=%s""".replace("VERBOSE", VERBOSE and "Yes" or "No")
|
||||
|
||||
HTMLBLOCK = """<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta name="generator" content="Panda3D - makechm.py">
|
||||
</head>
|
||||
<body>
|
||||
<object type="text/site properties">
|
||||
<param name="Window Styles" value="0x800025">
|
||||
<param name="ImageType" value="Folder">
|
||||
<param name="Font" value="Arial,8,0">
|
||||
</object>
|
||||
<ul>\n"""
|
||||
|
||||
REFERENCEITEMS = [
|
||||
("index.html", "Main Page"),
|
||||
("methods.html", "Methods"),
|
||||
("functions.html", "Global Functions"),
|
||||
("classes.html", "Classes"),
|
||||
]
|
||||
|
||||
def urldecode(url):
|
||||
regex = re.compile("%([0-9a-hA-H][0-9a-hA-H])", re.M)
|
||||
return regex.sub(lambda x: chr(int(x.group(1), 16)), url)
|
||||
|
||||
def ireplace(string, target, replacement):
|
||||
"""Case-insensitive replace."""
|
||||
index = string.lower().find(target.lower())
|
||||
if index >= 0:
|
||||
result = string[:index] + replacement + string[index + len(target):]
|
||||
return result
|
||||
else:
|
||||
return string
|
||||
|
||||
def parseAnchor(node):
|
||||
"""Parses an XML minidom node representing an anchor and returns a tuple
|
||||
containing the href and the content of the link."""
|
||||
assert node.nodeType == Node.ELEMENT_NODE
|
||||
assert node.localName == "a"
|
||||
href = ""
|
||||
title = ""
|
||||
for localName, a in node.attributes.items():
|
||||
if localName.lower() == "href":
|
||||
href = a
|
||||
for e in node.childNodes:
|
||||
if e.nodeType == Node.TEXT_NODE:
|
||||
title += e.data
|
||||
return href, title
|
||||
|
||||
def parseManualTree(node):
|
||||
"""Parses a tree of the manual Main_Page and returns it through a list containing tuples:
|
||||
[(title, href, [(title, href, [...]), ...]), ...]"""
|
||||
if node.nodeType != Node.ELEMENT_NODE: return []
|
||||
result = []
|
||||
lastadded = None
|
||||
for e in node.childNodes:
|
||||
if e.nodeType == Node.ELEMENT_NODE:
|
||||
if e.localName == "ol":
|
||||
assert lastadded != None
|
||||
for i in xrange(len(result)):
|
||||
if result[i][:2] == lastadded:
|
||||
result[i] = lastadded + (parseManualTree(e),)
|
||||
elif e.localName == "a":
|
||||
href, title = parseAnchor(e)
|
||||
lastadded = title, href
|
||||
result.append((title, href, None))
|
||||
return result
|
||||
|
||||
def parseManualTOC(filename):
|
||||
"""Reads the manual's Main_Page file and returns a list of all the trees found."""
|
||||
filename = open(filename)
|
||||
text = filename.read()
|
||||
filename.close()
|
||||
text = text.split("<h2>Table of Contents</h2>")[1].split("</td>")[0]
|
||||
text = "<root>" + text.replace("<li>", "") + "</root>"
|
||||
text = re.sub(re.compile("<!--([^>]+)>"), "", text)
|
||||
result = []
|
||||
for e in xml.dom.minidom.parseString(text).childNodes[0].childNodes:
|
||||
if e.nodeType == Node.ELEMENT_NODE:
|
||||
result.append(parseManualTree(e))
|
||||
return result
|
||||
|
||||
def treeToHTML(tree, dirname, indent = ""):
|
||||
"""Converts a tree into HTML code suitable for .hhc or .hhk files. The tree should be like:
|
||||
[(title, href, [(title, href, [...]), ...]), ...]"""
|
||||
html = ""
|
||||
for title, href, sub in tree:
|
||||
html += indent + "<li><object type=\"text/sitemap\">\n"
|
||||
html += indent + " <param name=\"Name\" value=\"%s\">\n" % title.replace("CXX", "C++").replace("\"", """)
|
||||
html += indent + " <param name=\"Local\" value=\"%s\">\n" % urldecode(os.path.join(dirname, href))
|
||||
html += indent + "</object>\n"
|
||||
if sub != None:
|
||||
html += indent + "<ul>\n"
|
||||
html += treeToHTML(sub, dirname, indent + " ")
|
||||
html += indent + "</ul>\n"
|
||||
return html
|
||||
|
||||
def makeCHM(outputfile, dirname, title, special = None):
|
||||
"""Creates a CHM file based on a directory of HTML files. See the top of this file for more info."""
|
||||
assert special == None or special in ["manual", "reference"]
|
||||
reference = (special == "reference")
|
||||
manual = (special == "manual")
|
||||
base = ireplace(outputfile, ".chm", "")
|
||||
if os.path.isfile(base + ".chm"): os.remove(base + ".chm")
|
||||
# Create the hhp file
|
||||
hhp = open(base + ".hhp", "w")
|
||||
hhp.write("[OPTIONS]\n")
|
||||
hhp.write(OPTIONBLOCK % (base + ".chm", base, urldecode(os.path.join(dirname, "index.html")), base, title))
|
||||
hhp.write("\n[FILES]\n")
|
||||
# Create the TOC file and Index file
|
||||
hhk = open(base + ".hhk", "w")
|
||||
hhc = open(base + ".hhc", "w")
|
||||
hhk.write(HTMLBLOCK)
|
||||
hhc.write(HTMLBLOCK)
|
||||
# The manual should be treated as a special case.
|
||||
if manual:
|
||||
hhc.write(" <li><object type=\"text/sitemap\">\n")
|
||||
hhc.write(" <param name=\"Name\" value=\"Main Page\">\n")
|
||||
hhc.write(" <param name=\"Local\" value=\"%s\">\n" % urldecode(os.path.join(dirname, "index.html")))
|
||||
hhc.write(" </object>\n")
|
||||
for item in parseManualTOC("manual/index.html"):
|
||||
hhc.write(treeToHTML(item, dirname, " "))
|
||||
for i in os.listdir(dirname):
|
||||
hhp.write(os.path.join(dirname, i) + "\n")
|
||||
if i != "index.html":
|
||||
hhk.write(" <li><object type=\"text/sitemap\">\n")
|
||||
hhk.write(" <param name=\"Name\" value=\"%s\">\n" % ireplace(urldecode(i).replace(".1", "").replace("_", " ").replace("CXX", "C++"), ".html", "").replace("\"", """))
|
||||
hhk.write(" <param name=\"Local\" value=\"%s\">\n" % urldecode(os.path.join(dirname, i)))
|
||||
hhk.write(" </object>\n")
|
||||
else:
|
||||
idt = " "
|
||||
# If we are writing out the reference, write some extra stuff.
|
||||
if reference:
|
||||
idt = " "
|
||||
for i, desc in REFERENCEITEMS:
|
||||
hhk.write(" <li><object type=\"text/sitemap\">\n")
|
||||
hhk.write(" <param name=\"Name\" value=\"%s\">\n" % desc.replace("\"", """))
|
||||
hhk.write(" <param name=\"Local\" value=\"%s\">\n" % urldecode(os.path.join(dirname, i)))
|
||||
hhk.write(" </object>\n")
|
||||
hhc.write(" <li><object type=\"text/sitemap\">\n")
|
||||
hhc.write(" <param name=\"Name\" value=\"%s\">\n" % desc.replace("\"", """))
|
||||
hhc.write(" <param name=\"Local\" value=\"%s\">\n" % urldecode(os.path.join(dirname, i)))
|
||||
hhc.write(" </object>\n")
|
||||
hhc.write(" <ul>\n")
|
||||
# Loop through the directories and write out relevant data.
|
||||
for i in os.listdir(dirname):
|
||||
hhp.write(os.path.join(dirname, i) + "\n")
|
||||
if i != "index.html" and ((not reference) or (not i in ["classes.html", "methods.html", "functions.html"])):
|
||||
hhk.write(" <li><object type=\"text/sitemap\">\n")
|
||||
hhk.write(" <param name=\"Name\" value=\"%s\">\n" % ireplace(urldecode(i).replace(".1", ""), ".html", "").replace("\"", """))
|
||||
hhk.write(" <param name=\"Local\" value=\"%s\">\n" % urldecode(os.path.join(dirname, i)))
|
||||
hhk.write(" </object>\n")
|
||||
hhc.write(idt + "<li><object type=\"text/sitemap\">\n")
|
||||
hhc.write(idt + " <param name=\"Name\" value=\"%s\">\n" % ireplace(urldecode(i).replace(".1", ""), ".html", "").replace("\"", """))
|
||||
hhc.write(idt + " <param name=\"Local\" value=\"%s\">\n" % urldecode(os.path.join(dirname, i)))
|
||||
hhc.write(idt + "</object>\n")
|
||||
# Close the files.
|
||||
if reference: hhc.write(" </ul>\n")
|
||||
hhk.write(" </ul>\n </body>\n</html>")
|
||||
hhc.write(" </ul>\n </body>\n</html>")
|
||||
hhk.close()
|
||||
hhc.close()
|
||||
hhp.close()
|
||||
# Now, execute the command to compile the files.
|
||||
if os.path.isdir("C:\Program Files\HTML Help Workshop"):
|
||||
cmd = "\"C:\Program Files\HTML Help Workshop\hhc.exe\" %s.hhp" % base
|
||||
else:
|
||||
cmd = "hhc \"%s.hhp\"" % base
|
||||
print cmd
|
||||
os.system(cmd)
|
||||
if not KEEPTEMP:
|
||||
if os.path.isfile("%s.hhp" % base): os.remove("%s.hhp" % base)
|
||||
if os.path.isfile("%s.hhc" % base): os.remove("%s.hhc" % base)
|
||||
if os.path.isfile("%s.hhk" % base): os.remove("%s.hhk" % base)
|
||||
if os.path.isfile("%s.chw" % base): os.remove("%s.chw" % base)
|
||||
if not os.path.isfile(base + ".chm"):
|
||||
print "An error has occurred!"
|
||||
if __name__ == "__main__":
|
||||
exit(1)
|
||||
else:
|
||||
return False
|
||||
if __name__ != "__main__":
|
||||
return True
|
||||
|
||||
def makeManualCHM(outputfile, dirname, title):
|
||||
"""Same as makeCHM, but suitable for converting the Panda3D manual."""
|
||||
return makeCHM(outputfile, dirname, title, special = "manual")
|
||||
|
||||
def makeReferenceCHM(outputfile, dirname, title):
|
||||
"""Same as makeCHM, but converts a structure resembling that of the Panda3D reference."""
|
||||
return makeCHM(outputfile, dirname, title, special = "reference")
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Extract a version number, if we have one.
|
||||
VERSION = None
|
||||
try:
|
||||
f = file("built/include/pandaVersion.h","r")
|
||||
pattern = re.compile('^\s*[#]\s*define\s+PANDA_VERSION_STR\s+["]([0-9.]+)["]')
|
||||
for line in f:
|
||||
match = pattern.match(line,0)
|
||||
if (match):
|
||||
VERSION = match.group(1)
|
||||
break
|
||||
f.close()
|
||||
except:
|
||||
# If not, we don't care at all.
|
||||
pass
|
||||
|
||||
# Now, make CHM's for both the manual and reference, if we have them.
|
||||
if not os.path.isdir("manual"):
|
||||
print "No directory named 'manual' found"
|
||||
else:
|
||||
print "Making CHM file for manual..."
|
||||
if VERSION == None:
|
||||
makeManualCHM("manual.chm", "manual", "Panda3D Manual")
|
||||
else:
|
||||
makeManualCHM("manual-%s.chm" % VERSION, "manual", "Panda3D %s Manual" % VERSION)
|
||||
|
||||
if not os.path.isdir("reference"):
|
||||
print "No directory named 'reference' found"
|
||||
else:
|
||||
print "Making CHM file for API reference..."
|
||||
if VERSION == None:
|
||||
makeReferenceCHM("reference.chm", "reference", "Panda3D Reference")
|
||||
else:
|
||||
makeReferenceCHM("reference-%s.chm" % VERSION, "reference", "Panda3D %s Reference" % VERSION)
|
||||
|
||||
print "Done!"
|
||||
|
26
makepanda/makedocs.bat
Normal file
26
makepanda/makedocs.bat
Normal file
@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Verify that we can find the 'makedocs' python script
|
||||
REM and the python interpreter. If we can find both, then
|
||||
REM run 'makedocs'.
|
||||
REM
|
||||
|
||||
if not exist makepanda\makedocs.py goto :missing1
|
||||
if not exist thirdparty\win-python\python.exe goto :missing2
|
||||
thirdparty\win-python\python.exe makepanda\makedocs.py %*
|
||||
goto done
|
||||
|
||||
:missing1
|
||||
echo You need to change directory to the root of the panda source tree
|
||||
echo before invoking makedocs.
|
||||
goto done
|
||||
|
||||
:missing2
|
||||
echo You seem to be missing the 'thirdparty' directory. You probably checked
|
||||
echo the source code out from sourceforge. The sourceforge repository is
|
||||
echo missing the 'thirdparty' directory. You will need to supplement the
|
||||
echo code by downloading the 'thirdparty' directory from panda3d.etc.cmu.edu
|
||||
goto done
|
||||
|
||||
:done
|
77
makepanda/makedocs.py
Normal file
77
makepanda/makedocs.py
Normal file
@ -0,0 +1,77 @@
|
||||
########################################################################
|
||||
##
|
||||
## Win32 Usage: makepanda\makedocs.bat
|
||||
## Linux Usage: makepanda/makedocs.py
|
||||
##
|
||||
########################################################################
|
||||
|
||||
import sys,os,re
|
||||
sys.path = ["direct/src/directscripts"] + sys.path
|
||||
import gendocs
|
||||
|
||||
########################################################################
|
||||
##
|
||||
## Some handy utility functions.
|
||||
##
|
||||
########################################################################
|
||||
|
||||
def MakeDirectory(path):
|
||||
if os.path.isdir(path): return 0
|
||||
os.mkdir(path)
|
||||
|
||||
########################################################################
|
||||
##
|
||||
## Read the version number from built/include/pandaVersion.h
|
||||
##
|
||||
########################################################################
|
||||
|
||||
VERSION="0.0.0"
|
||||
try:
|
||||
f = file("built/include/pandaVersion.h","r")
|
||||
pattern = re.compile('^\s*[#]\s*define\s+PANDA_VERSION_STR\s+["]([0-9.]+)["]')
|
||||
for line in f:
|
||||
match = pattern.match(line,0)
|
||||
if (match):
|
||||
VERSION = match.group(1)
|
||||
break
|
||||
f.close()
|
||||
except: sys.exit("Cannot read version number from built/include/pandaVersion.h")
|
||||
|
||||
print "Generating docs for "+VERSION
|
||||
|
||||
########################################################################
|
||||
##
|
||||
## Make sure panda has been built.
|
||||
##
|
||||
########################################################################
|
||||
|
||||
if (os.path.isfile("built/pandac/input/libpgraph.in")==0) or (os.path.isfile("built/pandac/input/libputil.in")==0):
|
||||
sys.exit("Cannot read the interrogate-output files in built/pandac/input")
|
||||
|
||||
########################################################################
|
||||
##
|
||||
## Generate the PHP version.
|
||||
##
|
||||
## The manual is in the form of a bunch of HTML files that can be
|
||||
## included by a PHP script called "/apiref.php".
|
||||
##
|
||||
########################################################################
|
||||
|
||||
MakeDirectory("referphp")
|
||||
gendocs.generate(VERSION, "built/pandac/input", "direct", "referphp", "", "", "/apiref.php?page=", "")
|
||||
|
||||
########################################################################
|
||||
##
|
||||
## Generate the HTML version.
|
||||
##
|
||||
## The manual is in the form of a bunch of standalone HTML files
|
||||
## that contain links to each other.
|
||||
##
|
||||
########################################################################
|
||||
|
||||
HEADER = "<html><head></head><body>\n"
|
||||
FOOTER = "</body></html>\n"
|
||||
|
||||
MakeDirectory("reference")
|
||||
gendocs.generate(VERSION, "built/pandac/input", "direct", "reference", HEADER, FOOTER, "", ".html")
|
||||
|
28
makepanda/makepanda.bat
Executable file
28
makepanda/makepanda.bat
Executable file
@ -0,0 +1,28 @@
|
||||
@echo off
|
||||
|
||||
REM
|
||||
REM Verify that we can find the 'makepanda' python script
|
||||
REM and the python interpreter. If we can find both, then
|
||||
REM run 'makepanda'.
|
||||
REM
|
||||
|
||||
if not exist makepanda\makepanda.py goto :missing1
|
||||
if not exist thirdparty\win-python\python.exe goto :missing2
|
||||
thirdparty\win-python\python.exe makepanda\makepanda.py %*
|
||||
if errorlevel 1 if x%1 == x--slavebuild exit 1
|
||||
goto done
|
||||
|
||||
:missing1
|
||||
echo You need to change directory to the root of the panda source tree
|
||||
echo before invoking makepanda. For further install instructions, read
|
||||
echo the installation instructions in the file doc/INSTALL-MK.
|
||||
goto done
|
||||
|
||||
:missing2
|
||||
echo You seem to be missing the 'thirdparty' directory. You probably checked
|
||||
echo the source code out from sourceforge. The sourceforge repository is
|
||||
echo missing the 'thirdparty' directory. You will need to supplement the
|
||||
echo code by downloading the 'thirdparty' directory from panda3d.etc.cmu.edu
|
||||
goto done
|
||||
|
||||
:done
|
3839
makepanda/makepanda.py
Executable file
3839
makepanda/makepanda.py
Executable file
File diff suppressed because it is too large
Load Diff
20
makepanda/makepanda.sln
Executable file
20
makepanda/makepanda.sln
Executable file
@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "makepanda", "makepanda.vcproj", "{F4935D7A-20AD-4132-B3CB-ADFF4F928D25}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F4935D7A-20AD-4132-B3CB-ADFF4F928D25}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F4935D7A-20AD-4132-B3CB-ADFF4F928D25}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F4935D7A-20AD-4132-B3CB-ADFF4F928D25}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F4935D7A-20AD-4132-B3CB-ADFF4F928D25}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
5061
makepanda/makepanda.vcproj
Executable file
5061
makepanda/makepanda.vcproj
Executable file
File diff suppressed because it is too large
Load Diff
1220
makepanda/makepandacore.py
Normal file
1220
makepanda/makepandacore.py
Normal file
File diff suppressed because it is too large
Load Diff
4798
makepanda/otherMakePanda.py
Executable file
4798
makepanda/otherMakePanda.py
Executable file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user