Nebula: Style fixes
80 char limit add/update some pragmas
This commit is contained in:
parent
ebfc2fc68e
commit
a6ab3387c7
|
@ -191,8 +191,8 @@ drawshdisk(int x0, int y0, int r)
|
||||||
(because if x<0, then (unsigned)(x) = 2**32-|x| which is
|
(because if x<0, then (unsigned)(x) = 2**32-|x| which is
|
||||||
BIG and thus >H )
|
BIG and thus >H )
|
||||||
|
|
||||||
This is clearly a stupid, unmaintanable, unreadable "optimization".
|
This is clearly a stupid, unmaintanable, unreadable
|
||||||
But i like it :)
|
"optimization". But i like it :)
|
||||||
*/
|
*/
|
||||||
if ((uint32)(y0 - y - 1) < gHeight - 3)
|
if ((uint32)(y0 - y - 1) < gHeight - 3)
|
||||||
memshset(&gBuffer8[x0 + gWidth * (y0 - y + 1)], c, d, x);
|
memshset(&gBuffer8[x0 + gWidth * (y0 - y + 1)], c, d, x);
|
||||||
|
@ -302,7 +302,8 @@ setPalette()
|
||||||
case 0: // yellow
|
case 0: // yellow
|
||||||
default:
|
default:
|
||||||
for (i = 0; i < 30; i++)
|
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);
|
// | (uint8)(i*3/10);
|
||||||
|
|
||||||
for (i = 30; i < 256; i++) {
|
for (i = 30; i < 256; i++) {
|
||||||
|
@ -412,15 +413,14 @@ setPalette()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************************/
|
// #pragma mark - SimpleSlider
|
||||||
// #pragma mark -
|
|
||||||
// #pragma mark SimpleSlider
|
|
||||||
|
|
||||||
class SimpleSlider : public BSlider {
|
class SimpleSlider : public BSlider {
|
||||||
public:
|
public:
|
||||||
SimpleSlider(const char* label, BMessage* message)
|
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");
|
SetLimitLabels("1", "100");
|
||||||
SetHashMarks(B_HASH_MARKS_BOTTOM);
|
SetHashMarks(B_HASH_MARKS_BOTTOM);
|
||||||
|
@ -440,8 +440,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************************/
|
// #pragma mark - SettingsView
|
||||||
// #pragma mark -
|
|
||||||
|
|
||||||
|
|
||||||
class SettingsView : public BView {
|
class SettingsView : public BView {
|
||||||
|
@ -555,7 +554,8 @@ SettingsView::SettingsView(BRect frame)
|
||||||
B_TRANSLATE("Enable motion blur"), new BMessage(kMsgMotionBlur));
|
B_TRANSLATE("Enable motion blur"), new BMessage(kMsgMotionBlur));
|
||||||
fMotionCheck->SetValue((int)gMotionBlur);
|
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);
|
fSpeedSlider->SetValue((gSpeed - 0.002) / 0.05);
|
||||||
|
|
||||||
fFramesSlider = new SimpleSlider(B_TRANSLATE("Maximum Frames Per Second"),
|
fFramesSlider = new SimpleSlider(B_TRANSLATE("Maximum Frames Per Second"),
|
||||||
|
@ -642,15 +642,15 @@ SettingsView::MessageReceived(BMessage* message)
|
||||||
|
|
||||||
case kMsgFrames:
|
case kMsgFrames:
|
||||||
gMaxFramesPerSecond = fFramesSlider->Value();
|
gMaxFramesPerSecond = fFramesSlider->Value();
|
||||||
gScreenSaver->SetTickSize((bigtime_t)(1000000LL / gMaxFramesPerSecond));
|
gScreenSaver->SetTickSize(
|
||||||
|
(bigtime_t)(1000000LL / gMaxFramesPerSecond));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************************/
|
// #pragma mark - Nebula
|
||||||
// #pragma mark -
|
|
||||||
|
|
||||||
|
|
||||||
class Nebula : public BScreenSaver {
|
class Nebula : public BScreenSaver {
|
||||||
|
@ -811,7 +811,8 @@ Nebula::Draw(BView* view, int32)
|
||||||
if (fStarted) {
|
if (fStarted) {
|
||||||
view->SetHighColor(0, 0, 0, 0);
|
view->SetHighColor(0, 0, 0, 0);
|
||||||
view->FillRect(view->Frame());
|
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;
|
fStarted = false;
|
||||||
}
|
}
|
||||||
|
@ -826,8 +827,7 @@ Nebula::Draw(BView* view, int32)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************************/
|
// #pragma mark - instantiate_screen_saver
|
||||||
// #pragma mark -
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" _EXPORT BScreenSaver*
|
extern "C" _EXPORT BScreenSaver*
|
||||||
|
|
Loading…
Reference in New Issue