[haiku-development] Re: FallLeaves Screen Saver

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Mon, 24 Feb 2014 18:00:28 -0500

On Wed, Feb 2, 2011 at 11:59 PM, David Rawson Couzelis
<drcouzelis@xxxxxxxxx> wrote:
> I made my first Haiku application. It's a screensaver called "FallLeaves".
>
> I'd like to donate it to Haiku, Inc, so it can be included with the other
> Haiku screensavers. If you think it'd be appropriate to include it with the
> Haiku source code, then I will change the copyright to "Haiku, Inc".
>
> If you think it would be better to NOT include it with the Haiku source
> code, then I'll just post it on Haikuware.
>
> The source code is hosted here for now:
>
> http://dev.osdrawer.net/projects/haiku-api-examples/repository/show/FallLeaves
>
> And if you just want to try it out, the screensaver binary is here:
>
> http://dev.osdrawer.net/projects/haiku-api-examples/repository/raw/FallLeaves/FallLeaves
>
> Please let me know what you think. Thank you!

I remember really enjoying this screen saver when I ran it before.

Unfortunately, this screensaver no longer seems to work on post-PM
Haiku, it can't find it's resources. Is the source code still
available? My guess as to why this screensaver won't load is that it
is looking for its resources in /boot/home/config/add-ons/Screen
Savers/FullLeaves but because of the way PM has changed things that no
longer works, a few other screen savers such as DuckSaver and
SheepSaver (both by Werner Freytag) also fall victim to the same bug.

This is how I fixed the problem in DuckSaver:

https://github.com/jscipione/DuckSaver/commit/a28c1329185e2655e4f8350616ae6edc0f8d8cc0

The magic line there is SetToImage() which allows you to load the
resources without specifying the path. This method has the added
benefit that it work even if your screen saver is installed in
/boot/system/add-ons/Screen Savers/ (or on Dan0 or Zeta in the case of
DuckSaver)

Other related posts: