diff --git a/dtool/Config.pp b/dtool/Config.pp index 9fbaf02885..44336dc91e 100644 --- a/dtool/Config.pp +++ b/dtool/Config.pp @@ -907,7 +907,7 @@ #define TAU_MAKEFILE #define TAU_ROOT #define PDT_ROOT -#define TAU_OPTS -optKeepFiles +#define TAU_OPTS -optKeepFiles -optRevert #define TAU_CFLAGS -D_GNU_SOURCE #define USE_TAU diff --git a/dtool/pptempl/Depends.pp b/dtool/pptempl/Depends.pp index 764d393b5b..6dbb331a60 100644 --- a/dtool/pptempl/Depends.pp +++ b/dtool/pptempl/Depends.pp @@ -84,8 +84,9 @@ #set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I %.T %_src.cxx,$[get_sources]] $[included_sources] // Now compute the source files. - #define c_sources $[filter %.c,$[get_sources]] - #define cxx_sources $[filter-out %_src.cxx,$[filter %.cxx %.mm %.cpp,$[get_sources]]] + #define c_sources $[filter-out %_src.c,$[filter %.c,$[get_sources]]] + #define mm_sources $[filter %.mm,$[get_sources]] + #define cxx_sources $[filter-out %_src.cxx,$[filter %.cxx %.cpp,$[get_sources]]] #define cxx_interrogate_sources #if $[PYTHON_MODULE_ONLY] #set cxx_interrogate_sources $[cxx_sources] @@ -96,7 +97,7 @@ #define lxx_sources $[filter %.lxx,$[get_sources]] // Define what the object files are. - #foreach file $[c_sources] $[cxx_sources] $[cxx_interrogate_sources] $[yxx_sources] $[lxx_sources] + #foreach file $[c_sources] $[mm_sources] $[cxx_sources] $[cxx_interrogate_sources] $[yxx_sources] $[lxx_sources] #define $[file]_obj $[patsubst %.c %.cxx %.mm %.cpp %.yxx %.lxx,$[ODIR]/$[obj_prefix]%$[OBJ],$[notdir $[file]]] #push 1 $[file]_obj #end file @@ -160,7 +161,7 @@ #set cxx_interrogate_sources $[cxx_interrogate_sources] $[generated_file] #endif - #define compile_sources $[c_sources] $[cxx_sources] $[cxx_interrogate_sources] + #define compile_sources $[c_sources] $[mm_sources] $[cxx_sources] $[cxx_interrogate_sources] #end metalib_target lib_target noinst_lib_target test_lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index fb0710c772..67a3f68566 100644 --- a/dtool/pptempl/Global.pp +++ b/dtool/pptempl/Global.pp @@ -83,6 +83,10 @@ #define python_framework $[PYTHON_FRAMEWORK] #endif +#if $[USE_TAU] + #define tau_ipath $[wildcard $[TAU_IPATH]] +#endif + #if $[HAVE_THREADS] #define threads_ipath $[wildcard $[THREADS_IPATH]] #define threads_lpath $[wildcard $[THREADS_LPATH]] @@ -697,7 +701,7 @@ // names only; the -I switch is not included here. #defun get_ipath // hack to add stl,python. should be removed - #define alt_ipath $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_ipath] $[python_ipath]] + #define alt_ipath $[if $[IGNORE_LIB_DEFAULTS_HACK],,$[stl_ipath] $[python_ipath] $[tau_ipath]] #foreach package $[use_packages] #set alt_ipath $[alt_ipath] $[$[package]_ipath] diff --git a/dtool/pptempl/Template.unix.pp b/dtool/pptempl/Template.unix.pp index 9c3cf48d67..9c31f2c6af 100644 --- a/dtool/pptempl/Template.unix.pp +++ b/dtool/pptempl/Template.unix.pp @@ -341,7 +341,7 @@ igate : $[get_igatedb(metalib_target lib_target ss_lib_target)] // various .obj files. #define sources \ - $[patsubst %,$[%_obj],$[c_sources] $[cxx_sources]] + $[patsubst %,$[%_obj],$[c_sources] $[mm_sources] $[cxx_sources]] #define interrogate_sources \ $[patsubst %,$[%_obj],$[cxx_interrogate_sources]] #define cc_ld $[or $[get_ld],$[CC]] @@ -656,7 +656,7 @@ $[TAB] $[compile_c] // Rules to compile C++ files (static objects). -#foreach file $[sort $[cxx_sources] $[cxx_interrogate_sources]] +#foreach file $[sort $[mm_sources] $[cxx_sources] $[cxx_interrogate_sources]] #define target $[$[file]_obj] #define source $[file] #define ipath $[target_ipath] @@ -697,7 +697,7 @@ $[TAB] $[compile_c] // Rules to compile C++ files (shared objects). -#foreach file $[sort $[cxx_sources] $[cxx_interrogate_sources]] +#foreach file $[sort $[mm_sources] $[cxx_sources] $[cxx_interrogate_sources]] #define target $[$[file]_obj] #define source $[file] #define ipath $[target_ipath] diff --git a/dtool/src/dtoolbase/cmath.I b/dtool/src/dtoolbase/cmath.I index 030eca6a33..945da68c7a 100644 --- a/dtool/src/dtoolbase/cmath.I +++ b/dtool/src/dtoolbase/cmath.I @@ -12,15 +12,6 @@ // //////////////////////////////////////////////////////////////////// -#ifdef __APPLE__ -#ifndef isnan -#define isnan(x) \ - ((sizeof(x) == sizeof(double)) ? \ - __isnand(x) : \ - (sizeof(x) == sizeof(float)) ? __isnanf(x) : __isnan(x)) -#endif -#endif - #ifdef __INTEL_COMPILER // see float.h #define FPU_CONTROLWORD_WRITEMASK 0xFFFFF // if you look at defn of _CW_DEFAULT, all settings fall within 0xFFFFF diff --git a/dtool/src/dtoolbase/deletedBufferChain.cxx b/dtool/src/dtoolbase/deletedBufferChain.cxx index 8cf83c44c8..af19e4ab0b 100644 --- a/dtool/src/dtoolbase/deletedBufferChain.cxx +++ b/dtool/src/dtoolbase/deletedBufferChain.cxx @@ -47,7 +47,7 @@ DeletedBufferChain(size_t buffer_size) { void *DeletedBufferChain:: allocate(size_t size, TypeHandle type_handle) { #ifdef USE_DELETED_CHAIN - TAU_PROFILE("void *DeletedBufferChain::allocate(size_t, TypeHandle)", " ", TAU_USER); + //TAU_PROFILE("void *DeletedBufferChain::allocate(size_t, TypeHandle)", " ", TAU_USER); assert(size <= _buffer_size); ObjectNode *obj; @@ -105,7 +105,7 @@ allocate(size_t size, TypeHandle type_handle) { void DeletedBufferChain:: deallocate(void *ptr, TypeHandle type_handle) { #ifdef USE_DELETED_CHAIN - TAU_PROFILE("void DeletedBufferChain::deallocate(void *, TypeHandle)", " ", TAU_USER); + //TAU_PROFILE("void DeletedBufferChain::deallocate(void *, TypeHandle)", " ", TAU_USER); assert(ptr != (void *)NULL); #ifdef DO_MEMORY_USAGE diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index 56eccb4c10..494d92ea55 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -20,6 +20,11 @@ #ifdef __cplusplus +#ifdef USE_TAU +// Tau provides this destructive version of stdbool.h that we must mask. +#define __PDT_STDBOOL_H_ +#endif + #ifdef CPPPARSER #include #include diff --git a/dtool/src/dtoolutil/executionEnvironment.cxx b/dtool/src/dtoolutil/executionEnvironment.cxx index 4006b5ac20..97cf4d33be 100644 --- a/dtool/src/dtoolutil/executionEnvironment.cxx +++ b/dtool/src/dtoolutil/executionEnvironment.cxx @@ -18,6 +18,10 @@ #include #include // for perror +#ifdef __APPLE__ +#include // for realpath +#endif // __APPLE__ + #ifdef WIN32_VC // Windows requires this for getcwd(). #include diff --git a/panda/src/collide/collisionBox.cxx b/panda/src/collide/collisionBox.cxx index 458fb72291..93fe1ae97e 100644 --- a/panda/src/collide/collisionBox.cxx +++ b/panda/src/collide/collisionBox.cxx @@ -15,6 +15,7 @@ #include "collisionBox.h" #include "collisionLine.h" #include "collisionRay.h" +#include "collisionSphere.h" #include "collisionSegment.h" #include "collisionHandler.h" #include "collisionEntry.h" diff --git a/panda/src/collide/collisionHandlerGravity.cxx b/panda/src/collide/collisionHandlerGravity.cxx index 9a32281489..00f50ce107 100755 --- a/panda/src/collide/collisionHandlerGravity.cxx +++ b/panda/src/collide/collisionHandlerGravity.cxx @@ -184,7 +184,11 @@ set_highest_collision(const NodePath &target_node_path, const NodePath &from_nod // Add only the one that we're impacting with: add_entry(highest); } else { - _current_colliding.insert(valid_entries.begin(), valid_entries.end()); + // Add all of them. + pvector::iterator vi; + for (vi = valid_entries.begin(); vi != valid_entries.end(); ++vi) { + add_entry(*vi); + } } diff --git a/panda/src/framework/Sources.pp b/panda/src/framework/Sources.pp index 24bb849e60..e9c10c12ba 100644 --- a/panda/src/framework/Sources.pp +++ b/panda/src/framework/Sources.pp @@ -34,7 +34,7 @@ config_framework.cxx config_framework.h \ pandaFramework.cxx pandaFramework.I pandaFramework.h \ windowFramework.cxx windowFramework.I windowFramework.h \ - shuttle_controls.bam.c + rock_floor.rgb_src.c shuttle_controls.bam_src.c #define INSTALL_HEADERS \ pandaFramework.I pandaFramework.h \ diff --git a/panda/src/framework/rock_floor.rgb.c b/panda/src/framework/rock_floor.rgb_src.c similarity index 100% rename from panda/src/framework/rock_floor.rgb.c rename to panda/src/framework/rock_floor.rgb_src.c diff --git a/panda/src/framework/shuttle_controls.bam.c b/panda/src/framework/shuttle_controls.bam_src.c similarity index 100% rename from panda/src/framework/shuttle_controls.bam.c rename to panda/src/framework/shuttle_controls.bam_src.c diff --git a/panda/src/framework/windowFramework.cxx b/panda/src/framework/windowFramework.cxx index 85135d2687..51b2393803 100644 --- a/panda/src/framework/windowFramework.cxx +++ b/panda/src/framework/windowFramework.cxx @@ -58,12 +58,12 @@ // This is generated data for the standard texture we apply to the // blue triangle. -#include "rock_floor.rgb.c" +#include "rock_floor.rgb_src.c" // This is generated data for shuttle_controls.bam, a bamified version // of shuttle_controls.egg (found in the models tree). It's -// compiled in shuttle_controls.bam.c. -#include "shuttle_controls.bam.c" +// compiled in shuttle_controls.bam_src.c. +#include "shuttle_controls.bam_src.c" // This number is chosen arbitrarily to override any settings in model // files. diff --git a/panda/src/pgraph/Sources.pp b/panda/src/pgraph/Sources.pp index 76362f69b6..7e4af88970 100644 --- a/panda/src/pgraph/Sources.pp +++ b/panda/src/pgraph/Sources.pp @@ -120,6 +120,7 @@ antialiasAttrib.cxx \ attribNodeRegistry.cxx \ audioVolumeAttrib.cxx \ + auxBitplaneAttrib.cxx \ auxSceneData.cxx \ bamFile.cxx \ billboardEffect.cxx \ diff --git a/panda/src/pipeline/conditionVarPosixImpl.cxx b/panda/src/pipeline/conditionVarPosixImpl.cxx index 8dda009f33..1b54fe3759 100644 --- a/panda/src/pipeline/conditionVarPosixImpl.cxx +++ b/panda/src/pipeline/conditionVarPosixImpl.cxx @@ -26,7 +26,7 @@ //////////////////////////////////////////////////////////////////// void ConditionVarPosixImpl:: wait(double timeout) { - TAU_PROFILE("ConditionVarPosixImpl::wait()", " ", TAU_USER); + //TAU_PROFILE("ConditionVarPosixImpl::wait()", " ", TAU_USER); struct timeval now; gettimeofday(&now, NULL); diff --git a/panda/src/pipeline/threadPosixImpl.cxx b/panda/src/pipeline/threadPosixImpl.cxx index 639ef7fb24..34e2b119c5 100644 --- a/panda/src/pipeline/threadPosixImpl.cxx +++ b/panda/src/pipeline/threadPosixImpl.cxx @@ -201,7 +201,7 @@ void *ThreadPosixImpl:: root_func(void *data) { TAU_REGISTER_THREAD(); { - TAU_PROFILE("void ThreadPosixImpl::root_func()", " ", TAU_USER); + //TAU_PROFILE("void ThreadPosixImpl::root_func()", " ", TAU_USER); ThreadPosixImpl *self = (ThreadPosixImpl *)data; int result = pthread_setspecific(_pt_ptr_index, self->_parent_obj); diff --git a/panda/src/pipeline/threadWin32Impl.cxx b/panda/src/pipeline/threadWin32Impl.cxx index a22fa74e48..9ea243ff3f 100644 --- a/panda/src/pipeline/threadWin32Impl.cxx +++ b/panda/src/pipeline/threadWin32Impl.cxx @@ -156,7 +156,7 @@ DWORD ThreadWin32Impl:: root_func(LPVOID data) { TAU_REGISTER_THREAD(); { - TAU_PROFILE("void ThreadWin32Impl::root_func()", " ", TAU_USER); + //TAU_PROFILE("void ThreadWin32Impl::root_func()", " ", TAU_USER); ThreadWin32Impl *self = (ThreadWin32Impl *)data; BOOL result = TlsSetValue(_pt_ptr_index, self->_parent_obj); diff --git a/panda/src/testbed/test_map.cxx b/panda/src/testbed/test_map.cxx index a73b627142..54d5370e33 100644 --- a/panda/src/testbed/test_map.cxx +++ b/panda/src/testbed/test_map.cxx @@ -127,19 +127,15 @@ test_performance() { MemoryUsage::freeze(); MapType *m = new MapType; - if (MemoryUsage::has_cpp_size()) { - cerr << "Empty map uses " << MemoryUsage::get_current_cpp_size() - << " bytes.\n"; - } + cerr << "Empty map uses " << MemoryUsage::get_current_cpp_size() + << " bytes.\n"; for (int p = 0; p < initial_population; p++) { m->insert(MapType::value_type(samples[rand() & sample_mask], 0)); } - if (MemoryUsage::has_cpp_size()) { - cerr << "map with " << m->size() - << " elements uses " << MemoryUsage::get_current_cpp_size() - << " bytes.\n"; - } + cerr << "map with " << m->size() + << " elements uses " << MemoryUsage::get_current_cpp_size() + << " bytes.\n"; for (int r = 0; r < num_reps; r++) { double now = clock->get_real_time(); diff --git a/panda/src/testbed/test_texmem.cxx b/panda/src/testbed/test_texmem.cxx index 0dca496efb..cb69b34b98 100644 --- a/panda/src/testbed/test_texmem.cxx +++ b/panda/src/testbed/test_texmem.cxx @@ -13,8 +13,9 @@ //////////////////////////////////////////////////////////////////// #include "pandaFramework.h" -#include "geomQuad.h" -#include "textureAttrib.h" +#include "cardMaker.h" +#include "texture.h" +#include "pnmImage.h" #include "cmath.h" #include "mathNumbers.h" @@ -22,12 +23,10 @@ NodePath bogus_scene; NodePath old_bogus_scene; void -event_T(CPT_Event, void *data) { +event_T(const Event *, void *data) { PandaFramework *framework = (PandaFramework *)data; WindowFramework *wf = framework->get_window(0); - GraphicsStateGuardian *gsg = wf->get_graphics_window()->get_gsg(); - Camera *camera = wf->get_camera(0); NodePath models = framework->get_models(); NodePath render = wf->get_render(); @@ -54,14 +53,9 @@ event_T(CPT_Event, void *data) { cerr << "Loading " << num_quads_side * num_quads_side << " textures at " << tex_x_size << ", " << tex_y_size << "\n"; - GeomNode *gnode = new GeomNode("quads"); - bogus_scene.attach_new_node(gnode); - PNMImage white_center(tex_x_size / 4, tex_y_size / 4); white_center.fill(1.0f, 1.0f, 1.0f); - PTA_Colorf colors; - colors.push_back(Colorf(1.0f, 1.0f, 1.0f, 1.0f)); for (int yi = 0; yi < num_quads_side; yi++) { float y0 = (float)yi / (float)num_quads_side; float y1 = (float)(yi + 1) / (float)num_quads_side; @@ -90,23 +84,13 @@ event_T(CPT_Event, void *data) { tex->set_minfilter(Texture::FT_linear_mipmap_linear); tex->load(bogus_image); - PTA_Vertexf coords; - PTA_TexCoordf uvs; - coords.push_back(Vertexf(hx0 * px0, hy0 * px0, py0)); - coords.push_back(Vertexf(hx1 * px0, hy1 * px0, py0)); - coords.push_back(Vertexf(hx1 * px1, hy1 * px1, py1)); - coords.push_back(Vertexf(hx0 * px1, hy0 * px1, py1)); - uvs.push_back(TexCoordf(0.0f, 0.0f)); - uvs.push_back(TexCoordf(1.0f, 0.0f)); - uvs.push_back(TexCoordf(1.0f, 1.0f)); - uvs.push_back(TexCoordf(0.0f, 1.0f)); - - PT(GeomQuad) quad = new GeomQuad; - quad->set_coords(coords); - quad->set_colors(colors, G_OVERALL); - quad->set_num_prims(1); - quad->set_texcoords(uvs, G_PER_VERTEX); - gnode->add_geom(quad, RenderState::make(TextureAttrib::make(tex))); + CardMaker cm("card"); + cm.set_frame(Vertexf(hx0 * px0, hy0 * px0, py0), + Vertexf(hx1 * px0, hy1 * px0, py0), + Vertexf(hx1 * px1, hy1 * px1, py1), + Vertexf(hx0 * px1, hy0 * px1, py1)); + NodePath card = bogus_scene.attach_new_node(cm.generate()); + card.set_texture(tex); } } cerr << "Done.\n"; @@ -134,7 +118,7 @@ main(int argc, char *argv[]) { window->loop_animations(); framework.enable_default_keys(); - framework.get_event_handler().add_hook("shift-t", event_T, &framework); + framework.define_key("shift-t", "test texture memory", event_T, &framework); framework.main_loop(); } diff --git a/panda/src/text/Sources.pp b/panda/src/text/Sources.pp index 73f76c7490..86b3b4f573 100644 --- a/panda/src/text/Sources.pp +++ b/panda/src/text/Sources.pp @@ -44,7 +44,7 @@ textNode.cxx \ textProperties.cxx \ textPropertiesManager.cxx \ - cmss12.bam.c cmss12.bam.pz.c persans.ttf.c + cmss12.bam_src.c cmss12.bam.pz_src.c persans.ttf_src.c #define INSTALL_HEADERS \ config_text.h \ diff --git a/panda/src/text/cmss12.bam.pz.c b/panda/src/text/cmss12.bam.pz_src.c similarity index 100% rename from panda/src/text/cmss12.bam.pz.c rename to panda/src/text/cmss12.bam.pz_src.c diff --git a/panda/src/text/cmss12.bam.c b/panda/src/text/cmss12.bam_src.c similarity index 100% rename from panda/src/text/cmss12.bam.c rename to panda/src/text/cmss12.bam_src.c diff --git a/panda/src/text/default_font.cxx b/panda/src/text/default_font.cxx index 8a9adce435..50bee08edf 100644 --- a/panda/src/text/default_font.cxx +++ b/panda/src/text/default_font.cxx @@ -39,7 +39,7 @@ // If we have FreeType available, include the ttf font; it's superior // because it's dynamic. See above. -#include "persans.ttf.c" +#include "persans.ttf_src.c" #elif defined(HAVE_ZLIB) @@ -50,9 +50,9 @@ // egg2bam -rawtex -o cmss12.bam cmss12.egg // pzip cmss12.bam -// bin2c -n default_font_data -o cmss12.bam.pz.c cmss12.bam.pz +// bin2c -n default_font_data -o cmss12.bam.pz_src.c cmss12.bam.pz -#include "cmss12.bam.pz.c" +#include "cmss12.bam.pz_src.c" #else @@ -62,9 +62,9 @@ // Regenerate this file with (cmss12.egg can be loaded from the models tree): // egg2bam -rawtex -o cmss12.bam cmss12.egg -// bin2c -n default_font_data -o cmss12.bam.c cmss12.bam +// bin2c -n default_font_data -o cmss12.bam_src.c cmss12.bam -#include "cmss12.bam.c" +#include "cmss12.bam_src.c" #endif diff --git a/panda/src/text/persans.ttf.c b/panda/src/text/persans.ttf_src.c similarity index 100% rename from panda/src/text/persans.ttf.c rename to panda/src/text/persans.ttf_src.c