15 #include "config_express.h"
17 #include "datagramIterator.h"
18 #include "nodeReferenceCount.h"
19 #include "referenceCount.h"
20 #include "textEncoder.h"
21 #include "typedObject.h"
22 #include "typedReferenceCount.h"
23 #include "virtualFile.h"
24 #include "virtualFileComposite.h"
25 #include "virtualFileMount.h"
26 #include "virtualFileMountAndroidAsset.h"
27 #include "virtualFileMountMultifile.h"
28 #include "virtualFileMountRamdisk.h"
29 #include "virtualFileMountSystem.h"
30 #include "virtualFileSimple.h"
31 #include "fileReference.h"
32 #include "temporaryFile.h"
33 #include "pandaSystem.h"
34 #include "numeric_types.h"
36 #include "export_dtool.h"
38 #include "streamWrapper.h"
40 ConfigureDef(config_express);
41 NotifyCategoryDef(express,
"");
42 NotifyCategoryDef(clock,
":express");
44 ConfigureFn(config_express) {
49 (
"patchfile-window-size", 16);
52 (
"patchfile-increment-size", 8);
55 (
"patchfile-buffer-size", 4096);
58 (
"patchfile-zone-size", 10000);
61 (
"keep-temporary-files",
false,
62 PRC_DESC(
"Set this true to keep around the temporary files from "
63 "downloading, decompressing, and patching, or false (the "
64 "default) to delete these. Mainly useful for debugging "
65 "when the process goes wrong."));
68 (
"multifile-always-binary",
false,
69 PRC_DESC(
"This is a temporary transition variable. Set this true "
70 "to enable the old behavior for multifiles: all subfiles are "
71 "always added to and extracted from the multifile in binary mode. "
72 "Set it false to enable the new behavior: subfiles may be added "
73 "or extracted in either binary or text mode, according to the "
74 "set_binary() or set_text() flag on the Filename."));
77 (
"collect-tcp",
false,
78 PRC_DESC(
"Set this true to enable accumulation of several small consecutive "
79 "TCP datagrams into one large datagram before sending it, to reduce "
80 "overhead from the TCP/IP protocol. See "
81 "Connection::set_collect_tcp() or SocketStream::set_collect_tcp()."));
84 (
"collect-tcp-interval", 0.2);
96 static bool initialized =
false;
102 Datagram::init_type();
103 DatagramIterator::init_type();
104 Namable::init_type();
105 NodeReferenceCount::init_type();
106 ReferenceCount::init_type();
108 TypedReferenceCount::init_type();
109 VirtualFile::init_type();
110 VirtualFileComposite::init_type();
111 VirtualFileMount::init_type();
113 VirtualFileMountAndroidAsset::init_type();
115 VirtualFileMountMultifile::init_type();
116 VirtualFileMountRamdisk::init_type();
117 VirtualFileMountSystem::init_type();
118 VirtualFileSimple::init_type();
119 FileReference::init_type();
120 TemporaryFile::init_type();
122 init_system_type_handles();
133 nassertv(
sizeof(PN_int8) == 1 &&
sizeof(PN_uint8) == 1);
134 nassertv(
sizeof(PN_int16) == 2 &&
sizeof(PN_uint16) == 2);
135 nassertv(
sizeof(PN_int32) == 4 &&
sizeof(PN_uint32) == 4);
136 nassertv(
sizeof(PN_int64) == 8 &&
sizeof(PN_uint64) == 8);
137 nassertv(
sizeof(PN_float32) == 4);
138 nassertv(
sizeof(PN_float64) == 8);
142 memcpy(&word,
"\1\2\3\4", 4);
143 #ifdef WORDS_BIGENDIAN
144 nassertv(word == 0x01020304);
146 nassertv(word == 0x04030201);
151 get_use_high_res_clock() {
156 (
"use-high-res-clock",
true,
157 PRC_DESC(
"Set this to false to avoid using the high-precision clock, even if "
158 "it is available."));
161 return *use_high_res_clock;
165 get_paranoid_clock() {
170 (
"paranoid-clock",
false,
171 PRC_DESC(
"Set this to true to double-check the results of the high-resolution "
172 "clock against the system clock."));
175 return *paranoid_clock;
184 (
"verify-dcast",
true,
185 PRC_DESC(
"Set this to true to verify that every attempted DCAST operation in "
186 "fact references the correct type, or false otherwise. This has no "
187 "effect if NDEBUG is defined, in which case it is never tested."));
190 return *verify_dcast;
196 get_config_express() {
198 return config_express;
202 static JavaVM *panda_jvm = NULL;
208 jint JNI_OnLoad(JavaVM *jvm,
void *reserved) {
210 return JNI_VERSION_1_4;
217 JavaVM *get_java_vm() {
218 nassertr(panda_jvm != NULL, NULL);
228 JNIEnv *get_jni_env() {
229 nassertr(panda_jvm != NULL, NULL);
231 int status = panda_jvm->GetEnv((
void**) &env, JNI_VERSION_1_4);
233 if (status < 0 || env == NULL) {
234 express_cat.error() <<
"JVM is not available in this thread!\n";
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
This class is used as a namespace to group several global properties of Panda.
This is a convenience class to specialize ConfigVariable as a boolean type.
This class emulates the old dconfig-style interface to our Panda config system.
void add_system(const string &system)
Intended for use by each subsystem to register itself at startup.
This is a convenience class to specialize ConfigVariable as a floating-point type.
This is a convenience class to specialize ConfigVariable as an integer type.