style cleanup

This commit is contained in:
Campbell Barton 2012-06-04 20:11:09 +00:00
parent 510f98576a
commit 5189356d58
34 changed files with 174 additions and 192 deletions

View File

@ -127,10 +127,10 @@ BSP_CSGMeshVertexIt_Construct(
BSP_CSGMesh_VertexIt * v_it = new BSP_CSGMesh_VertexIt;
v_it->mesh = mesh;
if( output->num_elements > 0 )
if ( output->num_elements > 0 )
v_it->pos = &mesh->VertexSet()[0];
output->it = v_it;
};
}
/**

View File

@ -33,118 +33,95 @@
#include "CTR_List.h"
CTR_Link::
CTR_Link(
) :
CTR_Link::CTR_Link() :
m_next(0),
m_prev(0)
{
}
CTR_Link::
CTR_Link(
CTR_Link *next,
CTR_Link *prev
) :
CTR_Link::CTR_Link(CTR_Link *next, CTR_Link *prev) :
m_next(next),
m_prev(prev)
{
}
CTR_Link *
CTR_Link::
getNext(
) const {
CTR_Link *
CTR_Link::getNext() const
{
return m_next;
}
CTR_Link *
CTR_Link::
getPrev(
) const {
CTR_Link *
CTR_Link::getPrev() const
{
return m_prev;
}
bool
CTR_Link::
isHead(
) const {
bool
CTR_Link::isHead() const
{
return m_prev == 0;
}
bool
CTR_Link::
isTail(
) const {
bool
CTR_Link::isTail() const
{
return m_next == 0;
}
void
CTR_Link::
insertBefore(
CTR_Link *link
) {
m_next = link;
m_prev = link->m_prev;
m_next->m_prev = this;
m_prev->m_next = this;
void
CTR_Link::insertBefore(CTR_Link *link)
{
m_next = link;
m_prev = link->m_prev;
m_next->m_prev = this;
m_prev->m_next = this;
}
void
CTR_Link::
insertAfter(
CTR_Link *link
) {
m_next = link->m_next;
m_prev = link;
m_next->m_prev = this;
m_prev->m_next = this;
void
CTR_Link::insertAfter(CTR_Link *link)
{
m_next = link->m_next;
m_prev = link;
m_next->m_prev = this;
m_prev->m_next = this;
}
void
CTR_Link::
remove(
) {
m_next->m_prev = m_prev;
m_prev->m_next = m_next;
void
CTR_Link::remove()
{
m_next->m_prev = m_prev;
m_prev->m_next = m_next;
}
CTR_List::
CTR_List(
) :
CTR_List::CTR_List() :
m_head(&m_tail, 0),
m_tail(0, &m_head)
{
}
CTR_Link *
CTR_List::
getHead(
) const {
CTR_Link *
CTR_List:: getHead() const
{
return m_head.getNext();
}
CTR_Link *
CTR_List::
getTail(
) const {
CTR_Link *
CTR_List::getTail() const
{
return m_tail.getPrev();
}
void
CTR_List::
addHead(
CTR_Link *link
) {
void
CTR_List::addHead(CTR_Link *link)
{
link->insertAfter(&m_head);
}
void
CTR_List::
addTail(
CTR_Link *link
) {
void
CTR_List::addTail(CTR_Link *link)
{
link->insertBefore(&m_tail);
}

View File

@ -41,7 +41,7 @@ public:
GHOST_TSuccess getNumDisplaySettings( GHOST_TUns8 display, GHOST_TInt32& numSettings ) const{ return GHOST_kFailure; }
GHOST_TSuccess getDisplaySetting( GHOST_TUns8 display, GHOST_TInt32 index, GHOST_DisplaySetting& setting ) const { return GHOST_kFailure; }
GHOST_TSuccess getCurrentDisplaySetting( GHOST_TUns8 display, GHOST_DisplaySetting& setting ) const { return getDisplaySetting(display,GHOST_TInt32(0),setting); }
GHOST_TSuccess setCurrentDisplaySetting( GHOST_TUns8 display, const GHOST_DisplaySetting& setting ){ return GHOST_kSuccess; }
GHOST_TSuccess setCurrentDisplaySetting( GHOST_TUns8 display, const GHOST_DisplaySetting& setting ) { return GHOST_kSuccess; }
private:
GHOST_SystemNULL * m_system;

View File

@ -60,27 +60,27 @@ public:
}
protected:
GHOST_TSuccess installDrawingContext( GHOST_TDrawingContextType type ){ return GHOST_kSuccess; }
GHOST_TSuccess removeDrawingContext( ){ return GHOST_kSuccess; }
GHOST_TSuccess setWindowCursorGrab( GHOST_TGrabCursorMode mode ){ return GHOST_kSuccess; }
GHOST_TSuccess setWindowCursorShape( GHOST_TStandardCursor shape ){ return GHOST_kSuccess; }
GHOST_TSuccess installDrawingContext( GHOST_TDrawingContextType type ) { return GHOST_kSuccess; }
GHOST_TSuccess removeDrawingContext( ) { return GHOST_kSuccess; }
GHOST_TSuccess setWindowCursorGrab( GHOST_TGrabCursorMode mode ) { return GHOST_kSuccess; }
GHOST_TSuccess setWindowCursorShape( GHOST_TStandardCursor shape ) { return GHOST_kSuccess; }
GHOST_TSuccess setWindowCustomCursorShape( GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY ) { return GHOST_kSuccess; }
GHOST_TSuccess setWindowCustomCursorShape( GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color ){ return GHOST_kSuccess; }
GHOST_TSuccess setWindowCustomCursorShape( GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color ) { return GHOST_kSuccess; }
bool getValid( ) const { return true; }
void setTitle( const STR_String& title ){ /* nothing */ }
void setTitle( const STR_String& title ) { /* nothing */ }
void getTitle( STR_String& title ) const { title= "untitled"; }
void getWindowBounds( GHOST_Rect& bounds ) const { getClientBounds(bounds); }
void getClientBounds( GHOST_Rect& bounds ) const { /* nothing */ }
GHOST_TSuccess setClientWidth( GHOST_TUns32 width ){ return GHOST_kFailure; }
GHOST_TSuccess setClientHeight( GHOST_TUns32 height ){ return GHOST_kFailure; }
GHOST_TSuccess setClientSize( GHOST_TUns32 width, GHOST_TUns32 height ){ return GHOST_kFailure; }
GHOST_TSuccess setClientWidth( GHOST_TUns32 width ) { return GHOST_kFailure; }
GHOST_TSuccess setClientHeight( GHOST_TUns32 height ) { return GHOST_kFailure; }
GHOST_TSuccess setClientSize( GHOST_TUns32 width, GHOST_TUns32 height ) { return GHOST_kFailure; }
void screenToClient( GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY ) const { outX = inX; outY = inY; }
void clientToScreen( GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY ) const { outX = inX; outY = inY; }
GHOST_TSuccess swapBuffers( ){ return GHOST_kFailure; }
GHOST_TSuccess activateDrawingContext( ){ return GHOST_kFailure; }
~GHOST_WindowNULL( ){ /* nothing */ }
GHOST_TSuccess setWindowCursorVisibility( bool visible ){ return GHOST_kSuccess; }
GHOST_TSuccess swapBuffers( ) { return GHOST_kFailure; }
GHOST_TSuccess activateDrawingContext( ) { return GHOST_kFailure; }
~GHOST_WindowNULL( ) { /* nothing */ }
GHOST_TSuccess setWindowCursorVisibility( bool visible ) { return GHOST_kSuccess; }
GHOST_TSuccess setState(GHOST_TWindowState state) { return GHOST_kSuccess; }
GHOST_TWindowState getState() const { return GHOST_kWindowStateNormal; }
GHOST_TSuccess invalidate() { return GHOST_kSuccess; }

