forked from bartvdbraak/blender
style cleanup
This commit is contained in:
parent
dd106b5c7a
commit
5549904171
@ -1580,11 +1580,11 @@ int BKE_node_clipboard_validate(void)
|
||||
|
||||
/* lists must be aligned */
|
||||
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;
|
||||
node;
|
||||
node = node->next, node_info = node_info->next)
|
||||
node;
|
||||
node = node->next, node_info = node_info->next)
|
||||
{
|
||||
/* validate the node against the stored node info */
|
||||
|
||||
|
@ -104,7 +104,7 @@ private:
|
||||
#endif
|
||||
|
||||
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,
|
||||
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
|
||||
* -> 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
|
||||
* gets deleted as it is no longer required.
|
||||
* last two keyframes and the new-keyframe match, the last existing keyframe
|
||||
* gets deleted as it is no longer required.
|
||||
* -> 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));
|
||||
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)
|
||||
{
|
||||
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_EXT:
|
||||
@ -2639,7 +2639,7 @@ static void node_composit_buts_trackpos(uiLayout *layout, bContext *C, PointerRN
|
||||
static void node_composit_set_butfunc(bNodeType *ntype)
|
||||
{
|
||||
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:
|
||||
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 */
|
||||
for (i = 0, fp = linear_buffer, cp = byte_buffer;
|
||||
i < channels * width * height;
|
||||
i++, fp++, cp++)
|
||||
i++, fp++, cp++)
|
||||
{
|
||||
*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,
|
||||
const MVert *mvert,
|
||||
int totvert,
|
||||
const MVert *mvert,
|
||||
int totvert,
|
||||
const MEdge *medge,
|
||||
const MeshElemMap *emap,
|
||||
int totedge)
|
||||
const MeshElemMap *emap,
|
||||
int totedge)
|
||||
{
|
||||
BLI_Stack *stack;
|
||||
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 */
|
||||
|
@ -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*/
|
||||
if (rd->qtcodecsettings.codecType) {
|
||||
qtexport->frameAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
stringWithCodecType(rd->qtcodecsettings.codecType),
|
||||
QTAddImageCodecType,
|
||||
[NSNumber numberWithLong:((rd->qtcodecsettings.codecSpatialQuality)*codecLosslessQuality)/100],
|
||||
QTAddImageCodecQuality,
|
||||
nil];
|
||||
qtexport->frameAttributes = [
|
||||
NSDictionary dictionaryWithObjectsAndKeys:
|
||||
stringWithCodecType(rd->qtcodecsettings.codecType),
|
||||
QTAddImageCodecType,
|
||||
[NSNumber numberWithLong:((rd->qtcodecsettings.codecSpatialQuality)*codecLosslessQuality)/100],
|
||||
QTAddImageCodecQuality,
|
||||
nil];
|
||||
}
|
||||
else {
|
||||
qtexport->frameAttributes = [NSDictionary dictionaryWithObjectsAndKeys:@"jpeg",
|
||||
QTAddImageCodecType,
|
||||
[NSNumber numberWithLong:codecHighQuality],
|
||||
QTAddImageCodecQuality,
|
||||
nil];
|
||||
qtexport->frameAttributes = [
|
||||
NSDictionary dictionaryWithObjectsAndKeys:@"jpeg",
|
||||
QTAddImageCodecType,
|
||||
[NSNumber numberWithLong:codecHighQuality],
|
||||
QTAddImageCodecQuality,
|
||||
nil];
|
||||
}
|
||||
[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);
|
||||
|
||||
if (!ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) && !ISTIMER(event->type)) {
|
||||
|
||||
if (!ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) && !ISTIMER(event->type)) {
|
||||
|
||||
/* test for CLICK events */
|
||||
if (wm_action_not_handled(action)) {
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
|
||||
/* 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) {
|
||||
win->eventstate->check_click = TRUE;
|
||||
|
@ -632,9 +632,9 @@ void BL_ConvertSensors(struct Object* blenderobject,
|
||||
uniqueval->Release();
|
||||
|
||||
/* Conversion succeeded, so we can set the generic props here. */
|
||||
gamesensor->SetPulseMode(pos_pulsemode,
|
||||
neg_pulsemode,
|
||||
frequency);
|
||||
gamesensor->SetPulseMode(pos_pulsemode,
|
||||
neg_pulsemode,
|
||||
frequency);
|
||||
gamesensor->SetInvert(invert);
|
||||
gamesensor->SetLevel(level);
|
||||
gamesensor->SetTap(tap);
|
||||
|
@ -48,13 +48,13 @@
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
SCA_RandomActuator::SCA_RandomActuator(SCA_IObject *gameobj,
|
||||
long seed,
|
||||
SCA_RandomActuator::KX_RANDOMACT_MODE mode,
|
||||
float para1,
|
||||
float para2,
|
||||
const STR_String &propName)
|
||||
: SCA_IActuator(gameobj, KX_ACT_RANDOM),
|
||||
m_propname(propName),
|
||||
long seed,
|
||||
SCA_RandomActuator::KX_RANDOMACT_MODE mode,
|
||||
float para1,
|
||||
float para2,
|
||||
const STR_String &propName)
|
||||
: SCA_IActuator(gameobj, KX_ACT_RANDOM),
|
||||
m_propname(propName),
|
||||
m_parameter1(para1),
|
||||
m_parameter2(para2),
|
||||
m_distribution(mode)
|
||||
@ -196,33 +196,30 @@ bool SCA_RandomActuator::Update()
|
||||
|
||||
*/
|
||||
tmpval = new CFloatValue(m_parameter1);
|
||||
} else {
|
||||
/*
|
||||
|
||||
070301 - nzc
|
||||
Now, with seed != 0, we will most assuredly get some
|
||||
sensible values. The termination condition states two
|
||||
things:
|
||||
1. s >= 0 is not allowed: to prevent the distro from
|
||||
getting a bias towards high values. This is a small
|
||||
correction, really, and might also be left out.
|
||||
2. s == 0 is not allowed: to prevent a division by zero
|
||||
when renormalising the drawn value to the desired
|
||||
distribution shape. As a side effect, the distro will
|
||||
never yield the exact mean.
|
||||
I am not sure whether this is consistent, since the error
|
||||
cause by #2 is of the same magnitude as the one
|
||||
prevented by #1. The error introduced into the SD will be
|
||||
improved, though. By how much? Hard to say... If you like
|
||||
the maths, feel free to analyse. Be aware that this is
|
||||
one of the really old standard algorithms. I think the
|
||||
original came in Fortran, was translated to Pascal, and
|
||||
then someone came up with the C code. My guess it that
|
||||
this will be quite sufficient here.
|
||||
|
||||
}
|
||||
else {
|
||||
/* 070301 - nzc
|
||||
* Now, with seed != 0, we will most assuredly get some
|
||||
* sensible values. The termination condition states two
|
||||
* things:
|
||||
* 1. s >= 0 is not allowed: to prevent the distro from
|
||||
* getting a bias towards high values. This is a small
|
||||
* correction, really, and might also be left out.
|
||||
* 2. s == 0 is not allowed: to prevent a division by zero
|
||||
* when renormalising the drawn value to the desired
|
||||
* distribution shape. As a side effect, the distro will
|
||||
* never yield the exact mean.
|
||||
* I am not sure whether this is consistent, since the error
|
||||
* cause by #2 is of the same magnitude as the one
|
||||
* prevented by #1. The error introduced into the SD will be
|
||||
* improved, though. By how much? Hard to say... If you like
|
||||
* the maths, feel free to analyse. Be aware that this is
|
||||
* one of the really old standard algorithms. I think the
|
||||
* original came in Fortran, was translated to Pascal, and
|
||||
* then someone came up with the C code. My guess it that
|
||||
* this will be quite sufficient here.
|
||||
*/
|
||||
do
|
||||
{
|
||||
do {
|
||||
x = 2.0 * m_base->DrawFloat() - 1.0;
|
||||
y = 2.0 * m_base->DrawFloat() - 1.0;
|
||||
s = x*x + y*y;
|
||||
|
@ -165,11 +165,11 @@ void KX_BlenderMaterial::InitTextures()
|
||||
continue;
|
||||
}
|
||||
if (!mTextures[i].InitCubeMap(i, mMaterial->cubemap[i] ) )
|
||||
spit("unable to initialize image("<<i<<") in "<<
|
||||
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!
|
||||
// However, if we're using a custom shader, then we still need to load the textures ourselves.
|
||||
spit("unable to initialize image("<<i<<") in "<<
|
||||
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!
|
||||
* However, if we're using a custom shader, then we still need to load the textures ourselves. */
|
||||
else if (!mMaterial->glslmat || mShader) {
|
||||
if ( mMaterial->img[i] ) {
|
||||
if ( ! mTextures[i].InitFromImage(i, mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 ))
|
||||
|
@ -38,19 +38,19 @@
|
||||
#include "KX_Python.h"
|
||||
#include "KX_PyMath.h"
|
||||
KX_Camera::KX_Camera(void* sgReplicationInfo,
|
||||
SG_Callbacks callbacks,
|
||||
const RAS_CameraData& camdata,
|
||||
bool frustum_culling,
|
||||
bool delete_node)
|
||||
:
|
||||
KX_GameObject(sgReplicationInfo,callbacks),
|
||||
m_camdata(camdata),
|
||||
m_dirty(true),
|
||||
m_normalized(false),
|
||||
m_frustum_culling(frustum_culling),
|
||||
m_set_projection_matrix(false),
|
||||
m_set_frustum_center(false),
|
||||
m_delete_node(delete_node)
|
||||
SG_Callbacks callbacks,
|
||||
const RAS_CameraData& camdata,
|
||||
bool frustum_culling,
|
||||
bool delete_node)
|
||||
:
|
||||
KX_GameObject(sgReplicationInfo,callbacks),
|
||||
m_camdata(camdata),
|
||||
m_dirty(true),
|
||||
m_normalized(false),
|
||||
m_frustum_culling(frustum_culling),
|
||||
m_set_projection_matrix(false),
|
||||
m_set_frustum_center(false),
|
||||
m_delete_node(delete_node)
|
||||
{
|
||||
// setting a name would be nice...
|
||||
m_name = "cam";
|
||||
|
@ -120,7 +120,7 @@ protected:
|
||||
/**
|
||||
* 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.
|
||||
|
@ -48,8 +48,8 @@ public:
|
||||
|
||||
MT_Transform GetTransform() const {
|
||||
return MT_Transform(m_position + m_deltaPosition,
|
||||
MT_Matrix3x3(m_eulerAngles + m_deltaEulerAngles,
|
||||
m_scaling + m_deltaScaling));
|
||||
MT_Matrix3x3(m_eulerAngles + m_deltaEulerAngles,
|
||||
m_scaling + m_deltaScaling));
|
||||
}
|
||||
|
||||
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.
|
||||
*/
|
||||
MT_Point3 m_hitPosition;
|
||||
MT_Point3 m_hitPosition;
|
||||
|
||||
/**
|
||||
* (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.
|
||||
*/
|
||||
MT_Point3 m_prevSourcePoint;
|
||||
|
||||
MT_Point3 m_prevSourcePoint;
|
||||
|
||||
/**
|
||||
* (in game world coordinates) the face normal of the vertex where
|
||||
* the object was hit. */
|
||||
MT_Vector3 m_hitNormal;
|
||||
MT_Vector3 m_hitNormal;
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -180,8 +180,8 @@ void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,cons
|
||||
gp_Rasterizer->DrawDebugLine(from,to,color);
|
||||
}
|
||||
|
||||
void KX_RasterizerDrawDebugCircle(const MT_Vector3& center, const MT_Scalar radius, const MT_Vector3& color,
|
||||
const MT_Vector3& normal, int nsector)
|
||||
void KX_RasterizerDrawDebugCircle(const MT_Vector3& center, const MT_Scalar radius, const MT_Vector3& color,
|
||||
const MT_Vector3& normal, int nsector)
|
||||
{
|
||||
if (gp_Rasterizer)
|
||||
gp_Rasterizer->DrawDebugCircle(center, radius, color, normal, nsector);
|
||||
|
Loading…
Reference in New Issue
Block a user