diff options
-rw-r--r-- | intern/ghost/intern/GHOST_DisplayManagerCocoa.mm | 4 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 12 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 26 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWin32.cpp | 14 | ||||
-rw-r--r-- | intern/locale/boost_locale_wrapper.cpp | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 3 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/MeshImporter.cpp | 10 | ||||
-rw-r--r-- | source/blender/freestyle/intern/stroke/StrokeRep.cpp | 12 | ||||
-rw-r--r-- | source/blender/quicktime/apple/qtkit_export.m | 14 | ||||
-rw-r--r-- | source/blender/quicktime/apple/qtkit_import.m | 28 | ||||
-rw-r--r-- | source/blender/render/intern/include/texture.h | 12 | ||||
-rw-r--r-- | source/blender/render/intern/source/rayshade.c | 2 |
13 files changed, 74 insertions, 67 deletions
diff --git a/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm b/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm index 555f883cbf2..88f338c0649 100644 --- a/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm +++ b/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm @@ -74,7 +74,7 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::getDisplaySetting(GHOST_TUns8 display, else askedDisplay = [[NSScreen screens] objectAtIndex:display]; - if(askedDisplay == nil) { + if (askedDisplay == nil) { [pool drain]; return GHOST_kFailure; } @@ -109,7 +109,7 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::getCurrentDisplaySetting(GHOST_TUns8 d else askedDisplay = [[NSScreen screens] objectAtIndex:display]; - if(askedDisplay == nil) { + if (askedDisplay == nil) { [pool drain]; return GHOST_kFailure; } diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 004821a0857..37b698c8d3d 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -1541,8 +1541,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) window->clientToScreenIntern(x_warp+x_accum, y_warp+y_accum, x, y); pushEvent(new GHOST_EventCursor([event timestamp] * 1000, GHOST_kEventCursorMove, window, x, y)); - } break; + } case GHOST_kGrabWrap: //Wrap cursor at area/window boundaries { NSPoint mousePos = [cocoawindow mouseLocationOutsideOfEventStream]; @@ -1552,7 +1552,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) GHOST_Rect bounds, windowBounds, correctedBounds; /* fallback to window bounds */ - if(window->getCursorGrabBounds(bounds)==GHOST_kFailure) + if (window->getCursorGrabBounds(bounds) == GHOST_kFailure) window->getClientBounds(bounds); //Switch back to Cocoa coordinates orientation (y=0 at botton,the same as blender internal btw!), and to client coordinates @@ -1586,8 +1586,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) window->getCursorGrabInitPos(x_cur, y_cur); window->clientToScreenIntern(x_cur + x_accum, y_cur + y_accum, x, y); pushEvent(new GHOST_EventCursor([event timestamp] * 1000, GHOST_kEventCursorMove, window, x, y)); - } break; + } default: { //Normal cursor operation: send mouse position in window @@ -1599,8 +1599,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) m_cursorDelta_x=0; m_cursorDelta_y=0; //Mouse motion occurred between two cursor warps, so we can reset the delta counter - } break; + } } } break; @@ -1854,7 +1854,7 @@ GHOST_TUns8* GHOST_SystemCocoa::getClipboard(bool selection) const [pool drain]; - if(temp_buff) { + if (temp_buff) { return temp_buff; } else { @@ -1866,7 +1866,7 @@ void GHOST_SystemCocoa::putClipboard(GHOST_TInt8 *buffer, bool selection) const { NSString *textToCopy; - if(selection) {return;} // for copying the selection, used on X11 + if (selection) return; // for copying the selection, used on X11 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index b43758b345f..ebb419b6c04 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -599,17 +599,19 @@ GHOST_TKey GHOST_SystemWin32::convertKey(GHOST_IWindow *window, short vKey, shor case VK_GR_LESS: key = GHOST_kKeyGrLess; break; case VK_SHIFT: - /* Check single shift presses */ - if (scanCode == 0x36) { - key = GHOST_kKeyRightShift; - } else if (scanCode == 0x2a) { - key = GHOST_kKeyLeftShift; - } else { - /* Must be a combination SHIFT (Left or Right) + a Key - * Ignore this as the next message will contain - * the desired "Key" */ - key = GHOST_kKeyUnknown; - } + /* Check single shift presses */ + if (scanCode == 0x36) { + key = GHOST_kKeyRightShift; + } + else if (scanCode == 0x2a) { + key = GHOST_kKeyLeftShift; + } + else { + /* Must be a combination SHIFT (Left or Right) + a Key + * Ignore this as the next message will contain + * the desired "Key" */ + key = GHOST_kKeyUnknown; + } break; case VK_CONTROL: key = (extend) ? GHOST_kKeyRightControl : GHOST_kKeyLeftControl; @@ -1162,7 +1164,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, * message without calling DefWindowProc. */ /* we get first WM_SIZE before we fully init. So, do not dispatch before we continiously resizng */ - if(window->m_inLiveResize) { + if (window->m_inLiveResize) { system->pushEvent(processWindowEvent(GHOST_kEventWindowSize, window)); system->dispatchEvents(); } diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 2b311f96647..a409f5c357a 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -179,12 +179,12 @@ GHOST_WindowWin32::GHOST_WindowWin32( RECT rect, desktop; int wintype = WS_OVERLAPPEDWINDOW; - if (m_parentWindowHwnd != 0) - { + if (m_parentWindowHwnd != 0) { wintype = WS_CHILD; /* check against parent window if given */ GetWindowRect((HWND)m_parentWindowHwnd, &rect); - } else { + } + else { int framex = GetSystemMetrics(SM_CXSIZEFRAME); int framey = GetSystemMetrics(SM_CYSIZEFRAME); int caption = GetSystemMetrics(SM_CYCAPTION); @@ -203,10 +203,10 @@ GHOST_WindowWin32::GHOST_WindowWin32( desktop.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN); /* virtual screen (desktop) bound checks */ - if(rect.left < desktop.left) rect.left = desktop.left; - if(rect.top < desktop.top) rect.top = desktop.top; - if(rect.bottom > desktop.bottom) rect.bottom = desktop.bottom; - if(rect.right > desktop.right) rect.right = desktop.right; + if (rect.left < desktop.left) rect.left = desktop.left; + if (rect.top < desktop.top) rect.top = desktop.top; + if (rect.bottom > desktop.bottom) rect.bottom = desktop.bottom; + if (rect.right > desktop.right) rect.right = desktop.right; /* dimension vars to use in window creation */ left = rect.left; diff --git a/intern/locale/boost_locale_wrapper.cpp b/intern/locale/boost_locale_wrapper.cpp index 5d7ba599467..945d0bbc5da 100644 --- a/intern/locale/boost_locale_wrapper.cpp +++ b/intern/locale/boost_locale_wrapper.cpp @@ -109,7 +109,7 @@ const char *bl_locale_pgettext(const char *msgctxt, const char *msgid) std::locale l; char_message_facet const &facet = std::use_facet<char_message_facet>(l); char const *r = facet.get(0, msgctxt, msgid); - if(r) + if (r) return r; return msgid; } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 21136f0ca6d..1e4e57b1dd2 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2449,7 +2449,8 @@ static void write_soops(WriteData *wd, SpaceOops *so, LinkNode **tmp_mem_list) /* restore old treestore */ so->treestore = ts; - } else { + } + else { writestruct(wd, DATA, "SpaceOops", 1, so); } } diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 5592be6e872..79c725166f6 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -944,7 +944,7 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera) return true; } - if(et && et->isProfile("blender")) { + if (et && et->isProfile("blender")) { et->setData("shiftx",&(cam->shiftx)); et->setData("shifty",&(cam->shifty)); et->setData("YF_dofdist",&(cam->YF_dofdist)); diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index 09d71f22a0d..c7652bd7ae7 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -665,9 +665,10 @@ void MeshImporter::get_vector(float v[3], COLLADAFW::MeshVertexData& arr, int i, v[0] = (*values)[i++]; v[1] = (*values)[i++]; - if(stride>=3) { + if (stride>=3) { v[2] = (*values)[i]; - } else { + } + else { v[2] = 0.0f; } @@ -680,9 +681,10 @@ void MeshImporter::get_vector(float v[3], COLLADAFW::MeshVertexData& arr, int i, v[0] = (float)(*values)[i++]; v[1] = (float)(*values)[i++]; - if(stride>=3) { + if (stride >= 3) { v[2] = (float)(*values)[i]; - } else { + } + else { v[2] = 0.0f; } } diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.cpp b/source/blender/freestyle/intern/stroke/StrokeRep.cpp index 2615df0a124..fb6da853e02 100644 --- a/source/blender/freestyle/intern/stroke/StrokeRep.cpp +++ b/source/blender/freestyle/intern/stroke/StrokeRep.cpp @@ -149,7 +149,8 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices) if (dp < 0) userDir = userDir * (-1.0f); stripDir = userDir; - } else { + } + else { ++orientationErrors; } } @@ -207,7 +208,8 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices) if (dp < 0) userDir = userDir * (-1.0f); stripDir = userDir; - } else { + } + else { ++orientationErrors; } } @@ -226,7 +228,8 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices) if (dp < 0) userDir = userDir * (-1.0f); stripDirPrev = userDir; - } else { + } + else { ++orientationErrors; } } @@ -302,7 +305,8 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices) if (dp < 0) userDir = userDir * (-1.0f); stripDirLast = userDir; - } else { + } + else { ++orientationErrors; } } diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index 7b42c89d936..8cf91e44c77 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -317,7 +317,7 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R int success = 1; OSStatus err = noErr; - if(qtexport == NULL) qtexport = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport"); + if (qtexport == NULL) qtexport = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport"); [QTMovie enterQTKitOnThread]; @@ -476,7 +476,7 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R err = AudioFileCreateWithURL(outputFileURL, audioFileType, &qtexport->audioOutputFormat, kAudioFileFlags_EraseFile, &qtexport->audioFile); CFRelease(outputFileURL); - if(err) + if (err) BKE_report(reports, RPT_ERROR, "\nQuicktime: unable to create temporary audio file. Format error ?"); else { err = AudioConverterNew(&qtexport->audioInputFormat, &qtexport->audioOutputFormat, &qtexport->audioConverter); @@ -542,7 +542,7 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R else qtexport->movie = [[QTMovie alloc] initToWritableFile:qtexport->filename error:&error]; - if(qtexport->movie == nil) { + if (qtexport->movie == nil) { BKE_report(reports, RPT_ERROR, "Unable to create quicktime movie."); success = 0; if (qtexport->filename) [qtexport->filename release]; @@ -749,13 +749,11 @@ void end_qt(void) if (audioTmpMovie) { NSArray *audioTracks = [audioTmpMovie tracksOfMediaType:QTMediaTypeSound]; QTTrack *audioTrack = nil; - if( [audioTracks count] > 0 ) - { + if ( [audioTracks count] > 0 ) { audioTrack = [audioTracks objectAtIndex:0]; } - if( audioTrack ) - { + if (audioTrack) { QTTimeRange totalRange; totalRange.time = QTZeroTime; totalRange.duration = [[audioTmpMovie attributeForKey:QTMovieDurationAttribute] QTTimeValue]; @@ -798,7 +796,7 @@ void end_qt(void) [QTMovie exitQTKitOnThread]; - if(qtexport) { + if (qtexport) { MEM_freeN(qtexport); qtexport = NULL; } diff --git a/source/blender/quicktime/apple/qtkit_import.m b/source/blender/quicktime/apple/qtkit_import.m index bee26c5348e..fbe4733c3b1 100644 --- a/source/blender/quicktime/apple/qtkit_import.m +++ b/source/blender/quicktime/apple/qtkit_import.m @@ -128,7 +128,7 @@ void free_anim_quicktime(struct anim *anim) if (anim == NULL) return; if (anim->qtime == NULL) return; - if(anim->qtime->ibuf) + if (anim->qtime->ibuf) IMB_freeImBuf(anim->qtime->ibuf); [anim->qtime->media release]; @@ -136,7 +136,7 @@ void free_anim_quicktime(struct anim *anim) [QTMovie exitQTKitOnThread]; - if(anim->qtime) MEM_freeN (anim->qtime); + if (anim->qtime) MEM_freeN (anim->qtime); anim->qtime = NULL; @@ -289,7 +289,7 @@ ImBuf *qtime_fetchibuf (struct anim *anim, int position) } if (frameImage == nil) { - if(QTIME_DEBUG) printf ("Error reading frame from Quicktime"); + if (QTIME_DEBUG) printf ("Error reading frame from Quicktime"); [pool drain]; return NULL; } @@ -312,7 +312,7 @@ int startquicktime(struct anim *anim) anim->qtime = MEM_callocN(sizeof(QuicktimeMovie),"animqt"); if (anim->qtime == NULL) { - if(QTIME_DEBUG) printf("Can't alloc qtime: %s\n", anim->name); + if (QTIME_DEBUG) printf("Can't alloc qtime: %s\n", anim->name); return -1; } @@ -329,9 +329,9 @@ int startquicktime(struct anim *anim) anim->qtime->movie = [QTMovie movieWithAttributes:attributes error:NULL]; if (!anim->qtime->movie) { - if(QTIME_DEBUG) printf("qt: bad movie %s\n", anim->name); + if (QTIME_DEBUG) printf("qt: bad movie %s\n", anim->name); MEM_freeN(anim->qtime); - if(QTIME_DEBUG) printf("qt: can't load %s\n", anim->name); + if (QTIME_DEBUG) printf("qt: can't load %s\n", anim->name); [QTMovie exitQTKitOnThread]; [pool drain]; return -1; @@ -342,11 +342,11 @@ int startquicktime(struct anim *anim) videoTracks = [anim->qtime->movie tracksOfMediaType:QTMediaTypeVideo]; - if([videoTracks count] == 0) { - if(QTIME_DEBUG) printf("qt: no video tracks for movie %s\n", anim->name); + if ([videoTracks count] == 0) { + if (QTIME_DEBUG) printf("qt: no video tracks for movie %s\n", anim->name); [anim->qtime->movie release]; MEM_freeN(anim->qtime); - if(QTIME_DEBUG) printf("qt: can't load %s\n", anim->name); + if (QTIME_DEBUG) printf("qt: can't load %s\n", anim->name); [QTMovie exitQTKitOnThread]; [pool drain]; return -1; @@ -360,8 +360,8 @@ int startquicktime(struct anim *anim) anim->x = frameSize.width; anim->y = frameSize.height; - if(anim->x == 0 && anim->y == 0) { - if(QTIME_DEBUG) printf("qt: error, no dimensions\n"); + if (anim->x == 0 && anim->y == 0) { + if (QTIME_DEBUG) printf("qt: error, no dimensions\n"); free_anim_quicktime(anim); [pool drain]; return -1; @@ -398,12 +398,12 @@ int imb_is_a_quicktime(char *name) int result; NSAutoreleasePool *pool; - if(!G.have_quicktime) return 0; + if (!G.have_quicktime) return 0; pool = [[NSAutoreleasePool alloc] init]; // don't let quicktime image import handle these - if( BLI_testextensie(name, ".swf") || + if (BLI_testextensie(name, ".swf") || BLI_testextensie(name, ".txt") || BLI_testextensie(name, ".mpg") || BLI_testextensie(name, ".wav") || @@ -437,7 +437,7 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags) NSBitmapImageRep *blBitmapFormatImageRGB,*blBitmapFormatImageRGBA; NSAutoreleasePool *pool; - if(!G.have_quicktime) + if (!G.have_quicktime) return NULL; pool = [[NSAutoreleasePool alloc] init]; diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index 2dc12f39db7..b23d6b09524 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -35,17 +35,17 @@ #define BRICONT \ texres->tin= (texres->tin-0.5f) * tex->contrast+tex->bright-0.5f; \ - if(texres->tin < 0.0f) texres->tin= 0.0f; \ - else if(texres->tin > 1.0f) texres->tin= 1.0f; \ + if (texres->tin < 0.0f) texres->tin= 0.0f; \ + else if (texres->tin > 1.0f) texres->tin= 1.0f; \ #define BRICONTRGB \ texres->tr= tex->rfac*((texres->tr-0.5f)*tex->contrast+tex->bright-0.5f); \ - if(texres->tr<0.0f) texres->tr= 0.0f; \ + if (texres->tr<0.0f) texres->tr= 0.0f; \ texres->tg= tex->gfac*((texres->tg-0.5f)*tex->contrast+tex->bright-0.5f); \ - if(texres->tg<0.0f) texres->tg= 0.0f; \ + if (texres->tg<0.0f) texres->tg= 0.0f; \ texres->tb= tex->bfac*((texres->tb-0.5f)*tex->contrast+tex->bright-0.5f); \ - if(texres->tb<0.0f) texres->tb= 0.0f; \ - if(tex->saturation != 1.0f) { \ + if (texres->tb<0.0f) texres->tb= 0.0f; \ + if (tex->saturation != 1.0f) { \ float _hsv[3]; \ rgb_to_hsv(texres->tr, texres->tg, texres->tb, \ _hsv, _hsv+1, _hsv+2); \ diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 768fd2cdcf5..90ae39ee767 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -739,7 +739,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con * in two each time, giving 2^depth rays. we need to be able to cancel such * a render to avoid hanging, a better solution would be random picking * between directions and russian roulette termination */ - if(R.test_break(R.tbh)) { + if (R.test_break(R.tbh)) { zero_v4(col); return; } |