Module: synfig
Branch: master
Commit: d2ef6450b3b458bf70332adce9503b12d111a18c
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig;a=commit;h=d2ef6450b3b458bf70332adce9503b12d111a18c

Author: Carlos Lopez <[email protected]>
Date:   Wed May 12 18:07:05 2010 +0200

Add needed code to show random splash between two

---

 synfig-studio/src/gtkmm/splash.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/synfig-studio/src/gtkmm/splash.cpp 
b/synfig-studio/src/gtkmm/splash.cpp
index fe87f01..b51500c 100644
--- a/synfig-studio/src/gtkmm/splash.cpp
+++ b/synfig-studio/src/gtkmm/splash.cpp
@@ -78,6 +78,8 @@ using namespace studio;
 #      define IMAGE_EXT        "png"
 #endif
 
+#define NUMBER_OF_SPLASH_SCREEN 2
+
 /* === G L O B A L S ======================================================= */
 
 /* === P R O C E D U R E S ================================================= */
@@ -178,7 +180,10 @@ Splash::Splash():
 
        // Create the splash image
        Gtk::Image* splash_image = manage(new class Gtk::Image());
-       splash_image->set(imagepath+"splash_screen."IMAGE_EXT);
+       srand(time(NULL));
+       const float ran = rand()/float(RAND_MAX);
+       int number =1+int(ran*(NUMBER_OF_SPLASH_SCREEN));
+       
splash_image->set(imagepath+"splash_screen"+strprintf("%d",number)+"."IMAGE_EXT);
        splash_image->set_alignment(0.5,0.5);
        splash_image->set_padding(0,0);
 


------------------------------------------------------------------------------

_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to