debugging and prepapred for mameo
authorVlad <vlad@gas.by>
Tue, 17 Aug 2010 10:37:48 +0000 (13:37 +0300)
committerVlad <vlad@gas.by>
Tue, 17 Aug 2010 10:37:48 +0000 (13:37 +0300)
sherman-aquarium/shermans/background.c
sherman-aquarium/shermans/fish.c
sherman-aquarium/shermans/screensaver.c

index 9285838..24656a5 100644 (file)
@@ -168,6 +168,7 @@ void background_init(void)
 {
     ad = aquarium_get_settings_ptr();
 
 {
     ad = aquarium_get_settings_ptr();
 
+    
     if(background_settings.desktop){
        background_prepare_desktop();
        return;
     if(background_settings.desktop){
        background_prepare_desktop();
        return;
index 3122c01..c935ab6 100644 (file)
@@ -649,7 +649,9 @@ void fish_update(void)
 
        if(fishes[i].is_dead == TRUE){
 
 
        if(fishes[i].is_dead == TRUE){
 
+               fprintf(stderr,"ddddddddddddddddd33333333\n");
            if(fish_settings.rebirth){
            if(fish_settings.rebirth){
+               fprintf(stderr,"ddddddddddddddddd\n");
                if(g_rand_int_range(ad->rnd, 0, 100) < 20){
                    //              printf("Rebirth and salvation..\n");
                    /* Salvation and rebirth...*/
                if(g_rand_int_range(ad->rnd, 0, 100) < 20){
                    //              printf("Rebirth and salvation..\n");
                    /* Salvation and rebirth...*/
index fbab9df..8f1f57f 100644 (file)
@@ -118,6 +118,7 @@ typedef struct {
 #define ARG_COMICS 52
 #define ARG_COMICS_DIR 53
 #define ARG_COMICS_DELAY 54
 #define ARG_COMICS 52
 #define ARG_COMICS_DIR 53
 #define ARG_COMICS_DELAY 54
+#define ARG_VIEW 55
 
 #define DEPTH 24
 
 
 #define DEPTH 24
 
@@ -132,7 +133,8 @@ static GdkGC *gc;
 static SDL_Surface *screen=NULL, *screen_image, *background, **thisfish;
 static SDL_Rect *fish_dest, *fish_src, *clean_dest;
 static int curr_dest, clean_count,  no_sdl_quit = 0, comics_delay = 50;
 static SDL_Surface *screen=NULL, *screen_image, *background, **thisfish;
 static SDL_Rect *fish_dest, *fish_src, *clean_dest;
 static int curr_dest, clean_count,  no_sdl_quit = 0, comics_delay = 50;
-int window_id = -1, fullscreen = 0;
+int window_id = -1, fullscreen = 1;
+int view = 1;
 static unsigned char *original_bg;
 static AquariumData ad;
 
 static unsigned char *original_bg;
 static AquariumData ad;
 
@@ -507,7 +509,7 @@ void screensaver_init()
     int sdl_flags = SDL_DOUBLEBUF|SDL_HWSURFACE|SDL_ANYFORMAT;
 
     screen_height = 480;
     int sdl_flags = SDL_DOUBLEBUF|SDL_HWSURFACE|SDL_ANYFORMAT;
 
     screen_height = 480;
-    screen_width = 640;
+    screen_width = 800;
     
     if(window_id != -1){
        display = XOpenDisplay(NULL);
     
     if(window_id != -1){
        display = XOpenDisplay(NULL);
@@ -598,12 +600,12 @@ void screensaver_init_param(int argc, char **argv)
 
     Sound_settings *s, sound_settings = {0,TYPE_MP3, NULL};
     Bubble_settings *bub, bubble_settings = {20};
 
     Sound_settings *s, sound_settings = {0,TYPE_MP3, NULL};
     Bubble_settings *bub, bubble_settings = {20};
-    Bottom_settings *b, bottom_settings = {0,5,1,75,2};
-    Background_settings *bg, background_settings = {NULL,NULL, 0,1, 
+    Bottom_settings *b, bottom_settings = {1,5,1,75,3};
+    Background_settings *bg, background_settings = {NULL,NULL, 2,0, 
                                                    (GaiColor){0, 100, 150, 0},
                                                    (GaiColor){10,120, 250, 0},
                                                    (GaiColor){0,0,0,0}};
                                                    (GaiColor){0, 100, 150, 0},
                                                    (GaiColor){10,120, 250, 0},
                                                    (GaiColor){0,0,0,0}};
-    Fish_settings *f, fish_settings = {0, 0, 75, 0, 100, 0, 15, 0, 75, 75,
+    Fish_settings *f, fish_settings = {1, 1, 75, 0, 100, 1, 15, 0, 75, 75,
                                       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
     struct option cmdline_options[] = {
        {"sound", no_argument, NULL, ARG_SOUND},
                                       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
     struct option cmdline_options[] = {
        {"sound", no_argument, NULL, ARG_SOUND},
@@ -672,6 +674,7 @@ void screensaver_init_param(int argc, char **argv)
        {"root", no_argument, NULL, ARG_FULLSCREEN},
        {"bubble", required_argument, NULL, ARG_BUBBLE},
        {"desktop", no_argument, NULL, ARG_DESKTOP},
        {"root", no_argument, NULL, ARG_FULLSCREEN},
        {"bubble", required_argument, NULL, ARG_BUBBLE},
        {"desktop", no_argument, NULL, ARG_DESKTOP},
+       {"view", required_argument, NULL, ARG_VIEW},
        {0,0,0,0}};
 
 
        {0,0,0,0}};
 
 
@@ -686,6 +689,7 @@ void screensaver_init_param(int argc, char **argv)
     memcpy(b,&bottom_settings, sizeof(Bottom_settings));
     memcpy(bub, &bubble_settings, sizeof(Bubble_settings));
     memcpy(s, &sound_settings, sizeof(Sound_settings));
     memcpy(b,&bottom_settings, sizeof(Bottom_settings));
     memcpy(bub, &bubble_settings, sizeof(Bubble_settings));
     memcpy(s, &sound_settings, sizeof(Sound_settings));
+fprintf(stderr, "1BG %i\n",bg->desktop);
 
     while ((c =
            getopt_long_only(argc, argv, "", cmdline_options, NULL)) != -1){
 
     while ((c =
            getopt_long_only(argc, argv, "", cmdline_options, NULL)) != -1){
@@ -837,7 +841,7 @@ void screensaver_init_param(int argc, char **argv)
            s->prg = g_strdup_printf(optarg);
            break;
        case ARG_WINDOW_ID:
            s->prg = g_strdup_printf(optarg);
            break;
        case ARG_WINDOW_ID:
-           window_id = htoi(optarg);
+           window_id = atoi(optarg);
            break;
        case ARG_FULLSCREEN:
            fullscreen = 1;
            break;
        case ARG_FULLSCREEN:
            fullscreen = 1;
@@ -845,6 +849,9 @@ void screensaver_init_param(int argc, char **argv)
        case ARG_BUBBLE:
            bub->max_bubbles = atoi(optarg);
            break;
        case ARG_BUBBLE:
            bub->max_bubbles = atoi(optarg);
            break;
+       case ARG_VIEW:
+           view = atoi(optarg);
+           break;
        case ARG_DESKTOP:
            bg->type = 0;
            bg->desktop = 1;
        case ARG_DESKTOP:
            bg->type = 0;
            bg->desktop = 1;
@@ -909,10 +916,14 @@ int main(int argc, char **argv)
     screensaver_init_param(argc, argv);
     screensaver_init(0);
 
     screensaver_init_param(argc, argv);
     screensaver_init(0);
 
-    if(window_id==-1)
+    if(window_id==-1){
+       fprintf(stderr, "screensaver_main_sdl\n");
        screensaver_main_sdl();
        screensaver_main_sdl();
-    else
+    }
+    else{
+        fprintf(stderr, "screensaver_main_GDK\n");
        screensaver_main_gdk();
        screensaver_main_gdk();
+    }
     return 0;
 }
 
     return 0;
 }