added sound option for video
[livewp] / applet / src / livewp-rules.c
index 545147a..7658e6e 100644 (file)
@@ -146,3 +146,23 @@ int get_moon_phase()
     return MOON_NONE;
 
 }
+
+gint 
+fast_rnd(gint max)
+{
+    guint offset = 12923; 
+    guint multiplier = 4079; 
+    static guint seed = 123;
+
+    seed = seed * multiplier + offset;
+    return (gint)(seed % max);
+}
+void 
+get_sun_screen_pos(double alt, double azm, gint * x, gint * y)
+{
+    gint y0 = 365;// - уровень горизонта
+    *x = (int)(azm * 800) - 64;
+    *y = (int)((1 - alt) * y0) - 64;
+    //fprintf(stderr, "sun pos alt=%f azm=%f x=%d y=%d\n", alt, azm, *x, *y);
+}
+