diff --git a/direct/metalibs/direct/Sources.pp b/direct/metalibs/direct/Sources.pp index fce6fee912..dbbef8307f 100644 --- a/direct/metalibs/direct/Sources.pp +++ b/direct/metalibs/direct/Sources.pp @@ -18,7 +18,7 @@ express:c pstatclient:c prc:c pandabase:c linmath:c \ putil:c display:c event:c pgraph:c gsgbase:c gobj:c mathutil:c \ lerp:c downloader:c pnmimage:c chan:c \ - pipeline:c cull:c + pipeline:c cull:c $[if $[HAVE_NET],net:c] #begin metalib_target #define TARGET direct diff --git a/direct/src/dcparse/Sources.pp b/direct/src/dcparse/Sources.pp index 224107a389..2e5cf1277c 100644 --- a/direct/src/dcparse/Sources.pp +++ b/direct/src/dcparse/Sources.pp @@ -4,9 +4,9 @@ express:c pandaexpress:m \ interrogatedb:c dconfig:c dtoolconfig:m \ dtoolutil:c dtoolbase:c dtool:m \ - pystub \ prc:c pstatclient:c pandabase:c linmath:c putil:c \ - pipeline:c + pipeline:c $[if $[HAVE_NET],net:c] \ + pystub #define C++FLAGS -DWITHIN_PANDA diff --git a/direct/src/dcparser/Sources.pp b/direct/src/dcparser/Sources.pp index f47d5de818..c7352d4a5b 100644 --- a/direct/src/dcparser/Sources.pp +++ b/direct/src/dcparser/Sources.pp @@ -3,7 +3,7 @@ pstatclient:c pipeline:c panda:m \ interrogatedb:c dconfig:c dtoolconfig:m \ dtoolutil:c dtoolbase:c dtool:m prc:c pandabase:c \ - linmath:c putil:c + linmath:c putil:c $[if $[HAVE_NET],net:c] #define LOCAL_LIBS \ directbase diff --git a/direct/src/directd/Sources.pp b/direct/src/directd/Sources.pp index 40afa34b02..8f78358a3d 100644 --- a/direct/src/directd/Sources.pp +++ b/direct/src/directd/Sources.pp @@ -6,7 +6,7 @@ #define LOCAL_LIBS \ directbase #define OTHER_LIBS \ - net:c linmath:c putil:c express:c panda:m pandaexpress:m dtoolconfig dtool + $[if $[HAVE_NET],net:c] linmath:c putil:c express:c panda:m pandaexpress:m dtoolconfig dtool #define WIN_SYS_LIBS $[WIN_SYS_LIBS] user32.lib //advapi32.lib #begin lib_target diff --git a/direct/src/directdServer/Sources.pp b/direct/src/directdServer/Sources.pp index 03247777a1..0bc33598d7 100644 --- a/direct/src/directdServer/Sources.pp +++ b/direct/src/directdServer/Sources.pp @@ -6,7 +6,7 @@ //#define LOCAL_LIBS \ // directbase #define OTHER_LIBS \ - net:c linmath:c putil:c express:c panda:m pandaexpress:m dtoolconfig dtool + $[if $[HAVE_NET],net:c] linmath:c putil:c express:c panda:m pandaexpress:m dtoolconfig dtool #define WIN_SYS_LIBS $[WIN_SYS_LIBS] user32.lib //advapi32.lib #begin bin_target diff --git a/direct/src/distributed/Sources.pp b/direct/src/distributed/Sources.pp index 3a130d6729..d6a35f927b 100644 --- a/direct/src/distributed/Sources.pp +++ b/direct/src/distributed/Sources.pp @@ -12,10 +12,7 @@ interrogatedb:c dconfig:c dtoolconfig:m \ dtoolutil:c dtoolbase:c dtool:m \ prc:c pstatclient:c pandabase:c linmath:c putil:c \ - pipeline:c - #if $[and $[HAVE_NET],$[HAVE_NSPR]] \ - #define OTHER_LIBS net:c $[OTHER_LIBS] - #endif + pipeline:c $[if $[HAVE_NET],net:c] #define SOURCES \ config_distributed.cxx config_distributed.h \ diff --git a/direct/src/ffi/genPyCode.pp b/direct/src/ffi/genPyCode.pp index 3d8a5cd79f..a3120392a1 100644 --- a/direct/src/ffi/genPyCode.pp +++ b/direct/src/ffi/genPyCode.pp @@ -149,6 +149,7 @@ DoGenPyCode.extensionsDir = os.path.join(directDir, 'src', '$[extensions_name]') DoGenPyCode.etcPath = [] DoGenPyCode.pythonSourcePath = [] +#if $[CTA_GENERIC_GENPYCODE] # Look for additional packages (other than the basic three) # that the user might be dynamically attached to. packages = [] @@ -204,6 +205,7 @@ for package in packages: if isModule: if basename not in DoGenPyCode.codeLibs: DoGenPyCode.codeLibs.append(basename) +#endif // CTA_GENERIC_GENPYCODE #endif // CTPROJS DoGenPyCode.run() diff --git a/direct/src/interval/Sources.pp b/direct/src/interval/Sources.pp index 57d1810a5c..af61e0e79e 100644 --- a/direct/src/interval/Sources.pp +++ b/direct/src/interval/Sources.pp @@ -9,7 +9,7 @@ interrogatedb:c dconfig:c dtoolconfig:m \ dtoolutil:c dtoolbase:c dtool:m \ pandabase:c prc:c gsgbase:c pstatclient:c \ - pipeline:c + pipeline:c $[if $[HAVE_NET],net:c] #define SOURCES \ config_interval.cxx config_interval.h \ diff --git a/direct/src/showbase/Sources.pp b/direct/src/showbase/Sources.pp index c02a9a01d3..ee8ca71a48 100644 --- a/direct/src/showbase/Sources.pp +++ b/direct/src/showbase/Sources.pp @@ -9,7 +9,7 @@ dtoolutil:c dtoolbase:c dtool:m \ pgraph:c gsgbase:c gobj:c mathutil:c pstatclient:c \ lerp:c downloader:c pandabase:c pnmimage:c prc:c \ - pipeline:c cull:c + pipeline:c cull:c $[if $[HAVE_NET],net:c] #define SOURCES \ showBase.cxx showBase.h diff --git a/dtool/Config.osxppc.pp b/dtool/Config.OSX.pp similarity index 77% rename from dtool/Config.osxppc.pp rename to dtool/Config.OSX.pp index f8a4457cf4..90deb1fba2 100644 --- a/dtool/Config.osxppc.pp +++ b/dtool/Config.OSX.pp @@ -1,5 +1,5 @@ // -// Config.osx.pp +// Config.OSX.pp // // This file defines some custom config variables for the osx // platform. It makes some initial guesses about compiler features, @@ -19,67 +19,14 @@ // to a subsequent version of Panda. // ******************************************************************* -print $[PLATFORM] - -#define PYTHON_IPATH /Library/Frameworks/Python.framework/Headers - -#define HAVE_PYTHON 1 -#define PYTHON_FRAMEWORK Python - // What additional flags should we pass to interrogate? #define SYSTEM_IGATE_FLAGS -D__FLT_EVAL_METHOD__=0 -D__i386__ -D__const=const -Dvolatile -D__LITTLE_ENDIAN__ -D__inline__=inline -D__GNUC__ #define HAVE_GL 1 #define IS_OSX 1 -//#define ZLIB_IPATH /usr/include -//#define ZLIB_LPATH /usr/lib/ -//#define ZLIB_LIBS libz.dylib - -#define HAVE_ZLIB 1 -#define HAVE_JPEG 1 -#define HAVE_FREETYPE 1 -#print Before Configure Miles -//#define HAVE_RAD_MSS 1 -//#define RAD_MSS_IPATH /Users/roger/Documents/M/include -//#define RAD_MSS_LPATH /Users/roger/Documents/M/redist/macho/ -//#define RAD_MSS_LIBS MilesMachO -//#define rad_mss_ipath $[RAD_MSS_IPATH] -//#define rad_mss_lpath $[RAD_MSS_LPATH] -//#define rad_mss_libs $[RAD_MSS_LIBS] - - -//#print -- $[RAD_MSS_IPATH] -//#print --- $[RAD_MSS_LPATH] -//#print ----$[RAD_MSS_LIBS] - - -//#print ---$[rad_mss_ipath] -//#print ---$[rad_mss_lpath] -//#print ---$[rad_mss_libs] - - - -#define PNG_IPATH /opt/local/include -#define PNG_LPATH /opt/local/lib -#define PNG_LIBS png -//#define HAVE_PNG 1 - - -#define HAVE_OPENSSL 1 - -// Is libfftw installed, and where? -#define FFTW_IPATH /opt/local/include -#define FFTW_LPATH /opt/local/lib -#define FFTW_LIBS drfftw dfftw -//#define HAVE_FFTW 1 - - -#define TIFF_IPATH /opt/local/include -#define TIFF_LPATH /opt/local/lib - -// Is the platform big-endian (like an SGI workstation) or -// little-endian (like a PC)? Define this to the empty string to -// indicate little-endian, or nonempty to indicate big-endian. +// We don't need worry about defining WORDS_BIGENDIAN (and we +// shouldn't anyway, since ppc and intel are different). We rely on +// dtoolbase.h to determine this at compilation time. #define WORDS_BIGENDIAN // Does the C++ compiler support namespaces? @@ -167,7 +114,7 @@ print $[PLATFORM] #define HAVE_IO_H // Do we have ? -#define HAVE_MALLOC_H 1 +#define HAVE_MALLOC_H // Do we have ? #define HAVE_ALLOCA_H 1 diff --git a/dtool/Config.osxintel.pp b/dtool/Config.osxintel.pp deleted file mode 100644 index 666bb88869..0000000000 --- a/dtool/Config.osxintel.pp +++ /dev/null @@ -1,214 +0,0 @@ -// -// Config.osx.pp -// -// This file defines some custom config variables for the osx -// platform. It makes some initial guesses about compiler features, -// etc. -// - -// ******************************************************************* -// NOTE: you should not attempt to copy this file verbatim as your own -// personal Config.pp file. Instead, you should start with an empty -// Config.pp file, and add lines to it when you wish to override -// settings given in here. In the normal ppremake system, this file -// will always be read first, and then your personal Config.pp file -// will be read later, which gives you a chance to override the -// default settings found in this file. However, if you start by -// copying the entire file, it will be difficult to tell which -// settings you have customized, and it will be difficult to upgrade -// to a subsequent version of Panda. -// ******************************************************************* - - -//#define PYTHON_IPATH /Library/Frameworks/Python.framework/Headers -//#define PYTHON_LPATH /Library/Frameworks/Python.framework/Headers - -#define PYTHON_IPATH /Library/Frameworks/Python.framework/Headers -#define HAVE_PYTHON 1 -#define PYTHON_FRAMEWORK Python - -// What additional flags should we pass to interrogate? -#define SYSTEM_IGATE_FLAGS -D__FLT_EVAL_METHOD__=0 -D__i386__ -D__const=const -Dvolatile -D__LITTLE_ENDIAN__ -D__inline__=inline -D__GNUC__ -#define HAVE_GL 1 -#define IS_OSX 1 - -//#define ZLIB_IPATH /usr/include -//#define ZLIB_LPATH /usr/lib/ -//#define ZLIB_LIBS libz.dylib - -//#define HAVE_ZLIB 1 -//#define HAVE_JPEG 1 -//#define HAVE_FREETYPE 1 -#print Before Configure Miles -#define HAVE_RAD_MSS 1 -#define RAD_MSS_IPATH /Users/roger/m/include -#define RAD_MSS_LPATH /Users/roger/m/redist/macx86 -#define RAD_MSS_LIBS MilesMachOx86 -#define rad_mss_ipath $[RAD_MSS_IPATH] -#define rad_mss_lpath $[RAD_MSS_LPATH] -#define rad_mss_libs $[RAD_MSS_LIBS] - - -//#print -- $[RAD_MSS_IPATH] -//#print --- $[RAD_MSS_LPATH] -//#print ----$[RAD_MSS_LIBS] - - -//#print ---$[rad_mss_ipath] -//#print ---$[rad_mss_lpath] -//#print ---$[rad_mss_libs] - - - -#define PNG_IPATH /opt/local/include -#define PNG_LPATH /opt/local/lib -#define PNG_LIBS png -//#define HAVE_PNG 1 - - -#define HAVE_OPENSSL 1 - -// Is libfftw installed, and where? -#define FFTW_IPATH /opt/local/include -#define FFTW_LPATH /opt/local/lib -#define FFTW_LIBS rfftw fftw -//#define HAVE_FFTW 1 - - -#define TIFF_IPATH /opt/local/include -#define TIFF_LPATH /opt/local/lib - -// Is the platform big-endian (like an SGI workstation) or -// little-endian (like a PC)? Define this to the empty string to -// indicate little-endian, or nonempty to indicate big-endian. -#define WORDS_BIGENDIAN - -// Does the C++ compiler support namespaces? -#define HAVE_NAMESPACE 1 - -// Does the C++ compiler support ios::binary? -#define HAVE_IOS_BINARY 1 - -// How about the typename keyword? -#define HAVE_TYPENAME 1 - -// Will the compiler avoid inserting extra bytes in structs between a -// base struct and its derived structs? It is safe to define this -// false if you don't know, but if you know that you can get away with -// this you may gain a tiny performance gain by defining this true. -// If you define this true incorrectly, you will get lots of -// assertion failures on execution. -#define SIMPLE_STRUCT_POINTERS - -// Do we have a gettimeofday() function? -#define HAVE_GETTIMEOFDAY 1 - -// Does gettimeofday() take only one parameter? -#define GETTIMEOFDAY_ONE_PARAM - -// Do we have getopt() and/or getopt_long_only() built into the -// system? -#define HAVE_GETOPT 1 -#define HAVE_GETOPT_LONG_ONLY - -// Are the above getopt() functions defined in getopt.h, or somewhere else? -#define HAVE_GETOPT_H 1 - -// Can we determine the terminal width by making an ioctl(TIOCGWINSZ) call? -#define IOCTL_TERMINAL_WIDTH 1 - -// Do the system headers define a "streamsize" typedef? How about the -// ios::binary enumerated value? And other ios typedef symbols like -// ios::openmode and ios::fmtflags? -#define HAVE_STREAMSIZE 1 -#define HAVE_IOS_BINARY 1 -#define HAVE_IOS_TYPEDEFS 1 - -// Can we safely call getenv() at static init time? -#define STATIC_INIT_GETENV 1 - -// Can we read the file /proc/self/environ to determine our -// environment variables at static init time? -#define HAVE_PROC_SELF_ENVIRON 1 - -// Do we have a global pair of argc/argv variables that we can read at -// static init time? Should we prototype them? What are they called? -#define HAVE_GLOBAL_ARGV -#define PROTOTYPE_GLOBAL_ARGV -#define GLOBAL_ARGV __Argv -#define GLOBAL_ARGC __Argc - -// Can we read the file /proc/self/cmdline to determine our -// command-line arguments at static init time? -#define HAVE_PROC_SELF_CMDLINE - -// Should we include or ? Define HAVE_IOSTREAM -// to nonempty if we should use , or empty if we should use -// . -#define HAVE_IOSTREAM 1 - -// Do we have a true stringstream class defined in ? -#define HAVE_SSTREAM 1 - -// Does fstream::open() require a third parameter, specifying the -// umask? Versions of gcc prior to 3.2 had this. -#define HAVE_OPEN_MASK - -// Do the compiler or system libraries define wchar_t for you? -#define HAVE_WCHAR_T 1 - -// Does define the typedef wstring? Most do, but for some -// reason, versions of gcc before 3.0 didn't do this. -#define HAVE_WSTRING 1 - -// Do we have ? -#define HAVE_NEW 1 - -// Do we have ? -#define HAVE_IO_H - -// Do we have ? -#define HAVE_MALLOC_H - -// Do we have ? -#define HAVE_ALLOCA_H 1 - -// Do we have ? -#define HAVE_LOCALE_H 1 - -// Do we have ? -#define HAVE_MINMAX_H - -// Do we have ? -#define HAVE_SYS_TYPES_H 1 -#define HAVE_SYS_TIME_H 1 - -// Do we have ? -#define HAVE_UNISTD_H 1 - -// Do we have ? -#define HAVE_UTIME_H 1 - -// Do we have ? -#define HAVE_DIRENT_H 1 - -// Do we have (and do we want to use it instead of dirent.h)? -#define HAVE_GLOB_H 1 - -// Do we have (and presumably a Linux-style audio -// interface)? -#define HAVE_SYS_SOUNDCARD_H 1 - -// Do we have RTTI (and )? -#define HAVE_RTTI 1 - -// Must global operator new and delete functions throw exceptions? -#define GLOBAL_OPERATOR_NEW_EXCEPTIONS 1 - -// Modern versions of gcc do support the latest STL allocator -// definitions. -#define USE_STL_ALLOCATOR 1 - -// The dynamic library file extension (usually .so .dll or .dylib): -#define DYNAMIC_LIB_EXT .dylib -#define BUNDLE_EXT .so diff --git a/dtool/Config.pp b/dtool/Config.pp index 3982df1737..bb5634d1ee 100644 --- a/dtool/Config.pp +++ b/dtool/Config.pp @@ -876,12 +876,8 @@ #define CXX CC #endif -#if $[and $[OSX_PLATFORM],$[UNIVERSAL_BINARIES]] - // Configure for universal binaries on OSX. - #define ARCH_FLAGS -arch i386 -arch ppc -#else - #define ARCH_FLAGS -#endif +// Configure for universal binaries on OSX. +#defer ARCH_FLAGS $[if $[and $[OSX_PLATFORM],$[UNIVERSAL_BINARIES]],-arch i386 -arch ppc,] // How to compile a C or C++ file into a .o file. $[target] is the // name of the .o file, $[source] is the name of the source file, diff --git a/dtool/Package.pp b/dtool/Package.pp index 77bdab272a..7b562f85e9 100644 --- a/dtool/Package.pp +++ b/dtool/Package.pp @@ -63,7 +63,7 @@ #define WINDOWS_PLATFORM $[or $[eq $[PLATFORM],Win32],$[eq $[PLATFORM],Cygwin]] // True if we are building on some flavor of OS X. -#define OSX_PLATFORM $[or $[eq $[PLATFORM],Darwin],$[eq $[PLATFORM],osxppc],$[eq $[PLATFORM],osxintel]] +#define OSX_PLATFORM $[eq $[PLATFORM],OSX] // True if we are building on some flavor of Unix. #define UNIX_PLATFORM $[and $[not $[WINDOWS_PLATFORM]],$[not $[OSX_PLATFORM]]] diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index ba7281d365..4eed401bf9 100644 --- a/dtool/pptempl/Global.pp +++ b/dtool/pptempl/Global.pp @@ -102,6 +102,7 @@ #define nspr_lpath $[wildcard $[NSPR_LPATH]] #define nspr_cflags $[NSPR_CFLAGS] #define nspr_libs $[NSPR_LIBS] + #define nspr_framework $[NSPR_FRAMEWORK] #endif #if $[HAVE_OPENSSL] @@ -278,6 +279,7 @@ #define freetype_lpath $[wildcard $[FREETYPE_LPATH]] #define freetype_cflags $[FREETYPE_CFLAGS] #define freetype_libs $[FREETYPE_LIBS] + #define freetype_framework $[FREETYPE_FRAMEWORK] #endif #if $[and $[HAVE_MAYA],$[MAYA_LOCATION]] diff --git a/panda/src/audio/config_audio.cxx b/panda/src/audio/config_audio.cxx index fb6bbf0e37..86ec631f89 100644 --- a/panda/src/audio/config_audio.cxx +++ b/panda/src/audio/config_audio.cxx @@ -64,7 +64,7 @@ ConfigVariableBool fmod_use_surround_sound // Config variables for Miles: ConfigVariableBool audio_software_midi -("audio-software-midi", false); +("audio-software-midi", true); ConfigVariableFilename audio_dls_file ("audio-dls-file", ""); diff --git a/panda/src/audiotraits/milesAudioManager.cxx b/panda/src/audiotraits/milesAudioManager.cxx index a1eae1a4fc..a485a2fbe0 100644 --- a/panda/src/audiotraits/milesAudioManager.cxx +++ b/panda/src/audiotraits/milesAudioManager.cxx @@ -78,21 +78,15 @@ MilesAudioManager() { S32 use_MIDI=(audio_play_midi)?1:0; if (audio_play_midi && audio_software_midi) { use_MIDI=AIL_QUICK_DLS_ONLY; - } -#ifdef IS_OSX -use_MIDI=AIL_QUICK_DLS_ONLY; -audio_software_midi=true; -#endif - audio_debug(" use_digital="<get(); - while (!_decompress->eof() && !_decompress->fail()) { - _dest->put(ch); - if (++count >= decompressor_buffer_size) { + + TrueClock *clock = TrueClock::get_global_ptr(); + double now = clock->get_short_time(); + double finish = now + decompressor_step_time; + + static const size_t buffer_size = 1024; + char buffer[buffer_size]; + + _decompress->read(buffer, buffer_size); + size_t count = _decompress->gcount(); + while (count != 0) { + _dest->write(buffer, count); + + now = clock->get_short_time(); + if (now >= finish) { // That's enough for now. return EU_ok; } - ch = _decompress->get(); + _decompress->read(buffer, buffer_size); + count = _decompress->gcount(); } // All done! diff --git a/panda/src/downloader/extractor.cxx b/panda/src/downloader/extractor.cxx index 7df53b3609..0026810770 100644 --- a/panda/src/downloader/extractor.cxx +++ b/panda/src/downloader/extractor.cxx @@ -155,69 +155,112 @@ step() { _initiated = true; } - if (_read == (istream *)NULL) { - // Time to open the next subfile. - if (_request_index >= (int)_requests.size()) { - // All done! - reset(); - return EU_success; - } + TrueClock *clock = TrueClock::get_global_ptr(); + double now = clock->get_short_time(); + double finish = now + extractor_step_time; - _subfile_index = _requests[_request_index]; - _subfile_filename = Filename(_extract_dir, - _multifile->get_subfile_name(_subfile_index)); - _subfile_filename.set_binary(); - _subfile_filename.make_dir(); - if (!_subfile_filename.open_write(_write, true)) { - downloader_cat.error() - << "Unable to write to " << _subfile_filename << ".\n"; - reset(); - return EU_error_abort; - } - - _subfile_length = _multifile->get_subfile_length(_subfile_index); - _subfile_pos = 0; - _read = _multifile->open_read_subfile(_subfile_index); + do { if (_read == (istream *)NULL) { - downloader_cat.error() - << "Unable to read subfile " - << _multifile->get_subfile_name(_subfile_index) << ".\n"; - reset(); - return EU_error_abort; - } + // Time to open the next subfile. + if (_request_index >= (int)_requests.size()) { + // All done! + if (downloader_cat.is_debug()) { + downloader_cat.debug() + << "Finished extracting.\n"; + } + reset(); + return EU_success; + } + + _subfile_index = _requests[_request_index]; + _subfile_filename = Filename(_extract_dir, + _multifile->get_subfile_name(_subfile_index)); - } else if (_subfile_pos >= _subfile_length) { - // Time to close this subfile. - delete _read; - _read = (istream *)NULL; - _write.close(); - _request_index++; + if (downloader_cat.is_debug()) { + downloader_cat.debug() + << "Extracting " << _subfile_filename << ".\n"; + } - } else { - // Read a number of bytes from the subfile and write them to the - // output. - size_t max_bytes = min((size_t)extractor_buffer_size, - _subfile_length - _subfile_pos); - for (size_t p = 0; p < max_bytes; p++) { - int byte = _read->get(); - if (_read->eof() || _read->fail()) { + _subfile_filename.set_binary(); + _subfile_filename.make_dir(); + if (!_subfile_filename.open_write(_write, true)) { + downloader_cat.error() + << "Unable to write to " << _subfile_filename << ".\n"; + reset(); + return EU_error_abort; + } + + _subfile_length = _multifile->get_subfile_length(_subfile_index); + _subfile_pos = 0; + _read = _multifile->open_read_subfile(_subfile_index); + if (_read == (istream *)NULL) { + downloader_cat.error() + << "Unable to read subfile " + << _multifile->get_subfile_name(_subfile_index) << ".\n"; + reset(); + return EU_error_abort; + } + + } else if (_subfile_pos >= _subfile_length) { + // Time to close this subfile. + + if (downloader_cat.is_debug()) { + downloader_cat.debug() + << "Finished current subfile.\n"; + } + delete _read; + _read = (istream *)NULL; + _write.close(); + _request_index++; + + } else { + // Read a number of bytes from the subfile and write them to the + // output. + static const size_t buffer_size = 1024; + char buffer[buffer_size]; + + size_t max_bytes = min(buffer_size, _subfile_length - _subfile_pos); + _read->read(buffer, max_bytes); + size_t count = _read->gcount(); + while (count != 0) { + if (downloader_cat.is_spam()) { + downloader_cat.spam() + << " . . . read " << count << " bytes.\n"; + } + _write.write(buffer, count); + if (!_write) { + downloader_cat.error() + << "Error writing to " << _subfile_filename << ".\n"; + reset(); + return EU_error_abort; + } + + _subfile_pos += count; + _total_bytes_extracted += count; + + now = clock->get_short_time(); + if (now >= finish) { + // That's enough for now. + return EU_ok; + } + + max_bytes = min(buffer_size, _subfile_length - _subfile_pos); + _read->read(buffer, max_bytes); + count = _read->gcount(); + } + + if (max_bytes != 0) { downloader_cat.error() << "Unexpected EOF on multifile " << _multifile_name << ".\n"; reset(); return EU_error_abort; } - _write.put(byte); } - if (!_write) { - downloader_cat.error() - << "Error writing to " << _subfile_filename << ".\n"; - reset(); - return EU_error_abort; - } - _subfile_pos += max_bytes; - _total_bytes_extracted += max_bytes; - } + + now = clock->get_short_time(); + } while (now < finish); + // That's enough for now. return EU_ok; } diff --git a/panda/src/mathutil/fftCompressor.cxx b/panda/src/mathutil/fftCompressor.cxx index 43728635e5..19269922a9 100644 --- a/panda/src/mathutil/fftCompressor.cxx +++ b/panda/src/mathutil/fftCompressor.cxx @@ -27,7 +27,6 @@ #ifdef HAVE_FFTW -#ifdef IS_OSX // hack..... // this is a hack to help interigate sort out a macro // in the system poll and select definitions @@ -35,10 +34,7 @@ #ifdef howmany #undef howmany #endif -#include -#else #include -#endif // These FFTW support objects can only be defined if we actually have // the FFTW library available. diff --git a/panda/src/net/Sources.pp b/panda/src/net/Sources.pp index 1714505b58..a59170da4d 100644 --- a/panda/src/net/Sources.pp +++ b/panda/src/net/Sources.pp @@ -1,5 +1,6 @@ -#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \ - dtoolutil:c dtoolbase:c dtool:m +#define OTHER_LIBS \ + interrogatedb:c dconfig:c dtoolconfig:m \ + dtoolutil:c dtoolbase:c prc:c dtool:m #define BUILD_DIRECTORY $[and $[HAVE_NET],$[HAVE_NSPR]] #define USE_PACKAGES net nspr