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