mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
general: further warning fixes, use -Wno-unused-variable if NDEBUG
Disabling unused variable checking is needed in NDEBUG builds because of the heavy use of temporary variables in asserts.
This commit is contained in:
parent
1c6ae84cdc
commit
db5dd98d33
@ -71,17 +71,19 @@ operator = (const CPPFunctionType ©) {
|
||||
*/
|
||||
bool CPPFunctionType::
|
||||
accepts_num_parameters(int num_parameters) {
|
||||
assert(num_parameters >= 0);
|
||||
if (_parameters == NULL) {
|
||||
return (num_parameters == 0);
|
||||
}
|
||||
|
||||
size_t actual_num_parameters = _parameters->_parameters.size();
|
||||
// If we passed too many parameters, it must have an ellipsis.
|
||||
if (num_parameters > actual_num_parameters) {
|
||||
if ((size_t)num_parameters > actual_num_parameters) {
|
||||
return _parameters->_includes_ellipsis;
|
||||
}
|
||||
|
||||
// Make sure all superfluous parameters have a default value.
|
||||
for (size_t i = num_parameters; i < actual_num_parameters; ++i) {
|
||||
for (size_t i = (size_t)num_parameters; i < actual_num_parameters; ++i) {
|
||||
CPPInstance *param = _parameters->_parameters[i];
|
||||
if (param->_initializer == NULL) {
|
||||
return false;
|
||||
|
@ -1579,7 +1579,6 @@ handle_if_directive(const string &args, const YYLTYPE &loc) {
|
||||
*/
|
||||
void CPPPreprocessor::
|
||||
handle_include_directive(const string &args, const YYLTYPE &loc) {
|
||||
bool okflag = false;
|
||||
Filename filename;
|
||||
Filename filename_as_referenced;
|
||||
bool angle_quotes = false;
|
||||
@ -1599,7 +1598,6 @@ handle_include_directive(const string &args, const YYLTYPE &loc) {
|
||||
if (!expr.empty()) {
|
||||
if (expr[0] == '"' && expr[expr.size() - 1] == '"') {
|
||||
filename = expr.substr(1, expr.size() - 2);
|
||||
okflag = true;
|
||||
|
||||
if (_files.size() == 1) {
|
||||
// If we're currently processing a top-level file, record the include
|
||||
@ -1614,7 +1612,6 @@ handle_include_directive(const string &args, const YYLTYPE &loc) {
|
||||
// same, as if they used quote marks.
|
||||
angle_quotes = true;
|
||||
}
|
||||
okflag = true;
|
||||
|
||||
if (_files.size() == 1) {
|
||||
// If we're currently processing a top-level file, record the include
|
||||
@ -2552,7 +2549,7 @@ get_number(int c) {
|
||||
loc.last_column = get_col_number();
|
||||
|
||||
YYSTYPE result;
|
||||
result.u.real = pstrtod(num.c_str(), (char **)NULL);
|
||||
result.u.real = (long double)pstrtod(num.c_str(), (char **)NULL);
|
||||
|
||||
return get_literal(REAL, loc, num, result);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ GetInt(const string &sym, int def) {
|
||||
|
||||
float DConfig::
|
||||
GetFloat(const string &sym, float def) {
|
||||
ConfigVariableDouble var(sym, def, "DConfig", ConfigFlags::F_dconfig);
|
||||
ConfigVariableDouble var(sym, (double)def, "DConfig", ConfigFlags::F_dconfig);
|
||||
return (float)var.get_value();
|
||||
}
|
||||
|
||||
|
@ -755,10 +755,10 @@ read_args() {
|
||||
if (_binary_name.empty()) {
|
||||
_binary_name = buffer;
|
||||
}
|
||||
int idx = strlen(buffer) + 1;
|
||||
size_t idx = strlen(buffer) + 1;
|
||||
while (idx < bufsize) {
|
||||
_args.push_back((char*)(buffer + idx));
|
||||
int newidx = strlen(buffer + idx);
|
||||
size_t newidx = strlen(buffer + idx);
|
||||
idx += newidx + 1;
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ format_string(bool value) {
|
||||
INLINE string
|
||||
format_string(float value) {
|
||||
char buffer[32];
|
||||
pdtoa(value, buffer);
|
||||
pdtoa((double)value, buffer);
|
||||
return string(buffer);
|
||||
}
|
||||
|
||||
|
@ -767,12 +767,12 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
|
||||
}
|
||||
|
||||
// Check for a special meaning by name and signature.
|
||||
int first_param = 0;
|
||||
size_t first_param = 0;
|
||||
if (_has_this) {
|
||||
first_param = 1;
|
||||
}
|
||||
|
||||
if (_parameters.size() > (size_t)first_param && _parameters[first_param]._name == "self" &&
|
||||
if (_parameters.size() > first_param && _parameters[first_param]._name == "self" &&
|
||||
TypeManager::is_pointer_to_PyObject(_parameters[first_param]._remap->get_orig_type())) {
|
||||
// Here's a special case. If the first parameter of a nonstatic method
|
||||
// is a PyObject * called "self", then we will automatically fill it in
|
||||
@ -782,9 +782,9 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
|
||||
_flags |= F_explicit_self;
|
||||
}
|
||||
|
||||
if ((int)_parameters.size() == first_param) {
|
||||
if (_parameters.size() == first_param) {
|
||||
_args_type = InterfaceMaker::AT_no_args;
|
||||
} else if ((int)_parameters.size() == first_param + 1 &&
|
||||
} else if (_parameters.size() == first_param + 1 &&
|
||||
_parameters[first_param]._remap->get_default_value() == NULL) {
|
||||
_args_type = InterfaceMaker::AT_single_arg;
|
||||
} else {
|
||||
@ -833,7 +833,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
|
||||
}
|
||||
|
||||
} else if (fname == "size" || fname == "__len__") {
|
||||
if ((int)_parameters.size() == first_param &&
|
||||
if (_parameters.size() == first_param &&
|
||||
TypeManager::is_integer(_return_type->get_new_type())) {
|
||||
// It receives no parameters, and returns an integer.
|
||||
_flags |= F_size;
|
||||
@ -847,7 +847,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
|
||||
}
|
||||
|
||||
} else if (fname == "__iter__") {
|
||||
if ((int)_parameters.size() == first_param &&
|
||||
if (_parameters.size() == first_param &&
|
||||
TypeManager::is_pointer(_return_type->get_new_type())) {
|
||||
// It receives no parameters, and returns a pointer.
|
||||
_flags |= F_iter;
|
||||
@ -870,7 +870,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
|
||||
if (_args_type == InterfaceMaker::AT_varargs) {
|
||||
// Of course methods named "make" can still take kwargs, if they are
|
||||
// named.
|
||||
for (int i = first_param; i < _parameters.size(); ++i) {
|
||||
for (size_t i = first_param; i < _parameters.size(); ++i) {
|
||||
if (_parameters[i]._has_name) {
|
||||
_args_type = InterfaceMaker::AT_keyword_args;
|
||||
break;
|
||||
@ -904,7 +904,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
|
||||
if (_args_type == InterfaceMaker::AT_varargs) {
|
||||
// Every other method can take keyword arguments, if they take more
|
||||
// than one argument, and the arguments are named.
|
||||
for (int i = first_param; i < _parameters.size(); ++i) {
|
||||
for (size_t i = first_param; i < _parameters.size(); ++i) {
|
||||
if (_parameters[i]._has_name) {
|
||||
_args_type |= InterfaceMaker::AT_keyword_args;
|
||||
break;
|
||||
@ -960,7 +960,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
|
||||
|
||||
// Constructors always take varargs, and possibly keyword args.
|
||||
_args_type = InterfaceMaker::AT_varargs;
|
||||
for (int i = first_param; i < _parameters.size(); ++i) {
|
||||
for (size_t i = first_param; i < _parameters.size(); ++i) {
|
||||
if (_parameters[i]._has_name) {
|
||||
_args_type = InterfaceMaker::AT_keyword_args;
|
||||
break;
|
||||
|
@ -3610,8 +3610,8 @@ write_function_for_name(ostream &out, Object *obj,
|
||||
std::set<FunctionRemap *>::iterator sii;
|
||||
for (sii = mii->second.begin(); sii != mii->second.end(); ++sii) {
|
||||
remap = (*sii);
|
||||
int first_param = remap->_has_this ? 1 : 0;
|
||||
for (int i = first_param; i < remap->_parameters.size(); ++i) {
|
||||
size_t first_param = remap->_has_this ? 1u : 0u;
|
||||
for (size_t i = first_param; i < remap->_parameters.size(); ++i) {
|
||||
if (remap->_parameters[i]._has_name) {
|
||||
strip_keyword_args = false;
|
||||
break;
|
||||
|
@ -26,7 +26,7 @@ static PyObject *GetSuperBase(PyObject *self) {
|
||||
|
||||
PyMethodDef Dtool_Methods_DTOOL_SUPER_BASE[] = {
|
||||
{ "DtoolGetSuperBase", (PyCFunction) &GetSuperBase, METH_NOARGS, "Will Return SUPERbase Class"},
|
||||
{ NULL, NULL }
|
||||
{ nullptr, nullptr, 0, nullptr }
|
||||
};
|
||||
|
||||
EXPCL_INTERROGATEDB void Dtool_PyModuleClassInit_DTOOL_SUPER_BASE(PyObject *module) {
|
||||
|
@ -1357,6 +1357,13 @@ def CompileCxx(obj,src,opts):
|
||||
# Enable more warnings.
|
||||
cmd += " -Wall -Wno-reorder -Wno-unused-function"
|
||||
|
||||
if not src.endswith(".c"):
|
||||
cmd += " -Wno-reorder"
|
||||
|
||||
# Ignore unused variables in NDEBUG builds, often used in asserts.
|
||||
if optlevel == 4:
|
||||
cmd += " -Wno-unused-variable"
|
||||
|
||||
if src.endswith(".c"):
|
||||
cmd += ' ' + CFLAGS
|
||||
else:
|
||||
|
@ -130,13 +130,11 @@ add_geom(const Geom *geom, const TransformState *ts) {
|
||||
|
||||
#if BT_BULLET_VERSION >= 282
|
||||
for (it = points.begin(); it != points.end(); ++it) {
|
||||
LVecBase3 v = *it;
|
||||
_shape->addPoint(LVecBase3_to_btVector3(*it), false);
|
||||
}
|
||||
_shape->recalcLocalAabb();
|
||||
#else
|
||||
for (it = points.begin(); it != points.end(); ++it) {
|
||||
LVecBase3 v = *it;
|
||||
_shape->addPoint(LVecBase3_to_btVector3(*it));
|
||||
}
|
||||
#endif
|
||||
|
@ -213,11 +213,11 @@ handle_entries() {
|
||||
prev_trans = prev_trans->set_pos(contact_pos);
|
||||
from_node_path.set_prev_transform(wrt_node, prev_trans);
|
||||
|
||||
{
|
||||
//const LPoint3 new_pos(from_node_path.get_pos(wrt_node));
|
||||
/*{
|
||||
const LPoint3 new_pos(from_node_path.get_pos(wrt_node));
|
||||
CPT(TransformState) new_prev_trans(from_node_path.get_prev_transform(wrt_node));
|
||||
const LPoint3 new_prev_pos(new_prev_trans->get_pos());
|
||||
}
|
||||
}*/
|
||||
|
||||
// recalculate the position delta
|
||||
N = from_node_path.get_pos_delta(wrt_node);
|
||||
|
@ -860,8 +860,6 @@ convert_primitive(const GeomVertexData *vertex_data,
|
||||
}
|
||||
}
|
||||
|
||||
LNormal normal;
|
||||
LColor color;
|
||||
CPT(TransformBlendTable) transformBlendTable = vertex_data->get_transform_blend_table();
|
||||
|
||||
int num_primitives = primitive->get_num_primitives();
|
||||
|
@ -157,9 +157,9 @@ add_float64(PN_float64 value) {
|
||||
INLINE void Datagram::
|
||||
add_stdfloat(PN_stdfloat value) {
|
||||
if (_stdfloat_double) {
|
||||
add_float64(value);
|
||||
add_float64((double)value);
|
||||
} else {
|
||||
add_float32(value);
|
||||
add_float32((float)value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,8 +107,6 @@ private:
|
||||
GeomVertexRewriter *_color;
|
||||
|
||||
// billboard vectors
|
||||
LVector4 _colorv;
|
||||
LVector3 _normalv;
|
||||
LVector3 _eyePos;
|
||||
LVector3 _b1, _b2, _b3, _b4;
|
||||
LVector3 _up, _right;
|
||||
|
@ -323,8 +323,7 @@ generate_vis_points() const {
|
||||
NodePath PfmVizzer::
|
||||
generate_vis_mesh(MeshFace face) const {
|
||||
nassertr(_pfm.is_valid(), NodePath());
|
||||
bool check_aux_pfm = uses_aux_pfm();
|
||||
nassertr(!check_aux_pfm || (_aux_pfm != NULL && _aux_pfm->is_valid()), NodePath());
|
||||
nassertr(!uses_aux_pfm() || (_aux_pfm != NULL && _aux_pfm->is_valid()), NodePath());
|
||||
nassertr(face != 0, NodePath());
|
||||
|
||||
if (_pfm.get_num_channels() == 1 && _vis_columns.empty()) {
|
||||
|
@ -867,7 +867,7 @@ add_segment(int segnum) {
|
||||
int tfirstr = 0, tlastr = 0, tfirstl = 0, tlastl = 0;
|
||||
int i1, i2, t, tn; // t1, t2,
|
||||
point_t tpt;
|
||||
int tritop = 0, tribot = 0, is_swapped = 0;
|
||||
int tribot = 0, is_swapped = 0;
|
||||
int tmptriseg;
|
||||
|
||||
s = seg[segnum];
|
||||
@ -939,7 +939,6 @@ add_segment(int segnum) {
|
||||
else /* v0 already present */
|
||||
{ /* Get the topmost intersecting trapezoid */
|
||||
tfirst = locate_endpoint(&s.v0, &s.v1, s.root0);
|
||||
tritop = 1;
|
||||
}
|
||||
|
||||
|
||||
@ -1294,16 +1293,13 @@ add_segment(int segnum) {
|
||||
// int tmpseg = tr[tr[t].d0].rseg;
|
||||
double y0, yt;
|
||||
point_t tmppt;
|
||||
int tnext, i_d0, i_d1;
|
||||
int tnext, i_d0;
|
||||
|
||||
i_d1 = false;
|
||||
i_d0 = false;
|
||||
if (FP_EQUAL(tr[t].lo.y, s.v0.y))
|
||||
{
|
||||
if (tr[t].lo.x > s.v0.x)
|
||||
i_d0 = true;
|
||||
else
|
||||
i_d1 = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1314,8 +1310,6 @@ add_segment(int segnum) {
|
||||
|
||||
if (_less_than(&tmppt, &tr[t].lo))
|
||||
i_d0 = true;
|
||||
else
|
||||
i_d1 = true;
|
||||
}
|
||||
|
||||
/* check continuity from the top so that the lower-neighbour */
|
||||
@ -1792,7 +1786,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) {
|
||||
int mnew;
|
||||
int v0, v1; //, v0next, v1next;
|
||||
int retval = 0; //, tmp;
|
||||
int do_switch = false;
|
||||
|
||||
// printf("visited size = %d, visited[trnum] = %d\n", visited.size(),
|
||||
// visited[trnum]);
|
||||
@ -1817,7 +1810,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) {
|
||||
v1 = t->lseg;
|
||||
if (from == t->d1)
|
||||
{
|
||||
do_switch = true;
|
||||
mnew = make_new_monotone_poly(mcur, v1, v0);
|
||||
traverse_polygon(mcur, t->d1, trnum, TR_FROM_UP);
|
||||
traverse_polygon(mnew, t->d0, trnum, TR_FROM_UP);
|
||||
@ -1847,7 +1839,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) {
|
||||
v1 = tr[t->u0].rseg;
|
||||
if (from == t->u1)
|
||||
{
|
||||
do_switch = true;
|
||||
mnew = make_new_monotone_poly(mcur, v1, v0);
|
||||
traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN);
|
||||
traverse_polygon(mnew, t->u0, trnum, TR_FROM_DN);
|
||||
@ -1879,7 +1870,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) {
|
||||
if (((dir == TR_FROM_DN) && (t->d1 == from)) ||
|
||||
((dir == TR_FROM_UP) && (t->u1 == from)))
|
||||
{
|
||||
do_switch = true;
|
||||
mnew = make_new_monotone_poly(mcur, v1, v0);
|
||||
traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN);
|
||||
traverse_polygon(mcur, t->d1, trnum, TR_FROM_UP);
|
||||
@ -1905,7 +1895,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) {
|
||||
retval = SP_2UP_LEFT;
|
||||
if ((dir == TR_FROM_UP) && (t->u0 == from))
|
||||
{
|
||||
do_switch = true;
|
||||
mnew = make_new_monotone_poly(mcur, v1, v0);
|
||||
traverse_polygon(mcur, t->u0, trnum, TR_FROM_DN);
|
||||
traverse_polygon(mnew, t->d0, trnum, TR_FROM_UP);
|
||||
@ -1928,7 +1917,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) {
|
||||
retval = SP_2UP_RIGHT;
|
||||
if ((dir == TR_FROM_UP) && (t->u1 == from))
|
||||
{
|
||||
do_switch = true;
|
||||
mnew = make_new_monotone_poly(mcur, v1, v0);
|
||||
traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN);
|
||||
traverse_polygon(mnew, t->d1, trnum, TR_FROM_UP);
|
||||
@ -1957,7 +1945,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) {
|
||||
retval = SP_2DN_LEFT;
|
||||
if (!((dir == TR_FROM_DN) && (t->d0 == from)))
|
||||
{
|
||||
do_switch = true;
|
||||
mnew = make_new_monotone_poly(mcur, v1, v0);
|
||||
traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN);
|
||||
traverse_polygon(mcur, t->d1, trnum, TR_FROM_UP);
|
||||
@ -1981,7 +1968,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) {
|
||||
retval = SP_2DN_RIGHT;
|
||||
if ((dir == TR_FROM_DN) && (t->d1 == from))
|
||||
{
|
||||
do_switch = true;
|
||||
mnew = make_new_monotone_poly(mcur, v1, v0);
|
||||
traverse_polygon(mcur, t->d1, trnum, TR_FROM_UP);
|
||||
traverse_polygon(mnew, t->u1, trnum, TR_FROM_DN);
|
||||
@ -2008,7 +1994,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) {
|
||||
retval = SP_SIMPLE_LRDN;
|
||||
if (dir == TR_FROM_UP)
|
||||
{
|
||||
do_switch = true;
|
||||
mnew = make_new_monotone_poly(mcur, v1, v0);
|
||||
traverse_polygon(mcur, t->u0, trnum, TR_FROM_DN);
|
||||
traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN);
|
||||
@ -2033,7 +2018,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) {
|
||||
retval = SP_SIMPLE_LRUP;
|
||||
if (dir == TR_FROM_UP)
|
||||
{
|
||||
do_switch = true;
|
||||
mnew = make_new_monotone_poly(mcur, v1, v0);
|
||||
traverse_polygon(mcur, t->u0, trnum, TR_FROM_DN);
|
||||
traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN);
|
||||
|
@ -229,7 +229,7 @@ process_primitive(const GeomPrimitive *primitive,
|
||||
CPT(GeomVertexData) vData) {
|
||||
GeomVertexReader vReader(vData, "vertex");
|
||||
GeomVertexReader nReader(vData, "normal");
|
||||
LVecBase3f vertex, normal;
|
||||
LVecBase3f vertex;
|
||||
// CPT(GeomPrimitive) dPrimitive = primitive->decompose();
|
||||
CPT(GeomPrimitive) dPrimitive = primitive;
|
||||
ostream &out = odetrimeshdata_cat.debug();
|
||||
|
@ -136,7 +136,6 @@ void Fog::
|
||||
adjust_to_camera(const TransformState *camera_transform) {
|
||||
LVector3 forward = LVector3::forward();
|
||||
|
||||
LPoint3 onset_point, opaque_point;
|
||||
if (get_num_parents() != 0) {
|
||||
// Linear fog is relative to the fog's net transform in the scene graph.
|
||||
NodePath this_np(this);
|
||||
|
@ -94,8 +94,6 @@ private:
|
||||
bool _needs_recompute_clip;
|
||||
bool _needs_recompute_canvas;
|
||||
|
||||
LVecBase4 _orig_clip_frame;
|
||||
|
||||
bool _has_virtual_frame;
|
||||
LVecBase4 _virtual_frame;
|
||||
|
||||
|
@ -40,16 +40,13 @@ precompute_linear_matrices(Physical *physical,
|
||||
const LinearForceVector &forces) {
|
||||
nassertv(physical);
|
||||
// make sure the physical's in the scene graph, somewhere.
|
||||
PhysicalNode *physical_node = physical->get_physical_node();
|
||||
nassertv(physical_node);
|
||||
nassertv(physical->get_physical_node() != nullptr);
|
||||
|
||||
// by global forces, we mean forces not contained in the physical
|
||||
int global_force_vec_size = forces.size();
|
||||
size_t global_force_vec_size = forces.size();
|
||||
|
||||
// by local forces, we mean members of the physical's force set.
|
||||
int local_force_vec_size = physical->get_linear_forces().size();
|
||||
|
||||
ForceNode *force_node;
|
||||
size_t local_force_vec_size = physical->get_linear_forces().size();
|
||||
|
||||
// prepare the vector
|
||||
_precomputed_linear_matrices.clear();
|
||||
@ -63,8 +60,7 @@ precompute_linear_matrices(Physical *physical,
|
||||
LinearForceVector::const_iterator fi;
|
||||
for (fi = forces.begin(); fi != forces.end(); ++fi) {
|
||||
// LinearForce *cur_force = *fi;
|
||||
force_node = (*fi)->get_force_node();
|
||||
nassertv(force_node != (ForceNode *) NULL);
|
||||
nassertv((*fi)->get_force_node() != nullptr);
|
||||
|
||||
NodePath force_np = (*fi)->get_force_node_path();
|
||||
_precomputed_linear_matrices.push_back(
|
||||
@ -74,8 +70,7 @@ precompute_linear_matrices(Physical *physical,
|
||||
// tally the local xforms
|
||||
const LinearForceVector &force_vector = physical->get_linear_forces();
|
||||
for (fi = force_vector.begin(); fi != force_vector.end(); ++fi) {
|
||||
force_node = (*fi)->get_force_node();
|
||||
nassertv(force_node != (ForceNode *) NULL);
|
||||
nassertv((*fi)->get_force_node() != nullptr);
|
||||
|
||||
NodePath force_np = (*fi)->get_force_node_path();
|
||||
_precomputed_linear_matrices.push_back(
|
||||
@ -93,16 +88,13 @@ precompute_angular_matrices(Physical *physical,
|
||||
const AngularForceVector &forces) {
|
||||
nassertv(physical);
|
||||
// make sure the physical's in the scene graph, somewhere.
|
||||
PhysicalNode *physical_node = physical->get_physical_node();
|
||||
nassertv(physical_node != NULL);
|
||||
nassertv(physical->get_physical_node() != nullptr);
|
||||
|
||||
// by global forces, we mean forces not contained in the physical
|
||||
int global_force_vec_size = forces.size();
|
||||
size_t global_force_vec_size = forces.size();
|
||||
|
||||
// by local forces, we mean members of the physical's force set.
|
||||
int local_force_vec_size = physical->get_angular_forces().size();
|
||||
|
||||
ForceNode *force_node;
|
||||
size_t local_force_vec_size = physical->get_angular_forces().size();
|
||||
|
||||
// prepare the vector
|
||||
_precomputed_angular_matrices.clear();
|
||||
@ -115,8 +107,7 @@ precompute_angular_matrices(Physical *physical,
|
||||
// tally the global xforms
|
||||
AngularForceVector::const_iterator fi;
|
||||
for (fi = forces.begin(); fi != forces.end(); ++fi) {
|
||||
force_node = (*fi)->get_force_node();
|
||||
nassertv(force_node != (ForceNode *) NULL);
|
||||
nassertv((*fi)->get_force_node() != nullptr);
|
||||
|
||||
NodePath force_np = (*fi)->get_force_node_path();
|
||||
_precomputed_angular_matrices.push_back(
|
||||
@ -126,8 +117,7 @@ precompute_angular_matrices(Physical *physical,
|
||||
// tally the local xforms
|
||||
const AngularForceVector &force_vector = physical->get_angular_forces();
|
||||
for (fi = force_vector.begin(); fi != force_vector.end(); ++fi) {
|
||||
force_node = (*fi)->get_force_node();
|
||||
nassertv(force_node != (ForceNode *) NULL);
|
||||
nassertv((*fi)->get_force_node() != nullptr);
|
||||
|
||||
NodePath force_np = (*fi)->get_force_node_path();
|
||||
_precomputed_angular_matrices.push_back(
|
||||
|
@ -57,7 +57,7 @@ attach_physicalnode(PhysicalNode *p) {
|
||||
INLINE void PhysicsManager::
|
||||
attach_physical_node(PhysicalNode *p) {
|
||||
nassertv(p);
|
||||
for (int i = 0; i < p->get_num_physicals(); ++i) {
|
||||
for (size_t i = 0; i < p->get_num_physicals(); ++i) {
|
||||
attach_physical(p->get_physical(i));
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ remove_physical(Physical *p) {
|
||||
void PhysicsManager::
|
||||
remove_physical_node(PhysicalNode *p) {
|
||||
nassertv(p);
|
||||
for (int i = 0; i < p->get_num_physicals(); ++i) {
|
||||
for (size_t i = 0; i < p->get_num_physicals(); ++i) {
|
||||
remove_physical(p->get_physical(i));
|
||||
}
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ find_character_gsets(PandaNode *root, CPT(Geom) &ch, CPT(Geom) &dot,
|
||||
const Geom *geom = geode->get_geom(i);
|
||||
|
||||
bool found_points = false;
|
||||
for (int j = 0; j < geom->get_num_primitives() && !found_points; j++) {
|
||||
for (size_t j = 0; j < geom->get_num_primitives() && !found_points; ++j) {
|
||||
const GeomPrimitive *primitive = geom->get_primitive(j);
|
||||
if (primitive->is_of_type(GeomPoints::get_class_type())) {
|
||||
dot = geom;
|
||||
|
@ -697,7 +697,6 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader,
|
||||
|
||||
// Texture coordinates.
|
||||
for (int si = 0; si < max_stage_index; ++si) {
|
||||
LTexCoord d;
|
||||
(*texgen_func[si])(v->tex_coord[si], tcdata[si]);
|
||||
}
|
||||
|
||||
|
@ -348,10 +348,10 @@
|
||||
int n;
|
||||
#ifdef INTERP_Z
|
||||
ZPOINT *pz;
|
||||
unsigned int z,zz;
|
||||
UNUSED unsigned int z,zz;
|
||||
#endif
|
||||
#ifdef INTERP_RGB
|
||||
unsigned int or1,og1,ob1,oa1;
|
||||
UNUSED unsigned int or1,og1,ob1,oa1;
|
||||
#endif
|
||||
#ifdef INTERP_ST
|
||||
unsigned int s,t;
|
||||
|
@ -31,7 +31,7 @@ static void
|
||||
FNAME(flat_untextured) (ZBuffer *zb,
|
||||
ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2)
|
||||
{
|
||||
int color;
|
||||
UNUSED int color;
|
||||
int or0, og0, ob0, oa0;
|
||||
|
||||
#define INTERP_Z
|
||||
|
@ -117,6 +117,14 @@ get_collector_index() const {
|
||||
return _collector_index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the thread index.
|
||||
*/
|
||||
int GtkStatsLabel::
|
||||
get_thread_index() const {
|
||||
return _thread_index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the visual highlight for this label.
|
||||
*/
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
int get_height() const;
|
||||
|
||||
int get_collector_index() const;
|
||||
int get_thread_index() const;
|
||||
|
||||
void set_highlight(bool highlight);
|
||||
bool get_highlight() const;
|
||||
|
@ -270,7 +270,6 @@ process_ref_plane_res(const string &line) {
|
||||
}
|
||||
|
||||
bool okflag = true;
|
||||
LPoint3d pos;
|
||||
okflag &= string_to_double(words[1], _ref_plane_res[0]);
|
||||
okflag &= string_to_double(words[2], _ref_plane_res[1]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user