*** empty log message ***

This commit is contained in:
David Rose
2000-10-30 18:49:38 +00:00
parent d6b808c8cc
commit 0d238d06ab
70 changed files with 527 additions and 344 deletions
+17 -3
View File
@@ -137,7 +137,13 @@
#define PYTHON_LPATH
#defer HAVE_PYTHON $[isdir $[PYTHON_IPATH]]
// Is NSPR installed, and where?
// Is NSPR installed, and where? This is the Netscape Portable
// Runtime library, downloadable as part of the Mozilla package from
// mozilla.org. It provides portable threading and networking
// services to Panda. Panda should compile without it, although
// without any threading or networking capabilities; eventually,
// native support for these capabilities may be added for certain
// platforms. See also HAVE_IPC and HAVE_NET.
#define NSPR_IPATH /usr/include/nspr
#define NSPR_LPATH
#define NSPR_LIBS nspr4
@@ -211,8 +217,16 @@
#define MIKMOD_CONFIG libmikmod-config
#defer HAVE_MIKMOD $[bintest $[MIKMOD_CONFIG]]
// Do you want to build in support for threading (inter-process
// control)? What additional libraries are required? Currently, this
// requires NSPR to compile correctly.
#define IPC_IPATH
#define IPC_LPATH
#define IPC_LIBS
#defer HAVE_IPC $[HAVE_NSPR]
// Do you want to build the network interface? What additional libraries
// are required?
// are required? Currently, this requires NSPR.
#define NET_IPATH
#define NET_LPATH
#if $[eq $[PLATFORM],Win32]
@@ -220,7 +234,7 @@
#else
#define NET_LIBS
#endif
#define HAVE_NET 1
#defer HAVE_NET $[HAVE_NSPR]
// Do you want to build the audio interface? What additional
// libraries are required?
+3
View File
@@ -58,6 +58,9 @@ $[cdefine HAVE_RIB]
/* Define if we want to use mikmod for audio. */
$[cdefine HAVE_MIKMOD]
/* Define if we want to compile the ipc code. */
$[cdefine HAVE_IPC]
/* Define if we want to compile the net code. */
$[cdefine HAVE_NET]
+101 -38
View File
@@ -90,6 +90,18 @@
#define gl_libs $[GL_LIBS]
#endif
#if $[HAVE_GLX]
#define glx_ipath $[wildcard $[GLX_IPATH]]
#define glx_lpath $[wildcard $[GLX_LPATH]]
#define glx_libs $[GLX_LIBS]
#endif
#if $[HAVE_GLUT]
#define glut_ipath $[wildcard $[GLUT_IPATH]]
#define glut_lpath $[wildcard $[GLUT_LPATH]]
#define glut_libs $[GLUT_LIBS]
#endif
#if $[HAVE_DX]
#define dx_ipath $[wildcard $[DX_IPATH]]
#define dx_lpath $[wildcard $[DX_LPATH]]
@@ -123,6 +135,12 @@
#define maya_ld $[MAYA_LOCATION]/bin/mayald
#endif
#if $[HAVE_IPC]
#define ipc_ipath $[wildcard $[IPC_IPATH]]
#define ipc_lpath $[wildcard $[IPC_LPATH]]
#define ipc_libs $[IPC_LIBS]
#endif
#if $[HAVE_NET]
#define net_ipath $[wildcard $[NET_IPATH]]
#define net_lpath $[wildcard $[NET_LPATH]]
@@ -156,6 +174,7 @@
$[or $[not $[DIRECTORY_IF_VRPN]],$[HAVE_VRPN]], \
$[or $[not $[DIRECTORY_IF_GTKMM]],$[HAVE_GTKMM]], \
$[or $[not $[DIRECTORY_IF_MAYA]],$[HAVE_MAYA]], \
$[or $[not $[DIRECTORY_IF_IPC]],$[HAVE_IPC]], \
$[or $[not $[DIRECTORY_IF_NET]],$[HAVE_NET]], \
$[or $[not $[DIRECTORY_IF_AUDIO]],$[HAVE_AUDIO]], \
1 ]
@@ -180,6 +199,7 @@
$[or $[not $[TARGET_IF_VRPN]],$[HAVE_VRPN]], \
$[or $[not $[TARGET_IF_GTKMM]],$[HAVE_GTKMM]], \
$[or $[not $[TARGET_IF_MAYA]],$[HAVE_MAYA]], \
$[or $[not $[TARGET_IF_IPC]],$[HAVE_IPC]], \
$[or $[not $[TARGET_IF_NET]],$[HAVE_NET]], \
$[or $[not $[TARGET_IF_AUDIO]],$[HAVE_AUDIO]], \
1 ]
@@ -194,6 +214,11 @@
#defer active_libs $[active_local_libs] $[active_component_libs]
// This variable, when evaluated within a target, will either be empty
// string if the target is not to be built, or the target name if it
// is.
#defer active_target $[if $[build_target],$[TARGET]]
// This subroutine will set up the sources variable to reflect the
// complete set of sources for this target, and also set the
// alt_cflags, alt_libs, etc. as appropriate according to how the
@@ -204,6 +229,8 @@
#defer get_sources \
$[SOURCES] \
$[if $[HAVE_ZLIB],$[IF_ZLIB_SOURCES]] \
$[if $[HAVE_IPC],$[IF_IPC_SOURCES]] \
$[if $[HAVE_NET],$[IF_NET_SOURCES]] \
$[if $[HAVE_PYTHON],$[IF_PYTHON_SOURCES]]
// This variable returns the set of sources that are to be
@@ -232,7 +259,7 @@
// current metalib target should include one, or empty string if it
// should not.
#defer get_igatemscan \
$[if $[and $[run_interrogate],$[components $[IGATESCAN],$[COMPONENT_LIBS]]], \
$[if $[and $[run_interrogate],$[components $[IGATESCAN],$[active_component_libs]]], \
$[TARGET]]
@@ -243,31 +270,40 @@
#defun get_cflags
#define alt_cflags $[nspr_cflags] $[python_cflags]
#if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[COMPONENT_LIBS]],]
#if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[zlib_cflags]
#endif
#if $[ne $[USE_GL] $[components $[USE_GL],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[gl_cflags]
#endif
#if $[ne $[USE_DX] $[components $[USE_DX],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[glx_cflags]
#endif
#if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[glut_cflags]
#endif
#if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[dx_cflags]
#endif
#if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[COMPONENT_LIBS]],]
#if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[soxst_cflags]
#endif
#if $[ne $[USE_NET] $[components $[USE_NET],$[COMPONENT_LIBS]],]
#if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[ipc_cflags]
#endif
#if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[net_cflags]
#endif
#if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[COMPONENT_LIBS]],]
#if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[audio_cflags]
#endif
#if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[COMPONENT_LIBS]],]
#if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[mikmod_cflags]
#endif
#if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[gtkmm_cflags]
#endif
#if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LIBS]],]
#if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs]],]
#set alt_cflags $[alt_cflags] $[maya_cflags]
#endif
@@ -281,31 +317,40 @@
#defun get_ipath
#define alt_ipath $[nspr_ipath] $[python_ipath]
#if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[COMPONENT_LIBS]],]
#if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[zlib_ipath]
#endif
#if $[ne $[USE_GL] $[components $[USE_GL],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[gl_ipath]
#endif
#if $[ne $[USE_DX] $[components $[USE_DX],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[glx_ipath]
#endif
#if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[glut_ipath]
#endif
#if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[dx_ipath]
#endif
#if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[COMPONENT_LIBS]],]
#if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[soxst_ipath]
#endif
#if $[ne $[USE_NET] $[components $[USE_NET],$[COMPONENT_LIBS]],]
#if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[ipc_ipath]
#endif
#if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[net_ipath]
#endif
#if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[COMPONENT_LIBS]],]
#if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[audio_ipath]
#endif
#if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[COMPONENT_LIBS]],]
#if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[mikmod_ipath]
#endif
#if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[gtkmm_ipath]
#endif
#if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LIBS]],]
#if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs]],]
#set alt_ipath $[alt_ipath] $[maya_ipath]
#endif
@@ -319,31 +364,40 @@
#defun get_lpath
#define alt_lpath $[nspr_lpath] $[python_lpath]
#if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[COMPONENT_LIBS]],]
#if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[zlib_lpath]
#endif
#if $[ne $[USE_GL] $[components $[USE_GL],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[gl_lpath]
#endif
#if $[ne $[USE_DX] $[components $[USE_DX],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[glx_lpath]
#endif
#if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[glut_lpath]
#endif
#if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[dx_lpath]
#endif
#if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[COMPONENT_LIBS]],]
#if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[soxst_lpath]
#endif
#if $[ne $[USE_NET] $[components $[USE_NET],$[COMPONENT_LIBS]],]
#if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[ipc_lpath]
#endif
#if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[net_lpath]
#endif
#if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[COMPONENT_LIBS]],]
#if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[audio_lpath]
#endif
#if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[COMPONENT_LIBS]],]
#if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[mikmod_lpath]
#endif
#if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[gtkmm_lpath]
#endif
#if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LIBS]],]
#if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs]],]
#set alt_lpath $[alt_lpath] $[maya_lpath]
#endif
@@ -358,35 +412,44 @@
#defun get_libs
#define alt_libs $[nspr_libs] $[python_libs]
#if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[COMPONENT_LIBS]],]
#if $[ne $[USE_ZLIB] $[components $[USE_ZLIB],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[zlib_libs]
#endif
#if $[ne $[USE_GL] $[components $[USE_GL],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GL] $[components $[USE_GL],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[gl_libs]
#endif
#if $[ne $[USE_DX] $[components $[USE_DX],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GLX] $[components $[USE_GLX],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[glx_libs]
#endif
#if $[ne $[USE_GLUT] $[components $[USE_GLUT],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[glut_libs]
#endif
#if $[ne $[USE_DX] $[components $[USE_DX],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[dx_libs]
#endif
#if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[COMPONENT_LIBS]],]
#if $[ne $[USE_SOXST] $[components $[USE_SOXST],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[soxst_libs]
#endif
#if $[ne $[USE_NET] $[components $[USE_NET],$[COMPONENT_LIBS]],]
#if $[ne $[USE_IPC] $[components $[USE_IPC],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[ipc_libs]
#endif
#if $[ne $[USE_NET] $[components $[USE_NET],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[net_libs]
#endif
#if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[COMPONENT_LIBS]],]
#if $[ne $[USE_AUDIO] $[components $[USE_AUDIO],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[audio_libs]
#endif
#if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[COMPONENT_LIBS]],]
#if $[ne $[USE_MIKMOD] $[components $[USE_MIKMOD],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[mikmod_libs]
#endif
#if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[COMPONENT_LIBS]],]
#if $[ne $[USE_GTKMM] $[components $[USE_GTKMM],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[gtkmm_libs]
#endif
#if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[COMPONENT_LIBS]],]
#if $[ne $[USE_MAYA] $[components $[USE_MAYA],$[active_component_libs]],]
#set alt_libs $[alt_libs] $[maya_libs]
#endif
#if $[UNIX_PLATFORM]
#set alt_libs $[alt_libs] $[UNIX_SYS_LIBS] $[components $[UNIX_SYS_LIBS],$[COMPONENT_LIBS]]
#set alt_libs $[alt_libs] $[UNIX_SYS_LIBS] $[components $[UNIX_SYS_LIBS],$[active_component_libs]]
#endif
$[alt_libs]
+10 -10
View File
@@ -53,17 +53,17 @@
// $[bin_targets] the list of binaries. $[test_bin_targets] is the
// list of binaries that are to be built only when specifically asked
// for.
#define lib_targets $[patsubst %,$[so_dir]\lib%$[dllext].dll,$[TARGET(metalib_target noinst_lib_target)] $[real_lib_targets]]
#define static_lib_targets $[TARGET(static_lib_target):%=$[st_dir]\lib%$[dllext].lib]
#define lib_targets $[patsubst %,$[so_dir]\lib%$[dllext].dll,$[active_target(metalib_target noinst_lib_target)] $[real_lib_targets]]
#define static_lib_targets $[active_target(static_lib_target):%=$[st_dir]\lib%$[dllext].lib]
#define bin_targets \
$[TARGET(bin_target noinst_bin_target):%=$[st_dir]\%.exe] \
$[TARGET(sed_bin_target):%=$[st_dir]\%]
#define test_bin_targets $[TARGET(test_bin_target):%=$[st_dir]\%.exe]
$[active_target(bin_target noinst_bin_target):%=$[st_dir]\%.exe] \
$[active_target(sed_bin_target):%=$[st_dir]\%]
#define test_bin_targets $[active_target(test_bin_target):%=$[st_dir]\%.exe]
// And these variables will define the various things we need to
// install.
#define install_lib $[TARGET(metalib_target static_lib_target)] $[real_lib_targets]
#define install_bin $[TARGET(bin_target)]
#define install_lib $[active_target(metalib_target static_lib_target)] $[real_lib_targets]
#define install_bin $[active_target(bin_target)]
#define install_scripts $[sort $[INSTALL_SCRIPTS(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_SCRIPTS]]
#define install_headers $[sort $[INSTALL_HEADERS(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_HEADERS]]
#define install_parser_inc $[sort $[INSTALL_PARSER_INC]]
@@ -214,13 +214,13 @@ cleanall : clean
$[if $[install_config],$[install_config_dir]] \
$[if $[install_igatedb],$[install_igatedb_dir]] \
] \
$[TARGET(metalib_target lib_target static_lib_target):%=install-lib%] \
$[TARGET(bin_target sed_bin_target):%=install-%] \
$[active_target(metalib_target lib_target static_lib_target):%=install-lib%] \
$[active_target(bin_target sed_bin_target):%=install-%] \
$[installed_files]
install : all $[install_targets]
uninstall : $[TARGET(metalib_target lib_target static_lib_target):%=uninstall-lib%] $[TARGET(bin_target):%=uninstall-%]
uninstall : $[active_target(metalib_target lib_target static_lib_target):%=uninstall-lib%] $[active_target(bin_target):%=uninstall-%]
#if $[installed_files]
del /f $[sort $[installed_files]]
#endif
+8 -8
View File
@@ -38,15 +38,15 @@
// $[bin_targets] the list of binaries. $[test_bin_targets] is the
// list of binaries that are to be built only when specifically asked
// for.
#define lib_targets $[TARGET(metalib_target lib_target noinst_lib_target):%=$[so_dir]/lib%.so]
#define static_lib_targets $[TARGET(static_lib_target):%=$[st_dir]/lib%.a]
#define bin_targets $[TARGET(bin_target noinst_bin_target sed_bin_target):%=$[st_dir]/%]
#define test_bin_targets $[TARGET(test_bin_target):%=$[st_dir]/%]
#define lib_targets $[active_target(metalib_target lib_target noinst_lib_target):%=$[so_dir]/lib%.so]
#define static_lib_targets $[active_target(static_lib_target):%=$[st_dir]/lib%.a]
#define bin_targets $[active_target(bin_target noinst_bin_target sed_bin_target):%=$[st_dir]/%]
#define test_bin_targets $[active_target(test_bin_target):%=$[st_dir]/%]
// And these variables will define the various things we need to
// install.
#define install_lib $[TARGET(metalib_target lib_target static_lib_target)]
#define install_bin $[TARGET(bin_target)]
#define install_lib $[active_target(metalib_target lib_target static_lib_target)]
#define install_bin $[active_target(bin_target)]
#define install_scripts $[sort $[INSTALL_SCRIPTS(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_SCRIPTS]]
#define install_headers $[sort $[INSTALL_HEADERS(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_HEADERS]]
#define install_parser_inc $[sort $[INSTALL_PARSER_INC]]
@@ -197,8 +197,8 @@ cleanall : clean
$[if $[install_config],$[install_config_dir]] \
$[if $[install_igatedb],$[install_igatedb_dir]] \
] \
$[TARGET(metalib_target lib_target static_lib_target):%=install-lib%] \
$[TARGET(bin_target sed_bin_target):%=install-%] \
$[active_target(metalib_target lib_target static_lib_target):%=install-lib%] \
$[active_target(bin_target sed_bin_target):%=install-%] \
$[installed_files]
install : all $[install_targets]
+3 -1
View File
@@ -10,7 +10,9 @@
#define BUILDING_DLL BUILDING_PANDAGL
#define COMPONENT_LIBS \
glgsg glxdisplay wgldisplay // sgiglxdisplay
glgsg glxdisplay wgldisplay glutdisplay \
sgidisplay sgiglxdisplay sgiglutdisplay
#define LOCAL_LIBS gsgbase display express
#define OTHER_LIBS dtool
-22
View File
@@ -1,22 +0,0 @@
#define DIRECTORY_IF_GLUT yes
// DIR_TYPE "metalib" indicates we are building a shared library that
// consists mostly of references to other shared libraries. Under
// Windows, this directly produces a DLL (as opposed to the regular
// src libraries, which don't produce anything but a pile of OBJ files
// under Windows).
#define DIR_TYPE metalib
#define BUILDING_DLL BUILDING_PANDAGLUT
#define COMPONENT_LIBS \
glutdisplay // sgiglutdisplay
#define LOCAL_LIBS glgsg display express
#define OTHER_LIBS dtool
#begin metalib_target
#define TARGET pandaglut
#define SOURCES pandaglut.cxx
#end metalib_target
-9
View File
@@ -1,9 +0,0 @@
// Filename: pandaglut.cxx
// Created by: drose (15May00)
//
////////////////////////////////////////////////////////////////////
// This is a dummy file whose sole purpose is to give the compiler
// something to compile when making libpandaglut.so in NO_DEFER mode,
// which generates an empty library that itself links with all the
// other shared libraries that make up libpandaglut.
+2 -2
View File
@@ -102,8 +102,8 @@ compute_angle() const {
Edges::const_iterator ei;
for (ei = _edges.begin(); ei != _edges.end(); ++ei) {
Normalf v1 = (Vertexf &)(*ei)->_a->get_coord_value(*_bucket) - v0;
Normalf v2 = (Vertexf &)(*ei)->_b->get_coord_value(*_bucket) - v0;
Normalf v1 = (*ei)->_a->get_coord_value(*_bucket) - v0;
Normalf v2 = (*ei)->_b->get_coord_value(*_bucket) - v0;
v1 = normalize(v1);
v2 = normalize(v2);
+5 -5
View File
@@ -149,7 +149,7 @@ void AnimChannelMatrixXfmTable::
set_table(char table_id, const CPTA_float &table) {
int num_frames = _root->get_num_frames();
if (table.size() > 1 && table.size() < num_frames) {
if (table.size() > 1 && (int)table.size() < num_frames) {
// The new table has an invalid number of frames--it doesn't match
// the bundle's requirement.
return;
@@ -231,7 +231,7 @@ write_datagram(BamWriter *manager, Datagram &me)
// Write out everything the old way, as floats.
for(int i = 0; i < num_tables; i++) {
me.add_uint16(_tables[i].size());
for(int j = 0; j < _tables[i].size(); j++) {
for(int j = 0; j < (int)_tables[i].size(); j++) {
me.add_float64(_tables[i][j]);
}
}
@@ -243,7 +243,7 @@ write_datagram(BamWriter *manager, Datagram &me)
int i;
for(i = 0; i < 3; i++) {
me.add_uint16(_tables[i].size());
for(int j = 0; j < _tables[i].size(); j++) {
for(int j = 0; j < (int)_tables[i].size(); j++) {
me.add_uint16((int)max(min(_tables[i][j]*256.0, 65535.0), 0.0));
}
}
@@ -251,7 +251,7 @@ write_datagram(BamWriter *manager, Datagram &me)
// Now, write out the joint angles. These are in the range 0 .. 360.
for(i = 3; i < 6; i++) {
me.add_uint16(_tables[i].size());
for(int j = 0; j < _tables[i].size(); j++) {
for(int j = 0; j < (int)_tables[i].size(); j++) {
me.add_uint16((unsigned int)(_tables[i][j] * 65536.0 / 360.0));
}
}
@@ -260,7 +260,7 @@ write_datagram(BamWriter *manager, Datagram &me)
// -1000 .. 1000.
for(i = 6; i < 9; i++) {
me.add_uint16(_tables[i].size());
for(int j = 0; j < _tables[i].size(); j++) {
for(int j = 0; j < (int)_tables[i].size(); j++) {
me.add_int16((int)max(min(_tables[i][j] * 32767.0 / 1000.0, 32767.0), -32767.0));
}
}
+3 -3
View File
@@ -78,7 +78,7 @@ void AnimChannelScalarTable::
set_table(const CPTA_float &table) {
int num_frames = _root->get_num_frames();
if (table.size() > 1 && table.size() < num_frames) {
if (table.size() > 1 && (int)table.size() < num_frames) {
// The new table has an invalid number of frames--it doesn't match
// the bundle's requirement.
return;
@@ -122,7 +122,7 @@ write_datagram(BamWriter *manager, Datagram &me)
if (!quantize_bam_channels) {
// Write out everything the old way, as floats.
me.add_uint16(_table.size());
for(int i = 0; i < _table.size(); i++) {
for(int i = 0; i < (int)_table.size(); i++) {
me.add_float64(_table[i]);
}
@@ -131,7 +131,7 @@ write_datagram(BamWriter *manager, Datagram &me)
// We quantize morphs within the range -100 .. 100.
me.add_uint16(_table.size());
for(int i = 0; i < _table.size(); i++) {
for(int i = 0; i < (int)_table.size(); i++) {
me.add_int16((int)max(min(_table[i] * 32767.0 / 100.0, 32767.0), -32767.0));
}
}
+2 -2
View File
@@ -52,7 +52,7 @@ get_num_children() const {
////////////////////////////////////////////////////////////////////
AnimGroup *AnimGroup::
get_child(int n) const {
nassertr(n >= 0 && n < _children.size(), NULL);
nassertr(n >= 0 && n < (int)_children.size(), NULL);
return _children[n];
}
@@ -149,7 +149,7 @@ write_datagram(BamWriter *manager, Datagram &me)
//Write out the root
manager->write_pointer(me, this->_root);
me.add_uint16(_children.size());
for(int i = 0; i < _children.size(); i++)
for(int i = 0; i < (int)_children.size(); i++)
{
manager->write_pointer(me, _children[i]);
}
+3 -3
View File
@@ -38,7 +38,7 @@ get_blend_value(const PartBundle *root) {
AnimControl *control = (*blend.begin()).first;
int channel_index = control->get_channel_index();
nassertv(channel_index >= 0 && channel_index < _channels.size());
nassertv(channel_index >= 0 && channel_index < (int)_channels.size());
ChannelType *channel = DCAST(ChannelType, _channels[channel_index]);
nassertv(channel != NULL);
@@ -59,7 +59,7 @@ get_blend_value(const PartBundle *root) {
nassertv(effect != 0.0);
int channel_index = control->get_channel_index();
nassertv(channel_index >= 0 && channel_index < _channels.size());
nassertv(channel_index >= 0 && channel_index < (int)_channels.size());
ChannelType *channel = DCAST(ChannelType, _channels[channel_index]);
nassertv(channel != NULL);
@@ -90,7 +90,7 @@ get_blend_value(const PartBundle *root) {
nassertv(effect != 0.0);
int channel_index = control->get_channel_index();
nassertv(channel_index >= 0 && channel_index < _channels.size());
nassertv(channel_index >= 0 && channel_index < (int)_channels.size());
ChannelType *channel = DCAST(ChannelType, _channels[channel_index]);
nassertv(channel != NULL);
+2 -2
View File
@@ -36,7 +36,7 @@ get_blend_value(const PartBundle *root) {
AnimControl *control = (*blend.begin()).first;
int channel_index = control->get_channel_index();
nassertv(channel_index >= 0 && channel_index < _channels.size());
nassertv(channel_index >= 0 && channel_index < (int)_channels.size());
ChannelType *channel = DCAST(ChannelType, _channels[channel_index]);
nassertv(channel != NULL);
@@ -54,7 +54,7 @@ get_blend_value(const PartBundle *root) {
nassertv(effect != 0.0);
int channel_index = control->get_channel_index();
nassertv(channel_index >= 0 && channel_index < _channels.size());
nassertv(channel_index >= 0 && channel_index < (int)_channels.size());
ChannelType *channel = DCAST(ChannelType, _channels[channel_index]);
nassertv(channel != NULL);
+6 -8
View File
@@ -94,7 +94,7 @@ get_num_children() const {
////////////////////////////////////////////////////////////////////
PartGroup *PartGroup::
get_child(int n) const {
nassertr(n >= 0 && n < _children.size(), NULL);
nassertr(n >= 0 && n < (int)_children.size(), NULL);
return _children[n];
}
@@ -265,20 +265,18 @@ check_hierarchy(const AnimGroup *anim, const PartGroup *,
}
}
while (i < get_num_children()) {
PartGroup *pc = get_child(i);
if (i < get_num_children()) {
// There's at least one extra part.
if ((hierarchy_match_flags & HMF_ok_part_extra) == 0) {
return false;
}
i++;
}
while (j < anim->get_num_children()) {
AnimGroup *ac = anim->get_child(j);
if (j < anim->get_num_children()) {
// There's at least one extra anim channel.
if ((hierarchy_match_flags & HMF_ok_anim_extra) == 0) {
return false;
}
j++;
}
return true;
@@ -399,7 +397,7 @@ write_datagram(BamWriter *manager, Datagram &me)
int i;
me.add_string(get_name());
me.add_uint16(_children.size());
for(i = 0; i < _children.size(); i++)
for(i = 0; i < (int)_children.size(); i++)
{
manager->write_pointer(me, _children[i]);
}
+1 -1
View File
@@ -190,7 +190,7 @@ write_datagram(BamWriter *manager, Datagram &me)
NamedNode::write_datagram(manager, me);
me.add_uint16(_solids.size());
for(i = 0; i < _solids.size(); i++)
for(i = 0; i < (int)_solids.size(); i++)
{
manager->write_pointer(me, _solids[i]);
}
+30 -2
View File
@@ -17,9 +17,11 @@ TypeHandle ClientBase::_type_handle;
////////////////////////////////////////////////////////////////////
ClientBase::
ClientBase(const string &server) :
_sleep_time(1000000/60), _server(server),
_forked(false), _shutdown(false)
_sleep_time(1000000/60), _server(server), _forked(false)
{
#ifdef HAVE_IPC
_shutdown = false;
#endif
}
@@ -31,6 +33,7 @@ ClientBase(const string &server) :
ClientBase::
~ClientBase()
{
#ifdef HAVE_IPC
if (asynchronous_clients && _forked == true) {
{
//Make sure that you grab all locks before setting shutdown to
@@ -48,6 +51,7 @@ ClientBase::
void *ret;
_client_thread->join(&ret);
}
#endif
}
////////////////////////////////////////////////////////////////////
// Function: ClientBase::fork_asynchronous_thread
@@ -56,6 +60,7 @@ ClientBase::
////////////////////////////////////////////////////////////////////
void ClientBase::
fork_asynchronous_thread(void) {
#ifdef HAVE_IPC
if (asynchronous_clients) {
_client_thread = thread::create(&st_callback, this);
_forked = true;
@@ -65,6 +70,7 @@ fork_asynchronous_thread(void) {
<< endl;
}
}
#endif
}
////////////////////////////////////////////////////////////////////
@@ -79,6 +85,7 @@ set_poll_time(float poll_time) {
}
#ifdef HAVE_IPC
////////////////////////////////////////////////////////////////////
// Function: ClientBase::st_callback
// Access: Private, static
@@ -117,6 +124,7 @@ callback(void) {
ipc_traits::sleep(0, _sleep_time);
}
}
#endif // HAVE_IPC
////////////////////////////////////////////////////////////////////
// Function: ClientBase::get_tracker_data
@@ -136,7 +144,9 @@ get_tracker_data(const string &tracker, int sensor) {
}
//Make sure to prevent simultaneous write and read of device
#ifdef HAVE_IPC
mutex_lock lock(_tracker_lock);
#endif
if ((find(_trackers.begin(), _trackers.end(), tracker) != _trackers.end()) ||
(find(_sensors[tracker].begin(), _sensors[tracker].end(), sensor)
@@ -174,7 +184,9 @@ get_analog_data(const string &analog) {
}
//Make sure to prevent simultaneous write and read of device
#ifdef HAVE_IPC
mutex_lock lock(_analog_lock);
#endif
if (find(_analogs.begin(), _analogs.end(), analog) != _analogs.end()) {
if (_analog_datas.find(analog) != _analog_datas.end()) {
@@ -209,7 +221,9 @@ get_button_data(const string &button) {
}
//Make sure to prevent simultaneous write and read of device
#ifdef HAVE_IPC
mutex_lock lock(_button_lock);
#endif
if (find(_buttons.begin(), _buttons.end(), button) != _buttons.end()) {
if (_button_datas.find(button) != _button_datas.end()) {
@@ -242,7 +256,9 @@ get_dial_data(const string &dial) {
}
//Make sure to prevent simultaneous write and read of device
#ifdef HAVE_IPC
mutex_lock lock(_dial_lock);
#endif
if (find(_dials.begin(), _dials.end(), dial) != _dials.end()) {
if (_dial_datas.find(dial) != _dial_datas.end()) {
@@ -267,7 +283,9 @@ void ClientBase::
push_tracker_position(const string &tracker, const int &sensor, const double &ptime,
const LPoint3f &pos, const LVector4f &pquat) {
//Make sure to prevent simultaneous write and read of device
#ifdef HAVE_IPC
mutex_lock lock(_tracker_lock);
#endif
_tracker_datas[tracker][sensor].ptime = ptime;
_tracker_datas[tracker][sensor].position = pos;
@@ -284,7 +302,9 @@ void ClientBase::
push_tracker_velocity(const string &tracker, int sensor, const double &vtime,
const LPoint3f &vel, const LVector4f &vquat, const float &dt) {
//Make sure to prevent simultaneous write and read of device
#ifdef HAVE_IPC
mutex_lock lock(_tracker_lock);
#endif
_tracker_datas[tracker][sensor].vtime = vtime;
_tracker_datas[tracker][sensor].velocity = vel;
@@ -302,7 +322,9 @@ void ClientBase::
push_tracker_acceleration(const string &tracker, const int &sensor, const double &atime,
const LPoint3f &acc, const LVector4f &aquat, const float &dt) {
//Make sure to prevent simultaneous write and read of device
#ifdef HAVE_IPC
mutex_lock lock(_tracker_lock);
#endif
_tracker_datas[tracker][sensor].atime = atime;
_tracker_datas[tracker][sensor].acceleration = acc;
@@ -320,7 +342,9 @@ void ClientBase::
push_analog(const string &analog, const float &atime,
const double *channels, int num_channels) {
//Make sure to prevent simultaneous write and read of device
#ifdef HAVE_IPC
mutex_lock lock(_analog_lock);
#endif
_analog_datas[analog].atime = atime;
@@ -341,7 +365,9 @@ void ClientBase::
push_button(const string &button, const float &btime, const int &button_id,
const int &state) {
//Make sure to prevent simultaneous write and read of device
#ifdef HAVE_IPC
mutex_lock lock(_button_lock);
#endif
_button_datas[button].btime = btime;
_button_datas[button].button_id = button_id;
@@ -358,7 +384,9 @@ void ClientBase::
push_dial(const string &dial, const float &dtime, const int &dial_id,
const float &change) {
//Make sure to prevent simultaneous write and read of device
#ifdef HAVE_IPC
mutex_lock lock(_dial_lock);
#endif
_dial_datas[dial].dtime = dtime;
_dial_datas[dial].dial_id = dial_id;
+9 -4
View File
@@ -15,11 +15,14 @@
#include <typedReferenceCount.h>
#include <luse.h>
#include <vector_string.h>
#include <vector_int.h>
#ifdef HAVE_IPC
#include <ipc_mutex.h>
#include <ipc_condition.h>
#include <ipc_thread.h>
#include <vector_string.h>
#include <vector_int.h>
#endif
#include <map>
@@ -60,7 +63,9 @@ protected:
private:
int _sleep_time;
const string _server;
bool _forked;
#ifdef HAVE_IPC
//Device locks and conditionals
mutex _tracker_lock;
mutex _analog_lock;
@@ -69,11 +74,11 @@ private:
//Thread variables and functions
thread *_client_thread;
bool _forked;
bool _shutdown;
static void* st_callback(void *arg);
void callback(void);
#endif
protected:
//Device polling functions
+1 -1
View File
@@ -48,7 +48,7 @@ describe_data_verbose(ostream &out, const NodeAttributes &state,
}
indent(out, indent_level) << name;
if (name.length() < data_indent_level) {
if ((int)name.length() < data_indent_level) {
indent(out, data_indent_level - name.length());
} else {
out << " ";
+1
View File
@@ -1,6 +1,7 @@
#define LOCAL_LIBS event ipc express pandabase
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolutil:c dtoolbase:c dtool:m
#define USE_ZLIB yes
#define USE_IPC yes
#begin lib_target
#define TARGET downloader
+15
View File
@@ -32,7 +32,10 @@ AsyncUtility(float frequency) : _frequency(frequency) {
_shutdown = false;
_threaded = false;
_threads_enabled = true;
#ifdef HAVE_IPC
_request_cond = new condition_variable(_lock);
#endif
}
////////////////////////////////////////////////////////////////////
@@ -42,7 +45,9 @@ AsyncUtility(float frequency) : _frequency(frequency) {
////////////////////////////////////////////////////////////////////
AsyncUtility::
~AsyncUtility() {
#ifdef HAVE_IPC
delete _request_cond;
#endif
}
////////////////////////////////////////////////////////////////////
@@ -52,12 +57,14 @@ AsyncUtility::
////////////////////////////////////////////////////////////////////
void AsyncUtility::
create_thread(void) {
#ifdef HAVE_IPC
if (_threaded == false && _threads_enabled == true) {
downloader_cat.debug()
<< "AsyncUtility::create_thread()" << endl;
_thread = thread::create(&st_callback, this);
_threaded = true;
}
#endif
}
////////////////////////////////////////////////////////////////////
@@ -67,6 +74,7 @@ create_thread(void) {
////////////////////////////////////////////////////////////////////
void AsyncUtility::
destroy_thread(void) {
#ifdef HAVE_IPC
if (_threaded == false)
return;
@@ -81,6 +89,7 @@ destroy_thread(void) {
// thread returns.
void *ret;
_thread->join(&ret);
#endif
}
////////////////////////////////////////////////////////////////////
@@ -97,8 +106,10 @@ destroy_thread(void) {
////////////////////////////////////////////////////////////////////
void* AsyncUtility::
st_callback(void *arg) {
#ifdef HAVE_IPC
nassertr(arg != NULL, NULL);
((AsyncUtility *)arg)->callback();
#endif
return NULL;
}
@@ -110,12 +121,14 @@ st_callback(void *arg) {
////////////////////////////////////////////////////////////////////
void AsyncUtility::
callback(void) {
#ifdef HAVE_IPC
while (process_request()) {
// Sleep until a signal arrives
_lock.lock();
_request_cond->wait();
_lock.unlock();
}
#endif
}
////////////////////////////////////////////////////////////////////
@@ -125,6 +138,7 @@ callback(void) {
////////////////////////////////////////////////////////////////////
void AsyncUtility::
nap(void) const {
#ifdef HAVE_IPC
#ifdef WIN32
_sleep(1000 * _frequency);
#else
@@ -133,4 +147,5 @@ nap(void) const {
tv.tv_usec = (long)(1000000 * _frequency);
select(0, NULL, NULL, NULL, &tv);
#endif
#endif // HAVE_IPC
}
+10 -3
View File
@@ -11,10 +11,14 @@
////////////////////////////////////////////////////////////////////
#include <pandabase.h>
#include <notify.h>
#include <typedef.h>
#ifdef HAVE_IPC
#include <ipc_mutex.h>
#include <ipc_condition.h>
#include <ipc_thread.h>
#include <typedef.h>
#endif
////////////////////////////////////////////////////////////////////
// Class : AsyncUtility
@@ -41,11 +45,14 @@ protected:
int _next_token;
bool _shutdown;
bool _threaded;
float _frequency;
bool _threads_enabled;
#ifdef HAVE_IPC
mutex _lock;
condition_variable *_request_cond;
thread *_thread;
float _frequency;
bool _threads_enabled;
#endif
};
#include "asyncUtility.I"
+2
View File
@@ -13,7 +13,9 @@
////////////////////////////////////////////////////////////////////
INLINE void Downloader::
set_bandwidth(float bytes) {
#ifdef HAVE_IPC
mutex_lock lock(_bandwidth_frequency_lock);
#endif
_bandwidth = bytes;
}
+12 -2
View File
@@ -18,9 +18,12 @@
#include <list>
#include <errno.h>
#if !defined(WIN32)
#if !defined(WIN32_VC)
// #define errno wsaGetLastError()
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#endif
////////////////////////////////////////////////////////////////////
@@ -247,7 +250,9 @@ request_download(const string &file_name, const Filename &file_dest,
}
// We need to grab the lock in order to signal the condition variable
#ifdef HAVE_IPC
_lock.lock();
#endif
if (_token_board->_waiting.is_full()) {
downloader_cat.error()
@@ -265,9 +270,10 @@ request_download(const string &file_name, const Filename &file_dest,
partial_content);
_token_board->_waiting.insert(tok);
#ifdef HAVE_IPC
_request_cond->signal();
_lock.unlock();
#endif
} else {
// If we're not running asynchronously, process the load request
@@ -480,9 +486,13 @@ download(const string &file_name, Filename file_dest,
for (;;) {
if (_download_enabled) {
// Ensure that these don't change while we're computing read_size
#ifdef HAVE_IPC
_bandwidth_frequency_lock.lock();
#endif
int read_size = (int)(_bandwidth * _frequency);
#ifdef HAVE_IPC
_bandwidth_frequency_lock.unlock();
#endif
// Ensure we have enough room in the buffer to download read_size
// If we don't have enough room, write the buffer to disk
+8 -1
View File
@@ -16,8 +16,12 @@
#include <buffer.h>
#include "asyncUtility.h"
#if defined(WIN32)
#if defined(WIN32_VC)
#include <winsock2.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <resolv.h>
#endif
class DownloaderToken;
@@ -91,7 +95,10 @@ private:
bool _connected;
#ifdef HAVE_IPC
mutex _bandwidth_frequency_lock;
#endif
int _socket;
PT(Buffer) _buffer;
float _bandwidth;
+4 -2
View File
@@ -106,7 +106,9 @@ request_extract(const Filename &source_file, const string &event_name,
}
// We need to grab the lock in order to signal the condition variable
#ifdef HAVE_IPC
_lock.lock();
#endif
if (_token_board->_waiting.is_full()) {
downloader_cat.error()
@@ -123,9 +125,10 @@ request_extract(const Filename &source_file, const string &event_name,
rel_path);
_token_board->_waiting.insert(tok);
#ifdef HAVE_IPC
_request_cond->signal();
_lock.unlock();
#endif
} else {
// If we're not running asynchronously, process the load request
@@ -239,7 +242,6 @@ extract(Filename &source_file, const Filename &rel_path) {
handled_all_input = true;
nap();
}
read_stream.close();
+4 -1
View File
@@ -103,7 +103,9 @@ request_patch(const Filename &patch, const Filename &infile,
}
// We need to grab the lock in order to signal the condition variable
#ifdef HAVE_IPC
_lock.lock();
#endif
if (_token_board->_waiting.is_full()) {
downloader_cat.error()
@@ -119,9 +121,10 @@ request_patch(const Filename &patch, const Filename &infile,
tok = new PatcherToken(_next_token++, patch, infile, event_name);
_token_board->_waiting.insert(tok);
#ifdef HAVE_IPC
_request_cond->signal();
_lock.unlock();
#endif
} else {
// If we're not running asynchronously, process the load request
+9 -1
View File
@@ -1,6 +1,7 @@
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolutil:c dtoolbase:c dtool:m pystub
#define LOCAL_LIBS downloader express event ipc
#define USE_ZLIB yes
#define USE_IPC yes
#define DIRECTORY_IF_IPC yes
#begin bin_target
#define TARGET apply_patch
@@ -23,6 +24,7 @@
#begin bin_target
#define TARGET check_adler
#define TARGET_IF_ZLIB yes
#define USE_ZLIB yes
#define SOURCES \
check_adler.cxx
@@ -31,6 +33,8 @@
#begin bin_target
#define TARGET check_crc
#define TARGET_IF_ZLIB yes
#define USE_ZLIB yes
#define SOURCES \
check_crc.cxx
@@ -47,6 +51,8 @@
#begin bin_target
#define TARGET pcompress
#define TARGET_IF_ZLIB yes
#define USE_ZLIB yes
#define SOURCES \
pcompress.cxx
@@ -55,6 +61,8 @@
#begin bin_target
#define TARGET pdecompress
#define TARGET_IF_ZLIB yes
#define USE_ZLIB yes
#define SOURCES \
pdecompress.cxx
+1 -1
View File
@@ -82,7 +82,7 @@ get_num_parameters() const {
////////////////////////////////////////////////////////////////////
EventParameter Event::
get_parameter(int n) const {
nassertr(n >= 0 && n < _parameters.size(), EventParameter(0));
nassertr(n >= 0 && n < (int)_parameters.size(), EventParameter(0));
return _parameters[n];
}
+2
View File
@@ -34,7 +34,9 @@ EventQueue::
////////////////////////////////////////////////////////////////////
void EventQueue::
queue_event(CPT_Event event) {
#ifdef HAVE_IPC
mutex_lock lock(_lock);
#endif
if (_queue.is_full()) {
event_cat.error()
<< "Ignoring event " << *event << "; event queue full.\n";
+5
View File
@@ -12,7 +12,10 @@
#include "pt_Event.h"
#include <circBuffer.h>
#ifdef HAVE_IPC
#include <ipc_mutex.h>
#endif
////////////////////////////////////////////////////////////////////
// Class : EventQueue
@@ -42,7 +45,9 @@ protected:
static void make_global_event_queue();
static EventQueue *_global_event_queue;
#ifdef HAVE_IPC
mutex _lock;
#endif
};
#include "eventQueue.I"
+5 -2
View File
@@ -10,7 +10,9 @@
circBuffer.I circBuffer.h clockObject.I clockObject.cxx \
clockObject.h config_express.cxx config_express.h datagram.I \
datagram.cxx datagram.h datagramGenerator.I datagramGenerator.cxx \
datagramGenerator.h datagramIterator.cxx datagramIterator.h \
datagramGenerator.h datagramInputFile.I datagramInputFile.h \
datagramInputFile.cxx datagramIterator.cxx datagramIterator.h \
datagramOutputFile.I datagramOutputFile.h datagramOutputFile.cxx \
datagramSink.I datagramSink.cxx datagramSink.h \
get_config_path.cxx get_config_path.h \
indent.I indent.cxx indent.h littleEndian.I \
@@ -27,7 +29,8 @@
#define INSTALL_HEADERS \
bigEndian.I bigEndian.h buffer.I buffer.h circBuffer.I \
circBuffer.h clockObject.I clockObject.h config_express.h \
datagram.I datagram.h datagramIterator.h \
datagram.I datagram.h datagramInputFile.I datagramInputFile.h \
datagramIterator.h datagramOutputFile.I datagramOutputFile.h \
datagramSink.I datagramSink.h datagramGenerator.I \
datagramGenerator.h get_config_path.h \
indent.I indent.h littleEndian.I littleEndian.h \
+11 -10
View File
@@ -1,16 +1,17 @@
// Filename: datagramGenerator.cxx
// Created by: jason (07Jun00)
//
// Filename: datagramGenerator.cxx
// Created by: jason (07Jun00)
//
#include <pandabase.h>
#include "datagramGenerator.h"
////////////////////////////////////////////////////////////////////
// Function: DatagramGenerator::Destructor
// Access: Public
// Description: Does nothing since this is class is just
// the definition of an interface
////////////////////////////////////////////////////////////////////
DatagramGenerator::~DatagramGenerator(void){
////////////////////////////////////////////////////////////////////
// Function: DatagramGenerator::Destructor
// Access: Public, Virtual>
// Description: Does nothing since this is class is just
// the definition of an interface
////////////////////////////////////////////////////////////////////
DatagramGenerator::
~DatagramGenerator() {
}
+4 -4
View File
@@ -17,12 +17,12 @@
////////////////////////////////////////////////////////////////////
class EXPCL_PANDAEXPRESS DatagramGenerator {
public:
INLINE DatagramGenerator(void);
virtual ~DatagramGenerator(void);
INLINE DatagramGenerator();
virtual ~DatagramGenerator();
virtual bool get_datagram(Datagram& dataBlock) = 0;
virtual bool empty(void) = 0;
virtual bool is_valid(void) = 0;
virtual bool is_eof() = 0;
virtual bool is_error() = 0;
};
#include "datagramGenerator.I"
+56
View File
@@ -0,0 +1,56 @@
// Filename: datagramOutputFile.I
// Created by: drose (27Oct00)
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: DatagramOutputFile::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE DatagramOutputFile::
DatagramOutputFile() {
_error = true;
_wrote_first_datagram = false;
}
////////////////////////////////////////////////////////////////////
// Function: DatagramOutputFile::open
// Access: Public
// Description: Opens the indicated filename for reading. Returns
// true if successful, false on failure.
////////////////////////////////////////////////////////////////////
INLINE bool DatagramOutputFile::
open(Filename filename) {
// DatagramOutputFiles are always binary.
_wrote_first_datagram = false;
_error = false;
filename.set_binary();
return filename.open_write(_out);
}
////////////////////////////////////////////////////////////////////
// Function: DatagramOutputFile::is_error
// Access: Public
// Description: Returns true if the file has reached an error
// condition.
////////////////////////////////////////////////////////////////////
INLINE bool DatagramOutputFile::
is_error() {
if (_out.fail()) {
_error = true;
}
return _error;
}
////////////////////////////////////////////////////////////////////
// Function: DatagramOutputFile::close
// Access: Public
// Description: Closes the file. This is also implicitly done when
// the DatagramOutputFile destructs.
////////////////////////////////////////////////////////////////////
INLINE void DatagramOutputFile::
close() {
_out.close();
}
+11 -1
View File
@@ -80,7 +80,6 @@
#include <orthoProjection.h>
#include <transparencyTransition.h>
#include <bamReader.h>
#include <ipc_file.h>
#include <collisionRay.h>
#include <collisionNode.h>
#include <collisionTraverser.h>
@@ -88,6 +87,7 @@
#include <nodePath.h>
#ifdef USE_IPC
#include <ipc_file.h>
#include <ipc_mutex.h>
#include <ipc_thread.h>
#endif
@@ -408,10 +408,12 @@ void event_esc(CPT_Event) {
rib_pipe = NULL;
rib_win = NULL;
#ifdef HAVE_NET
if (PStatClient::get_global_pstats()->is_connected()) {
nout << "Disconnecting from stats host" << endl;
PStatClient::get_global_pstats()->disconnect();
}
#endif
exit(0);
}
@@ -434,17 +436,25 @@ void event_f(CPT_Event) {
}
void event_S(CPT_Event) {
#ifdef HAVE_NET
nout << "Connecting to stats host" << endl;
PStatClient::get_global_pstats()->connect();
#else
nout << "Stats host not supported." << endl;
#endif
}
void event_A(CPT_Event) {
#ifdef HAVE_NET
if (PStatClient::get_global_pstats()->is_connected()) {
nout << "Disconnecting from stats host" << endl;
PStatClient::get_global_pstats()->disconnect();
} else {
nout << "Stats host is already disconnected." << endl;
}
#else
nout << "Stats host not supported." << endl;
#endif
}
void setup_framerate(void) {
+1
View File
@@ -3,6 +3,7 @@
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolutil:c dtoolbase:c dtool:m
#define USE_GL yes
#define USE_GLUT yes
#begin lib_target
#define TARGET glutdisplay
+18 -13
View File
@@ -69,19 +69,22 @@ void Fog::compute_density(void) {
_density = 1.0f;
float opaque_multiplier;
switch (_mode) {
case M_linear:
break;
case M_exponential:
// Multiplier = ln(2^bits)
opaque_multiplier = MathNumbers::ln2 * _hardware_bits;
_density = opaque_multiplier / (_opaque + _opaque_offset);
break;
case M_super_exponential:
// Multiplier = ln(squrt(2^bits))
opaque_multiplier = 0.5f * MathNumbers::ln2 * _hardware_bits;
opaque_multiplier *= opaque_multiplier;
_density = opaque_multiplier / (_opaque + _opaque_offset);
break;
case M_linear:
break;
case M_exponential:
// Multiplier = ln(2^bits)
opaque_multiplier = MathNumbers::ln2 * _hardware_bits;
_density = opaque_multiplier / (_opaque + _opaque_offset);
break;
case M_super_exponential:
// Multiplier = ln(squrt(2^bits))
opaque_multiplier = 0.5f * MathNumbers::ln2 * _hardware_bits;
opaque_multiplier *= opaque_multiplier;
_density = opaque_multiplier / (_opaque + _opaque_offset);
break;
case M_spline:
// *** What's this?
break;
}
}
@@ -102,5 +105,7 @@ output(ostream &out) const {
out << "(" << _hardware_bits << "," << _density
<< "," << _opaque << "," << _opaque_offset << ")";
break;
case M_spline:
break;
};
}
-2
View File
@@ -20,8 +20,6 @@
#include <ioPtaDatagramInt.h>
#include <ioPtaDatagramLinMath.h>
#include <nspr.h>
////////////////////////////////////////////////////////////////////
// Static variables
////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -50,7 +50,7 @@ write_datagram(BamWriter *, Datagram &me)
default:
gobj_cat.error()
<< "Unsupported bam-texture-mode: " << bam_texture_mode << "\n";
<< "Unsupported bam-texture-mode: " << (int)bam_texture_mode << "\n";
}
me.add_string(filename);
+1 -1
View File
@@ -225,7 +225,7 @@ store(PNMImage &pnmimage) const {
gobj_cat.error()
<< "Couldn't write image for " << get_name()
<< "; inappropriate type " << _type << ".\n";
<< "; inappropriate type " << (int)_type << ".\n";
return false;
}
-1
View File
@@ -196,7 +196,6 @@ clear_gsg(GraphicsStateGuardianBase *gsg) {
Contexts::iterator ci;
ci = _contexts.find(gsg);
if (ci != _contexts.end()) {
TextureContext *tc = (*ci).second;
_contexts.erase(ci);
} else {
// If this assertion fails, clear_gsg() was called on a GSG which
+1 -1
View File
@@ -47,7 +47,7 @@ recompute_bound() {
default:
graph_cat.error()
<< "Unexpected _bound_type: " << _bound_type
<< "Unexpected _bound_type: " << (int)_bound_type
<< " in BoundedObject::recompute_bound()\n";
_bound = NULL;
}
+4 -3
View File
@@ -4,7 +4,6 @@
#include "node.h"
#include "nodeRelation.h"
#include <nspr.h>
#include <bamWriter.h>
#include <bamReader.h>
#include <datagramIterator.h>
@@ -187,7 +186,8 @@ get_parent(TypeHandle type, int index) const {
UpRelations::const_iterator uri;
uri = _parents.find(type);
nassertr(uri != _parents.end(), (NodeRelation *)NULL);
nassertr(index >= 0 && index < (*uri).second.size(), (NodeRelation *)NULL);
nassertr(index >= 0 && index < (int)(*uri).second.size(),
(NodeRelation *)NULL);
return (*uri).second[index];
}
@@ -220,7 +220,8 @@ get_child(TypeHandle type, int index) const {
DownRelations::const_iterator dri;
dri = _children.find(type);
nassertr(dri != _children.end(), (NodeRelation *)NULL);
nassertr(index >= 0 && index < (*dri).second.size(), (NodeRelation *)NULL);
nassertr(index >= 0 && index < (int)(*dri).second.size(),
(NodeRelation *)NULL);
return (*dri).second[index];
}
+2
View File
@@ -1,6 +1,8 @@
#define LOCAL_LIBS express pandabase
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolutil:c dtoolbase:c dtool:m
#define USE_NSPR yes
#define USE_IPC yes
#define DIRECTORY_IF_IPC yes
#begin lib_target
#define TARGET ipc
-93
View File
@@ -1,96 +1,3 @@
// Filename: ipc_file.I
// Created by: jason (07Jun00)
//
#include <datagramIterator.h>
#include <config_express.h>
#include <nspr.h>
INLINE bool datagram_file::
open(file_mode mode, string header){
//By definition a file should not be opened for both
//reading and writing
nassertr(mode != FILE_BOTH, false);
_mode = mode;
if (!base_file::open(mode)) return false;
if (!header.empty())
{
if (mode == FILE_READ)
{
string file_header;
if (readin(file_header,header.size()) != (int)header.size()) return false;
if (file_header != header)
{
//Note! Using nout until a config_ipc file is made and therefore
//ipc_cat is made
nout << "File is either damaged or not valid" << endl;
return false;
}
}
else
{
if (writeout(header) != (int)header.size()) return false;
}
}
_valid = true;
return true;
}
INLINE bool datagram_file::
is_valid(void)
{
return _valid;
}
INLINE bool datagram_file::
empty(void){
return file::empty();
}
INLINE bool datagram_file::
get_datagram(Datagram& dataBlock) {
//Only perform reads when mode is set to
//FILE_READ. This is because datagram_file
//can only read or write.
nassertr(_mode == FILE_READ, false);
string header, packet;
if (readin(header,sizeof(PN_uint32)) != sizeof(PN_uint32)) return false;
Datagram size(header.data(), header.size());
DatagramIterator sizescan(size);
PN_uint32 packetsize = sizescan.get_uint32();
if (readin(packet, packetsize) != (int)packetsize) return false;
dataBlock.append_data(packet.data(), packetsize);
return true;
}
INLINE bool datagram_file::
put_datagram(const Datagram& dataBlock) {
//Only perform writes when mode is set to
//FILE_READ or FILE_APPEND. This is because datagram_file
//can only read or write.
nassertr(_mode == FILE_APPEND || _mode == FILE_WRITE, false);
DatagramIterator scanin(dataBlock);
Datagram out;
int datalen = dataBlock.get_length();
//Determine the size of the datagram and add it into the data to be
//written to the file. Then append the message.
out.add_uint32(datalen);
out.append_data(scanin.get_remaining_bytes().data(), datalen);
DatagramIterator scanout(out);
if (writeout(scanout.get_remaining_bytes()) != (int)out.get_length()) return false;
return true;
}
-23
View File
@@ -31,29 +31,6 @@ private:
file_class* _file;
};
class datagram_file : public DatagramGenerator, public DatagramSink, public base_file {
public:
INLINE datagram_file() : base_file(), _valid(false) {}
INLINE datagram_file(const string& file) : base_file(file) {}
virtual ~datagram_file(void){};
INLINE bool open(file_mode mode, string header = "");
INLINE bool empty(void);
INLINE bool get_datagram(Datagram& dataBlock);
INLINE bool put_datagram(const Datagram& dataBlock);
INLINE bool is_valid(void);
protected:
//When someone has a datagram_file, they shouldn't be directly reading from or
//writing to the file
INLINE int readin(string& buffer, int numBytes) {return base_file::readin(buffer, numBytes);}
INLINE int writeout(const string& buffer) {return base_file::writeout(buffer);}
private:
file_mode _mode;
bool _valid;
};
typedef base_file file;
typedef file::file_mode file_mode;
+6 -4
View File
@@ -58,11 +58,13 @@ is_right_handed(CoordinateSystem cs) {
case CS_zup_left:
case CS_yup_left:
return false;
default:
linmath_cat.error()
<< "Invalid coordinate system value: " << (int)cs << "\n";
nassertr(false, false);
return false;
}
linmath_cat.error()
<< "Invalid coordinate system value: " << (int)cs << "\n";
nassertr(false, false);
return false;
}
ostream &
+19 -7
View File
@@ -59,12 +59,18 @@ open_read(const Filename &filename, bool report_errors) {
loader_cat.info() << "Reading " << bam_filename << "\n";
_dfile.setFile(bam_filename.to_os_specific());
if (!_dfile.open(file::FILE_READ, _bam_header)) {
if (!_din.open(bam_filename)) {
loader_cat.error() << "Could not open " << bam_filename << "\n";
return false;
}
_reader = new BamReader(&_dfile);
string head = _din.read_header(_bam_header.size());
if (head != _bam_header) {
loader_cat.error() << bam_filename << " is not a valid BAM file.\n";
return false;
}
_reader = new BamReader(&_din);
if (!_reader->init()) {
close();
return false;
@@ -129,12 +135,17 @@ open_write(const Filename &filename, bool) {
loader_cat.info() << "Writing " << filename << "\n";
_dfile.setFile(filename.to_os_specific());
if (!_dfile.open(file::FILE_WRITE, _bam_header)) {
if (!_dout.open(filename)) {
loader_cat.error() << "Unable to open " << filename << "\n";
return false;
}
_writer = new BamWriter(&_dfile);
if (!_dout.write_header(_bam_header)) {
loader_cat.error() << "Unable to write to " << filename << "\n";
return false;
}
_writer = new BamWriter(&_dout);
if (!_writer->init()) {
close();
@@ -186,7 +197,8 @@ close() {
delete _writer;
_writer = NULL;
}
_dfile.close();
_din.close();
_dout.close();
}
+4 -2
View File
@@ -8,7 +8,8 @@
#include <pandabase.h>
#include <ipc_file.h>
#include <datagramInputFile.h>
#include <datagramOutputFile.h>
class BamReader;
class BamWriter;
@@ -43,7 +44,8 @@ public:
int get_current_minor_ver();
private:
datagram_file _dfile;
DatagramInputFile _din;
DatagramOutputFile _dout;
BamReader *_reader;
BamWriter *_writer;
};
+4 -1
View File
@@ -132,7 +132,9 @@ request_load(const Filename &filename, const string &event_name) {
}
// We need to grab the lock in order to signal the condition variable
#ifdef HAVE_IPC
_lock.lock();
#endif
if (_token_board->_waiting.is_full()) {
loader_cat.error()
@@ -148,9 +150,10 @@ request_load(const Filename &filename, const string &event_name) {
tok = new LoaderToken(_next_token++, filename, event_name);
_token_board->_waiting.insert(tok);
#ifdef HAVE_IPC
_request_cond->signal();
_lock.unlock();
#endif
} else {
// If we're not running asynchronously, process the load request
+1 -1
View File
@@ -63,7 +63,7 @@ get_num_types() const {
////////////////////////////////////////////////////////////////////
LoaderFileType *LoaderFileTypeRegistry::
get_type(int n) const {
nassertr(n >= 0 && n < _types.size(), NULL);
nassertr(n >= 0 && n < (int)_types.size(), NULL);
return _types[n];
}
+10 -8
View File
@@ -212,11 +212,12 @@ get_perspective_projection_mat(CoordinateSystem cs) const {
case CS_yup_left:
return LMatrix4<P_numtype>::convert_mat(CS_yup_right, CS_yup_left) *
get_perspective_projection_mat(CS_yup_right);
default:
mathutil_cat.error()
<< "Invalid coordinate system!\n";
return LMatrix4<P_numtype>::ident_mat();
}
mathutil_cat.error()
<< "Invalid coordinate system!\n";
return LMatrix4<P_numtype>::ident_mat();
}
////////////////////////////////////////////////////////////////////
@@ -258,9 +259,10 @@ get_ortho_projection_mat(CoordinateSystem cs) const {
case CS_yup_left:
return LMatrix4<P_numtype>::convert_mat(CS_yup_right, CS_yup_left) *
get_ortho_projection_mat(CS_yup_right);
}
mathutil_cat.error()
<< "Invalid coordinate system!\n";
return LMatrix4<P_numtype>::ident_mat();
default:
mathutil_cat.error()
<< "Invalid coordinate system!\n";
return LMatrix4<P_numtype>::ident_mat();
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
#begin lib_target
#define TARGET pstatclient
#define LOCAL_LIBS \
net linmath putil
net linmath putil express
#define SOURCES \
config_pstats.cxx config_pstats.h pStatClient.I pStatClient.cxx \
+14 -5
View File
@@ -4,6 +4,13 @@
////////////////////////////////////////////////////////////////////
#include "pStatClient.h"
#ifdef HAVE_NET
// This file only defines anything interesting if we have a network
// interface, in which case the PStatClient actually does something.
// If we don't have a network interface, there's nothing to define
// here.
#include "pStatClientControlMessage.h"
#include "pStatServerControlMessage.h"
#include "pStatCollector.h"
@@ -312,7 +319,7 @@ make_collector(int parent_index, const string &fullname) {
string name = fullname.substr(start);
nassertr(parent_index >= 0 && parent_index < _collectors.size(),
nassertr(parent_index >= 0 && parent_index < (int)_collectors.size(),
PStatCollector());
Collector &parent = _collectors[parent_index];
@@ -329,7 +336,7 @@ make_collector(int parent_index, const string &fullname) {
if (ni != parent._children.end()) {
// We already had a collector by this name; return it.
int index = (*ni).second;
nassertr(index >= 0 && index < _collectors.size(), PStatCollector());
nassertr(index >= 0 && index < (int)_collectors.size(), PStatCollector());
return PStatCollector(this, (*ni).second);
}
@@ -363,7 +370,7 @@ make_collector(int parent_index, const string &fullname,
const RGBColorf &suggested_color, int sort) {
PStatCollector c = make_collector(parent_index, fullname);
nassertr(c._client == this, PStatCollector());
nassertr(c._index >= 0 && c._index < _collectors.size(), PStatCollector());
nassertr(c._index >= 0 && c._index < (int)_collectors.size(), PStatCollector());
PStatCollectorDef *def = _collectors[c._index]._def;
nassertr(def != (PStatCollectorDef *)NULL, PStatCollector());
@@ -399,7 +406,7 @@ make_thread(const string &name) {
if (ni != _threads_by_name.end()) {
// We already had a thread by this name; return it.
int index = (*ni).second;
nassertr(index >= 0 && index < _threads.size(), PStatThread());
nassertr(index >= 0 && index < (int)_threads.size(), PStatThread());
return PStatThread(this, (*ni).second);
}
@@ -484,7 +491,7 @@ start(int collector_index, int thread_index, double as_of) {
////////////////////////////////////////////////////////////////////
void PStatClient::
stop(int collector_index, int thread_index, double as_of) {
nassertv(collector_index >= 0 && collector_index < _collectors.size());
nassertv(collector_index >= 0 && collector_index < (int)_collectors.size());
nassertv(thread_index >= 0 && thread_index < (int)_threads.size());
if (_threads[thread_index]._is_active) {
@@ -753,3 +760,5 @@ connection_reset(const PT(Connection) &connection) {
<< "Ignoring spurious connection_reset() message\n";
}
}
#endif // HAVE_NET
+24 -3
View File
@@ -10,13 +10,16 @@
#include "pStatFrameData.h"
#include <clockObject.h>
#include <vector_int.h>
#include <luse.h>
#ifdef HAVE_NET
#include <connectionManager.h>
#include <queuedConnectionReader.h>
#include <connectionWriter.h>
#include <netAddress.h>
#include <clockObject.h>
#include <vector_int.h>
#include <luse.h>
#endif
class PStatServerControlMessage;
class PStatCollector;
@@ -27,7 +30,12 @@ class PStatThread;
// Class : PStatClient
// Description : Manages the communications to report statistics via a
// network connection to a remote PStatServer.
//
// If HAVE_NET is not defined, we don't have a network
// interface, and therefore this class can't do very
// much. It's therefore defined as a stub class.
////////////////////////////////////////////////////////////////////
#ifdef HAVE_NET
class EXPCL_PANDA PStatClient : public ConnectionManager {
public:
PStatClient();
@@ -133,4 +141,17 @@ private:
#include "pStatClient.I"
#else // HAVE_NET
class EXPCL_PANDA PStatClient {
public:
PStatClient() { }
~PStatClient() { }
static void main_tick() { }
};
#endif // HAVE_NET
#endif
+22
View File
@@ -52,11 +52,16 @@ PStatCollector(PStatClient *client, int index) :
INLINE PStatCollector::
PStatCollector(const string &name, const RGBColorf &suggested_color,
int sort, PStatClient *client) {
#ifdef HAVE_NET
if (client == (PStatClient *)NULL) {
client = PStatClient::get_global_pstats();
}
PStatCollector collector(client->make_collector(0, name, suggested_color, sort));
(*this) = collector;
#else
_client = (PStatClient *)NULL;
_index = 0;
#endif
}
////////////////////////////////////////////////////////////////////
@@ -85,10 +90,15 @@ PStatCollector(const string &name, const RGBColorf &suggested_color,
INLINE PStatCollector::
PStatCollector(const PStatCollector &parent, const string &name,
const RGBColorf &suggested_color, int sort) {
#ifdef HAVE_NET
nassertv(parent._client != (PStatClient *)NULL);
PStatCollector collector(parent._client->make_collector
(parent._index, name, suggested_color, sort));
(*this) = collector;
#else
_client = (PStatClient *)NULL;
_index = 0;
#endif
}
////////////////////////////////////////////////////////////////////
@@ -122,7 +132,9 @@ operator = (const PStatCollector &copy) {
////////////////////////////////////////////////////////////////////
INLINE void PStatCollector::
start() {
#ifdef HAVE_NET
_client->start(_index, 0, _client->_clock.get_real_time());
#endif
}
////////////////////////////////////////////////////////////////////
@@ -132,7 +144,9 @@ start() {
////////////////////////////////////////////////////////////////////
INLINE void PStatCollector::
start(const PStatThread &thread) {
#ifdef HAVE_NET
_client->start(_index, thread._index, _client->_clock.get_real_time());
#endif
}
////////////////////////////////////////////////////////////////////
@@ -146,7 +160,9 @@ start(const PStatThread &thread) {
////////////////////////////////////////////////////////////////////
INLINE void PStatCollector::
start(const PStatThread &thread, double as_of) {
#ifdef HAVE_NET
_client->start(_index, thread._index, as_of);
#endif
}
////////////////////////////////////////////////////////////////////
@@ -157,7 +173,9 @@ start(const PStatThread &thread, double as_of) {
////////////////////////////////////////////////////////////////////
INLINE void PStatCollector::
stop() {
#ifdef HAVE_NET
_client->stop(_index, 0, _client->_clock.get_real_time());
#endif
}
////////////////////////////////////////////////////////////////////
@@ -167,7 +185,9 @@ stop() {
////////////////////////////////////////////////////////////////////
INLINE void PStatCollector::
stop(const PStatThread &thread) {
#ifdef HAVE_NET
_client->stop(_index, thread._index, _client->_clock.get_real_time());
#endif
}
////////////////////////////////////////////////////////////////////
@@ -181,5 +201,7 @@ stop(const PStatThread &thread) {
////////////////////////////////////////////////////////////////////
INLINE void PStatCollector::
stop(const PStatThread &thread, double as_of) {
#ifdef HAVE_NET
_client->stop(_index, thread._index, as_of);
#endif
}
+7
View File
@@ -40,11 +40,16 @@ PStatThread(PStatClient *client, int index) :
////////////////////////////////////////////////////////////////////
INLINE PStatThread::
PStatThread(const string &name, PStatClient *client) {
#ifdef HAVE_NET
if (client == (PStatClient *)NULL) {
client = PStatClient::get_global_pstats();
}
PStatThread thread(client->make_thread(name));
(*this) = thread;
#else
_client = (PStatClient *)NULL;
_index = 0;
#endif
}
////////////////////////////////////////////////////////////////////
@@ -80,5 +85,7 @@ operator = (const PStatThread &copy) {
////////////////////////////////////////////////////////////////////
INLINE void PStatThread::
new_frame() {
#ifdef HAVE_NET
_client->new_frame(_index);
#endif
}
-12
View File
@@ -125,18 +125,6 @@ clear_queue(void)
_deferred_reads.clear();
}
////////////////////////////////////////////////////////////////////
// Function: BamReader::empty
// Access: Public
// Description: Returns if BamReader has read all that it can from
// the given DatagramGenerator
////////////////////////////////////////////////////////////////////
INLINE void BamReader::
empty(void)
{
_source->empty();
}
////////////////////////////////////////////////////////////////////
// Function: parse_params
// Access: Private, Static
+2 -3
View File
@@ -4,7 +4,6 @@
#include <pandabase.h>
#include <notify.h>
#include <nspr.h>
#include "bam.h"
#include "bamReader.h"
@@ -49,7 +48,7 @@ init(void)
{
Datagram header;
if (!_source->is_valid())
if (_source->is_error())
{
return false;
}
@@ -176,7 +175,7 @@ read_object(void)
// return TypedWriteable::Null;
//}
if (!_source->is_valid())
if (_source->is_error())
{
return TypedWriteable::Null;
}
-3
View File
@@ -7,7 +7,6 @@
#include <pandabase.h>
#include <notify.h>
#include <nspr.h>
#include "typedWriteable.h"
#include "datagramGenerator.h"
@@ -60,8 +59,6 @@ public:
INLINE BamReader(DatagramGenerator *generator);
~BamReader(void);
INLINE void empty(void);
bool init(void);
TypedWriteable* read_object(void);
//When a client class asks BamReader to read out an object that it
-1
View File
@@ -7,7 +7,6 @@
#include <pandabase.h>
#include <notify.h>
#include <nspr.h>
#include "typedWriteable.h"
#include "datagramSink.h"
+1
View File
@@ -6,6 +6,7 @@
#define TARGET sgidisplay
#define UNIX_SYS_LIBS \
Xsgivc
#define LOCAL_LIBS display
#define SOURCES \
config_sgidisplay.cxx config_sgidisplay.h sgiGraphicsPipe.cxx \
+1 -1
View File
@@ -216,7 +216,7 @@ get_num_paths() const {
////////////////////////////////////////////////////////////////////
NodePath NodePathCollection::
get_path(int index) const {
nassertr(index >= 0 && index < _node_paths.size(), NodePath());
nassertr(index >= 0 && index < (int)_node_paths.size(), NodePath());
return NodePath(_node_paths[index]);
}
+1 -1
View File
@@ -250,7 +250,7 @@ write_datagram(BamWriter *manager, Datagram &me)
//Write out all of the Geom objects that this node
//stores
me.add_uint16(_geoms.size());
for(int i = 0; i < _geoms.size(); i++)
for(int i = 0; i < (int)_geoms.size(); i++)
{
manager->write_pointer(me, _geoms[i]);
}
@@ -284,6 +284,9 @@ collect_statistics(Geom *geom) {
case G_PER_VERTEX:
_num_normals += num_verts;
break;
case G_OFF:
break;
}
if (geom->get_binding(G_TEXCOORD) == G_PER_VERTEX) {
@@ -359,6 +362,10 @@ collect_statistics(Texture *texture) {
case Texture::FT_nearest_mipmap_linear:
case Texture::FT_linear_mipmap_linear:
is_mipmapped = true;
break;
default:
break;
}
if (is_mipmapped) {
+1 -1
View File
@@ -936,7 +936,7 @@ get_upper_left_3d() const {
}
////////////////////////////////////////////////////////////////////
// Function: TextNode::get_upper_left_3d
// Function: TextNode::get_lower_right_3d
// Access: Public, Scheme
// Description: Returns the lower-right extent of the text object,
// after it has been transformed into 3-d space by
+2
View File
@@ -1,5 +1,7 @@
#define DIRECTORY_IF_GTKMM yes
#define USE_GTKMM yes
#define DIRECTORY_IF_NET yes
#define USE_NET yes
#begin bin_target
#define TARGET gtk-stats
+3
View File
@@ -1,3 +1,6 @@
#define DIRECTORY_IF_NET yes
#define USE_NET yes
#begin lib_target
#define TARGET pstatserver
#define LOCAL_LIBS pandatoolbase
+3
View File
@@ -1,3 +1,6 @@
#define DIRECTORY_IF_NET yes
#define USE_NET yes
#begin bin_target
#define TARGET text-stats
#define LOCAL_LIBS \