style cleanup

This commit is contained in:
Campbell Barton
2012-10-28 15:23:16 +00:00
parent d800cffaf1
commit 0c6a0b293f
14 changed files with 58 additions and 60 deletions

View File

@@ -1000,16 +1000,16 @@ GHOST_TSuccess GHOST_SystemCocoa::handleApplicationBecomeActiveEvent()
modifiers = [[[NSApplication sharedApplication] currentEvent] modifierFlags]; modifiers = [[[NSApplication sharedApplication] currentEvent] modifierFlags];
if ((modifiers & NSShiftKeyMask) != (m_modifierMask & NSShiftKeyMask)) { if ((modifiers & NSShiftKeyMask) != (m_modifierMask & NSShiftKeyMask)) {
pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & NSShiftKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftShift) ); pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & NSShiftKeyMask) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp, window, GHOST_kKeyLeftShift));
} }
if ((modifiers & NSControlKeyMask) != (m_modifierMask & NSControlKeyMask)) { if ((modifiers & NSControlKeyMask) != (m_modifierMask & NSControlKeyMask)) {
pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & NSControlKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftControl) ); pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & NSControlKeyMask) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp, window, GHOST_kKeyLeftControl));
} }
if ((modifiers & NSAlternateKeyMask) != (m_modifierMask & NSAlternateKeyMask)) { if ((modifiers & NSAlternateKeyMask) != (m_modifierMask & NSAlternateKeyMask)) {
pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & NSAlternateKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftAlt) ); pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & NSAlternateKeyMask) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp, window, GHOST_kKeyLeftAlt));
} }
if ((modifiers & NSCommandKeyMask) != (m_modifierMask & NSCommandKeyMask)) { if ((modifiers & NSCommandKeyMask) != (m_modifierMask & NSCommandKeyMask)) {
pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & NSCommandKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyOS) ); pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & NSCommandKeyMask) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp, window, GHOST_kKeyOS));
} }
m_modifierMask = modifiers; m_modifierMask = modifiers;
@@ -1460,7 +1460,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
case NSLeftMouseDown: case NSLeftMouseDown:
case NSRightMouseDown: case NSRightMouseDown:
case NSOtherMouseDown: case NSOtherMouseDown:
pushEvent(new GHOST_EventButton([event timestamp]*1000, GHOST_kEventButtonDown, window, convertButton([event buttonNumber]))); pushEvent(new GHOST_EventButton([event timestamp] * 1000, GHOST_kEventButtonDown, window, convertButton([event buttonNumber])));
//Handle tablet events combined with mouse events //Handle tablet events combined with mouse events
handleTabletEvent(event); handleTabletEvent(event);
break; break;
@@ -1468,7 +1468,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
case NSLeftMouseUp: case NSLeftMouseUp:
case NSRightMouseUp: case NSRightMouseUp:
case NSOtherMouseUp: case NSOtherMouseUp:
pushEvent(new GHOST_EventButton([event timestamp]*1000, GHOST_kEventButtonUp, window, convertButton([event buttonNumber]))); pushEvent(new GHOST_EventButton([event timestamp] * 1000, GHOST_kEventButtonUp, window, convertButton([event buttonNumber])));
//Handle tablet events combined with mouse events //Handle tablet events combined with mouse events
handleTabletEvent(event); handleTabletEvent(event);
break; break;
@@ -1503,7 +1503,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
window->setCursorGrabAccum(x_accum, y_accum); window->setCursorGrabAccum(x_accum, y_accum);
window->clientToScreenIntern(x_warp+x_accum, y_warp+y_accum, x, y); window->clientToScreenIntern(x_warp+x_accum, y_warp+y_accum, x, y);
pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x, y)); pushEvent(new GHOST_EventCursor([event timestamp] * 1000, GHOST_kEventCursorMove, window, x, y));
} }
break; break;
case GHOST_kGrabWrap: //Wrap cursor at area/window boundaries case GHOST_kGrabWrap: //Wrap cursor at area/window boundaries
@@ -1548,7 +1548,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
//Post event //Post event
window->getCursorGrabInitPos(x_cur, y_cur); window->getCursorGrabInitPos(x_cur, y_cur);
window->clientToScreenIntern(x_cur + x_accum, y_cur + y_accum, x, y); window->clientToScreenIntern(x_cur + x_accum, y_cur + y_accum, x, y);
pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x, y)); pushEvent(new GHOST_EventCursor([event timestamp] * 1000, GHOST_kEventCursorMove, window, x, y));
} }
break; break;
default: default:
@@ -1558,7 +1558,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
GHOST_TInt32 x, y; GHOST_TInt32 x, y;
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x, y)); pushEvent(new GHOST_EventCursor([event timestamp] * 1000, GHOST_kEventCursorMove, window, x, y));
m_cursorDelta_x=0; m_cursorDelta_x=0;
m_cursorDelta_y=0; //Mouse motion occurred between two cursor warps, so we can reset the delta counter m_cursorDelta_y=0; //Mouse motion occurred between two cursor warps, so we can reset the delta counter
@@ -1580,7 +1580,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
if (deltaF == 0.0) break; //discard trackpad delta=0 events if (deltaF == 0.0) break; //discard trackpad delta=0 events
delta = deltaF > 0.0 ? 1 : -1; delta = deltaF > 0.0 ? 1 : -1;
pushEvent(new GHOST_EventWheel([event timestamp]*1000, window, delta)); pushEvent(new GHOST_EventWheel([event timestamp] * 1000, window, delta));
} }
else { else {
NSPoint mousePos = [event locationInWindow]; NSPoint mousePos = [event locationInWindow];
@@ -1604,7 +1604,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
dy = -dy; dy = -dy;
pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventScroll, x, y, dx, dy)); pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, window, GHOST_kTrackpadEventScroll, x, y, dx, dy));
} }
} }
break; break;
@@ -1614,8 +1614,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
NSPoint mousePos = [event locationInWindow]; NSPoint mousePos = [event locationInWindow];
GHOST_TInt32 x, y; GHOST_TInt32 x, y;
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventMagnify, x, y, pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, window, GHOST_kTrackpadEventMagnify, x, y,
[event magnification]*125.0 + 0.1, 0)); [event magnification] * 125.0 + 0.1, 0));
} }
break; break;
@@ -1624,8 +1624,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
NSPoint mousePos = [event locationInWindow]; NSPoint mousePos = [event locationInWindow];
GHOST_TInt32 x, y; GHOST_TInt32 x, y;
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventRotate, x, y, pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, window, GHOST_kTrackpadEventRotate, x, y,
-[event rotation] * 5.0, 0)); -[event rotation] * 5.0, 0));
} }
case NSEventTypeBeginGesture: case NSEventTypeBeginGesture:
m_isGestureInProgress = true; m_isGestureInProgress = true;
@@ -1700,11 +1700,11 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
break; //Cmd-Q is directly handled by Cocoa break; //Cmd-Q is directly handled by Cocoa
if ([event type] == NSKeyDown) { if ([event type] == NSKeyDown) {
pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii, utf8_buf) ); pushEvent( new GHOST_EventKey([event timestamp] * 1000, GHOST_kEventKeyDown, window, keyCode, ascii, utf8_buf) );
//printf("Key down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf); //printf("Key down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf);
} }
else { else {
pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, 0, '\0') ); pushEvent( new GHOST_EventKey([event timestamp] * 1000, GHOST_kEventKeyUp, window, keyCode, 0, '\0') );
//printf("Key up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf); //printf("Key up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf);
} }
break; break;
@@ -1713,16 +1713,16 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
modifiers = [event modifierFlags]; modifiers = [event modifierFlags];
if ((modifiers & NSShiftKeyMask) != (m_modifierMask & NSShiftKeyMask)) { if ((modifiers & NSShiftKeyMask) != (m_modifierMask & NSShiftKeyMask)) {
pushEvent( new GHOST_EventKey([event timestamp]*1000, (modifiers & NSShiftKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftShift) ); pushEvent(new GHOST_EventKey([event timestamp] * 1000, (modifiers & NSShiftKeyMask) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp, window, GHOST_kKeyLeftShift));
} }
if ((modifiers & NSControlKeyMask) != (m_modifierMask & NSControlKeyMask)) { if ((modifiers & NSControlKeyMask) != (m_modifierMask & NSControlKeyMask)) {
pushEvent( new GHOST_EventKey([event timestamp]*1000, (modifiers & NSControlKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftControl) ); pushEvent(new GHOST_EventKey([event timestamp] * 1000, (modifiers & NSControlKeyMask) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp, window, GHOST_kKeyLeftControl));
} }
if ((modifiers & NSAlternateKeyMask) != (m_modifierMask & NSAlternateKeyMask)) { if ((modifiers & NSAlternateKeyMask) != (m_modifierMask & NSAlternateKeyMask)) {
pushEvent( new GHOST_EventKey([event timestamp]*1000, (modifiers & NSAlternateKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftAlt) ); pushEvent(new GHOST_EventKey([event timestamp] * 1000, (modifiers & NSAlternateKeyMask) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp, window, GHOST_kKeyLeftAlt));
} }
if ((modifiers & NSCommandKeyMask) != (m_modifierMask & NSCommandKeyMask)) { if ((modifiers & NSCommandKeyMask) != (m_modifierMask & NSCommandKeyMask)) {
pushEvent( new GHOST_EventKey([event timestamp]*1000, (modifiers & NSCommandKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyOS) ); pushEvent(new GHOST_EventKey([event timestamp] * 1000, (modifiers & NSCommandKeyMask) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp, window, GHOST_kKeyOS));
} }
m_modifierMask = modifiers; m_modifierMask = modifiers;

View File

@@ -187,7 +187,7 @@ extern "C" {
NSPoint mouseLocation = [sender draggingLocation]; NSPoint mouseLocation = [sender draggingLocation];
systemCocoa->handleDraggingEvent(GHOST_kEventDraggingUpdated, m_draggedObjectType, associatedWindow, mouseLocation.x, mouseLocation.y, nil); systemCocoa->handleDraggingEvent(GHOST_kEventDraggingUpdated, m_draggedObjectType, associatedWindow, mouseLocation.x, mouseLocation.y, nil);
return associatedWindow->canAcceptDragOperation()?NSDragOperationCopy:NSDragOperationNone; return associatedWindow->canAcceptDragOperation() ? NSDragOperationCopy : NSDragOperationNone;
} }
- (void)draggingExited:(id < NSDraggingInfo >)sender - (void)draggingExited:(id < NSDraggingInfo >)sender
@@ -368,7 +368,7 @@ extern "C" {
- (BOOL)hasMarkedText - (BOOL)hasMarkedText
{ {
return (composing)? YES: NO; return (composing) ? YES : NO;
} }
- (void)doCommandBySelector:(SEL)selector - (void)doCommandBySelector:(SEL)selector
@@ -392,7 +392,7 @@ extern "C" {
- (NSRange)markedRange - (NSRange)markedRange
{ {
unsigned int length = (composing_text)? [composing_text length]: 0; unsigned int length = (composing_text) ? [composing_text length] : 0;
if (composing) if (composing)
return NSMakeRange(0, length); return NSMakeRange(0, length);
@@ -402,7 +402,7 @@ extern "C" {
- (NSRange)selectedRange - (NSRange)selectedRange
{ {
unsigned int length = (composing_text)? [composing_text length]: 0; unsigned int length = (composing_text) ? [composing_text length] : 0;
return NSMakeRange(0, length); return NSMakeRange(0, length);
} }

View File

@@ -80,7 +80,7 @@ void delete_MEM_CacheLimiter(MEM_CacheLimiterC *This);
* @return CacheLimiterHandle to ref, unref, touch the managed object * @return CacheLimiterHandle to ref, unref, touch the managed object
*/ */
MEM_CacheLimiterHandleC *MEM_CacheLimiter_insert(MEM_CacheLimiterC * This, void * data); MEM_CacheLimiterHandleC *MEM_CacheLimiter_insert(MEM_CacheLimiterC *This, void *data);
/** /**
* Free objects until memory constraints are satisfied * Free objects until memory constraints are satisfied
@@ -140,7 +140,7 @@ int MEM_CacheLimiter_get_refcount(MEM_CacheLimiterHandleC *handle);
* @param handle of object * @param handle of object
*/ */
void * MEM_CacheLimiter_get(MEM_CacheLimiterHandleC *handle); void *MEM_CacheLimiter_get(MEM_CacheLimiterHandleC *handle);
void MEM_CacheLimiter_ItemPriority_Func_set(MEM_CacheLimiterC *This, void MEM_CacheLimiter_ItemPriority_Func_set(MEM_CacheLimiterC *This,
MEM_CacheLimiter_ItemPriority_Func item_priority_func); MEM_CacheLimiter_ItemPriority_Func item_priority_func);

View File

@@ -59,9 +59,9 @@ public:
} }
~MEM_CacheLimiterCClass(); ~MEM_CacheLimiterCClass();
handle_t * insert(void * data); handle_t * insert(void *data);
void destruct(void * data, list_t::iterator it); void destruct(void *data, list_t::iterator it);
cache_t * get_cache() { cache_t * get_cache() {
return &cache; return &cache;
@@ -76,7 +76,7 @@ private:
class MEM_CacheLimiterHandleCClass { class MEM_CacheLimiterHandleCClass {
public: public:
MEM_CacheLimiterHandleCClass(void * data_, MEM_CacheLimiterCClass * parent_) : MEM_CacheLimiterHandleCClass(void *data_, MEM_CacheLimiterCClass *parent_) :
data(data_), data(data_),
parent(parent_) parent(parent_)
{ } { }
@@ -87,7 +87,7 @@ public:
it = it_; it = it_;
} }
void set_data(void * data_) { void set_data(void *data_) {
data = data_; data = data_;
} }
@@ -101,7 +101,7 @@ private:
list_t::iterator it; list_t::iterator it;
}; };
handle_t *MEM_CacheLimiterCClass::insert(void * data) handle_t *MEM_CacheLimiterCClass::insert(void *data)
{ {
cclass_list.push_back(new MEM_CacheLimiterHandleCClass(data, this)); cclass_list.push_back(new MEM_CacheLimiterHandleCClass(data, this));
list_t::iterator it = cclass_list.end(); list_t::iterator it = cclass_list.end();
@@ -111,7 +111,7 @@ handle_t *MEM_CacheLimiterCClass::insert(void * data)
return cache.insert(cclass_list.back()); return cache.insert(cclass_list.back());
} }
void MEM_CacheLimiterCClass::destruct(void * data, list_t::iterator it) void MEM_CacheLimiterCClass::destruct(void *data, list_t::iterator it)
{ {
data_destructor(data); data_destructor(data);
cclass_list.erase(it); cclass_list.erase(it);

View File

@@ -395,6 +395,7 @@ static void bm_edge_collapse_loop_customdata(BMesh *bm, BMLoop *l, BMVert *v_cle
BLI_assert(l_clear->v == v_clear); BLI_assert(l_clear->v == v_clear);
BLI_assert(l_other->v == v_other); BLI_assert(l_other->v == v_other);
(void)v_other; /* quiet warnings for release */
/* now we have both corners of the face 'l->f' */ /* now we have both corners of the face 'l->f' */
for (side = 0; side < 2; side++) { for (side = 0; side < 2; side++) {

View File

@@ -75,13 +75,13 @@ static int vert_is_boundary(BMVert *v);
static LaplacianSystem * init_laplacian_system( int a_numEdges, int a_numFaces, int a_numVerts); static LaplacianSystem * init_laplacian_system( int a_numEdges, int a_numFaces, int a_numVerts);
static void init_laplacian_matrix(LaplacianSystem * sys); static void init_laplacian_matrix(LaplacianSystem * sys);
static void delete_laplacian_system(LaplacianSystem * sys); static void delete_laplacian_system(LaplacianSystem * sys);
static void delete_void_pointer(void * data); static void delete_void_pointer(void *data);
static void fill_laplacian_matrix(LaplacianSystem * sys); static void fill_laplacian_matrix(LaplacianSystem * sys);
static void memset_laplacian_system(LaplacianSystem *sys, int val); static void memset_laplacian_system(LaplacianSystem *sys, int val);
static void validate_solution(LaplacianSystem * sys, int usex, int usey, int usez, int volumepreservation); static void validate_solution(LaplacianSystem * sys, int usex, int usey, int usez, int volumepreservation);
static void volume_preservation(BMesh *bm, BMOperator *op, float vini, float vend, int usex, int usey, int usez); static void volume_preservation(BMesh *bm, BMOperator *op, float vini, float vend, int usex, int usey, int usez);
static void delete_void_pointer(void * data) static void delete_void_pointer(void *data)
{ {
if (data) { if (data) {
MEM_freeN(data); MEM_freeN(data);

View File

@@ -37,8 +37,7 @@ void CropBaseOperation::updateArea()
float width = inputReference->getWidth(); float width = inputReference->getWidth();
float height = inputReference->getHeight(); float height = inputReference->getHeight();
if (width > 0.0f && height > 0.0f) if (width > 0.0f && height > 0.0f) {
{
if (this->m_relative) { if (this->m_relative) {
this->m_settings->x1 = width * this->m_settings->fac_x1; this->m_settings->x1 = width * this->m_settings->fac_x1;
this->m_settings->x2 = width * this->m_settings->fac_x2; this->m_settings->x2 = width * this->m_settings->fac_x2;
@@ -114,12 +113,10 @@ void CropImageOperation::determineResolution(unsigned int resolution[2], unsigne
void CropImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) void CropImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
{ {
if (x >= 0 && x < getWidth() && y >= 0 && y < getHeight()) if (x >= 0 && x < getWidth() && y >= 0 && y < getHeight()) {
{
this->m_inputOperation->read(output, (x + this->m_xmin), (y + this->m_ymin), sampler); this->m_inputOperation->read(output, (x + this->m_xmin), (y + this->m_ymin), sampler);
} }
else else {
{
zero_v4(output); zero_v4(output);
} }
} }

View File

@@ -72,7 +72,7 @@ typedef struct anim_index_builder {
char name[FILE_MAX]; char name[FILE_MAX];
char temp_name[FILE_MAX]; char temp_name[FILE_MAX];
void * private_data; void *private_data;
void (*delete_priv_data)(struct anim_index_builder * idx); void (*delete_priv_data)(struct anim_index_builder * idx);
void (*proc_frame)(struct anim_index_builder * idx, void (*proc_frame)(struct anim_index_builder * idx,

View File

@@ -35,9 +35,9 @@
#define __DNA_PACKEDFILE_TYPES_H__ #define __DNA_PACKEDFILE_TYPES_H__
typedef struct PackedFile { typedef struct PackedFile {
int size; int size;
int seek; int seek;
void * data; void *data;
} PackedFile; } PackedFile;
enum PF_FileStatus enum PF_FileStatus

View File

@@ -1355,8 +1355,8 @@ typedef struct Scene {
#define SFRA (scene->r.sfra) #define SFRA (scene->r.sfra)
#define EFRA (scene->r.efra) #define EFRA (scene->r.efra)
#define PRVRANGEON (scene->r.flag & SCER_PRV_RANGE) #define PRVRANGEON (scene->r.flag & SCER_PRV_RANGE)
#define PSFRA ((PRVRANGEON)? (scene->r.psfra): (scene->r.sfra)) #define PSFRA ((PRVRANGEON) ? (scene->r.psfra) : (scene->r.sfra))
#define PEFRA ((PRVRANGEON)? (scene->r.pefra): (scene->r.efra)) #define PEFRA ((PRVRANGEON) ? (scene->r.pefra) : (scene->r.efra))
#define FRA2TIME(a) ((((double) scene->r.frs_sec_base) * (double)(a)) / (double)scene->r.frs_sec) #define FRA2TIME(a) ((((double) scene->r.frs_sec_base) * (double)(a)) / (double)scene->r.frs_sec)
#define TIME2FRA(a) ((((double) scene->r.frs_sec) * (double)(a)) / (double)scene->r.frs_sec_base) #define TIME2FRA(a) ((((double) scene->r.frs_sec) * (double)(a)) / (double)scene->r.frs_sec_base)
#define FPS (((double) scene->r.frs_sec) / (double)scene->r.frs_sec_base) #define FPS (((double) scene->r.frs_sec) / (double)scene->r.frs_sec_base)

View File

@@ -1045,9 +1045,9 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA
else { else {
rna_print_data_get(f, dp); rna_print_data_get(f, dp);
if (dp->dnalengthname) if (dp->dnalengthname)
fprintf(f, " return (data->%s == NULL)? 0: data->%s;\n", dp->dnaname, dp->dnalengthname); fprintf(f, " return (data->%s == NULL) ? 0 : data->%s;\n", dp->dnaname, dp->dnalengthname);
else else
fprintf(f, " return (data->%s == NULL)? 0: %d;\n", dp->dnaname, dp->dnalengthfixed); fprintf(f, " return (data->%s == NULL) ? 0 : %d;\n", dp->dnaname, dp->dnalengthfixed);
} }
fprintf(f, "}\n\n"); fprintf(f, "}\n\n");
} }

View File

@@ -375,8 +375,8 @@ int rtbuild_heuristic_object_split(RTBuilder *b, int nchilds)
// not using log seems to have no impact on raytracing perf, but // not using log seems to have no impact on raytracing perf, but
// makes tree construction quicker, left out for now to test (brecht) // makes tree construction quicker, left out for now to test (brecht)
// left_side = bb_area(sweep_left.bb, sweep_left.bb+3)*(sweep_left.cost+logf((float)i)); // left_side = bb_area(sweep_left.bb, sweep_left.bb + 3) * (sweep_left.cost + logf((float)i));
// right_side= bb_area(sweep[i].bb, sweep[i].bb+3)*(sweep[i].cost+logf((float)size-i)); // right_side = bb_area(sweep[i].bb, sweep[i].bb + 3) * (sweep[i].cost + logf((float)size - i));
left_side = bb_area(sweep_left.bb, sweep_left.bb + 3) * (sweep_left.cost); left_side = bb_area(sweep_left.bb, sweep_left.bb + 3) * (sweep_left.cost);
right_side = bb_area(sweep[i].bb, sweep[i].bb + 3) * (sweep[i].cost); right_side = bb_area(sweep[i].bb, sweep[i].bb + 3) * (sweep[i].cost);
hcost = left_side + right_side; hcost = left_side + right_side;

View File

@@ -285,7 +285,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
} }
/* always store copy, as smoke internal data can change */ /* always store copy, as smoke internal data can change */
totRes= vd_resol_size(vd); totRes = vd_resol_size(vd);
vd->dataset = MEM_mapallocN(sizeof(float)*(totRes), "smoke data"); vd->dataset = MEM_mapallocN(sizeof(float)*(totRes), "smoke data");
memcpy(vd->dataset, flame, sizeof(float)*totRes); memcpy(vd->dataset, flame, sizeof(float)*totRes);
} }

View File

@@ -2918,23 +2918,23 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
switch (event.type) { switch (event.type) {
case LEFTSHIFTKEY: case RIGHTSHIFTKEY: case LEFTSHIFTKEY: case RIGHTSHIFTKEY:
evt->shift = (event.val == KM_PRESS) ? evt->shift = (event.val == KM_PRESS) ?
((evt->ctrl || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : ((evt->ctrl || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
FALSE; FALSE;
break; break;
case LEFTCTRLKEY: case RIGHTCTRLKEY: case LEFTCTRLKEY: case RIGHTCTRLKEY:
evt->ctrl = (event.val == KM_PRESS) ? evt->ctrl = (event.val == KM_PRESS) ?
((evt->shift || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : ((evt->shift || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
FALSE; FALSE;
break; break;
case LEFTALTKEY: case RIGHTALTKEY: case LEFTALTKEY: case RIGHTALTKEY:
evt->alt = (event.val == KM_PRESS) ? evt->alt = (event.val == KM_PRESS) ?
((evt->ctrl || evt->shift || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : ((evt->ctrl || evt->shift || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
FALSE; FALSE;
break; break;
case OSKEY: case OSKEY:
evt->oskey = (event.val == KM_PRESS) ? evt->oskey = (event.val == KM_PRESS) ?
((evt->ctrl || evt->alt || evt->shift) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : ((evt->ctrl || evt->alt || evt->shift) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
FALSE; FALSE;
break; break;
default: default:
if (event.val == KM_PRESS && event.keymodifier == 0) if (event.val == KM_PRESS && event.keymodifier == 0)