View File

@ -36,7 +36,7 @@
char *eventtype_to_string(GHOST_TEventType type)
{
switch(type) {
switch (type) {
case GHOST_kEventCursorMove: return "CursorMove";
case GHOST_kEventButtonDown: return "ButtonDown";
case GHOST_kEventButtonUp: return "ButtonUp";

View File

@ -72,7 +72,7 @@ struct MEM_Allocator
}
// __p is not permitted to be a null pointer.
void deallocate(pointer __p, size_type){
void deallocate(pointer __p, size_type) {
MEM_freeN(__p);
}

View File

@ -98,7 +98,7 @@
*
* static
* MEM_RefCountPtr<RcUsefullClass>
* New(...){
* New(...) {
* return MEM_RefCountPtr<RcUsefullClass> output(
* new UsefullClass(...)
* );

View File

@ -119,7 +119,7 @@ public :
MEM_SmartPtr(
const MEM_SmartPtr &rhs
){
) {
m_val = rhs.Release();
}

View File

@ -258,7 +258,7 @@ tbool genTangSpace(const SMikkTSpaceContext * pContext, const float fAngularThre
{
const int verts = pContext->m_pInterface->m_getNumVerticesOfFace(pContext, f);
if (verts==3) ++iNrTrianglesIn;
else if(verts==4) iNrTrianglesIn += 2;
else if (verts==4) iNrTrianglesIn += 2;
}
if (iNrTrianglesIn<=0) return TFALSE;
@ -470,11 +470,11 @@ static void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SM
const SVec3 vP = GetPosition(pContext, index);
if (vMin.x > vP.x) vMin.x = vP.x;
else if(vMax.x < vP.x) vMax.x = vP.x;
else if (vMax.x < vP.x) vMax.x = vP.x;
if (vMin.y > vP.y) vMin.y = vP.y;
else if(vMax.y < vP.y) vMax.y = vP.y;
else if (vMax.y < vP.y) vMax.y = vP.y;
if (vMin.z > vP.z) vMin.z = vP.z;
else if(vMax.z < vP.z) vMax.z = vP.z;
else if (vMax.z < vP.z) vMax.z = vP.z;
}
vDim = vsub(vMax,vMin);
@ -485,7 +485,7 @@ static void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SM
iChannel=1;
fMin = vMin.y, fMax=vMax.y;
}
else if(vDim.z>vDim.x)
else if (vDim.z>vDim.x)
{
iChannel=2;
fMin = vMin.z, fMax=vMax.z;
@ -590,7 +590,7 @@ static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], cons
for (l=(iL_in+1); l<=iR_in; l++)
for (c=0; c<3; c++)
if (fvMin[c]>pTmpVert[l].vert[c]) fvMin[c]=pTmpVert[l].vert[c];
else if(fvMax[c]<pTmpVert[l].vert[c]) fvMax[c]=pTmpVert[l].vert[c];
else if (fvMax[c]<pTmpVert[l].vert[c]) fvMax[c]=pTmpVert[l].vert[c];
dx = fvMax[0]-fvMin[0];
dy = fvMax[1]-fvMin[1];
@ -598,7 +598,7 @@ static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], cons
channel = 0;
if (dy>dx && dy>dz) channel=1;
else if(dz>dx) channel=2;
else if (dz>dx) channel=2;
fSep = 0.5f*(fvMax[channel]+fvMin[channel]);
@ -626,7 +626,7 @@ static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], cons
const SVec3 vT2 = GetTexCoord(pContext, index2);
i2rec=i2;
//if(vP==vP2 && vN==vN2 && vT==vT2)
//if (vP==vP2 && vN==vN2 && vT==vT2)
if (vP.x==vP2.x && vP.y==vP2.y && vP.z==vP2.z &&
vN.x==vN2.x && vN.y==vN2.y && vN.z==vN2.z &&
vT.x==vT2.x && vT.y==vT2.y && vT.z==vT2.z)
@ -812,7 +812,7 @@ static int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_
tbool bQuadDiagIs_02;
if (distSQ_02<distSQ_13)
bQuadDiagIs_02 = TTRUE;
else if(distSQ_13<distSQ_02)
else if (distSQ_13<distSQ_02)
bQuadDiagIs_02 = TFALSE;
else
{
@ -1027,7 +1027,7 @@ static void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMi
//printf("found quad with bad mapping\n");
tbool bChooseOrientFirstTri = TFALSE;
if ((pTriInfos[t+1].iFlag&GROUP_WITH_ANY)!=0) bChooseOrientFirstTri = TTRUE;
else if( CalcTexArea(pContext, &piTriListIn[t*3+0]) >= CalcTexArea(pContext, &piTriListIn[(t+1)*3+0]) )
else if ( CalcTexArea(pContext, &piTriListIn[t*3+0]) >= CalcTexArea(pContext, &piTriListIn[(t+1)*3+0]) )
bChooseOrientFirstTri = TTRUE;
// force match
@ -1142,13 +1142,13 @@ static tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[],
const int * pVerts = &piTriListIn[3*iMyTriIndex+0];
int i=-1;
if (pVerts[0]==iVertRep) i=0;
else if(pVerts[1]==iVertRep) i=1;
else if(pVerts[2]==iVertRep) i=2;
else if (pVerts[1]==iVertRep) i=1;
else if (pVerts[2]==iVertRep) i=2;
assert(i>=0 && i<3);
// early out
if (pMyTriInfo->AssignedGroup[i] == pGroup) return TTRUE;
else if(pMyTriInfo->AssignedGroup[i]!=NULL) return TFALSE;
else if (pMyTriInfo->AssignedGroup[i]!=NULL) return TFALSE;
if ((pMyTriInfo->iFlag&GROUP_WITH_ANY)!=0)
{
// first to group with a group-with-anything triangle
@ -1232,8 +1232,8 @@ static tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], con
tbool bFound;
SVec3 n, vOs, vOt;
if (pTriInfos[f].AssignedGroup[0]==pGroup) index=0;
else if(pTriInfos[f].AssignedGroup[1]==pGroup) index=1;
else if(pTriInfos[f].AssignedGroup[2]==pGroup) index=2;
else if (pTriInfos[f].AssignedGroup[1]==pGroup) index=1;
else if (pTriInfos[f].AssignedGroup[2]==pGroup) index=2;
assert(index>=0 && index<3);
iVertIndex = piTriListIn[f*3+index];
@ -1381,8 +1381,8 @@ static STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriL
float fCos, fAngle, fMagS, fMagT;
int i=-1, index=-1, i0=-1, i1=-1, i2=-1;
if (piTriListIn[3*f+0]==iVertexRepresentitive) i=0;
else if(piTriListIn[3*f+1]==iVertexRepresentitive) i=1;
else if(piTriListIn[3*f+2]==iVertexRepresentitive) i=2;
else if (piTriListIn[3*f+1]==iVertexRepresentitive) i=1;
else if (piTriListIn[3*f+2]==iVertexRepresentitive) i=2;
assert(i>=0 && i<3);
// project
@ -1404,8 +1404,8 @@ static STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriL
v2 = vsub(p2,p1);
// project
v1 = vsub(v1, vscale(vdot(n,v1),n)); if( VNotZero(v1) ) v1 = Normalize(v1);
v2 = vsub(v2, vscale(vdot(n,v2),n)); if( VNotZero(v2) ) v2 = Normalize(v2);
v1 = vsub(v1, vscale(vdot(n,v1),n)); if ( VNotZero(v1) ) v1 = Normalize(v1);
v2 = vsub(v2, vscale(vdot(n,v2),n)); if ( VNotZero(v2) ) v2 = Normalize(v2);
// weight contribution by the angle
// between the two edge vectors
@ -1647,7 +1647,7 @@ static void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int
SEdge sTmp;
const int iElems = iRight-iLeft+1;
if (iElems<2) return;
else if(iElems==2)
else if (iElems==2)
{
if (pSortBuffer[iLeft].array[channel] > pSortBuffer[iRight].array[channel])
{
@ -1868,8 +1868,8 @@ static void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriLis
int iFlag = (1<<pV[0]) | (1<<pV[1]) | (1<<pV[2]);
int iMissingIndex = 0;
if ((iFlag&2)==0) iMissingIndex=1;
else if((iFlag&4)==0) iMissingIndex=2;
else if((iFlag&8)==0) iMissingIndex=3;
else if ((iFlag&4)==0) iMissingIndex=2;
else if ((iFlag&8)==0) iMissingIndex=3;
iOrgF = pTriInfos[t].iOrgFaceNumber;
vDstP = GetPosition(pContext, MakeIndex(iOrgF, iMissingIndex));

View File

@ -306,7 +306,7 @@ int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, int num_
if ((y_curr >= 0) && (y_curr < ctx->rb.sizey)) {
/* draw the pixels. */
for (; cpxl <= mpxl; *cpxl++ = 1.0f);
for (; cpxl <= mpxl; *cpxl++ = 1.0f);
}
}

View File

@ -34,7 +34,7 @@ size_t count_utf_8_from_16(const wchar_t *string16)
return 0;
}
for (i = 0; (u = string16[i]); i++) {
for (i = 0; (u = string16[i]); i++) {
if (u < 0x0080) {
count += 1;
}

View File

@ -2674,7 +2674,7 @@ static void basic_force_cb(void *efdata_v, ParticleKey *state, float *force, flo
force[2] += (BLI_frand()-0.5f) * part->brownfac;
}
if(part->flag & PART_ROT_DYN && epoint.ave)
if (part->flag & PART_ROT_DYN && epoint.ave)
copy_v3_v3(pa->state.ave, epoint.ave);
}
/* gathers all forces that effect particles and calculates a new state for the particle */

View File

@ -1003,9 +1003,11 @@ void BKE_ffmpeg_end(void)
fprintf(stderr, "Closing ffmpeg...\n");
/* if (audio_stream) { SEE UPPER
write_audio_frames();
}*/
#if 0
if (audio_stream) { /* SEE UPPER */
write_audio_frames();
}
#endif
#ifdef WITH_AUDASPACE
if (audio_mixdown_device) {

View File

@ -285,8 +285,8 @@ void rgb_to_hsl(float r, float g, float b, float *lh, float *ls, float *ll)
else {
h = (r - g) / d + 4.0f;
}
}
h /= 6.0f;
}
h /= 6.0f;
*lh = h;
*ls = s;
@ -634,23 +634,23 @@ void BLI_init_srgb_conversion(void)
}
static float inverse_srgb_companding(float v)
{
if (v > 0.04045f) {
return powf((v + 0.055f) / 1.055f, 2.4);
}
else {
return v / 12.92f;
}
if (v > 0.04045f) {
return powf((v + 0.055f) / 1.055f, 2.4);
}
else {
return v / 12.92f;
}
}
void rgb_to_xyz(float r, float g, float b, float *x, float *y, float *z)
{
r = inverse_srgb_companding(r) * 100.0f;
g = inverse_srgb_companding(g) * 100.0f;
b = inverse_srgb_companding(b) * 100.0f;
r = inverse_srgb_companding(r) * 100.0f;
g = inverse_srgb_companding(g) * 100.0f;
b = inverse_srgb_companding(b) * 100.0f;
*x = r * 0.4124 + g * 0.3576 + b * 0.1805;
*y = r * 0.2126 + g * 0.7152 + b * 0.0722;
*z = r * 0.0193 + g * 0.1192 + b * 0.9505;
*x = r * 0.4124 + g * 0.3576 + b * 0.1805;
*y = r * 0.2126 + g * 0.7152 + b * 0.0722;
*z = r * 0.0193 + g * 0.1192 + b * 0.9505;
}
static float xyz_to_lab_component(float v)

View File

@ -335,9 +335,9 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size
int BLI_str_utf8_size(const char *p)
{
int mask = 0, len;
unsigned char c = (unsigned char) *p;
unsigned char c = (unsigned char) *p;
UTF8_COMPUTE (c, mask, len);
UTF8_COMPUTE (c, mask, len);
(void)mask; /* quiet warning */

View File

@ -6227,7 +6227,7 @@ static void lib_link_mask(FileData *fd, Main *main)
mask = main->mask.first;
while (mask) {
if(mask->id.flag & LIB_NEEDLINK) {
if (mask->id.flag & LIB_NEEDLINK) {
MaskLayer *masklay;
if (mask->adt)

View File

@ -804,7 +804,7 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node,
bool is_joint = node->getType() == COLLADAFW::Node::JOINT;
COLLADAFW::Node *root = root_map.find(node->getUniqueId()) == root_map.end() ? node : root_map[node->getUniqueId()];
Object *ob = is_joint ? armature_importer->get_armature_for_joint(root) : object_map.find(node->getUniqueId())->second;
Object *ob = is_joint ? armature_importer->get_armature_for_joint(root) : object_map.find(node->getUniqueId())->second;
if (!ob) {
fprintf(stderr, "cannot find Object for Node with id=\"%s\"\n", node->getOriginalId().c_str());
return;

View File

@ -99,8 +99,8 @@ void BaseImageOperation::determineResolution(unsigned int resolution[], unsigned
{
ImBuf *stackbuf = getImBuf();
resolution[0] = 0;
resolution[1] = 0;
resolution[0] = 0;
resolution[1] = 0;
if (stackbuf) {
resolution[0] = stackbuf->x;

View File

@ -166,13 +166,14 @@ static int panels_re_align(ScrArea *sa, ARegion *ar, Panel **r_pa)
static void panels_collapse_all(ScrArea *sa, ARegion *ar)
{
Panel *pa;
int flag = ((panel_aligned(sa, ar)==BUT_HORIZONTAL)? PNL_CLOSEDX: PNL_CLOSEDY);
Panel *pa;
int flag = ((panel_aligned(sa, ar)==BUT_HORIZONTAL) ? PNL_CLOSEDX : PNL_CLOSEDY);
for (pa= ar->panels.first; pa; pa= pa->next) {
if (pa->type && !(pa->type->flag & PNL_NO_HEADER))
pa->flag = flag;
}
for (pa= ar->panels.first; pa; pa= pa->next) {
if (pa->type && !(pa->type->flag & PNL_NO_HEADER)) {
pa->flag = flag;
}
}
}

View File

@ -168,7 +168,7 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname)
scopes->track_preview_height = (scopes->track_preview_height <= UI_UNIT_Y)?UI_UNIT_Y : scopes->track_preview_height;
uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, rect.xmax - rect.xmin,
scopes->track_preview_height, scopes, 0, 0, 0, 0, "");
scopes->track_preview_height, scopes, 0, 0, 0, 0, "");
}
/********************* Marker Template ************************/

View File

@ -282,7 +282,7 @@ void ED_space_clip_mask_aspect(SpaceClip *sc, float *aspx, float *aspy)
*aspy *= (float)h;
#endif
if(*aspx < *aspy) {
if (*aspx < *aspy) {
*aspy= *aspy / *aspx;
*aspx= 1.0f;
}
@ -329,7 +329,7 @@ void ED_space_clip_aspect_dimension_aware(SpaceClip *sc, float *aspx, float *asp
*aspx *= (float)w;
*aspy *= (float)h;
if(*aspx < *aspy) {
if (*aspx < *aspy) {
*aspy= *aspy / *aspx;
*aspx= 1.0f;
}
@ -691,9 +691,11 @@ void ED_space_clip_set_mask(bContext *C, SpaceClip *sc, Mask *mask)
{
sc->mask = mask;
if(sc->mask && sc->mask->id.us==0)
if (sc->mask && sc->mask->id.us==0) {
sc->clip->id.us = 1;
}
if(C)
if (C) {
WM_event_add_notifier(C, NC_MASK|NA_SELECTED, mask);
}
}

View File

@ -367,14 +367,14 @@ static void clip_listener(ScrArea *sa, wmNotifier *wmn)
}
break;
case NC_MASK:
switch(wmn->data) {
switch (wmn->data) {
case ND_SELECT:
case ND_DATA:
case ND_DRAW:
ED_area_tag_redraw(sa);
break;
}
switch(wmn->action) {
switch (wmn->action) {
case NA_SELECTED:
clip_scopes_tag_refresh(sa);
ED_area_tag_redraw(sa);
@ -1097,7 +1097,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar)
/* Grease Pencil */
clip_draw_grease_pencil((bContext *)C, 1);
if(sc->mode == SC_MODE_MASKEDIT) {
if (sc->mode == SC_MODE_MASKEDIT) {
int x, y;
int width, height;
float zoomx, zoomy, aspx, aspy;
@ -1323,7 +1323,7 @@ static void clip_header_area_listener(ARegion *ar, wmNotifier *wmn)
/* for proportional editmode only */
case ND_TOOLSETTINGS:
/* TODO - should do this when in mask mode only but no datas available */
// if(sc->mode == SC_MODE_MASKEDIT)
// if (sc->mode == SC_MODE_MASKEDIT)
{
ED_region_tag_redraw(ar);
}

View File

@ -1114,7 +1114,7 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED(
glDisable(GL_BLEND);
/* outline active and selected emphasis */
if( node->flag & (NODE_ACTIVE|SELECT) ) {
if (node->flag & (NODE_ACTIVE | SELECT)) {
glEnable(GL_BLEND);
glEnable( GL_LINE_SMOOTH );
/* using different shades of TH_TEXT_HI for the empasis, like triangle */
@ -1132,7 +1132,7 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED(
/* only draw input socket. as they all are placed on the same position.
* highlight also if node itself is selected, since we don't display the node body separately!
*/
for(sock= node->inputs.first; sock; sock= sock->next) {
for (sock= node->inputs.first; sock; sock= sock->next) {
node_socket_circle_draw(ntree, sock, socket_size, (sock->flag & SELECT) || (node->flag & SELECT));
}

View File

@ -2756,11 +2756,11 @@ static int add_reroute_intersect_check(bNodeLink *link, float mcoords[][2], int
float coord_array[LINK_RESOL+1][2];
int i, b;
if(node_link_bezier_points(NULL, NULL, link, coord_array, LINK_RESOL)) {
if (node_link_bezier_points(NULL, NULL, link, coord_array, LINK_RESOL)) {
for(i=0; i<tot-1; i++)
for(b=0; b<LINK_RESOL; b++)
if(isect_line_line_v2(mcoords[i], mcoords[i+1], coord_array[b], coord_array[b+1]) > 0) {
for (i=0; i<tot-1; i++)
for (b=0; b<LINK_RESOL; b++)
if (isect_line_line_v2(mcoords[i], mcoords[i+1], coord_array[b], coord_array[b+1]) > 0) {
result[0] = (mcoords[i][0]+mcoords[i+1][0])/2.0f;
result[1] = (mcoords[i][1]+mcoords[i+1][1])/2.0f;
return 1;
@ -2783,18 +2783,18 @@ static int add_reroute_exec(bContext *C, wmOperator *op)
UI_view2d_region_to_view(&ar->v2d, (short)loc[0], (short)loc[1],
&mcoords[i][0], &mcoords[i][1]);
i++;
if(i>= 256) break;
if (i>= 256) break;
}
RNA_END;
if(i>1) {
if (i>1) {
bNodeLink *link;
float insertPoint[2];
ED_preview_kill_jobs(C);
for(link= snode->edittree->links.first; link; link=link->next) {
if(add_reroute_intersect_check(link, mcoords, i, insertPoint)) {
for (link= snode->edittree->links.first; link; link=link->next) {
if (add_reroute_intersect_check(link, mcoords, i, insertPoint)) {
bNodeTemplate ntemp;
bNode *rerouteNode;

View File

@ -76,7 +76,7 @@ static bNode *node_under_mouse_tweak(bNodeTree *ntree, int mx, int my)
{
bNode *node;
for(node=ntree->nodes.last; node; node=node->prev) {
for (node=ntree->nodes.last; node; node=node->prev) {
if (node->typeinfo->tweak_area_func) {
if (node->typeinfo->tweak_area_func(node, mx, my))
return node;

View File

@ -6035,7 +6035,7 @@ void flushTransMasking(TransInfo *t)
invy = 1.0f/aspy;
/* flush to 2d vector from internally used 3d vector */
for(a=0, td = t->data2d, tdm = t->customData; a<t->total; a++, td++, tdm++) {
for (a=0, td = t->data2d, tdm = t->customData; a<t->total; a++, td++, tdm++) {
td->loc2d[0]= td->loc[0]*invx;
td->loc2d[1]= td->loc[1]*invy;

View File

@ -772,7 +772,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
GPU_link(mat, "mtex_value_invert", shadfac, &shadfac);
GPU_link(mat, "mix_mult", shadfac, rgb, GPU_uniform(lamp->shadow_color), &rgb);
GPU_link(mat, "mtex_value_invert", shadfac, &shadfac);
add_to_diffuse(mat, ma, shi, is, rgb, &shr->diff);
add_to_diffuse(mat, ma, shi, is, rgb, &shr->diff);
}
}

View File

@ -176,7 +176,7 @@ bool ColorBlock::isSingleColorNoAlpha() const
int i;
for (i = 0; i < 16; i++)
{
if (m_color[i].a != 0) c = m_color[i];
if (m_color[i].a != 0) c = m_color[i];
}
Color32 mask(0xFF, 0xFF, 0xFF, 0x00);

View File

@ -205,12 +205,12 @@ static MFace *get_dface(DerivedMesh *dm, DerivedMesh *split, int cur, int i, MFa
return df;
}
#define SET_VERTS(a, b, c, d) \
v[0] = mf->v##a; uv[0] = a - 1; \
v[1] = mf->v##b; uv[1] = b - 1; \
v[2] = mf->v##c; uv[2] = c - 1; \
v[3] = mf->v##d; uv[3] = d - 1; \
(void)0
#define SET_VERTS(a, b, c, d) { \
v[0] = mf->v##a; uv[0] = a - 1; \
v[1] = mf->v##b; uv[1] = b - 1; \
v[2] = mf->v##c; uv[2] = c - 1; \
v[3] = mf->v##d; uv[3] = d - 1; \
} (void)0
#define GET_ES(v1, v2) edgecut_get(eh, v1, v2)
#define INT_UV(uvf, c0, c1) interp_v2_v2v2(uvf, mf->uv[c0], mf->uv[c1], 0.5f)

View File

@ -435,7 +435,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (ofs_orig != 0.0f) {
scalar_short = scalar_short_vgroup = ofs_orig / 32767.0f;
mv = mvert + (((ofs_new >= ofs_orig) == do_flip) ? 0 : numVerts); /* as above but swapped, intentional use 'ofs_new' */
mv = mvert + (((ofs_new >= ofs_orig) == do_flip) ? 0 : numVerts); /* as above but swapped */
dv = dvert;
for (i = 0; i < numVerts; i++, mv++) {
if (dv) {

View File

@ -857,7 +857,7 @@ ListBase node_reroute_internal_connect(bNodeTree *ntree, bNode *node)
ret.first = ret.last = NULL;
/* Security check! */
if(!ntree)
if (!ntree)
return ret;
link = MEM_callocN(sizeof(bNodeLink), "internal node link");

View File

@ -170,18 +170,18 @@ static PyTypeObject bpy_lib_Type = {
};
PyDoc_STRVAR(bpy_lib_load_doc,
".. method:: load(filepath, link=False, relative=False)\n"
"\n"
" Returns a context manager which exposes 2 library objects on entering.\n"
" Each object has attributes matching bpy.data which are lists of strings to be linked.\n"
"\n"
" :arg filepath: The path to a blend file.\n"
" :type filepath: string\n"
" :arg link: When False reference to the original file is lost.\n"
" :type link: bool\n"
" :arg relative: When True the path is stored relative to the open blend file.\n"
" :type relative: bool\n"
);
".. method:: load(filepath, link=False, relative=False)\n"
"\n"
" Returns a context manager which exposes 2 library objects on entering.\n"
" Each object has attributes matching bpy.data which are lists of strings to be linked.\n"
"\n"
" :arg filepath: The path to a blend file.\n"
" :type filepath: string\n"
" :arg link: When False reference to the original file is lost.\n"
" :type link: bool\n"
" :arg relative: When True the path is stored relative to the open blend file.\n"
" :type relative: bool\n"
);
static PyObject *bpy_lib_load(PyObject *UNUSED(self), PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"filepath", "link", "relative", NULL};

View File

@ -2174,8 +2174,8 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
/* Options panel */
selected = RNA_boolean_get(op->ptr, "selected");
apply_modifiers = RNA_boolean_get(op->ptr, "apply_modifiers");
include_bone_children = RNA_boolean_get(op->ptr, "include_bone_children");
use_object_instantiation = RNA_boolean_get(op->ptr, "use_object_instantiation");
include_bone_children = RNA_boolean_get(op->ptr, "include_bone_children");
use_object_instantiation = RNA_boolean_get(op->ptr, "use_object_instantiation");
second_life = RNA_boolean_get(op->ptr, "second_life");
/* get editmode results */

View File

@ -2267,10 +2267,10 @@ KX_PYMETHODDEF_DOC(KX_Scene, addObject,
!ConvertPythonToGameObject(pyother, &other, false, "scene.addObject(object, other, time): KX_Scene (second argument)") )
return NULL;
if (!m_inactivelist->SearchValue(ob)) {
PyErr_Format(PyExc_ValueError, "scene.addObject(object, other, time): KX_Scene (second argument): object does not belong to scene");
return NULL;
}
if (!m_inactivelist->SearchValue(ob)) {
PyErr_Format(PyExc_ValueError, "scene.addObject(object, other, time): KX_Scene (second argument): object does not belong to scene");
return NULL;
}
SCA_IObject* replica = AddReplicaObject((SCA_IObject*)ob, other, time);
// release here because AddReplicaObject AddRef's