Skip to content

Commit

Permalink
Invert View Colors
Browse files Browse the repository at this point in the history
  • Loading branch information
rossetantoine committed Feb 7, 2014
1 parent 49217e4 commit f8fa6f5
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions DCMView.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
static double deg2rad = M_PI / 180.0;
static unsigned char *PETredTable = nil, *PETgreenTable = nil, *PETblueTable = nil;
static BOOL NOINTERPOLATION = NO, SOFTWAREINTERPOLATION = NO, IndependentCRWLWW, pluginOverridesMouse = NO; // Allows plugins to override mouse click actions.
BOOL FULL32BITPIPELINE = NO, gDontListenToSyncMessage = NO;
BOOL FULL32BITPIPELINE = NO, gDontListenToSyncMessage = NO, gInvertView;
BOOL OVERFLOWLINES = NO;
int CLUTBARS, MAXNUMBEROF32BITVIEWERS = 4, SOFTWAREINTERPOLATION_MAX, DISPLAYCROSSREFERENCELINES = YES;
static BOOL gClickCountSet = NO, avoidSetWLWWRentry = NO;
Expand Down Expand Up @@ -650,6 +650,7 @@ +(void) setDefaults

IndependentCRWLWW = [[NSUserDefaults standardUserDefaults] boolForKey:@"IndependentCRWLWW"];
CLUTBARS = [[NSUserDefaults standardUserDefaults] integerForKey: @"CLUTBARS"];
gInvertView = [[NSUserDefaults standardUserDefaults] boolForKey: @"InvertViewsColors"];

// int previousANNOTATIONS = ANNOTATIONS;
// ANNOTATIONS = [[NSUserDefaults standardUserDefaults] integerForKey: @"ANNOTATIONS"];
Expand Down Expand Up @@ -7547,6 +7548,7 @@ - (void) drawRectIn:(NSRect) size :(GLuint *) texture :(NSPoint) offset :(long)
}

glDisable (TEXTRECTMODE); // done with texturing

}

- (NSPoint) positionWithoutRotation: (NSPoint) tPt
Expand Down Expand Up @@ -9914,6 +9916,7 @@ - (void) drawRect:(NSRect)aRect withContext:(NSOpenGLContext *)ctx

glPopAttrib();


// glColor4f ( 0, 0, 0 , 0.8);
// glLineWidth( 3 * sf);
//
Expand Down Expand Up @@ -9955,8 +9958,19 @@ - (void) drawRect:(NSRect)aRect withContext:(NSOpenGLContext *)ctx
#endif

[self drawRectAnyway:aRect];

if( gInvertView)
{
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
glEnable(GL_BLEND);
glRectf( -1.0f, -1.0f, 1.0f, 1.0f );
glDisable(GL_BLEND);
}
}
@catch (NSException * e)
@catch (NSException * e)
{
N2LogExceptionWithStackTrace(e);
}
Expand Down

0 comments on commit f8fa6f5

Please sign in to comment.