Skip to content

Commit

Permalink
Nebula: Style fixes
Browse files Browse the repository at this point in the history
80 char limit
add/update some pragmas
  • Loading branch information
jscipione committed Apr 13, 2016
1 parent ebfc2fc commit a6ab338
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/add-ons/screen_savers/nebula/Nebula.cpp
Expand Up @@ -191,8 +191,8 @@ drawshdisk(int x0, int y0, int r)
(because if x<0, then (unsigned)(x) = 2**32-|x| which is
BIG and thus >H )
This is clearly a stupid, unmaintanable, unreadable "optimization".
But i like it :)
This is clearly a stupid, unmaintanable, unreadable
"optimization". But i like it :)
*/
if ((uint32)(y0 - y - 1) < gHeight - 3)
memshset(&gBuffer8[x0 + gWidth * (y0 - y + 1)], c, d, x);
Expand Down Expand Up @@ -302,7 +302,8 @@ setPalette()
case 0: // yellow
default:
for (i = 0; i < 30; i++)
gPalette[i] = (uint8)(i * 8 / 10) << 16 | (uint8)(i * 6 / 10) << 8;
gPalette[i] = (uint8)(i * 8 / 10) << 16
| (uint8)(i * 6 / 10) << 8;
// | (uint8)(i*3/10);

for (i = 30; i < 256; i++) {
Expand Down Expand Up @@ -412,15 +413,14 @@ setPalette()
}


/***********************************************************************************/
// #pragma mark -
// #pragma mark SimpleSlider
// #pragma mark - SimpleSlider


class SimpleSlider : public BSlider {
public:
SimpleSlider(const char* label, BMessage* message)
:
BSlider(B_EMPTY_STRING, B_EMPTY_STRING, message, 1, 100, B_HORIZONTAL)
:
BSlider(B_EMPTY_STRING, B_EMPTY_STRING, message, 1, 100, B_HORIZONTAL)
{
SetLimitLabels("1", "100");
SetHashMarks(B_HASH_MARKS_BOTTOM);
Expand All @@ -440,8 +440,7 @@ class SimpleSlider : public BSlider {
};


/***********************************************************************************/
// #pragma mark -
// #pragma mark - SettingsView


class SettingsView : public BView {
Expand Down Expand Up @@ -555,7 +554,8 @@ SettingsView::SettingsView(BRect frame)
B_TRANSLATE("Enable motion blur"), new BMessage(kMsgMotionBlur));
fMotionCheck->SetValue((int)gMotionBlur);

fSpeedSlider = new SimpleSlider(B_TRANSLATE("Speed"), new BMessage(kMsgSpeed));
fSpeedSlider = new SimpleSlider(B_TRANSLATE("Speed"),
new BMessage(kMsgSpeed));
fSpeedSlider->SetValue((gSpeed - 0.002) / 0.05);

fFramesSlider = new SimpleSlider(B_TRANSLATE("Maximum Frames Per Second"),
Expand Down Expand Up @@ -642,15 +642,15 @@ SettingsView::MessageReceived(BMessage* message)

case kMsgFrames:
gMaxFramesPerSecond = fFramesSlider->Value();
gScreenSaver->SetTickSize((bigtime_t)(1000000LL / gMaxFramesPerSecond));
gScreenSaver->SetTickSize(
(bigtime_t)(1000000LL / gMaxFramesPerSecond));
break;
}
}



/***********************************************************************************/
// #pragma mark -
// #pragma mark - Nebula


class Nebula : public BScreenSaver {
Expand Down Expand Up @@ -811,7 +811,8 @@ Nebula::Draw(BView* view, int32)
if (fStarted) {
view->SetHighColor(0, 0, 0, 0);
view->FillRect(view->Frame());
view->MovePenTo(0, (view->Bounds().Height() / fFactor - 1 - gHeight) / 2);
view->MovePenTo(0,
(view->Bounds().Height() / fFactor - 1 - gHeight) / 2);

fStarted = false;
}
Expand All @@ -826,8 +827,7 @@ Nebula::Draw(BView* view, int32)
}


/***********************************************************************************/
// #pragma mark -
// #pragma mark - instantiate_screen_saver


extern "C" _EXPORT BScreenSaver*
Expand Down

0 comments on commit a6ab338

Please sign in to comment.