*** empty log message ***

svn path=/trunk/boinc/; revision=5929
This commit is contained in:
Charlie Fenton 2005-04-25 11:09:40 +00:00
parent 8a9cbc2a74
commit 62ef1e8107
6 changed files with 45 additions and 18 deletions

View File

@ -137,7 +137,7 @@ bool get_viewport(int view[4]) {
void get_2d_positions(double x, double y, double z,
double model[16], double proj[16], int viewport[4], double proj_pos[3]
) {
gluProject(x, y, z,model,proj,viewport,&proj_pos[0],&proj_pos[1],&proj_pos[2]);
gluProject(x, y, z,model,proj,(GLint*)viewport,&proj_pos[0],&proj_pos[1],&proj_pos[2]);
}
void mode_lines() {

View File

@ -33,12 +33,16 @@ void BringAppToFront(void);
// and kCGScreenSaverWindowLevel
#define RealSaverLevel 2002
// Delay when switching to screensaver mode to reduce annoying flashes
#define SAVERDELAY 30
void MacGLUTFix(bool isScreenSaver) {
static NSMenu * emptyMenu;
NSOpenGLContext * myContext = nil;
NSView *myView = nil;
NSWindow* myWindow = nil;
int newWindowLevel;
static int stabilizationDelay = 0;
if (! boinc_is_standalone()) {
if (emptyMenu == nil) {
@ -62,7 +66,14 @@ void MacGLUTFix(bool isScreenSaver) {
newWindowLevel = isScreenSaver ? RealSaverLevel+20 : NSNormalWindowLevel;
if ([ myWindow level ] == newWindowLevel)
{
stabilizationDelay = 0;
return;
}
if (++stabilizationDelay < SAVERDELAY)
return;
[ myWindow setLevel:newWindowLevel ];
}

View File

@ -118,22 +118,22 @@ void mouse_click_move(int x, int y){
static void maybe_render() {
int width, height;
#ifdef __APPLE__
switch (current_graphics_mode) {
case MODE_WINDOW:
MacGLUTFix(false);
break;
case MODE_FULLSCREEN:
case MODE_BLANKSCREEN:
MacGLUTFix(true);
break;
}
#endif
if (visible && (current_graphics_mode != MODE_HIDE_GRAPHICS)) {
width = glutGet(GLUT_WINDOW_WIDTH);
height = glutGet(GLUT_WINDOW_HEIGHT);
if (throttled_app_render(width, height, dtime())) {
glutSwapBuffers();
#ifdef __APPLE__
switch (current_graphics_mode) {
case MODE_WINDOW:
MacGLUTFix(false);
break;
case MODE_FULLSCREEN:
case MODE_BLANKSCREEN:
MacGLUTFix(true);
break;
}
#endif
}
}
}

View File

@ -27629,3 +27629,16 @@ Charlie 24 April 2005
mac/
mac_saver_module.cpp
Mac_Saver_ModuleView.m
Charlie 25 April 2005
Mac: screensaver tweaks: banners scroll faster & smoother,
reduce annoying flashes when screensaver graphics are starting.
gutil.C - fix compiler warning.
api/
macglutfix.m
x_opengl.C
gutil.C
clientgui/
mac/
mac_saver_module.cpp

View File

@ -71,6 +71,7 @@ void strip_cr(char *buf);
#endif
#define BANNER_GAP 30 /* Space between repeats of banner text */
#define BANNERDELTA 2 /* Number of pixels to move banner each frame */
enum SaverState {
SaverState_Idle,
@ -288,7 +289,7 @@ int drawGraphics(GrafPtr aPort) {
SetPort(aPort);
drawBanner(aPort);
SetGWorld(savePort, saveGDH);
newFrequency = 45;
newFrequency = 100;
} else
newFrequency = 4;
@ -429,6 +430,8 @@ void setBannerText(ConstStringPtr msg, GrafPtr aPort) {
TextSize(24);
TextFace(bold);
bannerWidth = StringWidth(bannerText) + BANNER_GAP;
// Round up bannerWidth to an integral multiple of BANNERDELTA
bannerWidth = ((bannerWidth + BANNERDELTA - 1) / BANNERDELTA) * BANNERDELTA;
SetPort(savePort);
}
@ -451,10 +454,10 @@ void drawBanner(GrafPtr aPort) {
ForeColor(whiteColor);
BackColor(blackColor);
GetPortBounds(aPort, &wRect);
if ( (bannerPos + bannerWidth) < wRect.left)
if ( (bannerPos + bannerWidth) <= wRect.left)
bannerPos = wRect.left;
else
bannerPos -= 1;
bannerPos -= BANNERDELTA;
x = bannerPos;
y = (wRect.bottom - wRect.top) / 3 + wRect.top;

View File

@ -2106,9 +2106,9 @@
isa = PBXFileReference;
lastKnownFileType = wrapper.nib;
name = BOINCSaver.nib;
path = /Volumes/Moon/BOINC_Mac/boinc/clientgui/mac/BOINCSaver.nib;
refType = 0;
sourceTree = "<absolute>";
path = ../clientgui/mac/BOINCSaver.nib;
refType = 2;
sourceTree = SOURCE_ROOT;
};
DD48091F081A66F100A174AA = {
fileRef = DD48091E081A66F100A174AA;