mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Made a lot of ScopedPointer usage conform to the std::unique_ptr interface
This commit is contained in:
parent
2d9fc46b4e
commit
4229dc0a4f
99 changed files with 6809 additions and 498 deletions
|
|
@ -85,7 +85,7 @@ struct BackgroundLogo : public AnimatedContent
|
|||
)blahblah";
|
||||
|
||||
ScopedPointer<XmlElement> svg (XmlDocument::parse (logoData));
|
||||
logo = Drawable::createFromSVG (*svg);
|
||||
logo.reset (Drawable::createFromSVG (*svg));
|
||||
}
|
||||
|
||||
String getName() const override { return "Background Image"; }
|
||||
|
|
@ -205,18 +205,18 @@ struct FlockDemo : public BackgroundLogo
|
|||
{
|
||||
Bird()
|
||||
{
|
||||
Random rng;
|
||||
pos.x = rng.nextFloat() * 10.0f - 5.0f;
|
||||
pos.y = rng.nextFloat() * 10.0f - 5.0f;
|
||||
velocity.x = rng.nextFloat() * 0.001f;
|
||||
velocity.y = rng.nextFloat() * 0.001f;
|
||||
Random randGen;
|
||||
pos.x = randGen.nextFloat() * 10.0f - 5.0f;
|
||||
pos.y = randGen.nextFloat() * 10.0f - 5.0f;
|
||||
velocity.x = randGen.nextFloat() * 0.001f;
|
||||
velocity.y = randGen.nextFloat() * 0.001f;
|
||||
|
||||
colour = Colour::fromHSV (rng.nextFloat(), 0.2f, 0.9f, rng.nextFloat() * 0.4f + 0.2f);
|
||||
colour = Colour::fromHSV (randGen.nextFloat(), 0.2f, 0.9f, randGen.nextFloat() * 0.4f + 0.2f);
|
||||
|
||||
shape.addTriangle (0.0f, 0.0f, -0.3f, 1.0f, 0.3f, 1.0f);
|
||||
shape = shape.createPathWithRoundedCorners (0.2f);
|
||||
|
||||
shape.applyTransform (AffineTransform::scale (rng.nextFloat() + 1.0f));
|
||||
shape.applyTransform (AffineTransform::scale (randGen.nextFloat() + 1.0f));
|
||||
}
|
||||
|
||||
Point<float> pos, velocity, acc;
|
||||
|
|
@ -410,8 +410,8 @@ struct FlockWithText : public FlockDemo
|
|||
as.append (text, Font (textSize * scale), Colour (0x80ffffff).withMultipliedAlpha (alpha));
|
||||
|
||||
as.setJustification (Justification::centred);
|
||||
auto centre = canvas.clients[clientIndex % canvas.clients.size()].centre * scale;
|
||||
as.draw (g, Rectangle<float> (textBlockWidth * scale, textBlockWidth * scale).withCentre (centre));
|
||||
auto middle = canvas.clients[clientIndex % canvas.clients.size()].centre * scale;
|
||||
as.draw (g, Rectangle<float> (textBlockWidth * scale, textBlockWidth * scale).withCentre (middle));
|
||||
}
|
||||
|
||||
void tick()
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ struct MasterContentComponent : public Component,
|
|||
createAllDemos (demos);
|
||||
setContent (0);
|
||||
|
||||
setSize (15.0f * currentCanvas.getLimits().getWidth(),
|
||||
15.0f * currentCanvas.getLimits().getHeight());
|
||||
setSize ((int) (15.0f * currentCanvas.getLimits().getWidth()),
|
||||
(int) (15.0f * currentCanvas.getLimits().getHeight()));
|
||||
|
||||
if (! OSCSender::connect (getBroadcastIPAddress(), masterPortNumber))
|
||||
error = "Master app OSC sender: network connection error.";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue