code cleanup: warnings, also add check in crash handler that a wmWindowManager is present.

This commit is contained in:
Campbell Barton 2013-01-11 03:21:24 +00:00
parent 65497a25ba
commit 4d7583b66f
7 changed files with 22 additions and 10 deletions

@ -330,13 +330,17 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents)
{
#if 0
int keyno = 0;
#endif
if(!(mesh && b_mesh && b_ob && CData))
return false;
#if 0
Transform tfm = get_transform(b_ob->matrix_world());
Transform itfm = transform_quick_inverse(tfm);
#endif
BL::Object::modifiers_iterator b_mod;
for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
@ -348,12 +352,13 @@ bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Parti
BL::ParticleSettings b_part((const PointerRNA)b_psys.settings().ptr);
if((b_psys.settings().render_type()==BL::ParticleSettings::render_type_PATH)&&(b_psys.settings().type()==BL::ParticleSettings::type_HAIR)) {
#if 0
int mi = clamp(b_psys.settings().material()-1, 0, mesh->used_shaders.size()-1);
int shader = mesh->used_shaders[mi];
int draw_step = b_psys.settings().draw_step();
int ren_step = (int)pow((float)2.0f,(float)draw_step);
/*b_psys.settings().render_step(draw_step);*/
b_psys.settings().render_step(draw_step);
#endif
int totparts = b_psys.particles.length();
int totchild = b_psys.child_particles.length() * b_psys.settings().draw_percentage() / 100;
@ -397,13 +402,16 @@ bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Parti
bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool use_parents, int vcol_num)
{
#if 0
int keyno = 0;
#endif
if(!(mesh && b_mesh && b_ob && CData))
return false;
#if 0
Transform tfm = get_transform(b_ob->matrix_world());
Transform itfm = transform_quick_inverse(tfm);
#endif
BL::Object::modifiers_iterator b_mod;
for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
@ -415,13 +423,13 @@ bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
BL::ParticleSettings b_part((const PointerRNA)b_psys.settings().ptr);
if((b_psys.settings().render_type()==BL::ParticleSettings::render_type_PATH)&&(b_psys.settings().type()==BL::ParticleSettings::type_HAIR)) {
#if 0
int mi = clamp(b_psys.settings().material()-1, 0, mesh->used_shaders.size()-1);
int shader = mesh->used_shaders[mi];
int draw_step = b_psys.settings().draw_step();
int ren_step = (int)pow((float)2.0f,(float)draw_step);
/*b_psys.settings().render_step(draw_step);*/
b_psys.settings().render_step(draw_step);
#endif
int totparts = b_psys.particles.length();
int totchild = b_psys.child_particles.length() * b_psys.settings().draw_percentage() / 100;
int totcurves = totchild;

@ -2345,6 +2345,7 @@ void CustomData_bmesh_merge(CustomData *source, CustomData *dest,
default: /* should never happen */
BLI_assert(!"invalid type given");
iter_type = BM_VERTS_OF_MESH;
totelem = bm->totvert;
}
CustomData_merge(source, dest, mask, alloctype, 0);

@ -275,9 +275,11 @@ EnumPropertyItem image_color_mode_items[] = {
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
#define IMAGE_COLOR_MODE_BW image_color_mode_items[0]
#define IMAGE_COLOR_MODE_RGB image_color_mode_items[1]
#define IMAGE_COLOR_MODE_RGBA image_color_mode_items[2]
#endif
EnumPropertyItem image_color_depth_items[] = {
/* 1 (monochrome) not used */

@ -519,7 +519,9 @@ static void blender_crash_handler(int signum)
fname, errno ? strerror(errno) : "Unknown error opening file");
}
else {
BKE_report_write_file_fp(fp, &wm->reports, header);
if (wm) {
BKE_report_write_file_fp(fp, &wm->reports, header);
}
blender_crash_handler_backtrace(fp);

@ -42,7 +42,6 @@ typedef unsigned __int64 uint_ptr;
typedef unsigned long uint_ptr;
#endif
#define KX_INERTIA_INFINITE 10000
#include "RAS_IPolygonMaterial.h"
#include "KX_BlenderMaterial.h"
#include "KX_GameObject.h"

@ -83,7 +83,7 @@
// not valid, skip rendering this frame.
//#define NZC_GUARDED_OUTPUT
#define DEFAULT_LOGIC_TIC_RATE 60.0
#define DEFAULT_PHYSICS_TIC_RATE 60.0
//#define DEFAULT_PHYSICS_TIC_RATE 60.0
#ifdef FREE_WINDOWS /* XXX mingw64 (gcc 4.7.0) defines a macro for DrawText that translates to DrawTextA. Not good */
#ifdef DrawText

@ -198,7 +198,7 @@ static PyObject *gp_OrigPythonSysModules= NULL;
/* Macro for building the keyboard translation */
//#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, PyLong_FromLong(SCA_IInputDevice::KX_##name))
#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, item=PyLong_FromLong(name)); Py_DECREF(item)
//#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, item=PyLong_FromLong(name)); Py_DECREF(item)
/* For the defines for types from logic bricks, we do stuff explicitly... */
#define KX_MACRO_addTypesToDict(dict, name, name2) PyDict_SetItemString(dict, #name, item=PyLong_FromLong(name2)); Py_DECREF(item)