mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Minor stuff.
This commit is contained in:
parent
a971f93daf
commit
d1757b5e8a
4 changed files with 7 additions and 14 deletions
|
|
@ -28,8 +28,7 @@ Message::~Message() {}
|
|||
|
||||
void Message::messageCallback()
|
||||
{
|
||||
MessageListener* const r = recipient;
|
||||
if (r != nullptr)
|
||||
if (MessageListener* const r = recipient)
|
||||
r->handleMessage (*this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ public:
|
|||
|
||||
void messageCallback()
|
||||
{
|
||||
MessageManager* const mm = MessageManager::instance;
|
||||
if (mm != nullptr)
|
||||
if (MessageManager* const mm = MessageManager::instance)
|
||||
mm->quitMessageReceived = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,9 +122,7 @@ private:
|
|||
private:
|
||||
static NSApplicationTerminateReply applicationShouldTerminate (id /*self*/, SEL, NSApplication*)
|
||||
{
|
||||
JUCEApplicationBase* const app = JUCEApplicationBase::getInstance();
|
||||
|
||||
if (app != nullptr)
|
||||
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
|
||||
{
|
||||
app->systemRequestedQuit();
|
||||
|
||||
|
|
@ -142,9 +140,7 @@ private:
|
|||
|
||||
static BOOL application_openFile (id /*self*/, SEL, NSApplication*, NSString* filename)
|
||||
{
|
||||
JUCEApplicationBase* const app = JUCEApplicationBase::getInstance();
|
||||
|
||||
if (app != nullptr)
|
||||
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
|
||||
{
|
||||
app->anotherInstanceStarted (quotedIfContainsSpaces (filename));
|
||||
return YES;
|
||||
|
|
@ -155,9 +151,7 @@ private:
|
|||
|
||||
static void application_openFiles (id /*self*/, SEL, NSApplication*, NSArray* filenames)
|
||||
{
|
||||
JUCEApplicationBase* const app = JUCEApplicationBase::getInstance();
|
||||
|
||||
if (app != nullptr)
|
||||
if (JUCEApplicationBase* const app = JUCEApplicationBase::getInstance())
|
||||
{
|
||||
StringArray files;
|
||||
for (unsigned int i = 0; i < [filenames count]; ++i)
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ public:
|
|||
bool renderFrame()
|
||||
{
|
||||
ScopedPointer<MessageManagerLock> mmLock;
|
||||
|
||||
if (context.renderComponents && needsUpdate)
|
||||
{
|
||||
mmLock = new MessageManagerLock (this); // need to acquire this before locking the context.
|
||||
|
|
@ -332,7 +333,7 @@ public:
|
|||
const int defaultFPS = 60;
|
||||
|
||||
const int elapsed = (int) (Time::getMillisecondCounter() - frameRenderStartTime);
|
||||
wait (jmax (1, (1000 / defaultFPS) - elapsed));
|
||||
wait (jmax (1, (1000 / defaultFPS - 1) - elapsed));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue