style cleanup

This commit is contained in:
Campbell Barton 2012-10-29 02:11:40 +00:00
parent dd106b5c7a
commit 5549904171
17 changed files with 93 additions and 94 deletions

@ -1580,11 +1580,11 @@ int BKE_node_clipboard_validate(void)
/* lists must be aligned */ /* lists must be aligned */
BLI_assert(BLI_countlist(&node_clipboard.nodes) == BLI_assert(BLI_countlist(&node_clipboard.nodes) ==
BLI_countlist(&node_clipboard.nodes_extra_info)); BLI_countlist(&node_clipboard.nodes_extra_info));
for (node = node_clipboard.nodes.first, node_info = node_clipboard.nodes_extra_info.first; for (node = node_clipboard.nodes.first, node_info = node_clipboard.nodes_extra_info.first;
node; node;
node = node->next, node_info = node_info->next) node = node->next, node_info = node_info->next)
{ {
/* validate the node against the stored node info */ /* validate the node against the stored node info */

@ -104,7 +104,7 @@ private:
#endif #endif
void create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBone *parent, int totchild, void create_bone(SkinInfo& skin, COLLADAFW::Node *node, EditBone *parent, int totchild,
float parent_mat[][4], bArmature *arm); float parent_mat[][4], bArmature *arm);
void create_unskinned_bone(COLLADAFW::Node *node, EditBone *parent, int totchild, void create_unskinned_bone(COLLADAFW::Node *node, EditBone *parent, int totchild,
float parent_mat[][4], Object * ob_arm); float parent_mat[][4], Object * ob_arm);

@ -479,10 +479,10 @@ static short new_key_needed(FCurve *fcu, float cFrame, float nValue)
/* Frame in which to add a new-keyframe occurs after all other keys /* Frame in which to add a new-keyframe occurs after all other keys
* -> If there are at least two existing keyframes, then if the values of the * -> If there are at least two existing keyframes, then if the values of the
* last two keyframes and the new-keyframe match, the last existing keyframe * last two keyframes and the new-keyframe match, the last existing keyframe
* gets deleted as it is no longer required. * gets deleted as it is no longer required.
* -> Otherwise, a keyframe is just added. 1.0 is added so that fake-2nd-to-last * -> Otherwise, a keyframe is just added. 1.0 is added so that fake-2nd-to-last
* keyframe is not equal to last keyframe. * keyframe is not equal to last keyframe.
*/ */
bezt = (fcu->bezt + (fcu->totvert - 1)); bezt = (fcu->bezt + (fcu->totvert - 1));
valA = bezt->vec[1][1]; valA = bezt->vec[1][1];

@ -1388,7 +1388,7 @@ static void node_shader_buts_glossy(uiLayout *layout, bContext *UNUSED(C), Point
static void node_shader_set_butfunc(bNodeType *ntype) static void node_shader_set_butfunc(bNodeType *ntype)
{ {
switch (ntype->type) { switch (ntype->type) {
/* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */ /* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */
case SH_NODE_MATERIAL: case SH_NODE_MATERIAL:
case SH_NODE_MATERIAL_EXT: case SH_NODE_MATERIAL_EXT:
@ -2639,7 +2639,7 @@ static void node_composit_buts_trackpos(uiLayout *layout, bContext *C, PointerRN
static void node_composit_set_butfunc(bNodeType *ntype) static void node_composit_set_butfunc(bNodeType *ntype)
{ {
switch (ntype->type) { switch (ntype->type) {
/* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */ /* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */
case CMP_NODE_IMAGE: case CMP_NODE_IMAGE:
ntype->uifunc = node_composit_buts_image; ntype->uifunc = node_composit_buts_image;

@ -1225,7 +1225,7 @@ static void *display_buffer_apply_get_linear_buffer(DisplayBufferThread *handle)
/* first convert byte buffer to float, keep in image space */ /* first convert byte buffer to float, keep in image space */
for (i = 0, fp = linear_buffer, cp = byte_buffer; for (i = 0, fp = linear_buffer, cp = byte_buffer;
i < channels * width * height; i < channels * width * height;
i++, fp++, cp++) i++, fp++, cp++)
{ {
*fp = (float)(*cp) / 255.0f; *fp = (float)(*cp) / 255.0f;
} }

@ -697,11 +697,11 @@ static void build_emats_stack(BLI_Stack *stack, int *visited_e, EMat *emat,
} }
static EMat *build_edge_mats(const MVertSkin *vs, static EMat *build_edge_mats(const MVertSkin *vs,
const MVert *mvert, const MVert *mvert,
int totvert, int totvert,
const MEdge *medge, const MEdge *medge,
const MeshElemMap *emap, const MeshElemMap *emap,
int totedge) int totedge)
{ {
BLI_Stack *stack; BLI_Stack *stack;
EMat *emat; EMat *emat;

@ -83,7 +83,7 @@ static int node_shader_gpu_tex_environment(GPUMaterial *mat, bNode *node, GPUNod
} }
} }
return ret; return ret;
} }
/* node type definition */ /* node type definition */

@ -561,19 +561,21 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
/* specifying the codec attributes : try to retrieve them from render data first*/ /* specifying the codec attributes : try to retrieve them from render data first*/
if (rd->qtcodecsettings.codecType) { if (rd->qtcodecsettings.codecType) {
qtexport->frameAttributes = [NSDictionary dictionaryWithObjectsAndKeys: qtexport->frameAttributes = [
stringWithCodecType(rd->qtcodecsettings.codecType), NSDictionary dictionaryWithObjectsAndKeys:
QTAddImageCodecType, stringWithCodecType(rd->qtcodecsettings.codecType),
[NSNumber numberWithLong:((rd->qtcodecsettings.codecSpatialQuality)*codecLosslessQuality)/100], QTAddImageCodecType,
QTAddImageCodecQuality, [NSNumber numberWithLong:((rd->qtcodecsettings.codecSpatialQuality)*codecLosslessQuality)/100],
nil]; QTAddImageCodecQuality,
nil];
} }
else { else {
qtexport->frameAttributes = [NSDictionary dictionaryWithObjectsAndKeys:@"jpeg", qtexport->frameAttributes = [
QTAddImageCodecType, NSDictionary dictionaryWithObjectsAndKeys:@"jpeg",
[NSNumber numberWithLong:codecHighQuality], QTAddImageCodecType,
QTAddImageCodecQuality, [NSNumber numberWithLong:codecHighQuality],
nil]; QTAddImageCodecQuality,
nil];
} }
[qtexport->frameAttributes retain]; [qtexport->frameAttributes retain];

@ -1881,14 +1881,14 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
{ {
int action = wm_handlers_do_intern(C, event, handlers); int action = wm_handlers_do_intern(C, event, handlers);
if (!ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) && !ISTIMER(event->type)) { if (!ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) && !ISTIMER(event->type)) {
/* test for CLICK events */ /* test for CLICK events */
if (wm_action_not_handled(action)) { if (wm_action_not_handled(action)) {
wmWindow *win = CTX_wm_window(C); wmWindow *win = CTX_wm_window(C);
/* eventstate stores if previous event was a KM_PRESS, in case that /* eventstate stores if previous event was a KM_PRESS, in case that
wasn't handled, the KM_RELEASE will become a KM_CLICK */ * wasn't handled, the KM_RELEASE will become a KM_CLICK */
if (win && event->val == KM_PRESS) { if (win && event->val == KM_PRESS) {
win->eventstate->check_click = TRUE; win->eventstate->check_click = TRUE;

@ -632,9 +632,9 @@ void BL_ConvertSensors(struct Object* blenderobject,
uniqueval->Release(); uniqueval->Release();
/* Conversion succeeded, so we can set the generic props here. */ /* Conversion succeeded, so we can set the generic props here. */
gamesensor->SetPulseMode(pos_pulsemode, gamesensor->SetPulseMode(pos_pulsemode,
neg_pulsemode, neg_pulsemode,
frequency); frequency);
gamesensor->SetInvert(invert); gamesensor->SetInvert(invert);
gamesensor->SetLevel(level); gamesensor->SetLevel(level);
gamesensor->SetTap(tap); gamesensor->SetTap(tap);

@ -48,13 +48,13 @@
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
SCA_RandomActuator::SCA_RandomActuator(SCA_IObject *gameobj, SCA_RandomActuator::SCA_RandomActuator(SCA_IObject *gameobj,
long seed, long seed,
SCA_RandomActuator::KX_RANDOMACT_MODE mode, SCA_RandomActuator::KX_RANDOMACT_MODE mode,
float para1, float para1,
float para2, float para2,
const STR_String &propName) const STR_String &propName)
: SCA_IActuator(gameobj, KX_ACT_RANDOM), : SCA_IActuator(gameobj, KX_ACT_RANDOM),
m_propname(propName), m_propname(propName),
m_parameter1(para1), m_parameter1(para1),
m_parameter2(para2), m_parameter2(para2),
m_distribution(mode) m_distribution(mode)
@ -196,33 +196,30 @@ bool SCA_RandomActuator::Update()
*/ */
tmpval = new CFloatValue(m_parameter1); tmpval = new CFloatValue(m_parameter1);
} else { }
/* else {
/* 070301 - nzc
070301 - nzc * Now, with seed != 0, we will most assuredly get some
Now, with seed != 0, we will most assuredly get some * sensible values. The termination condition states two
sensible values. The termination condition states two * things:
things: * 1. s >= 0 is not allowed: to prevent the distro from
1. s >= 0 is not allowed: to prevent the distro from * getting a bias towards high values. This is a small
getting a bias towards high values. This is a small * correction, really, and might also be left out.
correction, really, and might also be left out. * 2. s == 0 is not allowed: to prevent a division by zero
2. s == 0 is not allowed: to prevent a division by zero * when renormalising the drawn value to the desired
when renormalising the drawn value to the desired * distribution shape. As a side effect, the distro will
distribution shape. As a side effect, the distro will * never yield the exact mean.
never yield the exact mean. * I am not sure whether this is consistent, since the error
I am not sure whether this is consistent, since the error * cause by #2 is of the same magnitude as the one
cause by #2 is of the same magnitude as the one * prevented by #1. The error introduced into the SD will be
prevented by #1. The error introduced into the SD will be * improved, though. By how much? Hard to say... If you like
improved, though. By how much? Hard to say... If you like * the maths, feel free to analyse. Be aware that this is
the maths, feel free to analyse. Be aware that this is * one of the really old standard algorithms. I think the
one of the really old standard algorithms. I think the * original came in Fortran, was translated to Pascal, and
original came in Fortran, was translated to Pascal, and * then someone came up with the C code. My guess it that
then someone came up with the C code. My guess it that * this will be quite sufficient here.
this will be quite sufficient here.
*/ */
do do {
{
x = 2.0 * m_base->DrawFloat() - 1.0; x = 2.0 * m_base->DrawFloat() - 1.0;
y = 2.0 * m_base->DrawFloat() - 1.0; y = 2.0 * m_base->DrawFloat() - 1.0;
s = x*x + y*y; s = x*x + y*y;

@ -165,11 +165,11 @@ void KX_BlenderMaterial::InitTextures()
continue; continue;
} }
if (!mTextures[i].InitCubeMap(i, mMaterial->cubemap[i] ) ) if (!mTextures[i].InitCubeMap(i, mMaterial->cubemap[i] ) )
spit("unable to initialize image("<<i<<") in "<< spit("unable to initialize image("<<i<<") in "<<
mMaterial->matname<< ", image will not be available"); mMaterial->matname<< ", image will not be available");
} }
// If we're using glsl materials, the textures are handled by bf_gpu, so don't load them twice! /* If we're using glsl materials, the textures are handled by bf_gpu, so don't load them twice!
// However, if we're using a custom shader, then we still need to load the textures ourselves. * However, if we're using a custom shader, then we still need to load the textures ourselves. */
else if (!mMaterial->glslmat || mShader) { else if (!mMaterial->glslmat || mShader) {
if ( mMaterial->img[i] ) { if ( mMaterial->img[i] ) {
if ( ! mTextures[i].InitFromImage(i, mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 )) if ( ! mTextures[i].InitFromImage(i, mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 ))

@ -38,19 +38,19 @@
#include "KX_Python.h" #include "KX_Python.h"
#include "KX_PyMath.h" #include "KX_PyMath.h"
KX_Camera::KX_Camera(void* sgReplicationInfo, KX_Camera::KX_Camera(void* sgReplicationInfo,
SG_Callbacks callbacks, SG_Callbacks callbacks,
const RAS_CameraData& camdata, const RAS_CameraData& camdata,
bool frustum_culling, bool frustum_culling,
bool delete_node) bool delete_node)
: :
KX_GameObject(sgReplicationInfo,callbacks), KX_GameObject(sgReplicationInfo,callbacks),
m_camdata(camdata), m_camdata(camdata),
m_dirty(true), m_dirty(true),
m_normalized(false), m_normalized(false),
m_frustum_culling(frustum_culling), m_frustum_culling(frustum_culling),
m_set_projection_matrix(false), m_set_projection_matrix(false),
m_set_frustum_center(false), m_set_frustum_center(false),
m_delete_node(delete_node) m_delete_node(delete_node)
{ {
// setting a name would be nice... // setting a name would be nice...
m_name = "cam"; m_name = "cam";

@ -120,7 +120,7 @@ protected:
/** /**
* whether the camera should delete the node itself (only for shadow camera) * whether the camera should delete the node itself (only for shadow camera)
*/ */
bool m_delete_node; bool m_delete_node;
/** /**
* Extracts the camera clip frames from the projection and world-to-camera matrices. * Extracts the camera clip frames from the projection and world-to-camera matrices.

@ -48,8 +48,8 @@ public:
MT_Transform GetTransform() const { MT_Transform GetTransform() const {
return MT_Transform(m_position + m_deltaPosition, return MT_Transform(m_position + m_deltaPosition,
MT_Matrix3x3(m_eulerAngles + m_deltaEulerAngles, MT_Matrix3x3(m_eulerAngles + m_deltaEulerAngles,
m_scaling + m_deltaScaling)); m_scaling + m_deltaScaling));
} }
MT_Point3& GetPosition() { return m_position; } MT_Point3& GetPosition() { return m_position; }

@ -151,27 +151,27 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
/** /**
* (in game world coordinates) the place where the object was hit. * (in game world coordinates) the place where the object was hit.
*/ */
MT_Point3 m_hitPosition; MT_Point3 m_hitPosition;
/** /**
* (in game world coordinates) the position to which to shoot the ray. * (in game world coordinates) the position to which to shoot the ray.
*/ */
MT_Point3 m_prevTargetPoint; MT_Point3 m_prevTargetPoint;
/** /**
* (in game world coordinates) the position from which to shoot the ray. * (in game world coordinates) the position from which to shoot the ray.
*/ */
MT_Point3 m_prevSourcePoint; MT_Point3 m_prevSourcePoint;
/** /**
* (in game world coordinates) the face normal of the vertex where * (in game world coordinates) the face normal of the vertex where
* the object was hit. */ * the object was hit. */
MT_Vector3 m_hitNormal; MT_Vector3 m_hitNormal;
/** /**
* UV texture coordinate of the hit point if any, (0,0) otherwise * UV texture coordinate of the hit point if any, (0,0) otherwise
*/ */
MT_Vector2 m_hitUV; MT_Vector2 m_hitUV;
/** /**
* The KX scene that holds the camera. The camera position * The KX scene that holds the camera. The camera position

@ -180,8 +180,8 @@ void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,cons
gp_Rasterizer->DrawDebugLine(from,to,color); gp_Rasterizer->DrawDebugLine(from,to,color);
} }
void KX_RasterizerDrawDebugCircle(const MT_Vector3& center, const MT_Scalar radius, const MT_Vector3& color, void KX_RasterizerDrawDebugCircle(const MT_Vector3& center, const MT_Scalar radius, const MT_Vector3& color,
const MT_Vector3& normal, int nsector) const MT_Vector3& normal, int nsector)
{ {
if (gp_Rasterizer) if (gp_Rasterizer)
gp_Rasterizer->DrawDebugCircle(center, radius, color, normal, nsector); gp_Rasterizer->DrawDebugCircle(center, radius, color, normal, nsector);