diff --git a/checkin_notes b/checkin_notes index 232e08bb07..6418ed2ea0 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8670,3 +8670,9 @@ David 24 Nov 2011 ssim/ ssim.cpp des.h + +David 24 Nov 2011 + - default screensaver: fix divide-by-zero; code cleanup + + clientsrc/ + ss_app.cpp diff --git a/clientscr/ss_app.cpp b/clientscr/ss_app.cpp index 70d4a0aa05..8bdf6218f2 100644 --- a/clientscr/ss_app.cpp +++ b/clientscr/ss_app.cpp @@ -70,18 +70,15 @@ double next_connect_time = 0.0; CC_STATE cc_state; CC_STATUS cc_status; -// Possible values of iBrandId: -#define BOINC_BRAND_ID 0 -#define GRIDREPUBLIC_BRAND_ID 1 -#define PROGRESSTHRUPROCESSORS_BRAND_ID 2 -#define CHARITYENGINE_BRAND_ID 3 - #ifdef _GRIDREPUBLIC -static long iBrandId = GRIDREPUBLIC_BRAND_ID; +const char* brand_name = "GridRepublic"; +const char* logo_file = "gridrepublic_ss_logo.jpg"; #elif defined(_CHARITYENGINE) -static long iBrandId = CHARITYENGINE_BRAND_ID; +const char* brand_name = "Charity Engine"; +const char* logo_file = "CE_ss_logo.jpg" #else -static long iBrandId = BOINC_BRAND_ID; // Default value for BOINC +const char* brand_name = "BOINC"; +const char* logo_file = "boinc_logo_black.jpg"; #endif #if 0 @@ -235,32 +232,19 @@ void show_project(unsigned int index, float alpha) { void show_disconnected() { float x=.3, y=.3; - if (iBrandId == GRIDREPUBLIC_BRAND_ID) { - txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "GridRepublic is not running."); - } else if (iBrandId == CHARITYENGINE_BRAND_ID) { - txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "Charity Engine is not running."); - } else { - txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "BOINC is not running."); - } + char buf[256]; + sprintf(buf, "%s is not running.", brand_name); + txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, buf); } void show_no_projects() { float x=.2, y=.3; - if (iBrandId == GRIDREPUBLIC_BRAND_ID) { - txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "GridRepublic is not attached to any projects."); - } else if (iBrandId == CHARITYENGINE_BRAND_ID) { - txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "Charity Engine is not attached to any projects."); - } else { - txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "BOINC is not attached to any projects."); - } + char buf[256]; + sprintf(buf, "%s is not attached to any projects.", brand_name); + txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, buf); y = .25; - if (iBrandId == GRIDREPUBLIC_BRAND_ID) { - txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "Attach to projects using the GridRepublic Desktop."); - } else if (iBrandId == CHARITYENGINE_BRAND_ID) { - txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "Attach to projects using the Charity Engine Desktop."); - } else { - txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, "Attach to projects using the BOINC Manager."); - } + sprintf(buf, "Attach to projects using %s.", brand_name); + txf_render_string(.1, x, y, 0, ALERT_SIZE, white, 0, buf); } #define MAX_JOBS_DISPLAY 4 @@ -272,6 +256,7 @@ void show_jobs(unsigned int index, double alpha) { unsigned int nfound = 0; unsigned int i; cc_status.task_suspend_reason &= ~SUSPEND_REASON_CPU_THROTTLE; + char buf[256]; if (!cc_status.task_suspend_reason) { for (i=0; i